From c2a4cba7d1e16e4a4bc1b52268e4e26655499446 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Wed, 14 Oct 2020 18:27:47 +0200 Subject: [PATCH 01/14] Add Go contract bindings Added a Makefile allowing to generate Go bindings of given contracts. --- .gitignore | 1 + bindings/go/Makefile | 49 + bindings/go/cmd/.keep | 0 bindings/go/cmd/Deposit.go | 1125 +++++++++ bindings/go/cmd/DepositLog.go | 445 ++++ bindings/go/contract/.keep | 0 bindings/go/contract/Deposit.go | 3791 ++++++++++++++++++++++++++++ bindings/go/contract/DepositLog.go | 3519 ++++++++++++++++++++++++++ bindings/go/gen.go | 3 + bindings/go/generate.sh | 9 + bindings/go/go.mod | 11 + bindings/go/go.sum | 1068 ++++++++ 12 files changed, 10021 insertions(+) create mode 100644 bindings/go/Makefile create mode 100644 bindings/go/cmd/.keep create mode 100644 bindings/go/cmd/Deposit.go create mode 100644 bindings/go/cmd/DepositLog.go create mode 100644 bindings/go/contract/.keep create mode 100644 bindings/go/contract/Deposit.go create mode 100644 bindings/go/contract/DepositLog.go create mode 100644 bindings/go/gen.go create mode 100755 bindings/go/generate.sh create mode 100644 bindings/go/go.mod create mode 100644 bindings/go/go.sum diff --git a/.gitignore b/.gitignore index b375da5d0..648569794 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ __pycache__/ node_modules/ artifacts/ .mypy_cache +bindings/go/abi # Visual Studio Code *.code-workspace diff --git a/bindings/go/Makefile b/bindings/go/Makefile new file mode 100644 index 000000000..62f6c10ea --- /dev/null +++ b/bindings/go/Makefile @@ -0,0 +1,49 @@ +solidity_dir=$(realpath ${SOLIDITY_DIR}) +solidity_files := $(foreach file,${SOLIDITY_FILES},$(file)) + +# Solidity filenames without .sol with subdirectories prefixes. +contract_stems := $(basename $(solidity_files)) + +abi_files := $(addprefix abi/,$(addsuffix .abi,$(contract_stems))) +abigen_files := $(addprefix abi/,$(addsuffix .go,$(contract_stems))) +contract_files := $(addprefix contract/,$(addsuffix .go,$(contract_stems))) + +all: gen_contract_go gen_abi_go + +clean: + rm -r abi/* + rm -r contract/* + mkdir tmp && mv cmd/cmd*.go tmp + rm -r cmd/* + mv tmp/* cmd && rm -r tmp + +gen_abi_go: $(abigen_files) + +gen_contract_go: $(contract_files) + +abi/%.abi: ${solidity_dir}/contracts/%.sol + $(eval output=$(dir $@)) + mkdir -p $(output) + solc openzeppelin-solidity/=${solidity_dir}/node_modules/openzeppelin-solidity/ \ + @summa-tx/bitcoin-spv-sol/=${solidity_dir}/node_modules/@summa-tx/bitcoin-spv-sol/ \ + @keep-network/keep-ecdsa/=${solidity_dir}/node_modules/@keep-network/keep-ecdsa/ \ + @summa-tx/relay-sol=${solidity_dir}/node_modules/@summa-tx/relay-sol/ \ + --allow-paths ${solidity_dir} \ + --overwrite \ + --abi \ + -o $(output) $< + +abi/%.go: abi/%.abi + $(eval type=$(notdir $*)) + go run github.com/ethereum/go-ethereum/cmd/abigen --abi $< --pkg abi --type $(type) --out $@ + +contract/DepositLog.go cmd/DepositLog.go: abi/DepositLog.abi abi/DepositLog.go *.go + go run github.com/keep-network/keep-common/tools/generators/ethereum $< contract/DepositLog.go cmd/DepositLog.go + +contract/deposit/Deposit.go cmd/deposit/Deposit.go: abi/deposit/Deposit.abi abi/deposit/Deposit.go *.go + go run github.com/keep-network/keep-common/tools/generators/ethereum $< contract/Deposit.go cmd/Deposit.go + + + + + diff --git a/bindings/go/cmd/.keep b/bindings/go/cmd/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/bindings/go/cmd/Deposit.go b/bindings/go/cmd/Deposit.go new file mode 100644 index 000000000..55dad0212 --- /dev/null +++ b/bindings/go/cmd/Deposit.go @@ -0,0 +1,1125 @@ +// Code generated - DO NOT EDIT. +// This file is a generated command and any manual changes will be lost. + +package cmd + +import ( + "fmt" + "math/big" + "sync" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + + "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" + "github.com/keep-network/keep-common/pkg/cmd" + "github.com/keep-network/keep-core/config" + "github.com/keep-network/tbtc/contract" + + "github.com/urfave/cli" +) + +var DepositCommand cli.Command + +var depositDescription = `The deposit command allows calling the Deposit 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. + + All subcommands can be used to investigate the result of a previous + transaction that called that same method by passing the -t/--transaction + flag with the transaction hash. + + 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() { + AvailableCommands = append(AvailableCommands, cli.Command{ + Name: "deposit", + Usage: `Provides access to the Deposit contract.`, + Description: depositDescription, + Subcommands: []cli.Command{{ + Name: "funding-info", + Usage: "Calls the constant method fundingInfo on the Deposit contract.", + ArgsUsage: "", + Action: dFundingInfo, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "get-redemption-tbtc-requirement", + Usage: "Calls the constant method getRedemptionTbtcRequirement on the Deposit contract.", + ArgsUsage: "[_redeemer] ", + Action: dGetRedemptionTbtcRequirement, + Before: cmd.ArgCountChecker(1), + Flags: cmd.ConstFlags, + }, { + Name: "undercollateralized-threshold-percent", + Usage: "Calls the constant method undercollateralizedThresholdPercent on the Deposit contract.", + ArgsUsage: "", + Action: dUndercollateralizedThresholdPercent, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "utxo-value", + Usage: "Calls the constant method utxoValue on the Deposit contract.", + ArgsUsage: "", + Action: dUtxoValue, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "current-state", + Usage: "Calls the constant method currentState on the Deposit contract.", + ArgsUsage: "", + Action: dCurrentState, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "get-owner-redemption-tbtc-requirement", + Usage: "Calls the constant method getOwnerRedemptionTbtcRequirement on the Deposit contract.", + ArgsUsage: "[_redeemer] ", + Action: dGetOwnerRedemptionTbtcRequirement, + Before: cmd.ArgCountChecker(1), + Flags: cmd.ConstFlags, + }, { + Name: "in-active", + Usage: "Calls the constant method inActive on the Deposit contract.", + ArgsUsage: "", + Action: dInActive, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "lot-size-tbtc", + Usage: "Calls the constant method lotSizeTbtc on the Deposit contract.", + ArgsUsage: "", + Action: dLotSizeTbtc, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "lot-size-satoshis", + Usage: "Calls the constant method lotSizeSatoshis on the Deposit contract.", + ArgsUsage: "", + Action: dLotSizeSatoshis, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "severely-undercollateralized-threshold-percent", + Usage: "Calls the constant method severelyUndercollateralizedThresholdPercent on the Deposit contract.", + ArgsUsage: "", + Action: dSeverelyUndercollateralizedThresholdPercent, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "initial-collateralized-percent", + Usage: "Calls the constant method initialCollateralizedPercent on the Deposit contract.", + ArgsUsage: "", + Action: dInitialCollateralizedPercent, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "keep-address", + Usage: "Calls the constant method keepAddress on the Deposit contract.", + ArgsUsage: "", + Action: dKeepAddress, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "withdrawable-amount", + Usage: "Calls the constant method withdrawableAmount on the Deposit contract.", + ArgsUsage: "", + Action: dWithdrawableAmount, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "collateralization-percentage", + Usage: "Calls the constant method collateralizationPercentage on the Deposit contract.", + ArgsUsage: "", + Action: dCollateralizationPercentage, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "remaining-term", + Usage: "Calls the constant method remainingTerm on the Deposit contract.", + ArgsUsage: "", + Action: dRemainingTerm, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "auction-value", + Usage: "Calls the constant method auctionValue on the Deposit contract.", + ArgsUsage: "", + Action: dAuctionValue, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "signer-fee-tbtc", + Usage: "Calls the constant method signerFeeTbtc on the Deposit contract.", + ArgsUsage: "", + Action: dSignerFeeTbtc, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "notify-redemption-signature-timed-out", + Usage: "Calls the method notifyRedemptionSignatureTimedOut on the Deposit contract.", + ArgsUsage: "", + Action: dNotifyRedemptionSignatureTimedOut, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "notify-funding-timed-out", + Usage: "Calls the method notifyFundingTimedOut on the Deposit contract.", + ArgsUsage: "", + Action: dNotifyFundingTimedOut, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "request-funder-abort", + Usage: "Calls the method requestFunderAbort on the Deposit contract.", + ArgsUsage: "[_abortOutputScript] ", + Action: dRequestFunderAbort, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), + Flags: cmd.NonConstFlags, + }, { + Name: "withdraw-funds", + Usage: "Calls the method withdrawFunds on the Deposit contract.", + ArgsUsage: "", + Action: dWithdrawFunds, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "notify-signer-setup-failed", + Usage: "Calls the method notifySignerSetupFailed on the Deposit contract.", + ArgsUsage: "", + Action: dNotifySignerSetupFailed, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "notify-redemption-proof-timed-out", + Usage: "Calls the method notifyRedemptionProofTimedOut on the Deposit contract.", + ArgsUsage: "", + Action: dNotifyRedemptionProofTimedOut, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "exit-courtesy-call", + Usage: "Calls the method exitCourtesyCall on the Deposit contract.", + ArgsUsage: "", + Action: dExitCourtesyCall, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "notify-courtesy-call-expired", + Usage: "Calls the method notifyCourtesyCallExpired on the Deposit contract.", + ArgsUsage: "", + Action: dNotifyCourtesyCallExpired, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "notify-undercollateralized-liquidation", + Usage: "Calls the method notifyUndercollateralizedLiquidation on the Deposit contract.", + ArgsUsage: "", + Action: dNotifyUndercollateralizedLiquidation, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "initialize", + Usage: "Calls the method initialize on the Deposit contract.", + ArgsUsage: "[_factory] ", + Action: dInitialize, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), + Flags: cmd.NonConstFlags, + }, { + Name: "notify-courtesy-call", + Usage: "Calls the method notifyCourtesyCall on the Deposit contract.", + ArgsUsage: "", + Action: dNotifyCourtesyCall, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "purchase-signer-bonds-at-auction", + Usage: "Calls the method purchaseSignerBondsAtAuction on the Deposit contract.", + ArgsUsage: "", + Action: dPurchaseSignerBondsAtAuction, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "retrieve-signer-pubkey", + Usage: "Calls the method retrieveSignerPubkey on the Deposit contract.", + ArgsUsage: "", + Action: dRetrieveSignerPubkey, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }}, + }) +} + +/// ------------------- Const methods ------------------- + +func dFundingInfo(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + result, err := contract.FundingInfoAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func dGetRedemptionTbtcRequirement(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + _redeemer, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _redeemer, a address, from passed value %v", + c.Args()[0], + ) + } + + result, err := contract.GetRedemptionTbtcRequirementAtBlock( + _redeemer, + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func dUndercollateralizedThresholdPercent(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + result, err := contract.UndercollateralizedThresholdPercentAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func dUtxoValue(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + result, err := contract.UtxoValueAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func dCurrentState(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + result, err := contract.CurrentStateAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func dGetOwnerRedemptionTbtcRequirement(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + _redeemer, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _redeemer, a address, from passed value %v", + c.Args()[0], + ) + } + + result, err := contract.GetOwnerRedemptionTbtcRequirementAtBlock( + _redeemer, + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func dInActive(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + result, err := contract.InActiveAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func dLotSizeTbtc(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + result, err := contract.LotSizeTbtcAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func dLotSizeSatoshis(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + result, err := contract.LotSizeSatoshisAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func dSeverelyUndercollateralizedThresholdPercent(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + result, err := contract.SeverelyUndercollateralizedThresholdPercentAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func dInitialCollateralizedPercent(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + result, err := contract.InitialCollateralizedPercentAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func dKeepAddress(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + result, err := contract.KeepAddressAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func dWithdrawableAmount(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + result, err := contract.WithdrawableAmountAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func dCollateralizationPercentage(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + result, err := contract.CollateralizationPercentageAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func dRemainingTerm(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + result, err := contract.RemainingTermAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func dAuctionValue(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + result, err := contract.AuctionValueAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func dSignerFeeTbtc(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + result, err := contract.SignerFeeTbtcAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +/// ------------------- Non-const methods ------------------- + +func dNotifyRedemptionSignatureTimedOut(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.NotifyRedemptionSignatureTimedOut() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallNotifyRedemptionSignatureTimedOut( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func dNotifyFundingTimedOut(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.NotifyFundingTimedOut() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallNotifyFundingTimedOut( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func dRequestFunderAbort(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + _abortOutputScript, err := hexutil.Decode(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _abortOutputScript, a bytes, from passed value %v", + c.Args()[0], + ) + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.RequestFunderAbort( + _abortOutputScript, + ) + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallRequestFunderAbort( + _abortOutputScript, + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func dWithdrawFunds(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.WithdrawFunds() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallWithdrawFunds( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func dNotifySignerSetupFailed(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.NotifySignerSetupFailed() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallNotifySignerSetupFailed( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func dNotifyRedemptionProofTimedOut(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.NotifyRedemptionProofTimedOut() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallNotifyRedemptionProofTimedOut( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func dExitCourtesyCall(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.ExitCourtesyCall() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallExitCourtesyCall( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func dNotifyCourtesyCallExpired(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.NotifyCourtesyCallExpired() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallNotifyCourtesyCallExpired( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.NotifyUndercollateralizedLiquidation() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallNotifyUndercollateralizedLiquidation( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func dInitialize(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + _factory, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _factory, a address, from passed value %v", + c.Args()[0], + ) + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.Initialize( + _factory, + ) + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallInitialize( + _factory, + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func dNotifyCourtesyCall(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.NotifyCourtesyCall() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallNotifyCourtesyCall( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func dPurchaseSignerBondsAtAuction(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.PurchaseSignerBondsAtAuction() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallPurchaseSignerBondsAtAuction( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func dRetrieveSignerPubkey(c *cli.Context) error { + contract, err := initializeDeposit(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.RetrieveSignerPubkey() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallRetrieveSignerPubkey( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +/// ------------------- Initialization ------------------- + +func initializeDeposit(c *cli.Context) (*contract.Deposit, error) { + config, err := config.ReadEthereumConfig(c.GlobalString("config")) + if err != nil { + return nil, fmt.Errorf("error reading Ethereum config from file: [%v]", err) + } + + client, _, _, err := ethutil.ConnectClients(config.URL, config.URLRPC) + if err != nil { + return nil, fmt.Errorf("error connecting to Ethereum node: [%v]", err) + } + + key, err := ethutil.DecryptKeyFile( + config.Account.KeyFile, + config.Account.KeyFilePassword, + ) + if err != nil { + return nil, fmt.Errorf( + "failed to read KeyFile: %s: [%v]", + config.Account.KeyFile, + err, + ) + } + + checkInterval := cmd.DefaultMiningCheckInterval + maxGasPrice := cmd.DefaultMaxGasPrice + if config.MiningCheckInterval != 0 { + checkInterval = time.Duration(config.MiningCheckInterval) * time.Second + } + if config.MaxGasPrice != 0 { + maxGasPrice = new(big.Int).SetUint64(config.MaxGasPrice) + } + + miningWaiter := ethutil.NewMiningWaiter(client, checkInterval, maxGasPrice) + + address := common.HexToAddress(config.ContractAddresses["Deposit"]) + + return contract.NewDeposit( + address, + key, + client, + ethutil.NewNonceManager(key.Address, client), + miningWaiter, + &sync.Mutex{}, + ) +} diff --git a/bindings/go/cmd/DepositLog.go b/bindings/go/cmd/DepositLog.go new file mode 100644 index 000000000..f95ad066b --- /dev/null +++ b/bindings/go/cmd/DepositLog.go @@ -0,0 +1,445 @@ +// Code generated - DO NOT EDIT. +// This file is a generated command and any manual changes will be lost. + +package cmd + +import ( + "fmt" + "math/big" + "sync" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + + "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" + "github.com/keep-network/keep-common/pkg/cmd" + "github.com/keep-network/keep-core/config" + "github.com/keep-network/tbtc/contract" + + "github.com/urfave/cli" +) + +var DepositLogCommand cli.Command + +var depositLogDescription = `The deposit-log command allows calling the DepositLog 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. + + All subcommands can be used to investigate the result of a previous + transaction that called that same method by passing the -t/--transaction + flag with the transaction hash. + + 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() { + AvailableCommands = append(AvailableCommands, cli.Command{ + Name: "deposit-log", + Usage: `Provides access to the DepositLog contract.`, + Description: depositLogDescription, + Subcommands: []cli.Command{{ + Name: "approved-to-log", + Usage: "Calls the constant method approvedToLog on the DepositLog contract.", + ArgsUsage: "[_caller] ", + Action: dlApprovedToLog, + Before: cmd.ArgCountChecker(1), + Flags: cmd.ConstFlags, + }, { + Name: "log-exited-courtesy-call", + Usage: "Calls the method logExitedCourtesyCall on the DepositLog contract.", + ArgsUsage: "", + Action: dlLogExitedCourtesyCall, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "log-fraud-during-setup", + Usage: "Calls the method logFraudDuringSetup on the DepositLog contract.", + ArgsUsage: "", + Action: dlLogFraudDuringSetup, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "log-funder-requested-abort", + Usage: "Calls the method logFunderRequestedAbort on the DepositLog contract.", + ArgsUsage: "[_abortOutputScript] ", + Action: dlLogFunderRequestedAbort, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), + Flags: cmd.NonConstFlags, + }, { + Name: "log-liquidated", + Usage: "Calls the method logLiquidated on the DepositLog contract.", + ArgsUsage: "", + Action: dlLogLiquidated, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "log-setup-failed", + Usage: "Calls the method logSetupFailed on the DepositLog contract.", + ArgsUsage: "", + Action: dlLogSetupFailed, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "log-courtesy-called", + Usage: "Calls the method logCourtesyCalled on the DepositLog contract.", + ArgsUsage: "", + Action: dlLogCourtesyCalled, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "log-created", + Usage: "Calls the method logCreated on the DepositLog contract.", + ArgsUsage: "[_keepAddress] ", + Action: dlLogCreated, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), + Flags: cmd.NonConstFlags, + }}, + }) +} + +/// ------------------- Const methods ------------------- + +func dlApprovedToLog(c *cli.Context) error { + contract, err := initializeDepositLog(c) + if err != nil { + return err + } + _caller, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _caller, a address, from passed value %v", + c.Args()[0], + ) + } + + result, err := contract.ApprovedToLogAtBlock( + _caller, + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +/// ------------------- Non-const methods ------------------- + +func dlLogExitedCourtesyCall(c *cli.Context) error { + contract, err := initializeDepositLog(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.LogExitedCourtesyCall() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallLogExitedCourtesyCall( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func dlLogFraudDuringSetup(c *cli.Context) error { + contract, err := initializeDepositLog(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.LogFraudDuringSetup() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallLogFraudDuringSetup( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func dlLogFunderRequestedAbort(c *cli.Context) error { + contract, err := initializeDepositLog(c) + if err != nil { + return err + } + + _abortOutputScript, err := hexutil.Decode(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _abortOutputScript, a bytes, from passed value %v", + c.Args()[0], + ) + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.LogFunderRequestedAbort( + _abortOutputScript, + ) + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallLogFunderRequestedAbort( + _abortOutputScript, + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func dlLogLiquidated(c *cli.Context) error { + contract, err := initializeDepositLog(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.LogLiquidated() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallLogLiquidated( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func dlLogSetupFailed(c *cli.Context) error { + contract, err := initializeDepositLog(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.LogSetupFailed() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallLogSetupFailed( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func dlLogCourtesyCalled(c *cli.Context) error { + contract, err := initializeDepositLog(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.LogCourtesyCalled() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallLogCourtesyCalled( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func dlLogCreated(c *cli.Context) error { + contract, err := initializeDepositLog(c) + if err != nil { + return err + } + + _keepAddress, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _keepAddress, a address, from passed value %v", + c.Args()[0], + ) + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.LogCreated( + _keepAddress, + ) + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallLogCreated( + _keepAddress, + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +/// ------------------- Initialization ------------------- + +func initializeDepositLog(c *cli.Context) (*contract.DepositLog, error) { + config, err := config.ReadEthereumConfig(c.GlobalString("config")) + if err != nil { + return nil, fmt.Errorf("error reading Ethereum config from file: [%v]", err) + } + + client, _, _, err := ethutil.ConnectClients(config.URL, config.URLRPC) + if err != nil { + return nil, fmt.Errorf("error connecting to Ethereum node: [%v]", err) + } + + key, err := ethutil.DecryptKeyFile( + config.Account.KeyFile, + config.Account.KeyFilePassword, + ) + if err != nil { + return nil, fmt.Errorf( + "failed to read KeyFile: %s: [%v]", + config.Account.KeyFile, + err, + ) + } + + checkInterval := cmd.DefaultMiningCheckInterval + maxGasPrice := cmd.DefaultMaxGasPrice + if config.MiningCheckInterval != 0 { + checkInterval = time.Duration(config.MiningCheckInterval) * time.Second + } + if config.MaxGasPrice != 0 { + maxGasPrice = new(big.Int).SetUint64(config.MaxGasPrice) + } + + miningWaiter := ethutil.NewMiningWaiter(client, checkInterval, maxGasPrice) + + address := common.HexToAddress(config.ContractAddresses["DepositLog"]) + + return contract.NewDepositLog( + address, + key, + client, + ethutil.NewNonceManager(key.Address, client), + miningWaiter, + &sync.Mutex{}, + ) +} diff --git a/bindings/go/contract/.keep b/bindings/go/contract/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/bindings/go/contract/Deposit.go b/bindings/go/contract/Deposit.go new file mode 100644 index 000000000..d1aa3f548 --- /dev/null +++ b/bindings/go/contract/Deposit.go @@ -0,0 +1,3791 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package contract + +import ( + "fmt" + "math/big" + "strings" + "sync" + + ethereumabi "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/ipfs/go-log" + + "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" + abi "github.com/keep-network/tbtc/abi/deposit" +) + +// 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 dLogger = log.Logger("keep-contract-Deposit") + +type Deposit struct { + contract *abi.Deposit + contractAddress common.Address + contractABI *ethereumabi.ABI + caller bind.ContractCaller + transactor bind.ContractTransactor + callerOptions *bind.CallOpts + transactorOptions *bind.TransactOpts + errorResolver *ethutil.ErrorResolver + nonceManager *ethutil.NonceManager + miningWaiter *ethutil.MiningWaiter + + transactionMutex *sync.Mutex +} + +func NewDeposit( + contractAddress common.Address, + accountKey *keystore.Key, + backend bind.ContractBackend, + nonceManager *ethutil.NonceManager, + miningWaiter *ethutil.MiningWaiter, + transactionMutex *sync.Mutex, +) (*Deposit, error) { + callerOptions := &bind.CallOpts{ + From: accountKey.Address, + } + + transactorOptions := bind.NewKeyedTransactor( + accountKey.PrivateKey, + ) + + randomBeaconContract, err := abi.NewDeposit( + contractAddress, + backend, + ) + if err != nil { + return nil, fmt.Errorf( + "failed to instantiate contract at address: %s [%v]", + contractAddress.String(), + err, + ) + } + + contractABI, err := ethereumabi.JSON(strings.NewReader(abi.DepositABI)) + if err != nil { + return nil, fmt.Errorf("failed to instantiate ABI: [%v]", err) + } + + return &Deposit{ + contract: randomBeaconContract, + contractAddress: contractAddress, + contractABI: &contractABI, + caller: backend, + transactor: backend, + callerOptions: callerOptions, + transactorOptions: transactorOptions, + errorResolver: ethutil.NewErrorResolver(backend, &contractABI, &contractAddress), + nonceManager: nonceManager, + miningWaiter: miningWaiter, + transactionMutex: transactionMutex, + }, nil +} + +// ----- Non-const Methods ------ + +// Transaction submission. +func (d *Deposit) InitializeDeposit( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, + value *big.Int, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction initializeDeposit", + "params: ", + fmt.Sprint( + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, + ), + "value: ", value, + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.transactorOptions + + transactorOptions.Value = value + + 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 := d.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 := d.contract.InitializeDeposit( + transactorOptions, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + value, + "initializeDeposit", + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, + ) + } + + dLogger.Infof( + "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.InitializeDeposit( + transactorOptions, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + value, + "initializeDeposit", + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, + ) + } + + dLogger.Infof( + "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallInitializeDeposit( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, + value *big.Int, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, value, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "initializeDeposit", + &result, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, + ) + + return err +} + +func (d *Deposit) InitializeDepositGasEstimate( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "initializeDeposit", + d.contractABI, + d.transactor, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) NotifyRedemptionSignatureTimedOut( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction notifyRedemptionSignatureTimedOut", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.NotifyRedemptionSignatureTimedOut( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyRedemptionSignatureTimedOut", + ) + } + + dLogger.Infof( + "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyRedemptionSignatureTimedOut", + ) + } + + dLogger.Infof( + "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallNotifyRedemptionSignatureTimedOut( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "notifyRedemptionSignatureTimedOut", + &result, + ) + + return err +} + +func (d *Deposit) NotifyRedemptionSignatureTimedOutGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "notifyRedemptionSignatureTimedOut", + d.contractABI, + d.transactor, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) ProvideBTCFundingProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _fundingOutputIndex uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction provideBTCFundingProof", + "params: ", + fmt.Sprint( + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ), + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.ProvideBTCFundingProof( + transactorOptions, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "provideBTCFundingProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + } + + dLogger.Infof( + "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.ProvideBTCFundingProof( + transactorOptions, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "provideBTCFundingProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + } + + dLogger.Infof( + "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallProvideBTCFundingProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _fundingOutputIndex uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "provideBTCFundingProof", + &result, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + + return err +} + +func (d *Deposit) ProvideBTCFundingProofGasEstimate( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _fundingOutputIndex uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "provideBTCFundingProof", + d.contractABI, + d.transactor, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) NotifyFundingTimedOut( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction notifyFundingTimedOut", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.NotifyFundingTimedOut( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyFundingTimedOut", + ) + } + + dLogger.Infof( + "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.NotifyFundingTimedOut( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyFundingTimedOut", + ) + } + + dLogger.Infof( + "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallNotifyFundingTimedOut( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "notifyFundingTimedOut", + &result, + ) + + return err +} + +func (d *Deposit) NotifyFundingTimedOutGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "notifyFundingTimedOut", + d.contractABI, + d.transactor, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) ProvideECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction provideECDSAFraudProof", + "params: ", + fmt.Sprint( + _v, + _r, + _s, + _signedDigest, + _preimage, + ), + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.ProvideECDSAFraudProof( + transactorOptions, + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "provideECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + } + + dLogger.Infof( + "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.ProvideECDSAFraudProof( + transactorOptions, + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "provideECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + } + + dLogger.Infof( + "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallProvideECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "provideECDSAFraudProof", + &result, + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + + return err +} + +func (d *Deposit) ProvideECDSAFraudProofGasEstimate( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "provideECDSAFraudProof", + d.contractABI, + d.transactor, + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) RequestFunderAbort( + _abortOutputScript []uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction requestFunderAbort", + "params: ", + fmt.Sprint( + _abortOutputScript, + ), + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.RequestFunderAbort( + transactorOptions, + _abortOutputScript, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "requestFunderAbort", + _abortOutputScript, + ) + } + + dLogger.Infof( + "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.RequestFunderAbort( + transactorOptions, + _abortOutputScript, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "requestFunderAbort", + _abortOutputScript, + ) + } + + dLogger.Infof( + "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallRequestFunderAbort( + _abortOutputScript []uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "requestFunderAbort", + &result, + _abortOutputScript, + ) + + return err +} + +func (d *Deposit) RequestFunderAbortGasEstimate( + _abortOutputScript []uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "requestFunderAbort", + d.contractABI, + d.transactor, + _abortOutputScript, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) TransferAndRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction transferAndRequestRedemption", + "params: ", + fmt.Sprint( + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, + ), + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.TransferAndRequestRedemption( + transactorOptions, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "transferAndRequestRedemption", + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, + ) + } + + dLogger.Infof( + "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.TransferAndRequestRedemption( + transactorOptions, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "transferAndRequestRedemption", + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, + ) + } + + dLogger.Infof( + "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallTransferAndRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "transferAndRequestRedemption", + &result, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, + ) + + return err +} + +func (d *Deposit) TransferAndRequestRedemptionGasEstimate( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "transferAndRequestRedemption", + d.contractABI, + d.transactor, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) IncreaseRedemptionFee( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction increaseRedemptionFee", + "params: ", + fmt.Sprint( + _previousOutputValueBytes, + _newOutputValueBytes, + ), + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.IncreaseRedemptionFee( + transactorOptions, + _previousOutputValueBytes, + _newOutputValueBytes, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "increaseRedemptionFee", + _previousOutputValueBytes, + _newOutputValueBytes, + ) + } + + dLogger.Infof( + "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.IncreaseRedemptionFee( + transactorOptions, + _previousOutputValueBytes, + _newOutputValueBytes, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "increaseRedemptionFee", + _previousOutputValueBytes, + _newOutputValueBytes, + ) + } + + dLogger.Infof( + "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallIncreaseRedemptionFee( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "increaseRedemptionFee", + &result, + _previousOutputValueBytes, + _newOutputValueBytes, + ) + + return err +} + +func (d *Deposit) IncreaseRedemptionFeeGasEstimate( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "increaseRedemptionFee", + d.contractABI, + d.transactor, + _previousOutputValueBytes, + _newOutputValueBytes, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) ProvideRedemptionProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction provideRedemptionProof", + "params: ", + fmt.Sprint( + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ), + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.ProvideRedemptionProof( + transactorOptions, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "provideRedemptionProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + } + + dLogger.Infof( + "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.ProvideRedemptionProof( + transactorOptions, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "provideRedemptionProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + } + + dLogger.Infof( + "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallProvideRedemptionProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "provideRedemptionProof", + &result, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + + return err +} + +func (d *Deposit) ProvideRedemptionProofGasEstimate( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "provideRedemptionProof", + d.contractABI, + d.transactor, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) WithdrawFunds( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction withdrawFunds", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.WithdrawFunds( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "withdrawFunds", + ) + } + + dLogger.Infof( + "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.WithdrawFunds( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "withdrawFunds", + ) + } + + dLogger.Infof( + "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallWithdrawFunds( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "withdrawFunds", + &result, + ) + + return err +} + +func (d *Deposit) WithdrawFundsGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "withdrawFunds", + d.contractABI, + d.transactor, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) NotifySignerSetupFailed( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction notifySignerSetupFailed", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.NotifySignerSetupFailed( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifySignerSetupFailed", + ) + } + + dLogger.Infof( + "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.NotifySignerSetupFailed( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifySignerSetupFailed", + ) + } + + dLogger.Infof( + "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallNotifySignerSetupFailed( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "notifySignerSetupFailed", + &result, + ) + + return err +} + +func (d *Deposit) NotifySignerSetupFailedGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "notifySignerSetupFailed", + d.contractABI, + d.transactor, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) NotifyRedemptionProofTimedOut( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction notifyRedemptionProofTimedOut", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.NotifyRedemptionProofTimedOut( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyRedemptionProofTimedOut", + ) + } + + dLogger.Infof( + "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.NotifyRedemptionProofTimedOut( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyRedemptionProofTimedOut", + ) + } + + dLogger.Infof( + "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallNotifyRedemptionProofTimedOut( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "notifyRedemptionProofTimedOut", + &result, + ) + + return err +} + +func (d *Deposit) NotifyRedemptionProofTimedOutGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "notifyRedemptionProofTimedOut", + d.contractABI, + d.transactor, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) ProvideRedemptionSignature( + _v uint8, + _r [32]uint8, + _s [32]uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction provideRedemptionSignature", + "params: ", + fmt.Sprint( + _v, + _r, + _s, + ), + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.ProvideRedemptionSignature( + transactorOptions, + _v, + _r, + _s, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "provideRedemptionSignature", + _v, + _r, + _s, + ) + } + + dLogger.Infof( + "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.ProvideRedemptionSignature( + transactorOptions, + _v, + _r, + _s, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "provideRedemptionSignature", + _v, + _r, + _s, + ) + } + + dLogger.Infof( + "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallProvideRedemptionSignature( + _v uint8, + _r [32]uint8, + _s [32]uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "provideRedemptionSignature", + &result, + _v, + _r, + _s, + ) + + return err +} + +func (d *Deposit) ProvideRedemptionSignatureGasEstimate( + _v uint8, + _r [32]uint8, + _s [32]uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "provideRedemptionSignature", + d.contractABI, + d.transactor, + _v, + _r, + _s, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) ExitCourtesyCall( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction exitCourtesyCall", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.ExitCourtesyCall( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "exitCourtesyCall", + ) + } + + dLogger.Infof( + "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.ExitCourtesyCall( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "exitCourtesyCall", + ) + } + + dLogger.Infof( + "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallExitCourtesyCall( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "exitCourtesyCall", + &result, + ) + + return err +} + +func (d *Deposit) ExitCourtesyCallGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "exitCourtesyCall", + d.contractABI, + d.transactor, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) NotifyCourtesyCallExpired( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction notifyCourtesyCallExpired", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.NotifyCourtesyCallExpired( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyCourtesyCallExpired", + ) + } + + dLogger.Infof( + "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.NotifyCourtesyCallExpired( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyCourtesyCallExpired", + ) + } + + dLogger.Infof( + "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallNotifyCourtesyCallExpired( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "notifyCourtesyCallExpired", + &result, + ) + + return err +} + +func (d *Deposit) NotifyCourtesyCallExpiredGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "notifyCourtesyCallExpired", + d.contractABI, + d.transactor, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) NotifyUndercollateralizedLiquidation( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction notifyUndercollateralizedLiquidation", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.NotifyUndercollateralizedLiquidation( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyUndercollateralizedLiquidation", + ) + } + + dLogger.Infof( + "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.NotifyUndercollateralizedLiquidation( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyUndercollateralizedLiquidation", + ) + } + + dLogger.Infof( + "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallNotifyUndercollateralizedLiquidation( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "notifyUndercollateralizedLiquidation", + &result, + ) + + return err +} + +func (d *Deposit) NotifyUndercollateralizedLiquidationGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "notifyUndercollateralizedLiquidation", + d.contractABI, + d.transactor, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) ProvideFundingECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction provideFundingECDSAFraudProof", + "params: ", + fmt.Sprint( + _v, + _r, + _s, + _signedDigest, + _preimage, + ), + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.ProvideFundingECDSAFraudProof( + transactorOptions, + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "provideFundingECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + } + + dLogger.Infof( + "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.ProvideFundingECDSAFraudProof( + transactorOptions, + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "provideFundingECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + } + + dLogger.Infof( + "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallProvideFundingECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "provideFundingECDSAFraudProof", + &result, + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + + return err +} + +func (d *Deposit) ProvideFundingECDSAFraudProofGasEstimate( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "provideFundingECDSAFraudProof", + d.contractABI, + d.transactor, + _v, + _r, + _s, + _signedDigest, + _preimage, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) RequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction requestRedemption", + "params: ", + fmt.Sprint( + _outputValueBytes, + _redeemerOutputScript, + ), + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.RequestRedemption( + transactorOptions, + _outputValueBytes, + _redeemerOutputScript, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "requestRedemption", + _outputValueBytes, + _redeemerOutputScript, + ) + } + + dLogger.Infof( + "submitted transaction requestRedemption with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.RequestRedemption( + transactorOptions, + _outputValueBytes, + _redeemerOutputScript, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "requestRedemption", + _outputValueBytes, + _redeemerOutputScript, + ) + } + + dLogger.Infof( + "submitted transaction requestRedemption with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "requestRedemption", + &result, + _outputValueBytes, + _redeemerOutputScript, + ) + + return err +} + +func (d *Deposit) RequestRedemptionGasEstimate( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "requestRedemption", + d.contractABI, + d.transactor, + _outputValueBytes, + _redeemerOutputScript, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) Initialize( + _factory common.Address, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction initialize", + "params: ", + fmt.Sprint( + _factory, + ), + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.Initialize( + transactorOptions, + _factory, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "initialize", + _factory, + ) + } + + dLogger.Infof( + "submitted transaction initialize with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.Initialize( + transactorOptions, + _factory, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "initialize", + _factory, + ) + } + + dLogger.Infof( + "submitted transaction initialize with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallInitialize( + _factory common.Address, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "initialize", + &result, + _factory, + ) + + return err +} + +func (d *Deposit) InitializeGasEstimate( + _factory common.Address, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "initialize", + d.contractABI, + d.transactor, + _factory, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) NotifyCourtesyCall( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction notifyCourtesyCall", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.NotifyCourtesyCall( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyCourtesyCall", + ) + } + + dLogger.Infof( + "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.NotifyCourtesyCall( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyCourtesyCall", + ) + } + + dLogger.Infof( + "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallNotifyCourtesyCall( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "notifyCourtesyCall", + &result, + ) + + return err +} + +func (d *Deposit) NotifyCourtesyCallGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "notifyCourtesyCall", + d.contractABI, + d.transactor, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) PurchaseSignerBondsAtAuction( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction purchaseSignerBondsAtAuction", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.PurchaseSignerBondsAtAuction( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "purchaseSignerBondsAtAuction", + ) + } + + dLogger.Infof( + "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.PurchaseSignerBondsAtAuction( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "purchaseSignerBondsAtAuction", + ) + } + + dLogger.Infof( + "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallPurchaseSignerBondsAtAuction( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "purchaseSignerBondsAtAuction", + &result, + ) + + return err +} + +func (d *Deposit) PurchaseSignerBondsAtAuctionGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "purchaseSignerBondsAtAuction", + d.contractABI, + d.transactor, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) RetrieveSignerPubkey( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction retrieveSignerPubkey", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.RetrieveSignerPubkey( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "retrieveSignerPubkey", + ) + } + + dLogger.Infof( + "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.RetrieveSignerPubkey( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "retrieveSignerPubkey", + ) + } + + dLogger.Infof( + "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallRetrieveSignerPubkey( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "retrieveSignerPubkey", + &result, + ) + + return err +} + +func (d *Deposit) RetrieveSignerPubkeyGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "retrieveSignerPubkey", + d.contractABI, + d.transactor, + ) + + return result, err +} + +// ----- Const Methods ------ + +type fundingInfo struct { + UtxoValueBytes [8]uint8 + FundedAt *big.Int + UtxoOutpoint []uint8 +} + +func (d *Deposit) FundingInfo() (fundingInfo, error) { + var result fundingInfo + result, err := d.contract.FundingInfo( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "fundingInfo", + ) + } + + return result, err +} + +func (d *Deposit) FundingInfoAtBlock( + blockNumber *big.Int, +) (fundingInfo, error) { + var result fundingInfo + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "fundingInfo", + &result, + ) + + return result, err +} + +func (d *Deposit) GetRedemptionTbtcRequirement( + _redeemer common.Address, +) (*big.Int, error) { + var result *big.Int + result, err := d.contract.GetRedemptionTbtcRequirement( + d.callerOptions, + _redeemer, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "getRedemptionTbtcRequirement", + _redeemer, + ) + } + + return result, err +} + +func (d *Deposit) GetRedemptionTbtcRequirementAtBlock( + _redeemer common.Address, + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "getRedemptionTbtcRequirement", + &result, + _redeemer, + ) + + return result, err +} + +func (d *Deposit) UndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := d.contract.UndercollateralizedThresholdPercent( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "undercollateralizedThresholdPercent", + ) + } + + return result, err +} + +func (d *Deposit) UndercollateralizedThresholdPercentAtBlock( + blockNumber *big.Int, +) (uint16, error) { + var result uint16 + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "undercollateralizedThresholdPercent", + &result, + ) + + return result, err +} + +func (d *Deposit) UtxoValue() (*big.Int, error) { + var result *big.Int + result, err := d.contract.UtxoValue( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "utxoValue", + ) + } + + return result, err +} + +func (d *Deposit) UtxoValueAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "utxoValue", + &result, + ) + + return result, err +} + +func (d *Deposit) CurrentState() (*big.Int, error) { + var result *big.Int + result, err := d.contract.CurrentState( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "currentState", + ) + } + + return result, err +} + +func (d *Deposit) CurrentStateAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "currentState", + &result, + ) + + return result, err +} + +func (d *Deposit) GetOwnerRedemptionTbtcRequirement( + _redeemer common.Address, +) (*big.Int, error) { + var result *big.Int + result, err := d.contract.GetOwnerRedemptionTbtcRequirement( + d.callerOptions, + _redeemer, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "getOwnerRedemptionTbtcRequirement", + _redeemer, + ) + } + + return result, err +} + +func (d *Deposit) GetOwnerRedemptionTbtcRequirementAtBlock( + _redeemer common.Address, + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "getOwnerRedemptionTbtcRequirement", + &result, + _redeemer, + ) + + return result, err +} + +func (d *Deposit) InActive() (bool, error) { + var result bool + result, err := d.contract.InActive( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "inActive", + ) + } + + return result, err +} + +func (d *Deposit) InActiveAtBlock( + blockNumber *big.Int, +) (bool, error) { + var result bool + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "inActive", + &result, + ) + + return result, err +} + +func (d *Deposit) LotSizeTbtc() (*big.Int, error) { + var result *big.Int + result, err := d.contract.LotSizeTbtc( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "lotSizeTbtc", + ) + } + + return result, err +} + +func (d *Deposit) LotSizeTbtcAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "lotSizeTbtc", + &result, + ) + + return result, err +} + +func (d *Deposit) LotSizeSatoshis() (uint64, error) { + var result uint64 + result, err := d.contract.LotSizeSatoshis( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "lotSizeSatoshis", + ) + } + + return result, err +} + +func (d *Deposit) LotSizeSatoshisAtBlock( + blockNumber *big.Int, +) (uint64, error) { + var result uint64 + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "lotSizeSatoshis", + &result, + ) + + return result, err +} + +func (d *Deposit) SeverelyUndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := d.contract.SeverelyUndercollateralizedThresholdPercent( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "severelyUndercollateralizedThresholdPercent", + ) + } + + return result, err +} + +func (d *Deposit) SeverelyUndercollateralizedThresholdPercentAtBlock( + blockNumber *big.Int, +) (uint16, error) { + var result uint16 + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "severelyUndercollateralizedThresholdPercent", + &result, + ) + + return result, err +} + +func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { + var result uint16 + result, err := d.contract.InitialCollateralizedPercent( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "initialCollateralizedPercent", + ) + } + + return result, err +} + +func (d *Deposit) InitialCollateralizedPercentAtBlock( + blockNumber *big.Int, +) (uint16, error) { + var result uint16 + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "initialCollateralizedPercent", + &result, + ) + + return result, err +} + +func (d *Deposit) KeepAddress() (common.Address, error) { + var result common.Address + result, err := d.contract.KeepAddress( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "keepAddress", + ) + } + + return result, err +} + +func (d *Deposit) KeepAddressAtBlock( + blockNumber *big.Int, +) (common.Address, error) { + var result common.Address + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "keepAddress", + &result, + ) + + return result, err +} + +func (d *Deposit) WithdrawableAmount() (*big.Int, error) { + var result *big.Int + result, err := d.contract.WithdrawableAmount( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "withdrawableAmount", + ) + } + + return result, err +} + +func (d *Deposit) WithdrawableAmountAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "withdrawableAmount", + &result, + ) + + return result, err +} + +func (d *Deposit) CollateralizationPercentage() (*big.Int, error) { + var result *big.Int + result, err := d.contract.CollateralizationPercentage( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "collateralizationPercentage", + ) + } + + return result, err +} + +func (d *Deposit) CollateralizationPercentageAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "collateralizationPercentage", + &result, + ) + + return result, err +} + +func (d *Deposit) RemainingTerm() (*big.Int, error) { + var result *big.Int + result, err := d.contract.RemainingTerm( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "remainingTerm", + ) + } + + return result, err +} + +func (d *Deposit) RemainingTermAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "remainingTerm", + &result, + ) + + return result, err +} + +func (d *Deposit) AuctionValue() (*big.Int, error) { + var result *big.Int + result, err := d.contract.AuctionValue( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "auctionValue", + ) + } + + return result, err +} + +func (d *Deposit) AuctionValueAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "auctionValue", + &result, + ) + + return result, err +} + +func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { + var result *big.Int + result, err := d.contract.SignerFeeTbtc( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "signerFeeTbtc", + ) + } + + return result, err +} + +func (d *Deposit) SignerFeeTbtcAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "signerFeeTbtc", + &result, + ) + + return result, err +} + +// ------ Events ------- diff --git a/bindings/go/contract/DepositLog.go b/bindings/go/contract/DepositLog.go new file mode 100644 index 000000000..204e953ff --- /dev/null +++ b/bindings/go/contract/DepositLog.go @@ -0,0 +1,3519 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package contract + +import ( + "fmt" + "math/big" + "strings" + "sync" + "time" + + ethereumabi "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/ipfs/go-log" + + "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" + "github.com/keep-network/keep-common/pkg/subscription" + "github.com/keep-network/tbtc/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 dlLogger = log.Logger("keep-contract-DepositLog") + +type DepositLog struct { + contract *abi.DepositLog + contractAddress common.Address + contractABI *ethereumabi.ABI + caller bind.ContractCaller + transactor bind.ContractTransactor + callerOptions *bind.CallOpts + transactorOptions *bind.TransactOpts + errorResolver *ethutil.ErrorResolver + nonceManager *ethutil.NonceManager + miningWaiter *ethutil.MiningWaiter + + transactionMutex *sync.Mutex +} + +func NewDepositLog( + contractAddress common.Address, + accountKey *keystore.Key, + backend bind.ContractBackend, + nonceManager *ethutil.NonceManager, + miningWaiter *ethutil.MiningWaiter, + transactionMutex *sync.Mutex, +) (*DepositLog, error) { + callerOptions := &bind.CallOpts{ + From: accountKey.Address, + } + + transactorOptions := bind.NewKeyedTransactor( + accountKey.PrivateKey, + ) + + randomBeaconContract, err := abi.NewDepositLog( + contractAddress, + backend, + ) + if err != nil { + return nil, fmt.Errorf( + "failed to instantiate contract at address: %s [%v]", + contractAddress.String(), + err, + ) + } + + contractABI, err := ethereumabi.JSON(strings.NewReader(abi.DepositLogABI)) + if err != nil { + return nil, fmt.Errorf("failed to instantiate ABI: [%v]", err) + } + + return &DepositLog{ + contract: randomBeaconContract, + contractAddress: contractAddress, + contractABI: &contractABI, + caller: backend, + transactor: backend, + callerOptions: callerOptions, + transactorOptions: transactorOptions, + errorResolver: ethutil.NewErrorResolver(backend, &contractABI, &contractAddress), + nonceManager: nonceManager, + miningWaiter: miningWaiter, + transactionMutex: transactionMutex, + }, nil +} + +// ----- Non-const Methods ------ + +// Transaction submission. +func (dl *DepositLog) LogExitedCourtesyCall( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dlLogger.Debug( + "submitting transaction logExitedCourtesyCall", + ) + + dl.transactionMutex.Lock() + defer dl.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *dl.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 := dl.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 := dl.contract.LogExitedCourtesyCall( + transactorOptions, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logExitedCourtesyCall", + ) + } + + dlLogger.Infof( + "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go dl.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := dl.contract.LogExitedCourtesyCall( + transactorOptions, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logExitedCourtesyCall", + ) + } + + dlLogger.Infof( + "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + dl.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (dl *DepositLog) CallLogExitedCourtesyCall( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + dl.transactorOptions.From, + blockNumber, nil, + dl.contractABI, + dl.caller, + dl.errorResolver, + dl.contractAddress, + "logExitedCourtesyCall", + &result, + ) + + return err +} + +func (dl *DepositLog) LogExitedCourtesyCallGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + dl.callerOptions.From, + dl.contractAddress, + "logExitedCourtesyCall", + dl.contractABI, + dl.transactor, + ) + + return result, err +} + +// Transaction submission. +func (dl *DepositLog) LogFraudDuringSetup( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dlLogger.Debug( + "submitting transaction logFraudDuringSetup", + ) + + dl.transactionMutex.Lock() + defer dl.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *dl.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 := dl.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 := dl.contract.LogFraudDuringSetup( + transactorOptions, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logFraudDuringSetup", + ) + } + + dlLogger.Infof( + "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go dl.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := dl.contract.LogFraudDuringSetup( + transactorOptions, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logFraudDuringSetup", + ) + } + + dlLogger.Infof( + "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + dl.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (dl *DepositLog) CallLogFraudDuringSetup( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + dl.transactorOptions.From, + blockNumber, nil, + dl.contractABI, + dl.caller, + dl.errorResolver, + dl.contractAddress, + "logFraudDuringSetup", + &result, + ) + + return err +} + +func (dl *DepositLog) LogFraudDuringSetupGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + dl.callerOptions.From, + dl.contractAddress, + "logFraudDuringSetup", + dl.contractABI, + dl.transactor, + ) + + return result, err +} + +// Transaction submission. +func (dl *DepositLog) LogFunderRequestedAbort( + _abortOutputScript []uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dlLogger.Debug( + "submitting transaction logFunderRequestedAbort", + "params: ", + fmt.Sprint( + _abortOutputScript, + ), + ) + + dl.transactionMutex.Lock() + defer dl.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *dl.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 := dl.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 := dl.contract.LogFunderRequestedAbort( + transactorOptions, + _abortOutputScript, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logFunderRequestedAbort", + _abortOutputScript, + ) + } + + dlLogger.Infof( + "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go dl.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := dl.contract.LogFunderRequestedAbort( + transactorOptions, + _abortOutputScript, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logFunderRequestedAbort", + _abortOutputScript, + ) + } + + dlLogger.Infof( + "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + dl.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (dl *DepositLog) CallLogFunderRequestedAbort( + _abortOutputScript []uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + dl.transactorOptions.From, + blockNumber, nil, + dl.contractABI, + dl.caller, + dl.errorResolver, + dl.contractAddress, + "logFunderRequestedAbort", + &result, + _abortOutputScript, + ) + + return err +} + +func (dl *DepositLog) LogFunderRequestedAbortGasEstimate( + _abortOutputScript []uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + dl.callerOptions.From, + dl.contractAddress, + "logFunderRequestedAbort", + dl.contractABI, + dl.transactor, + _abortOutputScript, + ) + + return result, err +} + +// Transaction submission. +func (dl *DepositLog) LogFunded( + _txid [32]uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dlLogger.Debug( + "submitting transaction logFunded", + "params: ", + fmt.Sprint( + _txid, + ), + ) + + dl.transactionMutex.Lock() + defer dl.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *dl.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 := dl.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 := dl.contract.LogFunded( + transactorOptions, + _txid, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logFunded", + _txid, + ) + } + + dlLogger.Infof( + "submitted transaction logFunded with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go dl.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := dl.contract.LogFunded( + transactorOptions, + _txid, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logFunded", + _txid, + ) + } + + dlLogger.Infof( + "submitted transaction logFunded with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + dl.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (dl *DepositLog) CallLogFunded( + _txid [32]uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + dl.transactorOptions.From, + blockNumber, nil, + dl.contractABI, + dl.caller, + dl.errorResolver, + dl.contractAddress, + "logFunded", + &result, + _txid, + ) + + return err +} + +func (dl *DepositLog) LogFundedGasEstimate( + _txid [32]uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + dl.callerOptions.From, + dl.contractAddress, + "logFunded", + dl.contractABI, + dl.transactor, + _txid, + ) + + return result, err +} + +// Transaction submission. +func (dl *DepositLog) LogLiquidated( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dlLogger.Debug( + "submitting transaction logLiquidated", + ) + + dl.transactionMutex.Lock() + defer dl.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *dl.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 := dl.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 := dl.contract.LogLiquidated( + transactorOptions, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logLiquidated", + ) + } + + dlLogger.Infof( + "submitted transaction logLiquidated with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go dl.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := dl.contract.LogLiquidated( + transactorOptions, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logLiquidated", + ) + } + + dlLogger.Infof( + "submitted transaction logLiquidated with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + dl.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (dl *DepositLog) CallLogLiquidated( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + dl.transactorOptions.From, + blockNumber, nil, + dl.contractABI, + dl.caller, + dl.errorResolver, + dl.contractAddress, + "logLiquidated", + &result, + ) + + return err +} + +func (dl *DepositLog) LogLiquidatedGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + dl.callerOptions.From, + dl.contractAddress, + "logLiquidated", + dl.contractABI, + dl.transactor, + ) + + return result, err +} + +// Transaction submission. +func (dl *DepositLog) LogRedemptionRequested( + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dlLogger.Debug( + "submitting transaction logRedemptionRequested", + "params: ", + fmt.Sprint( + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ), + ) + + dl.transactionMutex.Lock() + defer dl.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *dl.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 := dl.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 := dl.contract.LogRedemptionRequested( + transactorOptions, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logRedemptionRequested", + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ) + } + + dlLogger.Infof( + "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go dl.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := dl.contract.LogRedemptionRequested( + transactorOptions, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logRedemptionRequested", + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ) + } + + dlLogger.Infof( + "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + dl.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (dl *DepositLog) CallLogRedemptionRequested( + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + dl.transactorOptions.From, + blockNumber, nil, + dl.contractABI, + dl.caller, + dl.errorResolver, + dl.contractAddress, + "logRedemptionRequested", + &result, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ) + + return err +} + +func (dl *DepositLog) LogRedemptionRequestedGasEstimate( + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + dl.callerOptions.From, + dl.contractAddress, + "logRedemptionRequested", + dl.contractABI, + dl.transactor, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ) + + return result, err +} + +// Transaction submission. +func (dl *DepositLog) LogSetupFailed( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dlLogger.Debug( + "submitting transaction logSetupFailed", + ) + + dl.transactionMutex.Lock() + defer dl.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *dl.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 := dl.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 := dl.contract.LogSetupFailed( + transactorOptions, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logSetupFailed", + ) + } + + dlLogger.Infof( + "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go dl.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := dl.contract.LogSetupFailed( + transactorOptions, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logSetupFailed", + ) + } + + dlLogger.Infof( + "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + dl.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (dl *DepositLog) CallLogSetupFailed( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + dl.transactorOptions.From, + blockNumber, nil, + dl.contractABI, + dl.caller, + dl.errorResolver, + dl.contractAddress, + "logSetupFailed", + &result, + ) + + return err +} + +func (dl *DepositLog) LogSetupFailedGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + dl.callerOptions.From, + dl.contractAddress, + "logSetupFailed", + dl.contractABI, + dl.transactor, + ) + + return result, err +} + +// Transaction submission. +func (dl *DepositLog) LogRegisteredPubkey( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dlLogger.Debug( + "submitting transaction logRegisteredPubkey", + "params: ", + fmt.Sprint( + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ), + ) + + dl.transactionMutex.Lock() + defer dl.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *dl.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 := dl.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 := dl.contract.LogRegisteredPubkey( + transactorOptions, + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logRegisteredPubkey", + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ) + } + + dlLogger.Infof( + "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go dl.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := dl.contract.LogRegisteredPubkey( + transactorOptions, + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logRegisteredPubkey", + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ) + } + + dlLogger.Infof( + "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + dl.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (dl *DepositLog) CallLogRegisteredPubkey( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + dl.transactorOptions.From, + blockNumber, nil, + dl.contractABI, + dl.caller, + dl.errorResolver, + dl.contractAddress, + "logRegisteredPubkey", + &result, + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ) + + return err +} + +func (dl *DepositLog) LogRegisteredPubkeyGasEstimate( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + dl.callerOptions.From, + dl.contractAddress, + "logRegisteredPubkey", + dl.contractABI, + dl.transactor, + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ) + + return result, err +} + +// Transaction submission. +func (dl *DepositLog) LogCourtesyCalled( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dlLogger.Debug( + "submitting transaction logCourtesyCalled", + ) + + dl.transactionMutex.Lock() + defer dl.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *dl.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 := dl.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 := dl.contract.LogCourtesyCalled( + transactorOptions, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logCourtesyCalled", + ) + } + + dlLogger.Infof( + "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go dl.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := dl.contract.LogCourtesyCalled( + transactorOptions, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logCourtesyCalled", + ) + } + + dlLogger.Infof( + "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + dl.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (dl *DepositLog) CallLogCourtesyCalled( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + dl.transactorOptions.From, + blockNumber, nil, + dl.contractABI, + dl.caller, + dl.errorResolver, + dl.contractAddress, + "logCourtesyCalled", + &result, + ) + + return err +} + +func (dl *DepositLog) LogCourtesyCalledGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + dl.callerOptions.From, + dl.contractAddress, + "logCourtesyCalled", + dl.contractABI, + dl.transactor, + ) + + return result, err +} + +// Transaction submission. +func (dl *DepositLog) LogCreated( + _keepAddress common.Address, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dlLogger.Debug( + "submitting transaction logCreated", + "params: ", + fmt.Sprint( + _keepAddress, + ), + ) + + dl.transactionMutex.Lock() + defer dl.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *dl.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 := dl.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 := dl.contract.LogCreated( + transactorOptions, + _keepAddress, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logCreated", + _keepAddress, + ) + } + + dlLogger.Infof( + "submitted transaction logCreated with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go dl.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := dl.contract.LogCreated( + transactorOptions, + _keepAddress, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logCreated", + _keepAddress, + ) + } + + dlLogger.Infof( + "submitted transaction logCreated with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + dl.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (dl *DepositLog) CallLogCreated( + _keepAddress common.Address, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + dl.transactorOptions.From, + blockNumber, nil, + dl.contractABI, + dl.caller, + dl.errorResolver, + dl.contractAddress, + "logCreated", + &result, + _keepAddress, + ) + + return err +} + +func (dl *DepositLog) LogCreatedGasEstimate( + _keepAddress common.Address, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + dl.callerOptions.From, + dl.contractAddress, + "logCreated", + dl.contractABI, + dl.transactor, + _keepAddress, + ) + + return result, err +} + +// Transaction submission. +func (dl *DepositLog) LogGotRedemptionSignature( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dlLogger.Debug( + "submitting transaction logGotRedemptionSignature", + "params: ", + fmt.Sprint( + _digest, + _r, + _s, + ), + ) + + dl.transactionMutex.Lock() + defer dl.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *dl.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 := dl.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 := dl.contract.LogGotRedemptionSignature( + transactorOptions, + _digest, + _r, + _s, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logGotRedemptionSignature", + _digest, + _r, + _s, + ) + } + + dlLogger.Infof( + "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go dl.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := dl.contract.LogGotRedemptionSignature( + transactorOptions, + _digest, + _r, + _s, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logGotRedemptionSignature", + _digest, + _r, + _s, + ) + } + + dlLogger.Infof( + "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + dl.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (dl *DepositLog) CallLogGotRedemptionSignature( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + dl.transactorOptions.From, + blockNumber, nil, + dl.contractABI, + dl.caller, + dl.errorResolver, + dl.contractAddress, + "logGotRedemptionSignature", + &result, + _digest, + _r, + _s, + ) + + return err +} + +func (dl *DepositLog) LogGotRedemptionSignatureGasEstimate( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + dl.callerOptions.From, + dl.contractAddress, + "logGotRedemptionSignature", + dl.contractABI, + dl.transactor, + _digest, + _r, + _s, + ) + + return result, err +} + +// Transaction submission. +func (dl *DepositLog) LogRedeemed( + _txid [32]uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dlLogger.Debug( + "submitting transaction logRedeemed", + "params: ", + fmt.Sprint( + _txid, + ), + ) + + dl.transactionMutex.Lock() + defer dl.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *dl.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 := dl.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 := dl.contract.LogRedeemed( + transactorOptions, + _txid, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logRedeemed", + _txid, + ) + } + + dlLogger.Infof( + "submitted transaction logRedeemed with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go dl.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := dl.contract.LogRedeemed( + transactorOptions, + _txid, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logRedeemed", + _txid, + ) + } + + dlLogger.Infof( + "submitted transaction logRedeemed with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + dl.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (dl *DepositLog) CallLogRedeemed( + _txid [32]uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + dl.transactorOptions.From, + blockNumber, nil, + dl.contractABI, + dl.caller, + dl.errorResolver, + dl.contractAddress, + "logRedeemed", + &result, + _txid, + ) + + return err +} + +func (dl *DepositLog) LogRedeemedGasEstimate( + _txid [32]uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + dl.callerOptions.From, + dl.contractAddress, + "logRedeemed", + dl.contractABI, + dl.transactor, + _txid, + ) + + return result, err +} + +// Transaction submission. +func (dl *DepositLog) LogStartedLiquidation( + _wasFraud bool, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dlLogger.Debug( + "submitting transaction logStartedLiquidation", + "params: ", + fmt.Sprint( + _wasFraud, + ), + ) + + dl.transactionMutex.Lock() + defer dl.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *dl.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 := dl.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 := dl.contract.LogStartedLiquidation( + transactorOptions, + _wasFraud, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logStartedLiquidation", + _wasFraud, + ) + } + + dlLogger.Infof( + "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go dl.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := dl.contract.LogStartedLiquidation( + transactorOptions, + _wasFraud, + ) + if err != nil { + return transaction, dl.errorResolver.ResolveError( + err, + dl.transactorOptions.From, + nil, + "logStartedLiquidation", + _wasFraud, + ) + } + + dlLogger.Infof( + "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + dl.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (dl *DepositLog) CallLogStartedLiquidation( + _wasFraud bool, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + dl.transactorOptions.From, + blockNumber, nil, + dl.contractABI, + dl.caller, + dl.errorResolver, + dl.contractAddress, + "logStartedLiquidation", + &result, + _wasFraud, + ) + + return err +} + +func (dl *DepositLog) LogStartedLiquidationGasEstimate( + _wasFraud bool, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + dl.callerOptions.From, + dl.contractAddress, + "logStartedLiquidation", + dl.contractABI, + dl.transactor, + _wasFraud, + ) + + return result, err +} + +// ----- Const Methods ------ + +func (dl *DepositLog) ApprovedToLog( + _caller common.Address, +) (bool, error) { + var result bool + result, err := dl.contract.ApprovedToLog( + dl.callerOptions, + _caller, + ) + + if err != nil { + return result, dl.errorResolver.ResolveError( + err, + dl.callerOptions.From, + nil, + "approvedToLog", + _caller, + ) + } + + return result, err +} + +func (dl *DepositLog) ApprovedToLogAtBlock( + _caller common.Address, + blockNumber *big.Int, +) (bool, error) { + var result bool + + err := ethutil.CallAtBlock( + dl.callerOptions.From, + blockNumber, + nil, + dl.contractABI, + dl.caller, + dl.errorResolver, + dl.contractAddress, + "approvedToLog", + &result, + _caller, + ) + + return result, err +} + +// ------ Events ------- + +type depositLogCreatedFunc func( + _depositContractAddress common.Address, + _keepAddress common.Address, + _timestamp *big.Int, + blockNumber uint64, +) + +func (dl *DepositLog) WatchCreated( + success depositLogCreatedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _keepAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := dl.subscribeCreated( + success, + failCallback, + _depositContractAddressFilter, + _keepAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + dlLogger.Warning( + "subscription to event Created terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (dl *DepositLog) subscribeCreated( + success depositLogCreatedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _keepAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.DepositLogCreated) + eventSubscription, err := dl.contract.WatchCreated( + nil, + eventChan, + _depositContractAddressFilter, + _keepAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for Created events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event._depositContractAddress, + event._keepAddress, + event._timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type depositLogExitedCourtesyCallFunc func( + _depositContractAddress common.Address, + _timestamp *big.Int, + blockNumber uint64, +) + +func (dl *DepositLog) WatchExitedCourtesyCall( + success depositLogExitedCourtesyCallFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := dl.subscribeExitedCourtesyCall( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + dlLogger.Warning( + "subscription to event ExitedCourtesyCall terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (dl *DepositLog) subscribeExitedCourtesyCall( + success depositLogExitedCourtesyCallFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.DepositLogExitedCourtesyCall) + eventSubscription, err := dl.contract.WatchExitedCourtesyCall( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for ExitedCourtesyCall events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event._depositContractAddress, + event._timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type depositLogGotRedemptionSignatureFunc func( + _depositContractAddress common.Address, + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, + _timestamp *big.Int, + blockNumber uint64, +) + +func (dl *DepositLog) WatchGotRedemptionSignature( + success depositLogGotRedemptionSignatureFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _digestFilter [][32]uint8, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := dl.subscribeGotRedemptionSignature( + success, + failCallback, + _depositContractAddressFilter, + _digestFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + dlLogger.Warning( + "subscription to event GotRedemptionSignature terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (dl *DepositLog) subscribeGotRedemptionSignature( + success depositLogGotRedemptionSignatureFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _digestFilter [][32]uint8, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.DepositLogGotRedemptionSignature) + eventSubscription, err := dl.contract.WatchGotRedemptionSignature( + nil, + eventChan, + _depositContractAddressFilter, + _digestFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for GotRedemptionSignature events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event._depositContractAddress, + event._digest, + event._r, + event._s, + event._timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type depositLogLiquidatedFunc func( + _depositContractAddress common.Address, + _timestamp *big.Int, + blockNumber uint64, +) + +func (dl *DepositLog) WatchLiquidated( + success depositLogLiquidatedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := dl.subscribeLiquidated( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + dlLogger.Warning( + "subscription to event Liquidated terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (dl *DepositLog) subscribeLiquidated( + success depositLogLiquidatedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.DepositLogLiquidated) + eventSubscription, err := dl.contract.WatchLiquidated( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for Liquidated events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event._depositContractAddress, + event._timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type depositLogRedeemedFunc func( + _depositContractAddress common.Address, + _txid [32]uint8, + _timestamp *big.Int, + blockNumber uint64, +) + +func (dl *DepositLog) WatchRedeemed( + success depositLogRedeemedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := dl.subscribeRedeemed( + success, + failCallback, + _depositContractAddressFilter, + _txidFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + dlLogger.Warning( + "subscription to event Redeemed terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (dl *DepositLog) subscribeRedeemed( + success depositLogRedeemedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.DepositLogRedeemed) + eventSubscription, err := dl.contract.WatchRedeemed( + nil, + eventChan, + _depositContractAddressFilter, + _txidFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for Redeemed events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event._depositContractAddress, + event._txid, + event._timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type depositLogCourtesyCalledFunc func( + _depositContractAddress common.Address, + _timestamp *big.Int, + blockNumber uint64, +) + +func (dl *DepositLog) WatchCourtesyCalled( + success depositLogCourtesyCalledFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := dl.subscribeCourtesyCalled( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + dlLogger.Warning( + "subscription to event CourtesyCalled terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (dl *DepositLog) subscribeCourtesyCalled( + success depositLogCourtesyCalledFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.DepositLogCourtesyCalled) + eventSubscription, err := dl.contract.WatchCourtesyCalled( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for CourtesyCalled events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event._depositContractAddress, + event._timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type depositLogFundedFunc func( + _depositContractAddress common.Address, + _txid [32]uint8, + _timestamp *big.Int, + blockNumber uint64, +) + +func (dl *DepositLog) WatchFunded( + success depositLogFundedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := dl.subscribeFunded( + success, + failCallback, + _depositContractAddressFilter, + _txidFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + dlLogger.Warning( + "subscription to event Funded terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (dl *DepositLog) subscribeFunded( + success depositLogFundedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.DepositLogFunded) + eventSubscription, err := dl.contract.WatchFunded( + nil, + eventChan, + _depositContractAddressFilter, + _txidFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for Funded events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event._depositContractAddress, + event._txid, + event._timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type depositLogFunderAbortRequestedFunc func( + _depositContractAddress common.Address, + _abortOutputScript []uint8, + blockNumber uint64, +) + +func (dl *DepositLog) WatchFunderAbortRequested( + success depositLogFunderAbortRequestedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := dl.subscribeFunderAbortRequested( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + dlLogger.Warning( + "subscription to event FunderAbortRequested terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (dl *DepositLog) subscribeFunderAbortRequested( + success depositLogFunderAbortRequestedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.DepositLogFunderAbortRequested) + eventSubscription, err := dl.contract.WatchFunderAbortRequested( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for FunderAbortRequested events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event._depositContractAddress, + event._abortOutputScript, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type depositLogRedemptionRequestedFunc func( + _depositContractAddress common.Address, + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, + blockNumber uint64, +) + +func (dl *DepositLog) WatchRedemptionRequested( + success depositLogRedemptionRequestedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _requesterFilter []common.Address, + _digestFilter [][32]uint8, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := dl.subscribeRedemptionRequested( + success, + failCallback, + _depositContractAddressFilter, + _requesterFilter, + _digestFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + dlLogger.Warning( + "subscription to event RedemptionRequested terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (dl *DepositLog) subscribeRedemptionRequested( + success depositLogRedemptionRequestedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _requesterFilter []common.Address, + _digestFilter [][32]uint8, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.DepositLogRedemptionRequested) + eventSubscription, err := dl.contract.WatchRedemptionRequested( + nil, + eventChan, + _depositContractAddressFilter, + _requesterFilter, + _digestFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for RedemptionRequested events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event._depositContractAddress, + event._requester, + event._digest, + event._utxoValue, + event._redeemerOutputScript, + event._requestedFee, + event._outpoint, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type depositLogRegisteredPubkeyFunc func( + _depositContractAddress common.Address, + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, + _timestamp *big.Int, + blockNumber uint64, +) + +func (dl *DepositLog) WatchRegisteredPubkey( + success depositLogRegisteredPubkeyFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := dl.subscribeRegisteredPubkey( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + dlLogger.Warning( + "subscription to event RegisteredPubkey terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (dl *DepositLog) subscribeRegisteredPubkey( + success depositLogRegisteredPubkeyFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.DepositLogRegisteredPubkey) + eventSubscription, err := dl.contract.WatchRegisteredPubkey( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for RegisteredPubkey events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event._depositContractAddress, + event._signingGroupPubkeyX, + event._signingGroupPubkeyY, + event._timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type depositLogSetupFailedFunc func( + _depositContractAddress common.Address, + _timestamp *big.Int, + blockNumber uint64, +) + +func (dl *DepositLog) WatchSetupFailed( + success depositLogSetupFailedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := dl.subscribeSetupFailed( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + dlLogger.Warning( + "subscription to event SetupFailed terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (dl *DepositLog) subscribeSetupFailed( + success depositLogSetupFailedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.DepositLogSetupFailed) + eventSubscription, err := dl.contract.WatchSetupFailed( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for SetupFailed events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event._depositContractAddress, + event._timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type depositLogStartedLiquidationFunc func( + _depositContractAddress common.Address, + _wasFraud bool, + _timestamp *big.Int, + blockNumber uint64, +) + +func (dl *DepositLog) WatchStartedLiquidation( + success depositLogStartedLiquidationFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := dl.subscribeStartedLiquidation( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + dlLogger.Warning( + "subscription to event StartedLiquidation terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (dl *DepositLog) subscribeStartedLiquidation( + success depositLogStartedLiquidationFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.DepositLogStartedLiquidation) + eventSubscription, err := dl.contract.WatchStartedLiquidation( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for StartedLiquidation events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event._depositContractAddress, + event._wasFraud, + event._timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type depositLogFraudDuringSetupFunc func( + _depositContractAddress common.Address, + _timestamp *big.Int, + blockNumber uint64, +) + +func (dl *DepositLog) WatchFraudDuringSetup( + success depositLogFraudDuringSetupFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := dl.subscribeFraudDuringSetup( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + dlLogger.Warning( + "subscription to event FraudDuringSetup terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (dl *DepositLog) subscribeFraudDuringSetup( + success depositLogFraudDuringSetupFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.DepositLogFraudDuringSetup) + eventSubscription, err := dl.contract.WatchFraudDuringSetup( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for FraudDuringSetup events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event._depositContractAddress, + event._timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} diff --git a/bindings/go/gen.go b/bindings/go/gen.go new file mode 100644 index 000000000..e63e947f1 --- /dev/null +++ b/bindings/go/gen.go @@ -0,0 +1,3 @@ +package gen + +//go:generate ./generate.sh diff --git a/bindings/go/generate.sh b/bindings/go/generate.sh new file mode 100755 index 000000000..65a73e49a --- /dev/null +++ b/bindings/go/generate.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +DIR=../../solidity + +# Source contracts for binding generation. +# They should include the subdirectory prefix if any. +FILES="DepositLog.sol deposit/Deposit.sol" + +SOLIDITY_DIR=$DIR SOLIDITY_FILES=$FILES make diff --git a/bindings/go/go.mod b/bindings/go/go.mod new file mode 100644 index 000000000..c75123b80 --- /dev/null +++ b/bindings/go/go.mod @@ -0,0 +1,11 @@ +module github.com/keep-network/tbtc + +go 1.13 + +require ( + github.com/ethereum/go-ethereum v1.9.10 + github.com/ipfs/go-log v1.0.4 + github.com/keep-network/keep-common v1.2.0 + github.com/keep-network/keep-core v1.3.0 + github.com/urfave/cli v1.22.1 +) diff --git a/bindings/go/go.sum b/bindings/go/go.sum new file mode 100644 index 000000000..1527f437a --- /dev/null +++ b/bindings/go/go.sum @@ -0,0 +1,1068 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.37.0/go.mod h1:TS1dMSSfndXH133OKGwekG838Om/cQT0BUHV3HcBgoo= +dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU= +dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU= +dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= +dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= +git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= +github.com/AndreasBriese/bbloom v0.0.0-20180913140656-343706a395b7/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= +github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= +github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= +github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= +github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= +github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/zstd v1.3.6-0.20190409195224-796139022798/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= +github.com/Kubuxu/go-os-helper v0.0.1/go.mod h1:N8B+I7vPCT80IcP58r50u4+gEEcsZETFUpAzWW2ep1Y= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= +github.com/Shopify/sarama v1.23.1/go.mod h1:XLH1GYJnLVE0XCr6KdJGVJRTwY30moWNJ4sERjXX6fs= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= +github.com/VictoriaMetrics/fastcache v1.5.3 h1:2odJnXLbFZcoV9KYtQ+7TH1UOq3dn3AssMgieaezkR4= +github.com/VictoriaMetrics/fastcache v1.5.3/go.mod h1:+jv9Ckb+za/P1ZRg/sulP5Ni1v49daAVERr0H3CuscE= +github.com/VictoriaMetrics/fastcache v1.5.7 h1:4y6y0G8PRzszQUYIQHHssv/jgPHAb5qQuuDNdCbyAgw= +github.com/VictoriaMetrics/fastcache v1.5.7/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8= +github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= +github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= +github.com/aristanetworks/fsnotify v1.4.2/go.mod h1:D/rtu7LpjYM8tRJphJ0hUBYpjai8SfX+aSNsWDTq/Ks= +github.com/aristanetworks/glog v0.0.0-20180419172825-c15b03b3054f/go.mod h1:KASm+qXFKs/xjSoWn30NrWBBvdTTQq+UjkhjEJHfSFA= +github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847 h1:rtI0fD4oG/8eVokGVPYJEW1F88p1ZNgXiEIs9thEE4A= +github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ= +github.com/aristanetworks/goarista v0.0.0-20190924011532-60b7b74727fd h1:2gXWYquahfk3RfmyLuMk47NCaf+1FFQ95FNM+HZN3Oo= +github.com/aristanetworks/goarista v0.0.0-20190924011532-60b7b74727fd/go.mod h1:Z4RTxGAuYhPzcq8+EdRM+R8M48Ssle2TsWtwRKa+vns= +github.com/aristanetworks/goarista v0.0.0-20200206021550-59c4040ef2d3 h1:y1poWrL93oTYqikei1Sf8eBE6cJxNPr5wJcfxdgbuXQ= +github.com/aristanetworks/goarista v0.0.0-20200206021550-59c4040ef2d3/go.mod h1:Z4RTxGAuYhPzcq8+EdRM+R8M48Ssle2TsWtwRKa+vns= +github.com/aristanetworks/splunk-hec-go v0.3.3/go.mod h1:1VHO9r17b0K7WmOlLb9nTk/2YanvOEnLMUgsFrxBROc= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/benbjohnson/clock v1.0.2/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= +github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= +github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= +github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnCiweXmzRIAiUWCInVmPgjkzgv5k4tVyXiQ= +github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= +github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= +github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= +github.com/btcsuite/btcd v0.20.1-beta h1:Ik4hyJqN8Jfyv3S4AGBOmyouMsYE3EdYODkMbQjwPGw= +github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= +github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= +github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= +github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= +github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= +github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= +github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= +github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= +github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= +github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= +github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= +github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.0.1-0.20190104013014-3767db7a7e18/go.mod h1:HD5P3vAIAh+Y2GAxg0PrPN1P8WkepXGpjbUPDHJqqKM= +github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= +github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davidlazar/go-crypto v0.0.0-20170701192655-dcfb0a7ac018/go.mod h1:rQYf4tfk5sSwFsnDg3qYaBxSjsD9S8+59vW0dKUgme4= +github.com/davidlazar/go-crypto v0.0.0-20190912175916-7055855a373f h1:BOaYiTvg8p9vBUXpklC22XSK/mifLF7lG9jtmYYi3Tc= +github.com/davidlazar/go-crypto v0.0.0-20190912175916-7055855a373f/go.mod h1:rQYf4tfk5sSwFsnDg3qYaBxSjsD9S8+59vW0dKUgme4= +github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea h1:j4317fAZh7X6GqbFowYdYdI0L9bwxL07jyPZIdepyZ0= +github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= +github.com/deckarep/golang-set v1.7.1 h1:SCQV0S6gTtp6itiFrTqI+pfmJ4LN85S1YzhDf9rTHJQ= +github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= +github.com/dgraph-io/badger v1.5.5-0.20190226225317-8115aed38f8f/go.mod h1:VZxzAIRPHRVNRKRo6AXrX9BJegn6il06VMTZVJYCIjQ= +github.com/dgraph-io/badger v1.6.0-rc1/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= +github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= +github.com/dgraph-io/badger v1.6.1/go.mod h1:FRmFw3uxvcpa8zG3Rxs0th+hCLIuaQg8HlNV5bjgnuU= +github.com/dgraph-io/ristretto v0.0.2/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= +github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dvyukov/go-fuzz v0.0.0-20200318091601-be3528f3a813/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c h1:JHHhtb9XWJrGNMcrVP6vyzO4dusgi/HnceHTgxSejUM= +github.com/edsrzf/mmap-go v0.0.0-20160512033002-935e0e8a636c/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/edsrzf/mmap-go v1.0.0 h1:CEBF7HpRnUCSJgGUb5h1Gm7e3VkmVDrR8lvWVLtrOFw= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/elastic/gosigar v0.8.1-0.20180330100440-37f05ff46ffa/go.mod h1:cdorVVzy1fhmEqmtgqkoE3bYtCfSCkVyjTyCIo22xvs= +github.com/elastic/gosigar v0.10.5 h1:GzPQ+78RaAb4J63unidA/JavQRKrB6s8IOzN6Ib59jo= +github.com/elastic/gosigar v0.10.5/go.mod h1:cdorVVzy1fhmEqmtgqkoE3bYtCfSCkVyjTyCIo22xvs= +github.com/ethereum/go-ethereum v1.9.10 h1:jooX7tWcscpC7ytufk73t9JMCeJQ7aJF2YmZJQEuvFo= +github.com/ethereum/go-ethereum v1.9.10/go.mod h1:lXHkVo/MTvsEXfYsmNzelZ8R1e0DTvdk/wMZJIRpaRw= +github.com/ethereum/go-ethereum v1.9.22 h1:/Fea9n2EWJuNJ9oahMq9luqjRBcbW7QWdThbcJl13ek= +github.com/ethereum/go-ethereum v1.9.22/go.mod h1:FQjK3ZwD8C5DYn7ukTmFee36rq1dOMESiUfXr5RUc1w= +github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5/go.mod h1:JpoxHjuQauoxiFMl1ie8Xc/7TfLuMZ5eOCONd1sUBHg= +github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc h1:jtW8jbpkO4YirRSyepBOH8E+2HEw6/hKkBvFPwhUN8c= +github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= +github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= +github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/garyburd/redigo v1.6.0/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= +github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= +github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= +github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= +github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= +github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= +github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= +github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= +github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2-0.20190517061210-b285ee9cfc6c/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0 h1:oOuy+ugB+P/kBdUnG5QaMXSIyJ1q38wWSojYCb3z5VQ= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.2-0.20200707131729-196ae77b8a26 h1:lMm2hD9Fy0ynom5+85/pbdkiYcBqM1JWmhpAXLmy0fw= +github.com/golang/snappy v0.0.2-0.20200707131729-196ae77b8a26/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= +github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gopacket v1.1.17/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= +github.com/google/gopacket v1.1.18 h1:lum7VRA9kdlvBi7/v2p7/zcbkduHaCH/SVVyurs7OpY= +github.com/google/gopacket v1.1.18/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA= +github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= +github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989 h1:giknQ4mEuDFmmHSrGcbargOuLHQGtywqo4mheITex54= +github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= +github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277 h1:E0whKxgp2ojts0FDgUA8dl62bmH0LxKanMoBr6MDTDM= +github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= +github.com/gxed/hashland/keccakpg v0.0.1/go.mod h1:kRzw3HkwxFU1mpmPP8v1WyQzwdGfmKFJ6tItnhQ67kU= +github.com/gxed/hashland/murmur3 v0.0.1/go.mod h1:KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48= +github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/golang-lru v0.0.0-20160813221303-0a025b7e63ad/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= +github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/holiman/uint256 v1.1.1 h1:4JywC80b+/hSfljFlEBLHrrh+CIONLDz9NuFl0af4Mw= +github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huin/goupnp v0.0.0-20161224104101-679507af18f3/go.mod h1:MZ2ZmwcBpvOoJ22IJsc7va19ZwoheaBk43rKg12SKag= +github.com/huin/goupnp v1.0.0 h1:wg75sLpL6DZqwHQN6E1Cfk6mtfzS45z8OV+ic+DtHRo= +github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= +github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883 h1:FSeK4fZCo8u40n2JMnyAsd6x7+SbvoOMHvQOU/n10P4= +github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= +github.com/influxdata/influxdb1-client v0.0.0-20190809212627-fc22c7df067e/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= +github.com/ipfs/go-cid v0.0.2/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= +github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= +github.com/ipfs/go-cid v0.0.4/go.mod h1:4LLaPOQwmk5z9LBgQnpkivrx8BJjUyGwTXCd5Xfj6+M= +github.com/ipfs/go-cid v0.0.5/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog= +github.com/ipfs/go-cid v0.0.6/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= +github.com/ipfs/go-cid v0.0.7 h1:ysQJVJA3fNDF1qigJbsSQOdjhVLsOEoPdh0+R97k3jY= +github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= +github.com/ipfs/go-datastore v0.0.1/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= +github.com/ipfs/go-datastore v0.1.0/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= +github.com/ipfs/go-datastore v0.1.1/go.mod h1:w38XXW9kVFNp57Zj5knbKWM2T+KOZCGDRVNdgPHtbHw= +github.com/ipfs/go-datastore v0.4.0/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= +github.com/ipfs/go-datastore v0.4.1/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= +github.com/ipfs/go-datastore v0.4.4 h1:rjvQ9+muFaJ+QZ7dN5B1MSDNQ0JVZKkkES/rMZmA8X8= +github.com/ipfs/go-datastore v0.4.4/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= +github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= +github.com/ipfs/go-ds-badger v0.0.2/go.mod h1:Y3QpeSFWQf6MopLTiZD+VT6IC1yZqaGmjvRcKeSGij8= +github.com/ipfs/go-ds-badger v0.0.5/go.mod h1:g5AuuCGmr7efyzQhLL8MzwqcauPojGPUaHzfGTzuE3s= +github.com/ipfs/go-ds-badger v0.0.7/go.mod h1:qt0/fWzZDoPW6jpQeqUjR5kBfhDNB65jd9YlmAvpQBk= +github.com/ipfs/go-ds-badger v0.2.1/go.mod h1:Tx7l3aTph3FMFrRS838dcSJh+jjA7cX9DrGVwx/NOwE= +github.com/ipfs/go-ds-badger v0.2.3/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBRn4FS6UHUk= +github.com/ipfs/go-ds-leveldb v0.0.1/go.mod h1:feO8V3kubwsEF22n0YRQCffeb79OOYIykR4L04tMOYc= +github.com/ipfs/go-ds-leveldb v0.1.0/go.mod h1:hqAW8y4bwX5LWcCtku2rFNX3vjDZCy5LZCg+cSZvYb8= +github.com/ipfs/go-ds-leveldb v0.4.1/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= +github.com/ipfs/go-ds-leveldb v0.4.2/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= +github.com/ipfs/go-ipfs-addr v0.0.1 h1:DpDFybnho9v3/a1dzJ5KnWdThWD1HrFLpQ+tWIyBaFI= +github.com/ipfs/go-ipfs-addr v0.0.1/go.mod h1:uKTDljHT3Q3SUWzDLp3aYUi8MrY32fgNgogsIa0npjg= +github.com/ipfs/go-ipfs-config v0.0.4 h1:zOWk1gGvIOptjHvvu0qSC8psB2IBKO/FbQArFnmm0LM= +github.com/ipfs/go-ipfs-config v0.0.4/go.mod h1:KDbHjNyg4e6LLQSQpkgQMBz6Jf4LXiWAcmnkcwmH0DU= +github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= +github.com/ipfs/go-ipfs-util v0.0.1/go.mod h1:spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc= +github.com/ipfs/go-ipfs-util v0.0.2 h1:59Sswnk1MFaiq+VcaknX7aYEyGyGDAA73ilhEK2POp8= +github.com/ipfs/go-ipfs-util v0.0.2/go.mod h1:CbPtkWJzjLdEcezDns2XYaehFVNXG9zrdrtMecczcsQ= +github.com/ipfs/go-ipns v0.0.2 h1:oq4ErrV4hNQ2Eim257RTYRgfOSV/s8BDaf9iIl4NwFs= +github.com/ipfs/go-ipns v0.0.2/go.mod h1:WChil4e0/m9cIINWLxZe1Jtf77oz5L05rO2ei/uKJ5U= +github.com/ipfs/go-log v0.0.1 h1:9XTUN/rW64BCG1YhPK9Hoy3q8nr4gOmHHBpgFdfw6Lc= +github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM= +github.com/ipfs/go-log v1.0.2/go.mod h1:1MNjMxe0u6xvJZgeqbJ8vdo2TKaGwZ1a0Bpza+sr2Sk= +github.com/ipfs/go-log v1.0.3/go.mod h1:OsLySYkwIbiSUR/yBTdv1qPtcE4FW3WPWk/ewz9Ru+A= +github.com/ipfs/go-log v1.0.4 h1:6nLQdX4W8P9yZZFH7mO+X/PzjN8Laozm/lMJ6esdgzY= +github.com/ipfs/go-log v1.0.4/go.mod h1:oDCg2FkjogeFOhqqb+N39l2RpTNPL6F/StPkB3kPgcs= +github.com/ipfs/go-log/v2 v2.0.2/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBWFaa9+0= +github.com/ipfs/go-log/v2 v2.0.3/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBWFaa9+0= +github.com/ipfs/go-log/v2 v2.0.5/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscwkWG+dw= +github.com/ipfs/go-log/v2 v2.1.1 h1:G4TtqN+V9y9HY9TA6BwbCVyyBZ2B9MbCjR2MtGx8FR0= +github.com/ipfs/go-log/v2 v2.1.1/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= +github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= +github.com/jackpal/go-nat-pmp v1.0.1/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458 h1:6OvNmYgJyexcZ3pYbTI9jWx5tHo1Dee/tWbLMfPe2TA= +github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= +github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= +github.com/jbenet/go-cienv v0.0.0-20150120210510-1bb1476777ec/go.mod h1:rGaEvXB4uRSZMmzKNLoXvTu1sfx+1kv/DojUlPrSZGs= +github.com/jbenet/go-cienv v0.1.0/go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA= +github.com/jbenet/go-temp-err-catcher v0.0.0-20150120210811-aac704a3f4f2/go.mod h1:8GXXJV31xl8whumTzdZsTt3RnUIiPqzkyf7mxToRCMs= +github.com/jbenet/go-temp-err-catcher v0.1.0 h1:zpb3ZH6wIE8Shj2sKS+khgRvf7T7RABoLk/+KKHggpk= +github.com/jbenet/go-temp-err-catcher v0.1.0/go.mod h1:0kJRvmDZXNMIiJirNPEYfhpPwbGVtZVWC34vc5WLsDk= +github.com/jbenet/goprocess v0.0.0-20160826012719-b497e2f366b8/go.mod h1:Ly/wlsjFq/qrU3Rar62tu1gASgGw6chQbSh/XgIIXCY= +github.com/jbenet/goprocess v0.1.3/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= +github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0o= +github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= +github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= +github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= +github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d/go.mod h1:P2viExyCEfeWGU259JnaQ34Inuec4R38JCyBx2edgD0= +github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 h1:I/yrLt2WilKxlQKCM52clh5rGzTKpVctGT1lH4Dc8Jw= +github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/karalabe/usb v0.0.0-20191104083709-911d15fe12a9 h1:ZHuwnjpP8LsVsUYqTqeVAI+GfDfJ6UNPrExZF+vX/DQ= +github.com/karalabe/usb v0.0.0-20191104083709-911d15fe12a9/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/keep-network/go-libp2p-bootstrap v0.0.0-20200423153828-ed815bc50aec h1:2pXAsi4OUUjZKr5ds5UOF2IxXN+jVW0WetVO+czkf+A= +github.com/keep-network/go-libp2p-bootstrap v0.0.0-20200423153828-ed815bc50aec/go.mod h1:xR8jf3/VJAjh3nWu5tFe8Yxnt2HvWsqZHfGef1P5oDk= +github.com/keep-network/keep-common v1.2.0 h1:hVd2tTd7vL+9CQP5Ntk5kjs+GYvkgrRNBcNvTuhHhVk= +github.com/keep-network/keep-common v1.2.0/go.mod h1:emxogTbBdey7M3jOzfxZOdfn139kN2mI2b2wA6AHKKo= +github.com/keep-network/keep-core v1.3.0 h1:7Tb33EmO/ntHOEbOiYciRlBhqu5Ln6KemWCaYK0Z6LA= +github.com/keep-network/keep-core v1.3.0/go.mod h1:1KsSSTQoN754TrFLW7kLy50pOG2CQ4BOfnJqdvEG7FA= +github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= +github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/reedsolomon v1.9.2/go.mod h1:CwCi+NUr9pqSVktrkN+Ondf06rkhYZ/pcNv7fu+8Un4= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/koron/go-ssdp v0.0.0-20191105050749-2e1c40ed0b5d h1:68u9r4wEvL3gYg2jvAOgROwZ3H+Y3hIDk4tbbmIjcYQ= +github.com/koron/go-ssdp v0.0.0-20191105050749-2e1c40ed0b5d/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/libp2p/go-addr-util v0.0.1/go.mod h1:4ac6O7n9rIAKB1dnd+s8IbbMXkt+oBpzX4/+RACcnlQ= +github.com/libp2p/go-addr-util v0.0.2 h1:7cWK5cdA5x72jX0g8iLrQWm5TRJZ6CzGdPEhWj7plWU= +github.com/libp2p/go-addr-util v0.0.2/go.mod h1:Ecd6Fb3yIuLzq4bD7VcywcVSBtefcAwnUISBM3WG15E= +github.com/libp2p/go-buffer-pool v0.0.1/go.mod h1:xtyIz9PMobb13WaxR6Zo1Pd1zXJKYg0a8KiIvDp3TzQ= +github.com/libp2p/go-buffer-pool v0.0.2 h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs= +github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= +github.com/libp2p/go-conn-security-multistream v0.1.0/go.mod h1:aw6eD7LOsHEX7+2hJkDxw1MteijaVcI+/eP2/x3J1xc= +github.com/libp2p/go-conn-security-multistream v0.2.0 h1:uNiDjS58vrvJTg9jO6bySd1rMKejieG7v45ekqHbZ1M= +github.com/libp2p/go-conn-security-multistream v0.2.0/go.mod h1:hZN4MjlNetKD3Rq5Jb/P5ohUnFLNzEAR4DLSzpn2QLU= +github.com/libp2p/go-eventbus v0.1.0/go.mod h1:vROgu5cs5T7cv7POWlWxBaVLxfSegC5UGQf8A2eEmx4= +github.com/libp2p/go-eventbus v0.2.1 h1:VanAdErQnpTioN2TowqNcOijf6YwhuODe4pPKSDpxGc= +github.com/libp2p/go-eventbus v0.2.1/go.mod h1:jc2S4SoEVPP48H9Wpzm5aiGwUCBMfGhVhhBjyhhCJs8= +github.com/libp2p/go-flow-metrics v0.0.1/go.mod h1:Iv1GH0sG8DtYN3SVJ2eG221wMiNpZxBdp967ls1g+k8= +github.com/libp2p/go-flow-metrics v0.0.2/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs= +github.com/libp2p/go-flow-metrics v0.0.3 h1:8tAs/hSdNvUiLgtlSy3mxwxWP4I9y/jlkPFT7epKdeM= +github.com/libp2p/go-flow-metrics v0.0.3/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs= +github.com/libp2p/go-libp2p v0.6.1/go.mod h1:CTFnWXogryAHjXAKEbOf1OWY+VeAP3lDMZkfEI5sT54= +github.com/libp2p/go-libp2p v0.7.0/go.mod h1:hZJf8txWeCduQRDC/WSqBGMxaTHCOYHt2xSU1ivxn0k= +github.com/libp2p/go-libp2p v0.7.4/go.mod h1:oXsBlTLF1q7pxr+9w6lqzS1ILpyHsaBPniVO7zIHGMw= +github.com/libp2p/go-libp2p v0.8.3/go.mod h1:EsH1A+8yoWK+L4iKcbPYu6MPluZ+CHWI9El8cTaefiM= +github.com/libp2p/go-libp2p v0.10.0/go.mod h1:yBJNpb+mGJdgrwbKAKrhPU0u3ogyNFTfjJ6bdM+Q/G8= +github.com/libp2p/go-libp2p v0.10.3 h1:Bc8/VjmC+pICtK6xG8YgVutZvCdK0MsroWCHP+6AdFQ= +github.com/libp2p/go-libp2p v0.10.3/go.mod h1:0ER6iPSaPeQjryNgOnm9bLNpMJCYmuw54xJXsVR17eE= +github.com/libp2p/go-libp2p-autonat v0.1.1/go.mod h1:OXqkeGOY2xJVWKAGV2inNF5aKN/djNA3fdpCWloIudE= +github.com/libp2p/go-libp2p-autonat v0.2.0/go.mod h1:DX+9teU4pEEoZUqR1PiMlqliONQdNbfzE1C718tcViI= +github.com/libp2p/go-libp2p-autonat v0.2.1/go.mod h1:MWtAhV5Ko1l6QBsHQNSuM6b1sRkXrpk0/LqCr+vCVxI= +github.com/libp2p/go-libp2p-autonat v0.2.2/go.mod h1:HsM62HkqZmHR2k1xgX34WuWDzk/nBwNHoeyyT4IWV6A= +github.com/libp2p/go-libp2p-autonat v0.2.3/go.mod h1:2U6bNWCNsAG9LEbwccBDQbjzQ8Krdjge1jLTE9rdoMM= +github.com/libp2p/go-libp2p-autonat v0.3.2 h1:OhDSwVVaq7liTaRIsFFYvsaPp0pn2yi0WazejZ4DUmo= +github.com/libp2p/go-libp2p-autonat v0.3.2/go.mod h1:0OzOi1/cVc7UcxfOddemYD5vzEqi4fwRbnZcJGLi68U= +github.com/libp2p/go-libp2p-blankhost v0.1.1/go.mod h1:pf2fvdLJPsC1FsVrNP3DUUvMzUts2dsLLBEpo1vW1ro= +github.com/libp2p/go-libp2p-blankhost v0.1.4/go.mod h1:oJF0saYsAXQCSfDq254GMNmLNz6ZTHTOvtF4ZydUvwU= +github.com/libp2p/go-libp2p-blankhost v0.1.6/go.mod h1:jONCAJqEP+Z8T6EQviGL4JsQcLx1LgTGtVqFNY8EMfQ= +github.com/libp2p/go-libp2p-blankhost v0.2.0 h1:3EsGAi0CBGcZ33GwRuXEYJLLPoVWyXJ1bcJzAJjINkk= +github.com/libp2p/go-libp2p-blankhost v0.2.0/go.mod h1:eduNKXGTioTuQAUcZ5epXi9vMl+t4d8ugUBRQ4SqaNQ= +github.com/libp2p/go-libp2p-circuit v0.1.4/go.mod h1:CY67BrEjKNDhdTk8UgBX1Y/H5c3xkAcs3gnksxY7osU= +github.com/libp2p/go-libp2p-circuit v0.2.1/go.mod h1:BXPwYDN5A8z4OEY9sOfr2DUQMLQvKt/6oku45YUmjIo= +github.com/libp2p/go-libp2p-circuit v0.2.2/go.mod h1:nkG3iE01tR3FoQ2nMm06IUrCpCyJp1Eo4A1xYdpjfs4= +github.com/libp2p/go-libp2p-circuit v0.2.3/go.mod h1:nkG3iE01tR3FoQ2nMm06IUrCpCyJp1Eo4A1xYdpjfs4= +github.com/libp2p/go-libp2p-circuit v0.3.1 h1:69ENDoGnNN45BNDnBd+8SXSetDuw0eJFcGmOvvtOgBw= +github.com/libp2p/go-libp2p-circuit v0.3.1/go.mod h1:8RMIlivu1+RxhebipJwFDA45DasLx+kkrp4IlJj53F4= +github.com/libp2p/go-libp2p-connmgr v0.2.4 h1:TMS0vc0TCBomtQJyWr7fYxcVYYhx+q/2gF++G5Jkl/w= +github.com/libp2p/go-libp2p-connmgr v0.2.4/go.mod h1:YV0b/RIm8NGPnnNWM7hG9Q38OeQiQfKhHCCs1++ufn0= +github.com/libp2p/go-libp2p-core v0.0.1/go.mod h1:g/VxnTZ/1ygHxH3dKok7Vno1VfpvGcGip57wjTU4fco= +github.com/libp2p/go-libp2p-core v0.0.4/go.mod h1:jyuCQP356gzfCFtRKyvAbNkyeuxb7OlyhWZ3nls5d2I= +github.com/libp2p/go-libp2p-core v0.2.0/go.mod h1:X0eyB0Gy93v0DZtSYbEM7RnMChm9Uv3j7yRXjO77xSI= +github.com/libp2p/go-libp2p-core v0.2.2/go.mod h1:8fcwTbsG2B+lTgRJ1ICZtiM5GWCWZVoVrLaDRvIRng0= +github.com/libp2p/go-libp2p-core v0.2.4/go.mod h1:STh4fdfa5vDYr0/SzYYeqnt+E6KfEV5VxfIrm0bcI0g= +github.com/libp2p/go-libp2p-core v0.2.5/go.mod h1:6+5zJmKhsf7yHn1RbmYDu08qDUpIUxGdqHuEZckmZOA= +github.com/libp2p/go-libp2p-core v0.3.0/go.mod h1:ACp3DmS3/N64c2jDzcV429ukDpicbL6+TrrxANBjPGw= +github.com/libp2p/go-libp2p-core v0.3.1/go.mod h1:thvWy0hvaSBhnVBaW37BvzgVV68OUhgJJLAa6almrII= +github.com/libp2p/go-libp2p-core v0.4.0/go.mod h1:49XGI+kc38oGVwqSBhDEwytaAxgZasHhFfQKibzTls0= +github.com/libp2p/go-libp2p-core v0.5.0/go.mod h1:49XGI+kc38oGVwqSBhDEwytaAxgZasHhFfQKibzTls0= +github.com/libp2p/go-libp2p-core v0.5.1/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= +github.com/libp2p/go-libp2p-core v0.5.2/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= +github.com/libp2p/go-libp2p-core v0.5.3/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= +github.com/libp2p/go-libp2p-core v0.5.4/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= +github.com/libp2p/go-libp2p-core v0.5.5/go.mod h1:vj3awlOr9+GMZJFH9s4mpt9RHHgGqeHCopzbYKZdRjM= +github.com/libp2p/go-libp2p-core v0.5.6/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= +github.com/libp2p/go-libp2p-core v0.5.7/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= +github.com/libp2p/go-libp2p-core v0.6.0/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= +github.com/libp2p/go-libp2p-core v0.6.1 h1:XS+Goh+QegCDojUZp00CaPMfiEADCrLjNZskWE7pvqs= +github.com/libp2p/go-libp2p-core v0.6.1/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= +github.com/libp2p/go-libp2p-crypto v0.0.1/go.mod h1:yJkNyDmO341d5wwXxDUGO0LykUVT72ImHNUqh5D/dBE= +github.com/libp2p/go-libp2p-crypto v0.1.0 h1:k9MFy+o2zGDNGsaoZl0MA3iZ75qXxr9OOoAZF+sD5OQ= +github.com/libp2p/go-libp2p-crypto v0.1.0/go.mod h1:sPUokVISZiy+nNuTTH/TY+leRSxnFj/2GLjtOTW90hI= +github.com/libp2p/go-libp2p-discovery v0.2.0/go.mod h1:s4VGaxYMbw4+4+tsoQTqh7wfxg97AEdo4GYBt6BadWg= +github.com/libp2p/go-libp2p-discovery v0.3.0/go.mod h1:o03drFnz9BVAZdzC/QUQ+NeQOu38Fu7LJGEOK2gQltw= +github.com/libp2p/go-libp2p-discovery v0.4.0/go.mod h1:bZ0aJSrFc/eX2llP0ryhb1kpgkPyTo23SJ5b7UQCMh4= +github.com/libp2p/go-libp2p-discovery v0.5.0 h1:Qfl+e5+lfDgwdrXdu4YNCWyEo3fWuP+WgN9mN0iWviQ= +github.com/libp2p/go-libp2p-discovery v0.5.0/go.mod h1:+srtPIU9gDaBNu//UHvcdliKBIcr4SfDcm0/PfPJLug= +github.com/libp2p/go-libp2p-host v0.1.0 h1:OZwENiFm6JOK3YR5PZJxkXlJE8a5u8g4YvAUrEV2MjM= +github.com/libp2p/go-libp2p-host v0.1.0/go.mod h1:5+fWuLbDn8OxoxPN3CV0vsLe1hAKScSMbT84qRfxum8= +github.com/libp2p/go-libp2p-kad-dht v0.8.3 h1:ceK5ML6s/I8UAcw6veoNsuEHdHvfo88leU/5uWOIFWs= +github.com/libp2p/go-libp2p-kad-dht v0.8.3/go.mod h1:HnYYy8taJWESkqiESd1ngb9XX/XGGsMA5G0Vj2HoSh4= +github.com/libp2p/go-libp2p-kbucket v0.4.2 h1:wg+VPpCtY61bCasGRexCuXOmEmdKjN+k1w+JtTwu9gA= +github.com/libp2p/go-libp2p-kbucket v0.4.2/go.mod h1:7sCeZx2GkNK1S6lQnGUW5JYZCFPnXzAZCCBBS70lytY= +github.com/libp2p/go-libp2p-loggables v0.1.0 h1:h3w8QFfCt2UJl/0/NW4K829HX/0S4KD31PQ7m8UXXO8= +github.com/libp2p/go-libp2p-loggables v0.1.0/go.mod h1:EyumB2Y6PrYjr55Q3/tiJ/o3xoDasoRYM7nOzEpoa90= +github.com/libp2p/go-libp2p-mplex v0.2.0/go.mod h1:Ejl9IyjvXJ0T9iqUTE1jpYATQ9NM3g+OtR+EMMODbKo= +github.com/libp2p/go-libp2p-mplex v0.2.1/go.mod h1:SC99Rxs8Vuzrf/6WhmH41kNn13TiYdAWNYHrwImKLnE= +github.com/libp2p/go-libp2p-mplex v0.2.2/go.mod h1:74S9eum0tVQdAfFiKxAyKzNdSuLqw5oadDq7+L/FELo= +github.com/libp2p/go-libp2p-mplex v0.2.3/go.mod h1:CK3p2+9qH9x+7ER/gWWDYJ3QW5ZxWDkm+dVvjfuG3ek= +github.com/libp2p/go-libp2p-mplex v0.2.4 h1:XFFXaN4jhqnIuJVjYOR3k6bnRj0mFfJOlIuDVww+4Zo= +github.com/libp2p/go-libp2p-mplex v0.2.4/go.mod h1:mI7iOezdWFOisvUwaYd3IDrJ4oVmgoXK8H331ui39CE= +github.com/libp2p/go-libp2p-nat v0.0.5/go.mod h1:1qubaE5bTZMJE+E/uu2URroMbzdubFz1ChgiN79yKPE= +github.com/libp2p/go-libp2p-nat v0.0.6 h1:wMWis3kYynCbHoyKLPBEMu4YRLltbm8Mk08HGSfvTkU= +github.com/libp2p/go-libp2p-nat v0.0.6/go.mod h1:iV59LVhB3IkFvS6S6sauVTSOrNEANnINbI/fkaLimiw= +github.com/libp2p/go-libp2p-net v0.1.0 h1:3t23V5cR4GXcNoFriNoZKFdUZEUDZgUkvfwkD2INvQE= +github.com/libp2p/go-libp2p-net v0.1.0/go.mod h1:R5VZbutk75tkC5YJJS61OCO1NWoajxYjCEV2RoHh3FY= +github.com/libp2p/go-libp2p-netutil v0.1.0/go.mod h1:3Qv/aDqtMLTUyQeundkKsA+YCThNdbQD54k3TqjpbFU= +github.com/libp2p/go-libp2p-peer v0.0.1/go.mod h1:nXQvOBbwVqoP+T5Y5nCjeH4sP9IX/J0AMzcDUVruVoo= +github.com/libp2p/go-libp2p-peer v0.2.0 h1:EQ8kMjaCUwt/Y5uLgjT8iY2qg0mGUT0N1zUjer50DsY= +github.com/libp2p/go-libp2p-peer v0.2.0/go.mod h1:RCffaCvUyW2CJmG2gAWVqwePwW7JMgxjsHm7+J5kjWY= +github.com/libp2p/go-libp2p-peerstore v0.0.1/go.mod h1:RabLyPVJLuNQ+GFyoEkfi8H4Ti6k/HtZJ7YKgtSq+20= +github.com/libp2p/go-libp2p-peerstore v0.1.0/go.mod h1:2CeHkQsr8svp4fZ+Oi9ykN1HBb6u0MOvdJ7YIsmcwtY= +github.com/libp2p/go-libp2p-peerstore v0.1.3/go.mod h1:BJ9sHlm59/80oSkpWgr1MyY1ciXAXV397W6h1GH/uKI= +github.com/libp2p/go-libp2p-peerstore v0.1.4/go.mod h1:+4BDbDiiKf4PzpANZDAT+knVdLxvqh7hXOujessqdzs= +github.com/libp2p/go-libp2p-peerstore v0.2.0/go.mod h1:N2l3eVIeAitSg3Pi2ipSrJYnqhVnMNQZo9nkSCuAbnQ= +github.com/libp2p/go-libp2p-peerstore v0.2.1/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRjwRLBr4TYKfNgrUkOPA= +github.com/libp2p/go-libp2p-peerstore v0.2.2/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRjwRLBr4TYKfNgrUkOPA= +github.com/libp2p/go-libp2p-peerstore v0.2.3/go.mod h1:K8ljLdFn590GMttg/luh4caB/3g0vKuY01psze0upRw= +github.com/libp2p/go-libp2p-peerstore v0.2.4/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= +github.com/libp2p/go-libp2p-peerstore v0.2.6 h1:2ACefBX23iMdJU9Ke+dcXt3w86MIryes9v7In4+Qq3U= +github.com/libp2p/go-libp2p-peerstore v0.2.6/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= +github.com/libp2p/go-libp2p-pnet v0.2.0 h1:J6htxttBipJujEjz1y0a5+eYoiPcFHhSYHH6na5f0/k= +github.com/libp2p/go-libp2p-pnet v0.2.0/go.mod h1:Qqvq6JH/oMZGwqs3N1Fqhv8NVhrdYcO0BW4wssv21LA= +github.com/libp2p/go-libp2p-pubsub v0.3.3 h1:/AzOAmjDc+IJWybEzhYj1UaV1HErqmo4v3pQVepbgi8= +github.com/libp2p/go-libp2p-pubsub v0.3.3/go.mod h1:DTMSVmZZfXodB/pvdTGrY2eHPZ9W2ev7hzTH83OKHrI= +github.com/libp2p/go-libp2p-quic-transport v0.5.0/go.mod h1:IEcuC5MLxvZ5KuHKjRu+dr3LjCT1Be3rcD/4d8JrX8M= +github.com/libp2p/go-libp2p-record v0.1.2/go.mod h1:pal0eNcT5nqZaTV7UGhqeGqxFgGdsU/9W//C8dqjQDk= +github.com/libp2p/go-libp2p-record v0.1.3 h1:R27hoScIhQf/A8XJZ8lYpnqh9LatJ5YbHs28kCIfql0= +github.com/libp2p/go-libp2p-record v0.1.3/go.mod h1:yNUff/adKIfPnYQXgp6FQmNu3gLJ6EMg7+/vv2+9pY4= +github.com/libp2p/go-libp2p-routing v0.0.1/go.mod h1:N51q3yTr4Zdr7V8Jt2JIktVU+3xBBylx1MZeVA6t1Ys= +github.com/libp2p/go-libp2p-routing v0.1.0 h1:hFnj3WR3E2tOcKaGpyzfP4gvFZ3t8JkQmbapN0Ct+oU= +github.com/libp2p/go-libp2p-routing v0.1.0/go.mod h1:zfLhI1RI8RLEzmEaaPwzonRvXeeSHddONWkcTcB54nE= +github.com/libp2p/go-libp2p-routing-helpers v0.2.3/go.mod h1:795bh+9YeoFl99rMASoiVgHdi5bjack0N1+AFAdbvBw= +github.com/libp2p/go-libp2p-secio v0.1.0/go.mod h1:tMJo2w7h3+wN4pgU2LSYeiKPrfqBgkOsdiKK77hE7c8= +github.com/libp2p/go-libp2p-secio v0.2.0/go.mod h1:2JdZepB8J5V9mBp79BmwsaPQhRPNN2NrnB2lKQcdy6g= +github.com/libp2p/go-libp2p-secio v0.2.1/go.mod h1:cWtZpILJqkqrSkiYcDBh5lA3wbT2Q+hz3rJQq3iftD8= +github.com/libp2p/go-libp2p-secio v0.2.2 h1:rLLPvShPQAcY6eNurKNZq3eZjPWfU9kXF2eI9jIYdrg= +github.com/libp2p/go-libp2p-secio v0.2.2/go.mod h1:wP3bS+m5AUnFA+OFO7Er03uO1mncHG0uVwGrwvjYlNY= +github.com/libp2p/go-libp2p-swarm v0.1.0/go.mod h1:wQVsCdjsuZoc730CgOvh5ox6K8evllckjebkdiY5ta4= +github.com/libp2p/go-libp2p-swarm v0.2.2/go.mod h1:fvmtQ0T1nErXym1/aa1uJEyN7JzaTNyBcHImCxRpPKU= +github.com/libp2p/go-libp2p-swarm v0.2.3/go.mod h1:P2VO/EpxRyDxtChXz/VPVXyTnszHvokHKRhfkEgFKNM= +github.com/libp2p/go-libp2p-swarm v0.2.7/go.mod h1:ZSJ0Q+oq/B1JgfPHJAT2HTall+xYRNYp1xs4S2FBWKA= +github.com/libp2p/go-libp2p-swarm v0.2.8 h1:cIUUvytBzNQmGSjnXFlI6UpoBGsaud82mJPIJVfkDlg= +github.com/libp2p/go-libp2p-swarm v0.2.8/go.mod h1:JQKMGSth4SMqonruY0a8yjlPVIkb0mdNSwckW7OYziM= +github.com/libp2p/go-libp2p-testing v0.0.2/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= +github.com/libp2p/go-libp2p-testing v0.0.3/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= +github.com/libp2p/go-libp2p-testing v0.0.4/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= +github.com/libp2p/go-libp2p-testing v0.1.0/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0= +github.com/libp2p/go-libp2p-testing v0.1.1/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0= +github.com/libp2p/go-libp2p-testing v0.1.2-0.20200422005655-8775583591d8/go.mod h1:Qy8sAncLKpwXtS2dSnDOP8ktexIAHKu+J+pnZOFZLTc= +github.com/libp2p/go-libp2p-tls v0.1.3 h1:twKMhMu44jQO+HgQK9X8NHO5HkeJu2QbhLzLJpa8oNM= +github.com/libp2p/go-libp2p-tls v0.1.3/go.mod h1:wZfuewxOndz5RTnCAxFliGjvYSDA40sKitV4c50uI1M= +github.com/libp2p/go-libp2p-transport-upgrader v0.1.1/go.mod h1:IEtA6or8JUbsV07qPW4r01GnTenLW4oi3lOPbUMGJJA= +github.com/libp2p/go-libp2p-transport-upgrader v0.2.0/go.mod h1:mQcrHj4asu6ArfSoMuyojOdjx73Q47cYD7s5+gZOlns= +github.com/libp2p/go-libp2p-transport-upgrader v0.3.0 h1:q3ULhsknEQ34eVDhv4YwKS8iet69ffs9+Fir6a7weN4= +github.com/libp2p/go-libp2p-transport-upgrader v0.3.0/go.mod h1:i+SKzbRnvXdVbU3D1dwydnTmKRPXiAR/fyvi1dXuL4o= +github.com/libp2p/go-libp2p-yamux v0.2.0/go.mod h1:Db2gU+XfLpm6E4rG5uGCFX6uXA8MEXOxFcRoXUODaK8= +github.com/libp2p/go-libp2p-yamux v0.2.2/go.mod h1:lIohaR0pT6mOt0AZ0L2dFze9hds9Req3OfS+B+dv4qw= +github.com/libp2p/go-libp2p-yamux v0.2.5/go.mod h1:Zpgj6arbyQrmZ3wxSZxfBmbdnWtbZ48OpsfmQVTErwA= +github.com/libp2p/go-libp2p-yamux v0.2.7/go.mod h1:X28ENrBMU/nm4I3Nx4sZ4dgjZ6VhLEn0XhIoZ5viCwU= +github.com/libp2p/go-libp2p-yamux v0.2.8 h1:0s3ELSLu2O7hWKfX1YjzudBKCP0kZ+m9e2+0veXzkn4= +github.com/libp2p/go-libp2p-yamux v0.2.8/go.mod h1:/t6tDqeuZf0INZMTgd0WxIRbtK2EzI2h7HbFm9eAKI4= +github.com/libp2p/go-maddr-filter v0.0.4/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q= +github.com/libp2p/go-maddr-filter v0.0.5/go.mod h1:Jk+36PMfIqCJhAnaASRH83bdAvfDRp/w6ENFaC9bG+M= +github.com/libp2p/go-mplex v0.0.3/go.mod h1:pK5yMLmOoBR1pNCqDlA2GQrdAVTMkqFalaTWe7l4Yd0= +github.com/libp2p/go-mplex v0.1.0/go.mod h1:SXgmdki2kwCUlCCbfGLEgHjC4pFqhTp0ZoV6aiKgxDU= +github.com/libp2p/go-mplex v0.1.1/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3SFXI1lk= +github.com/libp2p/go-mplex v0.1.2 h1:qOg1s+WdGLlpkrczDqmhYzyk3vCfsQ8+RxRTQjOZWwI= +github.com/libp2p/go-mplex v0.1.2/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3SFXI1lk= +github.com/libp2p/go-msgio v0.0.2/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= +github.com/libp2p/go-msgio v0.0.4/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= +github.com/libp2p/go-msgio v0.0.6 h1:lQ7Uc0kS1wb1EfRxO2Eir/RJoHkHn7t6o+EiwsYIKJA= +github.com/libp2p/go-msgio v0.0.6/go.mod h1:4ecVB6d9f4BDSL5fqvPiC4A3KivjWn+Venn/1ALLMWA= +github.com/libp2p/go-nat v0.0.4/go.mod h1:Nmw50VAvKuk38jUBcmNh6p9lUJLoODbJRvYAa/+KSDo= +github.com/libp2p/go-nat v0.0.5 h1:qxnwkco8RLKqVh1NmjQ+tJ8p8khNLFxuElYG/TwqW4Q= +github.com/libp2p/go-nat v0.0.5/go.mod h1:B7NxsVNPZmRLvMOwiEO1scOSyjA56zxYAGv1yQgRkEU= +github.com/libp2p/go-netroute v0.1.2/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= +github.com/libp2p/go-netroute v0.1.3 h1:1ngWRx61us/EpaKkdqkMjKk/ufr/JlIFYQAxV2XX8Ig= +github.com/libp2p/go-netroute v0.1.3/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= +github.com/libp2p/go-openssl v0.0.2/go.mod h1:v8Zw2ijCSWBQi8Pq5GAixw6DbFfa9u6VIYDXnvOXkc0= +github.com/libp2p/go-openssl v0.0.3/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= +github.com/libp2p/go-openssl v0.0.4/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= +github.com/libp2p/go-openssl v0.0.5/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= +github.com/libp2p/go-openssl v0.0.7/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= +github.com/libp2p/go-reuseport v0.0.1 h1:7PhkfH73VXfPJYKQ6JwS5I/eVcoyYi9IMNGc6FWpFLw= +github.com/libp2p/go-reuseport v0.0.1/go.mod h1:jn6RmB1ufnQwl0Q1f+YxAj8isJgDCQzaaxIFYDhcYEA= +github.com/libp2p/go-reuseport-transport v0.0.2/go.mod h1:YkbSDrvjUVDL6b8XqriyA20obEtsW9BLkuOUyQAOCbs= +github.com/libp2p/go-reuseport-transport v0.0.3 h1:zzOeXnTooCkRvoH+bSXEfXhn76+LAiwoneM0gnXjF2M= +github.com/libp2p/go-reuseport-transport v0.0.3/go.mod h1:Spv+MPft1exxARzP2Sruj2Wb5JSyHNncjf1Oi2dEbzM= +github.com/libp2p/go-sockaddr v0.0.2/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k= +github.com/libp2p/go-sockaddr v0.1.0/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k= +github.com/libp2p/go-stream-muxer v0.0.1/go.mod h1:bAo8x7YkSpadMTbtTaxGVHWUQsR/l5MEaHbKaliuT14= +github.com/libp2p/go-stream-muxer-multistream v0.2.0/go.mod h1:j9eyPol/LLRqT+GPLSxvimPhNph4sfYfMoDPd7HkzIc= +github.com/libp2p/go-stream-muxer-multistream v0.3.0 h1:TqnSHPJEIqDEO7h1wZZ0p3DXdvDSiLHQidKKUGZtiOY= +github.com/libp2p/go-stream-muxer-multistream v0.3.0/go.mod h1:yDh8abSIzmZtqtOt64gFJUXEryejzNb0lisTt+fAMJA= +github.com/libp2p/go-tcp-transport v0.1.0/go.mod h1:oJ8I5VXryj493DEJ7OsBieu8fcg2nHGctwtInJVpipc= +github.com/libp2p/go-tcp-transport v0.1.1/go.mod h1:3HzGvLbx6etZjnFlERyakbaYPdfjg2pWP97dFZworkY= +github.com/libp2p/go-tcp-transport v0.2.0 h1:YoThc549fzmNJIh7XjHVtMIFaEDRtIrtWciG5LyYAPo= +github.com/libp2p/go-tcp-transport v0.2.0/go.mod h1:vX2U0CnWimU4h0SGSEsg++AzvBcroCGYw28kh94oLe0= +github.com/libp2p/go-testutil v0.1.0/go.mod h1:81b2n5HypcVyrCg/MJx4Wgfp/VHojytjVe/gLzZ2Ehc= +github.com/libp2p/go-ws-transport v0.2.0/go.mod h1:9BHJz/4Q5A9ludYWKoGCFC5gUElzlHoKzu0yY9p/klM= +github.com/libp2p/go-ws-transport v0.3.0/go.mod h1:bpgTJmRZAvVHrgHybCVyqoBmyLQ1fiZuEaBYusP5zsk= +github.com/libp2p/go-ws-transport v0.3.1 h1:ZX5rWB8nhRRJVaPO6tmkGI/Xx8XNboYX20PW5hXIscw= +github.com/libp2p/go-ws-transport v0.3.1/go.mod h1:bpgTJmRZAvVHrgHybCVyqoBmyLQ1fiZuEaBYusP5zsk= +github.com/libp2p/go-yamux v1.2.2/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= +github.com/libp2p/go-yamux v1.3.0/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= +github.com/libp2p/go-yamux v1.3.3/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= +github.com/libp2p/go-yamux v1.3.5/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= +github.com/libp2p/go-yamux v1.3.7 h1:v40A1eSPJDIZwz2AvrV3cxpTZEGDP11QJbukmEhYyQI= +github.com/libp2p/go-yamux v1.3.7/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= +github.com/lucas-clemente/quic-go v0.16.0/go.mod h1:I0+fcNTdb9eS1ZcjQZbDVPGchJ86chcIxPALn9lEJqE= +github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI= +github.com/marten-seemann/qtls v0.9.1/go.mod h1:T1MmAdDPyISzxlK6kjRr0pcZFBVd1OZbBb/j3cvzHhk= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.0 h1:v2XXALHHh6zHfYTJ+cSkwtyffnaOyR1MXaA91mTrb8o= +github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= +github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035 h1:USWjF42jDCSEeikX/G1g40ZWnsPXN5WkZ4jMHZWyBK4= +github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.5 h1:tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.7 h1:UvyT9uN+3r7yLEYSlJsbQGdsaB/a0DlgWP3pql6iwOc= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= +github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= +github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= +github.com/miekg/dns v1.1.12/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= +github.com/miekg/dns v1.1.30/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= +github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g= +github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= +github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= +github.com/minio/sha256-simd v0.0.0-20190328051042-05b4dd3047e5/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= +github.com/minio/sha256-simd v0.1.0/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= +github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= +github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU= +github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= +github.com/mr-tron/base58 v1.1.1/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= +github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= +github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= +github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= +github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= +github.com/multiformats/go-base32 v0.0.3 h1:tw5+NhuwaOjJCC5Pp82QuXbrmLzWg7uxlMFp8Nq/kkI= +github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= +github.com/multiformats/go-base36 v0.1.0 h1:JR6TyF7JjGd3m6FbLU2cOxhC0Li8z8dLNGQ89tUg4F4= +github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= +github.com/multiformats/go-multiaddr v0.0.1/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= +github.com/multiformats/go-multiaddr v0.0.2/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= +github.com/multiformats/go-multiaddr v0.0.4/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= +github.com/multiformats/go-multiaddr v0.1.0/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= +github.com/multiformats/go-multiaddr v0.1.1/go.mod h1:aMKBKNEYmzmDmxfX88/vz+J5IU55txyt0p4aiWVohjo= +github.com/multiformats/go-multiaddr v0.2.0/go.mod h1:0nO36NvPpyV4QzvTLi/lafl2y95ncPj0vFwVF6k6wJ4= +github.com/multiformats/go-multiaddr v0.2.1/go.mod h1:s/Apk6IyxfvMjDafnhJgJ3/46z7tZ04iMk5wP4QMGGE= +github.com/multiformats/go-multiaddr v0.2.2 h1:XZLDTszBIJe6m0zF6ITBrEcZR73OPUhCBBS9rYAuUzI= +github.com/multiformats/go-multiaddr v0.2.2/go.mod h1:NtfXiOtHvghW9KojvtySjH5y0u0xW5UouOmQQrn6a3Y= +github.com/multiformats/go-multiaddr-dns v0.0.1/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= +github.com/multiformats/go-multiaddr-dns v0.0.2/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= +github.com/multiformats/go-multiaddr-dns v0.2.0 h1:YWJoIDwLePniH7OU5hBnDZV6SWuvJqJ0YtN6pLeH9zA= +github.com/multiformats/go-multiaddr-dns v0.2.0/go.mod h1:TJ5pr5bBO7Y1B18djPuRsVkduhQH2YqYSbxWJzYGdK0= +github.com/multiformats/go-multiaddr-fmt v0.0.1/go.mod h1:aBYjqL4T/7j4Qx+R73XSv/8JsgnRFlf0w2KGLCmXl3Q= +github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E= +github.com/multiformats/go-multiaddr-fmt v0.1.0/go.mod h1:hGtDIW4PU4BqJ50gW2quDuPVjyWNZxToGUh/HwTZYJo= +github.com/multiformats/go-multiaddr-net v0.0.1/go.mod h1:nw6HSxNmCIQH27XPGBuX+d1tnvM7ihcFwHMSstNAVUU= +github.com/multiformats/go-multiaddr-net v0.1.0/go.mod h1:5JNbcfBOP4dnhoZOv10JJVkJO0pCCEf8mTnipAo2UZQ= +github.com/multiformats/go-multiaddr-net v0.1.1/go.mod h1:5JNbcfBOP4dnhoZOv10JJVkJO0pCCEf8mTnipAo2UZQ= +github.com/multiformats/go-multiaddr-net v0.1.2/go.mod h1:QsWt3XK/3hwvNxZJp92iMQKME1qHfpYmyIjFVsSOY6Y= +github.com/multiformats/go-multiaddr-net v0.1.3/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= +github.com/multiformats/go-multiaddr-net v0.1.4/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= +github.com/multiformats/go-multiaddr-net v0.1.5 h1:QoRKvu0xHN1FCFJcMQLbG/yQE2z441L5urvG3+qyz7g= +github.com/multiformats/go-multiaddr-net v0.1.5/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= +github.com/multiformats/go-multibase v0.0.1/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= +github.com/multiformats/go-multibase v0.0.3 h1:l/B6bJDQjvQ5G52jw4QGSYeOTZoAwIO77RblWplfIqk= +github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= +github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U= +github.com/multiformats/go-multihash v0.0.5/go.mod h1:lt/HCbqlQwlPBz7lv0sQCdtfcMtlJvakRUn/0Ual8po= +github.com/multiformats/go-multihash v0.0.8/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= +github.com/multiformats/go-multihash v0.0.9/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= +github.com/multiformats/go-multihash v0.0.10/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= +github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= +github.com/multiformats/go-multihash v0.0.14 h1:QoBceQYQQtNUuf6s7wHxnE2c8bhbMqhfGzNI032se/I= +github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= +github.com/multiformats/go-multistream v0.1.0/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= +github.com/multiformats/go-multistream v0.1.1/go.mod h1:KmHZ40hzVxiaiwlj3MEbYgK9JFk2/9UktWZAF54Du38= +github.com/multiformats/go-multistream v0.1.2 h1:knyamLYMPFPngQjGQ0lhnlys3jtVR/3xV6TREUJr+fE= +github.com/multiformats/go-multistream v0.1.2/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= +github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= +github.com/multiformats/go-varint v0.0.2/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= +github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= +github.com/multiformats/go-varint v0.0.6 h1:gk85QWKxh3TazbLxED/NlDVv8+q+ReFJk7Y2W/KhfNY= +github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= +github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= +github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= +github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c h1:1RHs3tNxjXGHeul8z2t6H2N2TlAqpKe5yryJztRx4Jk= +github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.2 h1:sq53g+DWf0J6/ceFUHpQ0nAEb6WgM++fq16MZ91cS6o= +github.com/olekukonko/tablewriter v0.0.2/go.mod h1:rSAaSIOAGT9odnlyGlUfAJaoc5w2fSBUmeGDbRWPxyQ= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= +github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/openconfig/gnmi v0.0.0-20190823184014-89b2bf29312c/go.mod h1:t+O9It+LKzfOAhKTT5O0ehDix+MTqbtT0T9t+7zzOvc= +github.com/openconfig/reference v0.0.0-20190727015836-8dfd928c9696/go.mod h1:ym2A+zigScwkSEb/cVQB0/ZMpU3rqiH6X7WRRsxgOGw= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= +github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= +github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222 h1:goeTyGkArOZIVOMA0dQbyuPWGNQJZGPwPu/QS9GlpnA= +github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= +github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= +github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 h1:oYW+YCJ1pachXTQmzR3rNLYGGz4g/UgFcjb28p/viDM= +github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= +github.com/pierrec/lz4 v0.0.0-20190327172049-315a67e90e41/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= +github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= +github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150 h1:ZeU+auZj1iNzN8iVhff6M38Mfu73FQiJve/GEXYJBjE= +github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/prometheus/tsdb v0.10.0 h1:If5rVCMTp6W2SiRAQFlbpJNgVlgMEd+U2GZckwK38ic= +github.com/prometheus/tsdb v0.10.0/go.mod h1:oi49uRhEe9dPUTlS3JRZOwJuVi6tmh10QSgwXEyGCt4= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/rjeczalik/notify v0.9.1 h1:CLCKso/QK1snAlnhNR/CNvNiFU2saUtjV0bx3EwNeCE= +github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= +github.com/rjeczalik/notify v0.9.2 h1:MiTWrPj55mNDHEiIX5YUSKefw/+lCQVoAFmD6oQm5w8= +github.com/rjeczalik/notify v0.9.2/go.mod h1:aErll2f0sUX9PXZnVNyeiObbmTlk5jnMoCa4QEjJeqM= +github.com/robertkrimen/otto v0.0.0-20170205013659-6a77b7cbc37d/go.mod h1:xvqspoSXJTIpemEonrMDFq6XzwHYYgToXWj5eRX1OtY= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00 h1:8DPul/X0IT/1TNMIxoKLwdemEOBBHDC/K4EB16Cw5WE= +github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= +github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521 h1:3hxavr+IHMsQBrYUPQM5v0CgENFktkkbg1sfpgM3h20= +github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= +github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/shirou/gopsutil v2.20.5+incompatible h1:tYH07UPoQt0OCQdgWWMgYHy3/a9bcxNpBIysykNIP7I= +github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= +github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY= +github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM= +github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470/go.mod h1:2dOwnU2uBioM+SGy2aZoq1f/Sd1l9OkAeAUvjSyvgU0= +github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= +github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= +github.com/shurcooL/gofontwoff v0.0.0-20180329035133-29b52fc0a18d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw= +github.com/shurcooL/gopherjslib v0.0.0-20160914041154-feb6d3990c2c/go.mod h1:8d3azKNyqcHP1GaQE/c6dDgjkgSx2BZ4IoEi4F1reUI= +github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU= +github.com/shurcooL/highlight_go v0.0.0-20181028180052-98c3abbbae20/go.mod h1:UDKB5a1T23gOMUJrI+uSuH0VRDStOiUVSjBTRDVBVag= +github.com/shurcooL/home v0.0.0-20181020052607-80b7ffcb30f9/go.mod h1:+rgNQw2P9ARFAs37qieuu7ohDNQ3gds9msbT2yn85sg= +github.com/shurcooL/htmlg v0.0.0-20170918183704-d01228ac9e50/go.mod h1:zPn1wHpTIePGnXSHpsVPWEktKXHr6+SS6x/IKRb7cpw= +github.com/shurcooL/httperror v0.0.0-20170206035902-86b7830d14cc/go.mod h1:aYMfkZ6DWSJPJ6c4Wwz3QtW22G7mf/PEgaB9k/ik5+Y= +github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= +github.com/shurcooL/httpgzip v0.0.0-20180522190206-b1c53ac65af9/go.mod h1:919LwcH0M7/W4fcZ0/jy0qGght1GIhqyS/EgWGH2j5Q= +github.com/shurcooL/issues v0.0.0-20181008053335-6292fdc1e191/go.mod h1:e2qWDig5bLteJ4fwvDAc2NHzqFEthkqn7aOZAOpj+PQ= +github.com/shurcooL/issuesapp v0.0.0-20180602232740-048589ce2241/go.mod h1:NPpHK2TI7iSaM0buivtFUc9offApnI0Alt/K8hcHy0I= +github.com/shurcooL/notifications v0.0.0-20181007000457-627ab5aea122/go.mod h1:b5uSkrEVM1jQUspwbixRBhaIjIzL2xazXp6kntxYle0= +github.com/shurcooL/octicon v0.0.0-20181028054416-fa4f57f9efb2/go.mod h1:eWdoE5JD4R5UVWDucdOPg1g2fqQRq78IQa9zlOV1vpQ= +github.com/shurcooL/reactions v0.0.0-20181006231557-f2e0b4ca5b82/go.mod h1:TCR1lToEk4d2s07G3XGfz2QrgHXg4RJBvjrOozvoWfk= +github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4= +github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/smola/gocompat v0.2.0/go.mod h1:1B0MlxbmoZNo3h8guHp8HztB3BSYR5itql9qtVc0ypY= +github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= +github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= +github.com/spacemonkeygo/openssl v0.0.0-20181017203307-c2dcc5cca94a/go.mod h1:7AyxJNCJ7SBZ1MfVQCWD6Uqo2oubI2Eq2y2eqf+A5r0= +github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572/go.mod h1:w0SWMsp6j9O/dk4/ZpIhL+3CkG8ofA2vuv7k+ltqUMc= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= +github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/src-d/envconfig v1.0.0/go.mod h1:Q9YQZ7BKITldTBnoxsE5gOeB5y66RyPXeue/R4aaNBc= +github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 h1:Gb2Tyox57NRNuZ2d3rmvB3pcmbu7O1RS3m8WRx7ilrg= +github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= +github.com/status-im/keycard-go v0.0.0-20191119114148-6dd40a46baa0 h1:5UdlDkkBoPrJfh7zkfoR3X5utJhNs/MCQysK3x0ycgg= +github.com/status-im/keycard-go v0.0.0-20191119114148-6dd40a46baa0/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= +github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570 h1:gIlAHnH1vJb5vwEjIp5kBj/eu99p/bl0Ay2goiPe5xE= +github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw= +github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3 h1:njlZPzLwU639dk2kqnCPPv+wNjq7Xb6EfUxe/oX0/NM= +github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= +github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d h1:gZZadD8H+fF+n9CmNhYL1Y0dJB+kLOmKd7FbPJLeGHs= +github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= +github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca h1:Ld/zXl5t4+D69SiV4JoN7kkfvJdOWlPpfxrzxpLMoUk= +github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= +github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= +github.com/templexxx/cpufeat v0.0.0-20180724012125-cef66df7f161/go.mod h1:wM7WEvslTq+iOEAMDLSzhVuOt5BRZ05WirO+b09GHQU= +github.com/templexxx/xor v0.0.0-20181023030647-4e92f724b73b/go.mod h1:5XA7W9S6mni3h5uvOC75dA3m9CCCaS83lltmc0ukdi4= +github.com/tjfoc/gmsm v1.0.1/go.mod h1:XxO4hdhhrzAd+G4CjDqaOkd0hUzmtPR/d3EiBBMn/wc= +github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef h1:wHSqTBrZW24CsNJDfeh9Ex6Pm0Rcpc7qrgKBiL44vF4= +github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= +github.com/tyler-smith/go-bip39 v1.0.2 h1:+t3w+KwLXO6154GNJY+qUtIxLTmFjfUmpguQT1OlOT8= +github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= +github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= +github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= +github.com/wangjia184/sortedset v0.0.0-20160527075905-f5d03557ba30/go.mod h1:YkocrP2K2tcw938x9gCOmT5G5eCD6jsTz0SZuyAqwIE= +github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 h1:EKhdznlJHPMoKr0XTrX+IlJs1LH3lyx2nfr1dOlZ79k= +github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1/go.mod h1:8UvriyWtv5Q5EOgjHaSseUEdkQfvwFv1I/In/O2M9gc= +github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc h1:9lDbC6Rz4bwmou+oE6Dt4Cb2BGMur5eR/GYptkKUVHo= +github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM= +github.com/whyrusleeping/go-logging v0.0.1/go.mod h1:lDPYj54zutzG1XYfHAhcc7oNXEburHQBn+Iqd4yS4vE= +github.com/whyrusleeping/mafmt v1.2.8/go.mod h1:faQJFPbLSxzD9xpA02ttW/tS9vZykNvXwGvqIpk20FA= +github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9/go.mod h1:j4l84WPFclQPj320J9gp0XwNKBb3U0zt5CBqjPp22G4= +github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 h1:E9S12nwJwEOXe2d6gT6qxdvqMnNq+VnSsKPgm2ZZNds= +github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7/go.mod h1:X2c0RVCI1eSUFI8eLcY3c0423ykwiUdxLJtkDvruhjI= +github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee h1:lYbXeSvJi5zk5GLKVuid9TVjS9a0OmLIDKTfoZBL6Ow= +github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee/go.mod h1:m2aV4LZI4Aez7dP5PMyVKEHhUyEJ/RjmPEDOpDvudHg= +github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208 h1:1cngl9mPEoITZG8s8cVcUy5CeIBYhEESkOB7m6Gmkrk= +github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees= +github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= +github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= +github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/xtaci/kcp-go v5.4.5+incompatible/go.mod h1:bN6vIwHQbfHaHtFpEssmWsN45a+AZwO7eyRCmEIbtvE= +github.com/xtaci/lossyconn v0.0.0-20190602105132-8df528c0c9ae/go.mod h1:gXtu8J62kEgmN++bm9BVICuT/e8yiLI2KFobd/TRFsE= +go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= +go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= +go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= +go.uber.org/zap v1.15.0 h1:ZZCA22JRF2gQE5FoNmhmrf7jeJJ2uhqDUNRYKm8dvmM= +go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= +go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= +golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= +golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190225124518-7f87c0fbb88b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190926114937-fa1a29108794 h1:4Yo9XtTfxfBCecLiBW8TYsFIdN7TkDhjGLWetFo4JSo= +golang.org/x/crypto v0.0.0-20190926114937-fa1a29108794/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5 h1:Q7tZBpemrlsc2I7IyODzhtallWRSm4Q0d09pL6XbQtU= +golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20200801112145-973feb4309de/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190227160552-c95aed5357e7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190228165749-92fc7df08ae7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190912160710-24e19bdeb0f2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190926025831-c00fd9afed17 h1:qPnAdmjNA41t3QBTx2mFGf/SD1IoslhYu7AmdsVzCcs= +golang.org/x/net v0.0.0-20190926025831-c00fd9afed17/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190219092855-153ac476189d/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190405154228-4b34438f7a67/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190526052359-791d8a0f4d09/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190912141932-bc967efca4b8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69 h1:rOhMmluY6kLMhdnrivzec6lLgaVbMHMn2ISQXJeJ5EM= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8 h1:AvbQYmiaaaza3cW3QXRyPo5kYgpFIzOAfeAAN7m3qQ4= +golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181130052023-1c3d964395ce/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190912185636-87d9f09c5d89/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190925230517-ea99b82c7b93 h1:Ejrp5SZ9rwPbsIk7rakjfOLd9H06/JNTx+5mO81yBz4= +golang.org/x/tools v0.0.0-20190925230517-ea99b82c7b93/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216052735-49a3e744a425 h1:VvQyQJN0tSuecqgcIxMWnnfG5kSmgy9KZR9sW3W5QeA= +golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69 h1:yBHHx+XZqXJBm6Exke3N7V9gnlsyXxoCPEb1yVenjfk= +golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= +google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= +google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= +google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a/go.mod h1:KF9sEfUPAXdG8Oev9e99iLGnl2uJMjc5B+4y3O7x610= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= +gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q= +gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4= +gopkg.in/jcmturner/gokrb5.v7 v7.2.3/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= +gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= +gopkg.in/olebedev/go-duktape.v3 v3.0.0-20190213234257-ec84240a7772/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= +gopkg.in/olebedev/go-duktape.v3 v3.0.0-20190709231704-1e4459ed25ff h1:uuol9OUzSvZntY1v963NAbVd7A+PHLMz1FlCe3Lorcs= +gopkg.in/olebedev/go-duktape.v3 v3.0.0-20190709231704-1e4459ed25ff/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= +gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6 h1:a6cXbcDDUkSBlpnkWV1bJ+vv3mOgQEltEJ2rPxroVu0= +gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= +gopkg.in/redis.v4 v4.2.4/go.mod h1:8KREHdypkCEojGKQcjMqAODMICIVwZAONWq8RowTITA= +gopkg.in/sourcemap.v1 v1.0.5/go.mod h1:2RlvNNSMglmRrcvhfuzp4hQHwOtjxlbjX7UPY/GXb78= +gopkg.in/src-d/go-cli.v0 v0.0.0-20181105080154-d492247bbc0d/go.mod h1:z+K8VcOYVYcSwSjGebuDL6176A1XskgbtNl64NSg+n8= +gopkg.in/src-d/go-log.v1 v1.0.1/go.mod h1:GN34hKP0g305ysm2/hctJ0Y8nWP3zxXXJ8GFabTyABE= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/urfave/cli.v1 v1.20.0 h1:NdAVW6RYxDif9DhDHaAortIu956m2c0v+09AZBPTbE0= +gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= +sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= +sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= From 29eeaf8dfc0f23d7f3d33810b7fc7f7b196831c4 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Wed, 14 Oct 2020 18:43:41 +0200 Subject: [PATCH 02/14] Change module name --- bindings/go/cmd/Deposit.go | 384 +++---- bindings/go/cmd/DepositLog.go | 124 +-- bindings/go/contract/Deposit.go | 1636 ++++++++++++++-------------- bindings/go/contract/DepositLog.go | 978 ++++++++--------- bindings/go/go.mod | 2 +- bindings/go/go.sum | 1 + 6 files changed, 1563 insertions(+), 1562 deletions(-) diff --git a/bindings/go/cmd/Deposit.go b/bindings/go/cmd/Deposit.go index 55dad0212..5764b857b 100644 --- a/bindings/go/cmd/Deposit.go +++ b/bindings/go/cmd/Deposit.go @@ -16,7 +16,7 @@ import ( "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" "github.com/keep-network/keep-common/pkg/cmd" "github.com/keep-network/keep-core/config" - "github.com/keep-network/tbtc/contract" + "github.com/keep-network/tbtc/bindings/go/contract" "github.com/urfave/cli" ) @@ -52,10 +52,10 @@ func init() { Usage: `Provides access to the Deposit contract.`, Description: depositDescription, Subcommands: []cli.Command{{ - Name: "funding-info", - Usage: "Calls the constant method fundingInfo on the Deposit contract.", + Name: "remaining-term", + Usage: "Calls the constant method remainingTerm on the Deposit contract.", ArgsUsage: "", - Action: dFundingInfo, + Action: dRemainingTerm, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { @@ -66,38 +66,38 @@ func init() { Before: cmd.ArgCountChecker(1), Flags: cmd.ConstFlags, }, { - Name: "undercollateralized-threshold-percent", - Usage: "Calls the constant method undercollateralizedThresholdPercent on the Deposit contract.", - ArgsUsage: "", - Action: dUndercollateralizedThresholdPercent, - Before: cmd.ArgCountChecker(0), + Name: "get-owner-redemption-tbtc-requirement", + Usage: "Calls the constant method getOwnerRedemptionTbtcRequirement on the Deposit contract.", + ArgsUsage: "[_redeemer] ", + Action: dGetOwnerRedemptionTbtcRequirement, + Before: cmd.ArgCountChecker(1), Flags: cmd.ConstFlags, }, { - Name: "utxo-value", - Usage: "Calls the constant method utxoValue on the Deposit contract.", + Name: "keep-address", + Usage: "Calls the constant method keepAddress on the Deposit contract.", ArgsUsage: "", - Action: dUtxoValue, + Action: dKeepAddress, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "current-state", - Usage: "Calls the constant method currentState on the Deposit contract.", + Name: "auction-value", + Usage: "Calls the constant method auctionValue on the Deposit contract.", ArgsUsage: "", - Action: dCurrentState, + Action: dAuctionValue, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-owner-redemption-tbtc-requirement", - Usage: "Calls the constant method getOwnerRedemptionTbtcRequirement on the Deposit contract.", - ArgsUsage: "[_redeemer] ", - Action: dGetOwnerRedemptionTbtcRequirement, - Before: cmd.ArgCountChecker(1), + Name: "collateralization-percentage", + Usage: "Calls the constant method collateralizationPercentage on the Deposit contract.", + ArgsUsage: "", + Action: dCollateralizationPercentage, + Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "in-active", - Usage: "Calls the constant method inActive on the Deposit contract.", + Name: "lot-size-satoshis", + Usage: "Calls the constant method lotSizeSatoshis on the Deposit contract.", ArgsUsage: "", - Action: dInActive, + Action: dLotSizeSatoshis, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { @@ -107,13 +107,6 @@ func init() { Action: dLotSizeTbtc, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, - }, { - Name: "lot-size-satoshis", - Usage: "Calls the constant method lotSizeSatoshis on the Deposit contract.", - ArgsUsage: "", - Action: dLotSizeSatoshis, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, }, { Name: "severely-undercollateralized-threshold-percent", Usage: "Calls the constant method severelyUndercollateralizedThresholdPercent on the Deposit contract.", @@ -122,101 +115,94 @@ func init() { Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "initial-collateralized-percent", - Usage: "Calls the constant method initialCollateralizedPercent on the Deposit contract.", + Name: "undercollateralized-threshold-percent", + Usage: "Calls the constant method undercollateralizedThresholdPercent on the Deposit contract.", ArgsUsage: "", - Action: dInitialCollateralizedPercent, + Action: dUndercollateralizedThresholdPercent, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "keep-address", - Usage: "Calls the constant method keepAddress on the Deposit contract.", + Name: "withdrawable-amount", + Usage: "Calls the constant method withdrawableAmount on the Deposit contract.", ArgsUsage: "", - Action: dKeepAddress, + Action: dWithdrawableAmount, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "withdrawable-amount", - Usage: "Calls the constant method withdrawableAmount on the Deposit contract.", + Name: "current-state", + Usage: "Calls the constant method currentState on the Deposit contract.", ArgsUsage: "", - Action: dWithdrawableAmount, + Action: dCurrentState, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "collateralization-percentage", - Usage: "Calls the constant method collateralizationPercentage on the Deposit contract.", + Name: "initial-collateralized-percent", + Usage: "Calls the constant method initialCollateralizedPercent on the Deposit contract.", ArgsUsage: "", - Action: dCollateralizationPercentage, + Action: dInitialCollateralizedPercent, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "remaining-term", - Usage: "Calls the constant method remainingTerm on the Deposit contract.", + Name: "signer-fee-tbtc", + Usage: "Calls the constant method signerFeeTbtc on the Deposit contract.", ArgsUsage: "", - Action: dRemainingTerm, + Action: dSignerFeeTbtc, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "auction-value", - Usage: "Calls the constant method auctionValue on the Deposit contract.", + Name: "funding-info", + Usage: "Calls the constant method fundingInfo on the Deposit contract.", ArgsUsage: "", - Action: dAuctionValue, + Action: dFundingInfo, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "signer-fee-tbtc", - Usage: "Calls the constant method signerFeeTbtc on the Deposit contract.", + Name: "in-active", + Usage: "Calls the constant method inActive on the Deposit contract.", ArgsUsage: "", - Action: dSignerFeeTbtc, + Action: dInActive, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "notify-redemption-signature-timed-out", - Usage: "Calls the method notifyRedemptionSignatureTimedOut on the Deposit contract.", + Name: "utxo-value", + Usage: "Calls the constant method utxoValue on the Deposit contract.", ArgsUsage: "", - Action: dNotifyRedemptionSignatureTimedOut, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, + Action: dUtxoValue, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, }, { - Name: "notify-funding-timed-out", - Usage: "Calls the method notifyFundingTimedOut on the Deposit contract.", + Name: "notify-redemption-proof-timed-out", + Usage: "Calls the method notifyRedemptionProofTimedOut on the Deposit contract.", ArgsUsage: "", - Action: dNotifyFundingTimedOut, + Action: dNotifyRedemptionProofTimedOut, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "request-funder-abort", - Usage: "Calls the method requestFunderAbort on the Deposit contract.", - ArgsUsage: "[_abortOutputScript] ", - Action: dRequestFunderAbort, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), - Flags: cmd.NonConstFlags, - }, { - Name: "withdraw-funds", - Usage: "Calls the method withdrawFunds on the Deposit contract.", + Name: "notify-redemption-signature-timed-out", + Usage: "Calls the method notifyRedemptionSignatureTimedOut on the Deposit contract.", ArgsUsage: "", - Action: dWithdrawFunds, + Action: dNotifyRedemptionSignatureTimedOut, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "notify-signer-setup-failed", - Usage: "Calls the method notifySignerSetupFailed on the Deposit contract.", + Name: "notify-undercollateralized-liquidation", + Usage: "Calls the method notifyUndercollateralizedLiquidation on the Deposit contract.", ArgsUsage: "", - Action: dNotifySignerSetupFailed, + Action: dNotifyUndercollateralizedLiquidation, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "notify-redemption-proof-timed-out", - Usage: "Calls the method notifyRedemptionProofTimedOut on the Deposit contract.", - ArgsUsage: "", - Action: dNotifyRedemptionProofTimedOut, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Name: "initialize", + Usage: "Calls the method initialize on the Deposit contract.", + ArgsUsage: "[_factory] ", + Action: dInitialize, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), Flags: cmd.NonConstFlags, }, { - Name: "exit-courtesy-call", - Usage: "Calls the method exitCourtesyCall on the Deposit contract.", + Name: "notify-courtesy-call", + Usage: "Calls the method notifyCourtesyCall on the Deposit contract.", ArgsUsage: "", - Action: dExitCourtesyCall, + Action: dNotifyCourtesyCall, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { @@ -227,24 +213,31 @@ func init() { Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "notify-undercollateralized-liquidation", - Usage: "Calls the method notifyUndercollateralizedLiquidation on the Deposit contract.", + Name: "notify-signer-setup-failed", + Usage: "Calls the method notifySignerSetupFailed on the Deposit contract.", ArgsUsage: "", - Action: dNotifyUndercollateralizedLiquidation, + Action: dNotifySignerSetupFailed, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "initialize", - Usage: "Calls the method initialize on the Deposit contract.", - ArgsUsage: "[_factory] ", - Action: dInitialize, + Name: "retrieve-signer-pubkey", + Usage: "Calls the method retrieveSignerPubkey on the Deposit contract.", + ArgsUsage: "", + Action: dRetrieveSignerPubkey, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "request-funder-abort", + Usage: "Calls the method requestFunderAbort on the Deposit contract.", + ArgsUsage: "[_abortOutputScript] ", + Action: dRequestFunderAbort, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), Flags: cmd.NonConstFlags, }, { - Name: "notify-courtesy-call", - Usage: "Calls the method notifyCourtesyCall on the Deposit contract.", + Name: "notify-funding-timed-out", + Usage: "Calls the method notifyFundingTimedOut on the Deposit contract.", ArgsUsage: "", - Action: dNotifyCourtesyCall, + Action: dNotifyFundingTimedOut, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { @@ -255,10 +248,17 @@ func init() { Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "retrieve-signer-pubkey", - Usage: "Calls the method retrieveSignerPubkey on the Deposit contract.", + Name: "withdraw-funds", + Usage: "Calls the method withdrawFunds on the Deposit contract.", ArgsUsage: "", - Action: dRetrieveSignerPubkey, + Action: dWithdrawFunds, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "exit-courtesy-call", + Usage: "Calls the method exitCourtesyCall on the Deposit contract.", + ArgsUsage: "", + Action: dExitCourtesyCall, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }}, @@ -267,13 +267,13 @@ func init() { /// ------------------- Const methods ------------------- -func dFundingInfo(c *cli.Context) error { +func dRemainingTerm(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.FundingInfoAtBlock( + result, err := contract.RemainingTermAtBlock( cmd.BlockFlagValue.Uint, ) @@ -315,13 +315,21 @@ func dGetRedemptionTbtcRequirement(c *cli.Context) error { return nil } -func dUndercollateralizedThresholdPercent(c *cli.Context) error { +func dGetOwnerRedemptionTbtcRequirement(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } + _redeemer, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _redeemer, a address, from passed value %v", + c.Args()[0], + ) + } - result, err := contract.UndercollateralizedThresholdPercentAtBlock( + result, err := contract.GetOwnerRedemptionTbtcRequirementAtBlock( + _redeemer, cmd.BlockFlagValue.Uint, ) @@ -335,13 +343,13 @@ func dUndercollateralizedThresholdPercent(c *cli.Context) error { return nil } -func dUtxoValue(c *cli.Context) error { +func dKeepAddress(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.UtxoValueAtBlock( + result, err := contract.KeepAddressAtBlock( cmd.BlockFlagValue.Uint, ) @@ -355,13 +363,13 @@ func dUtxoValue(c *cli.Context) error { return nil } -func dCurrentState(c *cli.Context) error { +func dAuctionValue(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.CurrentStateAtBlock( + result, err := contract.AuctionValueAtBlock( cmd.BlockFlagValue.Uint, ) @@ -375,21 +383,13 @@ func dCurrentState(c *cli.Context) error { return nil } -func dGetOwnerRedemptionTbtcRequirement(c *cli.Context) error { +func dCollateralizationPercentage(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - _redeemer, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _redeemer, a address, from passed value %v", - c.Args()[0], - ) - } - result, err := contract.GetOwnerRedemptionTbtcRequirementAtBlock( - _redeemer, + result, err := contract.CollateralizationPercentageAtBlock( cmd.BlockFlagValue.Uint, ) @@ -403,13 +403,13 @@ func dGetOwnerRedemptionTbtcRequirement(c *cli.Context) error { return nil } -func dInActive(c *cli.Context) error { +func dLotSizeSatoshis(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.InActiveAtBlock( + result, err := contract.LotSizeSatoshisAtBlock( cmd.BlockFlagValue.Uint, ) @@ -443,13 +443,13 @@ func dLotSizeTbtc(c *cli.Context) error { return nil } -func dLotSizeSatoshis(c *cli.Context) error { +func dSeverelyUndercollateralizedThresholdPercent(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.LotSizeSatoshisAtBlock( + result, err := contract.SeverelyUndercollateralizedThresholdPercentAtBlock( cmd.BlockFlagValue.Uint, ) @@ -463,13 +463,13 @@ func dLotSizeSatoshis(c *cli.Context) error { return nil } -func dSeverelyUndercollateralizedThresholdPercent(c *cli.Context) error { +func dUndercollateralizedThresholdPercent(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.SeverelyUndercollateralizedThresholdPercentAtBlock( + result, err := contract.UndercollateralizedThresholdPercentAtBlock( cmd.BlockFlagValue.Uint, ) @@ -483,13 +483,13 @@ func dSeverelyUndercollateralizedThresholdPercent(c *cli.Context) error { return nil } -func dInitialCollateralizedPercent(c *cli.Context) error { +func dWithdrawableAmount(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.InitialCollateralizedPercentAtBlock( + result, err := contract.WithdrawableAmountAtBlock( cmd.BlockFlagValue.Uint, ) @@ -503,13 +503,13 @@ func dInitialCollateralizedPercent(c *cli.Context) error { return nil } -func dKeepAddress(c *cli.Context) error { +func dCurrentState(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.KeepAddressAtBlock( + result, err := contract.CurrentStateAtBlock( cmd.BlockFlagValue.Uint, ) @@ -523,13 +523,13 @@ func dKeepAddress(c *cli.Context) error { return nil } -func dWithdrawableAmount(c *cli.Context) error { +func dInitialCollateralizedPercent(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.WithdrawableAmountAtBlock( + result, err := contract.InitialCollateralizedPercentAtBlock( cmd.BlockFlagValue.Uint, ) @@ -543,13 +543,13 @@ func dWithdrawableAmount(c *cli.Context) error { return nil } -func dCollateralizationPercentage(c *cli.Context) error { +func dSignerFeeTbtc(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.CollateralizationPercentageAtBlock( + result, err := contract.SignerFeeTbtcAtBlock( cmd.BlockFlagValue.Uint, ) @@ -563,13 +563,13 @@ func dCollateralizationPercentage(c *cli.Context) error { return nil } -func dRemainingTerm(c *cli.Context) error { +func dFundingInfo(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.RemainingTermAtBlock( + result, err := contract.FundingInfoAtBlock( cmd.BlockFlagValue.Uint, ) @@ -583,13 +583,13 @@ func dRemainingTerm(c *cli.Context) error { return nil } -func dAuctionValue(c *cli.Context) error { +func dInActive(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.AuctionValueAtBlock( + result, err := contract.InActiveAtBlock( cmd.BlockFlagValue.Uint, ) @@ -603,13 +603,13 @@ func dAuctionValue(c *cli.Context) error { return nil } -func dSignerFeeTbtc(c *cli.Context) error { +func dUtxoValue(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.SignerFeeTbtcAtBlock( + result, err := contract.UtxoValueAtBlock( cmd.BlockFlagValue.Uint, ) @@ -625,7 +625,7 @@ func dSignerFeeTbtc(c *cli.Context) error { /// ------------------- Non-const methods ------------------- -func dNotifyRedemptionSignatureTimedOut(c *cli.Context) error { +func dNotifyRedemptionProofTimedOut(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -637,7 +637,7 @@ func dNotifyRedemptionSignatureTimedOut(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyRedemptionSignatureTimedOut() + transaction, err = contract.NotifyRedemptionProofTimedOut() if err != nil { return err } @@ -645,7 +645,7 @@ func dNotifyRedemptionSignatureTimedOut(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyRedemptionSignatureTimedOut( + err = contract.CallNotifyRedemptionProofTimedOut( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -658,7 +658,7 @@ func dNotifyRedemptionSignatureTimedOut(c *cli.Context) error { return nil } -func dNotifyFundingTimedOut(c *cli.Context) error { +func dNotifyRedemptionSignatureTimedOut(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -670,7 +670,7 @@ func dNotifyFundingTimedOut(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyFundingTimedOut() + transaction, err = contract.NotifyRedemptionSignatureTimedOut() if err != nil { return err } @@ -678,7 +678,7 @@ func dNotifyFundingTimedOut(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyFundingTimedOut( + err = contract.CallNotifyRedemptionSignatureTimedOut( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -691,29 +691,19 @@ func dNotifyFundingTimedOut(c *cli.Context) error { return nil } -func dRequestFunderAbort(c *cli.Context) error { +func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - _abortOutputScript, err := hexutil.Decode(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _abortOutputScript, a bytes, from passed value %v", - c.Args()[0], - ) - } - var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.RequestFunderAbort( - _abortOutputScript, - ) + transaction, err = contract.NotifyUndercollateralizedLiquidation() if err != nil { return err } @@ -721,8 +711,7 @@ func dRequestFunderAbort(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallRequestFunderAbort( - _abortOutputScript, + err = contract.CallNotifyUndercollateralizedLiquidation( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -735,19 +724,29 @@ func dRequestFunderAbort(c *cli.Context) error { return nil } -func dWithdrawFunds(c *cli.Context) error { +func dInitialize(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } + _factory, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _factory, a address, from passed value %v", + c.Args()[0], + ) + } + var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.WithdrawFunds() + transaction, err = contract.Initialize( + _factory, + ) if err != nil { return err } @@ -755,7 +754,8 @@ func dWithdrawFunds(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallWithdrawFunds( + err = contract.CallInitialize( + _factory, cmd.BlockFlagValue.Uint, ) if err != nil { @@ -768,7 +768,7 @@ func dWithdrawFunds(c *cli.Context) error { return nil } -func dNotifySignerSetupFailed(c *cli.Context) error { +func dNotifyCourtesyCall(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -780,7 +780,7 @@ func dNotifySignerSetupFailed(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifySignerSetupFailed() + transaction, err = contract.NotifyCourtesyCall() if err != nil { return err } @@ -788,7 +788,7 @@ func dNotifySignerSetupFailed(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifySignerSetupFailed( + err = contract.CallNotifyCourtesyCall( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -801,7 +801,7 @@ func dNotifySignerSetupFailed(c *cli.Context) error { return nil } -func dNotifyRedemptionProofTimedOut(c *cli.Context) error { +func dNotifyCourtesyCallExpired(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -813,7 +813,7 @@ func dNotifyRedemptionProofTimedOut(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyRedemptionProofTimedOut() + transaction, err = contract.NotifyCourtesyCallExpired() if err != nil { return err } @@ -821,7 +821,7 @@ func dNotifyRedemptionProofTimedOut(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyRedemptionProofTimedOut( + err = contract.CallNotifyCourtesyCallExpired( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -834,7 +834,7 @@ func dNotifyRedemptionProofTimedOut(c *cli.Context) error { return nil } -func dExitCourtesyCall(c *cli.Context) error { +func dNotifySignerSetupFailed(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -846,7 +846,7 @@ func dExitCourtesyCall(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.ExitCourtesyCall() + transaction, err = contract.NotifySignerSetupFailed() if err != nil { return err } @@ -854,7 +854,7 @@ func dExitCourtesyCall(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallExitCourtesyCall( + err = contract.CallNotifySignerSetupFailed( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -867,7 +867,7 @@ func dExitCourtesyCall(c *cli.Context) error { return nil } -func dNotifyCourtesyCallExpired(c *cli.Context) error { +func dRetrieveSignerPubkey(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -879,7 +879,7 @@ func dNotifyCourtesyCallExpired(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyCourtesyCallExpired() + transaction, err = contract.RetrieveSignerPubkey() if err != nil { return err } @@ -887,7 +887,7 @@ func dNotifyCourtesyCallExpired(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyCourtesyCallExpired( + err = contract.CallRetrieveSignerPubkey( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -900,19 +900,29 @@ func dNotifyCourtesyCallExpired(c *cli.Context) error { return nil } -func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { +func dRequestFunderAbort(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } + _abortOutputScript, err := hexutil.Decode(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _abortOutputScript, a bytes, from passed value %v", + c.Args()[0], + ) + } + var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyUndercollateralizedLiquidation() + transaction, err = contract.RequestFunderAbort( + _abortOutputScript, + ) if err != nil { return err } @@ -920,7 +930,8 @@ func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyUndercollateralizedLiquidation( + err = contract.CallRequestFunderAbort( + _abortOutputScript, cmd.BlockFlagValue.Uint, ) if err != nil { @@ -933,29 +944,19 @@ func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { return nil } -func dInitialize(c *cli.Context) error { +func dNotifyFundingTimedOut(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - _factory, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _factory, a address, from passed value %v", - c.Args()[0], - ) - } - var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.Initialize( - _factory, - ) + transaction, err = contract.NotifyFundingTimedOut() if err != nil { return err } @@ -963,8 +964,7 @@ func dInitialize(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallInitialize( - _factory, + err = contract.CallNotifyFundingTimedOut( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -977,7 +977,7 @@ func dInitialize(c *cli.Context) error { return nil } -func dNotifyCourtesyCall(c *cli.Context) error { +func dPurchaseSignerBondsAtAuction(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -989,7 +989,7 @@ func dNotifyCourtesyCall(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyCourtesyCall() + transaction, err = contract.PurchaseSignerBondsAtAuction() if err != nil { return err } @@ -997,7 +997,7 @@ func dNotifyCourtesyCall(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyCourtesyCall( + err = contract.CallPurchaseSignerBondsAtAuction( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1010,7 +1010,7 @@ func dNotifyCourtesyCall(c *cli.Context) error { return nil } -func dPurchaseSignerBondsAtAuction(c *cli.Context) error { +func dWithdrawFunds(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -1022,7 +1022,7 @@ func dPurchaseSignerBondsAtAuction(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.PurchaseSignerBondsAtAuction() + transaction, err = contract.WithdrawFunds() if err != nil { return err } @@ -1030,7 +1030,7 @@ func dPurchaseSignerBondsAtAuction(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallPurchaseSignerBondsAtAuction( + err = contract.CallWithdrawFunds( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1043,7 +1043,7 @@ func dPurchaseSignerBondsAtAuction(c *cli.Context) error { return nil } -func dRetrieveSignerPubkey(c *cli.Context) error { +func dExitCourtesyCall(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -1055,7 +1055,7 @@ func dRetrieveSignerPubkey(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.RetrieveSignerPubkey() + transaction, err = contract.ExitCourtesyCall() if err != nil { return err } @@ -1063,7 +1063,7 @@ func dRetrieveSignerPubkey(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallRetrieveSignerPubkey( + err = contract.CallExitCourtesyCall( cmd.BlockFlagValue.Uint, ) if err != nil { diff --git a/bindings/go/cmd/DepositLog.go b/bindings/go/cmd/DepositLog.go index f95ad066b..e27655fe4 100644 --- a/bindings/go/cmd/DepositLog.go +++ b/bindings/go/cmd/DepositLog.go @@ -16,7 +16,7 @@ import ( "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" "github.com/keep-network/keep-common/pkg/cmd" "github.com/keep-network/keep-core/config" - "github.com/keep-network/tbtc/contract" + "github.com/keep-network/tbtc/bindings/go/contract" "github.com/urfave/cli" ) @@ -58,20 +58,6 @@ func init() { Action: dlApprovedToLog, Before: cmd.ArgCountChecker(1), Flags: cmd.ConstFlags, - }, { - Name: "log-exited-courtesy-call", - Usage: "Calls the method logExitedCourtesyCall on the DepositLog contract.", - ArgsUsage: "", - Action: dlLogExitedCourtesyCall, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "log-fraud-during-setup", - Usage: "Calls the method logFraudDuringSetup on the DepositLog contract.", - ArgsUsage: "", - Action: dlLogFraudDuringSetup, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, }, { Name: "log-funder-requested-abort", Usage: "Calls the method logFunderRequestedAbort on the DepositLog contract.", @@ -86,6 +72,20 @@ func init() { Action: dlLogLiquidated, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, + }, { + Name: "log-exited-courtesy-call", + Usage: "Calls the method logExitedCourtesyCall on the DepositLog contract.", + ArgsUsage: "", + Action: dlLogExitedCourtesyCall, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "log-created", + Usage: "Calls the method logCreated on the DepositLog contract.", + ArgsUsage: "[_keepAddress] ", + Action: dlLogCreated, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), + Flags: cmd.NonConstFlags, }, { Name: "log-setup-failed", Usage: "Calls the method logSetupFailed on the DepositLog contract.", @@ -93,6 +93,13 @@ func init() { Action: dlLogSetupFailed, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, + }, { + Name: "log-fraud-during-setup", + Usage: "Calls the method logFraudDuringSetup on the DepositLog contract.", + ArgsUsage: "", + Action: dlLogFraudDuringSetup, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, }, { Name: "log-courtesy-called", Usage: "Calls the method logCourtesyCalled on the DepositLog contract.", @@ -100,13 +107,6 @@ func init() { Action: dlLogCourtesyCalled, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, - }, { - Name: "log-created", - Usage: "Calls the method logCreated on the DepositLog contract.", - ArgsUsage: "[_keepAddress] ", - Action: dlLogCreated, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), - Flags: cmd.NonConstFlags, }}, }) } @@ -143,19 +143,29 @@ func dlApprovedToLog(c *cli.Context) error { /// ------------------- Non-const methods ------------------- -func dlLogExitedCourtesyCall(c *cli.Context) error { +func dlLogFunderRequestedAbort(c *cli.Context) error { contract, err := initializeDepositLog(c) if err != nil { return err } + _abortOutputScript, err := hexutil.Decode(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _abortOutputScript, a bytes, from passed value %v", + c.Args()[0], + ) + } + var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogExitedCourtesyCall() + transaction, err = contract.LogFunderRequestedAbort( + _abortOutputScript, + ) if err != nil { return err } @@ -163,7 +173,8 @@ func dlLogExitedCourtesyCall(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogExitedCourtesyCall( + err = contract.CallLogFunderRequestedAbort( + _abortOutputScript, cmd.BlockFlagValue.Uint, ) if err != nil { @@ -176,7 +187,7 @@ func dlLogExitedCourtesyCall(c *cli.Context) error { return nil } -func dlLogFraudDuringSetup(c *cli.Context) error { +func dlLogLiquidated(c *cli.Context) error { contract, err := initializeDepositLog(c) if err != nil { return err @@ -188,7 +199,7 @@ func dlLogFraudDuringSetup(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogFraudDuringSetup() + transaction, err = contract.LogLiquidated() if err != nil { return err } @@ -196,7 +207,7 @@ func dlLogFraudDuringSetup(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogFraudDuringSetup( + err = contract.CallLogLiquidated( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -209,29 +220,19 @@ func dlLogFraudDuringSetup(c *cli.Context) error { return nil } -func dlLogFunderRequestedAbort(c *cli.Context) error { +func dlLogExitedCourtesyCall(c *cli.Context) error { contract, err := initializeDepositLog(c) if err != nil { return err } - _abortOutputScript, err := hexutil.Decode(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _abortOutputScript, a bytes, from passed value %v", - c.Args()[0], - ) - } - var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogFunderRequestedAbort( - _abortOutputScript, - ) + transaction, err = contract.LogExitedCourtesyCall() if err != nil { return err } @@ -239,8 +240,7 @@ func dlLogFunderRequestedAbort(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogFunderRequestedAbort( - _abortOutputScript, + err = contract.CallLogExitedCourtesyCall( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -253,19 +253,29 @@ func dlLogFunderRequestedAbort(c *cli.Context) error { return nil } -func dlLogLiquidated(c *cli.Context) error { +func dlLogCreated(c *cli.Context) error { contract, err := initializeDepositLog(c) if err != nil { return err } + _keepAddress, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _keepAddress, a address, from passed value %v", + c.Args()[0], + ) + } + var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogLiquidated() + transaction, err = contract.LogCreated( + _keepAddress, + ) if err != nil { return err } @@ -273,7 +283,8 @@ func dlLogLiquidated(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogLiquidated( + err = contract.CallLogCreated( + _keepAddress, cmd.BlockFlagValue.Uint, ) if err != nil { @@ -319,7 +330,7 @@ func dlLogSetupFailed(c *cli.Context) error { return nil } -func dlLogCourtesyCalled(c *cli.Context) error { +func dlLogFraudDuringSetup(c *cli.Context) error { contract, err := initializeDepositLog(c) if err != nil { return err @@ -331,7 +342,7 @@ func dlLogCourtesyCalled(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogCourtesyCalled() + transaction, err = contract.LogFraudDuringSetup() if err != nil { return err } @@ -339,7 +350,7 @@ func dlLogCourtesyCalled(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogCourtesyCalled( + err = contract.CallLogFraudDuringSetup( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -352,29 +363,19 @@ func dlLogCourtesyCalled(c *cli.Context) error { return nil } -func dlLogCreated(c *cli.Context) error { +func dlLogCourtesyCalled(c *cli.Context) error { contract, err := initializeDepositLog(c) if err != nil { return err } - _keepAddress, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _keepAddress, a address, from passed value %v", - c.Args()[0], - ) - } - var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogCreated( - _keepAddress, - ) + transaction, err = contract.LogCourtesyCalled() if err != nil { return err } @@ -382,8 +383,7 @@ func dlLogCreated(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogCreated( - _keepAddress, + err = contract.CallLogCourtesyCalled( cmd.BlockFlagValue.Uint, ) if err != nil { diff --git a/bindings/go/contract/Deposit.go b/bindings/go/contract/Deposit.go index d1aa3f548..1c438e0e2 100644 --- a/bindings/go/contract/Deposit.go +++ b/bindings/go/contract/Deposit.go @@ -18,7 +18,7 @@ import ( "github.com/ipfs/go-log" "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" - abi "github.com/keep-network/tbtc/abi/deposit" + abi "github.com/keep-network/tbtc/bindings/go/abi/deposit" ) // Create a package-level logger for this contract. The logger exists at @@ -92,29 +92,12 @@ func NewDeposit( // ----- Non-const Methods ------ // Transaction submission. -func (d *Deposit) InitializeDeposit( - _tbtcSystem common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachineAddress common.Address, - _lotSizeSatoshis uint64, - value *big.Int, +func (d *Deposit) NotifyRedemptionProofTimedOut( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction initializeDeposit", - "params: ", - fmt.Sprint( - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, - ), - "value: ", value, + "submitting transaction notifyRedemptionProofTimedOut", ) d.transactionMutex.Lock() @@ -124,8 +107,6 @@ func (d *Deposit) InitializeDeposit( transactorOptions := new(bind.TransactOpts) *transactorOptions = *d.transactorOptions - transactorOptions.Value = value - if len(transactionOptions) > 1 { return nil, fmt.Errorf( "could not process multiple transaction options sets", @@ -141,32 +122,20 @@ func (d *Deposit) InitializeDeposit( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.InitializeDeposit( + transaction, err := d.contract.NotifyRedemptionProofTimedOut( transactorOptions, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, - value, - "initializeDeposit", - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, + nil, + "notifyRedemptionProofTimedOut", ) } dLogger.Infof( - "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", + "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -177,32 +146,20 @@ func (d *Deposit) InitializeDeposit( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.InitializeDeposit( + transaction, err := d.contract.NotifyRedemptionProofTimedOut( transactorOptions, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, - value, - "initializeDeposit", - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, + nil, + "notifyRedemptionProofTimedOut", ) } dLogger.Infof( - "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", + "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -217,60 +174,34 @@ func (d *Deposit) InitializeDeposit( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallInitializeDeposit( - _tbtcSystem common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachineAddress common.Address, - _lotSizeSatoshis uint64, - value *big.Int, +func (d *Deposit) CallNotifyRedemptionProofTimedOut( blockNumber *big.Int, ) error { var result interface{} = nil err := ethutil.CallAtBlock( d.transactorOptions.From, - blockNumber, value, + blockNumber, nil, d.contractABI, d.caller, d.errorResolver, d.contractAddress, - "initializeDeposit", + "notifyRedemptionProofTimedOut", &result, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, ) return err } -func (d *Deposit) InitializeDepositGasEstimate( - _tbtcSystem common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachineAddress common.Address, - _lotSizeSatoshis uint64, -) (uint64, error) { +func (d *Deposit) NotifyRedemptionProofTimedOutGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "initializeDeposit", + "notifyRedemptionProofTimedOut", d.contractABI, d.transactor, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, ) return result, err @@ -392,6 +323,122 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOutGasEstimate() (uint64, error) return result, err } +// Transaction submission. +func (d *Deposit) NotifyUndercollateralizedLiquidation( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction notifyUndercollateralizedLiquidation", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.NotifyUndercollateralizedLiquidation( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyUndercollateralizedLiquidation", + ) + } + + dLogger.Infof( + "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.NotifyUndercollateralizedLiquidation( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyUndercollateralizedLiquidation", + ) + } + + dLogger.Infof( + "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallNotifyUndercollateralizedLiquidation( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "notifyUndercollateralizedLiquidation", + &result, + ) + + return err +} + +func (d *Deposit) NotifyUndercollateralizedLiquidationGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "notifyUndercollateralizedLiquidation", + d.contractABI, + d.transactor, + ) + + return result, err +} + // Transaction submission. func (d *Deposit) ProvideBTCFundingProof( _txVersion [4]uint8, @@ -593,12 +640,17 @@ func (d *Deposit) ProvideBTCFundingProofGasEstimate( } // Transaction submission. -func (d *Deposit) NotifyFundingTimedOut( +func (d *Deposit) Initialize( + _factory common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyFundingTimedOut", + "submitting transaction initialize", + "params: ", + fmt.Sprint( + _factory, + ), ) d.transactionMutex.Lock() @@ -623,20 +675,22 @@ func (d *Deposit) NotifyFundingTimedOut( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyFundingTimedOut( + transaction, err := d.contract.Initialize( transactorOptions, + _factory, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyFundingTimedOut", + "initialize", + _factory, ) } dLogger.Infof( - "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", + "submitted transaction initialize with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -647,20 +701,22 @@ func (d *Deposit) NotifyFundingTimedOut( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyFundingTimedOut( + transaction, err := d.contract.Initialize( transactorOptions, + _factory, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyFundingTimedOut", + "initialize", + _factory, ) } dLogger.Infof( - "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", + "submitted transaction initialize with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -675,7 +731,8 @@ func (d *Deposit) NotifyFundingTimedOut( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyFundingTimedOut( +func (d *Deposit) CallInitialize( + _factory common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -687,47 +744,38 @@ func (d *Deposit) CallNotifyFundingTimedOut( d.caller, d.errorResolver, d.contractAddress, - "notifyFundingTimedOut", + "initialize", &result, + _factory, ) return err } -func (d *Deposit) NotifyFundingTimedOutGasEstimate() (uint64, error) { +func (d *Deposit) InitializeGasEstimate( + _factory common.Address, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyFundingTimedOut", + "initialize", d.contractABI, d.transactor, + _factory, ) return result, err } // Transaction submission. -func (d *Deposit) ProvideECDSAFraudProof( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) NotifyCourtesyCall( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideECDSAFraudProof", - "params: ", - fmt.Sprint( - _v, - _r, - _s, - _signedDigest, - _preimage, - ), + "submitting transaction notifyCourtesyCall", ) d.transactionMutex.Lock() @@ -752,30 +800,20 @@ func (d *Deposit) ProvideECDSAFraudProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideECDSAFraudProof( + transaction, err := d.contract.NotifyCourtesyCall( transactorOptions, - _v, - _r, - _s, - _signedDigest, - _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideECDSAFraudProof", - _v, - _r, - _s, - _signedDigest, - _preimage, + "notifyCourtesyCall", ) } dLogger.Infof( - "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -786,30 +824,20 @@ func (d *Deposit) ProvideECDSAFraudProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideECDSAFraudProof( + transaction, err := d.contract.NotifyCourtesyCall( transactorOptions, - _v, - _r, - _s, - _signedDigest, - _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideECDSAFraudProof", - _v, - _r, - _s, - _signedDigest, - _preimage, + "notifyCourtesyCall", ) } dLogger.Infof( - "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -824,12 +852,7 @@ func (d *Deposit) ProvideECDSAFraudProof( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideECDSAFraudProof( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) CallNotifyCourtesyCall( blockNumber *big.Int, ) error { var result interface{} = nil @@ -841,55 +864,51 @@ func (d *Deposit) CallProvideECDSAFraudProof( d.caller, d.errorResolver, d.contractAddress, - "provideECDSAFraudProof", + "notifyCourtesyCall", &result, - _v, - _r, - _s, - _signedDigest, - _preimage, ) return err } -func (d *Deposit) ProvideECDSAFraudProofGasEstimate( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, -) (uint64, error) { +func (d *Deposit) NotifyCourtesyCallGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideECDSAFraudProof", + "notifyCourtesyCall", d.contractABI, d.transactor, - _v, - _r, - _s, - _signedDigest, - _preimage, ) return result, err } // Transaction submission. -func (d *Deposit) RequestFunderAbort( - _abortOutputScript []uint8, +func (d *Deposit) InitializeDeposit( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, + value *big.Int, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction requestFunderAbort", + "submitting transaction initializeDeposit", "params: ", fmt.Sprint( - _abortOutputScript, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ), + "value: ", value, ) d.transactionMutex.Lock() @@ -899,6 +918,8 @@ func (d *Deposit) RequestFunderAbort( transactorOptions := new(bind.TransactOpts) *transactorOptions = *d.transactorOptions + transactorOptions.Value = value + if len(transactionOptions) > 1 { return nil, fmt.Errorf( "could not process multiple transaction options sets", @@ -914,22 +935,32 @@ func (d *Deposit) RequestFunderAbort( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.RequestFunderAbort( + transaction, err := d.contract.InitializeDeposit( transactorOptions, - _abortOutputScript, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, - nil, - "requestFunderAbort", - _abortOutputScript, + value, + "initializeDeposit", + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) } dLogger.Infof( - "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", + "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -940,22 +971,32 @@ func (d *Deposit) RequestFunderAbort( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.RequestFunderAbort( + transaction, err := d.contract.InitializeDeposit( transactorOptions, - _abortOutputScript, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, - nil, - "requestFunderAbort", - _abortOutputScript, + value, + "initializeDeposit", + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) } dLogger.Infof( - "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", + "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -970,60 +1011,72 @@ func (d *Deposit) RequestFunderAbort( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallRequestFunderAbort( - _abortOutputScript []uint8, +func (d *Deposit) CallInitializeDeposit( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, + value *big.Int, blockNumber *big.Int, ) error { var result interface{} = nil err := ethutil.CallAtBlock( d.transactorOptions.From, - blockNumber, nil, + blockNumber, value, d.contractABI, d.caller, d.errorResolver, d.contractAddress, - "requestFunderAbort", + "initializeDeposit", &result, - _abortOutputScript, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) return err } -func (d *Deposit) RequestFunderAbortGasEstimate( - _abortOutputScript []uint8, +func (d *Deposit) InitializeDepositGasEstimate( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "requestFunderAbort", + "initializeDeposit", d.contractABI, d.transactor, - _abortOutputScript, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) return result, err } // Transaction submission. -func (d *Deposit) TransferAndRequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, - _finalRecipient common.Address, +func (d *Deposit) NotifyCourtesyCallExpired( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction transferAndRequestRedemption", - "params: ", - fmt.Sprint( - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, - ), + "submitting transaction notifyCourtesyCallExpired", ) d.transactionMutex.Lock() @@ -1048,26 +1101,20 @@ func (d *Deposit) TransferAndRequestRedemption( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.TransferAndRequestRedemption( + transaction, err := d.contract.NotifyCourtesyCallExpired( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "transferAndRequestRedemption", - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + "notifyCourtesyCallExpired", ) } dLogger.Infof( - "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1078,26 +1125,20 @@ func (d *Deposit) TransferAndRequestRedemption( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.TransferAndRequestRedemption( + transaction, err := d.contract.NotifyCourtesyCallExpired( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "transferAndRequestRedemption", - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + "notifyCourtesyCallExpired", ) } dLogger.Infof( - "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1112,10 +1153,7 @@ func (d *Deposit) TransferAndRequestRedemption( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallTransferAndRequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, - _finalRecipient common.Address, +func (d *Deposit) CallNotifyCourtesyCallExpired( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1127,51 +1165,34 @@ func (d *Deposit) CallTransferAndRequestRedemption( d.caller, d.errorResolver, d.contractAddress, - "transferAndRequestRedemption", + "notifyCourtesyCallExpired", &result, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, ) return err } -func (d *Deposit) TransferAndRequestRedemptionGasEstimate( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, - _finalRecipient common.Address, -) (uint64, error) { +func (d *Deposit) NotifyCourtesyCallExpiredGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "transferAndRequestRedemption", + "notifyCourtesyCallExpired", d.contractABI, d.transactor, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, ) return result, err } // Transaction submission. -func (d *Deposit) IncreaseRedemptionFee( - _previousOutputValueBytes [8]uint8, - _newOutputValueBytes [8]uint8, +func (d *Deposit) NotifySignerSetupFailed( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction increaseRedemptionFee", - "params: ", - fmt.Sprint( - _previousOutputValueBytes, - _newOutputValueBytes, - ), + "submitting transaction notifySignerSetupFailed", ) d.transactionMutex.Lock() @@ -1196,24 +1217,20 @@ func (d *Deposit) IncreaseRedemptionFee( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.IncreaseRedemptionFee( + transaction, err := d.contract.NotifySignerSetupFailed( transactorOptions, - _previousOutputValueBytes, - _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "increaseRedemptionFee", - _previousOutputValueBytes, - _newOutputValueBytes, + "notifySignerSetupFailed", ) } dLogger.Infof( - "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", + "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1224,24 +1241,20 @@ func (d *Deposit) IncreaseRedemptionFee( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.IncreaseRedemptionFee( + transaction, err := d.contract.NotifySignerSetupFailed( transactorOptions, - _previousOutputValueBytes, - _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "increaseRedemptionFee", - _previousOutputValueBytes, - _newOutputValueBytes, + "notifySignerSetupFailed", ) } dLogger.Infof( - "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", + "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1256,9 +1269,7 @@ func (d *Deposit) IncreaseRedemptionFee( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallIncreaseRedemptionFee( - _previousOutputValueBytes [8]uint8, - _newOutputValueBytes [8]uint8, +func (d *Deposit) CallNotifySignerSetupFailed( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1270,57 +1281,40 @@ func (d *Deposit) CallIncreaseRedemptionFee( d.caller, d.errorResolver, d.contractAddress, - "increaseRedemptionFee", + "notifySignerSetupFailed", &result, - _previousOutputValueBytes, - _newOutputValueBytes, ) return err } -func (d *Deposit) IncreaseRedemptionFeeGasEstimate( - _previousOutputValueBytes [8]uint8, - _newOutputValueBytes [8]uint8, -) (uint64, error) { +func (d *Deposit) NotifySignerSetupFailedGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "increaseRedemptionFee", + "notifySignerSetupFailed", d.contractABI, d.transactor, - _previousOutputValueBytes, - _newOutputValueBytes, ) return result, err } // Transaction submission. -func (d *Deposit) ProvideRedemptionProof( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) RequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideRedemptionProof", + "submitting transaction requestRedemption", "params: ", fmt.Sprint( - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _outputValueBytes, + _redeemerOutputScript, ), ) @@ -1346,34 +1340,24 @@ func (d *Deposit) ProvideRedemptionProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideRedemptionProof( + transaction, err := d.contract.RequestRedemption( transactorOptions, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _outputValueBytes, + _redeemerOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideRedemptionProof", - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + "requestRedemption", + _outputValueBytes, + _redeemerOutputScript, ) } dLogger.Infof( - "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", + "submitted transaction requestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1384,34 +1368,24 @@ func (d *Deposit) ProvideRedemptionProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideRedemptionProof( + transaction, err := d.contract.RequestRedemption( transactorOptions, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _outputValueBytes, + _redeemerOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideRedemptionProof", - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + "requestRedemption", + _outputValueBytes, + _redeemerOutputScript, ) } dLogger.Infof( - "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", + "submitted transaction requestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1426,14 +1400,9 @@ func (d *Deposit) ProvideRedemptionProof( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideRedemptionProof( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) CallRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1445,56 +1414,48 @@ func (d *Deposit) CallProvideRedemptionProof( d.caller, d.errorResolver, d.contractAddress, - "provideRedemptionProof", + "requestRedemption", &result, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _outputValueBytes, + _redeemerOutputScript, ) return err } -func (d *Deposit) ProvideRedemptionProofGasEstimate( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) RequestRedemptionGasEstimate( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideRedemptionProof", + "requestRedemption", d.contractABI, d.transactor, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _outputValueBytes, + _redeemerOutputScript, ) return result, err } // Transaction submission. -func (d *Deposit) WithdrawFunds( +func (d *Deposit) IncreaseRedemptionFee( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction withdrawFunds", + "submitting transaction increaseRedemptionFee", + "params: ", + fmt.Sprint( + _previousOutputValueBytes, + _newOutputValueBytes, + ), ) d.transactionMutex.Lock() @@ -1519,20 +1480,24 @@ func (d *Deposit) WithdrawFunds( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.WithdrawFunds( + transaction, err := d.contract.IncreaseRedemptionFee( transactorOptions, + _previousOutputValueBytes, + _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "withdrawFunds", + "increaseRedemptionFee", + _previousOutputValueBytes, + _newOutputValueBytes, ) } dLogger.Infof( - "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", + "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1543,20 +1508,24 @@ func (d *Deposit) WithdrawFunds( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.WithdrawFunds( + transaction, err := d.contract.IncreaseRedemptionFee( transactorOptions, + _previousOutputValueBytes, + _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "withdrawFunds", + "increaseRedemptionFee", + _previousOutputValueBytes, + _newOutputValueBytes, ) } dLogger.Infof( - "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", + "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1571,7 +1540,9 @@ func (d *Deposit) WithdrawFunds( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallWithdrawFunds( +func (d *Deposit) CallIncreaseRedemptionFee( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1583,34 +1554,41 @@ func (d *Deposit) CallWithdrawFunds( d.caller, d.errorResolver, d.contractAddress, - "withdrawFunds", + "increaseRedemptionFee", &result, + _previousOutputValueBytes, + _newOutputValueBytes, ) return err } -func (d *Deposit) WithdrawFundsGasEstimate() (uint64, error) { +func (d *Deposit) IncreaseRedemptionFeeGasEstimate( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "withdrawFunds", + "increaseRedemptionFee", d.contractABI, d.transactor, + _previousOutputValueBytes, + _newOutputValueBytes, ) return result, err } // Transaction submission. -func (d *Deposit) NotifySignerSetupFailed( +func (d *Deposit) RetrieveSignerPubkey( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifySignerSetupFailed", + "submitting transaction retrieveSignerPubkey", ) d.transactionMutex.Lock() @@ -1635,7 +1613,7 @@ func (d *Deposit) NotifySignerSetupFailed( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifySignerSetupFailed( + transaction, err := d.contract.RetrieveSignerPubkey( transactorOptions, ) if err != nil { @@ -1643,12 +1621,12 @@ func (d *Deposit) NotifySignerSetupFailed( err, d.transactorOptions.From, nil, - "notifySignerSetupFailed", + "retrieveSignerPubkey", ) } dLogger.Infof( - "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", + "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1659,7 +1637,7 @@ func (d *Deposit) NotifySignerSetupFailed( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifySignerSetupFailed( + transaction, err := d.contract.RetrieveSignerPubkey( transactorOptions, ) if err != nil { @@ -1667,12 +1645,12 @@ func (d *Deposit) NotifySignerSetupFailed( err, d.transactorOptions.From, nil, - "notifySignerSetupFailed", + "retrieveSignerPubkey", ) } dLogger.Infof( - "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", + "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1687,7 +1665,7 @@ func (d *Deposit) NotifySignerSetupFailed( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifySignerSetupFailed( +func (d *Deposit) CallRetrieveSignerPubkey( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1699,20 +1677,20 @@ func (d *Deposit) CallNotifySignerSetupFailed( d.caller, d.errorResolver, d.contractAddress, - "notifySignerSetupFailed", + "retrieveSignerPubkey", &result, ) return err } -func (d *Deposit) NotifySignerSetupFailedGasEstimate() (uint64, error) { +func (d *Deposit) RetrieveSignerPubkeyGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifySignerSetupFailed", + "retrieveSignerPubkey", d.contractABI, d.transactor, ) @@ -1721,12 +1699,17 @@ func (d *Deposit) NotifySignerSetupFailedGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) NotifyRedemptionProofTimedOut( +func (d *Deposit) RequestFunderAbort( + _abortOutputScript []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyRedemptionProofTimedOut", + "submitting transaction requestFunderAbort", + "params: ", + fmt.Sprint( + _abortOutputScript, + ), ) d.transactionMutex.Lock() @@ -1751,20 +1734,22 @@ func (d *Deposit) NotifyRedemptionProofTimedOut( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyRedemptionProofTimedOut( + transaction, err := d.contract.RequestFunderAbort( transactorOptions, + _abortOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyRedemptionProofTimedOut", + "requestFunderAbort", + _abortOutputScript, ) } dLogger.Infof( - "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", + "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1775,20 +1760,22 @@ func (d *Deposit) NotifyRedemptionProofTimedOut( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyRedemptionProofTimedOut( + transaction, err := d.contract.RequestFunderAbort( transactorOptions, + _abortOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyRedemptionProofTimedOut", + "requestFunderAbort", + _abortOutputScript, ) } dLogger.Infof( - "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", + "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1803,7 +1790,8 @@ func (d *Deposit) NotifyRedemptionProofTimedOut( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyRedemptionProofTimedOut( +func (d *Deposit) CallRequestFunderAbort( + _abortOutputScript []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1815,42 +1803,50 @@ func (d *Deposit) CallNotifyRedemptionProofTimedOut( d.caller, d.errorResolver, d.contractAddress, - "notifyRedemptionProofTimedOut", + "requestFunderAbort", &result, + _abortOutputScript, ) return err } -func (d *Deposit) NotifyRedemptionProofTimedOutGasEstimate() (uint64, error) { +func (d *Deposit) RequestFunderAbortGasEstimate( + _abortOutputScript []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyRedemptionProofTimedOut", + "requestFunderAbort", d.contractABI, d.transactor, + _abortOutputScript, ) return result, err } // Transaction submission. -func (d *Deposit) ProvideRedemptionSignature( +func (d *Deposit) ProvideECDSAFraudProof( _v uint8, _r [32]uint8, _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideRedemptionSignature", + "submitting transaction provideECDSAFraudProof", "params: ", fmt.Sprint( _v, _r, _s, + _signedDigest, + _preimage, ), ) @@ -1876,26 +1872,30 @@ func (d *Deposit) ProvideRedemptionSignature( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideRedemptionSignature( + transaction, err := d.contract.ProvideECDSAFraudProof( transactorOptions, _v, _r, _s, + _signedDigest, + _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideRedemptionSignature", + "provideECDSAFraudProof", _v, _r, _s, + _signedDigest, + _preimage, ) } dLogger.Infof( - "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", + "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1906,26 +1906,30 @@ func (d *Deposit) ProvideRedemptionSignature( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideRedemptionSignature( + transaction, err := d.contract.ProvideECDSAFraudProof( transactorOptions, _v, _r, _s, + _signedDigest, + _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideRedemptionSignature", + "provideECDSAFraudProof", _v, _r, _s, + _signedDigest, + _preimage, ) } dLogger.Infof( - "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", + "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1940,10 +1944,12 @@ func (d *Deposit) ProvideRedemptionSignature( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideRedemptionSignature( +func (d *Deposit) CallProvideECDSAFraudProof( _v uint8, _r [32]uint8, _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1955,160 +1961,67 @@ func (d *Deposit) CallProvideRedemptionSignature( d.caller, d.errorResolver, d.contractAddress, - "provideRedemptionSignature", + "provideECDSAFraudProof", &result, _v, _r, _s, + _signedDigest, + _preimage, ) return err } -func (d *Deposit) ProvideRedemptionSignatureGasEstimate( +func (d *Deposit) ProvideECDSAFraudProofGasEstimate( _v uint8, _r [32]uint8, _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideRedemptionSignature", + "provideECDSAFraudProof", d.contractABI, d.transactor, _v, _r, _s, + _signedDigest, + _preimage, ) return result, err } // Transaction submission. -func (d *Deposit) ExitCourtesyCall( - - transactionOptions ...ethutil.TransactionOptions, -) (*types.Transaction, error) { - dLogger.Debug( - "submitting transaction exitCourtesyCall", - ) - - d.transactionMutex.Lock() - defer d.transactionMutex.Unlock() - - // create a copy - transactorOptions := new(bind.TransactOpts) - *transactorOptions = *d.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 := d.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 := d.contract.ExitCourtesyCall( - transactorOptions, - ) - if err != nil { - return transaction, d.errorResolver.ResolveError( - err, - d.transactorOptions.From, - nil, - "exitCourtesyCall", - ) - } - - dLogger.Infof( - "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - go d.miningWaiter.ForceMining( - transaction, - func(newGasPrice *big.Int) (*types.Transaction, error) { - transactorOptions.GasLimit = transaction.Gas() - transactorOptions.GasPrice = newGasPrice - - transaction, err := d.contract.ExitCourtesyCall( - transactorOptions, - ) - if err != nil { - return transaction, d.errorResolver.ResolveError( - err, - d.transactorOptions.From, - nil, - "exitCourtesyCall", - ) - } - - dLogger.Infof( - "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - return transaction, nil - }, - ) - - d.nonceManager.IncrementNonce() - - return transaction, err -} - -// Non-mutating call, not a transaction submission. -func (d *Deposit) CallExitCourtesyCall( - blockNumber *big.Int, -) error { - var result interface{} = nil - - err := ethutil.CallAtBlock( - d.transactorOptions.From, - blockNumber, nil, - d.contractABI, - d.caller, - d.errorResolver, - d.contractAddress, - "exitCourtesyCall", - &result, - ) - - return err -} - -func (d *Deposit) ExitCourtesyCallGasEstimate() (uint64, error) { - var result uint64 - - result, err := ethutil.EstimateGas( - d.callerOptions.From, - d.contractAddress, - "exitCourtesyCall", - d.contractABI, - d.transactor, - ) - - return result, err -} - -// Transaction submission. -func (d *Deposit) NotifyCourtesyCallExpired( +func (d *Deposit) ProvideRedemptionProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyCourtesyCallExpired", + "submitting transaction provideRedemptionProof", + "params: ", + fmt.Sprint( + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ), ) d.transactionMutex.Lock() @@ -2133,20 +2046,34 @@ func (d *Deposit) NotifyCourtesyCallExpired( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyCourtesyCallExpired( + transaction, err := d.contract.ProvideRedemptionProof( transactorOptions, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyCourtesyCallExpired", + "provideRedemptionProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) } dLogger.Infof( - "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2157,20 +2084,34 @@ func (d *Deposit) NotifyCourtesyCallExpired( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyCourtesyCallExpired( + transaction, err := d.contract.ProvideRedemptionProof( transactorOptions, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyCourtesyCallExpired", + "provideRedemptionProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) } dLogger.Infof( - "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2185,7 +2126,14 @@ func (d *Deposit) NotifyCourtesyCallExpired( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyCourtesyCallExpired( +func (d *Deposit) CallProvideRedemptionProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2197,34 +2145,65 @@ func (d *Deposit) CallNotifyCourtesyCallExpired( d.caller, d.errorResolver, d.contractAddress, - "notifyCourtesyCallExpired", + "provideRedemptionProof", &result, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) return err } -func (d *Deposit) NotifyCourtesyCallExpiredGasEstimate() (uint64, error) { +func (d *Deposit) ProvideRedemptionProofGasEstimate( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyCourtesyCallExpired", + "provideRedemptionProof", d.contractABI, d.transactor, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyUndercollateralizedLiquidation( +func (d *Deposit) TransferAndRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyUndercollateralizedLiquidation", + "submitting transaction transferAndRequestRedemption", + "params: ", + fmt.Sprint( + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, + ), ) d.transactionMutex.Lock() @@ -2249,20 +2228,26 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyUndercollateralizedLiquidation( + transaction, err := d.contract.TransferAndRequestRedemption( transactorOptions, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyUndercollateralizedLiquidation", + "transferAndRequestRedemption", + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) } dLogger.Infof( - "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2273,20 +2258,26 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyUndercollateralizedLiquidation( + transaction, err := d.contract.TransferAndRequestRedemption( transactorOptions, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyUndercollateralizedLiquidation", + "transferAndRequestRedemption", + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) } dLogger.Infof( - "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2301,7 +2292,10 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyUndercollateralizedLiquidation( +func (d *Deposit) CallTransferAndRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2313,47 +2307,44 @@ func (d *Deposit) CallNotifyUndercollateralizedLiquidation( d.caller, d.errorResolver, d.contractAddress, - "notifyUndercollateralizedLiquidation", + "transferAndRequestRedemption", &result, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) return err } -func (d *Deposit) NotifyUndercollateralizedLiquidationGasEstimate() (uint64, error) { +func (d *Deposit) TransferAndRequestRedemptionGasEstimate( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyUndercollateralizedLiquidation", + "transferAndRequestRedemption", d.contractABI, d.transactor, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) return result, err } // Transaction submission. -func (d *Deposit) ProvideFundingECDSAFraudProof( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) NotifyFundingTimedOut( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideFundingECDSAFraudProof", - "params: ", - fmt.Sprint( - _v, - _r, - _s, - _signedDigest, - _preimage, - ), + "submitting transaction notifyFundingTimedOut", ) d.transactionMutex.Lock() @@ -2378,30 +2369,20 @@ func (d *Deposit) ProvideFundingECDSAFraudProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideFundingECDSAFraudProof( + transaction, err := d.contract.NotifyFundingTimedOut( transactorOptions, - _v, - _r, - _s, - _signedDigest, - _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideFundingECDSAFraudProof", - _v, - _r, - _s, - _signedDigest, - _preimage, + "notifyFundingTimedOut", ) } dLogger.Infof( - "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", + "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2412,30 +2393,20 @@ func (d *Deposit) ProvideFundingECDSAFraudProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideFundingECDSAFraudProof( - transactorOptions, - _v, - _r, - _s, - _signedDigest, - _preimage, + transaction, err := d.contract.NotifyFundingTimedOut( + transactorOptions, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideFundingECDSAFraudProof", - _v, - _r, - _s, - _signedDigest, - _preimage, + "notifyFundingTimedOut", ) } dLogger.Infof( - "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", + "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2450,12 +2421,7 @@ func (d *Deposit) ProvideFundingECDSAFraudProof( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideFundingECDSAFraudProof( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) CallNotifyFundingTimedOut( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2467,56 +2433,42 @@ func (d *Deposit) CallProvideFundingECDSAFraudProof( d.caller, d.errorResolver, d.contractAddress, - "provideFundingECDSAFraudProof", + "notifyFundingTimedOut", &result, - _v, - _r, - _s, - _signedDigest, - _preimage, ) return err } -func (d *Deposit) ProvideFundingECDSAFraudProofGasEstimate( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, -) (uint64, error) { +func (d *Deposit) NotifyFundingTimedOutGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideFundingECDSAFraudProof", + "notifyFundingTimedOut", d.contractABI, d.transactor, - _v, - _r, - _s, - _signedDigest, - _preimage, ) return result, err } // Transaction submission. -func (d *Deposit) RequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, +func (d *Deposit) ProvideRedemptionSignature( + _v uint8, + _r [32]uint8, + _s [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction requestRedemption", + "submitting transaction provideRedemptionSignature", "params: ", fmt.Sprint( - _outputValueBytes, - _redeemerOutputScript, + _v, + _r, + _s, ), ) @@ -2542,24 +2494,26 @@ func (d *Deposit) RequestRedemption( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.RequestRedemption( + transaction, err := d.contract.ProvideRedemptionSignature( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, + _v, + _r, + _s, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "requestRedemption", - _outputValueBytes, - _redeemerOutputScript, + "provideRedemptionSignature", + _v, + _r, + _s, ) } dLogger.Infof( - "submitted transaction requestRedemption with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2570,24 +2524,26 @@ func (d *Deposit) RequestRedemption( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.RequestRedemption( + transaction, err := d.contract.ProvideRedemptionSignature( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, + _v, + _r, + _s, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "requestRedemption", - _outputValueBytes, - _redeemerOutputScript, + "provideRedemptionSignature", + _v, + _r, + _s, ) } dLogger.Infof( - "submitted transaction requestRedemption with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2602,9 +2558,10 @@ func (d *Deposit) RequestRedemption( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallRequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, +func (d *Deposit) CallProvideRedemptionSignature( + _v uint8, + _r [32]uint8, + _s [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2616,46 +2573,44 @@ func (d *Deposit) CallRequestRedemption( d.caller, d.errorResolver, d.contractAddress, - "requestRedemption", + "provideRedemptionSignature", &result, - _outputValueBytes, - _redeemerOutputScript, + _v, + _r, + _s, ) return err } -func (d *Deposit) RequestRedemptionGasEstimate( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, +func (d *Deposit) ProvideRedemptionSignatureGasEstimate( + _v uint8, + _r [32]uint8, + _s [32]uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "requestRedemption", + "provideRedemptionSignature", d.contractABI, d.transactor, - _outputValueBytes, - _redeemerOutputScript, + _v, + _r, + _s, ) return result, err } // Transaction submission. -func (d *Deposit) Initialize( - _factory common.Address, +func (d *Deposit) PurchaseSignerBondsAtAuction( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction initialize", - "params: ", - fmt.Sprint( - _factory, - ), + "submitting transaction purchaseSignerBondsAtAuction", ) d.transactionMutex.Lock() @@ -2680,22 +2635,20 @@ func (d *Deposit) Initialize( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.Initialize( + transaction, err := d.contract.PurchaseSignerBondsAtAuction( transactorOptions, - _factory, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "initialize", - _factory, + "purchaseSignerBondsAtAuction", ) } dLogger.Infof( - "submitted transaction initialize with id: [%v] and nonce [%v]", + "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2706,22 +2659,20 @@ func (d *Deposit) Initialize( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.Initialize( + transaction, err := d.contract.PurchaseSignerBondsAtAuction( transactorOptions, - _factory, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "initialize", - _factory, + "purchaseSignerBondsAtAuction", ) } dLogger.Infof( - "submitted transaction initialize with id: [%v] and nonce [%v]", + "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2736,8 +2687,7 @@ func (d *Deposit) Initialize( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallInitialize( - _factory common.Address, +func (d *Deposit) CallPurchaseSignerBondsAtAuction( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2749,38 +2699,34 @@ func (d *Deposit) CallInitialize( d.caller, d.errorResolver, d.contractAddress, - "initialize", + "purchaseSignerBondsAtAuction", &result, - _factory, ) return err } -func (d *Deposit) InitializeGasEstimate( - _factory common.Address, -) (uint64, error) { +func (d *Deposit) PurchaseSignerBondsAtAuctionGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "initialize", + "purchaseSignerBondsAtAuction", d.contractABI, d.transactor, - _factory, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyCourtesyCall( +func (d *Deposit) WithdrawFunds( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyCourtesyCall", + "submitting transaction withdrawFunds", ) d.transactionMutex.Lock() @@ -2805,7 +2751,7 @@ func (d *Deposit) NotifyCourtesyCall( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyCourtesyCall( + transaction, err := d.contract.WithdrawFunds( transactorOptions, ) if err != nil { @@ -2813,12 +2759,12 @@ func (d *Deposit) NotifyCourtesyCall( err, d.transactorOptions.From, nil, - "notifyCourtesyCall", + "withdrawFunds", ) } dLogger.Infof( - "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2829,7 +2775,7 @@ func (d *Deposit) NotifyCourtesyCall( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyCourtesyCall( + transaction, err := d.contract.WithdrawFunds( transactorOptions, ) if err != nil { @@ -2837,12 +2783,12 @@ func (d *Deposit) NotifyCourtesyCall( err, d.transactorOptions.From, nil, - "notifyCourtesyCall", + "withdrawFunds", ) } dLogger.Infof( - "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2857,7 +2803,7 @@ func (d *Deposit) NotifyCourtesyCall( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyCourtesyCall( +func (d *Deposit) CallWithdrawFunds( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2869,20 +2815,20 @@ func (d *Deposit) CallNotifyCourtesyCall( d.caller, d.errorResolver, d.contractAddress, - "notifyCourtesyCall", + "withdrawFunds", &result, ) return err } -func (d *Deposit) NotifyCourtesyCallGasEstimate() (uint64, error) { +func (d *Deposit) WithdrawFundsGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyCourtesyCall", + "withdrawFunds", d.contractABI, d.transactor, ) @@ -2891,12 +2837,12 @@ func (d *Deposit) NotifyCourtesyCallGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) PurchaseSignerBondsAtAuction( +func (d *Deposit) ExitCourtesyCall( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction purchaseSignerBondsAtAuction", + "submitting transaction exitCourtesyCall", ) d.transactionMutex.Lock() @@ -2921,7 +2867,7 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.PurchaseSignerBondsAtAuction( + transaction, err := d.contract.ExitCourtesyCall( transactorOptions, ) if err != nil { @@ -2929,12 +2875,12 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( err, d.transactorOptions.From, nil, - "purchaseSignerBondsAtAuction", + "exitCourtesyCall", ) } dLogger.Infof( - "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", + "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2945,7 +2891,7 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.PurchaseSignerBondsAtAuction( + transaction, err := d.contract.ExitCourtesyCall( transactorOptions, ) if err != nil { @@ -2953,12 +2899,12 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( err, d.transactorOptions.From, nil, - "purchaseSignerBondsAtAuction", + "exitCourtesyCall", ) } dLogger.Infof( - "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", + "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2973,7 +2919,7 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallPurchaseSignerBondsAtAuction( +func (d *Deposit) CallExitCourtesyCall( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2985,20 +2931,20 @@ func (d *Deposit) CallPurchaseSignerBondsAtAuction( d.caller, d.errorResolver, d.contractAddress, - "purchaseSignerBondsAtAuction", + "exitCourtesyCall", &result, ) return err } -func (d *Deposit) PurchaseSignerBondsAtAuctionGasEstimate() (uint64, error) { +func (d *Deposit) ExitCourtesyCallGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "purchaseSignerBondsAtAuction", + "exitCourtesyCall", d.contractABI, d.transactor, ) @@ -3007,12 +2953,25 @@ func (d *Deposit) PurchaseSignerBondsAtAuctionGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) RetrieveSignerPubkey( +func (d *Deposit) ProvideFundingECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction retrieveSignerPubkey", + "submitting transaction provideFundingECDSAFraudProof", + "params: ", + fmt.Sprint( + _v, + _r, + _s, + _signedDigest, + _preimage, + ), ) d.transactionMutex.Lock() @@ -3037,20 +2996,30 @@ func (d *Deposit) RetrieveSignerPubkey( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.RetrieveSignerPubkey( + transaction, err := d.contract.ProvideFundingECDSAFraudProof( transactorOptions, + _v, + _r, + _s, + _signedDigest, + _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "retrieveSignerPubkey", + "provideFundingECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, ) } dLogger.Infof( - "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", + "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3061,20 +3030,30 @@ func (d *Deposit) RetrieveSignerPubkey( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.RetrieveSignerPubkey( + transaction, err := d.contract.ProvideFundingECDSAFraudProof( transactorOptions, + _v, + _r, + _s, + _signedDigest, + _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "retrieveSignerPubkey", + "provideFundingECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, ) } dLogger.Infof( - "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", + "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3089,7 +3068,12 @@ func (d *Deposit) RetrieveSignerPubkey( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallRetrieveSignerPubkey( +func (d *Deposit) CallProvideFundingECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -3101,22 +3085,38 @@ func (d *Deposit) CallRetrieveSignerPubkey( d.caller, d.errorResolver, d.contractAddress, - "retrieveSignerPubkey", + "provideFundingECDSAFraudProof", &result, + _v, + _r, + _s, + _signedDigest, + _preimage, ) return err } -func (d *Deposit) RetrieveSignerPubkeyGasEstimate() (uint64, error) { +func (d *Deposit) ProvideFundingECDSAFraudProofGasEstimate( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "retrieveSignerPubkey", + "provideFundingECDSAFraudProof", d.contractABI, d.transactor, + _v, + _r, + _s, + _signedDigest, + _preimage, ) return result, err @@ -3124,15 +3124,9 @@ func (d *Deposit) RetrieveSignerPubkeyGasEstimate() (uint64, error) { // ----- Const Methods ------ -type fundingInfo struct { - UtxoValueBytes [8]uint8 - FundedAt *big.Int - UtxoOutpoint []uint8 -} - -func (d *Deposit) FundingInfo() (fundingInfo, error) { - var result fundingInfo - result, err := d.contract.FundingInfo( +func (d *Deposit) RemainingTerm() (*big.Int, error) { + var result *big.Int + result, err := d.contract.RemainingTerm( d.callerOptions, ) @@ -3141,17 +3135,17 @@ func (d *Deposit) FundingInfo() (fundingInfo, error) { err, d.callerOptions.From, nil, - "fundingInfo", + "remainingTerm", ) } return result, err } -func (d *Deposit) FundingInfoAtBlock( +func (d *Deposit) RemainingTermAtBlock( blockNumber *big.Int, -) (fundingInfo, error) { - var result fundingInfo +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3161,7 +3155,7 @@ func (d *Deposit) FundingInfoAtBlock( d.caller, d.errorResolver, d.contractAddress, - "fundingInfo", + "remainingTerm", &result, ) @@ -3212,10 +3206,13 @@ func (d *Deposit) GetRedemptionTbtcRequirementAtBlock( return result, err } -func (d *Deposit) UndercollateralizedThresholdPercent() (uint16, error) { - var result uint16 - result, err := d.contract.UndercollateralizedThresholdPercent( +func (d *Deposit) GetOwnerRedemptionTbtcRequirement( + _redeemer common.Address, +) (*big.Int, error) { + var result *big.Int + result, err := d.contract.GetOwnerRedemptionTbtcRequirement( d.callerOptions, + _redeemer, ) if err != nil { @@ -3223,17 +3220,19 @@ func (d *Deposit) UndercollateralizedThresholdPercent() (uint16, error) { err, d.callerOptions.From, nil, - "undercollateralizedThresholdPercent", + "getOwnerRedemptionTbtcRequirement", + _redeemer, ) } return result, err } -func (d *Deposit) UndercollateralizedThresholdPercentAtBlock( +func (d *Deposit) GetOwnerRedemptionTbtcRequirementAtBlock( + _redeemer common.Address, blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3243,16 +3242,17 @@ func (d *Deposit) UndercollateralizedThresholdPercentAtBlock( d.caller, d.errorResolver, d.contractAddress, - "undercollateralizedThresholdPercent", + "getOwnerRedemptionTbtcRequirement", &result, + _redeemer, ) return result, err } -func (d *Deposit) UtxoValue() (*big.Int, error) { - var result *big.Int - result, err := d.contract.UtxoValue( +func (d *Deposit) KeepAddress() (common.Address, error) { + var result common.Address + result, err := d.contract.KeepAddress( d.callerOptions, ) @@ -3261,17 +3261,17 @@ func (d *Deposit) UtxoValue() (*big.Int, error) { err, d.callerOptions.From, nil, - "utxoValue", + "keepAddress", ) } return result, err } -func (d *Deposit) UtxoValueAtBlock( +func (d *Deposit) KeepAddressAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (common.Address, error) { + var result common.Address err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3281,16 +3281,16 @@ func (d *Deposit) UtxoValueAtBlock( d.caller, d.errorResolver, d.contractAddress, - "utxoValue", + "keepAddress", &result, ) return result, err } -func (d *Deposit) CurrentState() (*big.Int, error) { +func (d *Deposit) AuctionValue() (*big.Int, error) { var result *big.Int - result, err := d.contract.CurrentState( + result, err := d.contract.AuctionValue( d.callerOptions, ) @@ -3299,14 +3299,14 @@ func (d *Deposit) CurrentState() (*big.Int, error) { err, d.callerOptions.From, nil, - "currentState", + "auctionValue", ) } return result, err } -func (d *Deposit) CurrentStateAtBlock( +func (d *Deposit) AuctionValueAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3319,20 +3319,17 @@ func (d *Deposit) CurrentStateAtBlock( d.caller, d.errorResolver, d.contractAddress, - "currentState", + "auctionValue", &result, ) return result, err } -func (d *Deposit) GetOwnerRedemptionTbtcRequirement( - _redeemer common.Address, -) (*big.Int, error) { +func (d *Deposit) CollateralizationPercentage() (*big.Int, error) { var result *big.Int - result, err := d.contract.GetOwnerRedemptionTbtcRequirement( + result, err := d.contract.CollateralizationPercentage( d.callerOptions, - _redeemer, ) if err != nil { @@ -3340,16 +3337,14 @@ func (d *Deposit) GetOwnerRedemptionTbtcRequirement( err, d.callerOptions.From, nil, - "getOwnerRedemptionTbtcRequirement", - _redeemer, + "collateralizationPercentage", ) } return result, err } -func (d *Deposit) GetOwnerRedemptionTbtcRequirementAtBlock( - _redeemer common.Address, +func (d *Deposit) CollateralizationPercentageAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3362,17 +3357,16 @@ func (d *Deposit) GetOwnerRedemptionTbtcRequirementAtBlock( d.caller, d.errorResolver, d.contractAddress, - "getOwnerRedemptionTbtcRequirement", + "collateralizationPercentage", &result, - _redeemer, ) return result, err } -func (d *Deposit) InActive() (bool, error) { - var result bool - result, err := d.contract.InActive( +func (d *Deposit) LotSizeSatoshis() (uint64, error) { + var result uint64 + result, err := d.contract.LotSizeSatoshis( d.callerOptions, ) @@ -3381,17 +3375,17 @@ func (d *Deposit) InActive() (bool, error) { err, d.callerOptions.From, nil, - "inActive", + "lotSizeSatoshis", ) } return result, err } -func (d *Deposit) InActiveAtBlock( +func (d *Deposit) LotSizeSatoshisAtBlock( blockNumber *big.Int, -) (bool, error) { - var result bool +) (uint64, error) { + var result uint64 err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3401,7 +3395,7 @@ func (d *Deposit) InActiveAtBlock( d.caller, d.errorResolver, d.contractAddress, - "inActive", + "lotSizeSatoshis", &result, ) @@ -3446,9 +3440,9 @@ func (d *Deposit) LotSizeTbtcAtBlock( return result, err } -func (d *Deposit) LotSizeSatoshis() (uint64, error) { - var result uint64 - result, err := d.contract.LotSizeSatoshis( +func (d *Deposit) SeverelyUndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := d.contract.SeverelyUndercollateralizedThresholdPercent( d.callerOptions, ) @@ -3457,17 +3451,17 @@ func (d *Deposit) LotSizeSatoshis() (uint64, error) { err, d.callerOptions.From, nil, - "lotSizeSatoshis", + "severelyUndercollateralizedThresholdPercent", ) } return result, err } -func (d *Deposit) LotSizeSatoshisAtBlock( +func (d *Deposit) SeverelyUndercollateralizedThresholdPercentAtBlock( blockNumber *big.Int, -) (uint64, error) { - var result uint64 +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3477,16 +3471,16 @@ func (d *Deposit) LotSizeSatoshisAtBlock( d.caller, d.errorResolver, d.contractAddress, - "lotSizeSatoshis", + "severelyUndercollateralizedThresholdPercent", &result, ) return result, err } -func (d *Deposit) SeverelyUndercollateralizedThresholdPercent() (uint16, error) { +func (d *Deposit) UndercollateralizedThresholdPercent() (uint16, error) { var result uint16 - result, err := d.contract.SeverelyUndercollateralizedThresholdPercent( + result, err := d.contract.UndercollateralizedThresholdPercent( d.callerOptions, ) @@ -3495,14 +3489,14 @@ func (d *Deposit) SeverelyUndercollateralizedThresholdPercent() (uint16, error) err, d.callerOptions.From, nil, - "severelyUndercollateralizedThresholdPercent", + "undercollateralizedThresholdPercent", ) } return result, err } -func (d *Deposit) SeverelyUndercollateralizedThresholdPercentAtBlock( +func (d *Deposit) UndercollateralizedThresholdPercentAtBlock( blockNumber *big.Int, ) (uint16, error) { var result uint16 @@ -3515,16 +3509,16 @@ func (d *Deposit) SeverelyUndercollateralizedThresholdPercentAtBlock( d.caller, d.errorResolver, d.contractAddress, - "severelyUndercollateralizedThresholdPercent", + "undercollateralizedThresholdPercent", &result, ) return result, err } -func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { - var result uint16 - result, err := d.contract.InitialCollateralizedPercent( +func (d *Deposit) WithdrawableAmount() (*big.Int, error) { + var result *big.Int + result, err := d.contract.WithdrawableAmount( d.callerOptions, ) @@ -3533,17 +3527,17 @@ func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { err, d.callerOptions.From, nil, - "initialCollateralizedPercent", + "withdrawableAmount", ) } return result, err } -func (d *Deposit) InitialCollateralizedPercentAtBlock( +func (d *Deposit) WithdrawableAmountAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3553,16 +3547,16 @@ func (d *Deposit) InitialCollateralizedPercentAtBlock( d.caller, d.errorResolver, d.contractAddress, - "initialCollateralizedPercent", + "withdrawableAmount", &result, ) return result, err } -func (d *Deposit) KeepAddress() (common.Address, error) { - var result common.Address - result, err := d.contract.KeepAddress( +func (d *Deposit) CurrentState() (*big.Int, error) { + var result *big.Int + result, err := d.contract.CurrentState( d.callerOptions, ) @@ -3571,17 +3565,17 @@ func (d *Deposit) KeepAddress() (common.Address, error) { err, d.callerOptions.From, nil, - "keepAddress", + "currentState", ) } return result, err } -func (d *Deposit) KeepAddressAtBlock( +func (d *Deposit) CurrentStateAtBlock( blockNumber *big.Int, -) (common.Address, error) { - var result common.Address +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3591,16 +3585,16 @@ func (d *Deposit) KeepAddressAtBlock( d.caller, d.errorResolver, d.contractAddress, - "keepAddress", + "currentState", &result, ) return result, err } -func (d *Deposit) WithdrawableAmount() (*big.Int, error) { - var result *big.Int - result, err := d.contract.WithdrawableAmount( +func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { + var result uint16 + result, err := d.contract.InitialCollateralizedPercent( d.callerOptions, ) @@ -3609,17 +3603,17 @@ func (d *Deposit) WithdrawableAmount() (*big.Int, error) { err, d.callerOptions.From, nil, - "withdrawableAmount", + "initialCollateralizedPercent", ) } return result, err } -func (d *Deposit) WithdrawableAmountAtBlock( +func (d *Deposit) InitialCollateralizedPercentAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3629,16 +3623,16 @@ func (d *Deposit) WithdrawableAmountAtBlock( d.caller, d.errorResolver, d.contractAddress, - "withdrawableAmount", + "initialCollateralizedPercent", &result, ) return result, err } -func (d *Deposit) CollateralizationPercentage() (*big.Int, error) { +func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { var result *big.Int - result, err := d.contract.CollateralizationPercentage( + result, err := d.contract.SignerFeeTbtc( d.callerOptions, ) @@ -3647,14 +3641,14 @@ func (d *Deposit) CollateralizationPercentage() (*big.Int, error) { err, d.callerOptions.From, nil, - "collateralizationPercentage", + "signerFeeTbtc", ) } return result, err } -func (d *Deposit) CollateralizationPercentageAtBlock( +func (d *Deposit) SignerFeeTbtcAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3667,16 +3661,22 @@ func (d *Deposit) CollateralizationPercentageAtBlock( d.caller, d.errorResolver, d.contractAddress, - "collateralizationPercentage", + "signerFeeTbtc", &result, ) return result, err } -func (d *Deposit) RemainingTerm() (*big.Int, error) { - var result *big.Int - result, err := d.contract.RemainingTerm( +type fundingInfo struct { + UtxoValueBytes [8]uint8 + FundedAt *big.Int + UtxoOutpoint []uint8 +} + +func (d *Deposit) FundingInfo() (fundingInfo, error) { + var result fundingInfo + result, err := d.contract.FundingInfo( d.callerOptions, ) @@ -3685,17 +3685,17 @@ func (d *Deposit) RemainingTerm() (*big.Int, error) { err, d.callerOptions.From, nil, - "remainingTerm", + "fundingInfo", ) } return result, err } -func (d *Deposit) RemainingTermAtBlock( +func (d *Deposit) FundingInfoAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (fundingInfo, error) { + var result fundingInfo err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3705,16 +3705,16 @@ func (d *Deposit) RemainingTermAtBlock( d.caller, d.errorResolver, d.contractAddress, - "remainingTerm", + "fundingInfo", &result, ) return result, err } -func (d *Deposit) AuctionValue() (*big.Int, error) { - var result *big.Int - result, err := d.contract.AuctionValue( +func (d *Deposit) InActive() (bool, error) { + var result bool + result, err := d.contract.InActive( d.callerOptions, ) @@ -3723,17 +3723,17 @@ func (d *Deposit) AuctionValue() (*big.Int, error) { err, d.callerOptions.From, nil, - "auctionValue", + "inActive", ) } return result, err } -func (d *Deposit) AuctionValueAtBlock( +func (d *Deposit) InActiveAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (bool, error) { + var result bool err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3743,16 +3743,16 @@ func (d *Deposit) AuctionValueAtBlock( d.caller, d.errorResolver, d.contractAddress, - "auctionValue", + "inActive", &result, ) return result, err } -func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { +func (d *Deposit) UtxoValue() (*big.Int, error) { var result *big.Int - result, err := d.contract.SignerFeeTbtc( + result, err := d.contract.UtxoValue( d.callerOptions, ) @@ -3761,14 +3761,14 @@ func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { err, d.callerOptions.From, nil, - "signerFeeTbtc", + "utxoValue", ) } return result, err } -func (d *Deposit) SignerFeeTbtcAtBlock( +func (d *Deposit) UtxoValueAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3781,7 +3781,7 @@ func (d *Deposit) SignerFeeTbtcAtBlock( d.caller, d.errorResolver, d.contractAddress, - "signerFeeTbtc", + "utxoValue", &result, ) diff --git a/bindings/go/contract/DepositLog.go b/bindings/go/contract/DepositLog.go index 204e953ff..c94c08768 100644 --- a/bindings/go/contract/DepositLog.go +++ b/bindings/go/contract/DepositLog.go @@ -20,7 +20,7 @@ import ( "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" "github.com/keep-network/keep-common/pkg/subscription" - "github.com/keep-network/tbtc/abi" + "github.com/keep-network/tbtc/bindings/go/abi" ) // Create a package-level logger for this contract. The logger exists at @@ -94,12 +94,19 @@ func NewDepositLog( // ----- Non-const Methods ------ // Transaction submission. -func (dl *DepositLog) LogExitedCourtesyCall( +func (dl *DepositLog) LogRegisteredPubkey( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logExitedCourtesyCall", + "submitting transaction logRegisteredPubkey", + "params: ", + fmt.Sprint( + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ), ) dl.transactionMutex.Lock() @@ -124,20 +131,24 @@ func (dl *DepositLog) LogExitedCourtesyCall( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogExitedCourtesyCall( + transaction, err := dl.contract.LogRegisteredPubkey( transactorOptions, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logExitedCourtesyCall", + "logRegisteredPubkey", + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) } dlLogger.Infof( - "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -148,20 +159,24 @@ func (dl *DepositLog) LogExitedCourtesyCall( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogExitedCourtesyCall( + transaction, err := dl.contract.LogRegisteredPubkey( transactorOptions, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logExitedCourtesyCall", + "logRegisteredPubkey", + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) } dlLogger.Infof( - "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -176,7 +191,9 @@ func (dl *DepositLog) LogExitedCourtesyCall( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogExitedCourtesyCall( +func (dl *DepositLog) CallLogRegisteredPubkey( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -188,34 +205,46 @@ func (dl *DepositLog) CallLogExitedCourtesyCall( dl.caller, dl.errorResolver, dl.contractAddress, - "logExitedCourtesyCall", + "logRegisteredPubkey", &result, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) return err } -func (dl *DepositLog) LogExitedCourtesyCallGasEstimate() (uint64, error) { +func (dl *DepositLog) LogRegisteredPubkeyGasEstimate( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logExitedCourtesyCall", + "logRegisteredPubkey", dl.contractABI, dl.transactor, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) return result, err } // Transaction submission. -func (dl *DepositLog) LogFraudDuringSetup( +func (dl *DepositLog) LogFunderRequestedAbort( + _abortOutputScript []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logFraudDuringSetup", + "submitting transaction logFunderRequestedAbort", + "params: ", + fmt.Sprint( + _abortOutputScript, + ), ) dl.transactionMutex.Lock() @@ -240,20 +269,22 @@ func (dl *DepositLog) LogFraudDuringSetup( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogFraudDuringSetup( + transaction, err := dl.contract.LogFunderRequestedAbort( transactorOptions, + _abortOutputScript, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logFraudDuringSetup", + "logFunderRequestedAbort", + _abortOutputScript, ) } dlLogger.Infof( - "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", + "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -264,20 +295,22 @@ func (dl *DepositLog) LogFraudDuringSetup( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogFraudDuringSetup( + transaction, err := dl.contract.LogFunderRequestedAbort( transactorOptions, + _abortOutputScript, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logFraudDuringSetup", + "logFunderRequestedAbort", + _abortOutputScript, ) } dlLogger.Infof( - "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", + "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -292,7 +325,8 @@ func (dl *DepositLog) LogFraudDuringSetup( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogFraudDuringSetup( +func (dl *DepositLog) CallLogFunderRequestedAbort( + _abortOutputScript []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -304,39 +338,38 @@ func (dl *DepositLog) CallLogFraudDuringSetup( dl.caller, dl.errorResolver, dl.contractAddress, - "logFraudDuringSetup", + "logFunderRequestedAbort", &result, + _abortOutputScript, ) return err } -func (dl *DepositLog) LogFraudDuringSetupGasEstimate() (uint64, error) { +func (dl *DepositLog) LogFunderRequestedAbortGasEstimate( + _abortOutputScript []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logFraudDuringSetup", + "logFunderRequestedAbort", dl.contractABI, dl.transactor, + _abortOutputScript, ) return result, err } // Transaction submission. -func (dl *DepositLog) LogFunderRequestedAbort( - _abortOutputScript []uint8, +func (dl *DepositLog) LogLiquidated( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logFunderRequestedAbort", - "params: ", - fmt.Sprint( - _abortOutputScript, - ), + "submitting transaction logLiquidated", ) dl.transactionMutex.Lock() @@ -361,22 +394,20 @@ func (dl *DepositLog) LogFunderRequestedAbort( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogFunderRequestedAbort( + transaction, err := dl.contract.LogLiquidated( transactorOptions, - _abortOutputScript, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logFunderRequestedAbort", - _abortOutputScript, + "logLiquidated", ) } dlLogger.Infof( - "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", + "submitted transaction logLiquidated with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -387,22 +418,20 @@ func (dl *DepositLog) LogFunderRequestedAbort( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogFunderRequestedAbort( + transaction, err := dl.contract.LogLiquidated( transactorOptions, - _abortOutputScript, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logFunderRequestedAbort", - _abortOutputScript, + "logLiquidated", ) } dlLogger.Infof( - "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", + "submitted transaction logLiquidated with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -417,8 +446,7 @@ func (dl *DepositLog) LogFunderRequestedAbort( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogFunderRequestedAbort( - _abortOutputScript []uint8, +func (dl *DepositLog) CallLogLiquidated( blockNumber *big.Int, ) error { var result interface{} = nil @@ -430,43 +458,34 @@ func (dl *DepositLog) CallLogFunderRequestedAbort( dl.caller, dl.errorResolver, dl.contractAddress, - "logFunderRequestedAbort", + "logLiquidated", &result, - _abortOutputScript, ) return err } -func (dl *DepositLog) LogFunderRequestedAbortGasEstimate( - _abortOutputScript []uint8, -) (uint64, error) { +func (dl *DepositLog) LogLiquidatedGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logFunderRequestedAbort", + "logLiquidated", dl.contractABI, dl.transactor, - _abortOutputScript, ) return result, err } // Transaction submission. -func (dl *DepositLog) LogFunded( - _txid [32]uint8, +func (dl *DepositLog) LogExitedCourtesyCall( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logFunded", - "params: ", - fmt.Sprint( - _txid, - ), + "submitting transaction logExitedCourtesyCall", ) dl.transactionMutex.Lock() @@ -491,22 +510,20 @@ func (dl *DepositLog) LogFunded( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogFunded( + transaction, err := dl.contract.LogExitedCourtesyCall( transactorOptions, - _txid, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logFunded", - _txid, + "logExitedCourtesyCall", ) } dlLogger.Infof( - "submitted transaction logFunded with id: [%v] and nonce [%v]", + "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -517,22 +534,20 @@ func (dl *DepositLog) LogFunded( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogFunded( + transaction, err := dl.contract.LogExitedCourtesyCall( transactorOptions, - _txid, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logFunded", - _txid, + "logExitedCourtesyCall", ) } dlLogger.Infof( - "submitted transaction logFunded with id: [%v] and nonce [%v]", + "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -547,8 +562,7 @@ func (dl *DepositLog) LogFunded( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogFunded( - _txid [32]uint8, +func (dl *DepositLog) CallLogExitedCourtesyCall( blockNumber *big.Int, ) error { var result interface{} = nil @@ -560,38 +574,39 @@ func (dl *DepositLog) CallLogFunded( dl.caller, dl.errorResolver, dl.contractAddress, - "logFunded", + "logExitedCourtesyCall", &result, - _txid, ) return err } -func (dl *DepositLog) LogFundedGasEstimate( - _txid [32]uint8, -) (uint64, error) { +func (dl *DepositLog) LogExitedCourtesyCallGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logFunded", + "logExitedCourtesyCall", dl.contractABI, dl.transactor, - _txid, ) return result, err } // Transaction submission. -func (dl *DepositLog) LogLiquidated( +func (dl *DepositLog) LogCreated( + _keepAddress common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logLiquidated", + "submitting transaction logCreated", + "params: ", + fmt.Sprint( + _keepAddress, + ), ) dl.transactionMutex.Lock() @@ -616,20 +631,22 @@ func (dl *DepositLog) LogLiquidated( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogLiquidated( + transaction, err := dl.contract.LogCreated( transactorOptions, + _keepAddress, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logLiquidated", + "logCreated", + _keepAddress, ) } dlLogger.Infof( - "submitted transaction logLiquidated with id: [%v] and nonce [%v]", + "submitted transaction logCreated with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -640,20 +657,22 @@ func (dl *DepositLog) LogLiquidated( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogLiquidated( + transaction, err := dl.contract.LogCreated( transactorOptions, + _keepAddress, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logLiquidated", + "logCreated", + _keepAddress, ) } dlLogger.Infof( - "submitted transaction logLiquidated with id: [%v] and nonce [%v]", + "submitted transaction logCreated with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -668,7 +687,8 @@ func (dl *DepositLog) LogLiquidated( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogLiquidated( +func (dl *DepositLog) CallLogCreated( + _keepAddress common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -680,48 +700,42 @@ func (dl *DepositLog) CallLogLiquidated( dl.caller, dl.errorResolver, dl.contractAddress, - "logLiquidated", + "logCreated", &result, + _keepAddress, ) return err } -func (dl *DepositLog) LogLiquidatedGasEstimate() (uint64, error) { +func (dl *DepositLog) LogCreatedGasEstimate( + _keepAddress common.Address, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logLiquidated", + "logCreated", dl.contractABI, dl.transactor, + _keepAddress, ) return result, err } // Transaction submission. -func (dl *DepositLog) LogRedemptionRequested( - _requester common.Address, - _digest [32]uint8, - _utxoValue *big.Int, - _redeemerOutputScript []uint8, - _requestedFee *big.Int, - _outpoint []uint8, +func (dl *DepositLog) LogFunded( + _txid [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logRedemptionRequested", + "submitting transaction logFunded", "params: ", fmt.Sprint( - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, + _txid, ), ) @@ -747,32 +761,22 @@ func (dl *DepositLog) LogRedemptionRequested( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogRedemptionRequested( + transaction, err := dl.contract.LogFunded( transactorOptions, - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, + _txid, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logRedemptionRequested", - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, + "logFunded", + _txid, ) } dlLogger.Infof( - "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", + "submitted transaction logFunded with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -783,32 +787,22 @@ func (dl *DepositLog) LogRedemptionRequested( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogRedemptionRequested( + transaction, err := dl.contract.LogFunded( transactorOptions, - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, + _txid, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logRedemptionRequested", - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, + "logFunded", + _txid, ) } dlLogger.Infof( - "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", + "submitted transaction logFunded with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -823,13 +817,8 @@ func (dl *DepositLog) LogRedemptionRequested( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogRedemptionRequested( - _requester common.Address, - _digest [32]uint8, - _utxoValue *big.Int, - _redeemerOutputScript []uint8, - _requestedFee *big.Int, - _outpoint []uint8, +func (dl *DepositLog) CallLogFunded( + _txid [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -841,41 +830,26 @@ func (dl *DepositLog) CallLogRedemptionRequested( dl.caller, dl.errorResolver, dl.contractAddress, - "logRedemptionRequested", + "logFunded", &result, - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, + _txid, ) return err } -func (dl *DepositLog) LogRedemptionRequestedGasEstimate( - _requester common.Address, - _digest [32]uint8, - _utxoValue *big.Int, - _redeemerOutputScript []uint8, - _requestedFee *big.Int, - _outpoint []uint8, +func (dl *DepositLog) LogFundedGasEstimate( + _txid [32]uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logRedemptionRequested", + "logFunded", dl.contractABI, dl.transactor, - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, + _txid, ) return result, err @@ -998,18 +972,16 @@ func (dl *DepositLog) LogSetupFailedGasEstimate() (uint64, error) { } // Transaction submission. -func (dl *DepositLog) LogRegisteredPubkey( - _signingGroupPubkeyX [32]uint8, - _signingGroupPubkeyY [32]uint8, +func (dl *DepositLog) LogStartedLiquidation( + _wasFraud bool, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logRegisteredPubkey", + "submitting transaction logStartedLiquidation", "params: ", fmt.Sprint( - _signingGroupPubkeyX, - _signingGroupPubkeyY, + _wasFraud, ), ) @@ -1035,24 +1007,22 @@ func (dl *DepositLog) LogRegisteredPubkey( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogRegisteredPubkey( + transaction, err := dl.contract.LogStartedLiquidation( transactorOptions, - _signingGroupPubkeyX, - _signingGroupPubkeyY, + _wasFraud, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logRegisteredPubkey", - _signingGroupPubkeyX, - _signingGroupPubkeyY, + "logStartedLiquidation", + _wasFraud, ) } dlLogger.Infof( - "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", + "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1063,24 +1033,22 @@ func (dl *DepositLog) LogRegisteredPubkey( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogRegisteredPubkey( + transaction, err := dl.contract.LogStartedLiquidation( transactorOptions, - _signingGroupPubkeyX, - _signingGroupPubkeyY, + _wasFraud, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logRegisteredPubkey", - _signingGroupPubkeyX, - _signingGroupPubkeyY, + "logStartedLiquidation", + _wasFraud, ) } dlLogger.Infof( - "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", + "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1095,9 +1063,8 @@ func (dl *DepositLog) LogRegisteredPubkey( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogRegisteredPubkey( - _signingGroupPubkeyX [32]uint8, - _signingGroupPubkeyY [32]uint8, +func (dl *DepositLog) CallLogStartedLiquidation( + _wasFraud bool, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1109,41 +1076,38 @@ func (dl *DepositLog) CallLogRegisteredPubkey( dl.caller, dl.errorResolver, dl.contractAddress, - "logRegisteredPubkey", + "logStartedLiquidation", &result, - _signingGroupPubkeyX, - _signingGroupPubkeyY, + _wasFraud, ) return err } -func (dl *DepositLog) LogRegisteredPubkeyGasEstimate( - _signingGroupPubkeyX [32]uint8, - _signingGroupPubkeyY [32]uint8, +func (dl *DepositLog) LogStartedLiquidationGasEstimate( + _wasFraud bool, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logRegisteredPubkey", + "logStartedLiquidation", dl.contractABI, dl.transactor, - _signingGroupPubkeyX, - _signingGroupPubkeyY, + _wasFraud, ) return result, err } // Transaction submission. -func (dl *DepositLog) LogCourtesyCalled( +func (dl *DepositLog) LogFraudDuringSetup( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logCourtesyCalled", + "submitting transaction logFraudDuringSetup", ) dl.transactionMutex.Lock() @@ -1168,7 +1132,7 @@ func (dl *DepositLog) LogCourtesyCalled( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogCourtesyCalled( + transaction, err := dl.contract.LogFraudDuringSetup( transactorOptions, ) if err != nil { @@ -1176,12 +1140,12 @@ func (dl *DepositLog) LogCourtesyCalled( err, dl.transactorOptions.From, nil, - "logCourtesyCalled", + "logFraudDuringSetup", ) } dlLogger.Infof( - "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", + "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1192,7 +1156,7 @@ func (dl *DepositLog) LogCourtesyCalled( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogCourtesyCalled( + transaction, err := dl.contract.LogFraudDuringSetup( transactorOptions, ) if err != nil { @@ -1200,12 +1164,12 @@ func (dl *DepositLog) LogCourtesyCalled( err, dl.transactorOptions.From, nil, - "logCourtesyCalled", + "logFraudDuringSetup", ) } dlLogger.Infof( - "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", + "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1220,7 +1184,7 @@ func (dl *DepositLog) LogCourtesyCalled( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogCourtesyCalled( +func (dl *DepositLog) CallLogFraudDuringSetup( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1232,20 +1196,20 @@ func (dl *DepositLog) CallLogCourtesyCalled( dl.caller, dl.errorResolver, dl.contractAddress, - "logCourtesyCalled", + "logFraudDuringSetup", &result, ) return err } -func (dl *DepositLog) LogCourtesyCalledGasEstimate() (uint64, error) { +func (dl *DepositLog) LogFraudDuringSetupGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logCourtesyCalled", + "logFraudDuringSetup", dl.contractABI, dl.transactor, ) @@ -1254,16 +1218,20 @@ func (dl *DepositLog) LogCourtesyCalledGasEstimate() (uint64, error) { } // Transaction submission. -func (dl *DepositLog) LogCreated( - _keepAddress common.Address, +func (dl *DepositLog) LogGotRedemptionSignature( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logCreated", + "submitting transaction logGotRedemptionSignature", "params: ", fmt.Sprint( - _keepAddress, + _digest, + _r, + _s, ), ) @@ -1289,22 +1257,26 @@ func (dl *DepositLog) LogCreated( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogCreated( + transaction, err := dl.contract.LogGotRedemptionSignature( transactorOptions, - _keepAddress, + _digest, + _r, + _s, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logCreated", - _keepAddress, + "logGotRedemptionSignature", + _digest, + _r, + _s, ) } dlLogger.Infof( - "submitted transaction logCreated with id: [%v] and nonce [%v]", + "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1315,22 +1287,26 @@ func (dl *DepositLog) LogCreated( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogCreated( + transaction, err := dl.contract.LogGotRedemptionSignature( transactorOptions, - _keepAddress, + _digest, + _r, + _s, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logCreated", - _keepAddress, + "logGotRedemptionSignature", + _digest, + _r, + _s, ) } dlLogger.Infof( - "submitted transaction logCreated with id: [%v] and nonce [%v]", + "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1345,8 +1321,10 @@ func (dl *DepositLog) LogCreated( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogCreated( - _keepAddress common.Address, +func (dl *DepositLog) CallLogGotRedemptionSignature( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1358,46 +1336,48 @@ func (dl *DepositLog) CallLogCreated( dl.caller, dl.errorResolver, dl.contractAddress, - "logCreated", + "logGotRedemptionSignature", &result, - _keepAddress, + _digest, + _r, + _s, ) return err } -func (dl *DepositLog) LogCreatedGasEstimate( - _keepAddress common.Address, +func (dl *DepositLog) LogGotRedemptionSignatureGasEstimate( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logCreated", + "logGotRedemptionSignature", dl.contractABI, dl.transactor, - _keepAddress, + _digest, + _r, + _s, ) return result, err } // Transaction submission. -func (dl *DepositLog) LogGotRedemptionSignature( - _digest [32]uint8, - _r [32]uint8, - _s [32]uint8, +func (dl *DepositLog) LogRedeemed( + _txid [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logGotRedemptionSignature", + "submitting transaction logRedeemed", "params: ", fmt.Sprint( - _digest, - _r, - _s, + _txid, ), ) @@ -1423,26 +1403,22 @@ func (dl *DepositLog) LogGotRedemptionSignature( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogGotRedemptionSignature( + transaction, err := dl.contract.LogRedeemed( transactorOptions, - _digest, - _r, - _s, + _txid, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logGotRedemptionSignature", - _digest, - _r, - _s, + "logRedeemed", + _txid, ) } dlLogger.Infof( - "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", + "submitted transaction logRedeemed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1453,26 +1429,22 @@ func (dl *DepositLog) LogGotRedemptionSignature( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogGotRedemptionSignature( + transaction, err := dl.contract.LogRedeemed( transactorOptions, - _digest, - _r, - _s, + _txid, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logGotRedemptionSignature", - _digest, - _r, - _s, + "logRedeemed", + _txid, ) } dlLogger.Infof( - "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", + "submitted transaction logRedeemed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1487,10 +1459,8 @@ func (dl *DepositLog) LogGotRedemptionSignature( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogGotRedemptionSignature( - _digest [32]uint8, - _r [32]uint8, - _s [32]uint8, +func (dl *DepositLog) CallLogRedeemed( + _txid [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1502,48 +1472,52 @@ func (dl *DepositLog) CallLogGotRedemptionSignature( dl.caller, dl.errorResolver, dl.contractAddress, - "logGotRedemptionSignature", + "logRedeemed", &result, - _digest, - _r, - _s, + _txid, ) return err } -func (dl *DepositLog) LogGotRedemptionSignatureGasEstimate( - _digest [32]uint8, - _r [32]uint8, - _s [32]uint8, +func (dl *DepositLog) LogRedeemedGasEstimate( + _txid [32]uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logGotRedemptionSignature", + "logRedeemed", dl.contractABI, dl.transactor, - _digest, - _r, - _s, + _txid, ) return result, err } // Transaction submission. -func (dl *DepositLog) LogRedeemed( - _txid [32]uint8, +func (dl *DepositLog) LogRedemptionRequested( + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logRedeemed", + "submitting transaction logRedemptionRequested", "params: ", fmt.Sprint( - _txid, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ), ) @@ -1569,22 +1543,32 @@ func (dl *DepositLog) LogRedeemed( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogRedeemed( + transaction, err := dl.contract.LogRedemptionRequested( transactorOptions, - _txid, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logRedeemed", - _txid, + "logRedemptionRequested", + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) } dlLogger.Infof( - "submitted transaction logRedeemed with id: [%v] and nonce [%v]", + "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1595,22 +1579,32 @@ func (dl *DepositLog) LogRedeemed( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogRedeemed( + transaction, err := dl.contract.LogRedemptionRequested( transactorOptions, - _txid, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logRedeemed", - _txid, + "logRedemptionRequested", + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) } dlLogger.Infof( - "submitted transaction logRedeemed with id: [%v] and nonce [%v]", + "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1625,8 +1619,13 @@ func (dl *DepositLog) LogRedeemed( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogRedeemed( - _txid [32]uint8, +func (dl *DepositLog) CallLogRedemptionRequested( + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1638,43 +1637,53 @@ func (dl *DepositLog) CallLogRedeemed( dl.caller, dl.errorResolver, dl.contractAddress, - "logRedeemed", + "logRedemptionRequested", &result, - _txid, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) return err } -func (dl *DepositLog) LogRedeemedGasEstimate( - _txid [32]uint8, +func (dl *DepositLog) LogRedemptionRequestedGasEstimate( + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logRedeemed", + "logRedemptionRequested", dl.contractABI, dl.transactor, - _txid, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) return result, err } // Transaction submission. -func (dl *DepositLog) LogStartedLiquidation( - _wasFraud bool, +func (dl *DepositLog) LogCourtesyCalled( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logStartedLiquidation", - "params: ", - fmt.Sprint( - _wasFraud, - ), + "submitting transaction logCourtesyCalled", ) dl.transactionMutex.Lock() @@ -1699,22 +1708,20 @@ func (dl *DepositLog) LogStartedLiquidation( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogStartedLiquidation( + transaction, err := dl.contract.LogCourtesyCalled( transactorOptions, - _wasFraud, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logStartedLiquidation", - _wasFraud, + "logCourtesyCalled", ) } dlLogger.Infof( - "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1725,22 +1732,20 @@ func (dl *DepositLog) LogStartedLiquidation( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogStartedLiquidation( + transaction, err := dl.contract.LogCourtesyCalled( transactorOptions, - _wasFraud, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logStartedLiquidation", - _wasFraud, + "logCourtesyCalled", ) } dlLogger.Infof( - "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1755,8 +1760,7 @@ func (dl *DepositLog) LogStartedLiquidation( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogStartedLiquidation( - _wasFraud bool, +func (dl *DepositLog) CallLogCourtesyCalled( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1768,26 +1772,22 @@ func (dl *DepositLog) CallLogStartedLiquidation( dl.caller, dl.errorResolver, dl.contractAddress, - "logStartedLiquidation", + "logCourtesyCalled", &result, - _wasFraud, ) return err } -func (dl *DepositLog) LogStartedLiquidationGasEstimate( - _wasFraud bool, -) (uint64, error) { +func (dl *DepositLog) LogCourtesyCalledGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logStartedLiquidation", + "logCourtesyCalled", dl.contractABI, dl.transactor, - _wasFraud, ) return result, err @@ -1841,18 +1841,20 @@ func (dl *DepositLog) ApprovedToLogAtBlock( // ------ Events ------- -type depositLogCreatedFunc func( +type depositLogGotRedemptionSignatureFunc func( _depositContractAddress common.Address, - _keepAddress common.Address, + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, _timestamp *big.Int, blockNumber uint64, ) -func (dl *DepositLog) WatchCreated( - success depositLogCreatedFunc, +func (dl *DepositLog) WatchGotRedemptionSignature( + success depositLogGotRedemptionSignatureFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _keepAddressFilter []common.Address, + _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -1869,11 +1871,11 @@ func (dl *DepositLog) WatchCreated( return err } - subscription, err := dl.subscribeCreated( + subscription, err := dl.subscribeGotRedemptionSignature( success, failCallback, _depositContractAddressFilter, - _keepAddressFilter, + _digestFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -1893,7 +1895,7 @@ func (dl *DepositLog) WatchCreated( select { case <-errorChan: dlLogger.Warning( - "subscription to event Created terminated with error; " + + "subscription to event GotRedemptionSignature terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -1914,23 +1916,23 @@ func (dl *DepositLog) WatchCreated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeCreated( - success depositLogCreatedFunc, +func (dl *DepositLog) subscribeGotRedemptionSignature( + success depositLogGotRedemptionSignatureFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _keepAddressFilter []common.Address, + _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogCreated) - eventSubscription, err := dl.contract.WatchCreated( + eventChan := make(chan *abi.DepositLogGotRedemptionSignature) + eventSubscription, err := dl.contract.WatchGotRedemptionSignature( nil, eventChan, _depositContractAddressFilter, - _keepAddressFilter, + _digestFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for Created events: [%v]", + "error creating watch for GotRedemptionSignature events: [%v]", err, ) } @@ -1949,7 +1951,9 @@ func (dl *DepositLog) subscribeCreated( } success( event._depositContractAddress, - event._keepAddress, + event._digest, + event._r, + event._s, event._timestamp, event.Raw.BlockNumber, ) @@ -1972,16 +1976,23 @@ func (dl *DepositLog) subscribeCreated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type depositLogExitedCourtesyCallFunc func( +type depositLogRedemptionRequestedFunc func( _depositContractAddress common.Address, - _timestamp *big.Int, + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, blockNumber uint64, ) -func (dl *DepositLog) WatchExitedCourtesyCall( - success depositLogExitedCourtesyCallFunc, +func (dl *DepositLog) WatchRedemptionRequested( + success depositLogRedemptionRequestedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _requesterFilter []common.Address, + _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -1998,10 +2009,12 @@ func (dl *DepositLog) WatchExitedCourtesyCall( return err } - subscription, err := dl.subscribeExitedCourtesyCall( + subscription, err := dl.subscribeRedemptionRequested( success, failCallback, _depositContractAddressFilter, + _requesterFilter, + _digestFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -2021,7 +2034,7 @@ func (dl *DepositLog) WatchExitedCourtesyCall( select { case <-errorChan: dlLogger.Warning( - "subscription to event ExitedCourtesyCall terminated with error; " + + "subscription to event RedemptionRequested terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -2042,21 +2055,25 @@ func (dl *DepositLog) WatchExitedCourtesyCall( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeExitedCourtesyCall( - success depositLogExitedCourtesyCallFunc, +func (dl *DepositLog) subscribeRedemptionRequested( + success depositLogRedemptionRequestedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _requesterFilter []common.Address, + _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogExitedCourtesyCall) - eventSubscription, err := dl.contract.WatchExitedCourtesyCall( + eventChan := make(chan *abi.DepositLogRedemptionRequested) + eventSubscription, err := dl.contract.WatchRedemptionRequested( nil, eventChan, _depositContractAddressFilter, + _requesterFilter, + _digestFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for ExitedCourtesyCall events: [%v]", + "error creating watch for RedemptionRequested events: [%v]", err, ) } @@ -2075,7 +2092,12 @@ func (dl *DepositLog) subscribeExitedCourtesyCall( } success( event._depositContractAddress, - event._timestamp, + event._requester, + event._digest, + event._utxoValue, + event._redeemerOutputScript, + event._requestedFee, + event._outpoint, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -2097,20 +2119,18 @@ func (dl *DepositLog) subscribeExitedCourtesyCall( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type depositLogGotRedemptionSignatureFunc func( +type depositLogRegisteredPubkeyFunc func( _depositContractAddress common.Address, - _digest [32]uint8, - _r [32]uint8, - _s [32]uint8, + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, _timestamp *big.Int, blockNumber uint64, ) -func (dl *DepositLog) WatchGotRedemptionSignature( - success depositLogGotRedemptionSignatureFunc, +func (dl *DepositLog) WatchRegisteredPubkey( + success depositLogRegisteredPubkeyFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -2127,11 +2147,10 @@ func (dl *DepositLog) WatchGotRedemptionSignature( return err } - subscription, err := dl.subscribeGotRedemptionSignature( + subscription, err := dl.subscribeRegisteredPubkey( success, failCallback, _depositContractAddressFilter, - _digestFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -2151,7 +2170,7 @@ func (dl *DepositLog) WatchGotRedemptionSignature( select { case <-errorChan: dlLogger.Warning( - "subscription to event GotRedemptionSignature terminated with error; " + + "subscription to event RegisteredPubkey terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -2172,23 +2191,21 @@ func (dl *DepositLog) WatchGotRedemptionSignature( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeGotRedemptionSignature( - success depositLogGotRedemptionSignatureFunc, +func (dl *DepositLog) subscribeRegisteredPubkey( + success depositLogRegisteredPubkeyFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogGotRedemptionSignature) - eventSubscription, err := dl.contract.WatchGotRedemptionSignature( + eventChan := make(chan *abi.DepositLogRegisteredPubkey) + eventSubscription, err := dl.contract.WatchRegisteredPubkey( nil, eventChan, _depositContractAddressFilter, - _digestFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for GotRedemptionSignature events: [%v]", + "error creating watch for RegisteredPubkey events: [%v]", err, ) } @@ -2207,9 +2224,8 @@ func (dl *DepositLog) subscribeGotRedemptionSignature( } success( event._depositContractAddress, - event._digest, - event._r, - event._s, + event._signingGroupPubkeyX, + event._signingGroupPubkeyY, event._timestamp, event.Raw.BlockNumber, ) @@ -2232,14 +2248,14 @@ func (dl *DepositLog) subscribeGotRedemptionSignature( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type depositLogLiquidatedFunc func( +type depositLogSetupFailedFunc func( _depositContractAddress common.Address, _timestamp *big.Int, blockNumber uint64, ) -func (dl *DepositLog) WatchLiquidated( - success depositLogLiquidatedFunc, +func (dl *DepositLog) WatchSetupFailed( + success depositLogSetupFailedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { @@ -2258,7 +2274,7 @@ func (dl *DepositLog) WatchLiquidated( return err } - subscription, err := dl.subscribeLiquidated( + subscription, err := dl.subscribeSetupFailed( success, failCallback, _depositContractAddressFilter, @@ -2281,7 +2297,7 @@ func (dl *DepositLog) WatchLiquidated( select { case <-errorChan: dlLogger.Warning( - "subscription to event Liquidated terminated with error; " + + "subscription to event SetupFailed terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -2302,13 +2318,13 @@ func (dl *DepositLog) WatchLiquidated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeLiquidated( - success depositLogLiquidatedFunc, +func (dl *DepositLog) subscribeSetupFailed( + success depositLogSetupFailedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogLiquidated) - eventSubscription, err := dl.contract.WatchLiquidated( + eventChan := make(chan *abi.DepositLogSetupFailed) + eventSubscription, err := dl.contract.WatchSetupFailed( nil, eventChan, _depositContractAddressFilter, @@ -2316,7 +2332,7 @@ func (dl *DepositLog) subscribeLiquidated( if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for Liquidated events: [%v]", + "error creating watch for SetupFailed events: [%v]", err, ) } @@ -2357,18 +2373,17 @@ func (dl *DepositLog) subscribeLiquidated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type depositLogRedeemedFunc func( +type depositLogStartedLiquidationFunc func( _depositContractAddress common.Address, - _txid [32]uint8, + _wasFraud bool, _timestamp *big.Int, blockNumber uint64, ) -func (dl *DepositLog) WatchRedeemed( - success depositLogRedeemedFunc, +func (dl *DepositLog) WatchStartedLiquidation( + success depositLogStartedLiquidationFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -2385,11 +2400,10 @@ func (dl *DepositLog) WatchRedeemed( return err } - subscription, err := dl.subscribeRedeemed( + subscription, err := dl.subscribeStartedLiquidation( success, failCallback, _depositContractAddressFilter, - _txidFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -2409,7 +2423,7 @@ func (dl *DepositLog) WatchRedeemed( select { case <-errorChan: dlLogger.Warning( - "subscription to event Redeemed terminated with error; " + + "subscription to event StartedLiquidation terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -2430,23 +2444,21 @@ func (dl *DepositLog) WatchRedeemed( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeRedeemed( - success depositLogRedeemedFunc, +func (dl *DepositLog) subscribeStartedLiquidation( + success depositLogStartedLiquidationFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogRedeemed) - eventSubscription, err := dl.contract.WatchRedeemed( + eventChan := make(chan *abi.DepositLogStartedLiquidation) + eventSubscription, err := dl.contract.WatchStartedLiquidation( nil, eventChan, _depositContractAddressFilter, - _txidFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for Redeemed events: [%v]", + "error creating watch for StartedLiquidation events: [%v]", err, ) } @@ -2465,7 +2477,7 @@ func (dl *DepositLog) subscribeRedeemed( } success( event._depositContractAddress, - event._txid, + event._wasFraud, event._timestamp, event.Raw.BlockNumber, ) @@ -2488,14 +2500,14 @@ func (dl *DepositLog) subscribeRedeemed( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type depositLogCourtesyCalledFunc func( +type depositLogExitedCourtesyCallFunc func( _depositContractAddress common.Address, _timestamp *big.Int, blockNumber uint64, ) -func (dl *DepositLog) WatchCourtesyCalled( - success depositLogCourtesyCalledFunc, +func (dl *DepositLog) WatchExitedCourtesyCall( + success depositLogExitedCourtesyCallFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { @@ -2514,7 +2526,7 @@ func (dl *DepositLog) WatchCourtesyCalled( return err } - subscription, err := dl.subscribeCourtesyCalled( + subscription, err := dl.subscribeExitedCourtesyCall( success, failCallback, _depositContractAddressFilter, @@ -2537,7 +2549,7 @@ func (dl *DepositLog) WatchCourtesyCalled( select { case <-errorChan: dlLogger.Warning( - "subscription to event CourtesyCalled terminated with error; " + + "subscription to event ExitedCourtesyCall terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -2558,13 +2570,13 @@ func (dl *DepositLog) WatchCourtesyCalled( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeCourtesyCalled( - success depositLogCourtesyCalledFunc, +func (dl *DepositLog) subscribeExitedCourtesyCall( + success depositLogExitedCourtesyCallFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogCourtesyCalled) - eventSubscription, err := dl.contract.WatchCourtesyCalled( + eventChan := make(chan *abi.DepositLogExitedCourtesyCall) + eventSubscription, err := dl.contract.WatchExitedCourtesyCall( nil, eventChan, _depositContractAddressFilter, @@ -2572,7 +2584,7 @@ func (dl *DepositLog) subscribeCourtesyCalled( if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for CourtesyCalled events: [%v]", + "error creating watch for ExitedCourtesyCall events: [%v]", err, ) } @@ -2744,14 +2756,14 @@ func (dl *DepositLog) subscribeFunded( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type depositLogFunderAbortRequestedFunc func( +type depositLogFraudDuringSetupFunc func( _depositContractAddress common.Address, - _abortOutputScript []uint8, + _timestamp *big.Int, blockNumber uint64, ) -func (dl *DepositLog) WatchFunderAbortRequested( - success depositLogFunderAbortRequestedFunc, +func (dl *DepositLog) WatchFraudDuringSetup( + success depositLogFraudDuringSetupFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { @@ -2770,7 +2782,7 @@ func (dl *DepositLog) WatchFunderAbortRequested( return err } - subscription, err := dl.subscribeFunderAbortRequested( + subscription, err := dl.subscribeFraudDuringSetup( success, failCallback, _depositContractAddressFilter, @@ -2793,7 +2805,7 @@ func (dl *DepositLog) WatchFunderAbortRequested( select { case <-errorChan: dlLogger.Warning( - "subscription to event FunderAbortRequested terminated with error; " + + "subscription to event FraudDuringSetup terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -2814,13 +2826,13 @@ func (dl *DepositLog) WatchFunderAbortRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeFunderAbortRequested( - success depositLogFunderAbortRequestedFunc, +func (dl *DepositLog) subscribeFraudDuringSetup( + success depositLogFraudDuringSetupFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogFunderAbortRequested) - eventSubscription, err := dl.contract.WatchFunderAbortRequested( + eventChan := make(chan *abi.DepositLogFraudDuringSetup) + eventSubscription, err := dl.contract.WatchFraudDuringSetup( nil, eventChan, _depositContractAddressFilter, @@ -2828,7 +2840,7 @@ func (dl *DepositLog) subscribeFunderAbortRequested( if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for FunderAbortRequested events: [%v]", + "error creating watch for FraudDuringSetup events: [%v]", err, ) } @@ -2847,7 +2859,7 @@ func (dl *DepositLog) subscribeFunderAbortRequested( } success( event._depositContractAddress, - event._abortOutputScript, + event._timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -2869,23 +2881,16 @@ func (dl *DepositLog) subscribeFunderAbortRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type depositLogRedemptionRequestedFunc func( +type depositLogFunderAbortRequestedFunc func( _depositContractAddress common.Address, - _requester common.Address, - _digest [32]uint8, - _utxoValue *big.Int, - _redeemerOutputScript []uint8, - _requestedFee *big.Int, - _outpoint []uint8, + _abortOutputScript []uint8, blockNumber uint64, ) -func (dl *DepositLog) WatchRedemptionRequested( - success depositLogRedemptionRequestedFunc, +func (dl *DepositLog) WatchFunderAbortRequested( + success depositLogFunderAbortRequestedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _requesterFilter []common.Address, - _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -2902,12 +2907,10 @@ func (dl *DepositLog) WatchRedemptionRequested( return err } - subscription, err := dl.subscribeRedemptionRequested( + subscription, err := dl.subscribeFunderAbortRequested( success, failCallback, _depositContractAddressFilter, - _requesterFilter, - _digestFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -2927,7 +2930,7 @@ func (dl *DepositLog) WatchRedemptionRequested( select { case <-errorChan: dlLogger.Warning( - "subscription to event RedemptionRequested terminated with error; " + + "subscription to event FunderAbortRequested terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -2948,25 +2951,21 @@ func (dl *DepositLog) WatchRedemptionRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeRedemptionRequested( - success depositLogRedemptionRequestedFunc, +func (dl *DepositLog) subscribeFunderAbortRequested( + success depositLogFunderAbortRequestedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _requesterFilter []common.Address, - _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogRedemptionRequested) - eventSubscription, err := dl.contract.WatchRedemptionRequested( + eventChan := make(chan *abi.DepositLogFunderAbortRequested) + eventSubscription, err := dl.contract.WatchFunderAbortRequested( nil, eventChan, _depositContractAddressFilter, - _requesterFilter, - _digestFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for RedemptionRequested events: [%v]", + "error creating watch for FunderAbortRequested events: [%v]", err, ) } @@ -2985,12 +2984,7 @@ func (dl *DepositLog) subscribeRedemptionRequested( } success( event._depositContractAddress, - event._requester, - event._digest, - event._utxoValue, - event._redeemerOutputScript, - event._requestedFee, - event._outpoint, + event._abortOutputScript, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -3012,16 +3006,14 @@ func (dl *DepositLog) subscribeRedemptionRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type depositLogRegisteredPubkeyFunc func( +type depositLogLiquidatedFunc func( _depositContractAddress common.Address, - _signingGroupPubkeyX [32]uint8, - _signingGroupPubkeyY [32]uint8, _timestamp *big.Int, blockNumber uint64, ) -func (dl *DepositLog) WatchRegisteredPubkey( - success depositLogRegisteredPubkeyFunc, +func (dl *DepositLog) WatchLiquidated( + success depositLogLiquidatedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { @@ -3040,7 +3032,7 @@ func (dl *DepositLog) WatchRegisteredPubkey( return err } - subscription, err := dl.subscribeRegisteredPubkey( + subscription, err := dl.subscribeLiquidated( success, failCallback, _depositContractAddressFilter, @@ -3063,7 +3055,7 @@ func (dl *DepositLog) WatchRegisteredPubkey( select { case <-errorChan: dlLogger.Warning( - "subscription to event RegisteredPubkey terminated with error; " + + "subscription to event Liquidated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -3084,13 +3076,13 @@ func (dl *DepositLog) WatchRegisteredPubkey( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeRegisteredPubkey( - success depositLogRegisteredPubkeyFunc, +func (dl *DepositLog) subscribeLiquidated( + success depositLogLiquidatedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogRegisteredPubkey) - eventSubscription, err := dl.contract.WatchRegisteredPubkey( + eventChan := make(chan *abi.DepositLogLiquidated) + eventSubscription, err := dl.contract.WatchLiquidated( nil, eventChan, _depositContractAddressFilter, @@ -3098,7 +3090,7 @@ func (dl *DepositLog) subscribeRegisteredPubkey( if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for RegisteredPubkey events: [%v]", + "error creating watch for Liquidated events: [%v]", err, ) } @@ -3117,8 +3109,6 @@ func (dl *DepositLog) subscribeRegisteredPubkey( } success( event._depositContractAddress, - event._signingGroupPubkeyX, - event._signingGroupPubkeyY, event._timestamp, event.Raw.BlockNumber, ) @@ -3141,16 +3131,18 @@ func (dl *DepositLog) subscribeRegisteredPubkey( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type depositLogSetupFailedFunc func( +type depositLogRedeemedFunc func( _depositContractAddress common.Address, + _txid [32]uint8, _timestamp *big.Int, blockNumber uint64, ) -func (dl *DepositLog) WatchSetupFailed( - success depositLogSetupFailedFunc, +func (dl *DepositLog) WatchRedeemed( + success depositLogRedeemedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -3167,10 +3159,11 @@ func (dl *DepositLog) WatchSetupFailed( return err } - subscription, err := dl.subscribeSetupFailed( + subscription, err := dl.subscribeRedeemed( success, failCallback, _depositContractAddressFilter, + _txidFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -3190,7 +3183,7 @@ func (dl *DepositLog) WatchSetupFailed( select { case <-errorChan: dlLogger.Warning( - "subscription to event SetupFailed terminated with error; " + + "subscription to event Redeemed terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -3211,21 +3204,23 @@ func (dl *DepositLog) WatchSetupFailed( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeSetupFailed( - success depositLogSetupFailedFunc, +func (dl *DepositLog) subscribeRedeemed( + success depositLogRedeemedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogSetupFailed) - eventSubscription, err := dl.contract.WatchSetupFailed( + eventChan := make(chan *abi.DepositLogRedeemed) + eventSubscription, err := dl.contract.WatchRedeemed( nil, eventChan, _depositContractAddressFilter, + _txidFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for SetupFailed events: [%v]", + "error creating watch for Redeemed events: [%v]", err, ) } @@ -3244,6 +3239,7 @@ func (dl *DepositLog) subscribeSetupFailed( } success( event._depositContractAddress, + event._txid, event._timestamp, event.Raw.BlockNumber, ) @@ -3266,15 +3262,14 @@ func (dl *DepositLog) subscribeSetupFailed( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type depositLogStartedLiquidationFunc func( +type depositLogCourtesyCalledFunc func( _depositContractAddress common.Address, - _wasFraud bool, _timestamp *big.Int, blockNumber uint64, ) -func (dl *DepositLog) WatchStartedLiquidation( - success depositLogStartedLiquidationFunc, +func (dl *DepositLog) WatchCourtesyCalled( + success depositLogCourtesyCalledFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { @@ -3293,7 +3288,7 @@ func (dl *DepositLog) WatchStartedLiquidation( return err } - subscription, err := dl.subscribeStartedLiquidation( + subscription, err := dl.subscribeCourtesyCalled( success, failCallback, _depositContractAddressFilter, @@ -3316,7 +3311,7 @@ func (dl *DepositLog) WatchStartedLiquidation( select { case <-errorChan: dlLogger.Warning( - "subscription to event StartedLiquidation terminated with error; " + + "subscription to event CourtesyCalled terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -3337,13 +3332,13 @@ func (dl *DepositLog) WatchStartedLiquidation( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeStartedLiquidation( - success depositLogStartedLiquidationFunc, +func (dl *DepositLog) subscribeCourtesyCalled( + success depositLogCourtesyCalledFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogStartedLiquidation) - eventSubscription, err := dl.contract.WatchStartedLiquidation( + eventChan := make(chan *abi.DepositLogCourtesyCalled) + eventSubscription, err := dl.contract.WatchCourtesyCalled( nil, eventChan, _depositContractAddressFilter, @@ -3351,7 +3346,7 @@ func (dl *DepositLog) subscribeStartedLiquidation( if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for StartedLiquidation events: [%v]", + "error creating watch for CourtesyCalled events: [%v]", err, ) } @@ -3370,7 +3365,6 @@ func (dl *DepositLog) subscribeStartedLiquidation( } success( event._depositContractAddress, - event._wasFraud, event._timestamp, event.Raw.BlockNumber, ) @@ -3393,16 +3387,18 @@ func (dl *DepositLog) subscribeStartedLiquidation( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type depositLogFraudDuringSetupFunc func( +type depositLogCreatedFunc func( _depositContractAddress common.Address, + _keepAddress common.Address, _timestamp *big.Int, blockNumber uint64, ) -func (dl *DepositLog) WatchFraudDuringSetup( - success depositLogFraudDuringSetupFunc, +func (dl *DepositLog) WatchCreated( + success depositLogCreatedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _keepAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -3419,10 +3415,11 @@ func (dl *DepositLog) WatchFraudDuringSetup( return err } - subscription, err := dl.subscribeFraudDuringSetup( + subscription, err := dl.subscribeCreated( success, failCallback, _depositContractAddressFilter, + _keepAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -3442,7 +3439,7 @@ func (dl *DepositLog) WatchFraudDuringSetup( select { case <-errorChan: dlLogger.Warning( - "subscription to event FraudDuringSetup terminated with error; " + + "subscription to event Created terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -3463,21 +3460,23 @@ func (dl *DepositLog) WatchFraudDuringSetup( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeFraudDuringSetup( - success depositLogFraudDuringSetupFunc, +func (dl *DepositLog) subscribeCreated( + success depositLogCreatedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _keepAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogFraudDuringSetup) - eventSubscription, err := dl.contract.WatchFraudDuringSetup( + eventChan := make(chan *abi.DepositLogCreated) + eventSubscription, err := dl.contract.WatchCreated( nil, eventChan, _depositContractAddressFilter, + _keepAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for FraudDuringSetup events: [%v]", + "error creating watch for Created events: [%v]", err, ) } @@ -3496,6 +3495,7 @@ func (dl *DepositLog) subscribeFraudDuringSetup( } success( event._depositContractAddress, + event._keepAddress, event._timestamp, event.Raw.BlockNumber, ) diff --git a/bindings/go/go.mod b/bindings/go/go.mod index c75123b80..23c7fa1fe 100644 --- a/bindings/go/go.mod +++ b/bindings/go/go.mod @@ -1,4 +1,4 @@ -module github.com/keep-network/tbtc +module github.com/keep-network/tbtc/bindings/go go 1.13 diff --git a/bindings/go/go.sum b/bindings/go/go.sum index 1527f437a..75dc46c29 100644 --- a/bindings/go/go.sum +++ b/bindings/go/go.sum @@ -333,6 +333,7 @@ github.com/keep-network/keep-common v1.2.0 h1:hVd2tTd7vL+9CQP5Ntk5kjs+GYvkgrRNBc github.com/keep-network/keep-common v1.2.0/go.mod h1:emxogTbBdey7M3jOzfxZOdfn139kN2mI2b2wA6AHKKo= github.com/keep-network/keep-core v1.3.0 h1:7Tb33EmO/ntHOEbOiYciRlBhqu5Ln6KemWCaYK0Z6LA= github.com/keep-network/keep-core v1.3.0/go.mod h1:1KsSSTQoN754TrFLW7kLy50pOG2CQ4BOfnJqdvEG7FA= +github.com/keep-network/tbtc v1.1.0 h1:9ZCuBsrJYN1L1V7bAC98ZAtxv+ZIHcMhz6RJLAizLvY= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= From 40b4f632012b278d3a78af9ac48b44193c8bbc66 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Wed, 14 Oct 2020 19:51:47 +0200 Subject: [PATCH 03/14] Check in abigen files --- .gitignore | 2 +- bindings/go/abi/DepositLog.go | 2406 ++++++++++++++++++++++++++++ bindings/go/abi/deposit/Deposit.go | 1091 +++++++++++++ 3 files changed, 3498 insertions(+), 1 deletion(-) create mode 100644 bindings/go/abi/DepositLog.go create mode 100644 bindings/go/abi/deposit/Deposit.go diff --git a/.gitignore b/.gitignore index 648569794..97a0078f3 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,7 @@ __pycache__/ node_modules/ artifacts/ .mypy_cache -bindings/go/abi +bindings/go/abi/**/*.abi # Visual Studio Code *.code-workspace diff --git a/bindings/go/abi/DepositLog.go b/bindings/go/abi/DepositLog.go new file mode 100644 index 000000000..1e3999447 --- /dev/null +++ b/bindings/go/abi/DepositLog.go @@ -0,0 +1,2406 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package abi + +import ( + "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 ( + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = abi.U256 + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// DepositLogABI is the input ABI used to generate the binding from. +const DepositLogABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"CourtesyCalled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_keepAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"Created\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"ExitedCourtesyCall\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"FraudDuringSetup\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_txid\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"Funded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_abortOutputScript\",\"type\":\"bytes\"}],\"name\":\"FunderAbortRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_digest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_r\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_s\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"GotRedemptionSignature\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"Liquidated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_txid\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"Redeemed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_digest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_utxoValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_redeemerOutputScript\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_requestedFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_outpoint\",\"type\":\"bytes\"}],\"name\":\"RedemptionRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_signingGroupPubkeyX\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_signingGroupPubkeyY\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"RegisteredPubkey\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"SetupFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_wasFraud\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"StartedLiquidation\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_caller\",\"type\":\"address\"}],\"name\":\"approvedToLog\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"logCourtesyCalled\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_keepAddress\",\"type\":\"address\"}],\"name\":\"logCreated\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"logExitedCourtesyCall\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"logFraudDuringSetup\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_txid\",\"type\":\"bytes32\"}],\"name\":\"logFunded\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_abortOutputScript\",\"type\":\"bytes\"}],\"name\":\"logFunderRequestedAbort\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_digest\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_s\",\"type\":\"bytes32\"}],\"name\":\"logGotRedemptionSignature\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"logLiquidated\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_txid\",\"type\":\"bytes32\"}],\"name\":\"logRedeemed\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_requester\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_digest\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_utxoValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_redeemerOutputScript\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_requestedFee\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_outpoint\",\"type\":\"bytes\"}],\"name\":\"logRedemptionRequested\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_signingGroupPubkeyX\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_signingGroupPubkeyY\",\"type\":\"bytes32\"}],\"name\":\"logRegisteredPubkey\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"logSetupFailed\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bool\",\"name\":\"_wasFraud\",\"type\":\"bool\"}],\"name\":\"logStartedLiquidation\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" + +// DepositLog is an auto generated Go binding around an Ethereum contract. +type DepositLog struct { + DepositLogCaller // Read-only binding to the contract + DepositLogTransactor // Write-only binding to the contract + DepositLogFilterer // Log filterer for contract events +} + +// DepositLogCaller is an auto generated read-only Go binding around an Ethereum contract. +type DepositLogCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DepositLogTransactor is an auto generated write-only Go binding around an Ethereum contract. +type DepositLogTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DepositLogFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type DepositLogFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DepositLogSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type DepositLogSession struct { + Contract *DepositLog // 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 +} + +// DepositLogCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type DepositLogCallerSession struct { + Contract *DepositLogCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// DepositLogTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type DepositLogTransactorSession struct { + Contract *DepositLogTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// DepositLogRaw is an auto generated low-level Go binding around an Ethereum contract. +type DepositLogRaw struct { + Contract *DepositLog // Generic contract binding to access the raw methods on +} + +// DepositLogCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type DepositLogCallerRaw struct { + Contract *DepositLogCaller // Generic read-only contract binding to access the raw methods on +} + +// DepositLogTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type DepositLogTransactorRaw struct { + Contract *DepositLogTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewDepositLog creates a new instance of DepositLog, bound to a specific deployed contract. +func NewDepositLog(address common.Address, backend bind.ContractBackend) (*DepositLog, error) { + contract, err := bindDepositLog(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &DepositLog{DepositLogCaller: DepositLogCaller{contract: contract}, DepositLogTransactor: DepositLogTransactor{contract: contract}, DepositLogFilterer: DepositLogFilterer{contract: contract}}, nil +} + +// NewDepositLogCaller creates a new read-only instance of DepositLog, bound to a specific deployed contract. +func NewDepositLogCaller(address common.Address, caller bind.ContractCaller) (*DepositLogCaller, error) { + contract, err := bindDepositLog(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &DepositLogCaller{contract: contract}, nil +} + +// NewDepositLogTransactor creates a new write-only instance of DepositLog, bound to a specific deployed contract. +func NewDepositLogTransactor(address common.Address, transactor bind.ContractTransactor) (*DepositLogTransactor, error) { + contract, err := bindDepositLog(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &DepositLogTransactor{contract: contract}, nil +} + +// NewDepositLogFilterer creates a new log filterer instance of DepositLog, bound to a specific deployed contract. +func NewDepositLogFilterer(address common.Address, filterer bind.ContractFilterer) (*DepositLogFilterer, error) { + contract, err := bindDepositLog(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &DepositLogFilterer{contract: contract}, nil +} + +// bindDepositLog binds a generic wrapper to an already deployed contract. +func bindDepositLog(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(DepositLogABI)) + 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 (_DepositLog *DepositLogRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _DepositLog.Contract.DepositLogCaller.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 (_DepositLog *DepositLogRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DepositLog.Contract.DepositLogTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_DepositLog *DepositLogRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DepositLog.Contract.DepositLogTransactor.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 (_DepositLog *DepositLogCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _DepositLog.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 (_DepositLog *DepositLogTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DepositLog.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_DepositLog *DepositLogTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _DepositLog.Contract.contract.Transact(opts, method, params...) +} + +// ApprovedToLog is a free data retrieval call binding the contract method 0x9ffb3862. +// +// Solidity: function approvedToLog(address _caller) constant returns(bool) +func (_DepositLog *DepositLogCaller) ApprovedToLog(opts *bind.CallOpts, _caller common.Address) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _DepositLog.contract.Call(opts, out, "approvedToLog", _caller) + return *ret0, err +} + +// ApprovedToLog is a free data retrieval call binding the contract method 0x9ffb3862. +// +// Solidity: function approvedToLog(address _caller) constant returns(bool) +func (_DepositLog *DepositLogSession) ApprovedToLog(_caller common.Address) (bool, error) { + return _DepositLog.Contract.ApprovedToLog(&_DepositLog.CallOpts, _caller) +} + +// ApprovedToLog is a free data retrieval call binding the contract method 0x9ffb3862. +// +// Solidity: function approvedToLog(address _caller) constant returns(bool) +func (_DepositLog *DepositLogCallerSession) ApprovedToLog(_caller common.Address) (bool, error) { + return _DepositLog.Contract.ApprovedToLog(&_DepositLog.CallOpts, _caller) +} + +// LogCourtesyCalled is a paid mutator transaction binding the contract method 0x22a147e6. +// +// Solidity: function logCourtesyCalled() returns() +func (_DepositLog *DepositLogTransactor) LogCourtesyCalled(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DepositLog.contract.Transact(opts, "logCourtesyCalled") +} + +// LogCourtesyCalled is a paid mutator transaction binding the contract method 0x22a147e6. +// +// Solidity: function logCourtesyCalled() returns() +func (_DepositLog *DepositLogSession) LogCourtesyCalled() (*types.Transaction, error) { + return _DepositLog.Contract.LogCourtesyCalled(&_DepositLog.TransactOpts) +} + +// LogCourtesyCalled is a paid mutator transaction binding the contract method 0x22a147e6. +// +// Solidity: function logCourtesyCalled() returns() +func (_DepositLog *DepositLogTransactorSession) LogCourtesyCalled() (*types.Transaction, error) { + return _DepositLog.Contract.LogCourtesyCalled(&_DepositLog.TransactOpts) +} + +// LogCreated is a paid mutator transaction binding the contract method 0x282bfd38. +// +// Solidity: function logCreated(address _keepAddress) returns() +func (_DepositLog *DepositLogTransactor) LogCreated(opts *bind.TransactOpts, _keepAddress common.Address) (*types.Transaction, error) { + return _DepositLog.contract.Transact(opts, "logCreated", _keepAddress) +} + +// LogCreated is a paid mutator transaction binding the contract method 0x282bfd38. +// +// Solidity: function logCreated(address _keepAddress) returns() +func (_DepositLog *DepositLogSession) LogCreated(_keepAddress common.Address) (*types.Transaction, error) { + return _DepositLog.Contract.LogCreated(&_DepositLog.TransactOpts, _keepAddress) +} + +// LogCreated is a paid mutator transaction binding the contract method 0x282bfd38. +// +// Solidity: function logCreated(address _keepAddress) returns() +func (_DepositLog *DepositLogTransactorSession) LogCreated(_keepAddress common.Address) (*types.Transaction, error) { + return _DepositLog.Contract.LogCreated(&_DepositLog.TransactOpts, _keepAddress) +} + +// LogExitedCourtesyCall is a paid mutator transaction binding the contract method 0x22e5724c. +// +// Solidity: function logExitedCourtesyCall() returns() +func (_DepositLog *DepositLogTransactor) LogExitedCourtesyCall(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DepositLog.contract.Transact(opts, "logExitedCourtesyCall") +} + +// LogExitedCourtesyCall is a paid mutator transaction binding the contract method 0x22e5724c. +// +// Solidity: function logExitedCourtesyCall() returns() +func (_DepositLog *DepositLogSession) LogExitedCourtesyCall() (*types.Transaction, error) { + return _DepositLog.Contract.LogExitedCourtesyCall(&_DepositLog.TransactOpts) +} + +// LogExitedCourtesyCall is a paid mutator transaction binding the contract method 0x22e5724c. +// +// Solidity: function logExitedCourtesyCall() returns() +func (_DepositLog *DepositLogTransactorSession) LogExitedCourtesyCall() (*types.Transaction, error) { + return _DepositLog.Contract.LogExitedCourtesyCall(&_DepositLog.TransactOpts) +} + +// LogFraudDuringSetup is a paid mutator transaction binding the contract method 0xe2c50ad8. +// +// Solidity: function logFraudDuringSetup() returns() +func (_DepositLog *DepositLogTransactor) LogFraudDuringSetup(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DepositLog.contract.Transact(opts, "logFraudDuringSetup") +} + +// LogFraudDuringSetup is a paid mutator transaction binding the contract method 0xe2c50ad8. +// +// Solidity: function logFraudDuringSetup() returns() +func (_DepositLog *DepositLogSession) LogFraudDuringSetup() (*types.Transaction, error) { + return _DepositLog.Contract.LogFraudDuringSetup(&_DepositLog.TransactOpts) +} + +// LogFraudDuringSetup is a paid mutator transaction binding the contract method 0xe2c50ad8. +// +// Solidity: function logFraudDuringSetup() returns() +func (_DepositLog *DepositLogTransactorSession) LogFraudDuringSetup() (*types.Transaction, error) { + return _DepositLog.Contract.LogFraudDuringSetup(&_DepositLog.TransactOpts) +} + +// LogFunded is a paid mutator transaction binding the contract method 0x7ed451a4. +// +// Solidity: function logFunded(bytes32 _txid) returns() +func (_DepositLog *DepositLogTransactor) LogFunded(opts *bind.TransactOpts, _txid [32]byte) (*types.Transaction, error) { + return _DepositLog.contract.Transact(opts, "logFunded", _txid) +} + +// LogFunded is a paid mutator transaction binding the contract method 0x7ed451a4. +// +// Solidity: function logFunded(bytes32 _txid) returns() +func (_DepositLog *DepositLogSession) LogFunded(_txid [32]byte) (*types.Transaction, error) { + return _DepositLog.Contract.LogFunded(&_DepositLog.TransactOpts, _txid) +} + +// LogFunded is a paid mutator transaction binding the contract method 0x7ed451a4. +// +// Solidity: function logFunded(bytes32 _txid) returns() +func (_DepositLog *DepositLogTransactorSession) LogFunded(_txid [32]byte) (*types.Transaction, error) { + return _DepositLog.Contract.LogFunded(&_DepositLog.TransactOpts, _txid) +} + +// LogFunderRequestedAbort is a paid mutator transaction binding the contract method 0xce2c07ce. +// +// Solidity: function logFunderRequestedAbort(bytes _abortOutputScript) returns() +func (_DepositLog *DepositLogTransactor) LogFunderRequestedAbort(opts *bind.TransactOpts, _abortOutputScript []byte) (*types.Transaction, error) { + return _DepositLog.contract.Transact(opts, "logFunderRequestedAbort", _abortOutputScript) +} + +// LogFunderRequestedAbort is a paid mutator transaction binding the contract method 0xce2c07ce. +// +// Solidity: function logFunderRequestedAbort(bytes _abortOutputScript) returns() +func (_DepositLog *DepositLogSession) LogFunderRequestedAbort(_abortOutputScript []byte) (*types.Transaction, error) { + return _DepositLog.Contract.LogFunderRequestedAbort(&_DepositLog.TransactOpts, _abortOutputScript) +} + +// LogFunderRequestedAbort is a paid mutator transaction binding the contract method 0xce2c07ce. +// +// Solidity: function logFunderRequestedAbort(bytes _abortOutputScript) returns() +func (_DepositLog *DepositLogTransactorSession) LogFunderRequestedAbort(_abortOutputScript []byte) (*types.Transaction, error) { + return _DepositLog.Contract.LogFunderRequestedAbort(&_DepositLog.TransactOpts, _abortOutputScript) +} + +// LogGotRedemptionSignature is a paid mutator transaction binding the contract method 0xf760621e. +// +// Solidity: function logGotRedemptionSignature(bytes32 _digest, bytes32 _r, bytes32 _s) returns() +func (_DepositLog *DepositLogTransactor) LogGotRedemptionSignature(opts *bind.TransactOpts, _digest [32]byte, _r [32]byte, _s [32]byte) (*types.Transaction, error) { + return _DepositLog.contract.Transact(opts, "logGotRedemptionSignature", _digest, _r, _s) +} + +// LogGotRedemptionSignature is a paid mutator transaction binding the contract method 0xf760621e. +// +// Solidity: function logGotRedemptionSignature(bytes32 _digest, bytes32 _r, bytes32 _s) returns() +func (_DepositLog *DepositLogSession) LogGotRedemptionSignature(_digest [32]byte, _r [32]byte, _s [32]byte) (*types.Transaction, error) { + return _DepositLog.Contract.LogGotRedemptionSignature(&_DepositLog.TransactOpts, _digest, _r, _s) +} + +// LogGotRedemptionSignature is a paid mutator transaction binding the contract method 0xf760621e. +// +// Solidity: function logGotRedemptionSignature(bytes32 _digest, bytes32 _r, bytes32 _s) returns() +func (_DepositLog *DepositLogTransactorSession) LogGotRedemptionSignature(_digest [32]byte, _r [32]byte, _s [32]byte) (*types.Transaction, error) { + return _DepositLog.Contract.LogGotRedemptionSignature(&_DepositLog.TransactOpts, _digest, _r, _s) +} + +// LogLiquidated is a paid mutator transaction binding the contract method 0xc8fba243. +// +// Solidity: function logLiquidated() returns() +func (_DepositLog *DepositLogTransactor) LogLiquidated(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DepositLog.contract.Transact(opts, "logLiquidated") +} + +// LogLiquidated is a paid mutator transaction binding the contract method 0xc8fba243. +// +// Solidity: function logLiquidated() returns() +func (_DepositLog *DepositLogSession) LogLiquidated() (*types.Transaction, error) { + return _DepositLog.Contract.LogLiquidated(&_DepositLog.TransactOpts) +} + +// LogLiquidated is a paid mutator transaction binding the contract method 0xc8fba243. +// +// Solidity: function logLiquidated() returns() +func (_DepositLog *DepositLogTransactorSession) LogLiquidated() (*types.Transaction, error) { + return _DepositLog.Contract.LogLiquidated(&_DepositLog.TransactOpts) +} + +// LogRedeemed is a paid mutator transaction binding the contract method 0x6e1ba283. +// +// Solidity: function logRedeemed(bytes32 _txid) returns() +func (_DepositLog *DepositLogTransactor) LogRedeemed(opts *bind.TransactOpts, _txid [32]byte) (*types.Transaction, error) { + return _DepositLog.contract.Transact(opts, "logRedeemed", _txid) +} + +// LogRedeemed is a paid mutator transaction binding the contract method 0x6e1ba283. +// +// Solidity: function logRedeemed(bytes32 _txid) returns() +func (_DepositLog *DepositLogSession) LogRedeemed(_txid [32]byte) (*types.Transaction, error) { + return _DepositLog.Contract.LogRedeemed(&_DepositLog.TransactOpts, _txid) +} + +// LogRedeemed is a paid mutator transaction binding the contract method 0x6e1ba283. +// +// Solidity: function logRedeemed(bytes32 _txid) returns() +func (_DepositLog *DepositLogTransactorSession) LogRedeemed(_txid [32]byte) (*types.Transaction, error) { + return _DepositLog.Contract.LogRedeemed(&_DepositLog.TransactOpts, _txid) +} + +// LogRedemptionRequested is a paid mutator transaction binding the contract method 0x18e647dd. +// +// Solidity: function logRedemptionRequested(address _requester, bytes32 _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) returns() +func (_DepositLog *DepositLogTransactor) LogRedemptionRequested(opts *bind.TransactOpts, _requester common.Address, _digest [32]byte, _utxoValue *big.Int, _redeemerOutputScript []byte, _requestedFee *big.Int, _outpoint []byte) (*types.Transaction, error) { + return _DepositLog.contract.Transact(opts, "logRedemptionRequested", _requester, _digest, _utxoValue, _redeemerOutputScript, _requestedFee, _outpoint) +} + +// LogRedemptionRequested is a paid mutator transaction binding the contract method 0x18e647dd. +// +// Solidity: function logRedemptionRequested(address _requester, bytes32 _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) returns() +func (_DepositLog *DepositLogSession) LogRedemptionRequested(_requester common.Address, _digest [32]byte, _utxoValue *big.Int, _redeemerOutputScript []byte, _requestedFee *big.Int, _outpoint []byte) (*types.Transaction, error) { + return _DepositLog.Contract.LogRedemptionRequested(&_DepositLog.TransactOpts, _requester, _digest, _utxoValue, _redeemerOutputScript, _requestedFee, _outpoint) +} + +// LogRedemptionRequested is a paid mutator transaction binding the contract method 0x18e647dd. +// +// Solidity: function logRedemptionRequested(address _requester, bytes32 _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) returns() +func (_DepositLog *DepositLogTransactorSession) LogRedemptionRequested(_requester common.Address, _digest [32]byte, _utxoValue *big.Int, _redeemerOutputScript []byte, _requestedFee *big.Int, _outpoint []byte) (*types.Transaction, error) { + return _DepositLog.Contract.LogRedemptionRequested(&_DepositLog.TransactOpts, _requester, _digest, _utxoValue, _redeemerOutputScript, _requestedFee, _outpoint) +} + +// LogRegisteredPubkey is a paid mutator transaction binding the contract method 0x869f9469. +// +// Solidity: function logRegisteredPubkey(bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY) returns() +func (_DepositLog *DepositLogTransactor) LogRegisteredPubkey(opts *bind.TransactOpts, _signingGroupPubkeyX [32]byte, _signingGroupPubkeyY [32]byte) (*types.Transaction, error) { + return _DepositLog.contract.Transact(opts, "logRegisteredPubkey", _signingGroupPubkeyX, _signingGroupPubkeyY) +} + +// LogRegisteredPubkey is a paid mutator transaction binding the contract method 0x869f9469. +// +// Solidity: function logRegisteredPubkey(bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY) returns() +func (_DepositLog *DepositLogSession) LogRegisteredPubkey(_signingGroupPubkeyX [32]byte, _signingGroupPubkeyY [32]byte) (*types.Transaction, error) { + return _DepositLog.Contract.LogRegisteredPubkey(&_DepositLog.TransactOpts, _signingGroupPubkeyX, _signingGroupPubkeyY) +} + +// LogRegisteredPubkey is a paid mutator transaction binding the contract method 0x869f9469. +// +// Solidity: function logRegisteredPubkey(bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY) returns() +func (_DepositLog *DepositLogTransactorSession) LogRegisteredPubkey(_signingGroupPubkeyX [32]byte, _signingGroupPubkeyY [32]byte) (*types.Transaction, error) { + return _DepositLog.Contract.LogRegisteredPubkey(&_DepositLog.TransactOpts, _signingGroupPubkeyX, _signingGroupPubkeyY) +} + +// LogSetupFailed is a paid mutator transaction binding the contract method 0xa831c816. +// +// Solidity: function logSetupFailed() returns() +func (_DepositLog *DepositLogTransactor) LogSetupFailed(opts *bind.TransactOpts) (*types.Transaction, error) { + return _DepositLog.contract.Transact(opts, "logSetupFailed") +} + +// LogSetupFailed is a paid mutator transaction binding the contract method 0xa831c816. +// +// Solidity: function logSetupFailed() returns() +func (_DepositLog *DepositLogSession) LogSetupFailed() (*types.Transaction, error) { + return _DepositLog.Contract.LogSetupFailed(&_DepositLog.TransactOpts) +} + +// LogSetupFailed is a paid mutator transaction binding the contract method 0xa831c816. +// +// Solidity: function logSetupFailed() returns() +func (_DepositLog *DepositLogTransactorSession) LogSetupFailed() (*types.Transaction, error) { + return _DepositLog.Contract.LogSetupFailed(&_DepositLog.TransactOpts) +} + +// LogStartedLiquidation is a paid mutator transaction binding the contract method 0x3aac3467. +// +// Solidity: function logStartedLiquidation(bool _wasFraud) returns() +func (_DepositLog *DepositLogTransactor) LogStartedLiquidation(opts *bind.TransactOpts, _wasFraud bool) (*types.Transaction, error) { + return _DepositLog.contract.Transact(opts, "logStartedLiquidation", _wasFraud) +} + +// LogStartedLiquidation is a paid mutator transaction binding the contract method 0x3aac3467. +// +// Solidity: function logStartedLiquidation(bool _wasFraud) returns() +func (_DepositLog *DepositLogSession) LogStartedLiquidation(_wasFraud bool) (*types.Transaction, error) { + return _DepositLog.Contract.LogStartedLiquidation(&_DepositLog.TransactOpts, _wasFraud) +} + +// LogStartedLiquidation is a paid mutator transaction binding the contract method 0x3aac3467. +// +// Solidity: function logStartedLiquidation(bool _wasFraud) returns() +func (_DepositLog *DepositLogTransactorSession) LogStartedLiquidation(_wasFraud bool) (*types.Transaction, error) { + return _DepositLog.Contract.LogStartedLiquidation(&_DepositLog.TransactOpts, _wasFraud) +} + +// DepositLogCourtesyCalledIterator is returned from FilterCourtesyCalled and is used to iterate over the raw logs and unpacked data for CourtesyCalled events raised by the DepositLog contract. +type DepositLogCourtesyCalledIterator struct { + Event *DepositLogCourtesyCalled // 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 *DepositLogCourtesyCalledIterator) 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(DepositLogCourtesyCalled) + 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(DepositLogCourtesyCalled) + 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 *DepositLogCourtesyCalledIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DepositLogCourtesyCalledIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DepositLogCourtesyCalled represents a CourtesyCalled event raised by the DepositLog contract. +type DepositLogCourtesyCalled struct { + DepositContractAddress common.Address + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterCourtesyCalled is a free log retrieval operation binding the contract event 0x6e7b45210b79c12cd1332babd8d86c0bbb9ca898a89ce0404f17064dbfba18c0. +// +// Solidity: event CourtesyCalled(address indexed _depositContractAddress, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) FilterCourtesyCalled(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*DepositLogCourtesyCalledIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _DepositLog.contract.FilterLogs(opts, "CourtesyCalled", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &DepositLogCourtesyCalledIterator{contract: _DepositLog.contract, event: "CourtesyCalled", logs: logs, sub: sub}, nil +} + +// WatchCourtesyCalled is a free log subscription operation binding the contract event 0x6e7b45210b79c12cd1332babd8d86c0bbb9ca898a89ce0404f17064dbfba18c0. +// +// Solidity: event CourtesyCalled(address indexed _depositContractAddress, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) WatchCourtesyCalled(opts *bind.WatchOpts, sink chan<- *DepositLogCourtesyCalled, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _DepositLog.contract.WatchLogs(opts, "CourtesyCalled", _depositContractAddressRule) + 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(DepositLogCourtesyCalled) + if err := _DepositLog.contract.UnpackLog(event, "CourtesyCalled", 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 +} + +// ParseCourtesyCalled is a log parse operation binding the contract event 0x6e7b45210b79c12cd1332babd8d86c0bbb9ca898a89ce0404f17064dbfba18c0. +// +// Solidity: event CourtesyCalled(address indexed _depositContractAddress, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) ParseCourtesyCalled(log types.Log) (*DepositLogCourtesyCalled, error) { + event := new(DepositLogCourtesyCalled) + if err := _DepositLog.contract.UnpackLog(event, "CourtesyCalled", log); err != nil { + return nil, err + } + return event, nil +} + +// DepositLogCreatedIterator is returned from FilterCreated and is used to iterate over the raw logs and unpacked data for Created events raised by the DepositLog contract. +type DepositLogCreatedIterator struct { + Event *DepositLogCreated // 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 *DepositLogCreatedIterator) 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(DepositLogCreated) + 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(DepositLogCreated) + 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 *DepositLogCreatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DepositLogCreatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DepositLogCreated represents a Created event raised by the DepositLog contract. +type DepositLogCreated struct { + DepositContractAddress common.Address + KeepAddress common.Address + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterCreated is a free log retrieval operation binding the contract event 0x822b3073be62c5c7f143c2dcd71ee266434ee935d90a1eec3be34710ac8ec1a2. +// +// Solidity: event Created(address indexed _depositContractAddress, address indexed _keepAddress, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) FilterCreated(opts *bind.FilterOpts, _depositContractAddress []common.Address, _keepAddress []common.Address) (*DepositLogCreatedIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _keepAddressRule []interface{} + for _, _keepAddressItem := range _keepAddress { + _keepAddressRule = append(_keepAddressRule, _keepAddressItem) + } + + logs, sub, err := _DepositLog.contract.FilterLogs(opts, "Created", _depositContractAddressRule, _keepAddressRule) + if err != nil { + return nil, err + } + return &DepositLogCreatedIterator{contract: _DepositLog.contract, event: "Created", logs: logs, sub: sub}, nil +} + +// WatchCreated is a free log subscription operation binding the contract event 0x822b3073be62c5c7f143c2dcd71ee266434ee935d90a1eec3be34710ac8ec1a2. +// +// Solidity: event Created(address indexed _depositContractAddress, address indexed _keepAddress, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) WatchCreated(opts *bind.WatchOpts, sink chan<- *DepositLogCreated, _depositContractAddress []common.Address, _keepAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _keepAddressRule []interface{} + for _, _keepAddressItem := range _keepAddress { + _keepAddressRule = append(_keepAddressRule, _keepAddressItem) + } + + logs, sub, err := _DepositLog.contract.WatchLogs(opts, "Created", _depositContractAddressRule, _keepAddressRule) + 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(DepositLogCreated) + if err := _DepositLog.contract.UnpackLog(event, "Created", 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 +} + +// ParseCreated is a log parse operation binding the contract event 0x822b3073be62c5c7f143c2dcd71ee266434ee935d90a1eec3be34710ac8ec1a2. +// +// Solidity: event Created(address indexed _depositContractAddress, address indexed _keepAddress, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) ParseCreated(log types.Log) (*DepositLogCreated, error) { + event := new(DepositLogCreated) + if err := _DepositLog.contract.UnpackLog(event, "Created", log); err != nil { + return nil, err + } + return event, nil +} + +// DepositLogExitedCourtesyCallIterator is returned from FilterExitedCourtesyCall and is used to iterate over the raw logs and unpacked data for ExitedCourtesyCall events raised by the DepositLog contract. +type DepositLogExitedCourtesyCallIterator struct { + Event *DepositLogExitedCourtesyCall // 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 *DepositLogExitedCourtesyCallIterator) 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(DepositLogExitedCourtesyCall) + 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(DepositLogExitedCourtesyCall) + 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 *DepositLogExitedCourtesyCallIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DepositLogExitedCourtesyCallIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DepositLogExitedCourtesyCall represents a ExitedCourtesyCall event raised by the DepositLog contract. +type DepositLogExitedCourtesyCall struct { + DepositContractAddress common.Address + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterExitedCourtesyCall is a free log retrieval operation binding the contract event 0x07f0eaafadb9abb1d28da85d4b4c74f1939fd61b535c7f5ab501f618f07e76ee. +// +// Solidity: event ExitedCourtesyCall(address indexed _depositContractAddress, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) FilterExitedCourtesyCall(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*DepositLogExitedCourtesyCallIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _DepositLog.contract.FilterLogs(opts, "ExitedCourtesyCall", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &DepositLogExitedCourtesyCallIterator{contract: _DepositLog.contract, event: "ExitedCourtesyCall", logs: logs, sub: sub}, nil +} + +// WatchExitedCourtesyCall is a free log subscription operation binding the contract event 0x07f0eaafadb9abb1d28da85d4b4c74f1939fd61b535c7f5ab501f618f07e76ee. +// +// Solidity: event ExitedCourtesyCall(address indexed _depositContractAddress, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) WatchExitedCourtesyCall(opts *bind.WatchOpts, sink chan<- *DepositLogExitedCourtesyCall, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _DepositLog.contract.WatchLogs(opts, "ExitedCourtesyCall", _depositContractAddressRule) + 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(DepositLogExitedCourtesyCall) + if err := _DepositLog.contract.UnpackLog(event, "ExitedCourtesyCall", 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 +} + +// ParseExitedCourtesyCall is a log parse operation binding the contract event 0x07f0eaafadb9abb1d28da85d4b4c74f1939fd61b535c7f5ab501f618f07e76ee. +// +// Solidity: event ExitedCourtesyCall(address indexed _depositContractAddress, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) ParseExitedCourtesyCall(log types.Log) (*DepositLogExitedCourtesyCall, error) { + event := new(DepositLogExitedCourtesyCall) + if err := _DepositLog.contract.UnpackLog(event, "ExitedCourtesyCall", log); err != nil { + return nil, err + } + return event, nil +} + +// DepositLogFraudDuringSetupIterator is returned from FilterFraudDuringSetup and is used to iterate over the raw logs and unpacked data for FraudDuringSetup events raised by the DepositLog contract. +type DepositLogFraudDuringSetupIterator struct { + Event *DepositLogFraudDuringSetup // 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 *DepositLogFraudDuringSetupIterator) 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(DepositLogFraudDuringSetup) + 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(DepositLogFraudDuringSetup) + 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 *DepositLogFraudDuringSetupIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DepositLogFraudDuringSetupIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DepositLogFraudDuringSetup represents a FraudDuringSetup event raised by the DepositLog contract. +type DepositLogFraudDuringSetup struct { + DepositContractAddress common.Address + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFraudDuringSetup is a free log retrieval operation binding the contract event 0x1e61af503f1d7de21d5300094c18bf8700f82b2951a4d54dd2adda13f6b3da30. +// +// Solidity: event FraudDuringSetup(address indexed _depositContractAddress, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) FilterFraudDuringSetup(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*DepositLogFraudDuringSetupIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _DepositLog.contract.FilterLogs(opts, "FraudDuringSetup", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &DepositLogFraudDuringSetupIterator{contract: _DepositLog.contract, event: "FraudDuringSetup", logs: logs, sub: sub}, nil +} + +// WatchFraudDuringSetup is a free log subscription operation binding the contract event 0x1e61af503f1d7de21d5300094c18bf8700f82b2951a4d54dd2adda13f6b3da30. +// +// Solidity: event FraudDuringSetup(address indexed _depositContractAddress, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) WatchFraudDuringSetup(opts *bind.WatchOpts, sink chan<- *DepositLogFraudDuringSetup, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _DepositLog.contract.WatchLogs(opts, "FraudDuringSetup", _depositContractAddressRule) + 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(DepositLogFraudDuringSetup) + if err := _DepositLog.contract.UnpackLog(event, "FraudDuringSetup", 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 +} + +// ParseFraudDuringSetup is a log parse operation binding the contract event 0x1e61af503f1d7de21d5300094c18bf8700f82b2951a4d54dd2adda13f6b3da30. +// +// Solidity: event FraudDuringSetup(address indexed _depositContractAddress, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) ParseFraudDuringSetup(log types.Log) (*DepositLogFraudDuringSetup, error) { + event := new(DepositLogFraudDuringSetup) + if err := _DepositLog.contract.UnpackLog(event, "FraudDuringSetup", log); err != nil { + return nil, err + } + return event, nil +} + +// DepositLogFundedIterator is returned from FilterFunded and is used to iterate over the raw logs and unpacked data for Funded events raised by the DepositLog contract. +type DepositLogFundedIterator struct { + Event *DepositLogFunded // 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 *DepositLogFundedIterator) 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(DepositLogFunded) + 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(DepositLogFunded) + 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 *DepositLogFundedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DepositLogFundedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DepositLogFunded represents a Funded event raised by the DepositLog contract. +type DepositLogFunded struct { + DepositContractAddress common.Address + Txid [32]byte + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFunded is a free log retrieval operation binding the contract event 0xe34c70bd3e03956978a5c76d2ea5f3a60819171afea6dee4fc12b2e45f72d43d. +// +// Solidity: event Funded(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) FilterFunded(opts *bind.FilterOpts, _depositContractAddress []common.Address, _txid [][32]byte) (*DepositLogFundedIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _txidRule []interface{} + for _, _txidItem := range _txid { + _txidRule = append(_txidRule, _txidItem) + } + + logs, sub, err := _DepositLog.contract.FilterLogs(opts, "Funded", _depositContractAddressRule, _txidRule) + if err != nil { + return nil, err + } + return &DepositLogFundedIterator{contract: _DepositLog.contract, event: "Funded", logs: logs, sub: sub}, nil +} + +// WatchFunded is a free log subscription operation binding the contract event 0xe34c70bd3e03956978a5c76d2ea5f3a60819171afea6dee4fc12b2e45f72d43d. +// +// Solidity: event Funded(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) WatchFunded(opts *bind.WatchOpts, sink chan<- *DepositLogFunded, _depositContractAddress []common.Address, _txid [][32]byte) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _txidRule []interface{} + for _, _txidItem := range _txid { + _txidRule = append(_txidRule, _txidItem) + } + + logs, sub, err := _DepositLog.contract.WatchLogs(opts, "Funded", _depositContractAddressRule, _txidRule) + 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(DepositLogFunded) + if err := _DepositLog.contract.UnpackLog(event, "Funded", 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 +} + +// ParseFunded is a log parse operation binding the contract event 0xe34c70bd3e03956978a5c76d2ea5f3a60819171afea6dee4fc12b2e45f72d43d. +// +// Solidity: event Funded(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) ParseFunded(log types.Log) (*DepositLogFunded, error) { + event := new(DepositLogFunded) + if err := _DepositLog.contract.UnpackLog(event, "Funded", log); err != nil { + return nil, err + } + return event, nil +} + +// DepositLogFunderAbortRequestedIterator is returned from FilterFunderAbortRequested and is used to iterate over the raw logs and unpacked data for FunderAbortRequested events raised by the DepositLog contract. +type DepositLogFunderAbortRequestedIterator struct { + Event *DepositLogFunderAbortRequested // 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 *DepositLogFunderAbortRequestedIterator) 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(DepositLogFunderAbortRequested) + 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(DepositLogFunderAbortRequested) + 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 *DepositLogFunderAbortRequestedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DepositLogFunderAbortRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DepositLogFunderAbortRequested represents a FunderAbortRequested event raised by the DepositLog contract. +type DepositLogFunderAbortRequested struct { + DepositContractAddress common.Address + AbortOutputScript []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFunderAbortRequested is a free log retrieval operation binding the contract event 0xa6e9673b5d53b3fe3c62b6459720f9c2a1b129d4f69acb771404ba8681b6a930. +// +// Solidity: event FunderAbortRequested(address indexed _depositContractAddress, bytes _abortOutputScript) +func (_DepositLog *DepositLogFilterer) FilterFunderAbortRequested(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*DepositLogFunderAbortRequestedIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _DepositLog.contract.FilterLogs(opts, "FunderAbortRequested", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &DepositLogFunderAbortRequestedIterator{contract: _DepositLog.contract, event: "FunderAbortRequested", logs: logs, sub: sub}, nil +} + +// WatchFunderAbortRequested is a free log subscription operation binding the contract event 0xa6e9673b5d53b3fe3c62b6459720f9c2a1b129d4f69acb771404ba8681b6a930. +// +// Solidity: event FunderAbortRequested(address indexed _depositContractAddress, bytes _abortOutputScript) +func (_DepositLog *DepositLogFilterer) WatchFunderAbortRequested(opts *bind.WatchOpts, sink chan<- *DepositLogFunderAbortRequested, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _DepositLog.contract.WatchLogs(opts, "FunderAbortRequested", _depositContractAddressRule) + 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(DepositLogFunderAbortRequested) + if err := _DepositLog.contract.UnpackLog(event, "FunderAbortRequested", 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 +} + +// ParseFunderAbortRequested is a log parse operation binding the contract event 0xa6e9673b5d53b3fe3c62b6459720f9c2a1b129d4f69acb771404ba8681b6a930. +// +// Solidity: event FunderAbortRequested(address indexed _depositContractAddress, bytes _abortOutputScript) +func (_DepositLog *DepositLogFilterer) ParseFunderAbortRequested(log types.Log) (*DepositLogFunderAbortRequested, error) { + event := new(DepositLogFunderAbortRequested) + if err := _DepositLog.contract.UnpackLog(event, "FunderAbortRequested", log); err != nil { + return nil, err + } + return event, nil +} + +// DepositLogGotRedemptionSignatureIterator is returned from FilterGotRedemptionSignature and is used to iterate over the raw logs and unpacked data for GotRedemptionSignature events raised by the DepositLog contract. +type DepositLogGotRedemptionSignatureIterator struct { + Event *DepositLogGotRedemptionSignature // 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 *DepositLogGotRedemptionSignatureIterator) 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(DepositLogGotRedemptionSignature) + 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(DepositLogGotRedemptionSignature) + 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 *DepositLogGotRedemptionSignatureIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DepositLogGotRedemptionSignatureIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DepositLogGotRedemptionSignature represents a GotRedemptionSignature event raised by the DepositLog contract. +type DepositLogGotRedemptionSignature struct { + DepositContractAddress common.Address + Digest [32]byte + R [32]byte + S [32]byte + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterGotRedemptionSignature is a free log retrieval operation binding the contract event 0x7f7d7327762d01d2c4a552ea0be2bc5a76264574a80aa78083e691a840e509f2. +// +// Solidity: event GotRedemptionSignature(address indexed _depositContractAddress, bytes32 indexed _digest, bytes32 _r, bytes32 _s, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) FilterGotRedemptionSignature(opts *bind.FilterOpts, _depositContractAddress []common.Address, _digest [][32]byte) (*DepositLogGotRedemptionSignatureIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _digestRule []interface{} + for _, _digestItem := range _digest { + _digestRule = append(_digestRule, _digestItem) + } + + logs, sub, err := _DepositLog.contract.FilterLogs(opts, "GotRedemptionSignature", _depositContractAddressRule, _digestRule) + if err != nil { + return nil, err + } + return &DepositLogGotRedemptionSignatureIterator{contract: _DepositLog.contract, event: "GotRedemptionSignature", logs: logs, sub: sub}, nil +} + +// WatchGotRedemptionSignature is a free log subscription operation binding the contract event 0x7f7d7327762d01d2c4a552ea0be2bc5a76264574a80aa78083e691a840e509f2. +// +// Solidity: event GotRedemptionSignature(address indexed _depositContractAddress, bytes32 indexed _digest, bytes32 _r, bytes32 _s, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) WatchGotRedemptionSignature(opts *bind.WatchOpts, sink chan<- *DepositLogGotRedemptionSignature, _depositContractAddress []common.Address, _digest [][32]byte) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _digestRule []interface{} + for _, _digestItem := range _digest { + _digestRule = append(_digestRule, _digestItem) + } + + logs, sub, err := _DepositLog.contract.WatchLogs(opts, "GotRedemptionSignature", _depositContractAddressRule, _digestRule) + 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(DepositLogGotRedemptionSignature) + if err := _DepositLog.contract.UnpackLog(event, "GotRedemptionSignature", 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 +} + +// ParseGotRedemptionSignature is a log parse operation binding the contract event 0x7f7d7327762d01d2c4a552ea0be2bc5a76264574a80aa78083e691a840e509f2. +// +// Solidity: event GotRedemptionSignature(address indexed _depositContractAddress, bytes32 indexed _digest, bytes32 _r, bytes32 _s, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) ParseGotRedemptionSignature(log types.Log) (*DepositLogGotRedemptionSignature, error) { + event := new(DepositLogGotRedemptionSignature) + if err := _DepositLog.contract.UnpackLog(event, "GotRedemptionSignature", log); err != nil { + return nil, err + } + return event, nil +} + +// DepositLogLiquidatedIterator is returned from FilterLiquidated and is used to iterate over the raw logs and unpacked data for Liquidated events raised by the DepositLog contract. +type DepositLogLiquidatedIterator struct { + Event *DepositLogLiquidated // 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 *DepositLogLiquidatedIterator) 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(DepositLogLiquidated) + 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(DepositLogLiquidated) + 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 *DepositLogLiquidatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DepositLogLiquidatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DepositLogLiquidated represents a Liquidated event raised by the DepositLog contract. +type DepositLogLiquidated struct { + DepositContractAddress common.Address + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterLiquidated is a free log retrieval operation binding the contract event 0xa5ee7a2b0254fce91deed604506790ed7fa072d0b14cba4859c3bc8955b9caac. +// +// Solidity: event Liquidated(address indexed _depositContractAddress, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) FilterLiquidated(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*DepositLogLiquidatedIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _DepositLog.contract.FilterLogs(opts, "Liquidated", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &DepositLogLiquidatedIterator{contract: _DepositLog.contract, event: "Liquidated", logs: logs, sub: sub}, nil +} + +// WatchLiquidated is a free log subscription operation binding the contract event 0xa5ee7a2b0254fce91deed604506790ed7fa072d0b14cba4859c3bc8955b9caac. +// +// Solidity: event Liquidated(address indexed _depositContractAddress, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) WatchLiquidated(opts *bind.WatchOpts, sink chan<- *DepositLogLiquidated, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _DepositLog.contract.WatchLogs(opts, "Liquidated", _depositContractAddressRule) + 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(DepositLogLiquidated) + if err := _DepositLog.contract.UnpackLog(event, "Liquidated", 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 +} + +// ParseLiquidated is a log parse operation binding the contract event 0xa5ee7a2b0254fce91deed604506790ed7fa072d0b14cba4859c3bc8955b9caac. +// +// Solidity: event Liquidated(address indexed _depositContractAddress, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) ParseLiquidated(log types.Log) (*DepositLogLiquidated, error) { + event := new(DepositLogLiquidated) + if err := _DepositLog.contract.UnpackLog(event, "Liquidated", log); err != nil { + return nil, err + } + return event, nil +} + +// DepositLogRedeemedIterator is returned from FilterRedeemed and is used to iterate over the raw logs and unpacked data for Redeemed events raised by the DepositLog contract. +type DepositLogRedeemedIterator struct { + Event *DepositLogRedeemed // 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 *DepositLogRedeemedIterator) 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(DepositLogRedeemed) + 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(DepositLogRedeemed) + 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 *DepositLogRedeemedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DepositLogRedeemedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DepositLogRedeemed represents a Redeemed event raised by the DepositLog contract. +type DepositLogRedeemed struct { + DepositContractAddress common.Address + Txid [32]byte + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRedeemed is a free log retrieval operation binding the contract event 0x44b7f176bcc739b54bd0800fe491cbdea19df7d4d6b19c281462e6b4fc504344. +// +// Solidity: event Redeemed(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) FilterRedeemed(opts *bind.FilterOpts, _depositContractAddress []common.Address, _txid [][32]byte) (*DepositLogRedeemedIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _txidRule []interface{} + for _, _txidItem := range _txid { + _txidRule = append(_txidRule, _txidItem) + } + + logs, sub, err := _DepositLog.contract.FilterLogs(opts, "Redeemed", _depositContractAddressRule, _txidRule) + if err != nil { + return nil, err + } + return &DepositLogRedeemedIterator{contract: _DepositLog.contract, event: "Redeemed", logs: logs, sub: sub}, nil +} + +// WatchRedeemed is a free log subscription operation binding the contract event 0x44b7f176bcc739b54bd0800fe491cbdea19df7d4d6b19c281462e6b4fc504344. +// +// Solidity: event Redeemed(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) WatchRedeemed(opts *bind.WatchOpts, sink chan<- *DepositLogRedeemed, _depositContractAddress []common.Address, _txid [][32]byte) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _txidRule []interface{} + for _, _txidItem := range _txid { + _txidRule = append(_txidRule, _txidItem) + } + + logs, sub, err := _DepositLog.contract.WatchLogs(opts, "Redeemed", _depositContractAddressRule, _txidRule) + 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(DepositLogRedeemed) + if err := _DepositLog.contract.UnpackLog(event, "Redeemed", 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 +} + +// ParseRedeemed is a log parse operation binding the contract event 0x44b7f176bcc739b54bd0800fe491cbdea19df7d4d6b19c281462e6b4fc504344. +// +// Solidity: event Redeemed(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) ParseRedeemed(log types.Log) (*DepositLogRedeemed, error) { + event := new(DepositLogRedeemed) + if err := _DepositLog.contract.UnpackLog(event, "Redeemed", log); err != nil { + return nil, err + } + return event, nil +} + +// DepositLogRedemptionRequestedIterator is returned from FilterRedemptionRequested and is used to iterate over the raw logs and unpacked data for RedemptionRequested events raised by the DepositLog contract. +type DepositLogRedemptionRequestedIterator struct { + Event *DepositLogRedemptionRequested // 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 *DepositLogRedemptionRequestedIterator) 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(DepositLogRedemptionRequested) + 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(DepositLogRedemptionRequested) + 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 *DepositLogRedemptionRequestedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DepositLogRedemptionRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DepositLogRedemptionRequested represents a RedemptionRequested event raised by the DepositLog contract. +type DepositLogRedemptionRequested struct { + DepositContractAddress common.Address + Requester common.Address + Digest [32]byte + UtxoValue *big.Int + RedeemerOutputScript []byte + RequestedFee *big.Int + Outpoint []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRedemptionRequested is a free log retrieval operation binding the contract event 0x7959c380174061a21a3ba80243a032ba9cd10dc8bd1736d7e835c94e97a35a98. +// +// Solidity: event RedemptionRequested(address indexed _depositContractAddress, address indexed _requester, bytes32 indexed _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) +func (_DepositLog *DepositLogFilterer) FilterRedemptionRequested(opts *bind.FilterOpts, _depositContractAddress []common.Address, _requester []common.Address, _digest [][32]byte) (*DepositLogRedemptionRequestedIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _requesterRule []interface{} + for _, _requesterItem := range _requester { + _requesterRule = append(_requesterRule, _requesterItem) + } + var _digestRule []interface{} + for _, _digestItem := range _digest { + _digestRule = append(_digestRule, _digestItem) + } + + logs, sub, err := _DepositLog.contract.FilterLogs(opts, "RedemptionRequested", _depositContractAddressRule, _requesterRule, _digestRule) + if err != nil { + return nil, err + } + return &DepositLogRedemptionRequestedIterator{contract: _DepositLog.contract, event: "RedemptionRequested", logs: logs, sub: sub}, nil +} + +// WatchRedemptionRequested is a free log subscription operation binding the contract event 0x7959c380174061a21a3ba80243a032ba9cd10dc8bd1736d7e835c94e97a35a98. +// +// Solidity: event RedemptionRequested(address indexed _depositContractAddress, address indexed _requester, bytes32 indexed _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) +func (_DepositLog *DepositLogFilterer) WatchRedemptionRequested(opts *bind.WatchOpts, sink chan<- *DepositLogRedemptionRequested, _depositContractAddress []common.Address, _requester []common.Address, _digest [][32]byte) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _requesterRule []interface{} + for _, _requesterItem := range _requester { + _requesterRule = append(_requesterRule, _requesterItem) + } + var _digestRule []interface{} + for _, _digestItem := range _digest { + _digestRule = append(_digestRule, _digestItem) + } + + logs, sub, err := _DepositLog.contract.WatchLogs(opts, "RedemptionRequested", _depositContractAddressRule, _requesterRule, _digestRule) + 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(DepositLogRedemptionRequested) + if err := _DepositLog.contract.UnpackLog(event, "RedemptionRequested", 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 +} + +// ParseRedemptionRequested is a log parse operation binding the contract event 0x7959c380174061a21a3ba80243a032ba9cd10dc8bd1736d7e835c94e97a35a98. +// +// Solidity: event RedemptionRequested(address indexed _depositContractAddress, address indexed _requester, bytes32 indexed _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) +func (_DepositLog *DepositLogFilterer) ParseRedemptionRequested(log types.Log) (*DepositLogRedemptionRequested, error) { + event := new(DepositLogRedemptionRequested) + if err := _DepositLog.contract.UnpackLog(event, "RedemptionRequested", log); err != nil { + return nil, err + } + return event, nil +} + +// DepositLogRegisteredPubkeyIterator is returned from FilterRegisteredPubkey and is used to iterate over the raw logs and unpacked data for RegisteredPubkey events raised by the DepositLog contract. +type DepositLogRegisteredPubkeyIterator struct { + Event *DepositLogRegisteredPubkey // 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 *DepositLogRegisteredPubkeyIterator) 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(DepositLogRegisteredPubkey) + 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(DepositLogRegisteredPubkey) + 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 *DepositLogRegisteredPubkeyIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DepositLogRegisteredPubkeyIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DepositLogRegisteredPubkey represents a RegisteredPubkey event raised by the DepositLog contract. +type DepositLogRegisteredPubkey struct { + DepositContractAddress common.Address + SigningGroupPubkeyX [32]byte + SigningGroupPubkeyY [32]byte + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRegisteredPubkey is a free log retrieval operation binding the contract event 0x8ee737ab16909c4e9d1b750814a4393c9f84ab5d3a29c08c313b783fc846ae33. +// +// Solidity: event RegisteredPubkey(address indexed _depositContractAddress, bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) FilterRegisteredPubkey(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*DepositLogRegisteredPubkeyIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _DepositLog.contract.FilterLogs(opts, "RegisteredPubkey", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &DepositLogRegisteredPubkeyIterator{contract: _DepositLog.contract, event: "RegisteredPubkey", logs: logs, sub: sub}, nil +} + +// WatchRegisteredPubkey is a free log subscription operation binding the contract event 0x8ee737ab16909c4e9d1b750814a4393c9f84ab5d3a29c08c313b783fc846ae33. +// +// Solidity: event RegisteredPubkey(address indexed _depositContractAddress, bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) WatchRegisteredPubkey(opts *bind.WatchOpts, sink chan<- *DepositLogRegisteredPubkey, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _DepositLog.contract.WatchLogs(opts, "RegisteredPubkey", _depositContractAddressRule) + 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(DepositLogRegisteredPubkey) + if err := _DepositLog.contract.UnpackLog(event, "RegisteredPubkey", 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 +} + +// ParseRegisteredPubkey is a log parse operation binding the contract event 0x8ee737ab16909c4e9d1b750814a4393c9f84ab5d3a29c08c313b783fc846ae33. +// +// Solidity: event RegisteredPubkey(address indexed _depositContractAddress, bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) ParseRegisteredPubkey(log types.Log) (*DepositLogRegisteredPubkey, error) { + event := new(DepositLogRegisteredPubkey) + if err := _DepositLog.contract.UnpackLog(event, "RegisteredPubkey", log); err != nil { + return nil, err + } + return event, nil +} + +// DepositLogSetupFailedIterator is returned from FilterSetupFailed and is used to iterate over the raw logs and unpacked data for SetupFailed events raised by the DepositLog contract. +type DepositLogSetupFailedIterator struct { + Event *DepositLogSetupFailed // 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 *DepositLogSetupFailedIterator) 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(DepositLogSetupFailed) + 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(DepositLogSetupFailed) + 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 *DepositLogSetupFailedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DepositLogSetupFailedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DepositLogSetupFailed represents a SetupFailed event raised by the DepositLog contract. +type DepositLogSetupFailed struct { + DepositContractAddress common.Address + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSetupFailed is a free log retrieval operation binding the contract event 0x8fd2cfb62a35fccc1ecef829f83a6c2f840b73dad49d3eaaa402909752086d4b. +// +// Solidity: event SetupFailed(address indexed _depositContractAddress, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) FilterSetupFailed(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*DepositLogSetupFailedIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _DepositLog.contract.FilterLogs(opts, "SetupFailed", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &DepositLogSetupFailedIterator{contract: _DepositLog.contract, event: "SetupFailed", logs: logs, sub: sub}, nil +} + +// WatchSetupFailed is a free log subscription operation binding the contract event 0x8fd2cfb62a35fccc1ecef829f83a6c2f840b73dad49d3eaaa402909752086d4b. +// +// Solidity: event SetupFailed(address indexed _depositContractAddress, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) WatchSetupFailed(opts *bind.WatchOpts, sink chan<- *DepositLogSetupFailed, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _DepositLog.contract.WatchLogs(opts, "SetupFailed", _depositContractAddressRule) + 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(DepositLogSetupFailed) + if err := _DepositLog.contract.UnpackLog(event, "SetupFailed", 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 +} + +// ParseSetupFailed is a log parse operation binding the contract event 0x8fd2cfb62a35fccc1ecef829f83a6c2f840b73dad49d3eaaa402909752086d4b. +// +// Solidity: event SetupFailed(address indexed _depositContractAddress, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) ParseSetupFailed(log types.Log) (*DepositLogSetupFailed, error) { + event := new(DepositLogSetupFailed) + if err := _DepositLog.contract.UnpackLog(event, "SetupFailed", log); err != nil { + return nil, err + } + return event, nil +} + +// DepositLogStartedLiquidationIterator is returned from FilterStartedLiquidation and is used to iterate over the raw logs and unpacked data for StartedLiquidation events raised by the DepositLog contract. +type DepositLogStartedLiquidationIterator struct { + Event *DepositLogStartedLiquidation // 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 *DepositLogStartedLiquidationIterator) 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(DepositLogStartedLiquidation) + 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(DepositLogStartedLiquidation) + 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 *DepositLogStartedLiquidationIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *DepositLogStartedLiquidationIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// DepositLogStartedLiquidation represents a StartedLiquidation event raised by the DepositLog contract. +type DepositLogStartedLiquidation struct { + DepositContractAddress common.Address + WasFraud bool + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterStartedLiquidation is a free log retrieval operation binding the contract event 0xbef11c059eefba82a15aea8a3a89c86fd08d7711c88fa7daea2632a55488510c. +// +// Solidity: event StartedLiquidation(address indexed _depositContractAddress, bool _wasFraud, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) FilterStartedLiquidation(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*DepositLogStartedLiquidationIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _DepositLog.contract.FilterLogs(opts, "StartedLiquidation", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &DepositLogStartedLiquidationIterator{contract: _DepositLog.contract, event: "StartedLiquidation", logs: logs, sub: sub}, nil +} + +// WatchStartedLiquidation is a free log subscription operation binding the contract event 0xbef11c059eefba82a15aea8a3a89c86fd08d7711c88fa7daea2632a55488510c. +// +// Solidity: event StartedLiquidation(address indexed _depositContractAddress, bool _wasFraud, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) WatchStartedLiquidation(opts *bind.WatchOpts, sink chan<- *DepositLogStartedLiquidation, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _DepositLog.contract.WatchLogs(opts, "StartedLiquidation", _depositContractAddressRule) + 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(DepositLogStartedLiquidation) + if err := _DepositLog.contract.UnpackLog(event, "StartedLiquidation", 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 +} + +// ParseStartedLiquidation is a log parse operation binding the contract event 0xbef11c059eefba82a15aea8a3a89c86fd08d7711c88fa7daea2632a55488510c. +// +// Solidity: event StartedLiquidation(address indexed _depositContractAddress, bool _wasFraud, uint256 _timestamp) +func (_DepositLog *DepositLogFilterer) ParseStartedLiquidation(log types.Log) (*DepositLogStartedLiquidation, error) { + event := new(DepositLogStartedLiquidation) + if err := _DepositLog.contract.UnpackLog(event, "StartedLiquidation", log); err != nil { + return nil, err + } + return event, nil +} diff --git a/bindings/go/abi/deposit/Deposit.go b/bindings/go/abi/deposit/Deposit.go new file mode 100644 index 000000000..f5c411ad9 --- /dev/null +++ b/bindings/go/abi/deposit/Deposit.go @@ -0,0 +1,1091 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package abi + +import ( + "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 ( + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = abi.U256 + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// DepositABI is the input ABI used to generate the binding from. +const DepositABI = "[{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"constant\":true,\"inputs\":[],\"name\":\"auctionValue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"collateralizationPercentage\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"currentState\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"exitCourtesyCall\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"fundingInfo\",\"outputs\":[{\"internalType\":\"bytes8\",\"name\":\"utxoValueBytes\",\"type\":\"bytes8\"},{\"internalType\":\"uint256\",\"name\":\"fundedAt\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"utxoOutpoint\",\"type\":\"bytes\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_redeemer\",\"type\":\"address\"}],\"name\":\"getOwnerRedemptionTbtcRequirement\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_redeemer\",\"type\":\"address\"}],\"name\":\"getRedemptionTbtcRequirement\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"inActive\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes8\",\"name\":\"_previousOutputValueBytes\",\"type\":\"bytes8\"},{\"internalType\":\"bytes8\",\"name\":\"_newOutputValueBytes\",\"type\":\"bytes8\"}],\"name\":\"increaseRedemptionFee\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"initialCollateralizedPercent\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_factory\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"contractITBTCSystem\",\"name\":\"_tbtcSystem\",\"type\":\"address\"},{\"internalType\":\"contractTBTCToken\",\"name\":\"_tbtcToken\",\"type\":\"address\"},{\"internalType\":\"contractIERC721\",\"name\":\"_tbtcDepositToken\",\"type\":\"address\"},{\"internalType\":\"contractFeeRebateToken\",\"name\":\"_feeRebateToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_vendingMachineAddress\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"_lotSizeSatoshis\",\"type\":\"uint64\"}],\"name\":\"initializeDeposit\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"keepAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"lotSizeSatoshis\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"lotSizeTbtc\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"notifyCourtesyCall\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"notifyCourtesyCallExpired\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"notifyFundingTimedOut\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"notifyRedemptionProofTimedOut\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"notifyRedemptionSignatureTimedOut\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"notifySignerSetupFailed\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"notifyUndercollateralizedLiquidation\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_txVersion\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"_txInputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"_txOutputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes4\",\"name\":\"_txLocktime\",\"type\":\"bytes4\"},{\"internalType\":\"uint8\",\"name\":\"_fundingOutputIndex\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"_merkleProof\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_txIndexInBlock\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_bitcoinHeaders\",\"type\":\"bytes\"}],\"name\":\"provideBTCFundingProof\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"_v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_s\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_signedDigest\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_preimage\",\"type\":\"bytes\"}],\"name\":\"provideECDSAFraudProof\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"_v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_s\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_signedDigest\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"_preimage\",\"type\":\"bytes\"}],\"name\":\"provideFundingECDSAFraudProof\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"_txVersion\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"_txInputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"_txOutputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes4\",\"name\":\"_txLocktime\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"_merkleProof\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_txIndexInBlock\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_bitcoinHeaders\",\"type\":\"bytes\"}],\"name\":\"provideRedemptionProof\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"_v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"_r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_s\",\"type\":\"bytes32\"}],\"name\":\"provideRedemptionSignature\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"purchaseSignerBondsAtAuction\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"remainingTerm\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_abortOutputScript\",\"type\":\"bytes\"}],\"name\":\"requestFunderAbort\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes8\",\"name\":\"_outputValueBytes\",\"type\":\"bytes8\"},{\"internalType\":\"bytes\",\"name\":\"_redeemerOutputScript\",\"type\":\"bytes\"}],\"name\":\"requestRedemption\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"retrieveSignerPubkey\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"severelyUndercollateralizedThresholdPercent\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"signerFeeTbtc\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes8\",\"name\":\"_outputValueBytes\",\"type\":\"bytes8\"},{\"internalType\":\"bytes\",\"name\":\"_redeemerOutputScript\",\"type\":\"bytes\"},{\"internalType\":\"addresspayable\",\"name\":\"_finalRecipient\",\"type\":\"address\"}],\"name\":\"transferAndRequestRedemption\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"undercollateralizedThresholdPercent\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"utxoValue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"withdrawFunds\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"withdrawableAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]" + +// Deposit is an auto generated Go binding around an Ethereum contract. +type Deposit struct { + DepositCaller // Read-only binding to the contract + DepositTransactor // Write-only binding to the contract + DepositFilterer // Log filterer for contract events +} + +// DepositCaller is an auto generated read-only Go binding around an Ethereum contract. +type DepositCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DepositTransactor is an auto generated write-only Go binding around an Ethereum contract. +type DepositTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DepositFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type DepositFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// DepositSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type DepositSession struct { + Contract *Deposit // 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 +} + +// DepositCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type DepositCallerSession struct { + Contract *DepositCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// DepositTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type DepositTransactorSession struct { + Contract *DepositTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// DepositRaw is an auto generated low-level Go binding around an Ethereum contract. +type DepositRaw struct { + Contract *Deposit // Generic contract binding to access the raw methods on +} + +// DepositCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type DepositCallerRaw struct { + Contract *DepositCaller // Generic read-only contract binding to access the raw methods on +} + +// DepositTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type DepositTransactorRaw struct { + Contract *DepositTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewDeposit creates a new instance of Deposit, bound to a specific deployed contract. +func NewDeposit(address common.Address, backend bind.ContractBackend) (*Deposit, error) { + contract, err := bindDeposit(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Deposit{DepositCaller: DepositCaller{contract: contract}, DepositTransactor: DepositTransactor{contract: contract}, DepositFilterer: DepositFilterer{contract: contract}}, nil +} + +// NewDepositCaller creates a new read-only instance of Deposit, bound to a specific deployed contract. +func NewDepositCaller(address common.Address, caller bind.ContractCaller) (*DepositCaller, error) { + contract, err := bindDeposit(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &DepositCaller{contract: contract}, nil +} + +// NewDepositTransactor creates a new write-only instance of Deposit, bound to a specific deployed contract. +func NewDepositTransactor(address common.Address, transactor bind.ContractTransactor) (*DepositTransactor, error) { + contract, err := bindDeposit(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &DepositTransactor{contract: contract}, nil +} + +// NewDepositFilterer creates a new log filterer instance of Deposit, bound to a specific deployed contract. +func NewDepositFilterer(address common.Address, filterer bind.ContractFilterer) (*DepositFilterer, error) { + contract, err := bindDeposit(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &DepositFilterer{contract: contract}, nil +} + +// bindDeposit binds a generic wrapper to an already deployed contract. +func bindDeposit(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(DepositABI)) + 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 (_Deposit *DepositRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _Deposit.Contract.DepositCaller.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 (_Deposit *DepositRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.Contract.DepositTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Deposit *DepositRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Deposit.Contract.DepositTransactor.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 (_Deposit *DepositCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _Deposit.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 (_Deposit *DepositTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Deposit *DepositTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Deposit.Contract.contract.Transact(opts, method, params...) +} + +// AuctionValue is a free data retrieval call binding the contract method 0x13f654df. +// +// Solidity: function auctionValue() constant returns(uint256) +func (_Deposit *DepositCaller) AuctionValue(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "auctionValue") + return *ret0, err +} + +// AuctionValue is a free data retrieval call binding the contract method 0x13f654df. +// +// Solidity: function auctionValue() constant returns(uint256) +func (_Deposit *DepositSession) AuctionValue() (*big.Int, error) { + return _Deposit.Contract.AuctionValue(&_Deposit.CallOpts) +} + +// AuctionValue is a free data retrieval call binding the contract method 0x13f654df. +// +// Solidity: function auctionValue() constant returns(uint256) +func (_Deposit *DepositCallerSession) AuctionValue() (*big.Int, error) { + return _Deposit.Contract.AuctionValue(&_Deposit.CallOpts) +} + +// CollateralizationPercentage is a free data retrieval call binding the contract method 0x6e4668be. +// +// Solidity: function collateralizationPercentage() constant returns(uint256) +func (_Deposit *DepositCaller) CollateralizationPercentage(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "collateralizationPercentage") + return *ret0, err +} + +// CollateralizationPercentage is a free data retrieval call binding the contract method 0x6e4668be. +// +// Solidity: function collateralizationPercentage() constant returns(uint256) +func (_Deposit *DepositSession) CollateralizationPercentage() (*big.Int, error) { + return _Deposit.Contract.CollateralizationPercentage(&_Deposit.CallOpts) +} + +// CollateralizationPercentage is a free data retrieval call binding the contract method 0x6e4668be. +// +// Solidity: function collateralizationPercentage() constant returns(uint256) +func (_Deposit *DepositCallerSession) CollateralizationPercentage() (*big.Int, error) { + return _Deposit.Contract.CollateralizationPercentage(&_Deposit.CallOpts) +} + +// CurrentState is a free data retrieval call binding the contract method 0x0c3f6acf. +// +// Solidity: function currentState() constant returns(uint256) +func (_Deposit *DepositCaller) CurrentState(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "currentState") + return *ret0, err +} + +// CurrentState is a free data retrieval call binding the contract method 0x0c3f6acf. +// +// Solidity: function currentState() constant returns(uint256) +func (_Deposit *DepositSession) CurrentState() (*big.Int, error) { + return _Deposit.Contract.CurrentState(&_Deposit.CallOpts) +} + +// CurrentState is a free data retrieval call binding the contract method 0x0c3f6acf. +// +// Solidity: function currentState() constant returns(uint256) +func (_Deposit *DepositCallerSession) CurrentState() (*big.Int, error) { + return _Deposit.Contract.CurrentState(&_Deposit.CallOpts) +} + +// FundingInfo is a free data retrieval call binding the contract method 0xdba49153. +// +// Solidity: function fundingInfo() constant returns(bytes8 utxoValueBytes, uint256 fundedAt, bytes utxoOutpoint) +func (_Deposit *DepositCaller) FundingInfo(opts *bind.CallOpts) (struct { + UtxoValueBytes [8]byte + FundedAt *big.Int + UtxoOutpoint []byte +}, error) { + ret := new(struct { + UtxoValueBytes [8]byte + FundedAt *big.Int + UtxoOutpoint []byte + }) + out := ret + err := _Deposit.contract.Call(opts, out, "fundingInfo") + return *ret, err +} + +// FundingInfo is a free data retrieval call binding the contract method 0xdba49153. +// +// Solidity: function fundingInfo() constant returns(bytes8 utxoValueBytes, uint256 fundedAt, bytes utxoOutpoint) +func (_Deposit *DepositSession) FundingInfo() (struct { + UtxoValueBytes [8]byte + FundedAt *big.Int + UtxoOutpoint []byte +}, error) { + return _Deposit.Contract.FundingInfo(&_Deposit.CallOpts) +} + +// FundingInfo is a free data retrieval call binding the contract method 0xdba49153. +// +// Solidity: function fundingInfo() constant returns(bytes8 utxoValueBytes, uint256 fundedAt, bytes utxoOutpoint) +func (_Deposit *DepositCallerSession) FundingInfo() (struct { + UtxoValueBytes [8]byte + FundedAt *big.Int + UtxoOutpoint []byte +}, error) { + return _Deposit.Contract.FundingInfo(&_Deposit.CallOpts) +} + +// GetOwnerRedemptionTbtcRequirement is a free data retrieval call binding the contract method 0xd8d02330. +// +// Solidity: function getOwnerRedemptionTbtcRequirement(address _redeemer) constant returns(uint256) +func (_Deposit *DepositCaller) GetOwnerRedemptionTbtcRequirement(opts *bind.CallOpts, _redeemer common.Address) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "getOwnerRedemptionTbtcRequirement", _redeemer) + return *ret0, err +} + +// GetOwnerRedemptionTbtcRequirement is a free data retrieval call binding the contract method 0xd8d02330. +// +// Solidity: function getOwnerRedemptionTbtcRequirement(address _redeemer) constant returns(uint256) +func (_Deposit *DepositSession) GetOwnerRedemptionTbtcRequirement(_redeemer common.Address) (*big.Int, error) { + return _Deposit.Contract.GetOwnerRedemptionTbtcRequirement(&_Deposit.CallOpts, _redeemer) +} + +// GetOwnerRedemptionTbtcRequirement is a free data retrieval call binding the contract method 0xd8d02330. +// +// Solidity: function getOwnerRedemptionTbtcRequirement(address _redeemer) constant returns(uint256) +func (_Deposit *DepositCallerSession) GetOwnerRedemptionTbtcRequirement(_redeemer common.Address) (*big.Int, error) { + return _Deposit.Contract.GetOwnerRedemptionTbtcRequirement(&_Deposit.CallOpts, _redeemer) +} + +// GetRedemptionTbtcRequirement is a free data retrieval call binding the contract method 0xd02fd958. +// +// Solidity: function getRedemptionTbtcRequirement(address _redeemer) constant returns(uint256) +func (_Deposit *DepositCaller) GetRedemptionTbtcRequirement(opts *bind.CallOpts, _redeemer common.Address) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "getRedemptionTbtcRequirement", _redeemer) + return *ret0, err +} + +// GetRedemptionTbtcRequirement is a free data retrieval call binding the contract method 0xd02fd958. +// +// Solidity: function getRedemptionTbtcRequirement(address _redeemer) constant returns(uint256) +func (_Deposit *DepositSession) GetRedemptionTbtcRequirement(_redeemer common.Address) (*big.Int, error) { + return _Deposit.Contract.GetRedemptionTbtcRequirement(&_Deposit.CallOpts, _redeemer) +} + +// GetRedemptionTbtcRequirement is a free data retrieval call binding the contract method 0xd02fd958. +// +// Solidity: function getRedemptionTbtcRequirement(address _redeemer) constant returns(uint256) +func (_Deposit *DepositCallerSession) GetRedemptionTbtcRequirement(_redeemer common.Address) (*big.Int, error) { + return _Deposit.Contract.GetRedemptionTbtcRequirement(&_Deposit.CallOpts, _redeemer) +} + +// InActive is a free data retrieval call binding the contract method 0xf97a02fa. +// +// Solidity: function inActive() constant returns(bool) +func (_Deposit *DepositCaller) InActive(opts *bind.CallOpts) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "inActive") + return *ret0, err +} + +// InActive is a free data retrieval call binding the contract method 0xf97a02fa. +// +// Solidity: function inActive() constant returns(bool) +func (_Deposit *DepositSession) InActive() (bool, error) { + return _Deposit.Contract.InActive(&_Deposit.CallOpts) +} + +// InActive is a free data retrieval call binding the contract method 0xf97a02fa. +// +// Solidity: function inActive() constant returns(bool) +func (_Deposit *DepositCallerSession) InActive() (bool, error) { + return _Deposit.Contract.InActive(&_Deposit.CallOpts) +} + +// InitialCollateralizedPercent is a free data retrieval call binding the contract method 0x76ef5510. +// +// Solidity: function initialCollateralizedPercent() constant returns(uint16) +func (_Deposit *DepositCaller) InitialCollateralizedPercent(opts *bind.CallOpts) (uint16, error) { + var ( + ret0 = new(uint16) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "initialCollateralizedPercent") + return *ret0, err +} + +// InitialCollateralizedPercent is a free data retrieval call binding the contract method 0x76ef5510. +// +// Solidity: function initialCollateralizedPercent() constant returns(uint16) +func (_Deposit *DepositSession) InitialCollateralizedPercent() (uint16, error) { + return _Deposit.Contract.InitialCollateralizedPercent(&_Deposit.CallOpts) +} + +// InitialCollateralizedPercent is a free data retrieval call binding the contract method 0x76ef5510. +// +// Solidity: function initialCollateralizedPercent() constant returns(uint16) +func (_Deposit *DepositCallerSession) InitialCollateralizedPercent() (uint16, error) { + return _Deposit.Contract.InitialCollateralizedPercent(&_Deposit.CallOpts) +} + +// KeepAddress is a free data retrieval call binding the contract method 0x6c3b0114. +// +// Solidity: function keepAddress() constant returns(address) +func (_Deposit *DepositCaller) KeepAddress(opts *bind.CallOpts) (common.Address, error) { + var ( + ret0 = new(common.Address) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "keepAddress") + return *ret0, err +} + +// KeepAddress is a free data retrieval call binding the contract method 0x6c3b0114. +// +// Solidity: function keepAddress() constant returns(address) +func (_Deposit *DepositSession) KeepAddress() (common.Address, error) { + return _Deposit.Contract.KeepAddress(&_Deposit.CallOpts) +} + +// KeepAddress is a free data retrieval call binding the contract method 0x6c3b0114. +// +// Solidity: function keepAddress() constant returns(address) +func (_Deposit *DepositCallerSession) KeepAddress() (common.Address, error) { + return _Deposit.Contract.KeepAddress(&_Deposit.CallOpts) +} + +// LotSizeSatoshis is a free data retrieval call binding the contract method 0x90a2f687. +// +// Solidity: function lotSizeSatoshis() constant returns(uint64) +func (_Deposit *DepositCaller) LotSizeSatoshis(opts *bind.CallOpts) (uint64, error) { + var ( + ret0 = new(uint64) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "lotSizeSatoshis") + return *ret0, err +} + +// LotSizeSatoshis is a free data retrieval call binding the contract method 0x90a2f687. +// +// Solidity: function lotSizeSatoshis() constant returns(uint64) +func (_Deposit *DepositSession) LotSizeSatoshis() (uint64, error) { + return _Deposit.Contract.LotSizeSatoshis(&_Deposit.CallOpts) +} + +// LotSizeSatoshis is a free data retrieval call binding the contract method 0x90a2f687. +// +// Solidity: function lotSizeSatoshis() constant returns(uint64) +func (_Deposit *DepositCallerSession) LotSizeSatoshis() (uint64, error) { + return _Deposit.Contract.LotSizeSatoshis(&_Deposit.CallOpts) +} + +// LotSizeTbtc is a free data retrieval call binding the contract method 0x946fbf4c. +// +// Solidity: function lotSizeTbtc() constant returns(uint256) +func (_Deposit *DepositCaller) LotSizeTbtc(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "lotSizeTbtc") + return *ret0, err +} + +// LotSizeTbtc is a free data retrieval call binding the contract method 0x946fbf4c. +// +// Solidity: function lotSizeTbtc() constant returns(uint256) +func (_Deposit *DepositSession) LotSizeTbtc() (*big.Int, error) { + return _Deposit.Contract.LotSizeTbtc(&_Deposit.CallOpts) +} + +// LotSizeTbtc is a free data retrieval call binding the contract method 0x946fbf4c. +// +// Solidity: function lotSizeTbtc() constant returns(uint256) +func (_Deposit *DepositCallerSession) LotSizeTbtc() (*big.Int, error) { + return _Deposit.Contract.LotSizeTbtc(&_Deposit.CallOpts) +} + +// RemainingTerm is a free data retrieval call binding the contract method 0x35bc0ebe. +// +// Solidity: function remainingTerm() constant returns(uint256) +func (_Deposit *DepositCaller) RemainingTerm(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "remainingTerm") + return *ret0, err +} + +// RemainingTerm is a free data retrieval call binding the contract method 0x35bc0ebe. +// +// Solidity: function remainingTerm() constant returns(uint256) +func (_Deposit *DepositSession) RemainingTerm() (*big.Int, error) { + return _Deposit.Contract.RemainingTerm(&_Deposit.CallOpts) +} + +// RemainingTerm is a free data retrieval call binding the contract method 0x35bc0ebe. +// +// Solidity: function remainingTerm() constant returns(uint256) +func (_Deposit *DepositCallerSession) RemainingTerm() (*big.Int, error) { + return _Deposit.Contract.RemainingTerm(&_Deposit.CallOpts) +} + +// SeverelyUndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0x0d5889f4. +// +// Solidity: function severelyUndercollateralizedThresholdPercent() constant returns(uint16) +func (_Deposit *DepositCaller) SeverelyUndercollateralizedThresholdPercent(opts *bind.CallOpts) (uint16, error) { + var ( + ret0 = new(uint16) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "severelyUndercollateralizedThresholdPercent") + return *ret0, err +} + +// SeverelyUndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0x0d5889f4. +// +// Solidity: function severelyUndercollateralizedThresholdPercent() constant returns(uint16) +func (_Deposit *DepositSession) SeverelyUndercollateralizedThresholdPercent() (uint16, error) { + return _Deposit.Contract.SeverelyUndercollateralizedThresholdPercent(&_Deposit.CallOpts) +} + +// SeverelyUndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0x0d5889f4. +// +// Solidity: function severelyUndercollateralizedThresholdPercent() constant returns(uint16) +func (_Deposit *DepositCallerSession) SeverelyUndercollateralizedThresholdPercent() (uint16, error) { + return _Deposit.Contract.SeverelyUndercollateralizedThresholdPercent(&_Deposit.CallOpts) +} + +// SignerFeeTbtc is a free data retrieval call binding the contract method 0x058d3703. +// +// Solidity: function signerFeeTbtc() constant returns(uint256) +func (_Deposit *DepositCaller) SignerFeeTbtc(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "signerFeeTbtc") + return *ret0, err +} + +// SignerFeeTbtc is a free data retrieval call binding the contract method 0x058d3703. +// +// Solidity: function signerFeeTbtc() constant returns(uint256) +func (_Deposit *DepositSession) SignerFeeTbtc() (*big.Int, error) { + return _Deposit.Contract.SignerFeeTbtc(&_Deposit.CallOpts) +} + +// SignerFeeTbtc is a free data retrieval call binding the contract method 0x058d3703. +// +// Solidity: function signerFeeTbtc() constant returns(uint256) +func (_Deposit *DepositCallerSession) SignerFeeTbtc() (*big.Int, error) { + return _Deposit.Contract.SignerFeeTbtc(&_Deposit.CallOpts) +} + +// UndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0x85df153d. +// +// Solidity: function undercollateralizedThresholdPercent() constant returns(uint16) +func (_Deposit *DepositCaller) UndercollateralizedThresholdPercent(opts *bind.CallOpts) (uint16, error) { + var ( + ret0 = new(uint16) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "undercollateralizedThresholdPercent") + return *ret0, err +} + +// UndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0x85df153d. +// +// Solidity: function undercollateralizedThresholdPercent() constant returns(uint16) +func (_Deposit *DepositSession) UndercollateralizedThresholdPercent() (uint16, error) { + return _Deposit.Contract.UndercollateralizedThresholdPercent(&_Deposit.CallOpts) +} + +// UndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0x85df153d. +// +// Solidity: function undercollateralizedThresholdPercent() constant returns(uint16) +func (_Deposit *DepositCallerSession) UndercollateralizedThresholdPercent() (uint16, error) { + return _Deposit.Contract.UndercollateralizedThresholdPercent(&_Deposit.CallOpts) +} + +// UtxoValue is a free data retrieval call binding the contract method 0x87a90d80. +// +// Solidity: function utxoValue() constant returns(uint256) +func (_Deposit *DepositCaller) UtxoValue(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "utxoValue") + return *ret0, err +} + +// UtxoValue is a free data retrieval call binding the contract method 0x87a90d80. +// +// Solidity: function utxoValue() constant returns(uint256) +func (_Deposit *DepositSession) UtxoValue() (*big.Int, error) { + return _Deposit.Contract.UtxoValue(&_Deposit.CallOpts) +} + +// UtxoValue is a free data retrieval call binding the contract method 0x87a90d80. +// +// Solidity: function utxoValue() constant returns(uint256) +func (_Deposit *DepositCallerSession) UtxoValue() (*big.Int, error) { + return _Deposit.Contract.UtxoValue(&_Deposit.CallOpts) +} + +// WithdrawableAmount is a free data retrieval call binding the contract method 0x951303f5. +// +// Solidity: function withdrawableAmount() constant returns(uint256) +func (_Deposit *DepositCaller) WithdrawableAmount(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _Deposit.contract.Call(opts, out, "withdrawableAmount") + return *ret0, err +} + +// WithdrawableAmount is a free data retrieval call binding the contract method 0x951303f5. +// +// Solidity: function withdrawableAmount() constant returns(uint256) +func (_Deposit *DepositSession) WithdrawableAmount() (*big.Int, error) { + return _Deposit.Contract.WithdrawableAmount(&_Deposit.CallOpts) +} + +// WithdrawableAmount is a free data retrieval call binding the contract method 0x951303f5. +// +// Solidity: function withdrawableAmount() constant returns(uint256) +func (_Deposit *DepositCallerSession) WithdrawableAmount() (*big.Int, error) { + return _Deposit.Contract.WithdrawableAmount(&_Deposit.CallOpts) +} + +// ExitCourtesyCall is a paid mutator transaction binding the contract method 0x287b32e5. +// +// Solidity: function exitCourtesyCall() returns() +func (_Deposit *DepositTransactor) ExitCourtesyCall(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "exitCourtesyCall") +} + +// ExitCourtesyCall is a paid mutator transaction binding the contract method 0x287b32e5. +// +// Solidity: function exitCourtesyCall() returns() +func (_Deposit *DepositSession) ExitCourtesyCall() (*types.Transaction, error) { + return _Deposit.Contract.ExitCourtesyCall(&_Deposit.TransactOpts) +} + +// ExitCourtesyCall is a paid mutator transaction binding the contract method 0x287b32e5. +// +// Solidity: function exitCourtesyCall() returns() +func (_Deposit *DepositTransactorSession) ExitCourtesyCall() (*types.Transaction, error) { + return _Deposit.Contract.ExitCourtesyCall(&_Deposit.TransactOpts) +} + +// IncreaseRedemptionFee is a paid mutator transaction binding the contract method 0x9894d734. +// +// Solidity: function increaseRedemptionFee(bytes8 _previousOutputValueBytes, bytes8 _newOutputValueBytes) returns() +func (_Deposit *DepositTransactor) IncreaseRedemptionFee(opts *bind.TransactOpts, _previousOutputValueBytes [8]byte, _newOutputValueBytes [8]byte) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "increaseRedemptionFee", _previousOutputValueBytes, _newOutputValueBytes) +} + +// IncreaseRedemptionFee is a paid mutator transaction binding the contract method 0x9894d734. +// +// Solidity: function increaseRedemptionFee(bytes8 _previousOutputValueBytes, bytes8 _newOutputValueBytes) returns() +func (_Deposit *DepositSession) IncreaseRedemptionFee(_previousOutputValueBytes [8]byte, _newOutputValueBytes [8]byte) (*types.Transaction, error) { + return _Deposit.Contract.IncreaseRedemptionFee(&_Deposit.TransactOpts, _previousOutputValueBytes, _newOutputValueBytes) +} + +// IncreaseRedemptionFee is a paid mutator transaction binding the contract method 0x9894d734. +// +// Solidity: function increaseRedemptionFee(bytes8 _previousOutputValueBytes, bytes8 _newOutputValueBytes) returns() +func (_Deposit *DepositTransactorSession) IncreaseRedemptionFee(_previousOutputValueBytes [8]byte, _newOutputValueBytes [8]byte) (*types.Transaction, error) { + return _Deposit.Contract.IncreaseRedemptionFee(&_Deposit.TransactOpts, _previousOutputValueBytes, _newOutputValueBytes) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _factory) returns() +func (_Deposit *DepositTransactor) Initialize(opts *bind.TransactOpts, _factory common.Address) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "initialize", _factory) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _factory) returns() +func (_Deposit *DepositSession) Initialize(_factory common.Address) (*types.Transaction, error) { + return _Deposit.Contract.Initialize(&_Deposit.TransactOpts, _factory) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _factory) returns() +func (_Deposit *DepositTransactorSession) Initialize(_factory common.Address) (*types.Transaction, error) { + return _Deposit.Contract.Initialize(&_Deposit.TransactOpts, _factory) +} + +// InitializeDeposit is a paid mutator transaction binding the contract method 0xa81e63f7. +// +// Solidity: function initializeDeposit(address _tbtcSystem, address _tbtcToken, address _tbtcDepositToken, address _feeRebateToken, address _vendingMachineAddress, uint64 _lotSizeSatoshis) returns() +func (_Deposit *DepositTransactor) InitializeDeposit(opts *bind.TransactOpts, _tbtcSystem common.Address, _tbtcToken common.Address, _tbtcDepositToken common.Address, _feeRebateToken common.Address, _vendingMachineAddress common.Address, _lotSizeSatoshis uint64) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "initializeDeposit", _tbtcSystem, _tbtcToken, _tbtcDepositToken, _feeRebateToken, _vendingMachineAddress, _lotSizeSatoshis) +} + +// InitializeDeposit is a paid mutator transaction binding the contract method 0xa81e63f7. +// +// Solidity: function initializeDeposit(address _tbtcSystem, address _tbtcToken, address _tbtcDepositToken, address _feeRebateToken, address _vendingMachineAddress, uint64 _lotSizeSatoshis) returns() +func (_Deposit *DepositSession) InitializeDeposit(_tbtcSystem common.Address, _tbtcToken common.Address, _tbtcDepositToken common.Address, _feeRebateToken common.Address, _vendingMachineAddress common.Address, _lotSizeSatoshis uint64) (*types.Transaction, error) { + return _Deposit.Contract.InitializeDeposit(&_Deposit.TransactOpts, _tbtcSystem, _tbtcToken, _tbtcDepositToken, _feeRebateToken, _vendingMachineAddress, _lotSizeSatoshis) +} + +// InitializeDeposit is a paid mutator transaction binding the contract method 0xa81e63f7. +// +// Solidity: function initializeDeposit(address _tbtcSystem, address _tbtcToken, address _tbtcDepositToken, address _feeRebateToken, address _vendingMachineAddress, uint64 _lotSizeSatoshis) returns() +func (_Deposit *DepositTransactorSession) InitializeDeposit(_tbtcSystem common.Address, _tbtcToken common.Address, _tbtcDepositToken common.Address, _feeRebateToken common.Address, _vendingMachineAddress common.Address, _lotSizeSatoshis uint64) (*types.Transaction, error) { + return _Deposit.Contract.InitializeDeposit(&_Deposit.TransactOpts, _tbtcSystem, _tbtcToken, _tbtcDepositToken, _feeRebateToken, _vendingMachineAddress, _lotSizeSatoshis) +} + +// NotifyCourtesyCall is a paid mutator transaction binding the contract method 0x96aab311. +// +// Solidity: function notifyCourtesyCall() returns() +func (_Deposit *DepositTransactor) NotifyCourtesyCall(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "notifyCourtesyCall") +} + +// NotifyCourtesyCall is a paid mutator transaction binding the contract method 0x96aab311. +// +// Solidity: function notifyCourtesyCall() returns() +func (_Deposit *DepositSession) NotifyCourtesyCall() (*types.Transaction, error) { + return _Deposit.Contract.NotifyCourtesyCall(&_Deposit.TransactOpts) +} + +// NotifyCourtesyCall is a paid mutator transaction binding the contract method 0x96aab311. +// +// Solidity: function notifyCourtesyCall() returns() +func (_Deposit *DepositTransactorSession) NotifyCourtesyCall() (*types.Transaction, error) { + return _Deposit.Contract.NotifyCourtesyCall(&_Deposit.TransactOpts) +} + +// NotifyCourtesyCallExpired is a paid mutator transaction binding the contract method 0x91d165e3. +// +// Solidity: function notifyCourtesyCallExpired() returns() +func (_Deposit *DepositTransactor) NotifyCourtesyCallExpired(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "notifyCourtesyCallExpired") +} + +// NotifyCourtesyCallExpired is a paid mutator transaction binding the contract method 0x91d165e3. +// +// Solidity: function notifyCourtesyCallExpired() returns() +func (_Deposit *DepositSession) NotifyCourtesyCallExpired() (*types.Transaction, error) { + return _Deposit.Contract.NotifyCourtesyCallExpired(&_Deposit.TransactOpts) +} + +// NotifyCourtesyCallExpired is a paid mutator transaction binding the contract method 0x91d165e3. +// +// Solidity: function notifyCourtesyCallExpired() returns() +func (_Deposit *DepositTransactorSession) NotifyCourtesyCallExpired() (*types.Transaction, error) { + return _Deposit.Contract.NotifyCourtesyCallExpired(&_Deposit.TransactOpts) +} + +// NotifyFundingTimedOut is a paid mutator transaction binding the contract method 0x259b1ea3. +// +// Solidity: function notifyFundingTimedOut() returns() +func (_Deposit *DepositTransactor) NotifyFundingTimedOut(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "notifyFundingTimedOut") +} + +// NotifyFundingTimedOut is a paid mutator transaction binding the contract method 0x259b1ea3. +// +// Solidity: function notifyFundingTimedOut() returns() +func (_Deposit *DepositSession) NotifyFundingTimedOut() (*types.Transaction, error) { + return _Deposit.Contract.NotifyFundingTimedOut(&_Deposit.TransactOpts) +} + +// NotifyFundingTimedOut is a paid mutator transaction binding the contract method 0x259b1ea3. +// +// Solidity: function notifyFundingTimedOut() returns() +func (_Deposit *DepositTransactorSession) NotifyFundingTimedOut() (*types.Transaction, error) { + return _Deposit.Contract.NotifyFundingTimedOut(&_Deposit.TransactOpts) +} + +// NotifyRedemptionProofTimedOut is a paid mutator transaction binding the contract method 0xba346839. +// +// Solidity: function notifyRedemptionProofTimedOut() returns() +func (_Deposit *DepositTransactor) NotifyRedemptionProofTimedOut(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "notifyRedemptionProofTimedOut") +} + +// NotifyRedemptionProofTimedOut is a paid mutator transaction binding the contract method 0xba346839. +// +// Solidity: function notifyRedemptionProofTimedOut() returns() +func (_Deposit *DepositSession) NotifyRedemptionProofTimedOut() (*types.Transaction, error) { + return _Deposit.Contract.NotifyRedemptionProofTimedOut(&_Deposit.TransactOpts) +} + +// NotifyRedemptionProofTimedOut is a paid mutator transaction binding the contract method 0xba346839. +// +// Solidity: function notifyRedemptionProofTimedOut() returns() +func (_Deposit *DepositTransactorSession) NotifyRedemptionProofTimedOut() (*types.Transaction, error) { + return _Deposit.Contract.NotifyRedemptionProofTimedOut(&_Deposit.TransactOpts) +} + +// NotifyRedemptionSignatureTimedOut is a paid mutator transaction binding the contract method 0x2b0bc981. +// +// Solidity: function notifyRedemptionSignatureTimedOut() returns() +func (_Deposit *DepositTransactor) NotifyRedemptionSignatureTimedOut(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "notifyRedemptionSignatureTimedOut") +} + +// NotifyRedemptionSignatureTimedOut is a paid mutator transaction binding the contract method 0x2b0bc981. +// +// Solidity: function notifyRedemptionSignatureTimedOut() returns() +func (_Deposit *DepositSession) NotifyRedemptionSignatureTimedOut() (*types.Transaction, error) { + return _Deposit.Contract.NotifyRedemptionSignatureTimedOut(&_Deposit.TransactOpts) +} + +// NotifyRedemptionSignatureTimedOut is a paid mutator transaction binding the contract method 0x2b0bc981. +// +// Solidity: function notifyRedemptionSignatureTimedOut() returns() +func (_Deposit *DepositTransactorSession) NotifyRedemptionSignatureTimedOut() (*types.Transaction, error) { + return _Deposit.Contract.NotifyRedemptionSignatureTimedOut(&_Deposit.TransactOpts) +} + +// NotifySignerSetupFailed is a paid mutator transaction binding the contract method 0x4f706e44. +// +// Solidity: function notifySignerSetupFailed() returns() +func (_Deposit *DepositTransactor) NotifySignerSetupFailed(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "notifySignerSetupFailed") +} + +// NotifySignerSetupFailed is a paid mutator transaction binding the contract method 0x4f706e44. +// +// Solidity: function notifySignerSetupFailed() returns() +func (_Deposit *DepositSession) NotifySignerSetupFailed() (*types.Transaction, error) { + return _Deposit.Contract.NotifySignerSetupFailed(&_Deposit.TransactOpts) +} + +// NotifySignerSetupFailed is a paid mutator transaction binding the contract method 0x4f706e44. +// +// Solidity: function notifySignerSetupFailed() returns() +func (_Deposit *DepositTransactorSession) NotifySignerSetupFailed() (*types.Transaction, error) { + return _Deposit.Contract.NotifySignerSetupFailed(&_Deposit.TransactOpts) +} + +// NotifyUndercollateralizedLiquidation is a paid mutator transaction binding the contract method 0xb4bd2e7a. +// +// Solidity: function notifyUndercollateralizedLiquidation() returns() +func (_Deposit *DepositTransactor) NotifyUndercollateralizedLiquidation(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "notifyUndercollateralizedLiquidation") +} + +// NotifyUndercollateralizedLiquidation is a paid mutator transaction binding the contract method 0xb4bd2e7a. +// +// Solidity: function notifyUndercollateralizedLiquidation() returns() +func (_Deposit *DepositSession) NotifyUndercollateralizedLiquidation() (*types.Transaction, error) { + return _Deposit.Contract.NotifyUndercollateralizedLiquidation(&_Deposit.TransactOpts) +} + +// NotifyUndercollateralizedLiquidation is a paid mutator transaction binding the contract method 0xb4bd2e7a. +// +// Solidity: function notifyUndercollateralizedLiquidation() returns() +func (_Deposit *DepositTransactorSession) NotifyUndercollateralizedLiquidation() (*types.Transaction, error) { + return _Deposit.Contract.NotifyUndercollateralizedLiquidation(&_Deposit.TransactOpts) +} + +// ProvideBTCFundingProof is a paid mutator transaction binding the contract method 0xd9f74b0e. +// +// Solidity: function provideBTCFundingProof(bytes4 _txVersion, bytes _txInputVector, bytes _txOutputVector, bytes4 _txLocktime, uint8 _fundingOutputIndex, bytes _merkleProof, uint256 _txIndexInBlock, bytes _bitcoinHeaders) returns() +func (_Deposit *DepositTransactor) ProvideBTCFundingProof(opts *bind.TransactOpts, _txVersion [4]byte, _txInputVector []byte, _txOutputVector []byte, _txLocktime [4]byte, _fundingOutputIndex uint8, _merkleProof []byte, _txIndexInBlock *big.Int, _bitcoinHeaders []byte) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "provideBTCFundingProof", _txVersion, _txInputVector, _txOutputVector, _txLocktime, _fundingOutputIndex, _merkleProof, _txIndexInBlock, _bitcoinHeaders) +} + +// ProvideBTCFundingProof is a paid mutator transaction binding the contract method 0xd9f74b0e. +// +// Solidity: function provideBTCFundingProof(bytes4 _txVersion, bytes _txInputVector, bytes _txOutputVector, bytes4 _txLocktime, uint8 _fundingOutputIndex, bytes _merkleProof, uint256 _txIndexInBlock, bytes _bitcoinHeaders) returns() +func (_Deposit *DepositSession) ProvideBTCFundingProof(_txVersion [4]byte, _txInputVector []byte, _txOutputVector []byte, _txLocktime [4]byte, _fundingOutputIndex uint8, _merkleProof []byte, _txIndexInBlock *big.Int, _bitcoinHeaders []byte) (*types.Transaction, error) { + return _Deposit.Contract.ProvideBTCFundingProof(&_Deposit.TransactOpts, _txVersion, _txInputVector, _txOutputVector, _txLocktime, _fundingOutputIndex, _merkleProof, _txIndexInBlock, _bitcoinHeaders) +} + +// ProvideBTCFundingProof is a paid mutator transaction binding the contract method 0xd9f74b0e. +// +// Solidity: function provideBTCFundingProof(bytes4 _txVersion, bytes _txInputVector, bytes _txOutputVector, bytes4 _txLocktime, uint8 _fundingOutputIndex, bytes _merkleProof, uint256 _txIndexInBlock, bytes _bitcoinHeaders) returns() +func (_Deposit *DepositTransactorSession) ProvideBTCFundingProof(_txVersion [4]byte, _txInputVector []byte, _txOutputVector []byte, _txLocktime [4]byte, _fundingOutputIndex uint8, _merkleProof []byte, _txIndexInBlock *big.Int, _bitcoinHeaders []byte) (*types.Transaction, error) { + return _Deposit.Contract.ProvideBTCFundingProof(&_Deposit.TransactOpts, _txVersion, _txInputVector, _txOutputVector, _txLocktime, _fundingOutputIndex, _merkleProof, _txIndexInBlock, _bitcoinHeaders) +} + +// ProvideECDSAFraudProof is a paid mutator transaction binding the contract method 0xd5eef971. +// +// Solidity: function provideECDSAFraudProof(uint8 _v, bytes32 _r, bytes32 _s, bytes32 _signedDigest, bytes _preimage) returns() +func (_Deposit *DepositTransactor) ProvideECDSAFraudProof(opts *bind.TransactOpts, _v uint8, _r [32]byte, _s [32]byte, _signedDigest [32]byte, _preimage []byte) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "provideECDSAFraudProof", _v, _r, _s, _signedDigest, _preimage) +} + +// ProvideECDSAFraudProof is a paid mutator transaction binding the contract method 0xd5eef971. +// +// Solidity: function provideECDSAFraudProof(uint8 _v, bytes32 _r, bytes32 _s, bytes32 _signedDigest, bytes _preimage) returns() +func (_Deposit *DepositSession) ProvideECDSAFraudProof(_v uint8, _r [32]byte, _s [32]byte, _signedDigest [32]byte, _preimage []byte) (*types.Transaction, error) { + return _Deposit.Contract.ProvideECDSAFraudProof(&_Deposit.TransactOpts, _v, _r, _s, _signedDigest, _preimage) +} + +// ProvideECDSAFraudProof is a paid mutator transaction binding the contract method 0xd5eef971. +// +// Solidity: function provideECDSAFraudProof(uint8 _v, bytes32 _r, bytes32 _s, bytes32 _signedDigest, bytes _preimage) returns() +func (_Deposit *DepositTransactorSession) ProvideECDSAFraudProof(_v uint8, _r [32]byte, _s [32]byte, _signedDigest [32]byte, _preimage []byte) (*types.Transaction, error) { + return _Deposit.Contract.ProvideECDSAFraudProof(&_Deposit.TransactOpts, _v, _r, _s, _signedDigest, _preimage) +} + +// ProvideFundingECDSAFraudProof is a paid mutator transaction binding the contract method 0x2d099442. +// +// Solidity: function provideFundingECDSAFraudProof(uint8 _v, bytes32 _r, bytes32 _s, bytes32 _signedDigest, bytes _preimage) returns() +func (_Deposit *DepositTransactor) ProvideFundingECDSAFraudProof(opts *bind.TransactOpts, _v uint8, _r [32]byte, _s [32]byte, _signedDigest [32]byte, _preimage []byte) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "provideFundingECDSAFraudProof", _v, _r, _s, _signedDigest, _preimage) +} + +// ProvideFundingECDSAFraudProof is a paid mutator transaction binding the contract method 0x2d099442. +// +// Solidity: function provideFundingECDSAFraudProof(uint8 _v, bytes32 _r, bytes32 _s, bytes32 _signedDigest, bytes _preimage) returns() +func (_Deposit *DepositSession) ProvideFundingECDSAFraudProof(_v uint8, _r [32]byte, _s [32]byte, _signedDigest [32]byte, _preimage []byte) (*types.Transaction, error) { + return _Deposit.Contract.ProvideFundingECDSAFraudProof(&_Deposit.TransactOpts, _v, _r, _s, _signedDigest, _preimage) +} + +// ProvideFundingECDSAFraudProof is a paid mutator transaction binding the contract method 0x2d099442. +// +// Solidity: function provideFundingECDSAFraudProof(uint8 _v, bytes32 _r, bytes32 _s, bytes32 _signedDigest, bytes _preimage) returns() +func (_Deposit *DepositTransactorSession) ProvideFundingECDSAFraudProof(_v uint8, _r [32]byte, _s [32]byte, _signedDigest [32]byte, _preimage []byte) (*types.Transaction, error) { + return _Deposit.Contract.ProvideFundingECDSAFraudProof(&_Deposit.TransactOpts, _v, _r, _s, _signedDigest, _preimage) +} + +// ProvideRedemptionProof is a paid mutator transaction binding the contract method 0xd459c416. +// +// Solidity: function provideRedemptionProof(bytes4 _txVersion, bytes _txInputVector, bytes _txOutputVector, bytes4 _txLocktime, bytes _merkleProof, uint256 _txIndexInBlock, bytes _bitcoinHeaders) returns() +func (_Deposit *DepositTransactor) ProvideRedemptionProof(opts *bind.TransactOpts, _txVersion [4]byte, _txInputVector []byte, _txOutputVector []byte, _txLocktime [4]byte, _merkleProof []byte, _txIndexInBlock *big.Int, _bitcoinHeaders []byte) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "provideRedemptionProof", _txVersion, _txInputVector, _txOutputVector, _txLocktime, _merkleProof, _txIndexInBlock, _bitcoinHeaders) +} + +// ProvideRedemptionProof is a paid mutator transaction binding the contract method 0xd459c416. +// +// Solidity: function provideRedemptionProof(bytes4 _txVersion, bytes _txInputVector, bytes _txOutputVector, bytes4 _txLocktime, bytes _merkleProof, uint256 _txIndexInBlock, bytes _bitcoinHeaders) returns() +func (_Deposit *DepositSession) ProvideRedemptionProof(_txVersion [4]byte, _txInputVector []byte, _txOutputVector []byte, _txLocktime [4]byte, _merkleProof []byte, _txIndexInBlock *big.Int, _bitcoinHeaders []byte) (*types.Transaction, error) { + return _Deposit.Contract.ProvideRedemptionProof(&_Deposit.TransactOpts, _txVersion, _txInputVector, _txOutputVector, _txLocktime, _merkleProof, _txIndexInBlock, _bitcoinHeaders) +} + +// ProvideRedemptionProof is a paid mutator transaction binding the contract method 0xd459c416. +// +// Solidity: function provideRedemptionProof(bytes4 _txVersion, bytes _txInputVector, bytes _txOutputVector, bytes4 _txLocktime, bytes _merkleProof, uint256 _txIndexInBlock, bytes _bitcoinHeaders) returns() +func (_Deposit *DepositTransactorSession) ProvideRedemptionProof(_txVersion [4]byte, _txInputVector []byte, _txOutputVector []byte, _txLocktime [4]byte, _merkleProof []byte, _txIndexInBlock *big.Int, _bitcoinHeaders []byte) (*types.Transaction, error) { + return _Deposit.Contract.ProvideRedemptionProof(&_Deposit.TransactOpts, _txVersion, _txInputVector, _txOutputVector, _txLocktime, _merkleProof, _txIndexInBlock, _bitcoinHeaders) +} + +// ProvideRedemptionSignature is a paid mutator transaction binding the contract method 0xc4159559. +// +// Solidity: function provideRedemptionSignature(uint8 _v, bytes32 _r, bytes32 _s) returns() +func (_Deposit *DepositTransactor) ProvideRedemptionSignature(opts *bind.TransactOpts, _v uint8, _r [32]byte, _s [32]byte) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "provideRedemptionSignature", _v, _r, _s) +} + +// ProvideRedemptionSignature is a paid mutator transaction binding the contract method 0xc4159559. +// +// Solidity: function provideRedemptionSignature(uint8 _v, bytes32 _r, bytes32 _s) returns() +func (_Deposit *DepositSession) ProvideRedemptionSignature(_v uint8, _r [32]byte, _s [32]byte) (*types.Transaction, error) { + return _Deposit.Contract.ProvideRedemptionSignature(&_Deposit.TransactOpts, _v, _r, _s) +} + +// ProvideRedemptionSignature is a paid mutator transaction binding the contract method 0xc4159559. +// +// Solidity: function provideRedemptionSignature(uint8 _v, bytes32 _r, bytes32 _s) returns() +func (_Deposit *DepositTransactorSession) ProvideRedemptionSignature(_v uint8, _r [32]byte, _s [32]byte) (*types.Transaction, error) { + return _Deposit.Contract.ProvideRedemptionSignature(&_Deposit.TransactOpts, _v, _r, _s) +} + +// PurchaseSignerBondsAtAuction is a paid mutator transaction binding the contract method 0x2c735daa. +// +// Solidity: function purchaseSignerBondsAtAuction() returns() +func (_Deposit *DepositTransactor) PurchaseSignerBondsAtAuction(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "purchaseSignerBondsAtAuction") +} + +// PurchaseSignerBondsAtAuction is a paid mutator transaction binding the contract method 0x2c735daa. +// +// Solidity: function purchaseSignerBondsAtAuction() returns() +func (_Deposit *DepositSession) PurchaseSignerBondsAtAuction() (*types.Transaction, error) { + return _Deposit.Contract.PurchaseSignerBondsAtAuction(&_Deposit.TransactOpts) +} + +// PurchaseSignerBondsAtAuction is a paid mutator transaction binding the contract method 0x2c735daa. +// +// Solidity: function purchaseSignerBondsAtAuction() returns() +func (_Deposit *DepositTransactorSession) PurchaseSignerBondsAtAuction() (*types.Transaction, error) { + return _Deposit.Contract.PurchaseSignerBondsAtAuction(&_Deposit.TransactOpts) +} + +// RequestFunderAbort is a paid mutator transaction binding the contract method 0x0049ce75. +// +// Solidity: function requestFunderAbort(bytes _abortOutputScript) returns() +func (_Deposit *DepositTransactor) RequestFunderAbort(opts *bind.TransactOpts, _abortOutputScript []byte) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "requestFunderAbort", _abortOutputScript) +} + +// RequestFunderAbort is a paid mutator transaction binding the contract method 0x0049ce75. +// +// Solidity: function requestFunderAbort(bytes _abortOutputScript) returns() +func (_Deposit *DepositSession) RequestFunderAbort(_abortOutputScript []byte) (*types.Transaction, error) { + return _Deposit.Contract.RequestFunderAbort(&_Deposit.TransactOpts, _abortOutputScript) +} + +// RequestFunderAbort is a paid mutator transaction binding the contract method 0x0049ce75. +// +// Solidity: function requestFunderAbort(bytes _abortOutputScript) returns() +func (_Deposit *DepositTransactorSession) RequestFunderAbort(_abortOutputScript []byte) (*types.Transaction, error) { + return _Deposit.Contract.RequestFunderAbort(&_Deposit.TransactOpts, _abortOutputScript) +} + +// RequestRedemption is a paid mutator transaction binding the contract method 0x994aa931. +// +// Solidity: function requestRedemption(bytes8 _outputValueBytes, bytes _redeemerOutputScript) returns() +func (_Deposit *DepositTransactor) RequestRedemption(opts *bind.TransactOpts, _outputValueBytes [8]byte, _redeemerOutputScript []byte) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "requestRedemption", _outputValueBytes, _redeemerOutputScript) +} + +// RequestRedemption is a paid mutator transaction binding the contract method 0x994aa931. +// +// Solidity: function requestRedemption(bytes8 _outputValueBytes, bytes _redeemerOutputScript) returns() +func (_Deposit *DepositSession) RequestRedemption(_outputValueBytes [8]byte, _redeemerOutputScript []byte) (*types.Transaction, error) { + return _Deposit.Contract.RequestRedemption(&_Deposit.TransactOpts, _outputValueBytes, _redeemerOutputScript) +} + +// RequestRedemption is a paid mutator transaction binding the contract method 0x994aa931. +// +// Solidity: function requestRedemption(bytes8 _outputValueBytes, bytes _redeemerOutputScript) returns() +func (_Deposit *DepositTransactorSession) RequestRedemption(_outputValueBytes [8]byte, _redeemerOutputScript []byte) (*types.Transaction, error) { + return _Deposit.Contract.RequestRedemption(&_Deposit.TransactOpts, _outputValueBytes, _redeemerOutputScript) +} + +// RetrieveSignerPubkey is a paid mutator transaction binding the contract method 0xea3db250. +// +// Solidity: function retrieveSignerPubkey() returns() +func (_Deposit *DepositTransactor) RetrieveSignerPubkey(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "retrieveSignerPubkey") +} + +// RetrieveSignerPubkey is a paid mutator transaction binding the contract method 0xea3db250. +// +// Solidity: function retrieveSignerPubkey() returns() +func (_Deposit *DepositSession) RetrieveSignerPubkey() (*types.Transaction, error) { + return _Deposit.Contract.RetrieveSignerPubkey(&_Deposit.TransactOpts) +} + +// RetrieveSignerPubkey is a paid mutator transaction binding the contract method 0xea3db250. +// +// Solidity: function retrieveSignerPubkey() returns() +func (_Deposit *DepositTransactorSession) RetrieveSignerPubkey() (*types.Transaction, error) { + return _Deposit.Contract.RetrieveSignerPubkey(&_Deposit.TransactOpts) +} + +// TransferAndRequestRedemption is a paid mutator transaction binding the contract method 0xfb7c592a. +// +// Solidity: function transferAndRequestRedemption(bytes8 _outputValueBytes, bytes _redeemerOutputScript, address _finalRecipient) returns() +func (_Deposit *DepositTransactor) TransferAndRequestRedemption(opts *bind.TransactOpts, _outputValueBytes [8]byte, _redeemerOutputScript []byte, _finalRecipient common.Address) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "transferAndRequestRedemption", _outputValueBytes, _redeemerOutputScript, _finalRecipient) +} + +// TransferAndRequestRedemption is a paid mutator transaction binding the contract method 0xfb7c592a. +// +// Solidity: function transferAndRequestRedemption(bytes8 _outputValueBytes, bytes _redeemerOutputScript, address _finalRecipient) returns() +func (_Deposit *DepositSession) TransferAndRequestRedemption(_outputValueBytes [8]byte, _redeemerOutputScript []byte, _finalRecipient common.Address) (*types.Transaction, error) { + return _Deposit.Contract.TransferAndRequestRedemption(&_Deposit.TransactOpts, _outputValueBytes, _redeemerOutputScript, _finalRecipient) +} + +// TransferAndRequestRedemption is a paid mutator transaction binding the contract method 0xfb7c592a. +// +// Solidity: function transferAndRequestRedemption(bytes8 _outputValueBytes, bytes _redeemerOutputScript, address _finalRecipient) returns() +func (_Deposit *DepositTransactorSession) TransferAndRequestRedemption(_outputValueBytes [8]byte, _redeemerOutputScript []byte, _finalRecipient common.Address) (*types.Transaction, error) { + return _Deposit.Contract.TransferAndRequestRedemption(&_Deposit.TransactOpts, _outputValueBytes, _redeemerOutputScript, _finalRecipient) +} + +// WithdrawFunds is a paid mutator transaction binding the contract method 0x24600fc3. +// +// Solidity: function withdrawFunds() returns() +func (_Deposit *DepositTransactor) WithdrawFunds(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Deposit.contract.Transact(opts, "withdrawFunds") +} + +// WithdrawFunds is a paid mutator transaction binding the contract method 0x24600fc3. +// +// Solidity: function withdrawFunds() returns() +func (_Deposit *DepositSession) WithdrawFunds() (*types.Transaction, error) { + return _Deposit.Contract.WithdrawFunds(&_Deposit.TransactOpts) +} + +// WithdrawFunds is a paid mutator transaction binding the contract method 0x24600fc3. +// +// Solidity: function withdrawFunds() returns() +func (_Deposit *DepositTransactorSession) WithdrawFunds() (*types.Transaction, error) { + return _Deposit.Contract.WithdrawFunds(&_Deposit.TransactOpts) +} From ee50b2db728492c06fa6a6b1920d219466593f0b Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Thu, 15 Oct 2020 11:22:21 +0200 Subject: [PATCH 04/14] Bump up keep-common version --- bindings/go/go.mod | 2 +- bindings/go/go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bindings/go/go.mod b/bindings/go/go.mod index 23c7fa1fe..a16f9c913 100644 --- a/bindings/go/go.mod +++ b/bindings/go/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/ethereum/go-ethereum v1.9.10 github.com/ipfs/go-log v1.0.4 - github.com/keep-network/keep-common v1.2.0 + github.com/keep-network/keep-common v1.2.1-0.20201015091820-496b0c87d6f5 github.com/keep-network/keep-core v1.3.0 github.com/urfave/cli v1.22.1 ) diff --git a/bindings/go/go.sum b/bindings/go/go.sum index 75dc46c29..2e54fc3f5 100644 --- a/bindings/go/go.sum +++ b/bindings/go/go.sum @@ -331,6 +331,8 @@ github.com/keep-network/go-libp2p-bootstrap v0.0.0-20200423153828-ed815bc50aec h github.com/keep-network/go-libp2p-bootstrap v0.0.0-20200423153828-ed815bc50aec/go.mod h1:xR8jf3/VJAjh3nWu5tFe8Yxnt2HvWsqZHfGef1P5oDk= github.com/keep-network/keep-common v1.2.0 h1:hVd2tTd7vL+9CQP5Ntk5kjs+GYvkgrRNBcNvTuhHhVk= github.com/keep-network/keep-common v1.2.0/go.mod h1:emxogTbBdey7M3jOzfxZOdfn139kN2mI2b2wA6AHKKo= +github.com/keep-network/keep-common v1.2.1-0.20201015091820-496b0c87d6f5 h1:HCQv0+3IhaH1zvRQ2cAinKK+HJCASI41EpZuUMKD278= +github.com/keep-network/keep-common v1.2.1-0.20201015091820-496b0c87d6f5/go.mod h1:emxogTbBdey7M3jOzfxZOdfn139kN2mI2b2wA6AHKKo= github.com/keep-network/keep-core v1.3.0 h1:7Tb33EmO/ntHOEbOiYciRlBhqu5Ln6KemWCaYK0Z6LA= github.com/keep-network/keep-core v1.3.0/go.mod h1:1KsSSTQoN754TrFLW7kLy50pOG2CQ4BOfnJqdvEG7FA= github.com/keep-network/tbtc v1.1.0 h1:9ZCuBsrJYN1L1V7bAC98ZAtxv+ZIHcMhz6RJLAizLvY= From 7cd08974c8d2bbac8a6b1457c7b979d5d0cbe9f5 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Thu, 15 Oct 2020 11:24:16 +0200 Subject: [PATCH 05/14] Get rid of the `bindings` subdirectory --- {bindings/go => go}/Makefile | 0 {bindings/go => go}/abi/DepositLog.go | 0 {bindings/go => go}/abi/deposit/Deposit.go | 0 {bindings/go => go}/cmd/.keep | 0 {bindings/go => go}/cmd/Deposit.go | 0 {bindings/go => go}/cmd/DepositLog.go | 0 {bindings/go => go}/contract/.keep | 0 {bindings/go => go}/contract/Deposit.go | 0 {bindings/go => go}/contract/DepositLog.go | 0 {bindings/go => go}/gen.go | 0 {bindings/go => go}/generate.sh | 0 {bindings/go => go}/go.mod | 2 +- {bindings/go => go}/go.sum | 0 13 files changed, 1 insertion(+), 1 deletion(-) rename {bindings/go => go}/Makefile (100%) rename {bindings/go => go}/abi/DepositLog.go (100%) rename {bindings/go => go}/abi/deposit/Deposit.go (100%) rename {bindings/go => go}/cmd/.keep (100%) rename {bindings/go => go}/cmd/Deposit.go (100%) rename {bindings/go => go}/cmd/DepositLog.go (100%) rename {bindings/go => go}/contract/.keep (100%) rename {bindings/go => go}/contract/Deposit.go (100%) rename {bindings/go => go}/contract/DepositLog.go (100%) rename {bindings/go => go}/gen.go (100%) rename {bindings/go => go}/generate.sh (100%) rename {bindings/go => go}/go.mod (83%) rename {bindings/go => go}/go.sum (100%) diff --git a/bindings/go/Makefile b/go/Makefile similarity index 100% rename from bindings/go/Makefile rename to go/Makefile diff --git a/bindings/go/abi/DepositLog.go b/go/abi/DepositLog.go similarity index 100% rename from bindings/go/abi/DepositLog.go rename to go/abi/DepositLog.go diff --git a/bindings/go/abi/deposit/Deposit.go b/go/abi/deposit/Deposit.go similarity index 100% rename from bindings/go/abi/deposit/Deposit.go rename to go/abi/deposit/Deposit.go diff --git a/bindings/go/cmd/.keep b/go/cmd/.keep similarity index 100% rename from bindings/go/cmd/.keep rename to go/cmd/.keep diff --git a/bindings/go/cmd/Deposit.go b/go/cmd/Deposit.go similarity index 100% rename from bindings/go/cmd/Deposit.go rename to go/cmd/Deposit.go diff --git a/bindings/go/cmd/DepositLog.go b/go/cmd/DepositLog.go similarity index 100% rename from bindings/go/cmd/DepositLog.go rename to go/cmd/DepositLog.go diff --git a/bindings/go/contract/.keep b/go/contract/.keep similarity index 100% rename from bindings/go/contract/.keep rename to go/contract/.keep diff --git a/bindings/go/contract/Deposit.go b/go/contract/Deposit.go similarity index 100% rename from bindings/go/contract/Deposit.go rename to go/contract/Deposit.go diff --git a/bindings/go/contract/DepositLog.go b/go/contract/DepositLog.go similarity index 100% rename from bindings/go/contract/DepositLog.go rename to go/contract/DepositLog.go diff --git a/bindings/go/gen.go b/go/gen.go similarity index 100% rename from bindings/go/gen.go rename to go/gen.go diff --git a/bindings/go/generate.sh b/go/generate.sh similarity index 100% rename from bindings/go/generate.sh rename to go/generate.sh diff --git a/bindings/go/go.mod b/go/go.mod similarity index 83% rename from bindings/go/go.mod rename to go/go.mod index a16f9c913..7e54794fb 100644 --- a/bindings/go/go.mod +++ b/go/go.mod @@ -1,4 +1,4 @@ -module github.com/keep-network/tbtc/bindings/go +module github.com/keep-network/tbtc/go go 1.13 diff --git a/bindings/go/go.sum b/go/go.sum similarity index 100% rename from bindings/go/go.sum rename to go/go.sum From 5f6ed68d464e63e091254a7f22ab37937b3375d4 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Thu, 15 Oct 2020 11:28:34 +0200 Subject: [PATCH 06/14] Regenerate go bindings --- .gitignore | 2 +- go/cmd/Deposit.go | 364 ++++---- go/cmd/DepositLog.go | 118 +-- go/contract/Deposit.go | 1690 ++++++++++++++++++------------------- go/contract/DepositLog.go | 1108 ++++++++++++------------ go/generate.sh | 2 +- 6 files changed, 1642 insertions(+), 1642 deletions(-) diff --git a/.gitignore b/.gitignore index 97a0078f3..e87e4f831 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,7 @@ __pycache__/ node_modules/ artifacts/ .mypy_cache -bindings/go/abi/**/*.abi +go/abi/**/*.abi # Visual Studio Code *.code-workspace diff --git a/go/cmd/Deposit.go b/go/cmd/Deposit.go index 5764b857b..93499a71c 100644 --- a/go/cmd/Deposit.go +++ b/go/cmd/Deposit.go @@ -16,7 +16,7 @@ import ( "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" "github.com/keep-network/keep-common/pkg/cmd" "github.com/keep-network/keep-core/config" - "github.com/keep-network/tbtc/bindings/go/contract" + "github.com/keep-network/tbtc/go/contract" "github.com/urfave/cli" ) @@ -52,10 +52,10 @@ func init() { Usage: `Provides access to the Deposit contract.`, Description: depositDescription, Subcommands: []cli.Command{{ - Name: "remaining-term", - Usage: "Calls the constant method remainingTerm on the Deposit contract.", + Name: "collateralization-percentage", + Usage: "Calls the constant method collateralizationPercentage on the Deposit contract.", ArgsUsage: "", - Action: dRemainingTerm, + Action: dCollateralizationPercentage, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { @@ -66,17 +66,10 @@ func init() { Before: cmd.ArgCountChecker(1), Flags: cmd.ConstFlags, }, { - Name: "get-owner-redemption-tbtc-requirement", - Usage: "Calls the constant method getOwnerRedemptionTbtcRequirement on the Deposit contract.", - ArgsUsage: "[_redeemer] ", - Action: dGetOwnerRedemptionTbtcRequirement, - Before: cmd.ArgCountChecker(1), - Flags: cmd.ConstFlags, - }, { - Name: "keep-address", - Usage: "Calls the constant method keepAddress on the Deposit contract.", + Name: "in-active", + Usage: "Calls the constant method inActive on the Deposit contract.", ArgsUsage: "", - Action: dKeepAddress, + Action: dInActive, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { @@ -87,95 +80,102 @@ func init() { Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "collateralization-percentage", - Usage: "Calls the constant method collateralizationPercentage on the Deposit contract.", + Name: "funding-info", + Usage: "Calls the constant method fundingInfo on the Deposit contract.", ArgsUsage: "", - Action: dCollateralizationPercentage, + Action: dFundingInfo, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "lot-size-satoshis", - Usage: "Calls the constant method lotSizeSatoshis on the Deposit contract.", + Name: "remaining-term", + Usage: "Calls the constant method remainingTerm on the Deposit contract.", ArgsUsage: "", - Action: dLotSizeSatoshis, + Action: dRemainingTerm, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "lot-size-tbtc", - Usage: "Calls the constant method lotSizeTbtc on the Deposit contract.", + Name: "undercollateralized-threshold-percent", + Usage: "Calls the constant method undercollateralizedThresholdPercent on the Deposit contract.", ArgsUsage: "", - Action: dLotSizeTbtc, + Action: dUndercollateralizedThresholdPercent, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "severely-undercollateralized-threshold-percent", - Usage: "Calls the constant method severelyUndercollateralizedThresholdPercent on the Deposit contract.", + Name: "withdrawable-amount", + Usage: "Calls the constant method withdrawableAmount on the Deposit contract.", ArgsUsage: "", - Action: dSeverelyUndercollateralizedThresholdPercent, + Action: dWithdrawableAmount, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "undercollateralized-threshold-percent", - Usage: "Calls the constant method undercollateralizedThresholdPercent on the Deposit contract.", + Name: "signer-fee-tbtc", + Usage: "Calls the constant method signerFeeTbtc on the Deposit contract.", ArgsUsage: "", - Action: dUndercollateralizedThresholdPercent, + Action: dSignerFeeTbtc, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "withdrawable-amount", - Usage: "Calls the constant method withdrawableAmount on the Deposit contract.", + Name: "utxo-value", + Usage: "Calls the constant method utxoValue on the Deposit contract.", ArgsUsage: "", - Action: dWithdrawableAmount, + Action: dUtxoValue, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "current-state", - Usage: "Calls the constant method currentState on the Deposit contract.", + Name: "lot-size-satoshis", + Usage: "Calls the constant method lotSizeSatoshis on the Deposit contract.", ArgsUsage: "", - Action: dCurrentState, + Action: dLotSizeSatoshis, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "initial-collateralized-percent", - Usage: "Calls the constant method initialCollateralizedPercent on the Deposit contract.", + Name: "lot-size-tbtc", + Usage: "Calls the constant method lotSizeTbtc on the Deposit contract.", ArgsUsage: "", - Action: dInitialCollateralizedPercent, + Action: dLotSizeTbtc, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "signer-fee-tbtc", - Usage: "Calls the constant method signerFeeTbtc on the Deposit contract.", + Name: "get-owner-redemption-tbtc-requirement", + Usage: "Calls the constant method getOwnerRedemptionTbtcRequirement on the Deposit contract.", + ArgsUsage: "[_redeemer] ", + Action: dGetOwnerRedemptionTbtcRequirement, + Before: cmd.ArgCountChecker(1), + Flags: cmd.ConstFlags, + }, { + Name: "keep-address", + Usage: "Calls the constant method keepAddress on the Deposit contract.", ArgsUsage: "", - Action: dSignerFeeTbtc, + Action: dKeepAddress, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "funding-info", - Usage: "Calls the constant method fundingInfo on the Deposit contract.", + Name: "current-state", + Usage: "Calls the constant method currentState on the Deposit contract.", ArgsUsage: "", - Action: dFundingInfo, + Action: dCurrentState, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "in-active", - Usage: "Calls the constant method inActive on the Deposit contract.", + Name: "initial-collateralized-percent", + Usage: "Calls the constant method initialCollateralizedPercent on the Deposit contract.", ArgsUsage: "", - Action: dInActive, + Action: dInitialCollateralizedPercent, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "utxo-value", - Usage: "Calls the constant method utxoValue on the Deposit contract.", + Name: "severely-undercollateralized-threshold-percent", + Usage: "Calls the constant method severelyUndercollateralizedThresholdPercent on the Deposit contract.", ArgsUsage: "", - Action: dUtxoValue, + Action: dSeverelyUndercollateralizedThresholdPercent, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "notify-redemption-proof-timed-out", - Usage: "Calls the method notifyRedemptionProofTimedOut on the Deposit contract.", - ArgsUsage: "", - Action: dNotifyRedemptionProofTimedOut, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Name: "initialize", + Usage: "Calls the method initialize on the Deposit contract.", + ArgsUsage: "[_factory] ", + Action: dInitialize, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), Flags: cmd.NonConstFlags, }, { Name: "notify-redemption-signature-timed-out", @@ -185,31 +185,24 @@ func init() { Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "notify-undercollateralized-liquidation", - Usage: "Calls the method notifyUndercollateralizedLiquidation on the Deposit contract.", + Name: "purchase-signer-bonds-at-auction", + Usage: "Calls the method purchaseSignerBondsAtAuction on the Deposit contract.", ArgsUsage: "", - Action: dNotifyUndercollateralizedLiquidation, + Action: dPurchaseSignerBondsAtAuction, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "initialize", - Usage: "Calls the method initialize on the Deposit contract.", - ArgsUsage: "[_factory] ", - Action: dInitialize, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), - Flags: cmd.NonConstFlags, - }, { - Name: "notify-courtesy-call", - Usage: "Calls the method notifyCourtesyCall on the Deposit contract.", + Name: "exit-courtesy-call", + Usage: "Calls the method exitCourtesyCall on the Deposit contract.", ArgsUsage: "", - Action: dNotifyCourtesyCall, + Action: dExitCourtesyCall, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "notify-courtesy-call-expired", - Usage: "Calls the method notifyCourtesyCallExpired on the Deposit contract.", + Name: "notify-redemption-proof-timed-out", + Usage: "Calls the method notifyRedemptionProofTimedOut on the Deposit contract.", ArgsUsage: "", - Action: dNotifyCourtesyCallExpired, + Action: dNotifyRedemptionProofTimedOut, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { @@ -219,13 +212,6 @@ func init() { Action: dNotifySignerSetupFailed, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, - }, { - Name: "retrieve-signer-pubkey", - Usage: "Calls the method retrieveSignerPubkey on the Deposit contract.", - ArgsUsage: "", - Action: dRetrieveSignerPubkey, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, }, { Name: "request-funder-abort", Usage: "Calls the method requestFunderAbort on the Deposit contract.", @@ -233,6 +219,20 @@ func init() { Action: dRequestFunderAbort, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), Flags: cmd.NonConstFlags, + }, { + Name: "withdraw-funds", + Usage: "Calls the method withdrawFunds on the Deposit contract.", + ArgsUsage: "", + Action: dWithdrawFunds, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "notify-courtesy-call-expired", + Usage: "Calls the method notifyCourtesyCallExpired on the Deposit contract.", + ArgsUsage: "", + Action: dNotifyCourtesyCallExpired, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, }, { Name: "notify-funding-timed-out", Usage: "Calls the method notifyFundingTimedOut on the Deposit contract.", @@ -241,24 +241,24 @@ func init() { Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "purchase-signer-bonds-at-auction", - Usage: "Calls the method purchaseSignerBondsAtAuction on the Deposit contract.", + Name: "notify-courtesy-call", + Usage: "Calls the method notifyCourtesyCall on the Deposit contract.", ArgsUsage: "", - Action: dPurchaseSignerBondsAtAuction, + Action: dNotifyCourtesyCall, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "withdraw-funds", - Usage: "Calls the method withdrawFunds on the Deposit contract.", + Name: "notify-undercollateralized-liquidation", + Usage: "Calls the method notifyUndercollateralizedLiquidation on the Deposit contract.", ArgsUsage: "", - Action: dWithdrawFunds, + Action: dNotifyUndercollateralizedLiquidation, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "exit-courtesy-call", - Usage: "Calls the method exitCourtesyCall on the Deposit contract.", + Name: "retrieve-signer-pubkey", + Usage: "Calls the method retrieveSignerPubkey on the Deposit contract.", ArgsUsage: "", - Action: dExitCourtesyCall, + Action: dRetrieveSignerPubkey, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }}, @@ -267,13 +267,13 @@ func init() { /// ------------------- Const methods ------------------- -func dRemainingTerm(c *cli.Context) error { +func dCollateralizationPercentage(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.RemainingTermAtBlock( + result, err := contract.CollateralizationPercentageAtBlock( cmd.BlockFlagValue.Uint, ) @@ -315,21 +315,13 @@ func dGetRedemptionTbtcRequirement(c *cli.Context) error { return nil } -func dGetOwnerRedemptionTbtcRequirement(c *cli.Context) error { +func dInActive(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - _redeemer, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _redeemer, a address, from passed value %v", - c.Args()[0], - ) - } - result, err := contract.GetOwnerRedemptionTbtcRequirementAtBlock( - _redeemer, + result, err := contract.InActiveAtBlock( cmd.BlockFlagValue.Uint, ) @@ -343,13 +335,13 @@ func dGetOwnerRedemptionTbtcRequirement(c *cli.Context) error { return nil } -func dKeepAddress(c *cli.Context) error { +func dAuctionValue(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.KeepAddressAtBlock( + result, err := contract.AuctionValueAtBlock( cmd.BlockFlagValue.Uint, ) @@ -363,13 +355,13 @@ func dKeepAddress(c *cli.Context) error { return nil } -func dAuctionValue(c *cli.Context) error { +func dFundingInfo(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.AuctionValueAtBlock( + result, err := contract.FundingInfoAtBlock( cmd.BlockFlagValue.Uint, ) @@ -383,13 +375,13 @@ func dAuctionValue(c *cli.Context) error { return nil } -func dCollateralizationPercentage(c *cli.Context) error { +func dRemainingTerm(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.CollateralizationPercentageAtBlock( + result, err := contract.RemainingTermAtBlock( cmd.BlockFlagValue.Uint, ) @@ -403,13 +395,13 @@ func dCollateralizationPercentage(c *cli.Context) error { return nil } -func dLotSizeSatoshis(c *cli.Context) error { +func dUndercollateralizedThresholdPercent(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.LotSizeSatoshisAtBlock( + result, err := contract.UndercollateralizedThresholdPercentAtBlock( cmd.BlockFlagValue.Uint, ) @@ -423,13 +415,13 @@ func dLotSizeSatoshis(c *cli.Context) error { return nil } -func dLotSizeTbtc(c *cli.Context) error { +func dWithdrawableAmount(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.LotSizeTbtcAtBlock( + result, err := contract.WithdrawableAmountAtBlock( cmd.BlockFlagValue.Uint, ) @@ -443,13 +435,13 @@ func dLotSizeTbtc(c *cli.Context) error { return nil } -func dSeverelyUndercollateralizedThresholdPercent(c *cli.Context) error { +func dSignerFeeTbtc(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.SeverelyUndercollateralizedThresholdPercentAtBlock( + result, err := contract.SignerFeeTbtcAtBlock( cmd.BlockFlagValue.Uint, ) @@ -463,13 +455,13 @@ func dSeverelyUndercollateralizedThresholdPercent(c *cli.Context) error { return nil } -func dUndercollateralizedThresholdPercent(c *cli.Context) error { +func dUtxoValue(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.UndercollateralizedThresholdPercentAtBlock( + result, err := contract.UtxoValueAtBlock( cmd.BlockFlagValue.Uint, ) @@ -483,13 +475,13 @@ func dUndercollateralizedThresholdPercent(c *cli.Context) error { return nil } -func dWithdrawableAmount(c *cli.Context) error { +func dLotSizeSatoshis(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.WithdrawableAmountAtBlock( + result, err := contract.LotSizeSatoshisAtBlock( cmd.BlockFlagValue.Uint, ) @@ -503,13 +495,13 @@ func dWithdrawableAmount(c *cli.Context) error { return nil } -func dCurrentState(c *cli.Context) error { +func dLotSizeTbtc(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.CurrentStateAtBlock( + result, err := contract.LotSizeTbtcAtBlock( cmd.BlockFlagValue.Uint, ) @@ -523,13 +515,21 @@ func dCurrentState(c *cli.Context) error { return nil } -func dInitialCollateralizedPercent(c *cli.Context) error { +func dGetOwnerRedemptionTbtcRequirement(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } + _redeemer, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _redeemer, a address, from passed value %v", + c.Args()[0], + ) + } - result, err := contract.InitialCollateralizedPercentAtBlock( + result, err := contract.GetOwnerRedemptionTbtcRequirementAtBlock( + _redeemer, cmd.BlockFlagValue.Uint, ) @@ -543,13 +543,13 @@ func dInitialCollateralizedPercent(c *cli.Context) error { return nil } -func dSignerFeeTbtc(c *cli.Context) error { +func dKeepAddress(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.SignerFeeTbtcAtBlock( + result, err := contract.KeepAddressAtBlock( cmd.BlockFlagValue.Uint, ) @@ -563,13 +563,13 @@ func dSignerFeeTbtc(c *cli.Context) error { return nil } -func dFundingInfo(c *cli.Context) error { +func dCurrentState(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.FundingInfoAtBlock( + result, err := contract.CurrentStateAtBlock( cmd.BlockFlagValue.Uint, ) @@ -583,13 +583,13 @@ func dFundingInfo(c *cli.Context) error { return nil } -func dInActive(c *cli.Context) error { +func dInitialCollateralizedPercent(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.InActiveAtBlock( + result, err := contract.InitialCollateralizedPercentAtBlock( cmd.BlockFlagValue.Uint, ) @@ -603,13 +603,13 @@ func dInActive(c *cli.Context) error { return nil } -func dUtxoValue(c *cli.Context) error { +func dSeverelyUndercollateralizedThresholdPercent(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.UtxoValueAtBlock( + result, err := contract.SeverelyUndercollateralizedThresholdPercentAtBlock( cmd.BlockFlagValue.Uint, ) @@ -625,19 +625,29 @@ func dUtxoValue(c *cli.Context) error { /// ------------------- Non-const methods ------------------- -func dNotifyRedemptionProofTimedOut(c *cli.Context) error { +func dInitialize(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } + _factory, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _factory, a address, from passed value %v", + c.Args()[0], + ) + } + var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyRedemptionProofTimedOut() + transaction, err = contract.Initialize( + _factory, + ) if err != nil { return err } @@ -645,7 +655,8 @@ func dNotifyRedemptionProofTimedOut(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyRedemptionProofTimedOut( + err = contract.CallInitialize( + _factory, cmd.BlockFlagValue.Uint, ) if err != nil { @@ -691,7 +702,7 @@ func dNotifyRedemptionSignatureTimedOut(c *cli.Context) error { return nil } -func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { +func dPurchaseSignerBondsAtAuction(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -703,7 +714,7 @@ func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyUndercollateralizedLiquidation() + transaction, err = contract.PurchaseSignerBondsAtAuction() if err != nil { return err } @@ -711,7 +722,7 @@ func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyUndercollateralizedLiquidation( + err = contract.CallPurchaseSignerBondsAtAuction( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -724,29 +735,19 @@ func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { return nil } -func dInitialize(c *cli.Context) error { +func dExitCourtesyCall(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - _factory, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _factory, a address, from passed value %v", - c.Args()[0], - ) - } - var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.Initialize( - _factory, - ) + transaction, err = contract.ExitCourtesyCall() if err != nil { return err } @@ -754,8 +755,7 @@ func dInitialize(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallInitialize( - _factory, + err = contract.CallExitCourtesyCall( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -768,7 +768,7 @@ func dInitialize(c *cli.Context) error { return nil } -func dNotifyCourtesyCall(c *cli.Context) error { +func dNotifyRedemptionProofTimedOut(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -780,7 +780,7 @@ func dNotifyCourtesyCall(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyCourtesyCall() + transaction, err = contract.NotifyRedemptionProofTimedOut() if err != nil { return err } @@ -788,7 +788,7 @@ func dNotifyCourtesyCall(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyCourtesyCall( + err = contract.CallNotifyRedemptionProofTimedOut( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -801,7 +801,7 @@ func dNotifyCourtesyCall(c *cli.Context) error { return nil } -func dNotifyCourtesyCallExpired(c *cli.Context) error { +func dNotifySignerSetupFailed(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -813,7 +813,7 @@ func dNotifyCourtesyCallExpired(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyCourtesyCallExpired() + transaction, err = contract.NotifySignerSetupFailed() if err != nil { return err } @@ -821,7 +821,7 @@ func dNotifyCourtesyCallExpired(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyCourtesyCallExpired( + err = contract.CallNotifySignerSetupFailed( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -834,19 +834,29 @@ func dNotifyCourtesyCallExpired(c *cli.Context) error { return nil } -func dNotifySignerSetupFailed(c *cli.Context) error { +func dRequestFunderAbort(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } + _abortOutputScript, err := hexutil.Decode(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _abortOutputScript, a bytes, from passed value %v", + c.Args()[0], + ) + } + var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifySignerSetupFailed() + transaction, err = contract.RequestFunderAbort( + _abortOutputScript, + ) if err != nil { return err } @@ -854,7 +864,8 @@ func dNotifySignerSetupFailed(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifySignerSetupFailed( + err = contract.CallRequestFunderAbort( + _abortOutputScript, cmd.BlockFlagValue.Uint, ) if err != nil { @@ -867,7 +878,7 @@ func dNotifySignerSetupFailed(c *cli.Context) error { return nil } -func dRetrieveSignerPubkey(c *cli.Context) error { +func dWithdrawFunds(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -879,7 +890,7 @@ func dRetrieveSignerPubkey(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.RetrieveSignerPubkey() + transaction, err = contract.WithdrawFunds() if err != nil { return err } @@ -887,7 +898,7 @@ func dRetrieveSignerPubkey(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallRetrieveSignerPubkey( + err = contract.CallWithdrawFunds( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -900,29 +911,19 @@ func dRetrieveSignerPubkey(c *cli.Context) error { return nil } -func dRequestFunderAbort(c *cli.Context) error { +func dNotifyCourtesyCallExpired(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - _abortOutputScript, err := hexutil.Decode(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _abortOutputScript, a bytes, from passed value %v", - c.Args()[0], - ) - } - var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.RequestFunderAbort( - _abortOutputScript, - ) + transaction, err = contract.NotifyCourtesyCallExpired() if err != nil { return err } @@ -930,8 +931,7 @@ func dRequestFunderAbort(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallRequestFunderAbort( - _abortOutputScript, + err = contract.CallNotifyCourtesyCallExpired( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -977,7 +977,7 @@ func dNotifyFundingTimedOut(c *cli.Context) error { return nil } -func dPurchaseSignerBondsAtAuction(c *cli.Context) error { +func dNotifyCourtesyCall(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -989,7 +989,7 @@ func dPurchaseSignerBondsAtAuction(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.PurchaseSignerBondsAtAuction() + transaction, err = contract.NotifyCourtesyCall() if err != nil { return err } @@ -997,7 +997,7 @@ func dPurchaseSignerBondsAtAuction(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallPurchaseSignerBondsAtAuction( + err = contract.CallNotifyCourtesyCall( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1010,7 +1010,7 @@ func dPurchaseSignerBondsAtAuction(c *cli.Context) error { return nil } -func dWithdrawFunds(c *cli.Context) error { +func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -1022,7 +1022,7 @@ func dWithdrawFunds(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.WithdrawFunds() + transaction, err = contract.NotifyUndercollateralizedLiquidation() if err != nil { return err } @@ -1030,7 +1030,7 @@ func dWithdrawFunds(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallWithdrawFunds( + err = contract.CallNotifyUndercollateralizedLiquidation( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1043,7 +1043,7 @@ func dWithdrawFunds(c *cli.Context) error { return nil } -func dExitCourtesyCall(c *cli.Context) error { +func dRetrieveSignerPubkey(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -1055,7 +1055,7 @@ func dExitCourtesyCall(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.ExitCourtesyCall() + transaction, err = contract.RetrieveSignerPubkey() if err != nil { return err } @@ -1063,7 +1063,7 @@ func dExitCourtesyCall(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallExitCourtesyCall( + err = contract.CallRetrieveSignerPubkey( cmd.BlockFlagValue.Uint, ) if err != nil { diff --git a/go/cmd/DepositLog.go b/go/cmd/DepositLog.go index e27655fe4..dcfb72587 100644 --- a/go/cmd/DepositLog.go +++ b/go/cmd/DepositLog.go @@ -16,7 +16,7 @@ import ( "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" "github.com/keep-network/keep-common/pkg/cmd" "github.com/keep-network/keep-core/config" - "github.com/keep-network/tbtc/bindings/go/contract" + "github.com/keep-network/tbtc/go/contract" "github.com/urfave/cli" ) @@ -59,17 +59,10 @@ func init() { Before: cmd.ArgCountChecker(1), Flags: cmd.ConstFlags, }, { - Name: "log-funder-requested-abort", - Usage: "Calls the method logFunderRequestedAbort on the DepositLog contract.", - ArgsUsage: "[_abortOutputScript] ", - Action: dlLogFunderRequestedAbort, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), - Flags: cmd.NonConstFlags, - }, { - Name: "log-liquidated", - Usage: "Calls the method logLiquidated on the DepositLog contract.", + Name: "log-courtesy-called", + Usage: "Calls the method logCourtesyCalled on the DepositLog contract.", ArgsUsage: "", - Action: dlLogLiquidated, + Action: dlLogCourtesyCalled, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { @@ -86,6 +79,13 @@ func init() { Action: dlLogCreated, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), Flags: cmd.NonConstFlags, + }, { + Name: "log-fraud-during-setup", + Usage: "Calls the method logFraudDuringSetup on the DepositLog contract.", + ArgsUsage: "", + Action: dlLogFraudDuringSetup, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, }, { Name: "log-setup-failed", Usage: "Calls the method logSetupFailed on the DepositLog contract.", @@ -94,17 +94,17 @@ func init() { Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "log-fraud-during-setup", - Usage: "Calls the method logFraudDuringSetup on the DepositLog contract.", - ArgsUsage: "", - Action: dlLogFraudDuringSetup, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Name: "log-funder-requested-abort", + Usage: "Calls the method logFunderRequestedAbort on the DepositLog contract.", + ArgsUsage: "[_abortOutputScript] ", + Action: dlLogFunderRequestedAbort, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), Flags: cmd.NonConstFlags, }, { - Name: "log-courtesy-called", - Usage: "Calls the method logCourtesyCalled on the DepositLog contract.", + Name: "log-liquidated", + Usage: "Calls the method logLiquidated on the DepositLog contract.", ArgsUsage: "", - Action: dlLogCourtesyCalled, + Action: dlLogLiquidated, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }}, @@ -143,29 +143,19 @@ func dlApprovedToLog(c *cli.Context) error { /// ------------------- Non-const methods ------------------- -func dlLogFunderRequestedAbort(c *cli.Context) error { +func dlLogCourtesyCalled(c *cli.Context) error { contract, err := initializeDepositLog(c) if err != nil { return err } - _abortOutputScript, err := hexutil.Decode(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _abortOutputScript, a bytes, from passed value %v", - c.Args()[0], - ) - } - var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogFunderRequestedAbort( - _abortOutputScript, - ) + transaction, err = contract.LogCourtesyCalled() if err != nil { return err } @@ -173,8 +163,7 @@ func dlLogFunderRequestedAbort(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogFunderRequestedAbort( - _abortOutputScript, + err = contract.CallLogCourtesyCalled( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -187,7 +176,7 @@ func dlLogFunderRequestedAbort(c *cli.Context) error { return nil } -func dlLogLiquidated(c *cli.Context) error { +func dlLogExitedCourtesyCall(c *cli.Context) error { contract, err := initializeDepositLog(c) if err != nil { return err @@ -199,7 +188,7 @@ func dlLogLiquidated(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogLiquidated() + transaction, err = contract.LogExitedCourtesyCall() if err != nil { return err } @@ -207,7 +196,7 @@ func dlLogLiquidated(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogLiquidated( + err = contract.CallLogExitedCourtesyCall( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -220,19 +209,29 @@ func dlLogLiquidated(c *cli.Context) error { return nil } -func dlLogExitedCourtesyCall(c *cli.Context) error { +func dlLogCreated(c *cli.Context) error { contract, err := initializeDepositLog(c) if err != nil { return err } + _keepAddress, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _keepAddress, a address, from passed value %v", + c.Args()[0], + ) + } + var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogExitedCourtesyCall() + transaction, err = contract.LogCreated( + _keepAddress, + ) if err != nil { return err } @@ -240,7 +239,8 @@ func dlLogExitedCourtesyCall(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogExitedCourtesyCall( + err = contract.CallLogCreated( + _keepAddress, cmd.BlockFlagValue.Uint, ) if err != nil { @@ -253,29 +253,19 @@ func dlLogExitedCourtesyCall(c *cli.Context) error { return nil } -func dlLogCreated(c *cli.Context) error { +func dlLogFraudDuringSetup(c *cli.Context) error { contract, err := initializeDepositLog(c) if err != nil { return err } - _keepAddress, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _keepAddress, a address, from passed value %v", - c.Args()[0], - ) - } - var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogCreated( - _keepAddress, - ) + transaction, err = contract.LogFraudDuringSetup() if err != nil { return err } @@ -283,8 +273,7 @@ func dlLogCreated(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogCreated( - _keepAddress, + err = contract.CallLogFraudDuringSetup( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -330,19 +319,29 @@ func dlLogSetupFailed(c *cli.Context) error { return nil } -func dlLogFraudDuringSetup(c *cli.Context) error { +func dlLogFunderRequestedAbort(c *cli.Context) error { contract, err := initializeDepositLog(c) if err != nil { return err } + _abortOutputScript, err := hexutil.Decode(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _abortOutputScript, a bytes, from passed value %v", + c.Args()[0], + ) + } + var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogFraudDuringSetup() + transaction, err = contract.LogFunderRequestedAbort( + _abortOutputScript, + ) if err != nil { return err } @@ -350,7 +349,8 @@ func dlLogFraudDuringSetup(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogFraudDuringSetup( + err = contract.CallLogFunderRequestedAbort( + _abortOutputScript, cmd.BlockFlagValue.Uint, ) if err != nil { @@ -363,7 +363,7 @@ func dlLogFraudDuringSetup(c *cli.Context) error { return nil } -func dlLogCourtesyCalled(c *cli.Context) error { +func dlLogLiquidated(c *cli.Context) error { contract, err := initializeDepositLog(c) if err != nil { return err @@ -375,7 +375,7 @@ func dlLogCourtesyCalled(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogCourtesyCalled() + transaction, err = contract.LogLiquidated() if err != nil { return err } @@ -383,7 +383,7 @@ func dlLogCourtesyCalled(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogCourtesyCalled( + err = contract.CallLogLiquidated( cmd.BlockFlagValue.Uint, ) if err != nil { diff --git a/go/contract/Deposit.go b/go/contract/Deposit.go index 1c438e0e2..dee497bb0 100644 --- a/go/contract/Deposit.go +++ b/go/contract/Deposit.go @@ -18,7 +18,7 @@ import ( "github.com/ipfs/go-log" "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" - abi "github.com/keep-network/tbtc/bindings/go/abi/deposit" + abi "github.com/keep-network/tbtc/go/abi/deposit" ) // Create a package-level logger for this contract. The logger exists at @@ -92,12 +92,17 @@ func NewDeposit( // ----- Non-const Methods ------ // Transaction submission. -func (d *Deposit) NotifyRedemptionProofTimedOut( +func (d *Deposit) Initialize( + _factory common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyRedemptionProofTimedOut", + "submitting transaction initialize", + "params: ", + fmt.Sprint( + _factory, + ), ) d.transactionMutex.Lock() @@ -122,20 +127,22 @@ func (d *Deposit) NotifyRedemptionProofTimedOut( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyRedemptionProofTimedOut( + transaction, err := d.contract.Initialize( transactorOptions, + _factory, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyRedemptionProofTimedOut", + "initialize", + _factory, ) } dLogger.Infof( - "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", + "submitted transaction initialize with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -146,20 +153,22 @@ func (d *Deposit) NotifyRedemptionProofTimedOut( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyRedemptionProofTimedOut( + transaction, err := d.contract.Initialize( transactorOptions, + _factory, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyRedemptionProofTimedOut", + "initialize", + _factory, ) } dLogger.Infof( - "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", + "submitted transaction initialize with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -174,7 +183,8 @@ func (d *Deposit) NotifyRedemptionProofTimedOut( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyRedemptionProofTimedOut( +func (d *Deposit) CallInitialize( + _factory common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -186,34 +196,55 @@ func (d *Deposit) CallNotifyRedemptionProofTimedOut( d.caller, d.errorResolver, d.contractAddress, - "notifyRedemptionProofTimedOut", + "initialize", &result, + _factory, ) return err } -func (d *Deposit) NotifyRedemptionProofTimedOutGasEstimate() (uint64, error) { +func (d *Deposit) InitializeGasEstimate( + _factory common.Address, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyRedemptionProofTimedOut", + "initialize", d.contractABI, d.transactor, + _factory, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyRedemptionSignatureTimedOut( +func (d *Deposit) InitializeDeposit( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, + value *big.Int, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyRedemptionSignatureTimedOut", + "submitting transaction initializeDeposit", + "params: ", + fmt.Sprint( + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, + ), + "value: ", value, ) d.transactionMutex.Lock() @@ -223,6 +254,8 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( transactorOptions := new(bind.TransactOpts) *transactorOptions = *d.transactorOptions + transactorOptions.Value = value + if len(transactionOptions) > 1 { return nil, fmt.Errorf( "could not process multiple transaction options sets", @@ -238,20 +271,32 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( + transaction, err := d.contract.InitializeDeposit( transactorOptions, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, - nil, - "notifyRedemptionSignatureTimedOut", + value, + "initializeDeposit", + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) } dLogger.Infof( - "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", + "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -262,20 +307,32 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( + transaction, err := d.contract.InitializeDeposit( transactorOptions, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, - nil, - "notifyRedemptionSignatureTimedOut", + value, + "initializeDeposit", + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) } dLogger.Infof( - "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", + "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -290,46 +347,72 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyRedemptionSignatureTimedOut( +func (d *Deposit) CallInitializeDeposit( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, + value *big.Int, blockNumber *big.Int, ) error { var result interface{} = nil err := ethutil.CallAtBlock( d.transactorOptions.From, - blockNumber, nil, + blockNumber, value, d.contractABI, d.caller, d.errorResolver, d.contractAddress, - "notifyRedemptionSignatureTimedOut", + "initializeDeposit", &result, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) return err } -func (d *Deposit) NotifyRedemptionSignatureTimedOutGasEstimate() (uint64, error) { +func (d *Deposit) InitializeDepositGasEstimate( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyRedemptionSignatureTimedOut", + "initializeDeposit", d.contractABI, d.transactor, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyUndercollateralizedLiquidation( +func (d *Deposit) NotifyRedemptionSignatureTimedOut( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyUndercollateralizedLiquidation", + "submitting transaction notifyRedemptionSignatureTimedOut", ) d.transactionMutex.Lock() @@ -354,7 +437,7 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyUndercollateralizedLiquidation( + transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( transactorOptions, ) if err != nil { @@ -362,12 +445,12 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( err, d.transactorOptions.From, nil, - "notifyUndercollateralizedLiquidation", + "notifyRedemptionSignatureTimedOut", ) } dLogger.Infof( - "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -378,7 +461,7 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyUndercollateralizedLiquidation( + transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( transactorOptions, ) if err != nil { @@ -386,12 +469,12 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( err, d.transactorOptions.From, nil, - "notifyUndercollateralizedLiquidation", + "notifyRedemptionSignatureTimedOut", ) } dLogger.Infof( - "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -406,7 +489,7 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyUndercollateralizedLiquidation( +func (d *Deposit) CallNotifyRedemptionSignatureTimedOut( blockNumber *big.Int, ) error { var result interface{} = nil @@ -418,20 +501,20 @@ func (d *Deposit) CallNotifyUndercollateralizedLiquidation( d.caller, d.errorResolver, d.contractAddress, - "notifyUndercollateralizedLiquidation", + "notifyRedemptionSignatureTimedOut", &result, ) return err } -func (d *Deposit) NotifyUndercollateralizedLiquidationGasEstimate() (uint64, error) { +func (d *Deposit) NotifyRedemptionSignatureTimedOutGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyUndercollateralizedLiquidation", + "notifyRedemptionSignatureTimedOut", d.contractABI, d.transactor, ) @@ -440,30 +523,24 @@ func (d *Deposit) NotifyUndercollateralizedLiquidationGasEstimate() (uint64, err } // Transaction submission. -func (d *Deposit) ProvideBTCFundingProof( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _fundingOutputIndex uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) ProvideECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideBTCFundingProof", + "submitting transaction provideECDSAFraudProof", "params: ", fmt.Sprint( - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _v, + _r, + _s, + _signedDigest, + _preimage, ), ) @@ -489,36 +566,30 @@ func (d *Deposit) ProvideBTCFundingProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideBTCFundingProof( + transaction, err := d.contract.ProvideECDSAFraudProof( transactorOptions, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _v, + _r, + _s, + _signedDigest, + _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideBTCFundingProof", - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + "provideECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, ) } dLogger.Infof( - "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", + "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -529,36 +600,30 @@ func (d *Deposit) ProvideBTCFundingProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideBTCFundingProof( + transaction, err := d.contract.ProvideECDSAFraudProof( transactorOptions, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _v, + _r, + _s, + _signedDigest, + _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideBTCFundingProof", - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + "provideECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, ) } dLogger.Infof( - "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", + "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -573,15 +638,12 @@ func (d *Deposit) ProvideBTCFundingProof( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideBTCFundingProof( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _fundingOutputIndex uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) CallProvideECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -593,63 +655,66 @@ func (d *Deposit) CallProvideBTCFundingProof( d.caller, d.errorResolver, d.contractAddress, - "provideBTCFundingProof", + "provideECDSAFraudProof", &result, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _v, + _r, + _s, + _signedDigest, + _preimage, ) return err } -func (d *Deposit) ProvideBTCFundingProofGasEstimate( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _fundingOutputIndex uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) ProvideECDSAFraudProofGasEstimate( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideBTCFundingProof", + "provideECDSAFraudProof", d.contractABI, d.transactor, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _v, + _r, + _s, + _signedDigest, + _preimage, ) return result, err } // Transaction submission. -func (d *Deposit) Initialize( - _factory common.Address, +func (d *Deposit) ProvideRedemptionProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction initialize", + "submitting transaction provideRedemptionProof", "params: ", fmt.Sprint( - _factory, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ), ) @@ -675,22 +740,34 @@ func (d *Deposit) Initialize( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.Initialize( + transaction, err := d.contract.ProvideRedemptionProof( transactorOptions, - _factory, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "initialize", - _factory, + "provideRedemptionProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) } dLogger.Infof( - "submitted transaction initialize with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -701,22 +778,34 @@ func (d *Deposit) Initialize( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.Initialize( + transaction, err := d.contract.ProvideRedemptionProof( transactorOptions, - _factory, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "initialize", - _factory, + "provideRedemptionProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) } dLogger.Infof( - "submitted transaction initialize with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -731,8 +820,14 @@ func (d *Deposit) Initialize( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallInitialize( - _factory common.Address, +func (d *Deposit) CallProvideRedemptionProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -744,38 +839,65 @@ func (d *Deposit) CallInitialize( d.caller, d.errorResolver, d.contractAddress, - "initialize", + "provideRedemptionProof", &result, - _factory, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) return err } -func (d *Deposit) InitializeGasEstimate( - _factory common.Address, +func (d *Deposit) ProvideRedemptionProofGasEstimate( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "initialize", + "provideRedemptionProof", d.contractABI, d.transactor, - _factory, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyCourtesyCall( +func (d *Deposit) ProvideRedemptionSignature( + _v uint8, + _r [32]uint8, + _s [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyCourtesyCall", + "submitting transaction provideRedemptionSignature", + "params: ", + fmt.Sprint( + _v, + _r, + _s, + ), ) d.transactionMutex.Lock() @@ -800,20 +922,26 @@ func (d *Deposit) NotifyCourtesyCall( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyCourtesyCall( + transaction, err := d.contract.ProvideRedemptionSignature( transactorOptions, + _v, + _r, + _s, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyCourtesyCall", + "provideRedemptionSignature", + _v, + _r, + _s, ) } dLogger.Infof( - "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -824,20 +952,26 @@ func (d *Deposit) NotifyCourtesyCall( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyCourtesyCall( + transaction, err := d.contract.ProvideRedemptionSignature( transactorOptions, + _v, + _r, + _s, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyCourtesyCall", + "provideRedemptionSignature", + _v, + _r, + _s, ) } dLogger.Infof( - "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -852,7 +986,10 @@ func (d *Deposit) NotifyCourtesyCall( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyCourtesyCall( +func (d *Deposit) CallProvideRedemptionSignature( + _v uint8, + _r [32]uint8, + _s [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -864,51 +1001,57 @@ func (d *Deposit) CallNotifyCourtesyCall( d.caller, d.errorResolver, d.contractAddress, - "notifyCourtesyCall", + "provideRedemptionSignature", &result, + _v, + _r, + _s, ) return err } -func (d *Deposit) NotifyCourtesyCallGasEstimate() (uint64, error) { +func (d *Deposit) ProvideRedemptionSignatureGasEstimate( + _v uint8, + _r [32]uint8, + _s [32]uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyCourtesyCall", + "provideRedemptionSignature", d.contractABI, d.transactor, + _v, + _r, + _s, ) return result, err } // Transaction submission. -func (d *Deposit) InitializeDeposit( - _tbtcSystem common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachineAddress common.Address, - _lotSizeSatoshis uint64, - value *big.Int, +func (d *Deposit) ProvideFundingECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction initializeDeposit", + "submitting transaction provideFundingECDSAFraudProof", "params: ", fmt.Sprint( - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, + _v, + _r, + _s, + _signedDigest, + _preimage, ), - "value: ", value, ) d.transactionMutex.Lock() @@ -918,8 +1061,6 @@ func (d *Deposit) InitializeDeposit( transactorOptions := new(bind.TransactOpts) *transactorOptions = *d.transactorOptions - transactorOptions.Value = value - if len(transactionOptions) > 1 { return nil, fmt.Errorf( "could not process multiple transaction options sets", @@ -935,32 +1076,30 @@ func (d *Deposit) InitializeDeposit( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.InitializeDeposit( + transaction, err := d.contract.ProvideFundingECDSAFraudProof( transactorOptions, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, + _v, + _r, + _s, + _signedDigest, + _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, - value, - "initializeDeposit", - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, + nil, + "provideFundingECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, ) } dLogger.Infof( - "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", + "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -971,32 +1110,30 @@ func (d *Deposit) InitializeDeposit( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.InitializeDeposit( + transaction, err := d.contract.ProvideFundingECDSAFraudProof( transactorOptions, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, + _v, + _r, + _s, + _signedDigest, + _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, - value, - "initializeDeposit", - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, + nil, + "provideFundingECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, ) } dLogger.Infof( - "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", + "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1011,72 +1148,67 @@ func (d *Deposit) InitializeDeposit( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallInitializeDeposit( - _tbtcSystem common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachineAddress common.Address, - _lotSizeSatoshis uint64, - value *big.Int, +func (d *Deposit) CallProvideFundingECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, blockNumber *big.Int, ) error { var result interface{} = nil err := ethutil.CallAtBlock( d.transactorOptions.From, - blockNumber, value, + blockNumber, nil, d.contractABI, d.caller, d.errorResolver, d.contractAddress, - "initializeDeposit", + "provideFundingECDSAFraudProof", &result, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, + _v, + _r, + _s, + _signedDigest, + _preimage, ) return err } -func (d *Deposit) InitializeDepositGasEstimate( - _tbtcSystem common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachineAddress common.Address, - _lotSizeSatoshis uint64, +func (d *Deposit) ProvideFundingECDSAFraudProofGasEstimate( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "initializeDeposit", + "provideFundingECDSAFraudProof", d.contractABI, d.transactor, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, + _v, + _r, + _s, + _signedDigest, + _preimage, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyCourtesyCallExpired( +func (d *Deposit) PurchaseSignerBondsAtAuction( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyCourtesyCallExpired", + "submitting transaction purchaseSignerBondsAtAuction", ) d.transactionMutex.Lock() @@ -1101,7 +1233,7 @@ func (d *Deposit) NotifyCourtesyCallExpired( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyCourtesyCallExpired( + transaction, err := d.contract.PurchaseSignerBondsAtAuction( transactorOptions, ) if err != nil { @@ -1109,12 +1241,12 @@ func (d *Deposit) NotifyCourtesyCallExpired( err, d.transactorOptions.From, nil, - "notifyCourtesyCallExpired", + "purchaseSignerBondsAtAuction", ) } dLogger.Infof( - "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", + "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1125,7 +1257,7 @@ func (d *Deposit) NotifyCourtesyCallExpired( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyCourtesyCallExpired( + transaction, err := d.contract.PurchaseSignerBondsAtAuction( transactorOptions, ) if err != nil { @@ -1133,12 +1265,12 @@ func (d *Deposit) NotifyCourtesyCallExpired( err, d.transactorOptions.From, nil, - "notifyCourtesyCallExpired", + "purchaseSignerBondsAtAuction", ) } dLogger.Infof( - "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", + "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1153,7 +1285,7 @@ func (d *Deposit) NotifyCourtesyCallExpired( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyCourtesyCallExpired( +func (d *Deposit) CallPurchaseSignerBondsAtAuction( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1165,20 +1297,20 @@ func (d *Deposit) CallNotifyCourtesyCallExpired( d.caller, d.errorResolver, d.contractAddress, - "notifyCourtesyCallExpired", + "purchaseSignerBondsAtAuction", &result, ) return err } -func (d *Deposit) NotifyCourtesyCallExpiredGasEstimate() (uint64, error) { +func (d *Deposit) PurchaseSignerBondsAtAuctionGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyCourtesyCallExpired", + "purchaseSignerBondsAtAuction", d.contractABI, d.transactor, ) @@ -1187,12 +1319,12 @@ func (d *Deposit) NotifyCourtesyCallExpiredGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) NotifySignerSetupFailed( +func (d *Deposit) ExitCourtesyCall( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifySignerSetupFailed", + "submitting transaction exitCourtesyCall", ) d.transactionMutex.Lock() @@ -1217,7 +1349,7 @@ func (d *Deposit) NotifySignerSetupFailed( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifySignerSetupFailed( + transaction, err := d.contract.ExitCourtesyCall( transactorOptions, ) if err != nil { @@ -1225,12 +1357,12 @@ func (d *Deposit) NotifySignerSetupFailed( err, d.transactorOptions.From, nil, - "notifySignerSetupFailed", + "exitCourtesyCall", ) } dLogger.Infof( - "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", + "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1241,7 +1373,7 @@ func (d *Deposit) NotifySignerSetupFailed( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifySignerSetupFailed( + transaction, err := d.contract.ExitCourtesyCall( transactorOptions, ) if err != nil { @@ -1249,12 +1381,12 @@ func (d *Deposit) NotifySignerSetupFailed( err, d.transactorOptions.From, nil, - "notifySignerSetupFailed", + "exitCourtesyCall", ) } dLogger.Infof( - "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", + "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1269,7 +1401,7 @@ func (d *Deposit) NotifySignerSetupFailed( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifySignerSetupFailed( +func (d *Deposit) CallExitCourtesyCall( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1281,20 +1413,20 @@ func (d *Deposit) CallNotifySignerSetupFailed( d.caller, d.errorResolver, d.contractAddress, - "notifySignerSetupFailed", + "exitCourtesyCall", &result, ) return err } -func (d *Deposit) NotifySignerSetupFailedGasEstimate() (uint64, error) { +func (d *Deposit) ExitCourtesyCallGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifySignerSetupFailed", + "exitCourtesyCall", d.contractABI, d.transactor, ) @@ -1303,19 +1435,12 @@ func (d *Deposit) NotifySignerSetupFailedGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) RequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, +func (d *Deposit) NotifyRedemptionProofTimedOut( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction requestRedemption", - "params: ", - fmt.Sprint( - _outputValueBytes, - _redeemerOutputScript, - ), + "submitting transaction notifyRedemptionProofTimedOut", ) d.transactionMutex.Lock() @@ -1340,24 +1465,20 @@ func (d *Deposit) RequestRedemption( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.RequestRedemption( + transaction, err := d.contract.NotifyRedemptionProofTimedOut( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "requestRedemption", - _outputValueBytes, - _redeemerOutputScript, + "notifyRedemptionProofTimedOut", ) } dLogger.Infof( - "submitted transaction requestRedemption with id: [%v] and nonce [%v]", + "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1368,24 +1489,20 @@ func (d *Deposit) RequestRedemption( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.RequestRedemption( + transaction, err := d.contract.NotifyRedemptionProofTimedOut( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "requestRedemption", - _outputValueBytes, - _redeemerOutputScript, + "notifyRedemptionProofTimedOut", ) } dLogger.Infof( - "submitted transaction requestRedemption with id: [%v] and nonce [%v]", + "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1400,9 +1517,7 @@ func (d *Deposit) RequestRedemption( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallRequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, +func (d *Deposit) CallNotifyRedemptionProofTimedOut( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1414,48 +1529,34 @@ func (d *Deposit) CallRequestRedemption( d.caller, d.errorResolver, d.contractAddress, - "requestRedemption", + "notifyRedemptionProofTimedOut", &result, - _outputValueBytes, - _redeemerOutputScript, ) return err } -func (d *Deposit) RequestRedemptionGasEstimate( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, -) (uint64, error) { +func (d *Deposit) NotifyRedemptionProofTimedOutGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "requestRedemption", + "notifyRedemptionProofTimedOut", d.contractABI, d.transactor, - _outputValueBytes, - _redeemerOutputScript, ) return result, err } // Transaction submission. -func (d *Deposit) IncreaseRedemptionFee( - _previousOutputValueBytes [8]uint8, - _newOutputValueBytes [8]uint8, +func (d *Deposit) NotifySignerSetupFailed( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction increaseRedemptionFee", - "params: ", - fmt.Sprint( - _previousOutputValueBytes, - _newOutputValueBytes, - ), + "submitting transaction notifySignerSetupFailed", ) d.transactionMutex.Lock() @@ -1480,24 +1581,20 @@ func (d *Deposit) IncreaseRedemptionFee( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.IncreaseRedemptionFee( + transaction, err := d.contract.NotifySignerSetupFailed( transactorOptions, - _previousOutputValueBytes, - _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "increaseRedemptionFee", - _previousOutputValueBytes, - _newOutputValueBytes, + "notifySignerSetupFailed", ) } dLogger.Infof( - "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", + "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1508,24 +1605,20 @@ func (d *Deposit) IncreaseRedemptionFee( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.IncreaseRedemptionFee( + transaction, err := d.contract.NotifySignerSetupFailed( transactorOptions, - _previousOutputValueBytes, - _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "increaseRedemptionFee", - _previousOutputValueBytes, - _newOutputValueBytes, + "notifySignerSetupFailed", ) } dLogger.Infof( - "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", + "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1540,9 +1633,7 @@ func (d *Deposit) IncreaseRedemptionFee( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallIncreaseRedemptionFee( - _previousOutputValueBytes [8]uint8, - _newOutputValueBytes [8]uint8, +func (d *Deposit) CallNotifySignerSetupFailed( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1554,41 +1645,41 @@ func (d *Deposit) CallIncreaseRedemptionFee( d.caller, d.errorResolver, d.contractAddress, - "increaseRedemptionFee", + "notifySignerSetupFailed", &result, - _previousOutputValueBytes, - _newOutputValueBytes, ) return err } -func (d *Deposit) IncreaseRedemptionFeeGasEstimate( - _previousOutputValueBytes [8]uint8, - _newOutputValueBytes [8]uint8, -) (uint64, error) { +func (d *Deposit) NotifySignerSetupFailedGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "increaseRedemptionFee", + "notifySignerSetupFailed", d.contractABI, d.transactor, - _previousOutputValueBytes, - _newOutputValueBytes, ) return result, err } // Transaction submission. -func (d *Deposit) RetrieveSignerPubkey( +func (d *Deposit) RequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction retrieveSignerPubkey", + "submitting transaction requestRedemption", + "params: ", + fmt.Sprint( + _outputValueBytes, + _redeemerOutputScript, + ), ) d.transactionMutex.Lock() @@ -1613,20 +1704,24 @@ func (d *Deposit) RetrieveSignerPubkey( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.RetrieveSignerPubkey( + transaction, err := d.contract.RequestRedemption( transactorOptions, + _outputValueBytes, + _redeemerOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "retrieveSignerPubkey", + "requestRedemption", + _outputValueBytes, + _redeemerOutputScript, ) } dLogger.Infof( - "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", + "submitted transaction requestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1637,20 +1732,24 @@ func (d *Deposit) RetrieveSignerPubkey( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.RetrieveSignerPubkey( + transaction, err := d.contract.RequestRedemption( transactorOptions, + _outputValueBytes, + _redeemerOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "retrieveSignerPubkey", + "requestRedemption", + _outputValueBytes, + _redeemerOutputScript, ) } dLogger.Infof( - "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", + "submitted transaction requestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1665,7 +1764,9 @@ func (d *Deposit) RetrieveSignerPubkey( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallRetrieveSignerPubkey( +func (d *Deposit) CallRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1677,22 +1778,29 @@ func (d *Deposit) CallRetrieveSignerPubkey( d.caller, d.errorResolver, d.contractAddress, - "retrieveSignerPubkey", + "requestRedemption", &result, + _outputValueBytes, + _redeemerOutputScript, ) return err } -func (d *Deposit) RetrieveSignerPubkeyGasEstimate() (uint64, error) { +func (d *Deposit) RequestRedemptionGasEstimate( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "retrieveSignerPubkey", + "requestRedemption", d.contractABI, d.transactor, + _outputValueBytes, + _redeemerOutputScript, ) return result, err @@ -1829,25 +1937,12 @@ func (d *Deposit) RequestFunderAbortGasEstimate( } // Transaction submission. -func (d *Deposit) ProvideECDSAFraudProof( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) WithdrawFunds( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideECDSAFraudProof", - "params: ", - fmt.Sprint( - _v, - _r, - _s, - _signedDigest, - _preimage, - ), + "submitting transaction withdrawFunds", ) d.transactionMutex.Lock() @@ -1872,30 +1967,20 @@ func (d *Deposit) ProvideECDSAFraudProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideECDSAFraudProof( + transaction, err := d.contract.WithdrawFunds( transactorOptions, - _v, - _r, - _s, - _signedDigest, - _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideECDSAFraudProof", - _v, - _r, - _s, - _signedDigest, - _preimage, + "withdrawFunds", ) } dLogger.Infof( - "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", + "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1906,30 +1991,20 @@ func (d *Deposit) ProvideECDSAFraudProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideECDSAFraudProof( + transaction, err := d.contract.WithdrawFunds( transactorOptions, - _v, - _r, - _s, - _signedDigest, - _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideECDSAFraudProof", - _v, - _r, - _s, - _signedDigest, - _preimage, + "withdrawFunds", ) } dLogger.Infof( - "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", + "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1944,12 +2019,7 @@ func (d *Deposit) ProvideECDSAFraudProof( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideECDSAFraudProof( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) CallWithdrawFunds( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1961,67 +2031,34 @@ func (d *Deposit) CallProvideECDSAFraudProof( d.caller, d.errorResolver, d.contractAddress, - "provideECDSAFraudProof", + "withdrawFunds", &result, - _v, - _r, - _s, - _signedDigest, - _preimage, ) return err } -func (d *Deposit) ProvideECDSAFraudProofGasEstimate( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, -) (uint64, error) { +func (d *Deposit) WithdrawFundsGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideECDSAFraudProof", + "withdrawFunds", d.contractABI, d.transactor, - _v, - _r, - _s, - _signedDigest, - _preimage, ) - - return result, err -} - -// Transaction submission. -func (d *Deposit) ProvideRedemptionProof( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, - - transactionOptions ...ethutil.TransactionOptions, -) (*types.Transaction, error) { - dLogger.Debug( - "submitting transaction provideRedemptionProof", - "params: ", - fmt.Sprint( - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, - ), + + return result, err +} + +// Transaction submission. +func (d *Deposit) NotifyCourtesyCallExpired( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction notifyCourtesyCallExpired", ) d.transactionMutex.Lock() @@ -2046,34 +2083,20 @@ func (d *Deposit) ProvideRedemptionProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideRedemptionProof( + transaction, err := d.contract.NotifyCourtesyCallExpired( transactorOptions, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideRedemptionProof", - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + "notifyCourtesyCallExpired", ) } dLogger.Infof( - "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2084,34 +2107,20 @@ func (d *Deposit) ProvideRedemptionProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideRedemptionProof( + transaction, err := d.contract.NotifyCourtesyCallExpired( transactorOptions, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideRedemptionProof", - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + "notifyCourtesyCallExpired", ) } dLogger.Infof( - "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2126,14 +2135,7 @@ func (d *Deposit) ProvideRedemptionProof( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideRedemptionProof( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) CallNotifyCourtesyCallExpired( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2145,65 +2147,34 @@ func (d *Deposit) CallProvideRedemptionProof( d.caller, d.errorResolver, d.contractAddress, - "provideRedemptionProof", + "notifyCourtesyCallExpired", &result, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, ) return err } -func (d *Deposit) ProvideRedemptionProofGasEstimate( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, -) (uint64, error) { +func (d *Deposit) NotifyCourtesyCallExpiredGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideRedemptionProof", + "notifyCourtesyCallExpired", d.contractABI, d.transactor, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, ) return result, err } // Transaction submission. -func (d *Deposit) TransferAndRequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, - _finalRecipient common.Address, +func (d *Deposit) NotifyFundingTimedOut( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction transferAndRequestRedemption", - "params: ", - fmt.Sprint( - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, - ), + "submitting transaction notifyFundingTimedOut", ) d.transactionMutex.Lock() @@ -2228,26 +2199,20 @@ func (d *Deposit) TransferAndRequestRedemption( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.TransferAndRequestRedemption( + transaction, err := d.contract.NotifyFundingTimedOut( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "transferAndRequestRedemption", - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + "notifyFundingTimedOut", ) } dLogger.Infof( - "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", + "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2258,26 +2223,20 @@ func (d *Deposit) TransferAndRequestRedemption( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.TransferAndRequestRedemption( + transaction, err := d.contract.NotifyFundingTimedOut( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "transferAndRequestRedemption", - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + "notifyFundingTimedOut", ) } dLogger.Infof( - "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", + "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2292,10 +2251,7 @@ func (d *Deposit) TransferAndRequestRedemption( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallTransferAndRequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, - _finalRecipient common.Address, +func (d *Deposit) CallNotifyFundingTimedOut( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2307,44 +2263,41 @@ func (d *Deposit) CallTransferAndRequestRedemption( d.caller, d.errorResolver, d.contractAddress, - "transferAndRequestRedemption", + "notifyFundingTimedOut", &result, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, ) return err } -func (d *Deposit) TransferAndRequestRedemptionGasEstimate( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, - _finalRecipient common.Address, -) (uint64, error) { +func (d *Deposit) NotifyFundingTimedOutGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "transferAndRequestRedemption", + "notifyFundingTimedOut", d.contractABI, d.transactor, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyFundingTimedOut( +func (d *Deposit) IncreaseRedemptionFee( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyFundingTimedOut", + "submitting transaction increaseRedemptionFee", + "params: ", + fmt.Sprint( + _previousOutputValueBytes, + _newOutputValueBytes, + ), ) d.transactionMutex.Lock() @@ -2369,20 +2322,24 @@ func (d *Deposit) NotifyFundingTimedOut( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyFundingTimedOut( + transaction, err := d.contract.IncreaseRedemptionFee( transactorOptions, + _previousOutputValueBytes, + _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyFundingTimedOut", + "increaseRedemptionFee", + _previousOutputValueBytes, + _newOutputValueBytes, ) } dLogger.Infof( - "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", + "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2393,20 +2350,24 @@ func (d *Deposit) NotifyFundingTimedOut( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyFundingTimedOut( + transaction, err := d.contract.IncreaseRedemptionFee( transactorOptions, + _previousOutputValueBytes, + _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyFundingTimedOut", + "increaseRedemptionFee", + _previousOutputValueBytes, + _newOutputValueBytes, ) } dLogger.Infof( - "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", + "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2421,7 +2382,9 @@ func (d *Deposit) NotifyFundingTimedOut( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyFundingTimedOut( +func (d *Deposit) CallIncreaseRedemptionFee( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2433,43 +2396,41 @@ func (d *Deposit) CallNotifyFundingTimedOut( d.caller, d.errorResolver, d.contractAddress, - "notifyFundingTimedOut", + "increaseRedemptionFee", &result, + _previousOutputValueBytes, + _newOutputValueBytes, ) return err } -func (d *Deposit) NotifyFundingTimedOutGasEstimate() (uint64, error) { +func (d *Deposit) IncreaseRedemptionFeeGasEstimate( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyFundingTimedOut", + "increaseRedemptionFee", d.contractABI, d.transactor, + _previousOutputValueBytes, + _newOutputValueBytes, ) return result, err } // Transaction submission. -func (d *Deposit) ProvideRedemptionSignature( - _v uint8, - _r [32]uint8, - _s [32]uint8, +func (d *Deposit) NotifyCourtesyCall( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideRedemptionSignature", - "params: ", - fmt.Sprint( - _v, - _r, - _s, - ), + "submitting transaction notifyCourtesyCall", ) d.transactionMutex.Lock() @@ -2494,26 +2455,20 @@ func (d *Deposit) ProvideRedemptionSignature( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideRedemptionSignature( + transaction, err := d.contract.NotifyCourtesyCall( transactorOptions, - _v, - _r, - _s, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideRedemptionSignature", - _v, - _r, - _s, + "notifyCourtesyCall", ) } dLogger.Infof( - "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2524,26 +2479,20 @@ func (d *Deposit) ProvideRedemptionSignature( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideRedemptionSignature( + transaction, err := d.contract.NotifyCourtesyCall( transactorOptions, - _v, - _r, - _s, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideRedemptionSignature", - _v, - _r, - _s, + "notifyCourtesyCall", ) } dLogger.Infof( - "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2558,10 +2507,7 @@ func (d *Deposit) ProvideRedemptionSignature( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideRedemptionSignature( - _v uint8, - _r [32]uint8, - _s [32]uint8, +func (d *Deposit) CallNotifyCourtesyCall( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2573,44 +2519,34 @@ func (d *Deposit) CallProvideRedemptionSignature( d.caller, d.errorResolver, d.contractAddress, - "provideRedemptionSignature", + "notifyCourtesyCall", &result, - _v, - _r, - _s, ) return err } -func (d *Deposit) ProvideRedemptionSignatureGasEstimate( - _v uint8, - _r [32]uint8, - _s [32]uint8, -) (uint64, error) { +func (d *Deposit) NotifyCourtesyCallGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideRedemptionSignature", + "notifyCourtesyCall", d.contractABI, d.transactor, - _v, - _r, - _s, ) return result, err } // Transaction submission. -func (d *Deposit) PurchaseSignerBondsAtAuction( +func (d *Deposit) NotifyUndercollateralizedLiquidation( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction purchaseSignerBondsAtAuction", + "submitting transaction notifyUndercollateralizedLiquidation", ) d.transactionMutex.Lock() @@ -2635,7 +2571,7 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.PurchaseSignerBondsAtAuction( + transaction, err := d.contract.NotifyUndercollateralizedLiquidation( transactorOptions, ) if err != nil { @@ -2643,12 +2579,12 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( err, d.transactorOptions.From, nil, - "purchaseSignerBondsAtAuction", + "notifyUndercollateralizedLiquidation", ) } dLogger.Infof( - "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", + "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2659,7 +2595,7 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.PurchaseSignerBondsAtAuction( + transaction, err := d.contract.NotifyUndercollateralizedLiquidation( transactorOptions, ) if err != nil { @@ -2667,12 +2603,12 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( err, d.transactorOptions.From, nil, - "purchaseSignerBondsAtAuction", + "notifyUndercollateralizedLiquidation", ) } dLogger.Infof( - "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", + "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2687,7 +2623,7 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallPurchaseSignerBondsAtAuction( +func (d *Deposit) CallNotifyUndercollateralizedLiquidation( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2699,20 +2635,20 @@ func (d *Deposit) CallPurchaseSignerBondsAtAuction( d.caller, d.errorResolver, d.contractAddress, - "purchaseSignerBondsAtAuction", + "notifyUndercollateralizedLiquidation", &result, ) return err } -func (d *Deposit) PurchaseSignerBondsAtAuctionGasEstimate() (uint64, error) { +func (d *Deposit) NotifyUndercollateralizedLiquidationGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "purchaseSignerBondsAtAuction", + "notifyUndercollateralizedLiquidation", d.contractABI, d.transactor, ) @@ -2721,12 +2657,31 @@ func (d *Deposit) PurchaseSignerBondsAtAuctionGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) WithdrawFunds( +func (d *Deposit) ProvideBTCFundingProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _fundingOutputIndex uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction withdrawFunds", + "submitting transaction provideBTCFundingProof", + "params: ", + fmt.Sprint( + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ), ) d.transactionMutex.Lock() @@ -2751,20 +2706,36 @@ func (d *Deposit) WithdrawFunds( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.WithdrawFunds( + transaction, err := d.contract.ProvideBTCFundingProof( transactorOptions, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "withdrawFunds", + "provideBTCFundingProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) } dLogger.Infof( - "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", + "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2775,20 +2746,36 @@ func (d *Deposit) WithdrawFunds( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.WithdrawFunds( + transaction, err := d.contract.ProvideBTCFundingProof( transactorOptions, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "withdrawFunds", + "provideBTCFundingProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) } dLogger.Infof( - "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", + "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2803,7 +2790,15 @@ func (d *Deposit) WithdrawFunds( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallWithdrawFunds( +func (d *Deposit) CallProvideBTCFundingProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _fundingOutputIndex uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2815,34 +2810,59 @@ func (d *Deposit) CallWithdrawFunds( d.caller, d.errorResolver, d.contractAddress, - "withdrawFunds", + "provideBTCFundingProof", &result, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) return err } -func (d *Deposit) WithdrawFundsGasEstimate() (uint64, error) { +func (d *Deposit) ProvideBTCFundingProofGasEstimate( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _fundingOutputIndex uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "withdrawFunds", + "provideBTCFundingProof", d.contractABI, d.transactor, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) return result, err } // Transaction submission. -func (d *Deposit) ExitCourtesyCall( +func (d *Deposit) RetrieveSignerPubkey( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction exitCourtesyCall", + "submitting transaction retrieveSignerPubkey", ) d.transactionMutex.Lock() @@ -2867,7 +2887,7 @@ func (d *Deposit) ExitCourtesyCall( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ExitCourtesyCall( + transaction, err := d.contract.RetrieveSignerPubkey( transactorOptions, ) if err != nil { @@ -2875,12 +2895,12 @@ func (d *Deposit) ExitCourtesyCall( err, d.transactorOptions.From, nil, - "exitCourtesyCall", + "retrieveSignerPubkey", ) } dLogger.Infof( - "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2891,7 +2911,7 @@ func (d *Deposit) ExitCourtesyCall( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ExitCourtesyCall( + transaction, err := d.contract.RetrieveSignerPubkey( transactorOptions, ) if err != nil { @@ -2899,12 +2919,12 @@ func (d *Deposit) ExitCourtesyCall( err, d.transactorOptions.From, nil, - "exitCourtesyCall", + "retrieveSignerPubkey", ) } dLogger.Infof( - "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2919,7 +2939,7 @@ func (d *Deposit) ExitCourtesyCall( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallExitCourtesyCall( +func (d *Deposit) CallRetrieveSignerPubkey( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2931,20 +2951,20 @@ func (d *Deposit) CallExitCourtesyCall( d.caller, d.errorResolver, d.contractAddress, - "exitCourtesyCall", + "retrieveSignerPubkey", &result, ) return err } -func (d *Deposit) ExitCourtesyCallGasEstimate() (uint64, error) { +func (d *Deposit) RetrieveSignerPubkeyGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "exitCourtesyCall", + "retrieveSignerPubkey", d.contractABI, d.transactor, ) @@ -2953,24 +2973,20 @@ func (d *Deposit) ExitCourtesyCallGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) ProvideFundingECDSAFraudProof( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) TransferAndRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideFundingECDSAFraudProof", + "submitting transaction transferAndRequestRedemption", "params: ", fmt.Sprint( - _v, - _r, - _s, - _signedDigest, - _preimage, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ), ) @@ -2996,30 +3012,26 @@ func (d *Deposit) ProvideFundingECDSAFraudProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideFundingECDSAFraudProof( + transaction, err := d.contract.TransferAndRequestRedemption( transactorOptions, - _v, - _r, - _s, - _signedDigest, - _preimage, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideFundingECDSAFraudProof", - _v, - _r, - _s, - _signedDigest, - _preimage, + "transferAndRequestRedemption", + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) } dLogger.Infof( - "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", + "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3030,30 +3042,26 @@ func (d *Deposit) ProvideFundingECDSAFraudProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideFundingECDSAFraudProof( + transaction, err := d.contract.TransferAndRequestRedemption( transactorOptions, - _v, - _r, - _s, - _signedDigest, - _preimage, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideFundingECDSAFraudProof", - _v, - _r, - _s, - _signedDigest, - _preimage, + "transferAndRequestRedemption", + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) } dLogger.Infof( - "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", + "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3068,12 +3076,10 @@ func (d *Deposit) ProvideFundingECDSAFraudProof( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideFundingECDSAFraudProof( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) CallTransferAndRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -3085,38 +3091,32 @@ func (d *Deposit) CallProvideFundingECDSAFraudProof( d.caller, d.errorResolver, d.contractAddress, - "provideFundingECDSAFraudProof", + "transferAndRequestRedemption", &result, - _v, - _r, - _s, - _signedDigest, - _preimage, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) return err } -func (d *Deposit) ProvideFundingECDSAFraudProofGasEstimate( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) TransferAndRequestRedemptionGasEstimate( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideFundingECDSAFraudProof", + "transferAndRequestRedemption", d.contractABI, d.transactor, - _v, - _r, - _s, - _signedDigest, - _preimage, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) return result, err @@ -3124,9 +3124,9 @@ func (d *Deposit) ProvideFundingECDSAFraudProofGasEstimate( // ----- Const Methods ------ -func (d *Deposit) RemainingTerm() (*big.Int, error) { +func (d *Deposit) CollateralizationPercentage() (*big.Int, error) { var result *big.Int - result, err := d.contract.RemainingTerm( + result, err := d.contract.CollateralizationPercentage( d.callerOptions, ) @@ -3135,14 +3135,14 @@ func (d *Deposit) RemainingTerm() (*big.Int, error) { err, d.callerOptions.From, nil, - "remainingTerm", + "collateralizationPercentage", ) } return result, err } -func (d *Deposit) RemainingTermAtBlock( +func (d *Deposit) CollateralizationPercentageAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3155,7 +3155,7 @@ func (d *Deposit) RemainingTermAtBlock( d.caller, d.errorResolver, d.contractAddress, - "remainingTerm", + "collateralizationPercentage", &result, ) @@ -3206,13 +3206,10 @@ func (d *Deposit) GetRedemptionTbtcRequirementAtBlock( return result, err } -func (d *Deposit) GetOwnerRedemptionTbtcRequirement( - _redeemer common.Address, -) (*big.Int, error) { - var result *big.Int - result, err := d.contract.GetOwnerRedemptionTbtcRequirement( +func (d *Deposit) InActive() (bool, error) { + var result bool + result, err := d.contract.InActive( d.callerOptions, - _redeemer, ) if err != nil { @@ -3220,19 +3217,17 @@ func (d *Deposit) GetOwnerRedemptionTbtcRequirement( err, d.callerOptions.From, nil, - "getOwnerRedemptionTbtcRequirement", - _redeemer, + "inActive", ) } return result, err } -func (d *Deposit) GetOwnerRedemptionTbtcRequirementAtBlock( - _redeemer common.Address, +func (d *Deposit) InActiveAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (bool, error) { + var result bool err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3242,17 +3237,16 @@ func (d *Deposit) GetOwnerRedemptionTbtcRequirementAtBlock( d.caller, d.errorResolver, d.contractAddress, - "getOwnerRedemptionTbtcRequirement", + "inActive", &result, - _redeemer, ) return result, err } -func (d *Deposit) KeepAddress() (common.Address, error) { - var result common.Address - result, err := d.contract.KeepAddress( +func (d *Deposit) AuctionValue() (*big.Int, error) { + var result *big.Int + result, err := d.contract.AuctionValue( d.callerOptions, ) @@ -3261,17 +3255,17 @@ func (d *Deposit) KeepAddress() (common.Address, error) { err, d.callerOptions.From, nil, - "keepAddress", + "auctionValue", ) } return result, err } -func (d *Deposit) KeepAddressAtBlock( +func (d *Deposit) AuctionValueAtBlock( blockNumber *big.Int, -) (common.Address, error) { - var result common.Address +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3281,16 +3275,22 @@ func (d *Deposit) KeepAddressAtBlock( d.caller, d.errorResolver, d.contractAddress, - "keepAddress", + "auctionValue", &result, ) return result, err } -func (d *Deposit) AuctionValue() (*big.Int, error) { - var result *big.Int - result, err := d.contract.AuctionValue( +type fundingInfo struct { + UtxoValueBytes [8]uint8 + FundedAt *big.Int + UtxoOutpoint []uint8 +} + +func (d *Deposit) FundingInfo() (fundingInfo, error) { + var result fundingInfo + result, err := d.contract.FundingInfo( d.callerOptions, ) @@ -3299,17 +3299,17 @@ func (d *Deposit) AuctionValue() (*big.Int, error) { err, d.callerOptions.From, nil, - "auctionValue", + "fundingInfo", ) } return result, err } -func (d *Deposit) AuctionValueAtBlock( +func (d *Deposit) FundingInfoAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (fundingInfo, error) { + var result fundingInfo err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3319,16 +3319,16 @@ func (d *Deposit) AuctionValueAtBlock( d.caller, d.errorResolver, d.contractAddress, - "auctionValue", + "fundingInfo", &result, ) return result, err } -func (d *Deposit) CollateralizationPercentage() (*big.Int, error) { +func (d *Deposit) RemainingTerm() (*big.Int, error) { var result *big.Int - result, err := d.contract.CollateralizationPercentage( + result, err := d.contract.RemainingTerm( d.callerOptions, ) @@ -3337,14 +3337,14 @@ func (d *Deposit) CollateralizationPercentage() (*big.Int, error) { err, d.callerOptions.From, nil, - "collateralizationPercentage", + "remainingTerm", ) } return result, err } -func (d *Deposit) CollateralizationPercentageAtBlock( +func (d *Deposit) RemainingTermAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3357,16 +3357,16 @@ func (d *Deposit) CollateralizationPercentageAtBlock( d.caller, d.errorResolver, d.contractAddress, - "collateralizationPercentage", + "remainingTerm", &result, ) return result, err } -func (d *Deposit) LotSizeSatoshis() (uint64, error) { - var result uint64 - result, err := d.contract.LotSizeSatoshis( +func (d *Deposit) UndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := d.contract.UndercollateralizedThresholdPercent( d.callerOptions, ) @@ -3375,17 +3375,17 @@ func (d *Deposit) LotSizeSatoshis() (uint64, error) { err, d.callerOptions.From, nil, - "lotSizeSatoshis", + "undercollateralizedThresholdPercent", ) } return result, err } -func (d *Deposit) LotSizeSatoshisAtBlock( +func (d *Deposit) UndercollateralizedThresholdPercentAtBlock( blockNumber *big.Int, -) (uint64, error) { - var result uint64 +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3395,16 +3395,16 @@ func (d *Deposit) LotSizeSatoshisAtBlock( d.caller, d.errorResolver, d.contractAddress, - "lotSizeSatoshis", + "undercollateralizedThresholdPercent", &result, ) return result, err } -func (d *Deposit) LotSizeTbtc() (*big.Int, error) { +func (d *Deposit) WithdrawableAmount() (*big.Int, error) { var result *big.Int - result, err := d.contract.LotSizeTbtc( + result, err := d.contract.WithdrawableAmount( d.callerOptions, ) @@ -3413,14 +3413,14 @@ func (d *Deposit) LotSizeTbtc() (*big.Int, error) { err, d.callerOptions.From, nil, - "lotSizeTbtc", + "withdrawableAmount", ) } return result, err } -func (d *Deposit) LotSizeTbtcAtBlock( +func (d *Deposit) WithdrawableAmountAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3433,16 +3433,16 @@ func (d *Deposit) LotSizeTbtcAtBlock( d.caller, d.errorResolver, d.contractAddress, - "lotSizeTbtc", + "withdrawableAmount", &result, ) return result, err } -func (d *Deposit) SeverelyUndercollateralizedThresholdPercent() (uint16, error) { - var result uint16 - result, err := d.contract.SeverelyUndercollateralizedThresholdPercent( +func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { + var result *big.Int + result, err := d.contract.SignerFeeTbtc( d.callerOptions, ) @@ -3451,17 +3451,17 @@ func (d *Deposit) SeverelyUndercollateralizedThresholdPercent() (uint16, error) err, d.callerOptions.From, nil, - "severelyUndercollateralizedThresholdPercent", + "signerFeeTbtc", ) } return result, err } -func (d *Deposit) SeverelyUndercollateralizedThresholdPercentAtBlock( +func (d *Deposit) SignerFeeTbtcAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3471,16 +3471,16 @@ func (d *Deposit) SeverelyUndercollateralizedThresholdPercentAtBlock( d.caller, d.errorResolver, d.contractAddress, - "severelyUndercollateralizedThresholdPercent", + "signerFeeTbtc", &result, ) return result, err } -func (d *Deposit) UndercollateralizedThresholdPercent() (uint16, error) { - var result uint16 - result, err := d.contract.UndercollateralizedThresholdPercent( +func (d *Deposit) UtxoValue() (*big.Int, error) { + var result *big.Int + result, err := d.contract.UtxoValue( d.callerOptions, ) @@ -3489,17 +3489,17 @@ func (d *Deposit) UndercollateralizedThresholdPercent() (uint16, error) { err, d.callerOptions.From, nil, - "undercollateralizedThresholdPercent", + "utxoValue", ) } return result, err } -func (d *Deposit) UndercollateralizedThresholdPercentAtBlock( +func (d *Deposit) UtxoValueAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3509,16 +3509,16 @@ func (d *Deposit) UndercollateralizedThresholdPercentAtBlock( d.caller, d.errorResolver, d.contractAddress, - "undercollateralizedThresholdPercent", + "utxoValue", &result, ) return result, err } -func (d *Deposit) WithdrawableAmount() (*big.Int, error) { - var result *big.Int - result, err := d.contract.WithdrawableAmount( +func (d *Deposit) LotSizeSatoshis() (uint64, error) { + var result uint64 + result, err := d.contract.LotSizeSatoshis( d.callerOptions, ) @@ -3527,17 +3527,17 @@ func (d *Deposit) WithdrawableAmount() (*big.Int, error) { err, d.callerOptions.From, nil, - "withdrawableAmount", + "lotSizeSatoshis", ) } return result, err } -func (d *Deposit) WithdrawableAmountAtBlock( +func (d *Deposit) LotSizeSatoshisAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (uint64, error) { + var result uint64 err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3547,16 +3547,16 @@ func (d *Deposit) WithdrawableAmountAtBlock( d.caller, d.errorResolver, d.contractAddress, - "withdrawableAmount", + "lotSizeSatoshis", &result, ) return result, err } -func (d *Deposit) CurrentState() (*big.Int, error) { +func (d *Deposit) LotSizeTbtc() (*big.Int, error) { var result *big.Int - result, err := d.contract.CurrentState( + result, err := d.contract.LotSizeTbtc( d.callerOptions, ) @@ -3565,14 +3565,14 @@ func (d *Deposit) CurrentState() (*big.Int, error) { err, d.callerOptions.From, nil, - "currentState", + "lotSizeTbtc", ) } return result, err } -func (d *Deposit) CurrentStateAtBlock( +func (d *Deposit) LotSizeTbtcAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3585,17 +3585,20 @@ func (d *Deposit) CurrentStateAtBlock( d.caller, d.errorResolver, d.contractAddress, - "currentState", + "lotSizeTbtc", &result, ) return result, err } -func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { - var result uint16 - result, err := d.contract.InitialCollateralizedPercent( +func (d *Deposit) GetOwnerRedemptionTbtcRequirement( + _redeemer common.Address, +) (*big.Int, error) { + var result *big.Int + result, err := d.contract.GetOwnerRedemptionTbtcRequirement( d.callerOptions, + _redeemer, ) if err != nil { @@ -3603,17 +3606,19 @@ func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { err, d.callerOptions.From, nil, - "initialCollateralizedPercent", + "getOwnerRedemptionTbtcRequirement", + _redeemer, ) } return result, err } -func (d *Deposit) InitialCollateralizedPercentAtBlock( +func (d *Deposit) GetOwnerRedemptionTbtcRequirementAtBlock( + _redeemer common.Address, blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3623,16 +3628,17 @@ func (d *Deposit) InitialCollateralizedPercentAtBlock( d.caller, d.errorResolver, d.contractAddress, - "initialCollateralizedPercent", + "getOwnerRedemptionTbtcRequirement", &result, + _redeemer, ) return result, err } -func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { - var result *big.Int - result, err := d.contract.SignerFeeTbtc( +func (d *Deposit) KeepAddress() (common.Address, error) { + var result common.Address + result, err := d.contract.KeepAddress( d.callerOptions, ) @@ -3641,17 +3647,17 @@ func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { err, d.callerOptions.From, nil, - "signerFeeTbtc", + "keepAddress", ) } return result, err } -func (d *Deposit) SignerFeeTbtcAtBlock( +func (d *Deposit) KeepAddressAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (common.Address, error) { + var result common.Address err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3661,22 +3667,16 @@ func (d *Deposit) SignerFeeTbtcAtBlock( d.caller, d.errorResolver, d.contractAddress, - "signerFeeTbtc", + "keepAddress", &result, ) return result, err } -type fundingInfo struct { - UtxoValueBytes [8]uint8 - FundedAt *big.Int - UtxoOutpoint []uint8 -} - -func (d *Deposit) FundingInfo() (fundingInfo, error) { - var result fundingInfo - result, err := d.contract.FundingInfo( +func (d *Deposit) CurrentState() (*big.Int, error) { + var result *big.Int + result, err := d.contract.CurrentState( d.callerOptions, ) @@ -3685,17 +3685,17 @@ func (d *Deposit) FundingInfo() (fundingInfo, error) { err, d.callerOptions.From, nil, - "fundingInfo", + "currentState", ) } return result, err } -func (d *Deposit) FundingInfoAtBlock( +func (d *Deposit) CurrentStateAtBlock( blockNumber *big.Int, -) (fundingInfo, error) { - var result fundingInfo +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3705,16 +3705,16 @@ func (d *Deposit) FundingInfoAtBlock( d.caller, d.errorResolver, d.contractAddress, - "fundingInfo", + "currentState", &result, ) return result, err } -func (d *Deposit) InActive() (bool, error) { - var result bool - result, err := d.contract.InActive( +func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { + var result uint16 + result, err := d.contract.InitialCollateralizedPercent( d.callerOptions, ) @@ -3723,17 +3723,17 @@ func (d *Deposit) InActive() (bool, error) { err, d.callerOptions.From, nil, - "inActive", + "initialCollateralizedPercent", ) } return result, err } -func (d *Deposit) InActiveAtBlock( +func (d *Deposit) InitialCollateralizedPercentAtBlock( blockNumber *big.Int, -) (bool, error) { - var result bool +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3743,16 +3743,16 @@ func (d *Deposit) InActiveAtBlock( d.caller, d.errorResolver, d.contractAddress, - "inActive", + "initialCollateralizedPercent", &result, ) return result, err } -func (d *Deposit) UtxoValue() (*big.Int, error) { - var result *big.Int - result, err := d.contract.UtxoValue( +func (d *Deposit) SeverelyUndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := d.contract.SeverelyUndercollateralizedThresholdPercent( d.callerOptions, ) @@ -3761,17 +3761,17 @@ func (d *Deposit) UtxoValue() (*big.Int, error) { err, d.callerOptions.From, nil, - "utxoValue", + "severelyUndercollateralizedThresholdPercent", ) } return result, err } -func (d *Deposit) UtxoValueAtBlock( +func (d *Deposit) SeverelyUndercollateralizedThresholdPercentAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3781,7 +3781,7 @@ func (d *Deposit) UtxoValueAtBlock( d.caller, d.errorResolver, d.contractAddress, - "utxoValue", + "severelyUndercollateralizedThresholdPercent", &result, ) diff --git a/go/contract/DepositLog.go b/go/contract/DepositLog.go index c94c08768..9bc33d28f 100644 --- a/go/contract/DepositLog.go +++ b/go/contract/DepositLog.go @@ -20,7 +20,7 @@ import ( "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" "github.com/keep-network/keep-common/pkg/subscription" - "github.com/keep-network/tbtc/bindings/go/abi" + "github.com/keep-network/tbtc/go/abi" ) // Create a package-level logger for this contract. The logger exists at @@ -94,19 +94,12 @@ func NewDepositLog( // ----- Non-const Methods ------ // Transaction submission. -func (dl *DepositLog) LogRegisteredPubkey( - _signingGroupPubkeyX [32]uint8, - _signingGroupPubkeyY [32]uint8, +func (dl *DepositLog) LogCourtesyCalled( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logRegisteredPubkey", - "params: ", - fmt.Sprint( - _signingGroupPubkeyX, - _signingGroupPubkeyY, - ), + "submitting transaction logCourtesyCalled", ) dl.transactionMutex.Lock() @@ -131,24 +124,20 @@ func (dl *DepositLog) LogRegisteredPubkey( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogRegisteredPubkey( + transaction, err := dl.contract.LogCourtesyCalled( transactorOptions, - _signingGroupPubkeyX, - _signingGroupPubkeyY, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logRegisteredPubkey", - _signingGroupPubkeyX, - _signingGroupPubkeyY, + "logCourtesyCalled", ) } dlLogger.Infof( - "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", + "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -159,24 +148,20 @@ func (dl *DepositLog) LogRegisteredPubkey( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogRegisteredPubkey( + transaction, err := dl.contract.LogCourtesyCalled( transactorOptions, - _signingGroupPubkeyX, - _signingGroupPubkeyY, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logRegisteredPubkey", - _signingGroupPubkeyX, - _signingGroupPubkeyY, + "logCourtesyCalled", ) } dlLogger.Infof( - "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", + "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -191,9 +176,7 @@ func (dl *DepositLog) LogRegisteredPubkey( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogRegisteredPubkey( - _signingGroupPubkeyX [32]uint8, - _signingGroupPubkeyY [32]uint8, +func (dl *DepositLog) CallLogCourtesyCalled( blockNumber *big.Int, ) error { var result interface{} = nil @@ -205,46 +188,34 @@ func (dl *DepositLog) CallLogRegisteredPubkey( dl.caller, dl.errorResolver, dl.contractAddress, - "logRegisteredPubkey", + "logCourtesyCalled", &result, - _signingGroupPubkeyX, - _signingGroupPubkeyY, ) return err } -func (dl *DepositLog) LogRegisteredPubkeyGasEstimate( - _signingGroupPubkeyX [32]uint8, - _signingGroupPubkeyY [32]uint8, -) (uint64, error) { +func (dl *DepositLog) LogCourtesyCalledGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logRegisteredPubkey", + "logCourtesyCalled", dl.contractABI, dl.transactor, - _signingGroupPubkeyX, - _signingGroupPubkeyY, ) return result, err } // Transaction submission. -func (dl *DepositLog) LogFunderRequestedAbort( - _abortOutputScript []uint8, +func (dl *DepositLog) LogExitedCourtesyCall( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logFunderRequestedAbort", - "params: ", - fmt.Sprint( - _abortOutputScript, - ), + "submitting transaction logExitedCourtesyCall", ) dl.transactionMutex.Lock() @@ -269,22 +240,20 @@ func (dl *DepositLog) LogFunderRequestedAbort( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogFunderRequestedAbort( + transaction, err := dl.contract.LogExitedCourtesyCall( transactorOptions, - _abortOutputScript, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logFunderRequestedAbort", - _abortOutputScript, + "logExitedCourtesyCall", ) } dlLogger.Infof( - "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", + "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -295,22 +264,20 @@ func (dl *DepositLog) LogFunderRequestedAbort( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogFunderRequestedAbort( + transaction, err := dl.contract.LogExitedCourtesyCall( transactorOptions, - _abortOutputScript, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logFunderRequestedAbort", - _abortOutputScript, + "logExitedCourtesyCall", ) } dlLogger.Infof( - "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", + "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -325,8 +292,7 @@ func (dl *DepositLog) LogFunderRequestedAbort( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogFunderRequestedAbort( - _abortOutputScript []uint8, +func (dl *DepositLog) CallLogExitedCourtesyCall( blockNumber *big.Int, ) error { var result interface{} = nil @@ -338,38 +304,43 @@ func (dl *DepositLog) CallLogFunderRequestedAbort( dl.caller, dl.errorResolver, dl.contractAddress, - "logFunderRequestedAbort", + "logExitedCourtesyCall", &result, - _abortOutputScript, ) return err } -func (dl *DepositLog) LogFunderRequestedAbortGasEstimate( - _abortOutputScript []uint8, -) (uint64, error) { +func (dl *DepositLog) LogExitedCourtesyCallGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logFunderRequestedAbort", + "logExitedCourtesyCall", dl.contractABI, dl.transactor, - _abortOutputScript, ) return result, err } // Transaction submission. -func (dl *DepositLog) LogLiquidated( +func (dl *DepositLog) LogGotRedemptionSignature( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logLiquidated", + "submitting transaction logGotRedemptionSignature", + "params: ", + fmt.Sprint( + _digest, + _r, + _s, + ), ) dl.transactionMutex.Lock() @@ -394,20 +365,26 @@ func (dl *DepositLog) LogLiquidated( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogLiquidated( + transaction, err := dl.contract.LogGotRedemptionSignature( transactorOptions, + _digest, + _r, + _s, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logLiquidated", + "logGotRedemptionSignature", + _digest, + _r, + _s, ) } dlLogger.Infof( - "submitted transaction logLiquidated with id: [%v] and nonce [%v]", + "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -418,20 +395,26 @@ func (dl *DepositLog) LogLiquidated( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogLiquidated( + transaction, err := dl.contract.LogGotRedemptionSignature( transactorOptions, + _digest, + _r, + _s, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logLiquidated", + "logGotRedemptionSignature", + _digest, + _r, + _s, ) } dlLogger.Infof( - "submitted transaction logLiquidated with id: [%v] and nonce [%v]", + "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -446,7 +429,10 @@ func (dl *DepositLog) LogLiquidated( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogLiquidated( +func (dl *DepositLog) CallLogGotRedemptionSignature( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -458,34 +444,59 @@ func (dl *DepositLog) CallLogLiquidated( dl.caller, dl.errorResolver, dl.contractAddress, - "logLiquidated", + "logGotRedemptionSignature", &result, + _digest, + _r, + _s, ) return err } -func (dl *DepositLog) LogLiquidatedGasEstimate() (uint64, error) { +func (dl *DepositLog) LogGotRedemptionSignatureGasEstimate( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logLiquidated", + "logGotRedemptionSignature", dl.contractABI, dl.transactor, + _digest, + _r, + _s, ) return result, err } // Transaction submission. -func (dl *DepositLog) LogExitedCourtesyCall( +func (dl *DepositLog) LogRedemptionRequested( + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logExitedCourtesyCall", + "submitting transaction logRedemptionRequested", + "params: ", + fmt.Sprint( + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ), ) dl.transactionMutex.Lock() @@ -510,20 +521,32 @@ func (dl *DepositLog) LogExitedCourtesyCall( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogExitedCourtesyCall( + transaction, err := dl.contract.LogRedemptionRequested( transactorOptions, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logExitedCourtesyCall", + "logRedemptionRequested", + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) } dlLogger.Infof( - "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -534,20 +557,32 @@ func (dl *DepositLog) LogExitedCourtesyCall( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogExitedCourtesyCall( + transaction, err := dl.contract.LogRedemptionRequested( transactorOptions, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logExitedCourtesyCall", + "logRedemptionRequested", + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) } dlLogger.Infof( - "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -562,7 +597,13 @@ func (dl *DepositLog) LogExitedCourtesyCall( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogExitedCourtesyCall( +func (dl *DepositLog) CallLogRedemptionRequested( + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -574,38 +615,59 @@ func (dl *DepositLog) CallLogExitedCourtesyCall( dl.caller, dl.errorResolver, dl.contractAddress, - "logExitedCourtesyCall", + "logRedemptionRequested", &result, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) return err } -func (dl *DepositLog) LogExitedCourtesyCallGasEstimate() (uint64, error) { +func (dl *DepositLog) LogRedemptionRequestedGasEstimate( + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logExitedCourtesyCall", + "logRedemptionRequested", dl.contractABI, dl.transactor, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) return result, err } // Transaction submission. -func (dl *DepositLog) LogCreated( - _keepAddress common.Address, +func (dl *DepositLog) LogRegisteredPubkey( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logCreated", + "submitting transaction logRegisteredPubkey", "params: ", fmt.Sprint( - _keepAddress, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ), ) @@ -631,22 +693,24 @@ func (dl *DepositLog) LogCreated( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogCreated( + transaction, err := dl.contract.LogRegisteredPubkey( transactorOptions, - _keepAddress, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logCreated", - _keepAddress, + "logRegisteredPubkey", + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) } dlLogger.Infof( - "submitted transaction logCreated with id: [%v] and nonce [%v]", + "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -657,22 +721,24 @@ func (dl *DepositLog) LogCreated( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogCreated( + transaction, err := dl.contract.LogRegisteredPubkey( transactorOptions, - _keepAddress, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logCreated", - _keepAddress, + "logRegisteredPubkey", + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) } dlLogger.Infof( - "submitted transaction logCreated with id: [%v] and nonce [%v]", + "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -687,8 +753,9 @@ func (dl *DepositLog) LogCreated( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogCreated( - _keepAddress common.Address, +func (dl *DepositLog) CallLogRegisteredPubkey( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -700,42 +767,45 @@ func (dl *DepositLog) CallLogCreated( dl.caller, dl.errorResolver, dl.contractAddress, - "logCreated", + "logRegisteredPubkey", &result, - _keepAddress, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) return err } -func (dl *DepositLog) LogCreatedGasEstimate( - _keepAddress common.Address, +func (dl *DepositLog) LogRegisteredPubkeyGasEstimate( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logCreated", + "logRegisteredPubkey", dl.contractABI, dl.transactor, - _keepAddress, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) return result, err } // Transaction submission. -func (dl *DepositLog) LogFunded( - _txid [32]uint8, +func (dl *DepositLog) LogCreated( + _keepAddress common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logFunded", + "submitting transaction logCreated", "params: ", fmt.Sprint( - _txid, + _keepAddress, ), ) @@ -761,22 +831,22 @@ func (dl *DepositLog) LogFunded( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogFunded( + transaction, err := dl.contract.LogCreated( transactorOptions, - _txid, + _keepAddress, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logFunded", - _txid, + "logCreated", + _keepAddress, ) } dlLogger.Infof( - "submitted transaction logFunded with id: [%v] and nonce [%v]", + "submitted transaction logCreated with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -787,22 +857,22 @@ func (dl *DepositLog) LogFunded( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogFunded( + transaction, err := dl.contract.LogCreated( transactorOptions, - _txid, + _keepAddress, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logFunded", - _txid, + "logCreated", + _keepAddress, ) } dlLogger.Infof( - "submitted transaction logFunded with id: [%v] and nonce [%v]", + "submitted transaction logCreated with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -817,8 +887,8 @@ func (dl *DepositLog) LogFunded( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogFunded( - _txid [32]uint8, +func (dl *DepositLog) CallLogCreated( + _keepAddress common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -830,38 +900,38 @@ func (dl *DepositLog) CallLogFunded( dl.caller, dl.errorResolver, dl.contractAddress, - "logFunded", + "logCreated", &result, - _txid, + _keepAddress, ) return err } -func (dl *DepositLog) LogFundedGasEstimate( - _txid [32]uint8, +func (dl *DepositLog) LogCreatedGasEstimate( + _keepAddress common.Address, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logFunded", + "logCreated", dl.contractABI, dl.transactor, - _txid, + _keepAddress, ) return result, err } // Transaction submission. -func (dl *DepositLog) LogSetupFailed( +func (dl *DepositLog) LogFraudDuringSetup( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logSetupFailed", + "submitting transaction logFraudDuringSetup", ) dl.transactionMutex.Lock() @@ -886,7 +956,7 @@ func (dl *DepositLog) LogSetupFailed( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogSetupFailed( + transaction, err := dl.contract.LogFraudDuringSetup( transactorOptions, ) if err != nil { @@ -894,12 +964,12 @@ func (dl *DepositLog) LogSetupFailed( err, dl.transactorOptions.From, nil, - "logSetupFailed", + "logFraudDuringSetup", ) } dlLogger.Infof( - "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", + "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -910,7 +980,7 @@ func (dl *DepositLog) LogSetupFailed( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogSetupFailed( + transaction, err := dl.contract.LogFraudDuringSetup( transactorOptions, ) if err != nil { @@ -918,12 +988,12 @@ func (dl *DepositLog) LogSetupFailed( err, dl.transactorOptions.From, nil, - "logSetupFailed", + "logFraudDuringSetup", ) } dlLogger.Infof( - "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", + "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -938,7 +1008,7 @@ func (dl *DepositLog) LogSetupFailed( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogSetupFailed( +func (dl *DepositLog) CallLogFraudDuringSetup( blockNumber *big.Int, ) error { var result interface{} = nil @@ -950,20 +1020,20 @@ func (dl *DepositLog) CallLogSetupFailed( dl.caller, dl.errorResolver, dl.contractAddress, - "logSetupFailed", + "logFraudDuringSetup", &result, ) return err } -func (dl *DepositLog) LogSetupFailedGasEstimate() (uint64, error) { +func (dl *DepositLog) LogFraudDuringSetupGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logSetupFailed", + "logFraudDuringSetup", dl.contractABI, dl.transactor, ) @@ -972,16 +1042,16 @@ func (dl *DepositLog) LogSetupFailedGasEstimate() (uint64, error) { } // Transaction submission. -func (dl *DepositLog) LogStartedLiquidation( - _wasFraud bool, +func (dl *DepositLog) LogFunded( + _txid [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logStartedLiquidation", + "submitting transaction logFunded", "params: ", fmt.Sprint( - _wasFraud, + _txid, ), ) @@ -1007,22 +1077,22 @@ func (dl *DepositLog) LogStartedLiquidation( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogStartedLiquidation( + transaction, err := dl.contract.LogFunded( transactorOptions, - _wasFraud, + _txid, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logStartedLiquidation", - _wasFraud, + "logFunded", + _txid, ) } dlLogger.Infof( - "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction logFunded with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1033,22 +1103,22 @@ func (dl *DepositLog) LogStartedLiquidation( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogStartedLiquidation( + transaction, err := dl.contract.LogFunded( transactorOptions, - _wasFraud, + _txid, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logStartedLiquidation", - _wasFraud, + "logFunded", + _txid, ) } dlLogger.Infof( - "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction logFunded with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1063,8 +1133,8 @@ func (dl *DepositLog) LogStartedLiquidation( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogStartedLiquidation( - _wasFraud bool, +func (dl *DepositLog) CallLogFunded( + _txid [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1076,38 +1146,43 @@ func (dl *DepositLog) CallLogStartedLiquidation( dl.caller, dl.errorResolver, dl.contractAddress, - "logStartedLiquidation", + "logFunded", &result, - _wasFraud, + _txid, ) return err } -func (dl *DepositLog) LogStartedLiquidationGasEstimate( - _wasFraud bool, +func (dl *DepositLog) LogFundedGasEstimate( + _txid [32]uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logStartedLiquidation", + "logFunded", dl.contractABI, dl.transactor, - _wasFraud, + _txid, ) return result, err } // Transaction submission. -func (dl *DepositLog) LogFraudDuringSetup( +func (dl *DepositLog) LogRedeemed( + _txid [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logFraudDuringSetup", + "submitting transaction logRedeemed", + "params: ", + fmt.Sprint( + _txid, + ), ) dl.transactionMutex.Lock() @@ -1132,20 +1207,22 @@ func (dl *DepositLog) LogFraudDuringSetup( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogFraudDuringSetup( + transaction, err := dl.contract.LogRedeemed( transactorOptions, + _txid, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logFraudDuringSetup", + "logRedeemed", + _txid, ) } dlLogger.Infof( - "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", + "submitted transaction logRedeemed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1156,20 +1233,22 @@ func (dl *DepositLog) LogFraudDuringSetup( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogFraudDuringSetup( + transaction, err := dl.contract.LogRedeemed( transactorOptions, + _txid, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logFraudDuringSetup", + "logRedeemed", + _txid, ) } dlLogger.Infof( - "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", + "submitted transaction logRedeemed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1184,7 +1263,8 @@ func (dl *DepositLog) LogFraudDuringSetup( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogFraudDuringSetup( +func (dl *DepositLog) CallLogRedeemed( + _txid [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1196,43 +1276,38 @@ func (dl *DepositLog) CallLogFraudDuringSetup( dl.caller, dl.errorResolver, dl.contractAddress, - "logFraudDuringSetup", + "logRedeemed", &result, + _txid, ) return err } -func (dl *DepositLog) LogFraudDuringSetupGasEstimate() (uint64, error) { +func (dl *DepositLog) LogRedeemedGasEstimate( + _txid [32]uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logFraudDuringSetup", + "logRedeemed", dl.contractABI, dl.transactor, + _txid, ) return result, err } // Transaction submission. -func (dl *DepositLog) LogGotRedemptionSignature( - _digest [32]uint8, - _r [32]uint8, - _s [32]uint8, +func (dl *DepositLog) LogSetupFailed( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logGotRedemptionSignature", - "params: ", - fmt.Sprint( - _digest, - _r, - _s, - ), + "submitting transaction logSetupFailed", ) dl.transactionMutex.Lock() @@ -1257,26 +1332,20 @@ func (dl *DepositLog) LogGotRedemptionSignature( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogGotRedemptionSignature( + transaction, err := dl.contract.LogSetupFailed( transactorOptions, - _digest, - _r, - _s, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logGotRedemptionSignature", - _digest, - _r, - _s, + "logSetupFailed", ) } dlLogger.Infof( - "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", + "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1287,26 +1356,20 @@ func (dl *DepositLog) LogGotRedemptionSignature( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogGotRedemptionSignature( + transaction, err := dl.contract.LogSetupFailed( transactorOptions, - _digest, - _r, - _s, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logGotRedemptionSignature", - _digest, - _r, - _s, + "logSetupFailed", ) } dlLogger.Infof( - "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", + "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1321,10 +1384,7 @@ func (dl *DepositLog) LogGotRedemptionSignature( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogGotRedemptionSignature( - _digest [32]uint8, - _r [32]uint8, - _s [32]uint8, +func (dl *DepositLog) CallLogSetupFailed( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1336,48 +1396,38 @@ func (dl *DepositLog) CallLogGotRedemptionSignature( dl.caller, dl.errorResolver, dl.contractAddress, - "logGotRedemptionSignature", + "logSetupFailed", &result, - _digest, - _r, - _s, ) return err } -func (dl *DepositLog) LogGotRedemptionSignatureGasEstimate( - _digest [32]uint8, - _r [32]uint8, - _s [32]uint8, -) (uint64, error) { +func (dl *DepositLog) LogSetupFailedGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logGotRedemptionSignature", + "logSetupFailed", dl.contractABI, dl.transactor, - _digest, - _r, - _s, ) return result, err } // Transaction submission. -func (dl *DepositLog) LogRedeemed( - _txid [32]uint8, +func (dl *DepositLog) LogFunderRequestedAbort( + _abortOutputScript []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logRedeemed", + "submitting transaction logFunderRequestedAbort", "params: ", fmt.Sprint( - _txid, + _abortOutputScript, ), ) @@ -1403,22 +1453,22 @@ func (dl *DepositLog) LogRedeemed( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogRedeemed( + transaction, err := dl.contract.LogFunderRequestedAbort( transactorOptions, - _txid, + _abortOutputScript, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logRedeemed", - _txid, + "logFunderRequestedAbort", + _abortOutputScript, ) } dlLogger.Infof( - "submitted transaction logRedeemed with id: [%v] and nonce [%v]", + "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1429,22 +1479,22 @@ func (dl *DepositLog) LogRedeemed( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogRedeemed( + transaction, err := dl.contract.LogFunderRequestedAbort( transactorOptions, - _txid, + _abortOutputScript, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logRedeemed", - _txid, + "logFunderRequestedAbort", + _abortOutputScript, ) } dlLogger.Infof( - "submitted transaction logRedeemed with id: [%v] and nonce [%v]", + "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1459,8 +1509,8 @@ func (dl *DepositLog) LogRedeemed( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogRedeemed( - _txid [32]uint8, +func (dl *DepositLog) CallLogFunderRequestedAbort( + _abortOutputScript []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1472,53 +1522,38 @@ func (dl *DepositLog) CallLogRedeemed( dl.caller, dl.errorResolver, dl.contractAddress, - "logRedeemed", + "logFunderRequestedAbort", &result, - _txid, + _abortOutputScript, ) return err } -func (dl *DepositLog) LogRedeemedGasEstimate( - _txid [32]uint8, +func (dl *DepositLog) LogFunderRequestedAbortGasEstimate( + _abortOutputScript []uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logRedeemed", + "logFunderRequestedAbort", dl.contractABI, dl.transactor, - _txid, + _abortOutputScript, ) return result, err } // Transaction submission. -func (dl *DepositLog) LogRedemptionRequested( - _requester common.Address, - _digest [32]uint8, - _utxoValue *big.Int, - _redeemerOutputScript []uint8, - _requestedFee *big.Int, - _outpoint []uint8, +func (dl *DepositLog) LogLiquidated( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logRedemptionRequested", - "params: ", - fmt.Sprint( - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, - ), + "submitting transaction logLiquidated", ) dl.transactionMutex.Lock() @@ -1543,32 +1578,20 @@ func (dl *DepositLog) LogRedemptionRequested( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogRedemptionRequested( + transaction, err := dl.contract.LogLiquidated( transactorOptions, - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logRedemptionRequested", - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, + "logLiquidated", ) } dlLogger.Infof( - "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", + "submitted transaction logLiquidated with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1579,32 +1602,20 @@ func (dl *DepositLog) LogRedemptionRequested( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogRedemptionRequested( + transaction, err := dl.contract.LogLiquidated( transactorOptions, - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logRedemptionRequested", - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, + "logLiquidated", ) } dlLogger.Infof( - "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", + "submitted transaction logLiquidated with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1619,13 +1630,7 @@ func (dl *DepositLog) LogRedemptionRequested( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogRedemptionRequested( - _requester common.Address, - _digest [32]uint8, - _utxoValue *big.Int, - _redeemerOutputScript []uint8, - _requestedFee *big.Int, - _outpoint []uint8, +func (dl *DepositLog) CallLogLiquidated( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1637,53 +1642,39 @@ func (dl *DepositLog) CallLogRedemptionRequested( dl.caller, dl.errorResolver, dl.contractAddress, - "logRedemptionRequested", + "logLiquidated", &result, - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, ) return err } -func (dl *DepositLog) LogRedemptionRequestedGasEstimate( - _requester common.Address, - _digest [32]uint8, - _utxoValue *big.Int, - _redeemerOutputScript []uint8, - _requestedFee *big.Int, - _outpoint []uint8, -) (uint64, error) { +func (dl *DepositLog) LogLiquidatedGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logRedemptionRequested", + "logLiquidated", dl.contractABI, dl.transactor, - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, ) return result, err } // Transaction submission. -func (dl *DepositLog) LogCourtesyCalled( +func (dl *DepositLog) LogStartedLiquidation( + _wasFraud bool, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dlLogger.Debug( - "submitting transaction logCourtesyCalled", + "submitting transaction logStartedLiquidation", + "params: ", + fmt.Sprint( + _wasFraud, + ), ) dl.transactionMutex.Lock() @@ -1708,20 +1699,22 @@ func (dl *DepositLog) LogCourtesyCalled( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := dl.contract.LogCourtesyCalled( + transaction, err := dl.contract.LogStartedLiquidation( transactorOptions, + _wasFraud, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logCourtesyCalled", + "logStartedLiquidation", + _wasFraud, ) } dlLogger.Infof( - "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", + "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1732,20 +1725,22 @@ func (dl *DepositLog) LogCourtesyCalled( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := dl.contract.LogCourtesyCalled( + transaction, err := dl.contract.LogStartedLiquidation( transactorOptions, + _wasFraud, ) if err != nil { return transaction, dl.errorResolver.ResolveError( err, dl.transactorOptions.From, nil, - "logCourtesyCalled", + "logStartedLiquidation", + _wasFraud, ) } dlLogger.Infof( - "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", + "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1760,7 +1755,8 @@ func (dl *DepositLog) LogCourtesyCalled( } // Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogCourtesyCalled( +func (dl *DepositLog) CallLogStartedLiquidation( + _wasFraud bool, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1772,22 +1768,26 @@ func (dl *DepositLog) CallLogCourtesyCalled( dl.caller, dl.errorResolver, dl.contractAddress, - "logCourtesyCalled", + "logStartedLiquidation", &result, + _wasFraud, ) return err } -func (dl *DepositLog) LogCourtesyCalledGasEstimate() (uint64, error) { +func (dl *DepositLog) LogStartedLiquidationGasEstimate( + _wasFraud bool, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( dl.callerOptions.From, dl.contractAddress, - "logCourtesyCalled", + "logStartedLiquidation", dl.contractABI, dl.transactor, + _wasFraud, ) return result, err @@ -1841,20 +1841,16 @@ func (dl *DepositLog) ApprovedToLogAtBlock( // ------ Events ------- -type depositLogGotRedemptionSignatureFunc func( - _depositContractAddress common.Address, - _digest [32]uint8, - _r [32]uint8, - _s [32]uint8, - _timestamp *big.Int, +type depositLogLiquidatedFunc func( + DepositContractAddress common.Address, + Timestamp *big.Int, blockNumber uint64, ) -func (dl *DepositLog) WatchGotRedemptionSignature( - success depositLogGotRedemptionSignatureFunc, +func (dl *DepositLog) WatchLiquidated( + success depositLogLiquidatedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -1871,11 +1867,10 @@ func (dl *DepositLog) WatchGotRedemptionSignature( return err } - subscription, err := dl.subscribeGotRedemptionSignature( + subscription, err := dl.subscribeLiquidated( success, failCallback, _depositContractAddressFilter, - _digestFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -1895,7 +1890,7 @@ func (dl *DepositLog) WatchGotRedemptionSignature( select { case <-errorChan: dlLogger.Warning( - "subscription to event GotRedemptionSignature terminated with error; " + + "subscription to event Liquidated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -1916,23 +1911,21 @@ func (dl *DepositLog) WatchGotRedemptionSignature( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeGotRedemptionSignature( - success depositLogGotRedemptionSignatureFunc, +func (dl *DepositLog) subscribeLiquidated( + success depositLogLiquidatedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogGotRedemptionSignature) - eventSubscription, err := dl.contract.WatchGotRedemptionSignature( + eventChan := make(chan *abi.DepositLogLiquidated) + eventSubscription, err := dl.contract.WatchLiquidated( nil, eventChan, _depositContractAddressFilter, - _digestFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for GotRedemptionSignature events: [%v]", + "error creating watch for Liquidated events: [%v]", err, ) } @@ -1950,11 +1943,8 @@ func (dl *DepositLog) subscribeGotRedemptionSignature( return } success( - event._depositContractAddress, - event._digest, - event._r, - event._s, - event._timestamp, + event.DepositContractAddress, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -1976,23 +1966,18 @@ func (dl *DepositLog) subscribeGotRedemptionSignature( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type depositLogRedemptionRequestedFunc func( - _depositContractAddress common.Address, - _requester common.Address, - _digest [32]uint8, - _utxoValue *big.Int, - _redeemerOutputScript []uint8, - _requestedFee *big.Int, - _outpoint []uint8, +type depositLogRedeemedFunc func( + DepositContractAddress common.Address, + Txid [32]uint8, + Timestamp *big.Int, blockNumber uint64, ) -func (dl *DepositLog) WatchRedemptionRequested( - success depositLogRedemptionRequestedFunc, +func (dl *DepositLog) WatchRedeemed( + success depositLogRedeemedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, - _requesterFilter []common.Address, - _digestFilter [][32]uint8, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -2009,12 +1994,11 @@ func (dl *DepositLog) WatchRedemptionRequested( return err } - subscription, err := dl.subscribeRedemptionRequested( + subscription, err := dl.subscribeRedeemed( success, failCallback, _depositContractAddressFilter, - _requesterFilter, - _digestFilter, + _txidFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -2034,7 +2018,7 @@ func (dl *DepositLog) WatchRedemptionRequested( select { case <-errorChan: dlLogger.Warning( - "subscription to event RedemptionRequested terminated with error; " + + "subscription to event Redeemed terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -2055,25 +2039,23 @@ func (dl *DepositLog) WatchRedemptionRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeRedemptionRequested( - success depositLogRedemptionRequestedFunc, +func (dl *DepositLog) subscribeRedeemed( + success depositLogRedeemedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _requesterFilter []common.Address, - _digestFilter [][32]uint8, + _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogRedemptionRequested) - eventSubscription, err := dl.contract.WatchRedemptionRequested( + eventChan := make(chan *abi.DepositLogRedeemed) + eventSubscription, err := dl.contract.WatchRedeemed( nil, eventChan, _depositContractAddressFilter, - _requesterFilter, - _digestFilter, + _txidFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for RedemptionRequested events: [%v]", + "error creating watch for Redeemed events: [%v]", err, ) } @@ -2091,13 +2073,9 @@ func (dl *DepositLog) subscribeRedemptionRequested( return } success( - event._depositContractAddress, - event._requester, - event._digest, - event._utxoValue, - event._redeemerOutputScript, - event._requestedFee, - event._outpoint, + event.DepositContractAddress, + event.Txid, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -2119,18 +2097,23 @@ func (dl *DepositLog) subscribeRedemptionRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type depositLogRegisteredPubkeyFunc func( - _depositContractAddress common.Address, - _signingGroupPubkeyX [32]uint8, - _signingGroupPubkeyY [32]uint8, - _timestamp *big.Int, +type depositLogRedemptionRequestedFunc func( + DepositContractAddress common.Address, + Requester common.Address, + Digest [32]uint8, + UtxoValue *big.Int, + RedeemerOutputScript []uint8, + RequestedFee *big.Int, + Outpoint []uint8, blockNumber uint64, ) -func (dl *DepositLog) WatchRegisteredPubkey( - success depositLogRegisteredPubkeyFunc, +func (dl *DepositLog) WatchRedemptionRequested( + success depositLogRedemptionRequestedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _requesterFilter []common.Address, + _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -2147,10 +2130,12 @@ func (dl *DepositLog) WatchRegisteredPubkey( return err } - subscription, err := dl.subscribeRegisteredPubkey( + subscription, err := dl.subscribeRedemptionRequested( success, failCallback, _depositContractAddressFilter, + _requesterFilter, + _digestFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -2170,7 +2155,7 @@ func (dl *DepositLog) WatchRegisteredPubkey( select { case <-errorChan: dlLogger.Warning( - "subscription to event RegisteredPubkey terminated with error; " + + "subscription to event RedemptionRequested terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -2191,21 +2176,25 @@ func (dl *DepositLog) WatchRegisteredPubkey( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeRegisteredPubkey( - success depositLogRegisteredPubkeyFunc, +func (dl *DepositLog) subscribeRedemptionRequested( + success depositLogRedemptionRequestedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _requesterFilter []common.Address, + _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogRegisteredPubkey) - eventSubscription, err := dl.contract.WatchRegisteredPubkey( + eventChan := make(chan *abi.DepositLogRedemptionRequested) + eventSubscription, err := dl.contract.WatchRedemptionRequested( nil, eventChan, _depositContractAddressFilter, + _requesterFilter, + _digestFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for RegisteredPubkey events: [%v]", + "error creating watch for RedemptionRequested events: [%v]", err, ) } @@ -2223,10 +2212,13 @@ func (dl *DepositLog) subscribeRegisteredPubkey( return } success( - event._depositContractAddress, - event._signingGroupPubkeyX, - event._signingGroupPubkeyY, - event._timestamp, + event.DepositContractAddress, + event.Requester, + event.Digest, + event.UtxoValue, + event.RedeemerOutputScript, + event.RequestedFee, + event.Outpoint, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -2248,14 +2240,16 @@ func (dl *DepositLog) subscribeRegisteredPubkey( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type depositLogSetupFailedFunc func( - _depositContractAddress common.Address, - _timestamp *big.Int, +type depositLogRegisteredPubkeyFunc func( + DepositContractAddress common.Address, + SigningGroupPubkeyX [32]uint8, + SigningGroupPubkeyY [32]uint8, + Timestamp *big.Int, blockNumber uint64, ) -func (dl *DepositLog) WatchSetupFailed( - success depositLogSetupFailedFunc, +func (dl *DepositLog) WatchRegisteredPubkey( + success depositLogRegisteredPubkeyFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { @@ -2274,7 +2268,7 @@ func (dl *DepositLog) WatchSetupFailed( return err } - subscription, err := dl.subscribeSetupFailed( + subscription, err := dl.subscribeRegisteredPubkey( success, failCallback, _depositContractAddressFilter, @@ -2297,7 +2291,7 @@ func (dl *DepositLog) WatchSetupFailed( select { case <-errorChan: dlLogger.Warning( - "subscription to event SetupFailed terminated with error; " + + "subscription to event RegisteredPubkey terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -2318,13 +2312,13 @@ func (dl *DepositLog) WatchSetupFailed( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeSetupFailed( - success depositLogSetupFailedFunc, +func (dl *DepositLog) subscribeRegisteredPubkey( + success depositLogRegisteredPubkeyFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogSetupFailed) - eventSubscription, err := dl.contract.WatchSetupFailed( + eventChan := make(chan *abi.DepositLogRegisteredPubkey) + eventSubscription, err := dl.contract.WatchRegisteredPubkey( nil, eventChan, _depositContractAddressFilter, @@ -2332,7 +2326,7 @@ func (dl *DepositLog) subscribeSetupFailed( if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for SetupFailed events: [%v]", + "error creating watch for RegisteredPubkey events: [%v]", err, ) } @@ -2350,8 +2344,10 @@ func (dl *DepositLog) subscribeSetupFailed( return } success( - event._depositContractAddress, - event._timestamp, + event.DepositContractAddress, + event.SigningGroupPubkeyX, + event.SigningGroupPubkeyY, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -2373,15 +2369,14 @@ func (dl *DepositLog) subscribeSetupFailed( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type depositLogStartedLiquidationFunc func( - _depositContractAddress common.Address, - _wasFraud bool, - _timestamp *big.Int, +type depositLogCourtesyCalledFunc func( + DepositContractAddress common.Address, + Timestamp *big.Int, blockNumber uint64, ) -func (dl *DepositLog) WatchStartedLiquidation( - success depositLogStartedLiquidationFunc, +func (dl *DepositLog) WatchCourtesyCalled( + success depositLogCourtesyCalledFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { @@ -2400,7 +2395,7 @@ func (dl *DepositLog) WatchStartedLiquidation( return err } - subscription, err := dl.subscribeStartedLiquidation( + subscription, err := dl.subscribeCourtesyCalled( success, failCallback, _depositContractAddressFilter, @@ -2423,7 +2418,7 @@ func (dl *DepositLog) WatchStartedLiquidation( select { case <-errorChan: dlLogger.Warning( - "subscription to event StartedLiquidation terminated with error; " + + "subscription to event CourtesyCalled terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -2444,13 +2439,13 @@ func (dl *DepositLog) WatchStartedLiquidation( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeStartedLiquidation( - success depositLogStartedLiquidationFunc, +func (dl *DepositLog) subscribeCourtesyCalled( + success depositLogCourtesyCalledFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogStartedLiquidation) - eventSubscription, err := dl.contract.WatchStartedLiquidation( + eventChan := make(chan *abi.DepositLogCourtesyCalled) + eventSubscription, err := dl.contract.WatchCourtesyCalled( nil, eventChan, _depositContractAddressFilter, @@ -2458,7 +2453,7 @@ func (dl *DepositLog) subscribeStartedLiquidation( if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for StartedLiquidation events: [%v]", + "error creating watch for CourtesyCalled events: [%v]", err, ) } @@ -2476,9 +2471,8 @@ func (dl *DepositLog) subscribeStartedLiquidation( return } success( - event._depositContractAddress, - event._wasFraud, - event._timestamp, + event.DepositContractAddress, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -2500,16 +2494,18 @@ func (dl *DepositLog) subscribeStartedLiquidation( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type depositLogExitedCourtesyCallFunc func( - _depositContractAddress common.Address, - _timestamp *big.Int, +type depositLogCreatedFunc func( + DepositContractAddress common.Address, + KeepAddress common.Address, + Timestamp *big.Int, blockNumber uint64, ) -func (dl *DepositLog) WatchExitedCourtesyCall( - success depositLogExitedCourtesyCallFunc, +func (dl *DepositLog) WatchCreated( + success depositLogCreatedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _keepAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -2526,10 +2522,11 @@ func (dl *DepositLog) WatchExitedCourtesyCall( return err } - subscription, err := dl.subscribeExitedCourtesyCall( + subscription, err := dl.subscribeCreated( success, failCallback, _depositContractAddressFilter, + _keepAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -2549,7 +2546,7 @@ func (dl *DepositLog) WatchExitedCourtesyCall( select { case <-errorChan: dlLogger.Warning( - "subscription to event ExitedCourtesyCall terminated with error; " + + "subscription to event Created terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -2570,21 +2567,23 @@ func (dl *DepositLog) WatchExitedCourtesyCall( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeExitedCourtesyCall( - success depositLogExitedCourtesyCallFunc, +func (dl *DepositLog) subscribeCreated( + success depositLogCreatedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _keepAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogExitedCourtesyCall) - eventSubscription, err := dl.contract.WatchExitedCourtesyCall( + eventChan := make(chan *abi.DepositLogCreated) + eventSubscription, err := dl.contract.WatchCreated( nil, eventChan, _depositContractAddressFilter, + _keepAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for ExitedCourtesyCall events: [%v]", + "error creating watch for Created events: [%v]", err, ) } @@ -2602,8 +2601,9 @@ func (dl *DepositLog) subscribeExitedCourtesyCall( return } success( - event._depositContractAddress, - event._timestamp, + event.DepositContractAddress, + event.KeepAddress, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -2626,9 +2626,9 @@ func (dl *DepositLog) subscribeExitedCourtesyCall( } type depositLogFundedFunc func( - _depositContractAddress common.Address, - _txid [32]uint8, - _timestamp *big.Int, + DepositContractAddress common.Address, + Txid [32]uint8, + Timestamp *big.Int, blockNumber uint64, ) @@ -2732,9 +2732,9 @@ func (dl *DepositLog) subscribeFunded( return } success( - event._depositContractAddress, - event._txid, - event._timestamp, + event.DepositContractAddress, + event.Txid, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -2756,16 +2756,20 @@ func (dl *DepositLog) subscribeFunded( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type depositLogFraudDuringSetupFunc func( - _depositContractAddress common.Address, - _timestamp *big.Int, +type depositLogGotRedemptionSignatureFunc func( + DepositContractAddress common.Address, + Digest [32]uint8, + R [32]uint8, + S [32]uint8, + Timestamp *big.Int, blockNumber uint64, ) -func (dl *DepositLog) WatchFraudDuringSetup( - success depositLogFraudDuringSetupFunc, +func (dl *DepositLog) WatchGotRedemptionSignature( + success depositLogGotRedemptionSignatureFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -2782,10 +2786,11 @@ func (dl *DepositLog) WatchFraudDuringSetup( return err } - subscription, err := dl.subscribeFraudDuringSetup( + subscription, err := dl.subscribeGotRedemptionSignature( success, failCallback, _depositContractAddressFilter, + _digestFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -2805,7 +2810,7 @@ func (dl *DepositLog) WatchFraudDuringSetup( select { case <-errorChan: dlLogger.Warning( - "subscription to event FraudDuringSetup terminated with error; " + + "subscription to event GotRedemptionSignature terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -2826,21 +2831,23 @@ func (dl *DepositLog) WatchFraudDuringSetup( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeFraudDuringSetup( - success depositLogFraudDuringSetupFunc, +func (dl *DepositLog) subscribeGotRedemptionSignature( + success depositLogGotRedemptionSignatureFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogFraudDuringSetup) - eventSubscription, err := dl.contract.WatchFraudDuringSetup( + eventChan := make(chan *abi.DepositLogGotRedemptionSignature) + eventSubscription, err := dl.contract.WatchGotRedemptionSignature( nil, eventChan, _depositContractAddressFilter, + _digestFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for FraudDuringSetup events: [%v]", + "error creating watch for GotRedemptionSignature events: [%v]", err, ) } @@ -2858,8 +2865,11 @@ func (dl *DepositLog) subscribeFraudDuringSetup( return } success( - event._depositContractAddress, - event._timestamp, + event.DepositContractAddress, + event.Digest, + event.R, + event.S, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -2881,14 +2891,14 @@ func (dl *DepositLog) subscribeFraudDuringSetup( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type depositLogFunderAbortRequestedFunc func( - _depositContractAddress common.Address, - _abortOutputScript []uint8, +type depositLogSetupFailedFunc func( + DepositContractAddress common.Address, + Timestamp *big.Int, blockNumber uint64, ) -func (dl *DepositLog) WatchFunderAbortRequested( - success depositLogFunderAbortRequestedFunc, +func (dl *DepositLog) WatchSetupFailed( + success depositLogSetupFailedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { @@ -2907,7 +2917,7 @@ func (dl *DepositLog) WatchFunderAbortRequested( return err } - subscription, err := dl.subscribeFunderAbortRequested( + subscription, err := dl.subscribeSetupFailed( success, failCallback, _depositContractAddressFilter, @@ -2930,7 +2940,7 @@ func (dl *DepositLog) WatchFunderAbortRequested( select { case <-errorChan: dlLogger.Warning( - "subscription to event FunderAbortRequested terminated with error; " + + "subscription to event SetupFailed terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -2951,13 +2961,13 @@ func (dl *DepositLog) WatchFunderAbortRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeFunderAbortRequested( - success depositLogFunderAbortRequestedFunc, +func (dl *DepositLog) subscribeSetupFailed( + success depositLogSetupFailedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogFunderAbortRequested) - eventSubscription, err := dl.contract.WatchFunderAbortRequested( + eventChan := make(chan *abi.DepositLogSetupFailed) + eventSubscription, err := dl.contract.WatchSetupFailed( nil, eventChan, _depositContractAddressFilter, @@ -2965,7 +2975,7 @@ func (dl *DepositLog) subscribeFunderAbortRequested( if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for FunderAbortRequested events: [%v]", + "error creating watch for SetupFailed events: [%v]", err, ) } @@ -2983,8 +2993,8 @@ func (dl *DepositLog) subscribeFunderAbortRequested( return } success( - event._depositContractAddress, - event._abortOutputScript, + event.DepositContractAddress, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -3006,14 +3016,14 @@ func (dl *DepositLog) subscribeFunderAbortRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type depositLogLiquidatedFunc func( - _depositContractAddress common.Address, - _timestamp *big.Int, +type depositLogExitedCourtesyCallFunc func( + DepositContractAddress common.Address, + Timestamp *big.Int, blockNumber uint64, ) -func (dl *DepositLog) WatchLiquidated( - success depositLogLiquidatedFunc, +func (dl *DepositLog) WatchExitedCourtesyCall( + success depositLogExitedCourtesyCallFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { @@ -3032,7 +3042,7 @@ func (dl *DepositLog) WatchLiquidated( return err } - subscription, err := dl.subscribeLiquidated( + subscription, err := dl.subscribeExitedCourtesyCall( success, failCallback, _depositContractAddressFilter, @@ -3055,7 +3065,7 @@ func (dl *DepositLog) WatchLiquidated( select { case <-errorChan: dlLogger.Warning( - "subscription to event Liquidated terminated with error; " + + "subscription to event ExitedCourtesyCall terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -3076,13 +3086,13 @@ func (dl *DepositLog) WatchLiquidated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeLiquidated( - success depositLogLiquidatedFunc, +func (dl *DepositLog) subscribeExitedCourtesyCall( + success depositLogExitedCourtesyCallFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogLiquidated) - eventSubscription, err := dl.contract.WatchLiquidated( + eventChan := make(chan *abi.DepositLogExitedCourtesyCall) + eventSubscription, err := dl.contract.WatchExitedCourtesyCall( nil, eventChan, _depositContractAddressFilter, @@ -3090,7 +3100,7 @@ func (dl *DepositLog) subscribeLiquidated( if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for Liquidated events: [%v]", + "error creating watch for ExitedCourtesyCall events: [%v]", err, ) } @@ -3108,8 +3118,8 @@ func (dl *DepositLog) subscribeLiquidated( return } success( - event._depositContractAddress, - event._timestamp, + event.DepositContractAddress, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -3131,18 +3141,16 @@ func (dl *DepositLog) subscribeLiquidated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type depositLogRedeemedFunc func( - _depositContractAddress common.Address, - _txid [32]uint8, - _timestamp *big.Int, +type depositLogFraudDuringSetupFunc func( + DepositContractAddress common.Address, + Timestamp *big.Int, blockNumber uint64, ) -func (dl *DepositLog) WatchRedeemed( - success depositLogRedeemedFunc, +func (dl *DepositLog) WatchFraudDuringSetup( + success depositLogFraudDuringSetupFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -3159,11 +3167,10 @@ func (dl *DepositLog) WatchRedeemed( return err } - subscription, err := dl.subscribeRedeemed( + subscription, err := dl.subscribeFraudDuringSetup( success, failCallback, _depositContractAddressFilter, - _txidFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -3183,7 +3190,7 @@ func (dl *DepositLog) WatchRedeemed( select { case <-errorChan: dlLogger.Warning( - "subscription to event Redeemed terminated with error; " + + "subscription to event FraudDuringSetup terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -3204,23 +3211,21 @@ func (dl *DepositLog) WatchRedeemed( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeRedeemed( - success depositLogRedeemedFunc, +func (dl *DepositLog) subscribeFraudDuringSetup( + success depositLogFraudDuringSetupFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogRedeemed) - eventSubscription, err := dl.contract.WatchRedeemed( + eventChan := make(chan *abi.DepositLogFraudDuringSetup) + eventSubscription, err := dl.contract.WatchFraudDuringSetup( nil, eventChan, _depositContractAddressFilter, - _txidFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for Redeemed events: [%v]", + "error creating watch for FraudDuringSetup events: [%v]", err, ) } @@ -3238,9 +3243,8 @@ func (dl *DepositLog) subscribeRedeemed( return } success( - event._depositContractAddress, - event._txid, - event._timestamp, + event.DepositContractAddress, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -3262,14 +3266,14 @@ func (dl *DepositLog) subscribeRedeemed( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type depositLogCourtesyCalledFunc func( - _depositContractAddress common.Address, - _timestamp *big.Int, +type depositLogFunderAbortRequestedFunc func( + DepositContractAddress common.Address, + AbortOutputScript []uint8, blockNumber uint64, ) -func (dl *DepositLog) WatchCourtesyCalled( - success depositLogCourtesyCalledFunc, +func (dl *DepositLog) WatchFunderAbortRequested( + success depositLogFunderAbortRequestedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { @@ -3288,7 +3292,7 @@ func (dl *DepositLog) WatchCourtesyCalled( return err } - subscription, err := dl.subscribeCourtesyCalled( + subscription, err := dl.subscribeFunderAbortRequested( success, failCallback, _depositContractAddressFilter, @@ -3311,7 +3315,7 @@ func (dl *DepositLog) WatchCourtesyCalled( select { case <-errorChan: dlLogger.Warning( - "subscription to event CourtesyCalled terminated with error; " + + "subscription to event FunderAbortRequested terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -3332,13 +3336,13 @@ func (dl *DepositLog) WatchCourtesyCalled( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeCourtesyCalled( - success depositLogCourtesyCalledFunc, +func (dl *DepositLog) subscribeFunderAbortRequested( + success depositLogFunderAbortRequestedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogCourtesyCalled) - eventSubscription, err := dl.contract.WatchCourtesyCalled( + eventChan := make(chan *abi.DepositLogFunderAbortRequested) + eventSubscription, err := dl.contract.WatchFunderAbortRequested( nil, eventChan, _depositContractAddressFilter, @@ -3346,7 +3350,7 @@ func (dl *DepositLog) subscribeCourtesyCalled( if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for CourtesyCalled events: [%v]", + "error creating watch for FunderAbortRequested events: [%v]", err, ) } @@ -3364,8 +3368,8 @@ func (dl *DepositLog) subscribeCourtesyCalled( return } success( - event._depositContractAddress, - event._timestamp, + event.DepositContractAddress, + event.AbortOutputScript, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -3387,18 +3391,17 @@ func (dl *DepositLog) subscribeCourtesyCalled( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type depositLogCreatedFunc func( - _depositContractAddress common.Address, - _keepAddress common.Address, - _timestamp *big.Int, +type depositLogStartedLiquidationFunc func( + DepositContractAddress common.Address, + WasFraud bool, + Timestamp *big.Int, blockNumber uint64, ) -func (dl *DepositLog) WatchCreated( - success depositLogCreatedFunc, +func (dl *DepositLog) WatchStartedLiquidation( + success depositLogStartedLiquidationFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _keepAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -3415,11 +3418,10 @@ func (dl *DepositLog) WatchCreated( return err } - subscription, err := dl.subscribeCreated( + subscription, err := dl.subscribeStartedLiquidation( success, failCallback, _depositContractAddressFilter, - _keepAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -3439,7 +3441,7 @@ func (dl *DepositLog) WatchCreated( select { case <-errorChan: dlLogger.Warning( - "subscription to event Created terminated with error; " + + "subscription to event StartedLiquidation terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -3460,23 +3462,21 @@ func (dl *DepositLog) WatchCreated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (dl *DepositLog) subscribeCreated( - success depositLogCreatedFunc, +func (dl *DepositLog) subscribeStartedLiquidation( + success depositLogStartedLiquidationFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _keepAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogCreated) - eventSubscription, err := dl.contract.WatchCreated( + eventChan := make(chan *abi.DepositLogStartedLiquidation) + eventSubscription, err := dl.contract.WatchStartedLiquidation( nil, eventChan, _depositContractAddressFilter, - _keepAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for Created events: [%v]", + "error creating watch for StartedLiquidation events: [%v]", err, ) } @@ -3494,9 +3494,9 @@ func (dl *DepositLog) subscribeCreated( return } success( - event._depositContractAddress, - event._keepAddress, - event._timestamp, + event.DepositContractAddress, + event.WasFraud, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() diff --git a/go/generate.sh b/go/generate.sh index 65a73e49a..97d6b956e 100755 --- a/go/generate.sh +++ b/go/generate.sh @@ -1,6 +1,6 @@ #!/bin/bash -DIR=../../solidity +DIR=../solidity # Source contracts for binding generation. # They should include the subdirectory prefix if any. From f8f4d65fbc31fe95803234c6b6df658a29f8564f Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Thu, 15 Oct 2020 13:30:33 +0200 Subject: [PATCH 07/14] Generate `TBTCSystem` binding instead of `DepositLog` This change is motivated by the fact that `TBTCSystem` contract derives from `DepositLog` and it is the contract actually emitting deposit lifecycle events. --- go/Makefile | 5 +- go/abi/DepositLog.go | 2406 ---------- go/abi/system/TBTCSystem.go | 5145 ++++++++++++++++++++++ go/cmd/Deposit.go | 364 +- go/cmd/DepositLog.go | 445 -- go/cmd/TBTCSystem.go | 1734 ++++++++ go/contract/Deposit.go | 1558 +++---- go/contract/DepositLog.go | 3519 --------------- go/contract/TBTCSystem.go | 8310 +++++++++++++++++++++++++++++++++++ go/gen.go | 2 +- go/generate.sh | 9 - 11 files changed, 16153 insertions(+), 7344 deletions(-) delete mode 100644 go/abi/DepositLog.go create mode 100644 go/abi/system/TBTCSystem.go delete mode 100644 go/cmd/DepositLog.go create mode 100644 go/cmd/TBTCSystem.go delete mode 100644 go/contract/DepositLog.go create mode 100644 go/contract/TBTCSystem.go delete mode 100755 go/generate.sh diff --git a/go/Makefile b/go/Makefile index 62f6c10ea..0efae55a3 100644 --- a/go/Makefile +++ b/go/Makefile @@ -37,12 +37,11 @@ abi/%.go: abi/%.abi $(eval type=$(notdir $*)) go run github.com/ethereum/go-ethereum/cmd/abigen --abi $< --pkg abi --type $(type) --out $@ -contract/DepositLog.go cmd/DepositLog.go: abi/DepositLog.abi abi/DepositLog.go *.go - go run github.com/keep-network/keep-common/tools/generators/ethereum $< contract/DepositLog.go cmd/DepositLog.go - contract/deposit/Deposit.go cmd/deposit/Deposit.go: abi/deposit/Deposit.abi abi/deposit/Deposit.go *.go go run github.com/keep-network/keep-common/tools/generators/ethereum $< contract/Deposit.go cmd/Deposit.go +contract/system/TBTCSystem.go cmd/system/TBTCSystem.go: abi/system/TBTCSystem.abi abi/system/TBTCSystem.go *.go + go run github.com/keep-network/keep-common/tools/generators/ethereum $< contract/TBTCSystem.go cmd/TBTCSystem.go diff --git a/go/abi/DepositLog.go b/go/abi/DepositLog.go deleted file mode 100644 index 1e3999447..000000000 --- a/go/abi/DepositLog.go +++ /dev/null @@ -1,2406 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package abi - -import ( - "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 ( - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = abi.U256 - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription -) - -// DepositLogABI is the input ABI used to generate the binding from. -const DepositLogABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"CourtesyCalled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_keepAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"Created\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"ExitedCourtesyCall\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"FraudDuringSetup\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_txid\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"Funded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_abortOutputScript\",\"type\":\"bytes\"}],\"name\":\"FunderAbortRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_digest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_r\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_s\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"GotRedemptionSignature\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"Liquidated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_txid\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"Redeemed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_digest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_utxoValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_redeemerOutputScript\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_requestedFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_outpoint\",\"type\":\"bytes\"}],\"name\":\"RedemptionRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_signingGroupPubkeyX\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_signingGroupPubkeyY\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"RegisteredPubkey\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"SetupFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_wasFraud\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"StartedLiquidation\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_caller\",\"type\":\"address\"}],\"name\":\"approvedToLog\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"logCourtesyCalled\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_keepAddress\",\"type\":\"address\"}],\"name\":\"logCreated\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"logExitedCourtesyCall\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"logFraudDuringSetup\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_txid\",\"type\":\"bytes32\"}],\"name\":\"logFunded\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_abortOutputScript\",\"type\":\"bytes\"}],\"name\":\"logFunderRequestedAbort\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_digest\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_s\",\"type\":\"bytes32\"}],\"name\":\"logGotRedemptionSignature\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"logLiquidated\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_txid\",\"type\":\"bytes32\"}],\"name\":\"logRedeemed\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_requester\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_digest\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_utxoValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_redeemerOutputScript\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_requestedFee\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_outpoint\",\"type\":\"bytes\"}],\"name\":\"logRedemptionRequested\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_signingGroupPubkeyX\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_signingGroupPubkeyY\",\"type\":\"bytes32\"}],\"name\":\"logRegisteredPubkey\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"logSetupFailed\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bool\",\"name\":\"_wasFraud\",\"type\":\"bool\"}],\"name\":\"logStartedLiquidation\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" - -// DepositLog is an auto generated Go binding around an Ethereum contract. -type DepositLog struct { - DepositLogCaller // Read-only binding to the contract - DepositLogTransactor // Write-only binding to the contract - DepositLogFilterer // Log filterer for contract events -} - -// DepositLogCaller is an auto generated read-only Go binding around an Ethereum contract. -type DepositLogCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// DepositLogTransactor is an auto generated write-only Go binding around an Ethereum contract. -type DepositLogTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// DepositLogFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type DepositLogFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// DepositLogSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type DepositLogSession struct { - Contract *DepositLog // 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 -} - -// DepositLogCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type DepositLogCallerSession struct { - Contract *DepositLogCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// DepositLogTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type DepositLogTransactorSession struct { - Contract *DepositLogTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// DepositLogRaw is an auto generated low-level Go binding around an Ethereum contract. -type DepositLogRaw struct { - Contract *DepositLog // Generic contract binding to access the raw methods on -} - -// DepositLogCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type DepositLogCallerRaw struct { - Contract *DepositLogCaller // Generic read-only contract binding to access the raw methods on -} - -// DepositLogTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type DepositLogTransactorRaw struct { - Contract *DepositLogTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewDepositLog creates a new instance of DepositLog, bound to a specific deployed contract. -func NewDepositLog(address common.Address, backend bind.ContractBackend) (*DepositLog, error) { - contract, err := bindDepositLog(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &DepositLog{DepositLogCaller: DepositLogCaller{contract: contract}, DepositLogTransactor: DepositLogTransactor{contract: contract}, DepositLogFilterer: DepositLogFilterer{contract: contract}}, nil -} - -// NewDepositLogCaller creates a new read-only instance of DepositLog, bound to a specific deployed contract. -func NewDepositLogCaller(address common.Address, caller bind.ContractCaller) (*DepositLogCaller, error) { - contract, err := bindDepositLog(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &DepositLogCaller{contract: contract}, nil -} - -// NewDepositLogTransactor creates a new write-only instance of DepositLog, bound to a specific deployed contract. -func NewDepositLogTransactor(address common.Address, transactor bind.ContractTransactor) (*DepositLogTransactor, error) { - contract, err := bindDepositLog(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &DepositLogTransactor{contract: contract}, nil -} - -// NewDepositLogFilterer creates a new log filterer instance of DepositLog, bound to a specific deployed contract. -func NewDepositLogFilterer(address common.Address, filterer bind.ContractFilterer) (*DepositLogFilterer, error) { - contract, err := bindDepositLog(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &DepositLogFilterer{contract: contract}, nil -} - -// bindDepositLog binds a generic wrapper to an already deployed contract. -func bindDepositLog(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(DepositLogABI)) - 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 (_DepositLog *DepositLogRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _DepositLog.Contract.DepositLogCaller.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 (_DepositLog *DepositLogRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _DepositLog.Contract.DepositLogTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_DepositLog *DepositLogRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _DepositLog.Contract.DepositLogTransactor.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 (_DepositLog *DepositLogCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { - return _DepositLog.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 (_DepositLog *DepositLogTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _DepositLog.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_DepositLog *DepositLogTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _DepositLog.Contract.contract.Transact(opts, method, params...) -} - -// ApprovedToLog is a free data retrieval call binding the contract method 0x9ffb3862. -// -// Solidity: function approvedToLog(address _caller) constant returns(bool) -func (_DepositLog *DepositLogCaller) ApprovedToLog(opts *bind.CallOpts, _caller common.Address) (bool, error) { - var ( - ret0 = new(bool) - ) - out := ret0 - err := _DepositLog.contract.Call(opts, out, "approvedToLog", _caller) - return *ret0, err -} - -// ApprovedToLog is a free data retrieval call binding the contract method 0x9ffb3862. -// -// Solidity: function approvedToLog(address _caller) constant returns(bool) -func (_DepositLog *DepositLogSession) ApprovedToLog(_caller common.Address) (bool, error) { - return _DepositLog.Contract.ApprovedToLog(&_DepositLog.CallOpts, _caller) -} - -// ApprovedToLog is a free data retrieval call binding the contract method 0x9ffb3862. -// -// Solidity: function approvedToLog(address _caller) constant returns(bool) -func (_DepositLog *DepositLogCallerSession) ApprovedToLog(_caller common.Address) (bool, error) { - return _DepositLog.Contract.ApprovedToLog(&_DepositLog.CallOpts, _caller) -} - -// LogCourtesyCalled is a paid mutator transaction binding the contract method 0x22a147e6. -// -// Solidity: function logCourtesyCalled() returns() -func (_DepositLog *DepositLogTransactor) LogCourtesyCalled(opts *bind.TransactOpts) (*types.Transaction, error) { - return _DepositLog.contract.Transact(opts, "logCourtesyCalled") -} - -// LogCourtesyCalled is a paid mutator transaction binding the contract method 0x22a147e6. -// -// Solidity: function logCourtesyCalled() returns() -func (_DepositLog *DepositLogSession) LogCourtesyCalled() (*types.Transaction, error) { - return _DepositLog.Contract.LogCourtesyCalled(&_DepositLog.TransactOpts) -} - -// LogCourtesyCalled is a paid mutator transaction binding the contract method 0x22a147e6. -// -// Solidity: function logCourtesyCalled() returns() -func (_DepositLog *DepositLogTransactorSession) LogCourtesyCalled() (*types.Transaction, error) { - return _DepositLog.Contract.LogCourtesyCalled(&_DepositLog.TransactOpts) -} - -// LogCreated is a paid mutator transaction binding the contract method 0x282bfd38. -// -// Solidity: function logCreated(address _keepAddress) returns() -func (_DepositLog *DepositLogTransactor) LogCreated(opts *bind.TransactOpts, _keepAddress common.Address) (*types.Transaction, error) { - return _DepositLog.contract.Transact(opts, "logCreated", _keepAddress) -} - -// LogCreated is a paid mutator transaction binding the contract method 0x282bfd38. -// -// Solidity: function logCreated(address _keepAddress) returns() -func (_DepositLog *DepositLogSession) LogCreated(_keepAddress common.Address) (*types.Transaction, error) { - return _DepositLog.Contract.LogCreated(&_DepositLog.TransactOpts, _keepAddress) -} - -// LogCreated is a paid mutator transaction binding the contract method 0x282bfd38. -// -// Solidity: function logCreated(address _keepAddress) returns() -func (_DepositLog *DepositLogTransactorSession) LogCreated(_keepAddress common.Address) (*types.Transaction, error) { - return _DepositLog.Contract.LogCreated(&_DepositLog.TransactOpts, _keepAddress) -} - -// LogExitedCourtesyCall is a paid mutator transaction binding the contract method 0x22e5724c. -// -// Solidity: function logExitedCourtesyCall() returns() -func (_DepositLog *DepositLogTransactor) LogExitedCourtesyCall(opts *bind.TransactOpts) (*types.Transaction, error) { - return _DepositLog.contract.Transact(opts, "logExitedCourtesyCall") -} - -// LogExitedCourtesyCall is a paid mutator transaction binding the contract method 0x22e5724c. -// -// Solidity: function logExitedCourtesyCall() returns() -func (_DepositLog *DepositLogSession) LogExitedCourtesyCall() (*types.Transaction, error) { - return _DepositLog.Contract.LogExitedCourtesyCall(&_DepositLog.TransactOpts) -} - -// LogExitedCourtesyCall is a paid mutator transaction binding the contract method 0x22e5724c. -// -// Solidity: function logExitedCourtesyCall() returns() -func (_DepositLog *DepositLogTransactorSession) LogExitedCourtesyCall() (*types.Transaction, error) { - return _DepositLog.Contract.LogExitedCourtesyCall(&_DepositLog.TransactOpts) -} - -// LogFraudDuringSetup is a paid mutator transaction binding the contract method 0xe2c50ad8. -// -// Solidity: function logFraudDuringSetup() returns() -func (_DepositLog *DepositLogTransactor) LogFraudDuringSetup(opts *bind.TransactOpts) (*types.Transaction, error) { - return _DepositLog.contract.Transact(opts, "logFraudDuringSetup") -} - -// LogFraudDuringSetup is a paid mutator transaction binding the contract method 0xe2c50ad8. -// -// Solidity: function logFraudDuringSetup() returns() -func (_DepositLog *DepositLogSession) LogFraudDuringSetup() (*types.Transaction, error) { - return _DepositLog.Contract.LogFraudDuringSetup(&_DepositLog.TransactOpts) -} - -// LogFraudDuringSetup is a paid mutator transaction binding the contract method 0xe2c50ad8. -// -// Solidity: function logFraudDuringSetup() returns() -func (_DepositLog *DepositLogTransactorSession) LogFraudDuringSetup() (*types.Transaction, error) { - return _DepositLog.Contract.LogFraudDuringSetup(&_DepositLog.TransactOpts) -} - -// LogFunded is a paid mutator transaction binding the contract method 0x7ed451a4. -// -// Solidity: function logFunded(bytes32 _txid) returns() -func (_DepositLog *DepositLogTransactor) LogFunded(opts *bind.TransactOpts, _txid [32]byte) (*types.Transaction, error) { - return _DepositLog.contract.Transact(opts, "logFunded", _txid) -} - -// LogFunded is a paid mutator transaction binding the contract method 0x7ed451a4. -// -// Solidity: function logFunded(bytes32 _txid) returns() -func (_DepositLog *DepositLogSession) LogFunded(_txid [32]byte) (*types.Transaction, error) { - return _DepositLog.Contract.LogFunded(&_DepositLog.TransactOpts, _txid) -} - -// LogFunded is a paid mutator transaction binding the contract method 0x7ed451a4. -// -// Solidity: function logFunded(bytes32 _txid) returns() -func (_DepositLog *DepositLogTransactorSession) LogFunded(_txid [32]byte) (*types.Transaction, error) { - return _DepositLog.Contract.LogFunded(&_DepositLog.TransactOpts, _txid) -} - -// LogFunderRequestedAbort is a paid mutator transaction binding the contract method 0xce2c07ce. -// -// Solidity: function logFunderRequestedAbort(bytes _abortOutputScript) returns() -func (_DepositLog *DepositLogTransactor) LogFunderRequestedAbort(opts *bind.TransactOpts, _abortOutputScript []byte) (*types.Transaction, error) { - return _DepositLog.contract.Transact(opts, "logFunderRequestedAbort", _abortOutputScript) -} - -// LogFunderRequestedAbort is a paid mutator transaction binding the contract method 0xce2c07ce. -// -// Solidity: function logFunderRequestedAbort(bytes _abortOutputScript) returns() -func (_DepositLog *DepositLogSession) LogFunderRequestedAbort(_abortOutputScript []byte) (*types.Transaction, error) { - return _DepositLog.Contract.LogFunderRequestedAbort(&_DepositLog.TransactOpts, _abortOutputScript) -} - -// LogFunderRequestedAbort is a paid mutator transaction binding the contract method 0xce2c07ce. -// -// Solidity: function logFunderRequestedAbort(bytes _abortOutputScript) returns() -func (_DepositLog *DepositLogTransactorSession) LogFunderRequestedAbort(_abortOutputScript []byte) (*types.Transaction, error) { - return _DepositLog.Contract.LogFunderRequestedAbort(&_DepositLog.TransactOpts, _abortOutputScript) -} - -// LogGotRedemptionSignature is a paid mutator transaction binding the contract method 0xf760621e. -// -// Solidity: function logGotRedemptionSignature(bytes32 _digest, bytes32 _r, bytes32 _s) returns() -func (_DepositLog *DepositLogTransactor) LogGotRedemptionSignature(opts *bind.TransactOpts, _digest [32]byte, _r [32]byte, _s [32]byte) (*types.Transaction, error) { - return _DepositLog.contract.Transact(opts, "logGotRedemptionSignature", _digest, _r, _s) -} - -// LogGotRedemptionSignature is a paid mutator transaction binding the contract method 0xf760621e. -// -// Solidity: function logGotRedemptionSignature(bytes32 _digest, bytes32 _r, bytes32 _s) returns() -func (_DepositLog *DepositLogSession) LogGotRedemptionSignature(_digest [32]byte, _r [32]byte, _s [32]byte) (*types.Transaction, error) { - return _DepositLog.Contract.LogGotRedemptionSignature(&_DepositLog.TransactOpts, _digest, _r, _s) -} - -// LogGotRedemptionSignature is a paid mutator transaction binding the contract method 0xf760621e. -// -// Solidity: function logGotRedemptionSignature(bytes32 _digest, bytes32 _r, bytes32 _s) returns() -func (_DepositLog *DepositLogTransactorSession) LogGotRedemptionSignature(_digest [32]byte, _r [32]byte, _s [32]byte) (*types.Transaction, error) { - return _DepositLog.Contract.LogGotRedemptionSignature(&_DepositLog.TransactOpts, _digest, _r, _s) -} - -// LogLiquidated is a paid mutator transaction binding the contract method 0xc8fba243. -// -// Solidity: function logLiquidated() returns() -func (_DepositLog *DepositLogTransactor) LogLiquidated(opts *bind.TransactOpts) (*types.Transaction, error) { - return _DepositLog.contract.Transact(opts, "logLiquidated") -} - -// LogLiquidated is a paid mutator transaction binding the contract method 0xc8fba243. -// -// Solidity: function logLiquidated() returns() -func (_DepositLog *DepositLogSession) LogLiquidated() (*types.Transaction, error) { - return _DepositLog.Contract.LogLiquidated(&_DepositLog.TransactOpts) -} - -// LogLiquidated is a paid mutator transaction binding the contract method 0xc8fba243. -// -// Solidity: function logLiquidated() returns() -func (_DepositLog *DepositLogTransactorSession) LogLiquidated() (*types.Transaction, error) { - return _DepositLog.Contract.LogLiquidated(&_DepositLog.TransactOpts) -} - -// LogRedeemed is a paid mutator transaction binding the contract method 0x6e1ba283. -// -// Solidity: function logRedeemed(bytes32 _txid) returns() -func (_DepositLog *DepositLogTransactor) LogRedeemed(opts *bind.TransactOpts, _txid [32]byte) (*types.Transaction, error) { - return _DepositLog.contract.Transact(opts, "logRedeemed", _txid) -} - -// LogRedeemed is a paid mutator transaction binding the contract method 0x6e1ba283. -// -// Solidity: function logRedeemed(bytes32 _txid) returns() -func (_DepositLog *DepositLogSession) LogRedeemed(_txid [32]byte) (*types.Transaction, error) { - return _DepositLog.Contract.LogRedeemed(&_DepositLog.TransactOpts, _txid) -} - -// LogRedeemed is a paid mutator transaction binding the contract method 0x6e1ba283. -// -// Solidity: function logRedeemed(bytes32 _txid) returns() -func (_DepositLog *DepositLogTransactorSession) LogRedeemed(_txid [32]byte) (*types.Transaction, error) { - return _DepositLog.Contract.LogRedeemed(&_DepositLog.TransactOpts, _txid) -} - -// LogRedemptionRequested is a paid mutator transaction binding the contract method 0x18e647dd. -// -// Solidity: function logRedemptionRequested(address _requester, bytes32 _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) returns() -func (_DepositLog *DepositLogTransactor) LogRedemptionRequested(opts *bind.TransactOpts, _requester common.Address, _digest [32]byte, _utxoValue *big.Int, _redeemerOutputScript []byte, _requestedFee *big.Int, _outpoint []byte) (*types.Transaction, error) { - return _DepositLog.contract.Transact(opts, "logRedemptionRequested", _requester, _digest, _utxoValue, _redeemerOutputScript, _requestedFee, _outpoint) -} - -// LogRedemptionRequested is a paid mutator transaction binding the contract method 0x18e647dd. -// -// Solidity: function logRedemptionRequested(address _requester, bytes32 _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) returns() -func (_DepositLog *DepositLogSession) LogRedemptionRequested(_requester common.Address, _digest [32]byte, _utxoValue *big.Int, _redeemerOutputScript []byte, _requestedFee *big.Int, _outpoint []byte) (*types.Transaction, error) { - return _DepositLog.Contract.LogRedemptionRequested(&_DepositLog.TransactOpts, _requester, _digest, _utxoValue, _redeemerOutputScript, _requestedFee, _outpoint) -} - -// LogRedemptionRequested is a paid mutator transaction binding the contract method 0x18e647dd. -// -// Solidity: function logRedemptionRequested(address _requester, bytes32 _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) returns() -func (_DepositLog *DepositLogTransactorSession) LogRedemptionRequested(_requester common.Address, _digest [32]byte, _utxoValue *big.Int, _redeemerOutputScript []byte, _requestedFee *big.Int, _outpoint []byte) (*types.Transaction, error) { - return _DepositLog.Contract.LogRedemptionRequested(&_DepositLog.TransactOpts, _requester, _digest, _utxoValue, _redeemerOutputScript, _requestedFee, _outpoint) -} - -// LogRegisteredPubkey is a paid mutator transaction binding the contract method 0x869f9469. -// -// Solidity: function logRegisteredPubkey(bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY) returns() -func (_DepositLog *DepositLogTransactor) LogRegisteredPubkey(opts *bind.TransactOpts, _signingGroupPubkeyX [32]byte, _signingGroupPubkeyY [32]byte) (*types.Transaction, error) { - return _DepositLog.contract.Transact(opts, "logRegisteredPubkey", _signingGroupPubkeyX, _signingGroupPubkeyY) -} - -// LogRegisteredPubkey is a paid mutator transaction binding the contract method 0x869f9469. -// -// Solidity: function logRegisteredPubkey(bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY) returns() -func (_DepositLog *DepositLogSession) LogRegisteredPubkey(_signingGroupPubkeyX [32]byte, _signingGroupPubkeyY [32]byte) (*types.Transaction, error) { - return _DepositLog.Contract.LogRegisteredPubkey(&_DepositLog.TransactOpts, _signingGroupPubkeyX, _signingGroupPubkeyY) -} - -// LogRegisteredPubkey is a paid mutator transaction binding the contract method 0x869f9469. -// -// Solidity: function logRegisteredPubkey(bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY) returns() -func (_DepositLog *DepositLogTransactorSession) LogRegisteredPubkey(_signingGroupPubkeyX [32]byte, _signingGroupPubkeyY [32]byte) (*types.Transaction, error) { - return _DepositLog.Contract.LogRegisteredPubkey(&_DepositLog.TransactOpts, _signingGroupPubkeyX, _signingGroupPubkeyY) -} - -// LogSetupFailed is a paid mutator transaction binding the contract method 0xa831c816. -// -// Solidity: function logSetupFailed() returns() -func (_DepositLog *DepositLogTransactor) LogSetupFailed(opts *bind.TransactOpts) (*types.Transaction, error) { - return _DepositLog.contract.Transact(opts, "logSetupFailed") -} - -// LogSetupFailed is a paid mutator transaction binding the contract method 0xa831c816. -// -// Solidity: function logSetupFailed() returns() -func (_DepositLog *DepositLogSession) LogSetupFailed() (*types.Transaction, error) { - return _DepositLog.Contract.LogSetupFailed(&_DepositLog.TransactOpts) -} - -// LogSetupFailed is a paid mutator transaction binding the contract method 0xa831c816. -// -// Solidity: function logSetupFailed() returns() -func (_DepositLog *DepositLogTransactorSession) LogSetupFailed() (*types.Transaction, error) { - return _DepositLog.Contract.LogSetupFailed(&_DepositLog.TransactOpts) -} - -// LogStartedLiquidation is a paid mutator transaction binding the contract method 0x3aac3467. -// -// Solidity: function logStartedLiquidation(bool _wasFraud) returns() -func (_DepositLog *DepositLogTransactor) LogStartedLiquidation(opts *bind.TransactOpts, _wasFraud bool) (*types.Transaction, error) { - return _DepositLog.contract.Transact(opts, "logStartedLiquidation", _wasFraud) -} - -// LogStartedLiquidation is a paid mutator transaction binding the contract method 0x3aac3467. -// -// Solidity: function logStartedLiquidation(bool _wasFraud) returns() -func (_DepositLog *DepositLogSession) LogStartedLiquidation(_wasFraud bool) (*types.Transaction, error) { - return _DepositLog.Contract.LogStartedLiquidation(&_DepositLog.TransactOpts, _wasFraud) -} - -// LogStartedLiquidation is a paid mutator transaction binding the contract method 0x3aac3467. -// -// Solidity: function logStartedLiquidation(bool _wasFraud) returns() -func (_DepositLog *DepositLogTransactorSession) LogStartedLiquidation(_wasFraud bool) (*types.Transaction, error) { - return _DepositLog.Contract.LogStartedLiquidation(&_DepositLog.TransactOpts, _wasFraud) -} - -// DepositLogCourtesyCalledIterator is returned from FilterCourtesyCalled and is used to iterate over the raw logs and unpacked data for CourtesyCalled events raised by the DepositLog contract. -type DepositLogCourtesyCalledIterator struct { - Event *DepositLogCourtesyCalled // 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 *DepositLogCourtesyCalledIterator) 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(DepositLogCourtesyCalled) - 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(DepositLogCourtesyCalled) - 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 *DepositLogCourtesyCalledIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *DepositLogCourtesyCalledIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// DepositLogCourtesyCalled represents a CourtesyCalled event raised by the DepositLog contract. -type DepositLogCourtesyCalled struct { - DepositContractAddress common.Address - Timestamp *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterCourtesyCalled is a free log retrieval operation binding the contract event 0x6e7b45210b79c12cd1332babd8d86c0bbb9ca898a89ce0404f17064dbfba18c0. -// -// Solidity: event CourtesyCalled(address indexed _depositContractAddress, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) FilterCourtesyCalled(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*DepositLogCourtesyCalledIterator, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - - logs, sub, err := _DepositLog.contract.FilterLogs(opts, "CourtesyCalled", _depositContractAddressRule) - if err != nil { - return nil, err - } - return &DepositLogCourtesyCalledIterator{contract: _DepositLog.contract, event: "CourtesyCalled", logs: logs, sub: sub}, nil -} - -// WatchCourtesyCalled is a free log subscription operation binding the contract event 0x6e7b45210b79c12cd1332babd8d86c0bbb9ca898a89ce0404f17064dbfba18c0. -// -// Solidity: event CourtesyCalled(address indexed _depositContractAddress, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) WatchCourtesyCalled(opts *bind.WatchOpts, sink chan<- *DepositLogCourtesyCalled, _depositContractAddress []common.Address) (event.Subscription, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - - logs, sub, err := _DepositLog.contract.WatchLogs(opts, "CourtesyCalled", _depositContractAddressRule) - 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(DepositLogCourtesyCalled) - if err := _DepositLog.contract.UnpackLog(event, "CourtesyCalled", 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 -} - -// ParseCourtesyCalled is a log parse operation binding the contract event 0x6e7b45210b79c12cd1332babd8d86c0bbb9ca898a89ce0404f17064dbfba18c0. -// -// Solidity: event CourtesyCalled(address indexed _depositContractAddress, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) ParseCourtesyCalled(log types.Log) (*DepositLogCourtesyCalled, error) { - event := new(DepositLogCourtesyCalled) - if err := _DepositLog.contract.UnpackLog(event, "CourtesyCalled", log); err != nil { - return nil, err - } - return event, nil -} - -// DepositLogCreatedIterator is returned from FilterCreated and is used to iterate over the raw logs and unpacked data for Created events raised by the DepositLog contract. -type DepositLogCreatedIterator struct { - Event *DepositLogCreated // 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 *DepositLogCreatedIterator) 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(DepositLogCreated) - 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(DepositLogCreated) - 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 *DepositLogCreatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *DepositLogCreatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// DepositLogCreated represents a Created event raised by the DepositLog contract. -type DepositLogCreated struct { - DepositContractAddress common.Address - KeepAddress common.Address - Timestamp *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterCreated is a free log retrieval operation binding the contract event 0x822b3073be62c5c7f143c2dcd71ee266434ee935d90a1eec3be34710ac8ec1a2. -// -// Solidity: event Created(address indexed _depositContractAddress, address indexed _keepAddress, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) FilterCreated(opts *bind.FilterOpts, _depositContractAddress []common.Address, _keepAddress []common.Address) (*DepositLogCreatedIterator, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - var _keepAddressRule []interface{} - for _, _keepAddressItem := range _keepAddress { - _keepAddressRule = append(_keepAddressRule, _keepAddressItem) - } - - logs, sub, err := _DepositLog.contract.FilterLogs(opts, "Created", _depositContractAddressRule, _keepAddressRule) - if err != nil { - return nil, err - } - return &DepositLogCreatedIterator{contract: _DepositLog.contract, event: "Created", logs: logs, sub: sub}, nil -} - -// WatchCreated is a free log subscription operation binding the contract event 0x822b3073be62c5c7f143c2dcd71ee266434ee935d90a1eec3be34710ac8ec1a2. -// -// Solidity: event Created(address indexed _depositContractAddress, address indexed _keepAddress, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) WatchCreated(opts *bind.WatchOpts, sink chan<- *DepositLogCreated, _depositContractAddress []common.Address, _keepAddress []common.Address) (event.Subscription, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - var _keepAddressRule []interface{} - for _, _keepAddressItem := range _keepAddress { - _keepAddressRule = append(_keepAddressRule, _keepAddressItem) - } - - logs, sub, err := _DepositLog.contract.WatchLogs(opts, "Created", _depositContractAddressRule, _keepAddressRule) - 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(DepositLogCreated) - if err := _DepositLog.contract.UnpackLog(event, "Created", 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 -} - -// ParseCreated is a log parse operation binding the contract event 0x822b3073be62c5c7f143c2dcd71ee266434ee935d90a1eec3be34710ac8ec1a2. -// -// Solidity: event Created(address indexed _depositContractAddress, address indexed _keepAddress, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) ParseCreated(log types.Log) (*DepositLogCreated, error) { - event := new(DepositLogCreated) - if err := _DepositLog.contract.UnpackLog(event, "Created", log); err != nil { - return nil, err - } - return event, nil -} - -// DepositLogExitedCourtesyCallIterator is returned from FilterExitedCourtesyCall and is used to iterate over the raw logs and unpacked data for ExitedCourtesyCall events raised by the DepositLog contract. -type DepositLogExitedCourtesyCallIterator struct { - Event *DepositLogExitedCourtesyCall // 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 *DepositLogExitedCourtesyCallIterator) 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(DepositLogExitedCourtesyCall) - 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(DepositLogExitedCourtesyCall) - 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 *DepositLogExitedCourtesyCallIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *DepositLogExitedCourtesyCallIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// DepositLogExitedCourtesyCall represents a ExitedCourtesyCall event raised by the DepositLog contract. -type DepositLogExitedCourtesyCall struct { - DepositContractAddress common.Address - Timestamp *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterExitedCourtesyCall is a free log retrieval operation binding the contract event 0x07f0eaafadb9abb1d28da85d4b4c74f1939fd61b535c7f5ab501f618f07e76ee. -// -// Solidity: event ExitedCourtesyCall(address indexed _depositContractAddress, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) FilterExitedCourtesyCall(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*DepositLogExitedCourtesyCallIterator, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - - logs, sub, err := _DepositLog.contract.FilterLogs(opts, "ExitedCourtesyCall", _depositContractAddressRule) - if err != nil { - return nil, err - } - return &DepositLogExitedCourtesyCallIterator{contract: _DepositLog.contract, event: "ExitedCourtesyCall", logs: logs, sub: sub}, nil -} - -// WatchExitedCourtesyCall is a free log subscription operation binding the contract event 0x07f0eaafadb9abb1d28da85d4b4c74f1939fd61b535c7f5ab501f618f07e76ee. -// -// Solidity: event ExitedCourtesyCall(address indexed _depositContractAddress, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) WatchExitedCourtesyCall(opts *bind.WatchOpts, sink chan<- *DepositLogExitedCourtesyCall, _depositContractAddress []common.Address) (event.Subscription, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - - logs, sub, err := _DepositLog.contract.WatchLogs(opts, "ExitedCourtesyCall", _depositContractAddressRule) - 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(DepositLogExitedCourtesyCall) - if err := _DepositLog.contract.UnpackLog(event, "ExitedCourtesyCall", 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 -} - -// ParseExitedCourtesyCall is a log parse operation binding the contract event 0x07f0eaafadb9abb1d28da85d4b4c74f1939fd61b535c7f5ab501f618f07e76ee. -// -// Solidity: event ExitedCourtesyCall(address indexed _depositContractAddress, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) ParseExitedCourtesyCall(log types.Log) (*DepositLogExitedCourtesyCall, error) { - event := new(DepositLogExitedCourtesyCall) - if err := _DepositLog.contract.UnpackLog(event, "ExitedCourtesyCall", log); err != nil { - return nil, err - } - return event, nil -} - -// DepositLogFraudDuringSetupIterator is returned from FilterFraudDuringSetup and is used to iterate over the raw logs and unpacked data for FraudDuringSetup events raised by the DepositLog contract. -type DepositLogFraudDuringSetupIterator struct { - Event *DepositLogFraudDuringSetup // 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 *DepositLogFraudDuringSetupIterator) 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(DepositLogFraudDuringSetup) - 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(DepositLogFraudDuringSetup) - 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 *DepositLogFraudDuringSetupIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *DepositLogFraudDuringSetupIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// DepositLogFraudDuringSetup represents a FraudDuringSetup event raised by the DepositLog contract. -type DepositLogFraudDuringSetup struct { - DepositContractAddress common.Address - Timestamp *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterFraudDuringSetup is a free log retrieval operation binding the contract event 0x1e61af503f1d7de21d5300094c18bf8700f82b2951a4d54dd2adda13f6b3da30. -// -// Solidity: event FraudDuringSetup(address indexed _depositContractAddress, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) FilterFraudDuringSetup(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*DepositLogFraudDuringSetupIterator, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - - logs, sub, err := _DepositLog.contract.FilterLogs(opts, "FraudDuringSetup", _depositContractAddressRule) - if err != nil { - return nil, err - } - return &DepositLogFraudDuringSetupIterator{contract: _DepositLog.contract, event: "FraudDuringSetup", logs: logs, sub: sub}, nil -} - -// WatchFraudDuringSetup is a free log subscription operation binding the contract event 0x1e61af503f1d7de21d5300094c18bf8700f82b2951a4d54dd2adda13f6b3da30. -// -// Solidity: event FraudDuringSetup(address indexed _depositContractAddress, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) WatchFraudDuringSetup(opts *bind.WatchOpts, sink chan<- *DepositLogFraudDuringSetup, _depositContractAddress []common.Address) (event.Subscription, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - - logs, sub, err := _DepositLog.contract.WatchLogs(opts, "FraudDuringSetup", _depositContractAddressRule) - 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(DepositLogFraudDuringSetup) - if err := _DepositLog.contract.UnpackLog(event, "FraudDuringSetup", 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 -} - -// ParseFraudDuringSetup is a log parse operation binding the contract event 0x1e61af503f1d7de21d5300094c18bf8700f82b2951a4d54dd2adda13f6b3da30. -// -// Solidity: event FraudDuringSetup(address indexed _depositContractAddress, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) ParseFraudDuringSetup(log types.Log) (*DepositLogFraudDuringSetup, error) { - event := new(DepositLogFraudDuringSetup) - if err := _DepositLog.contract.UnpackLog(event, "FraudDuringSetup", log); err != nil { - return nil, err - } - return event, nil -} - -// DepositLogFundedIterator is returned from FilterFunded and is used to iterate over the raw logs and unpacked data for Funded events raised by the DepositLog contract. -type DepositLogFundedIterator struct { - Event *DepositLogFunded // 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 *DepositLogFundedIterator) 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(DepositLogFunded) - 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(DepositLogFunded) - 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 *DepositLogFundedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *DepositLogFundedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// DepositLogFunded represents a Funded event raised by the DepositLog contract. -type DepositLogFunded struct { - DepositContractAddress common.Address - Txid [32]byte - Timestamp *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterFunded is a free log retrieval operation binding the contract event 0xe34c70bd3e03956978a5c76d2ea5f3a60819171afea6dee4fc12b2e45f72d43d. -// -// Solidity: event Funded(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) FilterFunded(opts *bind.FilterOpts, _depositContractAddress []common.Address, _txid [][32]byte) (*DepositLogFundedIterator, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - var _txidRule []interface{} - for _, _txidItem := range _txid { - _txidRule = append(_txidRule, _txidItem) - } - - logs, sub, err := _DepositLog.contract.FilterLogs(opts, "Funded", _depositContractAddressRule, _txidRule) - if err != nil { - return nil, err - } - return &DepositLogFundedIterator{contract: _DepositLog.contract, event: "Funded", logs: logs, sub: sub}, nil -} - -// WatchFunded is a free log subscription operation binding the contract event 0xe34c70bd3e03956978a5c76d2ea5f3a60819171afea6dee4fc12b2e45f72d43d. -// -// Solidity: event Funded(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) WatchFunded(opts *bind.WatchOpts, sink chan<- *DepositLogFunded, _depositContractAddress []common.Address, _txid [][32]byte) (event.Subscription, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - var _txidRule []interface{} - for _, _txidItem := range _txid { - _txidRule = append(_txidRule, _txidItem) - } - - logs, sub, err := _DepositLog.contract.WatchLogs(opts, "Funded", _depositContractAddressRule, _txidRule) - 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(DepositLogFunded) - if err := _DepositLog.contract.UnpackLog(event, "Funded", 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 -} - -// ParseFunded is a log parse operation binding the contract event 0xe34c70bd3e03956978a5c76d2ea5f3a60819171afea6dee4fc12b2e45f72d43d. -// -// Solidity: event Funded(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) ParseFunded(log types.Log) (*DepositLogFunded, error) { - event := new(DepositLogFunded) - if err := _DepositLog.contract.UnpackLog(event, "Funded", log); err != nil { - return nil, err - } - return event, nil -} - -// DepositLogFunderAbortRequestedIterator is returned from FilterFunderAbortRequested and is used to iterate over the raw logs and unpacked data for FunderAbortRequested events raised by the DepositLog contract. -type DepositLogFunderAbortRequestedIterator struct { - Event *DepositLogFunderAbortRequested // 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 *DepositLogFunderAbortRequestedIterator) 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(DepositLogFunderAbortRequested) - 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(DepositLogFunderAbortRequested) - 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 *DepositLogFunderAbortRequestedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *DepositLogFunderAbortRequestedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// DepositLogFunderAbortRequested represents a FunderAbortRequested event raised by the DepositLog contract. -type DepositLogFunderAbortRequested struct { - DepositContractAddress common.Address - AbortOutputScript []byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterFunderAbortRequested is a free log retrieval operation binding the contract event 0xa6e9673b5d53b3fe3c62b6459720f9c2a1b129d4f69acb771404ba8681b6a930. -// -// Solidity: event FunderAbortRequested(address indexed _depositContractAddress, bytes _abortOutputScript) -func (_DepositLog *DepositLogFilterer) FilterFunderAbortRequested(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*DepositLogFunderAbortRequestedIterator, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - - logs, sub, err := _DepositLog.contract.FilterLogs(opts, "FunderAbortRequested", _depositContractAddressRule) - if err != nil { - return nil, err - } - return &DepositLogFunderAbortRequestedIterator{contract: _DepositLog.contract, event: "FunderAbortRequested", logs: logs, sub: sub}, nil -} - -// WatchFunderAbortRequested is a free log subscription operation binding the contract event 0xa6e9673b5d53b3fe3c62b6459720f9c2a1b129d4f69acb771404ba8681b6a930. -// -// Solidity: event FunderAbortRequested(address indexed _depositContractAddress, bytes _abortOutputScript) -func (_DepositLog *DepositLogFilterer) WatchFunderAbortRequested(opts *bind.WatchOpts, sink chan<- *DepositLogFunderAbortRequested, _depositContractAddress []common.Address) (event.Subscription, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - - logs, sub, err := _DepositLog.contract.WatchLogs(opts, "FunderAbortRequested", _depositContractAddressRule) - 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(DepositLogFunderAbortRequested) - if err := _DepositLog.contract.UnpackLog(event, "FunderAbortRequested", 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 -} - -// ParseFunderAbortRequested is a log parse operation binding the contract event 0xa6e9673b5d53b3fe3c62b6459720f9c2a1b129d4f69acb771404ba8681b6a930. -// -// Solidity: event FunderAbortRequested(address indexed _depositContractAddress, bytes _abortOutputScript) -func (_DepositLog *DepositLogFilterer) ParseFunderAbortRequested(log types.Log) (*DepositLogFunderAbortRequested, error) { - event := new(DepositLogFunderAbortRequested) - if err := _DepositLog.contract.UnpackLog(event, "FunderAbortRequested", log); err != nil { - return nil, err - } - return event, nil -} - -// DepositLogGotRedemptionSignatureIterator is returned from FilterGotRedemptionSignature and is used to iterate over the raw logs and unpacked data for GotRedemptionSignature events raised by the DepositLog contract. -type DepositLogGotRedemptionSignatureIterator struct { - Event *DepositLogGotRedemptionSignature // 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 *DepositLogGotRedemptionSignatureIterator) 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(DepositLogGotRedemptionSignature) - 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(DepositLogGotRedemptionSignature) - 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 *DepositLogGotRedemptionSignatureIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *DepositLogGotRedemptionSignatureIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// DepositLogGotRedemptionSignature represents a GotRedemptionSignature event raised by the DepositLog contract. -type DepositLogGotRedemptionSignature struct { - DepositContractAddress common.Address - Digest [32]byte - R [32]byte - S [32]byte - Timestamp *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterGotRedemptionSignature is a free log retrieval operation binding the contract event 0x7f7d7327762d01d2c4a552ea0be2bc5a76264574a80aa78083e691a840e509f2. -// -// Solidity: event GotRedemptionSignature(address indexed _depositContractAddress, bytes32 indexed _digest, bytes32 _r, bytes32 _s, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) FilterGotRedemptionSignature(opts *bind.FilterOpts, _depositContractAddress []common.Address, _digest [][32]byte) (*DepositLogGotRedemptionSignatureIterator, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - var _digestRule []interface{} - for _, _digestItem := range _digest { - _digestRule = append(_digestRule, _digestItem) - } - - logs, sub, err := _DepositLog.contract.FilterLogs(opts, "GotRedemptionSignature", _depositContractAddressRule, _digestRule) - if err != nil { - return nil, err - } - return &DepositLogGotRedemptionSignatureIterator{contract: _DepositLog.contract, event: "GotRedemptionSignature", logs: logs, sub: sub}, nil -} - -// WatchGotRedemptionSignature is a free log subscription operation binding the contract event 0x7f7d7327762d01d2c4a552ea0be2bc5a76264574a80aa78083e691a840e509f2. -// -// Solidity: event GotRedemptionSignature(address indexed _depositContractAddress, bytes32 indexed _digest, bytes32 _r, bytes32 _s, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) WatchGotRedemptionSignature(opts *bind.WatchOpts, sink chan<- *DepositLogGotRedemptionSignature, _depositContractAddress []common.Address, _digest [][32]byte) (event.Subscription, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - var _digestRule []interface{} - for _, _digestItem := range _digest { - _digestRule = append(_digestRule, _digestItem) - } - - logs, sub, err := _DepositLog.contract.WatchLogs(opts, "GotRedemptionSignature", _depositContractAddressRule, _digestRule) - 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(DepositLogGotRedemptionSignature) - if err := _DepositLog.contract.UnpackLog(event, "GotRedemptionSignature", 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 -} - -// ParseGotRedemptionSignature is a log parse operation binding the contract event 0x7f7d7327762d01d2c4a552ea0be2bc5a76264574a80aa78083e691a840e509f2. -// -// Solidity: event GotRedemptionSignature(address indexed _depositContractAddress, bytes32 indexed _digest, bytes32 _r, bytes32 _s, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) ParseGotRedemptionSignature(log types.Log) (*DepositLogGotRedemptionSignature, error) { - event := new(DepositLogGotRedemptionSignature) - if err := _DepositLog.contract.UnpackLog(event, "GotRedemptionSignature", log); err != nil { - return nil, err - } - return event, nil -} - -// DepositLogLiquidatedIterator is returned from FilterLiquidated and is used to iterate over the raw logs and unpacked data for Liquidated events raised by the DepositLog contract. -type DepositLogLiquidatedIterator struct { - Event *DepositLogLiquidated // 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 *DepositLogLiquidatedIterator) 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(DepositLogLiquidated) - 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(DepositLogLiquidated) - 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 *DepositLogLiquidatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *DepositLogLiquidatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// DepositLogLiquidated represents a Liquidated event raised by the DepositLog contract. -type DepositLogLiquidated struct { - DepositContractAddress common.Address - Timestamp *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterLiquidated is a free log retrieval operation binding the contract event 0xa5ee7a2b0254fce91deed604506790ed7fa072d0b14cba4859c3bc8955b9caac. -// -// Solidity: event Liquidated(address indexed _depositContractAddress, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) FilterLiquidated(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*DepositLogLiquidatedIterator, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - - logs, sub, err := _DepositLog.contract.FilterLogs(opts, "Liquidated", _depositContractAddressRule) - if err != nil { - return nil, err - } - return &DepositLogLiquidatedIterator{contract: _DepositLog.contract, event: "Liquidated", logs: logs, sub: sub}, nil -} - -// WatchLiquidated is a free log subscription operation binding the contract event 0xa5ee7a2b0254fce91deed604506790ed7fa072d0b14cba4859c3bc8955b9caac. -// -// Solidity: event Liquidated(address indexed _depositContractAddress, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) WatchLiquidated(opts *bind.WatchOpts, sink chan<- *DepositLogLiquidated, _depositContractAddress []common.Address) (event.Subscription, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - - logs, sub, err := _DepositLog.contract.WatchLogs(opts, "Liquidated", _depositContractAddressRule) - 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(DepositLogLiquidated) - if err := _DepositLog.contract.UnpackLog(event, "Liquidated", 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 -} - -// ParseLiquidated is a log parse operation binding the contract event 0xa5ee7a2b0254fce91deed604506790ed7fa072d0b14cba4859c3bc8955b9caac. -// -// Solidity: event Liquidated(address indexed _depositContractAddress, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) ParseLiquidated(log types.Log) (*DepositLogLiquidated, error) { - event := new(DepositLogLiquidated) - if err := _DepositLog.contract.UnpackLog(event, "Liquidated", log); err != nil { - return nil, err - } - return event, nil -} - -// DepositLogRedeemedIterator is returned from FilterRedeemed and is used to iterate over the raw logs and unpacked data for Redeemed events raised by the DepositLog contract. -type DepositLogRedeemedIterator struct { - Event *DepositLogRedeemed // 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 *DepositLogRedeemedIterator) 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(DepositLogRedeemed) - 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(DepositLogRedeemed) - 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 *DepositLogRedeemedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *DepositLogRedeemedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// DepositLogRedeemed represents a Redeemed event raised by the DepositLog contract. -type DepositLogRedeemed struct { - DepositContractAddress common.Address - Txid [32]byte - Timestamp *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRedeemed is a free log retrieval operation binding the contract event 0x44b7f176bcc739b54bd0800fe491cbdea19df7d4d6b19c281462e6b4fc504344. -// -// Solidity: event Redeemed(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) FilterRedeemed(opts *bind.FilterOpts, _depositContractAddress []common.Address, _txid [][32]byte) (*DepositLogRedeemedIterator, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - var _txidRule []interface{} - for _, _txidItem := range _txid { - _txidRule = append(_txidRule, _txidItem) - } - - logs, sub, err := _DepositLog.contract.FilterLogs(opts, "Redeemed", _depositContractAddressRule, _txidRule) - if err != nil { - return nil, err - } - return &DepositLogRedeemedIterator{contract: _DepositLog.contract, event: "Redeemed", logs: logs, sub: sub}, nil -} - -// WatchRedeemed is a free log subscription operation binding the contract event 0x44b7f176bcc739b54bd0800fe491cbdea19df7d4d6b19c281462e6b4fc504344. -// -// Solidity: event Redeemed(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) WatchRedeemed(opts *bind.WatchOpts, sink chan<- *DepositLogRedeemed, _depositContractAddress []common.Address, _txid [][32]byte) (event.Subscription, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - var _txidRule []interface{} - for _, _txidItem := range _txid { - _txidRule = append(_txidRule, _txidItem) - } - - logs, sub, err := _DepositLog.contract.WatchLogs(opts, "Redeemed", _depositContractAddressRule, _txidRule) - 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(DepositLogRedeemed) - if err := _DepositLog.contract.UnpackLog(event, "Redeemed", 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 -} - -// ParseRedeemed is a log parse operation binding the contract event 0x44b7f176bcc739b54bd0800fe491cbdea19df7d4d6b19c281462e6b4fc504344. -// -// Solidity: event Redeemed(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) ParseRedeemed(log types.Log) (*DepositLogRedeemed, error) { - event := new(DepositLogRedeemed) - if err := _DepositLog.contract.UnpackLog(event, "Redeemed", log); err != nil { - return nil, err - } - return event, nil -} - -// DepositLogRedemptionRequestedIterator is returned from FilterRedemptionRequested and is used to iterate over the raw logs and unpacked data for RedemptionRequested events raised by the DepositLog contract. -type DepositLogRedemptionRequestedIterator struct { - Event *DepositLogRedemptionRequested // 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 *DepositLogRedemptionRequestedIterator) 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(DepositLogRedemptionRequested) - 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(DepositLogRedemptionRequested) - 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 *DepositLogRedemptionRequestedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *DepositLogRedemptionRequestedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// DepositLogRedemptionRequested represents a RedemptionRequested event raised by the DepositLog contract. -type DepositLogRedemptionRequested struct { - DepositContractAddress common.Address - Requester common.Address - Digest [32]byte - UtxoValue *big.Int - RedeemerOutputScript []byte - RequestedFee *big.Int - Outpoint []byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRedemptionRequested is a free log retrieval operation binding the contract event 0x7959c380174061a21a3ba80243a032ba9cd10dc8bd1736d7e835c94e97a35a98. -// -// Solidity: event RedemptionRequested(address indexed _depositContractAddress, address indexed _requester, bytes32 indexed _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) -func (_DepositLog *DepositLogFilterer) FilterRedemptionRequested(opts *bind.FilterOpts, _depositContractAddress []common.Address, _requester []common.Address, _digest [][32]byte) (*DepositLogRedemptionRequestedIterator, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - var _requesterRule []interface{} - for _, _requesterItem := range _requester { - _requesterRule = append(_requesterRule, _requesterItem) - } - var _digestRule []interface{} - for _, _digestItem := range _digest { - _digestRule = append(_digestRule, _digestItem) - } - - logs, sub, err := _DepositLog.contract.FilterLogs(opts, "RedemptionRequested", _depositContractAddressRule, _requesterRule, _digestRule) - if err != nil { - return nil, err - } - return &DepositLogRedemptionRequestedIterator{contract: _DepositLog.contract, event: "RedemptionRequested", logs: logs, sub: sub}, nil -} - -// WatchRedemptionRequested is a free log subscription operation binding the contract event 0x7959c380174061a21a3ba80243a032ba9cd10dc8bd1736d7e835c94e97a35a98. -// -// Solidity: event RedemptionRequested(address indexed _depositContractAddress, address indexed _requester, bytes32 indexed _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) -func (_DepositLog *DepositLogFilterer) WatchRedemptionRequested(opts *bind.WatchOpts, sink chan<- *DepositLogRedemptionRequested, _depositContractAddress []common.Address, _requester []common.Address, _digest [][32]byte) (event.Subscription, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - var _requesterRule []interface{} - for _, _requesterItem := range _requester { - _requesterRule = append(_requesterRule, _requesterItem) - } - var _digestRule []interface{} - for _, _digestItem := range _digest { - _digestRule = append(_digestRule, _digestItem) - } - - logs, sub, err := _DepositLog.contract.WatchLogs(opts, "RedemptionRequested", _depositContractAddressRule, _requesterRule, _digestRule) - 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(DepositLogRedemptionRequested) - if err := _DepositLog.contract.UnpackLog(event, "RedemptionRequested", 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 -} - -// ParseRedemptionRequested is a log parse operation binding the contract event 0x7959c380174061a21a3ba80243a032ba9cd10dc8bd1736d7e835c94e97a35a98. -// -// Solidity: event RedemptionRequested(address indexed _depositContractAddress, address indexed _requester, bytes32 indexed _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) -func (_DepositLog *DepositLogFilterer) ParseRedemptionRequested(log types.Log) (*DepositLogRedemptionRequested, error) { - event := new(DepositLogRedemptionRequested) - if err := _DepositLog.contract.UnpackLog(event, "RedemptionRequested", log); err != nil { - return nil, err - } - return event, nil -} - -// DepositLogRegisteredPubkeyIterator is returned from FilterRegisteredPubkey and is used to iterate over the raw logs and unpacked data for RegisteredPubkey events raised by the DepositLog contract. -type DepositLogRegisteredPubkeyIterator struct { - Event *DepositLogRegisteredPubkey // 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 *DepositLogRegisteredPubkeyIterator) 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(DepositLogRegisteredPubkey) - 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(DepositLogRegisteredPubkey) - 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 *DepositLogRegisteredPubkeyIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *DepositLogRegisteredPubkeyIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// DepositLogRegisteredPubkey represents a RegisteredPubkey event raised by the DepositLog contract. -type DepositLogRegisteredPubkey struct { - DepositContractAddress common.Address - SigningGroupPubkeyX [32]byte - SigningGroupPubkeyY [32]byte - Timestamp *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRegisteredPubkey is a free log retrieval operation binding the contract event 0x8ee737ab16909c4e9d1b750814a4393c9f84ab5d3a29c08c313b783fc846ae33. -// -// Solidity: event RegisteredPubkey(address indexed _depositContractAddress, bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) FilterRegisteredPubkey(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*DepositLogRegisteredPubkeyIterator, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - - logs, sub, err := _DepositLog.contract.FilterLogs(opts, "RegisteredPubkey", _depositContractAddressRule) - if err != nil { - return nil, err - } - return &DepositLogRegisteredPubkeyIterator{contract: _DepositLog.contract, event: "RegisteredPubkey", logs: logs, sub: sub}, nil -} - -// WatchRegisteredPubkey is a free log subscription operation binding the contract event 0x8ee737ab16909c4e9d1b750814a4393c9f84ab5d3a29c08c313b783fc846ae33. -// -// Solidity: event RegisteredPubkey(address indexed _depositContractAddress, bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) WatchRegisteredPubkey(opts *bind.WatchOpts, sink chan<- *DepositLogRegisteredPubkey, _depositContractAddress []common.Address) (event.Subscription, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - - logs, sub, err := _DepositLog.contract.WatchLogs(opts, "RegisteredPubkey", _depositContractAddressRule) - 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(DepositLogRegisteredPubkey) - if err := _DepositLog.contract.UnpackLog(event, "RegisteredPubkey", 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 -} - -// ParseRegisteredPubkey is a log parse operation binding the contract event 0x8ee737ab16909c4e9d1b750814a4393c9f84ab5d3a29c08c313b783fc846ae33. -// -// Solidity: event RegisteredPubkey(address indexed _depositContractAddress, bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) ParseRegisteredPubkey(log types.Log) (*DepositLogRegisteredPubkey, error) { - event := new(DepositLogRegisteredPubkey) - if err := _DepositLog.contract.UnpackLog(event, "RegisteredPubkey", log); err != nil { - return nil, err - } - return event, nil -} - -// DepositLogSetupFailedIterator is returned from FilterSetupFailed and is used to iterate over the raw logs and unpacked data for SetupFailed events raised by the DepositLog contract. -type DepositLogSetupFailedIterator struct { - Event *DepositLogSetupFailed // 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 *DepositLogSetupFailedIterator) 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(DepositLogSetupFailed) - 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(DepositLogSetupFailed) - 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 *DepositLogSetupFailedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *DepositLogSetupFailedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// DepositLogSetupFailed represents a SetupFailed event raised by the DepositLog contract. -type DepositLogSetupFailed struct { - DepositContractAddress common.Address - Timestamp *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterSetupFailed is a free log retrieval operation binding the contract event 0x8fd2cfb62a35fccc1ecef829f83a6c2f840b73dad49d3eaaa402909752086d4b. -// -// Solidity: event SetupFailed(address indexed _depositContractAddress, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) FilterSetupFailed(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*DepositLogSetupFailedIterator, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - - logs, sub, err := _DepositLog.contract.FilterLogs(opts, "SetupFailed", _depositContractAddressRule) - if err != nil { - return nil, err - } - return &DepositLogSetupFailedIterator{contract: _DepositLog.contract, event: "SetupFailed", logs: logs, sub: sub}, nil -} - -// WatchSetupFailed is a free log subscription operation binding the contract event 0x8fd2cfb62a35fccc1ecef829f83a6c2f840b73dad49d3eaaa402909752086d4b. -// -// Solidity: event SetupFailed(address indexed _depositContractAddress, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) WatchSetupFailed(opts *bind.WatchOpts, sink chan<- *DepositLogSetupFailed, _depositContractAddress []common.Address) (event.Subscription, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - - logs, sub, err := _DepositLog.contract.WatchLogs(opts, "SetupFailed", _depositContractAddressRule) - 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(DepositLogSetupFailed) - if err := _DepositLog.contract.UnpackLog(event, "SetupFailed", 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 -} - -// ParseSetupFailed is a log parse operation binding the contract event 0x8fd2cfb62a35fccc1ecef829f83a6c2f840b73dad49d3eaaa402909752086d4b. -// -// Solidity: event SetupFailed(address indexed _depositContractAddress, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) ParseSetupFailed(log types.Log) (*DepositLogSetupFailed, error) { - event := new(DepositLogSetupFailed) - if err := _DepositLog.contract.UnpackLog(event, "SetupFailed", log); err != nil { - return nil, err - } - return event, nil -} - -// DepositLogStartedLiquidationIterator is returned from FilterStartedLiquidation and is used to iterate over the raw logs and unpacked data for StartedLiquidation events raised by the DepositLog contract. -type DepositLogStartedLiquidationIterator struct { - Event *DepositLogStartedLiquidation // 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 *DepositLogStartedLiquidationIterator) 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(DepositLogStartedLiquidation) - 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(DepositLogStartedLiquidation) - 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 *DepositLogStartedLiquidationIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *DepositLogStartedLiquidationIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// DepositLogStartedLiquidation represents a StartedLiquidation event raised by the DepositLog contract. -type DepositLogStartedLiquidation struct { - DepositContractAddress common.Address - WasFraud bool - Timestamp *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterStartedLiquidation is a free log retrieval operation binding the contract event 0xbef11c059eefba82a15aea8a3a89c86fd08d7711c88fa7daea2632a55488510c. -// -// Solidity: event StartedLiquidation(address indexed _depositContractAddress, bool _wasFraud, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) FilterStartedLiquidation(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*DepositLogStartedLiquidationIterator, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - - logs, sub, err := _DepositLog.contract.FilterLogs(opts, "StartedLiquidation", _depositContractAddressRule) - if err != nil { - return nil, err - } - return &DepositLogStartedLiquidationIterator{contract: _DepositLog.contract, event: "StartedLiquidation", logs: logs, sub: sub}, nil -} - -// WatchStartedLiquidation is a free log subscription operation binding the contract event 0xbef11c059eefba82a15aea8a3a89c86fd08d7711c88fa7daea2632a55488510c. -// -// Solidity: event StartedLiquidation(address indexed _depositContractAddress, bool _wasFraud, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) WatchStartedLiquidation(opts *bind.WatchOpts, sink chan<- *DepositLogStartedLiquidation, _depositContractAddress []common.Address) (event.Subscription, error) { - - var _depositContractAddressRule []interface{} - for _, _depositContractAddressItem := range _depositContractAddress { - _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) - } - - logs, sub, err := _DepositLog.contract.WatchLogs(opts, "StartedLiquidation", _depositContractAddressRule) - 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(DepositLogStartedLiquidation) - if err := _DepositLog.contract.UnpackLog(event, "StartedLiquidation", 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 -} - -// ParseStartedLiquidation is a log parse operation binding the contract event 0xbef11c059eefba82a15aea8a3a89c86fd08d7711c88fa7daea2632a55488510c. -// -// Solidity: event StartedLiquidation(address indexed _depositContractAddress, bool _wasFraud, uint256 _timestamp) -func (_DepositLog *DepositLogFilterer) ParseStartedLiquidation(log types.Log) (*DepositLogStartedLiquidation, error) { - event := new(DepositLogStartedLiquidation) - if err := _DepositLog.contract.UnpackLog(event, "StartedLiquidation", log); err != nil { - return nil, err - } - return event, nil -} diff --git a/go/abi/system/TBTCSystem.go b/go/abi/system/TBTCSystem.go new file mode 100644 index 000000000..549c5df6b --- /dev/null +++ b/go/abi/system/TBTCSystem.go @@ -0,0 +1,5145 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package abi + +import ( + "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 ( + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = abi.U256 + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription +) + +// TBTCSystemABI is the input ABI used to generate the binding from. +const TBTCSystemABI = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_priceFeed\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_relay\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_allowNewDeposits\",\"type\":\"bool\"}],\"name\":\"AllowNewDepositsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_initialCollateralizedPercent\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_undercollateralizedThresholdPercent\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_severelyUndercollateralizedThresholdPercent\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"CollateralizationThresholdsUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_initialCollateralizedPercent\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_undercollateralizedThresholdPercent\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_severelyUndercollateralizedThresholdPercent\",\"type\":\"uint16\"}],\"name\":\"CollateralizationThresholdsUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"CourtesyCalled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_keepAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"Created\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_priceFeed\",\"type\":\"address\"}],\"name\":\"EthBtcPriceFeedAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_priceFeed\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"EthBtcPriceFeedAdditionStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"ExitedCourtesyCall\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"FraudDuringSetup\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_txid\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"Funded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_abortOutputScript\",\"type\":\"bytes\"}],\"name\":\"FunderAbortRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_digest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_r\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_s\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"GotRedemptionSignature\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_keepStakedFactory\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_fullyBackedFactory\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_factorySelector\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"KeepFactoriesUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_keepStakedFactory\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_fullyBackedFactory\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_factorySelector\",\"type\":\"address\"}],\"name\":\"KeepFactoriesUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"Liquidated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64[]\",\"name\":\"_lotSizes\",\"type\":\"uint64[]\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"LotSizesUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64[]\",\"name\":\"_lotSizes\",\"type\":\"uint64[]\"}],\"name\":\"LotSizesUpdated\",\"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\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_txid\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"Redeemed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_requester\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_digest\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_utxoValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_redeemerOutputScript\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_requestedFee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_outpoint\",\"type\":\"bytes\"}],\"name\":\"RedemptionRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_signingGroupPubkeyX\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_signingGroupPubkeyY\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"RegisteredPubkey\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"SetupFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_signerFeeDivisor\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"SignerFeeDivisorUpdateStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_signerFeeDivisor\",\"type\":\"uint16\"}],\"name\":\"SignerFeeDivisorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_depositContractAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"_wasFraud\",\"type\":\"bool\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_timestamp\",\"type\":\"uint256\"}],\"name\":\"StartedLiquidation\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_caller\",\"type\":\"address\"}],\"name\":\"approvedToLog\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_initialCollateralizedPercent\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_undercollateralizedThresholdPercent\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_severelyUndercollateralizedThresholdPercent\",\"type\":\"uint16\"}],\"name\":\"beginCollateralizationThresholdsUpdate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"contractIMedianizer\",\"name\":\"_ethBtcPriceFeed\",\"type\":\"address\"}],\"name\":\"beginEthBtcPriceFeedAddition\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_keepStakedFactory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_fullyBackedFactory\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_factorySelector\",\"type\":\"address\"}],\"name\":\"beginKeepFactoriesUpdate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint64[]\",\"name\":\"_lotSizes\",\"type\":\"uint64[]\"}],\"name\":\"beginLotSizesUpdate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_signerFeeDivisor\",\"type\":\"uint16\"}],\"name\":\"beginSignerFeeDivisorUpdate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"emergencyPauseNewDeposits\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"fetchBitcoinPrice\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"fetchRelayCurrentDifficulty\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"fetchRelayPreviousDifficulty\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"finalizeCollateralizationThresholdsUpdate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"finalizeEthBtcPriceFeedAddition\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"finalizeKeepFactoriesUpdate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"finalizeLotSizesUpdate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"finalizeSignerFeeDivisorUpdate\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getAllowNewDeposits\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getAllowedLotSizes\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getGovernanceTimeDelay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getInitialCollateralizedPercent\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getKeepFactoriesUpgradeabilityPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getMaximumLotSize\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getMinimumLotSize\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getNewDepositFeeEstimate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getPriceFeedGovernanceTimeDelay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getRemainingCollateralizationThresholdsUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getRemainingEthBtcPriceFeedAdditionTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getRemainingKeepFactoriesUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getRemainingKeepFactoriesUpgradeabilityTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getRemainingLotSizesUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getRemainingPauseTerm\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getRemainingSignerFeeDivisorUpdateTime\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getSeverelyUndercollateralizedThresholdPercent\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getSignerFeeDivisor\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getUndercollateralizedThresholdPercent\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"contractIBondedECDSAKeepFactory\",\"name\":\"_defaultKeepFactory\",\"type\":\"address\"},{\"internalType\":\"contractDepositFactory\",\"name\":\"_depositFactory\",\"type\":\"address\"},{\"internalType\":\"addresspayable\",\"name\":\"_masterDepositAddress\",\"type\":\"address\"},{\"internalType\":\"contractTBTCToken\",\"name\":\"_tbtcToken\",\"type\":\"address\"},{\"internalType\":\"contractTBTCDepositToken\",\"name\":\"_tbtcDepositToken\",\"type\":\"address\"},{\"internalType\":\"contractFeeRebateToken\",\"name\":\"_feeRebateToken\",\"type\":\"address\"},{\"internalType\":\"contractVendingMachine\",\"name\":\"_vendingMachine\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"_keepThreshold\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_keepSize\",\"type\":\"uint16\"}],\"name\":\"initialize\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_requestedLotSizeSatoshis\",\"type\":\"uint64\"}],\"name\":\"isAllowedLotSize\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isOwner\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"keepSize\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"keepThreshold\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"logCourtesyCalled\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_keepAddress\",\"type\":\"address\"}],\"name\":\"logCreated\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"logExitedCourtesyCall\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"logFraudDuringSetup\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_txid\",\"type\":\"bytes32\"}],\"name\":\"logFunded\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"_abortOutputScript\",\"type\":\"bytes\"}],\"name\":\"logFunderRequestedAbort\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_digest\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_s\",\"type\":\"bytes32\"}],\"name\":\"logGotRedemptionSignature\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"logLiquidated\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_txid\",\"type\":\"bytes32\"}],\"name\":\"logRedeemed\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_requester\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_digest\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_utxoValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_redeemerOutputScript\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"_requestedFee\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_outpoint\",\"type\":\"bytes\"}],\"name\":\"logRedemptionRequested\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_signingGroupPubkeyX\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_signingGroupPubkeyY\",\"type\":\"bytes32\"}],\"name\":\"logRegisteredPubkey\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"logSetupFailed\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bool\",\"name\":\"_wasFraud\",\"type\":\"bool\"}],\"name\":\"logStartedLiquidation\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"priceFeed\",\"outputs\":[{\"internalType\":\"contractISatWeiPriceFeed\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"refreshMinimumBondableValue\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"relay\",\"outputs\":[{\"internalType\":\"contractIRelay\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_requestedLotSizeSatoshis\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"_maxSecuredLifetime\",\"type\":\"uint256\"}],\"name\":\"requestNewKeep\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"resumeNewDeposits\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" + +// TBTCSystem is an auto generated Go binding around an Ethereum contract. +type TBTCSystem struct { + TBTCSystemCaller // Read-only binding to the contract + TBTCSystemTransactor // Write-only binding to the contract + TBTCSystemFilterer // Log filterer for contract events +} + +// TBTCSystemCaller is an auto generated read-only Go binding around an Ethereum contract. +type TBTCSystemCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TBTCSystemTransactor is an auto generated write-only Go binding around an Ethereum contract. +type TBTCSystemTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TBTCSystemFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type TBTCSystemFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TBTCSystemSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type TBTCSystemSession struct { + Contract *TBTCSystem // 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 +} + +// TBTCSystemCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type TBTCSystemCallerSession struct { + Contract *TBTCSystemCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// TBTCSystemTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type TBTCSystemTransactorSession struct { + Contract *TBTCSystemTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// TBTCSystemRaw is an auto generated low-level Go binding around an Ethereum contract. +type TBTCSystemRaw struct { + Contract *TBTCSystem // Generic contract binding to access the raw methods on +} + +// TBTCSystemCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type TBTCSystemCallerRaw struct { + Contract *TBTCSystemCaller // Generic read-only contract binding to access the raw methods on +} + +// TBTCSystemTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type TBTCSystemTransactorRaw struct { + Contract *TBTCSystemTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewTBTCSystem creates a new instance of TBTCSystem, bound to a specific deployed contract. +func NewTBTCSystem(address common.Address, backend bind.ContractBackend) (*TBTCSystem, error) { + contract, err := bindTBTCSystem(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &TBTCSystem{TBTCSystemCaller: TBTCSystemCaller{contract: contract}, TBTCSystemTransactor: TBTCSystemTransactor{contract: contract}, TBTCSystemFilterer: TBTCSystemFilterer{contract: contract}}, nil +} + +// NewTBTCSystemCaller creates a new read-only instance of TBTCSystem, bound to a specific deployed contract. +func NewTBTCSystemCaller(address common.Address, caller bind.ContractCaller) (*TBTCSystemCaller, error) { + contract, err := bindTBTCSystem(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &TBTCSystemCaller{contract: contract}, nil +} + +// NewTBTCSystemTransactor creates a new write-only instance of TBTCSystem, bound to a specific deployed contract. +func NewTBTCSystemTransactor(address common.Address, transactor bind.ContractTransactor) (*TBTCSystemTransactor, error) { + contract, err := bindTBTCSystem(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &TBTCSystemTransactor{contract: contract}, nil +} + +// NewTBTCSystemFilterer creates a new log filterer instance of TBTCSystem, bound to a specific deployed contract. +func NewTBTCSystemFilterer(address common.Address, filterer bind.ContractFilterer) (*TBTCSystemFilterer, error) { + contract, err := bindTBTCSystem(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &TBTCSystemFilterer{contract: contract}, nil +} + +// bindTBTCSystem binds a generic wrapper to an already deployed contract. +func bindTBTCSystem(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := abi.JSON(strings.NewReader(TBTCSystemABI)) + 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 (_TBTCSystem *TBTCSystemRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _TBTCSystem.Contract.TBTCSystemCaller.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 (_TBTCSystem *TBTCSystemRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.Contract.TBTCSystemTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_TBTCSystem *TBTCSystemRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TBTCSystem.Contract.TBTCSystemTransactor.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 (_TBTCSystem *TBTCSystemCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error { + return _TBTCSystem.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 (_TBTCSystem *TBTCSystemTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_TBTCSystem *TBTCSystemTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TBTCSystem.Contract.contract.Transact(opts, method, params...) +} + +// ApprovedToLog is a free data retrieval call binding the contract method 0x9ffb3862. +// +// Solidity: function approvedToLog(address _caller) constant returns(bool) +func (_TBTCSystem *TBTCSystemCaller) ApprovedToLog(opts *bind.CallOpts, _caller common.Address) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "approvedToLog", _caller) + return *ret0, err +} + +// ApprovedToLog is a free data retrieval call binding the contract method 0x9ffb3862. +// +// Solidity: function approvedToLog(address _caller) constant returns(bool) +func (_TBTCSystem *TBTCSystemSession) ApprovedToLog(_caller common.Address) (bool, error) { + return _TBTCSystem.Contract.ApprovedToLog(&_TBTCSystem.CallOpts, _caller) +} + +// ApprovedToLog is a free data retrieval call binding the contract method 0x9ffb3862. +// +// Solidity: function approvedToLog(address _caller) constant returns(bool) +func (_TBTCSystem *TBTCSystemCallerSession) ApprovedToLog(_caller common.Address) (bool, error) { + return _TBTCSystem.Contract.ApprovedToLog(&_TBTCSystem.CallOpts, _caller) +} + +// FetchBitcoinPrice is a free data retrieval call binding the contract method 0xa6c1691c. +// +// Solidity: function fetchBitcoinPrice() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) FetchBitcoinPrice(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "fetchBitcoinPrice") + return *ret0, err +} + +// FetchBitcoinPrice is a free data retrieval call binding the contract method 0xa6c1691c. +// +// Solidity: function fetchBitcoinPrice() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) FetchBitcoinPrice() (*big.Int, error) { + return _TBTCSystem.Contract.FetchBitcoinPrice(&_TBTCSystem.CallOpts) +} + +// FetchBitcoinPrice is a free data retrieval call binding the contract method 0xa6c1691c. +// +// Solidity: function fetchBitcoinPrice() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) FetchBitcoinPrice() (*big.Int, error) { + return _TBTCSystem.Contract.FetchBitcoinPrice(&_TBTCSystem.CallOpts) +} + +// FetchRelayCurrentDifficulty is a free data retrieval call binding the contract method 0xdab70cb1. +// +// Solidity: function fetchRelayCurrentDifficulty() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) FetchRelayCurrentDifficulty(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "fetchRelayCurrentDifficulty") + return *ret0, err +} + +// FetchRelayCurrentDifficulty is a free data retrieval call binding the contract method 0xdab70cb1. +// +// Solidity: function fetchRelayCurrentDifficulty() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) FetchRelayCurrentDifficulty() (*big.Int, error) { + return _TBTCSystem.Contract.FetchRelayCurrentDifficulty(&_TBTCSystem.CallOpts) +} + +// FetchRelayCurrentDifficulty is a free data retrieval call binding the contract method 0xdab70cb1. +// +// Solidity: function fetchRelayCurrentDifficulty() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) FetchRelayCurrentDifficulty() (*big.Int, error) { + return _TBTCSystem.Contract.FetchRelayCurrentDifficulty(&_TBTCSystem.CallOpts) +} + +// FetchRelayPreviousDifficulty is a free data retrieval call binding the contract method 0x402b783d. +// +// Solidity: function fetchRelayPreviousDifficulty() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) FetchRelayPreviousDifficulty(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "fetchRelayPreviousDifficulty") + return *ret0, err +} + +// FetchRelayPreviousDifficulty is a free data retrieval call binding the contract method 0x402b783d. +// +// Solidity: function fetchRelayPreviousDifficulty() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) FetchRelayPreviousDifficulty() (*big.Int, error) { + return _TBTCSystem.Contract.FetchRelayPreviousDifficulty(&_TBTCSystem.CallOpts) +} + +// FetchRelayPreviousDifficulty is a free data retrieval call binding the contract method 0x402b783d. +// +// Solidity: function fetchRelayPreviousDifficulty() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) FetchRelayPreviousDifficulty() (*big.Int, error) { + return _TBTCSystem.Contract.FetchRelayPreviousDifficulty(&_TBTCSystem.CallOpts) +} + +// GetAllowNewDeposits is a free data retrieval call binding the contract method 0x0d7eb1c4. +// +// Solidity: function getAllowNewDeposits() constant returns(bool) +func (_TBTCSystem *TBTCSystemCaller) GetAllowNewDeposits(opts *bind.CallOpts) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getAllowNewDeposits") + return *ret0, err +} + +// GetAllowNewDeposits is a free data retrieval call binding the contract method 0x0d7eb1c4. +// +// Solidity: function getAllowNewDeposits() constant returns(bool) +func (_TBTCSystem *TBTCSystemSession) GetAllowNewDeposits() (bool, error) { + return _TBTCSystem.Contract.GetAllowNewDeposits(&_TBTCSystem.CallOpts) +} + +// GetAllowNewDeposits is a free data retrieval call binding the contract method 0x0d7eb1c4. +// +// Solidity: function getAllowNewDeposits() constant returns(bool) +func (_TBTCSystem *TBTCSystemCallerSession) GetAllowNewDeposits() (bool, error) { + return _TBTCSystem.Contract.GetAllowNewDeposits(&_TBTCSystem.CallOpts) +} + +// GetAllowedLotSizes is a free data retrieval call binding the contract method 0x086c9edd. +// +// Solidity: function getAllowedLotSizes() constant returns(uint64[]) +func (_TBTCSystem *TBTCSystemCaller) GetAllowedLotSizes(opts *bind.CallOpts) ([]uint64, error) { + var ( + ret0 = new([]uint64) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getAllowedLotSizes") + return *ret0, err +} + +// GetAllowedLotSizes is a free data retrieval call binding the contract method 0x086c9edd. +// +// Solidity: function getAllowedLotSizes() constant returns(uint64[]) +func (_TBTCSystem *TBTCSystemSession) GetAllowedLotSizes() ([]uint64, error) { + return _TBTCSystem.Contract.GetAllowedLotSizes(&_TBTCSystem.CallOpts) +} + +// GetAllowedLotSizes is a free data retrieval call binding the contract method 0x086c9edd. +// +// Solidity: function getAllowedLotSizes() constant returns(uint64[]) +func (_TBTCSystem *TBTCSystemCallerSession) GetAllowedLotSizes() ([]uint64, error) { + return _TBTCSystem.Contract.GetAllowedLotSizes(&_TBTCSystem.CallOpts) +} + +// GetGovernanceTimeDelay is a free data retrieval call binding the contract method 0xf2e72347. +// +// Solidity: function getGovernanceTimeDelay() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetGovernanceTimeDelay(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getGovernanceTimeDelay") + return *ret0, err +} + +// GetGovernanceTimeDelay is a free data retrieval call binding the contract method 0xf2e72347. +// +// Solidity: function getGovernanceTimeDelay() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetGovernanceTimeDelay() (*big.Int, error) { + return _TBTCSystem.Contract.GetGovernanceTimeDelay(&_TBTCSystem.CallOpts) +} + +// GetGovernanceTimeDelay is a free data retrieval call binding the contract method 0xf2e72347. +// +// Solidity: function getGovernanceTimeDelay() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetGovernanceTimeDelay() (*big.Int, error) { + return _TBTCSystem.Contract.GetGovernanceTimeDelay(&_TBTCSystem.CallOpts) +} + +// GetInitialCollateralizedPercent is a free data retrieval call binding the contract method 0x987ecea7. +// +// Solidity: function getInitialCollateralizedPercent() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCaller) GetInitialCollateralizedPercent(opts *bind.CallOpts) (uint16, error) { + var ( + ret0 = new(uint16) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getInitialCollateralizedPercent") + return *ret0, err +} + +// GetInitialCollateralizedPercent is a free data retrieval call binding the contract method 0x987ecea7. +// +// Solidity: function getInitialCollateralizedPercent() constant returns(uint16) +func (_TBTCSystem *TBTCSystemSession) GetInitialCollateralizedPercent() (uint16, error) { + return _TBTCSystem.Contract.GetInitialCollateralizedPercent(&_TBTCSystem.CallOpts) +} + +// GetInitialCollateralizedPercent is a free data retrieval call binding the contract method 0x987ecea7. +// +// Solidity: function getInitialCollateralizedPercent() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCallerSession) GetInitialCollateralizedPercent() (uint16, error) { + return _TBTCSystem.Contract.GetInitialCollateralizedPercent(&_TBTCSystem.CallOpts) +} + +// GetKeepFactoriesUpgradeabilityPeriod is a free data retrieval call binding the contract method 0xe5a6d77d. +// +// Solidity: function getKeepFactoriesUpgradeabilityPeriod() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetKeepFactoriesUpgradeabilityPeriod(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getKeepFactoriesUpgradeabilityPeriod") + return *ret0, err +} + +// GetKeepFactoriesUpgradeabilityPeriod is a free data retrieval call binding the contract method 0xe5a6d77d. +// +// Solidity: function getKeepFactoriesUpgradeabilityPeriod() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetKeepFactoriesUpgradeabilityPeriod() (*big.Int, error) { + return _TBTCSystem.Contract.GetKeepFactoriesUpgradeabilityPeriod(&_TBTCSystem.CallOpts) +} + +// GetKeepFactoriesUpgradeabilityPeriod is a free data retrieval call binding the contract method 0xe5a6d77d. +// +// Solidity: function getKeepFactoriesUpgradeabilityPeriod() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetKeepFactoriesUpgradeabilityPeriod() (*big.Int, error) { + return _TBTCSystem.Contract.GetKeepFactoriesUpgradeabilityPeriod(&_TBTCSystem.CallOpts) +} + +// GetMaximumLotSize is a free data retrieval call binding the contract method 0x2753d84b. +// +// Solidity: function getMaximumLotSize() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetMaximumLotSize(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getMaximumLotSize") + return *ret0, err +} + +// GetMaximumLotSize is a free data retrieval call binding the contract method 0x2753d84b. +// +// Solidity: function getMaximumLotSize() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetMaximumLotSize() (*big.Int, error) { + return _TBTCSystem.Contract.GetMaximumLotSize(&_TBTCSystem.CallOpts) +} + +// GetMaximumLotSize is a free data retrieval call binding the contract method 0x2753d84b. +// +// Solidity: function getMaximumLotSize() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetMaximumLotSize() (*big.Int, error) { + return _TBTCSystem.Contract.GetMaximumLotSize(&_TBTCSystem.CallOpts) +} + +// GetMinimumLotSize is a free data retrieval call binding the contract method 0x34d534a9. +// +// Solidity: function getMinimumLotSize() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetMinimumLotSize(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getMinimumLotSize") + return *ret0, err +} + +// GetMinimumLotSize is a free data retrieval call binding the contract method 0x34d534a9. +// +// Solidity: function getMinimumLotSize() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetMinimumLotSize() (*big.Int, error) { + return _TBTCSystem.Contract.GetMinimumLotSize(&_TBTCSystem.CallOpts) +} + +// GetMinimumLotSize is a free data retrieval call binding the contract method 0x34d534a9. +// +// Solidity: function getMinimumLotSize() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetMinimumLotSize() (*big.Int, error) { + return _TBTCSystem.Contract.GetMinimumLotSize(&_TBTCSystem.CallOpts) +} + +// GetNewDepositFeeEstimate is a free data retrieval call binding the contract method 0x2d00f1ee. +// +// Solidity: function getNewDepositFeeEstimate() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetNewDepositFeeEstimate(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getNewDepositFeeEstimate") + return *ret0, err +} + +// GetNewDepositFeeEstimate is a free data retrieval call binding the contract method 0x2d00f1ee. +// +// Solidity: function getNewDepositFeeEstimate() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetNewDepositFeeEstimate() (*big.Int, error) { + return _TBTCSystem.Contract.GetNewDepositFeeEstimate(&_TBTCSystem.CallOpts) +} + +// GetNewDepositFeeEstimate is a free data retrieval call binding the contract method 0x2d00f1ee. +// +// Solidity: function getNewDepositFeeEstimate() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetNewDepositFeeEstimate() (*big.Int, error) { + return _TBTCSystem.Contract.GetNewDepositFeeEstimate(&_TBTCSystem.CallOpts) +} + +// GetPriceFeedGovernanceTimeDelay is a free data retrieval call binding the contract method 0xae7f4a5f. +// +// Solidity: function getPriceFeedGovernanceTimeDelay() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetPriceFeedGovernanceTimeDelay(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getPriceFeedGovernanceTimeDelay") + return *ret0, err +} + +// GetPriceFeedGovernanceTimeDelay is a free data retrieval call binding the contract method 0xae7f4a5f. +// +// Solidity: function getPriceFeedGovernanceTimeDelay() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetPriceFeedGovernanceTimeDelay() (*big.Int, error) { + return _TBTCSystem.Contract.GetPriceFeedGovernanceTimeDelay(&_TBTCSystem.CallOpts) +} + +// GetPriceFeedGovernanceTimeDelay is a free data retrieval call binding the contract method 0xae7f4a5f. +// +// Solidity: function getPriceFeedGovernanceTimeDelay() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetPriceFeedGovernanceTimeDelay() (*big.Int, error) { + return _TBTCSystem.Contract.GetPriceFeedGovernanceTimeDelay(&_TBTCSystem.CallOpts) +} + +// GetRemainingCollateralizationThresholdsUpdateTime is a free data retrieval call binding the contract method 0xc074d550. +// +// Solidity: function getRemainingCollateralizationThresholdsUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetRemainingCollateralizationThresholdsUpdateTime(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getRemainingCollateralizationThresholdsUpdateTime") + return *ret0, err +} + +// GetRemainingCollateralizationThresholdsUpdateTime is a free data retrieval call binding the contract method 0xc074d550. +// +// Solidity: function getRemainingCollateralizationThresholdsUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetRemainingCollateralizationThresholdsUpdateTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingCollateralizationThresholdsUpdateTime(&_TBTCSystem.CallOpts) +} + +// GetRemainingCollateralizationThresholdsUpdateTime is a free data retrieval call binding the contract method 0xc074d550. +// +// Solidity: function getRemainingCollateralizationThresholdsUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetRemainingCollateralizationThresholdsUpdateTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingCollateralizationThresholdsUpdateTime(&_TBTCSystem.CallOpts) +} + +// GetRemainingEthBtcPriceFeedAdditionTime is a free data retrieval call binding the contract method 0x0af488f9. +// +// Solidity: function getRemainingEthBtcPriceFeedAdditionTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetRemainingEthBtcPriceFeedAdditionTime(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getRemainingEthBtcPriceFeedAdditionTime") + return *ret0, err +} + +// GetRemainingEthBtcPriceFeedAdditionTime is a free data retrieval call binding the contract method 0x0af488f9. +// +// Solidity: function getRemainingEthBtcPriceFeedAdditionTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetRemainingEthBtcPriceFeedAdditionTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingEthBtcPriceFeedAdditionTime(&_TBTCSystem.CallOpts) +} + +// GetRemainingEthBtcPriceFeedAdditionTime is a free data retrieval call binding the contract method 0x0af488f9. +// +// Solidity: function getRemainingEthBtcPriceFeedAdditionTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetRemainingEthBtcPriceFeedAdditionTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingEthBtcPriceFeedAdditionTime(&_TBTCSystem.CallOpts) +} + +// GetRemainingKeepFactoriesUpdateTime is a free data retrieval call binding the contract method 0x57535088. +// +// Solidity: function getRemainingKeepFactoriesUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetRemainingKeepFactoriesUpdateTime(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getRemainingKeepFactoriesUpdateTime") + return *ret0, err +} + +// GetRemainingKeepFactoriesUpdateTime is a free data retrieval call binding the contract method 0x57535088. +// +// Solidity: function getRemainingKeepFactoriesUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetRemainingKeepFactoriesUpdateTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingKeepFactoriesUpdateTime(&_TBTCSystem.CallOpts) +} + +// GetRemainingKeepFactoriesUpdateTime is a free data retrieval call binding the contract method 0x57535088. +// +// Solidity: function getRemainingKeepFactoriesUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetRemainingKeepFactoriesUpdateTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingKeepFactoriesUpdateTime(&_TBTCSystem.CallOpts) +} + +// GetRemainingKeepFactoriesUpgradeabilityTime is a free data retrieval call binding the contract method 0xb196b5a3. +// +// Solidity: function getRemainingKeepFactoriesUpgradeabilityTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetRemainingKeepFactoriesUpgradeabilityTime(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getRemainingKeepFactoriesUpgradeabilityTime") + return *ret0, err +} + +// GetRemainingKeepFactoriesUpgradeabilityTime is a free data retrieval call binding the contract method 0xb196b5a3. +// +// Solidity: function getRemainingKeepFactoriesUpgradeabilityTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetRemainingKeepFactoriesUpgradeabilityTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingKeepFactoriesUpgradeabilityTime(&_TBTCSystem.CallOpts) +} + +// GetRemainingKeepFactoriesUpgradeabilityTime is a free data retrieval call binding the contract method 0xb196b5a3. +// +// Solidity: function getRemainingKeepFactoriesUpgradeabilityTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetRemainingKeepFactoriesUpgradeabilityTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingKeepFactoriesUpgradeabilityTime(&_TBTCSystem.CallOpts) +} + +// GetRemainingLotSizesUpdateTime is a free data retrieval call binding the contract method 0x3ee850bc. +// +// Solidity: function getRemainingLotSizesUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetRemainingLotSizesUpdateTime(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getRemainingLotSizesUpdateTime") + return *ret0, err +} + +// GetRemainingLotSizesUpdateTime is a free data retrieval call binding the contract method 0x3ee850bc. +// +// Solidity: function getRemainingLotSizesUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetRemainingLotSizesUpdateTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingLotSizesUpdateTime(&_TBTCSystem.CallOpts) +} + +// GetRemainingLotSizesUpdateTime is a free data retrieval call binding the contract method 0x3ee850bc. +// +// Solidity: function getRemainingLotSizesUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetRemainingLotSizesUpdateTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingLotSizesUpdateTime(&_TBTCSystem.CallOpts) +} + +// GetRemainingPauseTerm is a free data retrieval call binding the contract method 0x013b0f30. +// +// Solidity: function getRemainingPauseTerm() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetRemainingPauseTerm(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getRemainingPauseTerm") + return *ret0, err +} + +// GetRemainingPauseTerm is a free data retrieval call binding the contract method 0x013b0f30. +// +// Solidity: function getRemainingPauseTerm() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetRemainingPauseTerm() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingPauseTerm(&_TBTCSystem.CallOpts) +} + +// GetRemainingPauseTerm is a free data retrieval call binding the contract method 0x013b0f30. +// +// Solidity: function getRemainingPauseTerm() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetRemainingPauseTerm() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingPauseTerm(&_TBTCSystem.CallOpts) +} + +// GetRemainingSignerFeeDivisorUpdateTime is a free data retrieval call binding the contract method 0xb792a38e. +// +// Solidity: function getRemainingSignerFeeDivisorUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCaller) GetRemainingSignerFeeDivisorUpdateTime(opts *bind.CallOpts) (*big.Int, error) { + var ( + ret0 = new(*big.Int) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getRemainingSignerFeeDivisorUpdateTime") + return *ret0, err +} + +// GetRemainingSignerFeeDivisorUpdateTime is a free data retrieval call binding the contract method 0xb792a38e. +// +// Solidity: function getRemainingSignerFeeDivisorUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemSession) GetRemainingSignerFeeDivisorUpdateTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingSignerFeeDivisorUpdateTime(&_TBTCSystem.CallOpts) +} + +// GetRemainingSignerFeeDivisorUpdateTime is a free data retrieval call binding the contract method 0xb792a38e. +// +// Solidity: function getRemainingSignerFeeDivisorUpdateTime() constant returns(uint256) +func (_TBTCSystem *TBTCSystemCallerSession) GetRemainingSignerFeeDivisorUpdateTime() (*big.Int, error) { + return _TBTCSystem.Contract.GetRemainingSignerFeeDivisorUpdateTime(&_TBTCSystem.CallOpts) +} + +// GetSeverelyUndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0x6f4fef62. +// +// Solidity: function getSeverelyUndercollateralizedThresholdPercent() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCaller) GetSeverelyUndercollateralizedThresholdPercent(opts *bind.CallOpts) (uint16, error) { + var ( + ret0 = new(uint16) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getSeverelyUndercollateralizedThresholdPercent") + return *ret0, err +} + +// GetSeverelyUndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0x6f4fef62. +// +// Solidity: function getSeverelyUndercollateralizedThresholdPercent() constant returns(uint16) +func (_TBTCSystem *TBTCSystemSession) GetSeverelyUndercollateralizedThresholdPercent() (uint16, error) { + return _TBTCSystem.Contract.GetSeverelyUndercollateralizedThresholdPercent(&_TBTCSystem.CallOpts) +} + +// GetSeverelyUndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0x6f4fef62. +// +// Solidity: function getSeverelyUndercollateralizedThresholdPercent() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCallerSession) GetSeverelyUndercollateralizedThresholdPercent() (uint16, error) { + return _TBTCSystem.Contract.GetSeverelyUndercollateralizedThresholdPercent(&_TBTCSystem.CallOpts) +} + +// GetSignerFeeDivisor is a free data retrieval call binding the contract method 0x60e98d59. +// +// Solidity: function getSignerFeeDivisor() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCaller) GetSignerFeeDivisor(opts *bind.CallOpts) (uint16, error) { + var ( + ret0 = new(uint16) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getSignerFeeDivisor") + return *ret0, err +} + +// GetSignerFeeDivisor is a free data retrieval call binding the contract method 0x60e98d59. +// +// Solidity: function getSignerFeeDivisor() constant returns(uint16) +func (_TBTCSystem *TBTCSystemSession) GetSignerFeeDivisor() (uint16, error) { + return _TBTCSystem.Contract.GetSignerFeeDivisor(&_TBTCSystem.CallOpts) +} + +// GetSignerFeeDivisor is a free data retrieval call binding the contract method 0x60e98d59. +// +// Solidity: function getSignerFeeDivisor() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCallerSession) GetSignerFeeDivisor() (uint16, error) { + return _TBTCSystem.Contract.GetSignerFeeDivisor(&_TBTCSystem.CallOpts) +} + +// GetUndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0xa2cd75da. +// +// Solidity: function getUndercollateralizedThresholdPercent() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCaller) GetUndercollateralizedThresholdPercent(opts *bind.CallOpts) (uint16, error) { + var ( + ret0 = new(uint16) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "getUndercollateralizedThresholdPercent") + return *ret0, err +} + +// GetUndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0xa2cd75da. +// +// Solidity: function getUndercollateralizedThresholdPercent() constant returns(uint16) +func (_TBTCSystem *TBTCSystemSession) GetUndercollateralizedThresholdPercent() (uint16, error) { + return _TBTCSystem.Contract.GetUndercollateralizedThresholdPercent(&_TBTCSystem.CallOpts) +} + +// GetUndercollateralizedThresholdPercent is a free data retrieval call binding the contract method 0xa2cd75da. +// +// Solidity: function getUndercollateralizedThresholdPercent() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCallerSession) GetUndercollateralizedThresholdPercent() (uint16, error) { + return _TBTCSystem.Contract.GetUndercollateralizedThresholdPercent(&_TBTCSystem.CallOpts) +} + +// IsAllowedLotSize is a free data retrieval call binding the contract method 0xa28b79f1. +// +// Solidity: function isAllowedLotSize(uint64 _requestedLotSizeSatoshis) constant returns(bool) +func (_TBTCSystem *TBTCSystemCaller) IsAllowedLotSize(opts *bind.CallOpts, _requestedLotSizeSatoshis uint64) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "isAllowedLotSize", _requestedLotSizeSatoshis) + return *ret0, err +} + +// IsAllowedLotSize is a free data retrieval call binding the contract method 0xa28b79f1. +// +// Solidity: function isAllowedLotSize(uint64 _requestedLotSizeSatoshis) constant returns(bool) +func (_TBTCSystem *TBTCSystemSession) IsAllowedLotSize(_requestedLotSizeSatoshis uint64) (bool, error) { + return _TBTCSystem.Contract.IsAllowedLotSize(&_TBTCSystem.CallOpts, _requestedLotSizeSatoshis) +} + +// IsAllowedLotSize is a free data retrieval call binding the contract method 0xa28b79f1. +// +// Solidity: function isAllowedLotSize(uint64 _requestedLotSizeSatoshis) constant returns(bool) +func (_TBTCSystem *TBTCSystemCallerSession) IsAllowedLotSize(_requestedLotSizeSatoshis uint64) (bool, error) { + return _TBTCSystem.Contract.IsAllowedLotSize(&_TBTCSystem.CallOpts, _requestedLotSizeSatoshis) +} + +// IsOwner is a free data retrieval call binding the contract method 0x8f32d59b. +// +// Solidity: function isOwner() constant returns(bool) +func (_TBTCSystem *TBTCSystemCaller) IsOwner(opts *bind.CallOpts) (bool, error) { + var ( + ret0 = new(bool) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "isOwner") + return *ret0, err +} + +// IsOwner is a free data retrieval call binding the contract method 0x8f32d59b. +// +// Solidity: function isOwner() constant returns(bool) +func (_TBTCSystem *TBTCSystemSession) IsOwner() (bool, error) { + return _TBTCSystem.Contract.IsOwner(&_TBTCSystem.CallOpts) +} + +// IsOwner is a free data retrieval call binding the contract method 0x8f32d59b. +// +// Solidity: function isOwner() constant returns(bool) +func (_TBTCSystem *TBTCSystemCallerSession) IsOwner() (bool, error) { + return _TBTCSystem.Contract.IsOwner(&_TBTCSystem.CallOpts) +} + +// KeepSize is a free data retrieval call binding the contract method 0x64bdb667. +// +// Solidity: function keepSize() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCaller) KeepSize(opts *bind.CallOpts) (uint16, error) { + var ( + ret0 = new(uint16) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "keepSize") + return *ret0, err +} + +// KeepSize is a free data retrieval call binding the contract method 0x64bdb667. +// +// Solidity: function keepSize() constant returns(uint16) +func (_TBTCSystem *TBTCSystemSession) KeepSize() (uint16, error) { + return _TBTCSystem.Contract.KeepSize(&_TBTCSystem.CallOpts) +} + +// KeepSize is a free data retrieval call binding the contract method 0x64bdb667. +// +// Solidity: function keepSize() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCallerSession) KeepSize() (uint16, error) { + return _TBTCSystem.Contract.KeepSize(&_TBTCSystem.CallOpts) +} + +// KeepThreshold is a free data retrieval call binding the contract method 0xe5426d2e. +// +// Solidity: function keepThreshold() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCaller) KeepThreshold(opts *bind.CallOpts) (uint16, error) { + var ( + ret0 = new(uint16) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "keepThreshold") + return *ret0, err +} + +// KeepThreshold is a free data retrieval call binding the contract method 0xe5426d2e. +// +// Solidity: function keepThreshold() constant returns(uint16) +func (_TBTCSystem *TBTCSystemSession) KeepThreshold() (uint16, error) { + return _TBTCSystem.Contract.KeepThreshold(&_TBTCSystem.CallOpts) +} + +// KeepThreshold is a free data retrieval call binding the contract method 0xe5426d2e. +// +// Solidity: function keepThreshold() constant returns(uint16) +func (_TBTCSystem *TBTCSystemCallerSession) KeepThreshold() (uint16, error) { + return _TBTCSystem.Contract.KeepThreshold(&_TBTCSystem.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() constant returns(address) +func (_TBTCSystem *TBTCSystemCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var ( + ret0 = new(common.Address) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "owner") + return *ret0, err +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() constant returns(address) +func (_TBTCSystem *TBTCSystemSession) Owner() (common.Address, error) { + return _TBTCSystem.Contract.Owner(&_TBTCSystem.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() constant returns(address) +func (_TBTCSystem *TBTCSystemCallerSession) Owner() (common.Address, error) { + return _TBTCSystem.Contract.Owner(&_TBTCSystem.CallOpts) +} + +// PriceFeed is a free data retrieval call binding the contract method 0x741bef1a. +// +// Solidity: function priceFeed() constant returns(address) +func (_TBTCSystem *TBTCSystemCaller) PriceFeed(opts *bind.CallOpts) (common.Address, error) { + var ( + ret0 = new(common.Address) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "priceFeed") + return *ret0, err +} + +// PriceFeed is a free data retrieval call binding the contract method 0x741bef1a. +// +// Solidity: function priceFeed() constant returns(address) +func (_TBTCSystem *TBTCSystemSession) PriceFeed() (common.Address, error) { + return _TBTCSystem.Contract.PriceFeed(&_TBTCSystem.CallOpts) +} + +// PriceFeed is a free data retrieval call binding the contract method 0x741bef1a. +// +// Solidity: function priceFeed() constant returns(address) +func (_TBTCSystem *TBTCSystemCallerSession) PriceFeed() (common.Address, error) { + return _TBTCSystem.Contract.PriceFeed(&_TBTCSystem.CallOpts) +} + +// Relay is a free data retrieval call binding the contract method 0xb59589d1. +// +// Solidity: function relay() constant returns(address) +func (_TBTCSystem *TBTCSystemCaller) Relay(opts *bind.CallOpts) (common.Address, error) { + var ( + ret0 = new(common.Address) + ) + out := ret0 + err := _TBTCSystem.contract.Call(opts, out, "relay") + return *ret0, err +} + +// Relay is a free data retrieval call binding the contract method 0xb59589d1. +// +// Solidity: function relay() constant returns(address) +func (_TBTCSystem *TBTCSystemSession) Relay() (common.Address, error) { + return _TBTCSystem.Contract.Relay(&_TBTCSystem.CallOpts) +} + +// Relay is a free data retrieval call binding the contract method 0xb59589d1. +// +// Solidity: function relay() constant returns(address) +func (_TBTCSystem *TBTCSystemCallerSession) Relay() (common.Address, error) { + return _TBTCSystem.Contract.Relay(&_TBTCSystem.CallOpts) +} + +// BeginCollateralizationThresholdsUpdate is a paid mutator transaction binding the contract method 0xdde3fdd2. +// +// Solidity: function beginCollateralizationThresholdsUpdate(uint16 _initialCollateralizedPercent, uint16 _undercollateralizedThresholdPercent, uint16 _severelyUndercollateralizedThresholdPercent) returns() +func (_TBTCSystem *TBTCSystemTransactor) BeginCollateralizationThresholdsUpdate(opts *bind.TransactOpts, _initialCollateralizedPercent uint16, _undercollateralizedThresholdPercent uint16, _severelyUndercollateralizedThresholdPercent uint16) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "beginCollateralizationThresholdsUpdate", _initialCollateralizedPercent, _undercollateralizedThresholdPercent, _severelyUndercollateralizedThresholdPercent) +} + +// BeginCollateralizationThresholdsUpdate is a paid mutator transaction binding the contract method 0xdde3fdd2. +// +// Solidity: function beginCollateralizationThresholdsUpdate(uint16 _initialCollateralizedPercent, uint16 _undercollateralizedThresholdPercent, uint16 _severelyUndercollateralizedThresholdPercent) returns() +func (_TBTCSystem *TBTCSystemSession) BeginCollateralizationThresholdsUpdate(_initialCollateralizedPercent uint16, _undercollateralizedThresholdPercent uint16, _severelyUndercollateralizedThresholdPercent uint16) (*types.Transaction, error) { + return _TBTCSystem.Contract.BeginCollateralizationThresholdsUpdate(&_TBTCSystem.TransactOpts, _initialCollateralizedPercent, _undercollateralizedThresholdPercent, _severelyUndercollateralizedThresholdPercent) +} + +// BeginCollateralizationThresholdsUpdate is a paid mutator transaction binding the contract method 0xdde3fdd2. +// +// Solidity: function beginCollateralizationThresholdsUpdate(uint16 _initialCollateralizedPercent, uint16 _undercollateralizedThresholdPercent, uint16 _severelyUndercollateralizedThresholdPercent) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) BeginCollateralizationThresholdsUpdate(_initialCollateralizedPercent uint16, _undercollateralizedThresholdPercent uint16, _severelyUndercollateralizedThresholdPercent uint16) (*types.Transaction, error) { + return _TBTCSystem.Contract.BeginCollateralizationThresholdsUpdate(&_TBTCSystem.TransactOpts, _initialCollateralizedPercent, _undercollateralizedThresholdPercent, _severelyUndercollateralizedThresholdPercent) +} + +// BeginEthBtcPriceFeedAddition is a paid mutator transaction binding the contract method 0x07a3d659. +// +// Solidity: function beginEthBtcPriceFeedAddition(address _ethBtcPriceFeed) returns() +func (_TBTCSystem *TBTCSystemTransactor) BeginEthBtcPriceFeedAddition(opts *bind.TransactOpts, _ethBtcPriceFeed common.Address) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "beginEthBtcPriceFeedAddition", _ethBtcPriceFeed) +} + +// BeginEthBtcPriceFeedAddition is a paid mutator transaction binding the contract method 0x07a3d659. +// +// Solidity: function beginEthBtcPriceFeedAddition(address _ethBtcPriceFeed) returns() +func (_TBTCSystem *TBTCSystemSession) BeginEthBtcPriceFeedAddition(_ethBtcPriceFeed common.Address) (*types.Transaction, error) { + return _TBTCSystem.Contract.BeginEthBtcPriceFeedAddition(&_TBTCSystem.TransactOpts, _ethBtcPriceFeed) +} + +// BeginEthBtcPriceFeedAddition is a paid mutator transaction binding the contract method 0x07a3d659. +// +// Solidity: function beginEthBtcPriceFeedAddition(address _ethBtcPriceFeed) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) BeginEthBtcPriceFeedAddition(_ethBtcPriceFeed common.Address) (*types.Transaction, error) { + return _TBTCSystem.Contract.BeginEthBtcPriceFeedAddition(&_TBTCSystem.TransactOpts, _ethBtcPriceFeed) +} + +// BeginKeepFactoriesUpdate is a paid mutator transaction binding the contract method 0xeae6191f. +// +// Solidity: function beginKeepFactoriesUpdate(address _keepStakedFactory, address _fullyBackedFactory, address _factorySelector) returns() +func (_TBTCSystem *TBTCSystemTransactor) BeginKeepFactoriesUpdate(opts *bind.TransactOpts, _keepStakedFactory common.Address, _fullyBackedFactory common.Address, _factorySelector common.Address) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "beginKeepFactoriesUpdate", _keepStakedFactory, _fullyBackedFactory, _factorySelector) +} + +// BeginKeepFactoriesUpdate is a paid mutator transaction binding the contract method 0xeae6191f. +// +// Solidity: function beginKeepFactoriesUpdate(address _keepStakedFactory, address _fullyBackedFactory, address _factorySelector) returns() +func (_TBTCSystem *TBTCSystemSession) BeginKeepFactoriesUpdate(_keepStakedFactory common.Address, _fullyBackedFactory common.Address, _factorySelector common.Address) (*types.Transaction, error) { + return _TBTCSystem.Contract.BeginKeepFactoriesUpdate(&_TBTCSystem.TransactOpts, _keepStakedFactory, _fullyBackedFactory, _factorySelector) +} + +// BeginKeepFactoriesUpdate is a paid mutator transaction binding the contract method 0xeae6191f. +// +// Solidity: function beginKeepFactoriesUpdate(address _keepStakedFactory, address _fullyBackedFactory, address _factorySelector) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) BeginKeepFactoriesUpdate(_keepStakedFactory common.Address, _fullyBackedFactory common.Address, _factorySelector common.Address) (*types.Transaction, error) { + return _TBTCSystem.Contract.BeginKeepFactoriesUpdate(&_TBTCSystem.TransactOpts, _keepStakedFactory, _fullyBackedFactory, _factorySelector) +} + +// BeginLotSizesUpdate is a paid mutator transaction binding the contract method 0x2b155e37. +// +// Solidity: function beginLotSizesUpdate(uint64[] _lotSizes) returns() +func (_TBTCSystem *TBTCSystemTransactor) BeginLotSizesUpdate(opts *bind.TransactOpts, _lotSizes []uint64) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "beginLotSizesUpdate", _lotSizes) +} + +// BeginLotSizesUpdate is a paid mutator transaction binding the contract method 0x2b155e37. +// +// Solidity: function beginLotSizesUpdate(uint64[] _lotSizes) returns() +func (_TBTCSystem *TBTCSystemSession) BeginLotSizesUpdate(_lotSizes []uint64) (*types.Transaction, error) { + return _TBTCSystem.Contract.BeginLotSizesUpdate(&_TBTCSystem.TransactOpts, _lotSizes) +} + +// BeginLotSizesUpdate is a paid mutator transaction binding the contract method 0x2b155e37. +// +// Solidity: function beginLotSizesUpdate(uint64[] _lotSizes) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) BeginLotSizesUpdate(_lotSizes []uint64) (*types.Transaction, error) { + return _TBTCSystem.Contract.BeginLotSizesUpdate(&_TBTCSystem.TransactOpts, _lotSizes) +} + +// BeginSignerFeeDivisorUpdate is a paid mutator transaction binding the contract method 0x49b64730. +// +// Solidity: function beginSignerFeeDivisorUpdate(uint16 _signerFeeDivisor) returns() +func (_TBTCSystem *TBTCSystemTransactor) BeginSignerFeeDivisorUpdate(opts *bind.TransactOpts, _signerFeeDivisor uint16) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "beginSignerFeeDivisorUpdate", _signerFeeDivisor) +} + +// BeginSignerFeeDivisorUpdate is a paid mutator transaction binding the contract method 0x49b64730. +// +// Solidity: function beginSignerFeeDivisorUpdate(uint16 _signerFeeDivisor) returns() +func (_TBTCSystem *TBTCSystemSession) BeginSignerFeeDivisorUpdate(_signerFeeDivisor uint16) (*types.Transaction, error) { + return _TBTCSystem.Contract.BeginSignerFeeDivisorUpdate(&_TBTCSystem.TransactOpts, _signerFeeDivisor) +} + +// BeginSignerFeeDivisorUpdate is a paid mutator transaction binding the contract method 0x49b64730. +// +// Solidity: function beginSignerFeeDivisorUpdate(uint16 _signerFeeDivisor) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) BeginSignerFeeDivisorUpdate(_signerFeeDivisor uint16) (*types.Transaction, error) { + return _TBTCSystem.Contract.BeginSignerFeeDivisorUpdate(&_TBTCSystem.TransactOpts, _signerFeeDivisor) +} + +// EmergencyPauseNewDeposits is a paid mutator transaction binding the contract method 0x80f04b8c. +// +// Solidity: function emergencyPauseNewDeposits() returns() +func (_TBTCSystem *TBTCSystemTransactor) EmergencyPauseNewDeposits(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "emergencyPauseNewDeposits") +} + +// EmergencyPauseNewDeposits is a paid mutator transaction binding the contract method 0x80f04b8c. +// +// Solidity: function emergencyPauseNewDeposits() returns() +func (_TBTCSystem *TBTCSystemSession) EmergencyPauseNewDeposits() (*types.Transaction, error) { + return _TBTCSystem.Contract.EmergencyPauseNewDeposits(&_TBTCSystem.TransactOpts) +} + +// EmergencyPauseNewDeposits is a paid mutator transaction binding the contract method 0x80f04b8c. +// +// Solidity: function emergencyPauseNewDeposits() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) EmergencyPauseNewDeposits() (*types.Transaction, error) { + return _TBTCSystem.Contract.EmergencyPauseNewDeposits(&_TBTCSystem.TransactOpts) +} + +// FinalizeCollateralizationThresholdsUpdate is a paid mutator transaction binding the contract method 0xde1e57d0. +// +// Solidity: function finalizeCollateralizationThresholdsUpdate() returns() +func (_TBTCSystem *TBTCSystemTransactor) FinalizeCollateralizationThresholdsUpdate(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "finalizeCollateralizationThresholdsUpdate") +} + +// FinalizeCollateralizationThresholdsUpdate is a paid mutator transaction binding the contract method 0xde1e57d0. +// +// Solidity: function finalizeCollateralizationThresholdsUpdate() returns() +func (_TBTCSystem *TBTCSystemSession) FinalizeCollateralizationThresholdsUpdate() (*types.Transaction, error) { + return _TBTCSystem.Contract.FinalizeCollateralizationThresholdsUpdate(&_TBTCSystem.TransactOpts) +} + +// FinalizeCollateralizationThresholdsUpdate is a paid mutator transaction binding the contract method 0xde1e57d0. +// +// Solidity: function finalizeCollateralizationThresholdsUpdate() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) FinalizeCollateralizationThresholdsUpdate() (*types.Transaction, error) { + return _TBTCSystem.Contract.FinalizeCollateralizationThresholdsUpdate(&_TBTCSystem.TransactOpts) +} + +// FinalizeEthBtcPriceFeedAddition is a paid mutator transaction binding the contract method 0xadc3ef70. +// +// Solidity: function finalizeEthBtcPriceFeedAddition() returns() +func (_TBTCSystem *TBTCSystemTransactor) FinalizeEthBtcPriceFeedAddition(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "finalizeEthBtcPriceFeedAddition") +} + +// FinalizeEthBtcPriceFeedAddition is a paid mutator transaction binding the contract method 0xadc3ef70. +// +// Solidity: function finalizeEthBtcPriceFeedAddition() returns() +func (_TBTCSystem *TBTCSystemSession) FinalizeEthBtcPriceFeedAddition() (*types.Transaction, error) { + return _TBTCSystem.Contract.FinalizeEthBtcPriceFeedAddition(&_TBTCSystem.TransactOpts) +} + +// FinalizeEthBtcPriceFeedAddition is a paid mutator transaction binding the contract method 0xadc3ef70. +// +// Solidity: function finalizeEthBtcPriceFeedAddition() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) FinalizeEthBtcPriceFeedAddition() (*types.Transaction, error) { + return _TBTCSystem.Contract.FinalizeEthBtcPriceFeedAddition(&_TBTCSystem.TransactOpts) +} + +// FinalizeKeepFactoriesUpdate is a paid mutator transaction binding the contract method 0x0d4455dc. +// +// Solidity: function finalizeKeepFactoriesUpdate() returns() +func (_TBTCSystem *TBTCSystemTransactor) FinalizeKeepFactoriesUpdate(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "finalizeKeepFactoriesUpdate") +} + +// FinalizeKeepFactoriesUpdate is a paid mutator transaction binding the contract method 0x0d4455dc. +// +// Solidity: function finalizeKeepFactoriesUpdate() returns() +func (_TBTCSystem *TBTCSystemSession) FinalizeKeepFactoriesUpdate() (*types.Transaction, error) { + return _TBTCSystem.Contract.FinalizeKeepFactoriesUpdate(&_TBTCSystem.TransactOpts) +} + +// FinalizeKeepFactoriesUpdate is a paid mutator transaction binding the contract method 0x0d4455dc. +// +// Solidity: function finalizeKeepFactoriesUpdate() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) FinalizeKeepFactoriesUpdate() (*types.Transaction, error) { + return _TBTCSystem.Contract.FinalizeKeepFactoriesUpdate(&_TBTCSystem.TransactOpts) +} + +// FinalizeLotSizesUpdate is a paid mutator transaction binding the contract method 0xcd3a9490. +// +// Solidity: function finalizeLotSizesUpdate() returns() +func (_TBTCSystem *TBTCSystemTransactor) FinalizeLotSizesUpdate(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "finalizeLotSizesUpdate") +} + +// FinalizeLotSizesUpdate is a paid mutator transaction binding the contract method 0xcd3a9490. +// +// Solidity: function finalizeLotSizesUpdate() returns() +func (_TBTCSystem *TBTCSystemSession) FinalizeLotSizesUpdate() (*types.Transaction, error) { + return _TBTCSystem.Contract.FinalizeLotSizesUpdate(&_TBTCSystem.TransactOpts) +} + +// FinalizeLotSizesUpdate is a paid mutator transaction binding the contract method 0xcd3a9490. +// +// Solidity: function finalizeLotSizesUpdate() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) FinalizeLotSizesUpdate() (*types.Transaction, error) { + return _TBTCSystem.Contract.FinalizeLotSizesUpdate(&_TBTCSystem.TransactOpts) +} + +// FinalizeSignerFeeDivisorUpdate is a paid mutator transaction binding the contract method 0x0ce0e700. +// +// Solidity: function finalizeSignerFeeDivisorUpdate() returns() +func (_TBTCSystem *TBTCSystemTransactor) FinalizeSignerFeeDivisorUpdate(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "finalizeSignerFeeDivisorUpdate") +} + +// FinalizeSignerFeeDivisorUpdate is a paid mutator transaction binding the contract method 0x0ce0e700. +// +// Solidity: function finalizeSignerFeeDivisorUpdate() returns() +func (_TBTCSystem *TBTCSystemSession) FinalizeSignerFeeDivisorUpdate() (*types.Transaction, error) { + return _TBTCSystem.Contract.FinalizeSignerFeeDivisorUpdate(&_TBTCSystem.TransactOpts) +} + +// FinalizeSignerFeeDivisorUpdate is a paid mutator transaction binding the contract method 0x0ce0e700. +// +// Solidity: function finalizeSignerFeeDivisorUpdate() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) FinalizeSignerFeeDivisorUpdate() (*types.Transaction, error) { + return _TBTCSystem.Contract.FinalizeSignerFeeDivisorUpdate(&_TBTCSystem.TransactOpts) +} + +// Initialize is a paid mutator transaction binding the contract method 0x1c52d90c. +// +// Solidity: function initialize(address _defaultKeepFactory, address _depositFactory, address _masterDepositAddress, address _tbtcToken, address _tbtcDepositToken, address _feeRebateToken, address _vendingMachine, uint16 _keepThreshold, uint16 _keepSize) returns() +func (_TBTCSystem *TBTCSystemTransactor) Initialize(opts *bind.TransactOpts, _defaultKeepFactory common.Address, _depositFactory common.Address, _masterDepositAddress common.Address, _tbtcToken common.Address, _tbtcDepositToken common.Address, _feeRebateToken common.Address, _vendingMachine common.Address, _keepThreshold uint16, _keepSize uint16) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "initialize", _defaultKeepFactory, _depositFactory, _masterDepositAddress, _tbtcToken, _tbtcDepositToken, _feeRebateToken, _vendingMachine, _keepThreshold, _keepSize) +} + +// Initialize is a paid mutator transaction binding the contract method 0x1c52d90c. +// +// Solidity: function initialize(address _defaultKeepFactory, address _depositFactory, address _masterDepositAddress, address _tbtcToken, address _tbtcDepositToken, address _feeRebateToken, address _vendingMachine, uint16 _keepThreshold, uint16 _keepSize) returns() +func (_TBTCSystem *TBTCSystemSession) Initialize(_defaultKeepFactory common.Address, _depositFactory common.Address, _masterDepositAddress common.Address, _tbtcToken common.Address, _tbtcDepositToken common.Address, _feeRebateToken common.Address, _vendingMachine common.Address, _keepThreshold uint16, _keepSize uint16) (*types.Transaction, error) { + return _TBTCSystem.Contract.Initialize(&_TBTCSystem.TransactOpts, _defaultKeepFactory, _depositFactory, _masterDepositAddress, _tbtcToken, _tbtcDepositToken, _feeRebateToken, _vendingMachine, _keepThreshold, _keepSize) +} + +// Initialize is a paid mutator transaction binding the contract method 0x1c52d90c. +// +// Solidity: function initialize(address _defaultKeepFactory, address _depositFactory, address _masterDepositAddress, address _tbtcToken, address _tbtcDepositToken, address _feeRebateToken, address _vendingMachine, uint16 _keepThreshold, uint16 _keepSize) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) Initialize(_defaultKeepFactory common.Address, _depositFactory common.Address, _masterDepositAddress common.Address, _tbtcToken common.Address, _tbtcDepositToken common.Address, _feeRebateToken common.Address, _vendingMachine common.Address, _keepThreshold uint16, _keepSize uint16) (*types.Transaction, error) { + return _TBTCSystem.Contract.Initialize(&_TBTCSystem.TransactOpts, _defaultKeepFactory, _depositFactory, _masterDepositAddress, _tbtcToken, _tbtcDepositToken, _feeRebateToken, _vendingMachine, _keepThreshold, _keepSize) +} + +// LogCourtesyCalled is a paid mutator transaction binding the contract method 0x22a147e6. +// +// Solidity: function logCourtesyCalled() returns() +func (_TBTCSystem *TBTCSystemTransactor) LogCourtesyCalled(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logCourtesyCalled") +} + +// LogCourtesyCalled is a paid mutator transaction binding the contract method 0x22a147e6. +// +// Solidity: function logCourtesyCalled() returns() +func (_TBTCSystem *TBTCSystemSession) LogCourtesyCalled() (*types.Transaction, error) { + return _TBTCSystem.Contract.LogCourtesyCalled(&_TBTCSystem.TransactOpts) +} + +// LogCourtesyCalled is a paid mutator transaction binding the contract method 0x22a147e6. +// +// Solidity: function logCourtesyCalled() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogCourtesyCalled() (*types.Transaction, error) { + return _TBTCSystem.Contract.LogCourtesyCalled(&_TBTCSystem.TransactOpts) +} + +// LogCreated is a paid mutator transaction binding the contract method 0x282bfd38. +// +// Solidity: function logCreated(address _keepAddress) returns() +func (_TBTCSystem *TBTCSystemTransactor) LogCreated(opts *bind.TransactOpts, _keepAddress common.Address) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logCreated", _keepAddress) +} + +// LogCreated is a paid mutator transaction binding the contract method 0x282bfd38. +// +// Solidity: function logCreated(address _keepAddress) returns() +func (_TBTCSystem *TBTCSystemSession) LogCreated(_keepAddress common.Address) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogCreated(&_TBTCSystem.TransactOpts, _keepAddress) +} + +// LogCreated is a paid mutator transaction binding the contract method 0x282bfd38. +// +// Solidity: function logCreated(address _keepAddress) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogCreated(_keepAddress common.Address) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogCreated(&_TBTCSystem.TransactOpts, _keepAddress) +} + +// LogExitedCourtesyCall is a paid mutator transaction binding the contract method 0x22e5724c. +// +// Solidity: function logExitedCourtesyCall() returns() +func (_TBTCSystem *TBTCSystemTransactor) LogExitedCourtesyCall(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logExitedCourtesyCall") +} + +// LogExitedCourtesyCall is a paid mutator transaction binding the contract method 0x22e5724c. +// +// Solidity: function logExitedCourtesyCall() returns() +func (_TBTCSystem *TBTCSystemSession) LogExitedCourtesyCall() (*types.Transaction, error) { + return _TBTCSystem.Contract.LogExitedCourtesyCall(&_TBTCSystem.TransactOpts) +} + +// LogExitedCourtesyCall is a paid mutator transaction binding the contract method 0x22e5724c. +// +// Solidity: function logExitedCourtesyCall() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogExitedCourtesyCall() (*types.Transaction, error) { + return _TBTCSystem.Contract.LogExitedCourtesyCall(&_TBTCSystem.TransactOpts) +} + +// LogFraudDuringSetup is a paid mutator transaction binding the contract method 0xe2c50ad8. +// +// Solidity: function logFraudDuringSetup() returns() +func (_TBTCSystem *TBTCSystemTransactor) LogFraudDuringSetup(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logFraudDuringSetup") +} + +// LogFraudDuringSetup is a paid mutator transaction binding the contract method 0xe2c50ad8. +// +// Solidity: function logFraudDuringSetup() returns() +func (_TBTCSystem *TBTCSystemSession) LogFraudDuringSetup() (*types.Transaction, error) { + return _TBTCSystem.Contract.LogFraudDuringSetup(&_TBTCSystem.TransactOpts) +} + +// LogFraudDuringSetup is a paid mutator transaction binding the contract method 0xe2c50ad8. +// +// Solidity: function logFraudDuringSetup() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogFraudDuringSetup() (*types.Transaction, error) { + return _TBTCSystem.Contract.LogFraudDuringSetup(&_TBTCSystem.TransactOpts) +} + +// LogFunded is a paid mutator transaction binding the contract method 0x7ed451a4. +// +// Solidity: function logFunded(bytes32 _txid) returns() +func (_TBTCSystem *TBTCSystemTransactor) LogFunded(opts *bind.TransactOpts, _txid [32]byte) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logFunded", _txid) +} + +// LogFunded is a paid mutator transaction binding the contract method 0x7ed451a4. +// +// Solidity: function logFunded(bytes32 _txid) returns() +func (_TBTCSystem *TBTCSystemSession) LogFunded(_txid [32]byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogFunded(&_TBTCSystem.TransactOpts, _txid) +} + +// LogFunded is a paid mutator transaction binding the contract method 0x7ed451a4. +// +// Solidity: function logFunded(bytes32 _txid) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogFunded(_txid [32]byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogFunded(&_TBTCSystem.TransactOpts, _txid) +} + +// LogFunderRequestedAbort is a paid mutator transaction binding the contract method 0xce2c07ce. +// +// Solidity: function logFunderRequestedAbort(bytes _abortOutputScript) returns() +func (_TBTCSystem *TBTCSystemTransactor) LogFunderRequestedAbort(opts *bind.TransactOpts, _abortOutputScript []byte) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logFunderRequestedAbort", _abortOutputScript) +} + +// LogFunderRequestedAbort is a paid mutator transaction binding the contract method 0xce2c07ce. +// +// Solidity: function logFunderRequestedAbort(bytes _abortOutputScript) returns() +func (_TBTCSystem *TBTCSystemSession) LogFunderRequestedAbort(_abortOutputScript []byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogFunderRequestedAbort(&_TBTCSystem.TransactOpts, _abortOutputScript) +} + +// LogFunderRequestedAbort is a paid mutator transaction binding the contract method 0xce2c07ce. +// +// Solidity: function logFunderRequestedAbort(bytes _abortOutputScript) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogFunderRequestedAbort(_abortOutputScript []byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogFunderRequestedAbort(&_TBTCSystem.TransactOpts, _abortOutputScript) +} + +// LogGotRedemptionSignature is a paid mutator transaction binding the contract method 0xf760621e. +// +// Solidity: function logGotRedemptionSignature(bytes32 _digest, bytes32 _r, bytes32 _s) returns() +func (_TBTCSystem *TBTCSystemTransactor) LogGotRedemptionSignature(opts *bind.TransactOpts, _digest [32]byte, _r [32]byte, _s [32]byte) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logGotRedemptionSignature", _digest, _r, _s) +} + +// LogGotRedemptionSignature is a paid mutator transaction binding the contract method 0xf760621e. +// +// Solidity: function logGotRedemptionSignature(bytes32 _digest, bytes32 _r, bytes32 _s) returns() +func (_TBTCSystem *TBTCSystemSession) LogGotRedemptionSignature(_digest [32]byte, _r [32]byte, _s [32]byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogGotRedemptionSignature(&_TBTCSystem.TransactOpts, _digest, _r, _s) +} + +// LogGotRedemptionSignature is a paid mutator transaction binding the contract method 0xf760621e. +// +// Solidity: function logGotRedemptionSignature(bytes32 _digest, bytes32 _r, bytes32 _s) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogGotRedemptionSignature(_digest [32]byte, _r [32]byte, _s [32]byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogGotRedemptionSignature(&_TBTCSystem.TransactOpts, _digest, _r, _s) +} + +// LogLiquidated is a paid mutator transaction binding the contract method 0xc8fba243. +// +// Solidity: function logLiquidated() returns() +func (_TBTCSystem *TBTCSystemTransactor) LogLiquidated(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logLiquidated") +} + +// LogLiquidated is a paid mutator transaction binding the contract method 0xc8fba243. +// +// Solidity: function logLiquidated() returns() +func (_TBTCSystem *TBTCSystemSession) LogLiquidated() (*types.Transaction, error) { + return _TBTCSystem.Contract.LogLiquidated(&_TBTCSystem.TransactOpts) +} + +// LogLiquidated is a paid mutator transaction binding the contract method 0xc8fba243. +// +// Solidity: function logLiquidated() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogLiquidated() (*types.Transaction, error) { + return _TBTCSystem.Contract.LogLiquidated(&_TBTCSystem.TransactOpts) +} + +// LogRedeemed is a paid mutator transaction binding the contract method 0x6e1ba283. +// +// Solidity: function logRedeemed(bytes32 _txid) returns() +func (_TBTCSystem *TBTCSystemTransactor) LogRedeemed(opts *bind.TransactOpts, _txid [32]byte) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logRedeemed", _txid) +} + +// LogRedeemed is a paid mutator transaction binding the contract method 0x6e1ba283. +// +// Solidity: function logRedeemed(bytes32 _txid) returns() +func (_TBTCSystem *TBTCSystemSession) LogRedeemed(_txid [32]byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogRedeemed(&_TBTCSystem.TransactOpts, _txid) +} + +// LogRedeemed is a paid mutator transaction binding the contract method 0x6e1ba283. +// +// Solidity: function logRedeemed(bytes32 _txid) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogRedeemed(_txid [32]byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogRedeemed(&_TBTCSystem.TransactOpts, _txid) +} + +// LogRedemptionRequested is a paid mutator transaction binding the contract method 0x18e647dd. +// +// Solidity: function logRedemptionRequested(address _requester, bytes32 _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) returns() +func (_TBTCSystem *TBTCSystemTransactor) LogRedemptionRequested(opts *bind.TransactOpts, _requester common.Address, _digest [32]byte, _utxoValue *big.Int, _redeemerOutputScript []byte, _requestedFee *big.Int, _outpoint []byte) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logRedemptionRequested", _requester, _digest, _utxoValue, _redeemerOutputScript, _requestedFee, _outpoint) +} + +// LogRedemptionRequested is a paid mutator transaction binding the contract method 0x18e647dd. +// +// Solidity: function logRedemptionRequested(address _requester, bytes32 _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) returns() +func (_TBTCSystem *TBTCSystemSession) LogRedemptionRequested(_requester common.Address, _digest [32]byte, _utxoValue *big.Int, _redeemerOutputScript []byte, _requestedFee *big.Int, _outpoint []byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogRedemptionRequested(&_TBTCSystem.TransactOpts, _requester, _digest, _utxoValue, _redeemerOutputScript, _requestedFee, _outpoint) +} + +// LogRedemptionRequested is a paid mutator transaction binding the contract method 0x18e647dd. +// +// Solidity: function logRedemptionRequested(address _requester, bytes32 _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogRedemptionRequested(_requester common.Address, _digest [32]byte, _utxoValue *big.Int, _redeemerOutputScript []byte, _requestedFee *big.Int, _outpoint []byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogRedemptionRequested(&_TBTCSystem.TransactOpts, _requester, _digest, _utxoValue, _redeemerOutputScript, _requestedFee, _outpoint) +} + +// LogRegisteredPubkey is a paid mutator transaction binding the contract method 0x869f9469. +// +// Solidity: function logRegisteredPubkey(bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY) returns() +func (_TBTCSystem *TBTCSystemTransactor) LogRegisteredPubkey(opts *bind.TransactOpts, _signingGroupPubkeyX [32]byte, _signingGroupPubkeyY [32]byte) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logRegisteredPubkey", _signingGroupPubkeyX, _signingGroupPubkeyY) +} + +// LogRegisteredPubkey is a paid mutator transaction binding the contract method 0x869f9469. +// +// Solidity: function logRegisteredPubkey(bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY) returns() +func (_TBTCSystem *TBTCSystemSession) LogRegisteredPubkey(_signingGroupPubkeyX [32]byte, _signingGroupPubkeyY [32]byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogRegisteredPubkey(&_TBTCSystem.TransactOpts, _signingGroupPubkeyX, _signingGroupPubkeyY) +} + +// LogRegisteredPubkey is a paid mutator transaction binding the contract method 0x869f9469. +// +// Solidity: function logRegisteredPubkey(bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogRegisteredPubkey(_signingGroupPubkeyX [32]byte, _signingGroupPubkeyY [32]byte) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogRegisteredPubkey(&_TBTCSystem.TransactOpts, _signingGroupPubkeyX, _signingGroupPubkeyY) +} + +// LogSetupFailed is a paid mutator transaction binding the contract method 0xa831c816. +// +// Solidity: function logSetupFailed() returns() +func (_TBTCSystem *TBTCSystemTransactor) LogSetupFailed(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logSetupFailed") +} + +// LogSetupFailed is a paid mutator transaction binding the contract method 0xa831c816. +// +// Solidity: function logSetupFailed() returns() +func (_TBTCSystem *TBTCSystemSession) LogSetupFailed() (*types.Transaction, error) { + return _TBTCSystem.Contract.LogSetupFailed(&_TBTCSystem.TransactOpts) +} + +// LogSetupFailed is a paid mutator transaction binding the contract method 0xa831c816. +// +// Solidity: function logSetupFailed() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogSetupFailed() (*types.Transaction, error) { + return _TBTCSystem.Contract.LogSetupFailed(&_TBTCSystem.TransactOpts) +} + +// LogStartedLiquidation is a paid mutator transaction binding the contract method 0x3aac3467. +// +// Solidity: function logStartedLiquidation(bool _wasFraud) returns() +func (_TBTCSystem *TBTCSystemTransactor) LogStartedLiquidation(opts *bind.TransactOpts, _wasFraud bool) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "logStartedLiquidation", _wasFraud) +} + +// LogStartedLiquidation is a paid mutator transaction binding the contract method 0x3aac3467. +// +// Solidity: function logStartedLiquidation(bool _wasFraud) returns() +func (_TBTCSystem *TBTCSystemSession) LogStartedLiquidation(_wasFraud bool) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogStartedLiquidation(&_TBTCSystem.TransactOpts, _wasFraud) +} + +// LogStartedLiquidation is a paid mutator transaction binding the contract method 0x3aac3467. +// +// Solidity: function logStartedLiquidation(bool _wasFraud) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) LogStartedLiquidation(_wasFraud bool) (*types.Transaction, error) { + return _TBTCSystem.Contract.LogStartedLiquidation(&_TBTCSystem.TransactOpts, _wasFraud) +} + +// RefreshMinimumBondableValue is a paid mutator transaction binding the contract method 0x7c75b115. +// +// Solidity: function refreshMinimumBondableValue() returns() +func (_TBTCSystem *TBTCSystemTransactor) RefreshMinimumBondableValue(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "refreshMinimumBondableValue") +} + +// RefreshMinimumBondableValue is a paid mutator transaction binding the contract method 0x7c75b115. +// +// Solidity: function refreshMinimumBondableValue() returns() +func (_TBTCSystem *TBTCSystemSession) RefreshMinimumBondableValue() (*types.Transaction, error) { + return _TBTCSystem.Contract.RefreshMinimumBondableValue(&_TBTCSystem.TransactOpts) +} + +// RefreshMinimumBondableValue is a paid mutator transaction binding the contract method 0x7c75b115. +// +// Solidity: function refreshMinimumBondableValue() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) RefreshMinimumBondableValue() (*types.Transaction, error) { + return _TBTCSystem.Contract.RefreshMinimumBondableValue(&_TBTCSystem.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_TBTCSystem *TBTCSystemTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_TBTCSystem *TBTCSystemSession) RenounceOwnership() (*types.Transaction, error) { + return _TBTCSystem.Contract.RenounceOwnership(&_TBTCSystem.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _TBTCSystem.Contract.RenounceOwnership(&_TBTCSystem.TransactOpts) +} + +// RequestNewKeep is a paid mutator transaction binding the contract method 0x82f91968. +// +// Solidity: function requestNewKeep(uint64 _requestedLotSizeSatoshis, uint256 _maxSecuredLifetime) returns(address) +func (_TBTCSystem *TBTCSystemTransactor) RequestNewKeep(opts *bind.TransactOpts, _requestedLotSizeSatoshis uint64, _maxSecuredLifetime *big.Int) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "requestNewKeep", _requestedLotSizeSatoshis, _maxSecuredLifetime) +} + +// RequestNewKeep is a paid mutator transaction binding the contract method 0x82f91968. +// +// Solidity: function requestNewKeep(uint64 _requestedLotSizeSatoshis, uint256 _maxSecuredLifetime) returns(address) +func (_TBTCSystem *TBTCSystemSession) RequestNewKeep(_requestedLotSizeSatoshis uint64, _maxSecuredLifetime *big.Int) (*types.Transaction, error) { + return _TBTCSystem.Contract.RequestNewKeep(&_TBTCSystem.TransactOpts, _requestedLotSizeSatoshis, _maxSecuredLifetime) +} + +// RequestNewKeep is a paid mutator transaction binding the contract method 0x82f91968. +// +// Solidity: function requestNewKeep(uint64 _requestedLotSizeSatoshis, uint256 _maxSecuredLifetime) returns(address) +func (_TBTCSystem *TBTCSystemTransactorSession) RequestNewKeep(_requestedLotSizeSatoshis uint64, _maxSecuredLifetime *big.Int) (*types.Transaction, error) { + return _TBTCSystem.Contract.RequestNewKeep(&_TBTCSystem.TransactOpts, _requestedLotSizeSatoshis, _maxSecuredLifetime) +} + +// ResumeNewDeposits is a paid mutator transaction binding the contract method 0x7c33fc05. +// +// Solidity: function resumeNewDeposits() returns() +func (_TBTCSystem *TBTCSystemTransactor) ResumeNewDeposits(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "resumeNewDeposits") +} + +// ResumeNewDeposits is a paid mutator transaction binding the contract method 0x7c33fc05. +// +// Solidity: function resumeNewDeposits() returns() +func (_TBTCSystem *TBTCSystemSession) ResumeNewDeposits() (*types.Transaction, error) { + return _TBTCSystem.Contract.ResumeNewDeposits(&_TBTCSystem.TransactOpts) +} + +// ResumeNewDeposits is a paid mutator transaction binding the contract method 0x7c33fc05. +// +// Solidity: function resumeNewDeposits() returns() +func (_TBTCSystem *TBTCSystemTransactorSession) ResumeNewDeposits() (*types.Transaction, error) { + return _TBTCSystem.Contract.ResumeNewDeposits(&_TBTCSystem.TransactOpts) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_TBTCSystem *TBTCSystemTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _TBTCSystem.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_TBTCSystem *TBTCSystemSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _TBTCSystem.Contract.TransferOwnership(&_TBTCSystem.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_TBTCSystem *TBTCSystemTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _TBTCSystem.Contract.TransferOwnership(&_TBTCSystem.TransactOpts, newOwner) +} + +// TBTCSystemAllowNewDepositsUpdatedIterator is returned from FilterAllowNewDepositsUpdated and is used to iterate over the raw logs and unpacked data for AllowNewDepositsUpdated events raised by the TBTCSystem contract. +type TBTCSystemAllowNewDepositsUpdatedIterator struct { + Event *TBTCSystemAllowNewDepositsUpdated // 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 *TBTCSystemAllowNewDepositsUpdatedIterator) 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(TBTCSystemAllowNewDepositsUpdated) + 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(TBTCSystemAllowNewDepositsUpdated) + 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 *TBTCSystemAllowNewDepositsUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemAllowNewDepositsUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemAllowNewDepositsUpdated represents a AllowNewDepositsUpdated event raised by the TBTCSystem contract. +type TBTCSystemAllowNewDepositsUpdated struct { + AllowNewDeposits bool + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAllowNewDepositsUpdated is a free log retrieval operation binding the contract event 0x3a854be74be62dd3ba5f0fdb7aa5b535683f999e90cda09ba75a2d99b2722523. +// +// Solidity: event AllowNewDepositsUpdated(bool _allowNewDeposits) +func (_TBTCSystem *TBTCSystemFilterer) FilterAllowNewDepositsUpdated(opts *bind.FilterOpts) (*TBTCSystemAllowNewDepositsUpdatedIterator, error) { + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "AllowNewDepositsUpdated") + if err != nil { + return nil, err + } + return &TBTCSystemAllowNewDepositsUpdatedIterator{contract: _TBTCSystem.contract, event: "AllowNewDepositsUpdated", logs: logs, sub: sub}, nil +} + +// WatchAllowNewDepositsUpdated is a free log subscription operation binding the contract event 0x3a854be74be62dd3ba5f0fdb7aa5b535683f999e90cda09ba75a2d99b2722523. +// +// Solidity: event AllowNewDepositsUpdated(bool _allowNewDeposits) +func (_TBTCSystem *TBTCSystemFilterer) WatchAllowNewDepositsUpdated(opts *bind.WatchOpts, sink chan<- *TBTCSystemAllowNewDepositsUpdated) (event.Subscription, error) { + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "AllowNewDepositsUpdated") + 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(TBTCSystemAllowNewDepositsUpdated) + if err := _TBTCSystem.contract.UnpackLog(event, "AllowNewDepositsUpdated", 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 +} + +// ParseAllowNewDepositsUpdated is a log parse operation binding the contract event 0x3a854be74be62dd3ba5f0fdb7aa5b535683f999e90cda09ba75a2d99b2722523. +// +// Solidity: event AllowNewDepositsUpdated(bool _allowNewDeposits) +func (_TBTCSystem *TBTCSystemFilterer) ParseAllowNewDepositsUpdated(log types.Log) (*TBTCSystemAllowNewDepositsUpdated, error) { + event := new(TBTCSystemAllowNewDepositsUpdated) + if err := _TBTCSystem.contract.UnpackLog(event, "AllowNewDepositsUpdated", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemCollateralizationThresholdsUpdateStartedIterator is returned from FilterCollateralizationThresholdsUpdateStarted and is used to iterate over the raw logs and unpacked data for CollateralizationThresholdsUpdateStarted events raised by the TBTCSystem contract. +type TBTCSystemCollateralizationThresholdsUpdateStartedIterator struct { + Event *TBTCSystemCollateralizationThresholdsUpdateStarted // 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 *TBTCSystemCollateralizationThresholdsUpdateStartedIterator) 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(TBTCSystemCollateralizationThresholdsUpdateStarted) + 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(TBTCSystemCollateralizationThresholdsUpdateStarted) + 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 *TBTCSystemCollateralizationThresholdsUpdateStartedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemCollateralizationThresholdsUpdateStartedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemCollateralizationThresholdsUpdateStarted represents a CollateralizationThresholdsUpdateStarted event raised by the TBTCSystem contract. +type TBTCSystemCollateralizationThresholdsUpdateStarted struct { + InitialCollateralizedPercent uint16 + UndercollateralizedThresholdPercent uint16 + SeverelyUndercollateralizedThresholdPercent uint16 + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterCollateralizationThresholdsUpdateStarted is a free log retrieval operation binding the contract event 0xc9e225c2db3e9f70966e6c0403de785bcda0172ec4e41111a6e8f4b85b1f30fb. +// +// Solidity: event CollateralizationThresholdsUpdateStarted(uint16 _initialCollateralizedPercent, uint16 _undercollateralizedThresholdPercent, uint16 _severelyUndercollateralizedThresholdPercent, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterCollateralizationThresholdsUpdateStarted(opts *bind.FilterOpts) (*TBTCSystemCollateralizationThresholdsUpdateStartedIterator, error) { + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "CollateralizationThresholdsUpdateStarted") + if err != nil { + return nil, err + } + return &TBTCSystemCollateralizationThresholdsUpdateStartedIterator{contract: _TBTCSystem.contract, event: "CollateralizationThresholdsUpdateStarted", logs: logs, sub: sub}, nil +} + +// WatchCollateralizationThresholdsUpdateStarted is a free log subscription operation binding the contract event 0xc9e225c2db3e9f70966e6c0403de785bcda0172ec4e41111a6e8f4b85b1f30fb. +// +// Solidity: event CollateralizationThresholdsUpdateStarted(uint16 _initialCollateralizedPercent, uint16 _undercollateralizedThresholdPercent, uint16 _severelyUndercollateralizedThresholdPercent, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchCollateralizationThresholdsUpdateStarted(opts *bind.WatchOpts, sink chan<- *TBTCSystemCollateralizationThresholdsUpdateStarted) (event.Subscription, error) { + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "CollateralizationThresholdsUpdateStarted") + 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(TBTCSystemCollateralizationThresholdsUpdateStarted) + if err := _TBTCSystem.contract.UnpackLog(event, "CollateralizationThresholdsUpdateStarted", 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 +} + +// ParseCollateralizationThresholdsUpdateStarted is a log parse operation binding the contract event 0xc9e225c2db3e9f70966e6c0403de785bcda0172ec4e41111a6e8f4b85b1f30fb. +// +// Solidity: event CollateralizationThresholdsUpdateStarted(uint16 _initialCollateralizedPercent, uint16 _undercollateralizedThresholdPercent, uint16 _severelyUndercollateralizedThresholdPercent, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseCollateralizationThresholdsUpdateStarted(log types.Log) (*TBTCSystemCollateralizationThresholdsUpdateStarted, error) { + event := new(TBTCSystemCollateralizationThresholdsUpdateStarted) + if err := _TBTCSystem.contract.UnpackLog(event, "CollateralizationThresholdsUpdateStarted", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemCollateralizationThresholdsUpdatedIterator is returned from FilterCollateralizationThresholdsUpdated and is used to iterate over the raw logs and unpacked data for CollateralizationThresholdsUpdated events raised by the TBTCSystem contract. +type TBTCSystemCollateralizationThresholdsUpdatedIterator struct { + Event *TBTCSystemCollateralizationThresholdsUpdated // 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 *TBTCSystemCollateralizationThresholdsUpdatedIterator) 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(TBTCSystemCollateralizationThresholdsUpdated) + 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(TBTCSystemCollateralizationThresholdsUpdated) + 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 *TBTCSystemCollateralizationThresholdsUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemCollateralizationThresholdsUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemCollateralizationThresholdsUpdated represents a CollateralizationThresholdsUpdated event raised by the TBTCSystem contract. +type TBTCSystemCollateralizationThresholdsUpdated struct { + InitialCollateralizedPercent uint16 + UndercollateralizedThresholdPercent uint16 + SeverelyUndercollateralizedThresholdPercent uint16 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterCollateralizationThresholdsUpdated is a free log retrieval operation binding the contract event 0x07ac9ce7dc4b2edb6435fb2255e9e867f357ef2052b982ce468442aa9d6c1d50. +// +// Solidity: event CollateralizationThresholdsUpdated(uint16 _initialCollateralizedPercent, uint16 _undercollateralizedThresholdPercent, uint16 _severelyUndercollateralizedThresholdPercent) +func (_TBTCSystem *TBTCSystemFilterer) FilterCollateralizationThresholdsUpdated(opts *bind.FilterOpts) (*TBTCSystemCollateralizationThresholdsUpdatedIterator, error) { + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "CollateralizationThresholdsUpdated") + if err != nil { + return nil, err + } + return &TBTCSystemCollateralizationThresholdsUpdatedIterator{contract: _TBTCSystem.contract, event: "CollateralizationThresholdsUpdated", logs: logs, sub: sub}, nil +} + +// WatchCollateralizationThresholdsUpdated is a free log subscription operation binding the contract event 0x07ac9ce7dc4b2edb6435fb2255e9e867f357ef2052b982ce468442aa9d6c1d50. +// +// Solidity: event CollateralizationThresholdsUpdated(uint16 _initialCollateralizedPercent, uint16 _undercollateralizedThresholdPercent, uint16 _severelyUndercollateralizedThresholdPercent) +func (_TBTCSystem *TBTCSystemFilterer) WatchCollateralizationThresholdsUpdated(opts *bind.WatchOpts, sink chan<- *TBTCSystemCollateralizationThresholdsUpdated) (event.Subscription, error) { + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "CollateralizationThresholdsUpdated") + 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(TBTCSystemCollateralizationThresholdsUpdated) + if err := _TBTCSystem.contract.UnpackLog(event, "CollateralizationThresholdsUpdated", 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 +} + +// ParseCollateralizationThresholdsUpdated is a log parse operation binding the contract event 0x07ac9ce7dc4b2edb6435fb2255e9e867f357ef2052b982ce468442aa9d6c1d50. +// +// Solidity: event CollateralizationThresholdsUpdated(uint16 _initialCollateralizedPercent, uint16 _undercollateralizedThresholdPercent, uint16 _severelyUndercollateralizedThresholdPercent) +func (_TBTCSystem *TBTCSystemFilterer) ParseCollateralizationThresholdsUpdated(log types.Log) (*TBTCSystemCollateralizationThresholdsUpdated, error) { + event := new(TBTCSystemCollateralizationThresholdsUpdated) + if err := _TBTCSystem.contract.UnpackLog(event, "CollateralizationThresholdsUpdated", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemCourtesyCalledIterator is returned from FilterCourtesyCalled and is used to iterate over the raw logs and unpacked data for CourtesyCalled events raised by the TBTCSystem contract. +type TBTCSystemCourtesyCalledIterator struct { + Event *TBTCSystemCourtesyCalled // 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 *TBTCSystemCourtesyCalledIterator) 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(TBTCSystemCourtesyCalled) + 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(TBTCSystemCourtesyCalled) + 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 *TBTCSystemCourtesyCalledIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemCourtesyCalledIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemCourtesyCalled represents a CourtesyCalled event raised by the TBTCSystem contract. +type TBTCSystemCourtesyCalled struct { + DepositContractAddress common.Address + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterCourtesyCalled is a free log retrieval operation binding the contract event 0x6e7b45210b79c12cd1332babd8d86c0bbb9ca898a89ce0404f17064dbfba18c0. +// +// Solidity: event CourtesyCalled(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterCourtesyCalled(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*TBTCSystemCourtesyCalledIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "CourtesyCalled", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &TBTCSystemCourtesyCalledIterator{contract: _TBTCSystem.contract, event: "CourtesyCalled", logs: logs, sub: sub}, nil +} + +// WatchCourtesyCalled is a free log subscription operation binding the contract event 0x6e7b45210b79c12cd1332babd8d86c0bbb9ca898a89ce0404f17064dbfba18c0. +// +// Solidity: event CourtesyCalled(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchCourtesyCalled(opts *bind.WatchOpts, sink chan<- *TBTCSystemCourtesyCalled, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "CourtesyCalled", _depositContractAddressRule) + 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(TBTCSystemCourtesyCalled) + if err := _TBTCSystem.contract.UnpackLog(event, "CourtesyCalled", 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 +} + +// ParseCourtesyCalled is a log parse operation binding the contract event 0x6e7b45210b79c12cd1332babd8d86c0bbb9ca898a89ce0404f17064dbfba18c0. +// +// Solidity: event CourtesyCalled(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseCourtesyCalled(log types.Log) (*TBTCSystemCourtesyCalled, error) { + event := new(TBTCSystemCourtesyCalled) + if err := _TBTCSystem.contract.UnpackLog(event, "CourtesyCalled", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemCreatedIterator is returned from FilterCreated and is used to iterate over the raw logs and unpacked data for Created events raised by the TBTCSystem contract. +type TBTCSystemCreatedIterator struct { + Event *TBTCSystemCreated // 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 *TBTCSystemCreatedIterator) 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(TBTCSystemCreated) + 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(TBTCSystemCreated) + 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 *TBTCSystemCreatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemCreatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemCreated represents a Created event raised by the TBTCSystem contract. +type TBTCSystemCreated struct { + DepositContractAddress common.Address + KeepAddress common.Address + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterCreated is a free log retrieval operation binding the contract event 0x822b3073be62c5c7f143c2dcd71ee266434ee935d90a1eec3be34710ac8ec1a2. +// +// Solidity: event Created(address indexed _depositContractAddress, address indexed _keepAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterCreated(opts *bind.FilterOpts, _depositContractAddress []common.Address, _keepAddress []common.Address) (*TBTCSystemCreatedIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _keepAddressRule []interface{} + for _, _keepAddressItem := range _keepAddress { + _keepAddressRule = append(_keepAddressRule, _keepAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "Created", _depositContractAddressRule, _keepAddressRule) + if err != nil { + return nil, err + } + return &TBTCSystemCreatedIterator{contract: _TBTCSystem.contract, event: "Created", logs: logs, sub: sub}, nil +} + +// WatchCreated is a free log subscription operation binding the contract event 0x822b3073be62c5c7f143c2dcd71ee266434ee935d90a1eec3be34710ac8ec1a2. +// +// Solidity: event Created(address indexed _depositContractAddress, address indexed _keepAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchCreated(opts *bind.WatchOpts, sink chan<- *TBTCSystemCreated, _depositContractAddress []common.Address, _keepAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _keepAddressRule []interface{} + for _, _keepAddressItem := range _keepAddress { + _keepAddressRule = append(_keepAddressRule, _keepAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "Created", _depositContractAddressRule, _keepAddressRule) + 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(TBTCSystemCreated) + if err := _TBTCSystem.contract.UnpackLog(event, "Created", 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 +} + +// ParseCreated is a log parse operation binding the contract event 0x822b3073be62c5c7f143c2dcd71ee266434ee935d90a1eec3be34710ac8ec1a2. +// +// Solidity: event Created(address indexed _depositContractAddress, address indexed _keepAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseCreated(log types.Log) (*TBTCSystemCreated, error) { + event := new(TBTCSystemCreated) + if err := _TBTCSystem.contract.UnpackLog(event, "Created", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemEthBtcPriceFeedAddedIterator is returned from FilterEthBtcPriceFeedAdded and is used to iterate over the raw logs and unpacked data for EthBtcPriceFeedAdded events raised by the TBTCSystem contract. +type TBTCSystemEthBtcPriceFeedAddedIterator struct { + Event *TBTCSystemEthBtcPriceFeedAdded // 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 *TBTCSystemEthBtcPriceFeedAddedIterator) 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(TBTCSystemEthBtcPriceFeedAdded) + 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(TBTCSystemEthBtcPriceFeedAdded) + 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 *TBTCSystemEthBtcPriceFeedAddedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemEthBtcPriceFeedAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemEthBtcPriceFeedAdded represents a EthBtcPriceFeedAdded event raised by the TBTCSystem contract. +type TBTCSystemEthBtcPriceFeedAdded struct { + PriceFeed common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterEthBtcPriceFeedAdded is a free log retrieval operation binding the contract event 0x5e4bd1f6e413d39e172d96a88ee6b1b2ba9e1a6207e2ca34fa8c3ccd152ff21a. +// +// Solidity: event EthBtcPriceFeedAdded(address _priceFeed) +func (_TBTCSystem *TBTCSystemFilterer) FilterEthBtcPriceFeedAdded(opts *bind.FilterOpts) (*TBTCSystemEthBtcPriceFeedAddedIterator, error) { + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "EthBtcPriceFeedAdded") + if err != nil { + return nil, err + } + return &TBTCSystemEthBtcPriceFeedAddedIterator{contract: _TBTCSystem.contract, event: "EthBtcPriceFeedAdded", logs: logs, sub: sub}, nil +} + +// WatchEthBtcPriceFeedAdded is a free log subscription operation binding the contract event 0x5e4bd1f6e413d39e172d96a88ee6b1b2ba9e1a6207e2ca34fa8c3ccd152ff21a. +// +// Solidity: event EthBtcPriceFeedAdded(address _priceFeed) +func (_TBTCSystem *TBTCSystemFilterer) WatchEthBtcPriceFeedAdded(opts *bind.WatchOpts, sink chan<- *TBTCSystemEthBtcPriceFeedAdded) (event.Subscription, error) { + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "EthBtcPriceFeedAdded") + 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(TBTCSystemEthBtcPriceFeedAdded) + if err := _TBTCSystem.contract.UnpackLog(event, "EthBtcPriceFeedAdded", 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 +} + +// ParseEthBtcPriceFeedAdded is a log parse operation binding the contract event 0x5e4bd1f6e413d39e172d96a88ee6b1b2ba9e1a6207e2ca34fa8c3ccd152ff21a. +// +// Solidity: event EthBtcPriceFeedAdded(address _priceFeed) +func (_TBTCSystem *TBTCSystemFilterer) ParseEthBtcPriceFeedAdded(log types.Log) (*TBTCSystemEthBtcPriceFeedAdded, error) { + event := new(TBTCSystemEthBtcPriceFeedAdded) + if err := _TBTCSystem.contract.UnpackLog(event, "EthBtcPriceFeedAdded", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemEthBtcPriceFeedAdditionStartedIterator is returned from FilterEthBtcPriceFeedAdditionStarted and is used to iterate over the raw logs and unpacked data for EthBtcPriceFeedAdditionStarted events raised by the TBTCSystem contract. +type TBTCSystemEthBtcPriceFeedAdditionStartedIterator struct { + Event *TBTCSystemEthBtcPriceFeedAdditionStarted // 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 *TBTCSystemEthBtcPriceFeedAdditionStartedIterator) 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(TBTCSystemEthBtcPriceFeedAdditionStarted) + 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(TBTCSystemEthBtcPriceFeedAdditionStarted) + 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 *TBTCSystemEthBtcPriceFeedAdditionStartedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemEthBtcPriceFeedAdditionStartedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemEthBtcPriceFeedAdditionStarted represents a EthBtcPriceFeedAdditionStarted event raised by the TBTCSystem contract. +type TBTCSystemEthBtcPriceFeedAdditionStarted struct { + PriceFeed common.Address + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterEthBtcPriceFeedAdditionStarted is a free log retrieval operation binding the contract event 0x5a3d3d9197f5c60c16de28887dccf83284a4fd034b930272637c83307b4fffe7. +// +// Solidity: event EthBtcPriceFeedAdditionStarted(address _priceFeed, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterEthBtcPriceFeedAdditionStarted(opts *bind.FilterOpts) (*TBTCSystemEthBtcPriceFeedAdditionStartedIterator, error) { + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "EthBtcPriceFeedAdditionStarted") + if err != nil { + return nil, err + } + return &TBTCSystemEthBtcPriceFeedAdditionStartedIterator{contract: _TBTCSystem.contract, event: "EthBtcPriceFeedAdditionStarted", logs: logs, sub: sub}, nil +} + +// WatchEthBtcPriceFeedAdditionStarted is a free log subscription operation binding the contract event 0x5a3d3d9197f5c60c16de28887dccf83284a4fd034b930272637c83307b4fffe7. +// +// Solidity: event EthBtcPriceFeedAdditionStarted(address _priceFeed, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchEthBtcPriceFeedAdditionStarted(opts *bind.WatchOpts, sink chan<- *TBTCSystemEthBtcPriceFeedAdditionStarted) (event.Subscription, error) { + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "EthBtcPriceFeedAdditionStarted") + 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(TBTCSystemEthBtcPriceFeedAdditionStarted) + if err := _TBTCSystem.contract.UnpackLog(event, "EthBtcPriceFeedAdditionStarted", 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 +} + +// ParseEthBtcPriceFeedAdditionStarted is a log parse operation binding the contract event 0x5a3d3d9197f5c60c16de28887dccf83284a4fd034b930272637c83307b4fffe7. +// +// Solidity: event EthBtcPriceFeedAdditionStarted(address _priceFeed, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseEthBtcPriceFeedAdditionStarted(log types.Log) (*TBTCSystemEthBtcPriceFeedAdditionStarted, error) { + event := new(TBTCSystemEthBtcPriceFeedAdditionStarted) + if err := _TBTCSystem.contract.UnpackLog(event, "EthBtcPriceFeedAdditionStarted", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemExitedCourtesyCallIterator is returned from FilterExitedCourtesyCall and is used to iterate over the raw logs and unpacked data for ExitedCourtesyCall events raised by the TBTCSystem contract. +type TBTCSystemExitedCourtesyCallIterator struct { + Event *TBTCSystemExitedCourtesyCall // 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 *TBTCSystemExitedCourtesyCallIterator) 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(TBTCSystemExitedCourtesyCall) + 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(TBTCSystemExitedCourtesyCall) + 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 *TBTCSystemExitedCourtesyCallIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemExitedCourtesyCallIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemExitedCourtesyCall represents a ExitedCourtesyCall event raised by the TBTCSystem contract. +type TBTCSystemExitedCourtesyCall struct { + DepositContractAddress common.Address + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterExitedCourtesyCall is a free log retrieval operation binding the contract event 0x07f0eaafadb9abb1d28da85d4b4c74f1939fd61b535c7f5ab501f618f07e76ee. +// +// Solidity: event ExitedCourtesyCall(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterExitedCourtesyCall(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*TBTCSystemExitedCourtesyCallIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "ExitedCourtesyCall", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &TBTCSystemExitedCourtesyCallIterator{contract: _TBTCSystem.contract, event: "ExitedCourtesyCall", logs: logs, sub: sub}, nil +} + +// WatchExitedCourtesyCall is a free log subscription operation binding the contract event 0x07f0eaafadb9abb1d28da85d4b4c74f1939fd61b535c7f5ab501f618f07e76ee. +// +// Solidity: event ExitedCourtesyCall(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchExitedCourtesyCall(opts *bind.WatchOpts, sink chan<- *TBTCSystemExitedCourtesyCall, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "ExitedCourtesyCall", _depositContractAddressRule) + 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(TBTCSystemExitedCourtesyCall) + if err := _TBTCSystem.contract.UnpackLog(event, "ExitedCourtesyCall", 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 +} + +// ParseExitedCourtesyCall is a log parse operation binding the contract event 0x07f0eaafadb9abb1d28da85d4b4c74f1939fd61b535c7f5ab501f618f07e76ee. +// +// Solidity: event ExitedCourtesyCall(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseExitedCourtesyCall(log types.Log) (*TBTCSystemExitedCourtesyCall, error) { + event := new(TBTCSystemExitedCourtesyCall) + if err := _TBTCSystem.contract.UnpackLog(event, "ExitedCourtesyCall", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemFraudDuringSetupIterator is returned from FilterFraudDuringSetup and is used to iterate over the raw logs and unpacked data for FraudDuringSetup events raised by the TBTCSystem contract. +type TBTCSystemFraudDuringSetupIterator struct { + Event *TBTCSystemFraudDuringSetup // 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 *TBTCSystemFraudDuringSetupIterator) 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(TBTCSystemFraudDuringSetup) + 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(TBTCSystemFraudDuringSetup) + 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 *TBTCSystemFraudDuringSetupIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemFraudDuringSetupIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemFraudDuringSetup represents a FraudDuringSetup event raised by the TBTCSystem contract. +type TBTCSystemFraudDuringSetup struct { + DepositContractAddress common.Address + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFraudDuringSetup is a free log retrieval operation binding the contract event 0x1e61af503f1d7de21d5300094c18bf8700f82b2951a4d54dd2adda13f6b3da30. +// +// Solidity: event FraudDuringSetup(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterFraudDuringSetup(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*TBTCSystemFraudDuringSetupIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "FraudDuringSetup", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &TBTCSystemFraudDuringSetupIterator{contract: _TBTCSystem.contract, event: "FraudDuringSetup", logs: logs, sub: sub}, nil +} + +// WatchFraudDuringSetup is a free log subscription operation binding the contract event 0x1e61af503f1d7de21d5300094c18bf8700f82b2951a4d54dd2adda13f6b3da30. +// +// Solidity: event FraudDuringSetup(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchFraudDuringSetup(opts *bind.WatchOpts, sink chan<- *TBTCSystemFraudDuringSetup, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "FraudDuringSetup", _depositContractAddressRule) + 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(TBTCSystemFraudDuringSetup) + if err := _TBTCSystem.contract.UnpackLog(event, "FraudDuringSetup", 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 +} + +// ParseFraudDuringSetup is a log parse operation binding the contract event 0x1e61af503f1d7de21d5300094c18bf8700f82b2951a4d54dd2adda13f6b3da30. +// +// Solidity: event FraudDuringSetup(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseFraudDuringSetup(log types.Log) (*TBTCSystemFraudDuringSetup, error) { + event := new(TBTCSystemFraudDuringSetup) + if err := _TBTCSystem.contract.UnpackLog(event, "FraudDuringSetup", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemFundedIterator is returned from FilterFunded and is used to iterate over the raw logs and unpacked data for Funded events raised by the TBTCSystem contract. +type TBTCSystemFundedIterator struct { + Event *TBTCSystemFunded // 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 *TBTCSystemFundedIterator) 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(TBTCSystemFunded) + 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(TBTCSystemFunded) + 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 *TBTCSystemFundedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemFundedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemFunded represents a Funded event raised by the TBTCSystem contract. +type TBTCSystemFunded struct { + DepositContractAddress common.Address + Txid [32]byte + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFunded is a free log retrieval operation binding the contract event 0xe34c70bd3e03956978a5c76d2ea5f3a60819171afea6dee4fc12b2e45f72d43d. +// +// Solidity: event Funded(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterFunded(opts *bind.FilterOpts, _depositContractAddress []common.Address, _txid [][32]byte) (*TBTCSystemFundedIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _txidRule []interface{} + for _, _txidItem := range _txid { + _txidRule = append(_txidRule, _txidItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "Funded", _depositContractAddressRule, _txidRule) + if err != nil { + return nil, err + } + return &TBTCSystemFundedIterator{contract: _TBTCSystem.contract, event: "Funded", logs: logs, sub: sub}, nil +} + +// WatchFunded is a free log subscription operation binding the contract event 0xe34c70bd3e03956978a5c76d2ea5f3a60819171afea6dee4fc12b2e45f72d43d. +// +// Solidity: event Funded(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchFunded(opts *bind.WatchOpts, sink chan<- *TBTCSystemFunded, _depositContractAddress []common.Address, _txid [][32]byte) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _txidRule []interface{} + for _, _txidItem := range _txid { + _txidRule = append(_txidRule, _txidItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "Funded", _depositContractAddressRule, _txidRule) + 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(TBTCSystemFunded) + if err := _TBTCSystem.contract.UnpackLog(event, "Funded", 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 +} + +// ParseFunded is a log parse operation binding the contract event 0xe34c70bd3e03956978a5c76d2ea5f3a60819171afea6dee4fc12b2e45f72d43d. +// +// Solidity: event Funded(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseFunded(log types.Log) (*TBTCSystemFunded, error) { + event := new(TBTCSystemFunded) + if err := _TBTCSystem.contract.UnpackLog(event, "Funded", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemFunderAbortRequestedIterator is returned from FilterFunderAbortRequested and is used to iterate over the raw logs and unpacked data for FunderAbortRequested events raised by the TBTCSystem contract. +type TBTCSystemFunderAbortRequestedIterator struct { + Event *TBTCSystemFunderAbortRequested // 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 *TBTCSystemFunderAbortRequestedIterator) 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(TBTCSystemFunderAbortRequested) + 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(TBTCSystemFunderAbortRequested) + 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 *TBTCSystemFunderAbortRequestedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemFunderAbortRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemFunderAbortRequested represents a FunderAbortRequested event raised by the TBTCSystem contract. +type TBTCSystemFunderAbortRequested struct { + DepositContractAddress common.Address + AbortOutputScript []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFunderAbortRequested is a free log retrieval operation binding the contract event 0xa6e9673b5d53b3fe3c62b6459720f9c2a1b129d4f69acb771404ba8681b6a930. +// +// Solidity: event FunderAbortRequested(address indexed _depositContractAddress, bytes _abortOutputScript) +func (_TBTCSystem *TBTCSystemFilterer) FilterFunderAbortRequested(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*TBTCSystemFunderAbortRequestedIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "FunderAbortRequested", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &TBTCSystemFunderAbortRequestedIterator{contract: _TBTCSystem.contract, event: "FunderAbortRequested", logs: logs, sub: sub}, nil +} + +// WatchFunderAbortRequested is a free log subscription operation binding the contract event 0xa6e9673b5d53b3fe3c62b6459720f9c2a1b129d4f69acb771404ba8681b6a930. +// +// Solidity: event FunderAbortRequested(address indexed _depositContractAddress, bytes _abortOutputScript) +func (_TBTCSystem *TBTCSystemFilterer) WatchFunderAbortRequested(opts *bind.WatchOpts, sink chan<- *TBTCSystemFunderAbortRequested, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "FunderAbortRequested", _depositContractAddressRule) + 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(TBTCSystemFunderAbortRequested) + if err := _TBTCSystem.contract.UnpackLog(event, "FunderAbortRequested", 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 +} + +// ParseFunderAbortRequested is a log parse operation binding the contract event 0xa6e9673b5d53b3fe3c62b6459720f9c2a1b129d4f69acb771404ba8681b6a930. +// +// Solidity: event FunderAbortRequested(address indexed _depositContractAddress, bytes _abortOutputScript) +func (_TBTCSystem *TBTCSystemFilterer) ParseFunderAbortRequested(log types.Log) (*TBTCSystemFunderAbortRequested, error) { + event := new(TBTCSystemFunderAbortRequested) + if err := _TBTCSystem.contract.UnpackLog(event, "FunderAbortRequested", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemGotRedemptionSignatureIterator is returned from FilterGotRedemptionSignature and is used to iterate over the raw logs and unpacked data for GotRedemptionSignature events raised by the TBTCSystem contract. +type TBTCSystemGotRedemptionSignatureIterator struct { + Event *TBTCSystemGotRedemptionSignature // 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 *TBTCSystemGotRedemptionSignatureIterator) 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(TBTCSystemGotRedemptionSignature) + 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(TBTCSystemGotRedemptionSignature) + 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 *TBTCSystemGotRedemptionSignatureIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemGotRedemptionSignatureIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemGotRedemptionSignature represents a GotRedemptionSignature event raised by the TBTCSystem contract. +type TBTCSystemGotRedemptionSignature struct { + DepositContractAddress common.Address + Digest [32]byte + R [32]byte + S [32]byte + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterGotRedemptionSignature is a free log retrieval operation binding the contract event 0x7f7d7327762d01d2c4a552ea0be2bc5a76264574a80aa78083e691a840e509f2. +// +// Solidity: event GotRedemptionSignature(address indexed _depositContractAddress, bytes32 indexed _digest, bytes32 _r, bytes32 _s, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterGotRedemptionSignature(opts *bind.FilterOpts, _depositContractAddress []common.Address, _digest [][32]byte) (*TBTCSystemGotRedemptionSignatureIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _digestRule []interface{} + for _, _digestItem := range _digest { + _digestRule = append(_digestRule, _digestItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "GotRedemptionSignature", _depositContractAddressRule, _digestRule) + if err != nil { + return nil, err + } + return &TBTCSystemGotRedemptionSignatureIterator{contract: _TBTCSystem.contract, event: "GotRedemptionSignature", logs: logs, sub: sub}, nil +} + +// WatchGotRedemptionSignature is a free log subscription operation binding the contract event 0x7f7d7327762d01d2c4a552ea0be2bc5a76264574a80aa78083e691a840e509f2. +// +// Solidity: event GotRedemptionSignature(address indexed _depositContractAddress, bytes32 indexed _digest, bytes32 _r, bytes32 _s, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchGotRedemptionSignature(opts *bind.WatchOpts, sink chan<- *TBTCSystemGotRedemptionSignature, _depositContractAddress []common.Address, _digest [][32]byte) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _digestRule []interface{} + for _, _digestItem := range _digest { + _digestRule = append(_digestRule, _digestItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "GotRedemptionSignature", _depositContractAddressRule, _digestRule) + 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(TBTCSystemGotRedemptionSignature) + if err := _TBTCSystem.contract.UnpackLog(event, "GotRedemptionSignature", 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 +} + +// ParseGotRedemptionSignature is a log parse operation binding the contract event 0x7f7d7327762d01d2c4a552ea0be2bc5a76264574a80aa78083e691a840e509f2. +// +// Solidity: event GotRedemptionSignature(address indexed _depositContractAddress, bytes32 indexed _digest, bytes32 _r, bytes32 _s, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseGotRedemptionSignature(log types.Log) (*TBTCSystemGotRedemptionSignature, error) { + event := new(TBTCSystemGotRedemptionSignature) + if err := _TBTCSystem.contract.UnpackLog(event, "GotRedemptionSignature", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemKeepFactoriesUpdateStartedIterator is returned from FilterKeepFactoriesUpdateStarted and is used to iterate over the raw logs and unpacked data for KeepFactoriesUpdateStarted events raised by the TBTCSystem contract. +type TBTCSystemKeepFactoriesUpdateStartedIterator struct { + Event *TBTCSystemKeepFactoriesUpdateStarted // 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 *TBTCSystemKeepFactoriesUpdateStartedIterator) 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(TBTCSystemKeepFactoriesUpdateStarted) + 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(TBTCSystemKeepFactoriesUpdateStarted) + 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 *TBTCSystemKeepFactoriesUpdateStartedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemKeepFactoriesUpdateStartedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemKeepFactoriesUpdateStarted represents a KeepFactoriesUpdateStarted event raised by the TBTCSystem contract. +type TBTCSystemKeepFactoriesUpdateStarted struct { + KeepStakedFactory common.Address + FullyBackedFactory common.Address + FactorySelector common.Address + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterKeepFactoriesUpdateStarted is a free log retrieval operation binding the contract event 0x1608ec8025d64cdb0ed78e62a67d271a33b9d738842a6eb6e6449bc3afab6dca. +// +// Solidity: event KeepFactoriesUpdateStarted(address _keepStakedFactory, address _fullyBackedFactory, address _factorySelector, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterKeepFactoriesUpdateStarted(opts *bind.FilterOpts) (*TBTCSystemKeepFactoriesUpdateStartedIterator, error) { + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "KeepFactoriesUpdateStarted") + if err != nil { + return nil, err + } + return &TBTCSystemKeepFactoriesUpdateStartedIterator{contract: _TBTCSystem.contract, event: "KeepFactoriesUpdateStarted", logs: logs, sub: sub}, nil +} + +// WatchKeepFactoriesUpdateStarted is a free log subscription operation binding the contract event 0x1608ec8025d64cdb0ed78e62a67d271a33b9d738842a6eb6e6449bc3afab6dca. +// +// Solidity: event KeepFactoriesUpdateStarted(address _keepStakedFactory, address _fullyBackedFactory, address _factorySelector, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchKeepFactoriesUpdateStarted(opts *bind.WatchOpts, sink chan<- *TBTCSystemKeepFactoriesUpdateStarted) (event.Subscription, error) { + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "KeepFactoriesUpdateStarted") + 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(TBTCSystemKeepFactoriesUpdateStarted) + if err := _TBTCSystem.contract.UnpackLog(event, "KeepFactoriesUpdateStarted", 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 +} + +// ParseKeepFactoriesUpdateStarted is a log parse operation binding the contract event 0x1608ec8025d64cdb0ed78e62a67d271a33b9d738842a6eb6e6449bc3afab6dca. +// +// Solidity: event KeepFactoriesUpdateStarted(address _keepStakedFactory, address _fullyBackedFactory, address _factorySelector, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseKeepFactoriesUpdateStarted(log types.Log) (*TBTCSystemKeepFactoriesUpdateStarted, error) { + event := new(TBTCSystemKeepFactoriesUpdateStarted) + if err := _TBTCSystem.contract.UnpackLog(event, "KeepFactoriesUpdateStarted", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemKeepFactoriesUpdatedIterator is returned from FilterKeepFactoriesUpdated and is used to iterate over the raw logs and unpacked data for KeepFactoriesUpdated events raised by the TBTCSystem contract. +type TBTCSystemKeepFactoriesUpdatedIterator struct { + Event *TBTCSystemKeepFactoriesUpdated // 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 *TBTCSystemKeepFactoriesUpdatedIterator) 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(TBTCSystemKeepFactoriesUpdated) + 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(TBTCSystemKeepFactoriesUpdated) + 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 *TBTCSystemKeepFactoriesUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemKeepFactoriesUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemKeepFactoriesUpdated represents a KeepFactoriesUpdated event raised by the TBTCSystem contract. +type TBTCSystemKeepFactoriesUpdated struct { + KeepStakedFactory common.Address + FullyBackedFactory common.Address + FactorySelector common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterKeepFactoriesUpdated is a free log retrieval operation binding the contract event 0x75cd06e2a95bd62ad447184bf0950b3af3aabd0960994d09da9724686d0c1720. +// +// Solidity: event KeepFactoriesUpdated(address _keepStakedFactory, address _fullyBackedFactory, address _factorySelector) +func (_TBTCSystem *TBTCSystemFilterer) FilterKeepFactoriesUpdated(opts *bind.FilterOpts) (*TBTCSystemKeepFactoriesUpdatedIterator, error) { + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "KeepFactoriesUpdated") + if err != nil { + return nil, err + } + return &TBTCSystemKeepFactoriesUpdatedIterator{contract: _TBTCSystem.contract, event: "KeepFactoriesUpdated", logs: logs, sub: sub}, nil +} + +// WatchKeepFactoriesUpdated is a free log subscription operation binding the contract event 0x75cd06e2a95bd62ad447184bf0950b3af3aabd0960994d09da9724686d0c1720. +// +// Solidity: event KeepFactoriesUpdated(address _keepStakedFactory, address _fullyBackedFactory, address _factorySelector) +func (_TBTCSystem *TBTCSystemFilterer) WatchKeepFactoriesUpdated(opts *bind.WatchOpts, sink chan<- *TBTCSystemKeepFactoriesUpdated) (event.Subscription, error) { + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "KeepFactoriesUpdated") + 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(TBTCSystemKeepFactoriesUpdated) + if err := _TBTCSystem.contract.UnpackLog(event, "KeepFactoriesUpdated", 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 +} + +// ParseKeepFactoriesUpdated is a log parse operation binding the contract event 0x75cd06e2a95bd62ad447184bf0950b3af3aabd0960994d09da9724686d0c1720. +// +// Solidity: event KeepFactoriesUpdated(address _keepStakedFactory, address _fullyBackedFactory, address _factorySelector) +func (_TBTCSystem *TBTCSystemFilterer) ParseKeepFactoriesUpdated(log types.Log) (*TBTCSystemKeepFactoriesUpdated, error) { + event := new(TBTCSystemKeepFactoriesUpdated) + if err := _TBTCSystem.contract.UnpackLog(event, "KeepFactoriesUpdated", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemLiquidatedIterator is returned from FilterLiquidated and is used to iterate over the raw logs and unpacked data for Liquidated events raised by the TBTCSystem contract. +type TBTCSystemLiquidatedIterator struct { + Event *TBTCSystemLiquidated // 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 *TBTCSystemLiquidatedIterator) 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(TBTCSystemLiquidated) + 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(TBTCSystemLiquidated) + 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 *TBTCSystemLiquidatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemLiquidatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemLiquidated represents a Liquidated event raised by the TBTCSystem contract. +type TBTCSystemLiquidated struct { + DepositContractAddress common.Address + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterLiquidated is a free log retrieval operation binding the contract event 0xa5ee7a2b0254fce91deed604506790ed7fa072d0b14cba4859c3bc8955b9caac. +// +// Solidity: event Liquidated(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterLiquidated(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*TBTCSystemLiquidatedIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "Liquidated", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &TBTCSystemLiquidatedIterator{contract: _TBTCSystem.contract, event: "Liquidated", logs: logs, sub: sub}, nil +} + +// WatchLiquidated is a free log subscription operation binding the contract event 0xa5ee7a2b0254fce91deed604506790ed7fa072d0b14cba4859c3bc8955b9caac. +// +// Solidity: event Liquidated(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchLiquidated(opts *bind.WatchOpts, sink chan<- *TBTCSystemLiquidated, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "Liquidated", _depositContractAddressRule) + 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(TBTCSystemLiquidated) + if err := _TBTCSystem.contract.UnpackLog(event, "Liquidated", 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 +} + +// ParseLiquidated is a log parse operation binding the contract event 0xa5ee7a2b0254fce91deed604506790ed7fa072d0b14cba4859c3bc8955b9caac. +// +// Solidity: event Liquidated(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseLiquidated(log types.Log) (*TBTCSystemLiquidated, error) { + event := new(TBTCSystemLiquidated) + if err := _TBTCSystem.contract.UnpackLog(event, "Liquidated", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemLotSizesUpdateStartedIterator is returned from FilterLotSizesUpdateStarted and is used to iterate over the raw logs and unpacked data for LotSizesUpdateStarted events raised by the TBTCSystem contract. +type TBTCSystemLotSizesUpdateStartedIterator struct { + Event *TBTCSystemLotSizesUpdateStarted // 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 *TBTCSystemLotSizesUpdateStartedIterator) 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(TBTCSystemLotSizesUpdateStarted) + 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(TBTCSystemLotSizesUpdateStarted) + 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 *TBTCSystemLotSizesUpdateStartedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemLotSizesUpdateStartedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemLotSizesUpdateStarted represents a LotSizesUpdateStarted event raised by the TBTCSystem contract. +type TBTCSystemLotSizesUpdateStarted struct { + LotSizes []uint64 + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterLotSizesUpdateStarted is a free log retrieval operation binding the contract event 0xffb1e2bce3c7a63d0cac5492540bd370e1156621adde36cd481262c2846a2b7b. +// +// Solidity: event LotSizesUpdateStarted(uint64[] _lotSizes, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterLotSizesUpdateStarted(opts *bind.FilterOpts) (*TBTCSystemLotSizesUpdateStartedIterator, error) { + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "LotSizesUpdateStarted") + if err != nil { + return nil, err + } + return &TBTCSystemLotSizesUpdateStartedIterator{contract: _TBTCSystem.contract, event: "LotSizesUpdateStarted", logs: logs, sub: sub}, nil +} + +// WatchLotSizesUpdateStarted is a free log subscription operation binding the contract event 0xffb1e2bce3c7a63d0cac5492540bd370e1156621adde36cd481262c2846a2b7b. +// +// Solidity: event LotSizesUpdateStarted(uint64[] _lotSizes, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchLotSizesUpdateStarted(opts *bind.WatchOpts, sink chan<- *TBTCSystemLotSizesUpdateStarted) (event.Subscription, error) { + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "LotSizesUpdateStarted") + 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(TBTCSystemLotSizesUpdateStarted) + if err := _TBTCSystem.contract.UnpackLog(event, "LotSizesUpdateStarted", 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 +} + +// ParseLotSizesUpdateStarted is a log parse operation binding the contract event 0xffb1e2bce3c7a63d0cac5492540bd370e1156621adde36cd481262c2846a2b7b. +// +// Solidity: event LotSizesUpdateStarted(uint64[] _lotSizes, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseLotSizesUpdateStarted(log types.Log) (*TBTCSystemLotSizesUpdateStarted, error) { + event := new(TBTCSystemLotSizesUpdateStarted) + if err := _TBTCSystem.contract.UnpackLog(event, "LotSizesUpdateStarted", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemLotSizesUpdatedIterator is returned from FilterLotSizesUpdated and is used to iterate over the raw logs and unpacked data for LotSizesUpdated events raised by the TBTCSystem contract. +type TBTCSystemLotSizesUpdatedIterator struct { + Event *TBTCSystemLotSizesUpdated // 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 *TBTCSystemLotSizesUpdatedIterator) 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(TBTCSystemLotSizesUpdated) + 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(TBTCSystemLotSizesUpdated) + 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 *TBTCSystemLotSizesUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemLotSizesUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemLotSizesUpdated represents a LotSizesUpdated event raised by the TBTCSystem contract. +type TBTCSystemLotSizesUpdated struct { + LotSizes []uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterLotSizesUpdated is a free log retrieval operation binding the contract event 0xa801e49d33e856d89d06e647753d9d9dda3d0b0520c4346290ada455a00cafcc. +// +// Solidity: event LotSizesUpdated(uint64[] _lotSizes) +func (_TBTCSystem *TBTCSystemFilterer) FilterLotSizesUpdated(opts *bind.FilterOpts) (*TBTCSystemLotSizesUpdatedIterator, error) { + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "LotSizesUpdated") + if err != nil { + return nil, err + } + return &TBTCSystemLotSizesUpdatedIterator{contract: _TBTCSystem.contract, event: "LotSizesUpdated", logs: logs, sub: sub}, nil +} + +// WatchLotSizesUpdated is a free log subscription operation binding the contract event 0xa801e49d33e856d89d06e647753d9d9dda3d0b0520c4346290ada455a00cafcc. +// +// Solidity: event LotSizesUpdated(uint64[] _lotSizes) +func (_TBTCSystem *TBTCSystemFilterer) WatchLotSizesUpdated(opts *bind.WatchOpts, sink chan<- *TBTCSystemLotSizesUpdated) (event.Subscription, error) { + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "LotSizesUpdated") + 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(TBTCSystemLotSizesUpdated) + if err := _TBTCSystem.contract.UnpackLog(event, "LotSizesUpdated", 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 +} + +// ParseLotSizesUpdated is a log parse operation binding the contract event 0xa801e49d33e856d89d06e647753d9d9dda3d0b0520c4346290ada455a00cafcc. +// +// Solidity: event LotSizesUpdated(uint64[] _lotSizes) +func (_TBTCSystem *TBTCSystemFilterer) ParseLotSizesUpdated(log types.Log) (*TBTCSystemLotSizesUpdated, error) { + event := new(TBTCSystemLotSizesUpdated) + if err := _TBTCSystem.contract.UnpackLog(event, "LotSizesUpdated", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the TBTCSystem contract. +type TBTCSystemOwnershipTransferredIterator struct { + Event *TBTCSystemOwnershipTransferred // 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 *TBTCSystemOwnershipTransferredIterator) 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(TBTCSystemOwnershipTransferred) + 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(TBTCSystemOwnershipTransferred) + 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 *TBTCSystemOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemOwnershipTransferred represents a OwnershipTransferred event raised by the TBTCSystem contract. +type TBTCSystemOwnershipTransferred 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 (_TBTCSystem *TBTCSystemFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*TBTCSystemOwnershipTransferredIterator, 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 := _TBTCSystem.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &TBTCSystemOwnershipTransferredIterator{contract: _TBTCSystem.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 (_TBTCSystem *TBTCSystemFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *TBTCSystemOwnershipTransferred, 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 := _TBTCSystem.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(TBTCSystemOwnershipTransferred) + if err := _TBTCSystem.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 (_TBTCSystem *TBTCSystemFilterer) ParseOwnershipTransferred(log types.Log) (*TBTCSystemOwnershipTransferred, error) { + event := new(TBTCSystemOwnershipTransferred) + if err := _TBTCSystem.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemRedeemedIterator is returned from FilterRedeemed and is used to iterate over the raw logs and unpacked data for Redeemed events raised by the TBTCSystem contract. +type TBTCSystemRedeemedIterator struct { + Event *TBTCSystemRedeemed // 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 *TBTCSystemRedeemedIterator) 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(TBTCSystemRedeemed) + 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(TBTCSystemRedeemed) + 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 *TBTCSystemRedeemedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemRedeemedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemRedeemed represents a Redeemed event raised by the TBTCSystem contract. +type TBTCSystemRedeemed struct { + DepositContractAddress common.Address + Txid [32]byte + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRedeemed is a free log retrieval operation binding the contract event 0x44b7f176bcc739b54bd0800fe491cbdea19df7d4d6b19c281462e6b4fc504344. +// +// Solidity: event Redeemed(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterRedeemed(opts *bind.FilterOpts, _depositContractAddress []common.Address, _txid [][32]byte) (*TBTCSystemRedeemedIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _txidRule []interface{} + for _, _txidItem := range _txid { + _txidRule = append(_txidRule, _txidItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "Redeemed", _depositContractAddressRule, _txidRule) + if err != nil { + return nil, err + } + return &TBTCSystemRedeemedIterator{contract: _TBTCSystem.contract, event: "Redeemed", logs: logs, sub: sub}, nil +} + +// WatchRedeemed is a free log subscription operation binding the contract event 0x44b7f176bcc739b54bd0800fe491cbdea19df7d4d6b19c281462e6b4fc504344. +// +// Solidity: event Redeemed(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchRedeemed(opts *bind.WatchOpts, sink chan<- *TBTCSystemRedeemed, _depositContractAddress []common.Address, _txid [][32]byte) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _txidRule []interface{} + for _, _txidItem := range _txid { + _txidRule = append(_txidRule, _txidItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "Redeemed", _depositContractAddressRule, _txidRule) + 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(TBTCSystemRedeemed) + if err := _TBTCSystem.contract.UnpackLog(event, "Redeemed", 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 +} + +// ParseRedeemed is a log parse operation binding the contract event 0x44b7f176bcc739b54bd0800fe491cbdea19df7d4d6b19c281462e6b4fc504344. +// +// Solidity: event Redeemed(address indexed _depositContractAddress, bytes32 indexed _txid, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseRedeemed(log types.Log) (*TBTCSystemRedeemed, error) { + event := new(TBTCSystemRedeemed) + if err := _TBTCSystem.contract.UnpackLog(event, "Redeemed", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemRedemptionRequestedIterator is returned from FilterRedemptionRequested and is used to iterate over the raw logs and unpacked data for RedemptionRequested events raised by the TBTCSystem contract. +type TBTCSystemRedemptionRequestedIterator struct { + Event *TBTCSystemRedemptionRequested // 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 *TBTCSystemRedemptionRequestedIterator) 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(TBTCSystemRedemptionRequested) + 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(TBTCSystemRedemptionRequested) + 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 *TBTCSystemRedemptionRequestedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemRedemptionRequestedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemRedemptionRequested represents a RedemptionRequested event raised by the TBTCSystem contract. +type TBTCSystemRedemptionRequested struct { + DepositContractAddress common.Address + Requester common.Address + Digest [32]byte + UtxoValue *big.Int + RedeemerOutputScript []byte + RequestedFee *big.Int + Outpoint []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRedemptionRequested is a free log retrieval operation binding the contract event 0x7959c380174061a21a3ba80243a032ba9cd10dc8bd1736d7e835c94e97a35a98. +// +// Solidity: event RedemptionRequested(address indexed _depositContractAddress, address indexed _requester, bytes32 indexed _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) +func (_TBTCSystem *TBTCSystemFilterer) FilterRedemptionRequested(opts *bind.FilterOpts, _depositContractAddress []common.Address, _requester []common.Address, _digest [][32]byte) (*TBTCSystemRedemptionRequestedIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _requesterRule []interface{} + for _, _requesterItem := range _requester { + _requesterRule = append(_requesterRule, _requesterItem) + } + var _digestRule []interface{} + for _, _digestItem := range _digest { + _digestRule = append(_digestRule, _digestItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "RedemptionRequested", _depositContractAddressRule, _requesterRule, _digestRule) + if err != nil { + return nil, err + } + return &TBTCSystemRedemptionRequestedIterator{contract: _TBTCSystem.contract, event: "RedemptionRequested", logs: logs, sub: sub}, nil +} + +// WatchRedemptionRequested is a free log subscription operation binding the contract event 0x7959c380174061a21a3ba80243a032ba9cd10dc8bd1736d7e835c94e97a35a98. +// +// Solidity: event RedemptionRequested(address indexed _depositContractAddress, address indexed _requester, bytes32 indexed _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) +func (_TBTCSystem *TBTCSystemFilterer) WatchRedemptionRequested(opts *bind.WatchOpts, sink chan<- *TBTCSystemRedemptionRequested, _depositContractAddress []common.Address, _requester []common.Address, _digest [][32]byte) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + var _requesterRule []interface{} + for _, _requesterItem := range _requester { + _requesterRule = append(_requesterRule, _requesterItem) + } + var _digestRule []interface{} + for _, _digestItem := range _digest { + _digestRule = append(_digestRule, _digestItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "RedemptionRequested", _depositContractAddressRule, _requesterRule, _digestRule) + 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(TBTCSystemRedemptionRequested) + if err := _TBTCSystem.contract.UnpackLog(event, "RedemptionRequested", 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 +} + +// ParseRedemptionRequested is a log parse operation binding the contract event 0x7959c380174061a21a3ba80243a032ba9cd10dc8bd1736d7e835c94e97a35a98. +// +// Solidity: event RedemptionRequested(address indexed _depositContractAddress, address indexed _requester, bytes32 indexed _digest, uint256 _utxoValue, bytes _redeemerOutputScript, uint256 _requestedFee, bytes _outpoint) +func (_TBTCSystem *TBTCSystemFilterer) ParseRedemptionRequested(log types.Log) (*TBTCSystemRedemptionRequested, error) { + event := new(TBTCSystemRedemptionRequested) + if err := _TBTCSystem.contract.UnpackLog(event, "RedemptionRequested", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemRegisteredPubkeyIterator is returned from FilterRegisteredPubkey and is used to iterate over the raw logs and unpacked data for RegisteredPubkey events raised by the TBTCSystem contract. +type TBTCSystemRegisteredPubkeyIterator struct { + Event *TBTCSystemRegisteredPubkey // 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 *TBTCSystemRegisteredPubkeyIterator) 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(TBTCSystemRegisteredPubkey) + 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(TBTCSystemRegisteredPubkey) + 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 *TBTCSystemRegisteredPubkeyIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemRegisteredPubkeyIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemRegisteredPubkey represents a RegisteredPubkey event raised by the TBTCSystem contract. +type TBTCSystemRegisteredPubkey struct { + DepositContractAddress common.Address + SigningGroupPubkeyX [32]byte + SigningGroupPubkeyY [32]byte + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRegisteredPubkey is a free log retrieval operation binding the contract event 0x8ee737ab16909c4e9d1b750814a4393c9f84ab5d3a29c08c313b783fc846ae33. +// +// Solidity: event RegisteredPubkey(address indexed _depositContractAddress, bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterRegisteredPubkey(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*TBTCSystemRegisteredPubkeyIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "RegisteredPubkey", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &TBTCSystemRegisteredPubkeyIterator{contract: _TBTCSystem.contract, event: "RegisteredPubkey", logs: logs, sub: sub}, nil +} + +// WatchRegisteredPubkey is a free log subscription operation binding the contract event 0x8ee737ab16909c4e9d1b750814a4393c9f84ab5d3a29c08c313b783fc846ae33. +// +// Solidity: event RegisteredPubkey(address indexed _depositContractAddress, bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchRegisteredPubkey(opts *bind.WatchOpts, sink chan<- *TBTCSystemRegisteredPubkey, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "RegisteredPubkey", _depositContractAddressRule) + 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(TBTCSystemRegisteredPubkey) + if err := _TBTCSystem.contract.UnpackLog(event, "RegisteredPubkey", 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 +} + +// ParseRegisteredPubkey is a log parse operation binding the contract event 0x8ee737ab16909c4e9d1b750814a4393c9f84ab5d3a29c08c313b783fc846ae33. +// +// Solidity: event RegisteredPubkey(address indexed _depositContractAddress, bytes32 _signingGroupPubkeyX, bytes32 _signingGroupPubkeyY, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseRegisteredPubkey(log types.Log) (*TBTCSystemRegisteredPubkey, error) { + event := new(TBTCSystemRegisteredPubkey) + if err := _TBTCSystem.contract.UnpackLog(event, "RegisteredPubkey", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemSetupFailedIterator is returned from FilterSetupFailed and is used to iterate over the raw logs and unpacked data for SetupFailed events raised by the TBTCSystem contract. +type TBTCSystemSetupFailedIterator struct { + Event *TBTCSystemSetupFailed // 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 *TBTCSystemSetupFailedIterator) 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(TBTCSystemSetupFailed) + 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(TBTCSystemSetupFailed) + 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 *TBTCSystemSetupFailedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemSetupFailedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemSetupFailed represents a SetupFailed event raised by the TBTCSystem contract. +type TBTCSystemSetupFailed struct { + DepositContractAddress common.Address + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSetupFailed is a free log retrieval operation binding the contract event 0x8fd2cfb62a35fccc1ecef829f83a6c2f840b73dad49d3eaaa402909752086d4b. +// +// Solidity: event SetupFailed(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterSetupFailed(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*TBTCSystemSetupFailedIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "SetupFailed", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &TBTCSystemSetupFailedIterator{contract: _TBTCSystem.contract, event: "SetupFailed", logs: logs, sub: sub}, nil +} + +// WatchSetupFailed is a free log subscription operation binding the contract event 0x8fd2cfb62a35fccc1ecef829f83a6c2f840b73dad49d3eaaa402909752086d4b. +// +// Solidity: event SetupFailed(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchSetupFailed(opts *bind.WatchOpts, sink chan<- *TBTCSystemSetupFailed, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "SetupFailed", _depositContractAddressRule) + 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(TBTCSystemSetupFailed) + if err := _TBTCSystem.contract.UnpackLog(event, "SetupFailed", 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 +} + +// ParseSetupFailed is a log parse operation binding the contract event 0x8fd2cfb62a35fccc1ecef829f83a6c2f840b73dad49d3eaaa402909752086d4b. +// +// Solidity: event SetupFailed(address indexed _depositContractAddress, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseSetupFailed(log types.Log) (*TBTCSystemSetupFailed, error) { + event := new(TBTCSystemSetupFailed) + if err := _TBTCSystem.contract.UnpackLog(event, "SetupFailed", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemSignerFeeDivisorUpdateStartedIterator is returned from FilterSignerFeeDivisorUpdateStarted and is used to iterate over the raw logs and unpacked data for SignerFeeDivisorUpdateStarted events raised by the TBTCSystem contract. +type TBTCSystemSignerFeeDivisorUpdateStartedIterator struct { + Event *TBTCSystemSignerFeeDivisorUpdateStarted // 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 *TBTCSystemSignerFeeDivisorUpdateStartedIterator) 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(TBTCSystemSignerFeeDivisorUpdateStarted) + 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(TBTCSystemSignerFeeDivisorUpdateStarted) + 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 *TBTCSystemSignerFeeDivisorUpdateStartedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemSignerFeeDivisorUpdateStartedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemSignerFeeDivisorUpdateStarted represents a SignerFeeDivisorUpdateStarted event raised by the TBTCSystem contract. +type TBTCSystemSignerFeeDivisorUpdateStarted struct { + SignerFeeDivisor uint16 + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSignerFeeDivisorUpdateStarted is a free log retrieval operation binding the contract event 0x38cb7049f0daf658ca989e9ef6b850ef11e3740ff07a0c16706042c39adf48fc. +// +// Solidity: event SignerFeeDivisorUpdateStarted(uint16 _signerFeeDivisor, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterSignerFeeDivisorUpdateStarted(opts *bind.FilterOpts) (*TBTCSystemSignerFeeDivisorUpdateStartedIterator, error) { + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "SignerFeeDivisorUpdateStarted") + if err != nil { + return nil, err + } + return &TBTCSystemSignerFeeDivisorUpdateStartedIterator{contract: _TBTCSystem.contract, event: "SignerFeeDivisorUpdateStarted", logs: logs, sub: sub}, nil +} + +// WatchSignerFeeDivisorUpdateStarted is a free log subscription operation binding the contract event 0x38cb7049f0daf658ca989e9ef6b850ef11e3740ff07a0c16706042c39adf48fc. +// +// Solidity: event SignerFeeDivisorUpdateStarted(uint16 _signerFeeDivisor, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchSignerFeeDivisorUpdateStarted(opts *bind.WatchOpts, sink chan<- *TBTCSystemSignerFeeDivisorUpdateStarted) (event.Subscription, error) { + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "SignerFeeDivisorUpdateStarted") + 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(TBTCSystemSignerFeeDivisorUpdateStarted) + if err := _TBTCSystem.contract.UnpackLog(event, "SignerFeeDivisorUpdateStarted", 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 +} + +// ParseSignerFeeDivisorUpdateStarted is a log parse operation binding the contract event 0x38cb7049f0daf658ca989e9ef6b850ef11e3740ff07a0c16706042c39adf48fc. +// +// Solidity: event SignerFeeDivisorUpdateStarted(uint16 _signerFeeDivisor, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseSignerFeeDivisorUpdateStarted(log types.Log) (*TBTCSystemSignerFeeDivisorUpdateStarted, error) { + event := new(TBTCSystemSignerFeeDivisorUpdateStarted) + if err := _TBTCSystem.contract.UnpackLog(event, "SignerFeeDivisorUpdateStarted", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemSignerFeeDivisorUpdatedIterator is returned from FilterSignerFeeDivisorUpdated and is used to iterate over the raw logs and unpacked data for SignerFeeDivisorUpdated events raised by the TBTCSystem contract. +type TBTCSystemSignerFeeDivisorUpdatedIterator struct { + Event *TBTCSystemSignerFeeDivisorUpdated // 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 *TBTCSystemSignerFeeDivisorUpdatedIterator) 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(TBTCSystemSignerFeeDivisorUpdated) + 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(TBTCSystemSignerFeeDivisorUpdated) + 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 *TBTCSystemSignerFeeDivisorUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemSignerFeeDivisorUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemSignerFeeDivisorUpdated represents a SignerFeeDivisorUpdated event raised by the TBTCSystem contract. +type TBTCSystemSignerFeeDivisorUpdated struct { + SignerFeeDivisor uint16 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSignerFeeDivisorUpdated is a free log retrieval operation binding the contract event 0x236dec26d53c6a51390e98ed703106e132fd062b0e38b8a9cf8b4d13f47952c8. +// +// Solidity: event SignerFeeDivisorUpdated(uint16 _signerFeeDivisor) +func (_TBTCSystem *TBTCSystemFilterer) FilterSignerFeeDivisorUpdated(opts *bind.FilterOpts) (*TBTCSystemSignerFeeDivisorUpdatedIterator, error) { + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "SignerFeeDivisorUpdated") + if err != nil { + return nil, err + } + return &TBTCSystemSignerFeeDivisorUpdatedIterator{contract: _TBTCSystem.contract, event: "SignerFeeDivisorUpdated", logs: logs, sub: sub}, nil +} + +// WatchSignerFeeDivisorUpdated is a free log subscription operation binding the contract event 0x236dec26d53c6a51390e98ed703106e132fd062b0e38b8a9cf8b4d13f47952c8. +// +// Solidity: event SignerFeeDivisorUpdated(uint16 _signerFeeDivisor) +func (_TBTCSystem *TBTCSystemFilterer) WatchSignerFeeDivisorUpdated(opts *bind.WatchOpts, sink chan<- *TBTCSystemSignerFeeDivisorUpdated) (event.Subscription, error) { + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "SignerFeeDivisorUpdated") + 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(TBTCSystemSignerFeeDivisorUpdated) + if err := _TBTCSystem.contract.UnpackLog(event, "SignerFeeDivisorUpdated", 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 +} + +// ParseSignerFeeDivisorUpdated is a log parse operation binding the contract event 0x236dec26d53c6a51390e98ed703106e132fd062b0e38b8a9cf8b4d13f47952c8. +// +// Solidity: event SignerFeeDivisorUpdated(uint16 _signerFeeDivisor) +func (_TBTCSystem *TBTCSystemFilterer) ParseSignerFeeDivisorUpdated(log types.Log) (*TBTCSystemSignerFeeDivisorUpdated, error) { + event := new(TBTCSystemSignerFeeDivisorUpdated) + if err := _TBTCSystem.contract.UnpackLog(event, "SignerFeeDivisorUpdated", log); err != nil { + return nil, err + } + return event, nil +} + +// TBTCSystemStartedLiquidationIterator is returned from FilterStartedLiquidation and is used to iterate over the raw logs and unpacked data for StartedLiquidation events raised by the TBTCSystem contract. +type TBTCSystemStartedLiquidationIterator struct { + Event *TBTCSystemStartedLiquidation // 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 *TBTCSystemStartedLiquidationIterator) 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(TBTCSystemStartedLiquidation) + 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(TBTCSystemStartedLiquidation) + 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 *TBTCSystemStartedLiquidationIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TBTCSystemStartedLiquidationIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TBTCSystemStartedLiquidation represents a StartedLiquidation event raised by the TBTCSystem contract. +type TBTCSystemStartedLiquidation struct { + DepositContractAddress common.Address + WasFraud bool + Timestamp *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterStartedLiquidation is a free log retrieval operation binding the contract event 0xbef11c059eefba82a15aea8a3a89c86fd08d7711c88fa7daea2632a55488510c. +// +// Solidity: event StartedLiquidation(address indexed _depositContractAddress, bool _wasFraud, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) FilterStartedLiquidation(opts *bind.FilterOpts, _depositContractAddress []common.Address) (*TBTCSystemStartedLiquidationIterator, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.FilterLogs(opts, "StartedLiquidation", _depositContractAddressRule) + if err != nil { + return nil, err + } + return &TBTCSystemStartedLiquidationIterator{contract: _TBTCSystem.contract, event: "StartedLiquidation", logs: logs, sub: sub}, nil +} + +// WatchStartedLiquidation is a free log subscription operation binding the contract event 0xbef11c059eefba82a15aea8a3a89c86fd08d7711c88fa7daea2632a55488510c. +// +// Solidity: event StartedLiquidation(address indexed _depositContractAddress, bool _wasFraud, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) WatchStartedLiquidation(opts *bind.WatchOpts, sink chan<- *TBTCSystemStartedLiquidation, _depositContractAddress []common.Address) (event.Subscription, error) { + + var _depositContractAddressRule []interface{} + for _, _depositContractAddressItem := range _depositContractAddress { + _depositContractAddressRule = append(_depositContractAddressRule, _depositContractAddressItem) + } + + logs, sub, err := _TBTCSystem.contract.WatchLogs(opts, "StartedLiquidation", _depositContractAddressRule) + 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(TBTCSystemStartedLiquidation) + if err := _TBTCSystem.contract.UnpackLog(event, "StartedLiquidation", 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 +} + +// ParseStartedLiquidation is a log parse operation binding the contract event 0xbef11c059eefba82a15aea8a3a89c86fd08d7711c88fa7daea2632a55488510c. +// +// Solidity: event StartedLiquidation(address indexed _depositContractAddress, bool _wasFraud, uint256 _timestamp) +func (_TBTCSystem *TBTCSystemFilterer) ParseStartedLiquidation(log types.Log) (*TBTCSystemStartedLiquidation, error) { + event := new(TBTCSystemStartedLiquidation) + if err := _TBTCSystem.contract.UnpackLog(event, "StartedLiquidation", log); err != nil { + return nil, err + } + return event, nil +} diff --git a/go/cmd/Deposit.go b/go/cmd/Deposit.go index 93499a71c..f1633fc2a 100644 --- a/go/cmd/Deposit.go +++ b/go/cmd/Deposit.go @@ -52,94 +52,94 @@ func init() { Usage: `Provides access to the Deposit contract.`, Description: depositDescription, Subcommands: []cli.Command{{ - Name: "collateralization-percentage", - Usage: "Calls the constant method collateralizationPercentage on the Deposit contract.", + Name: "initial-collateralized-percent", + Usage: "Calls the constant method initialCollateralizedPercent on the Deposit contract.", ArgsUsage: "", - Action: dCollateralizationPercentage, + Action: dInitialCollateralizedPercent, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-redemption-tbtc-requirement", - Usage: "Calls the constant method getRedemptionTbtcRequirement on the Deposit contract.", - ArgsUsage: "[_redeemer] ", - Action: dGetRedemptionTbtcRequirement, - Before: cmd.ArgCountChecker(1), - Flags: cmd.ConstFlags, - }, { - Name: "in-active", - Usage: "Calls the constant method inActive on the Deposit contract.", + Name: "lot-size-tbtc", + Usage: "Calls the constant method lotSizeTbtc on the Deposit contract.", ArgsUsage: "", - Action: dInActive, + Action: dLotSizeTbtc, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "auction-value", - Usage: "Calls the constant method auctionValue on the Deposit contract.", + Name: "signer-fee-tbtc", + Usage: "Calls the constant method signerFeeTbtc on the Deposit contract.", ArgsUsage: "", - Action: dAuctionValue, + Action: dSignerFeeTbtc, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "funding-info", - Usage: "Calls the constant method fundingInfo on the Deposit contract.", + Name: "withdrawable-amount", + Usage: "Calls the constant method withdrawableAmount on the Deposit contract.", ArgsUsage: "", - Action: dFundingInfo, + Action: dWithdrawableAmount, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "remaining-term", - Usage: "Calls the constant method remainingTerm on the Deposit contract.", + Name: "collateralization-percentage", + Usage: "Calls the constant method collateralizationPercentage on the Deposit contract.", ArgsUsage: "", - Action: dRemainingTerm, + Action: dCollateralizationPercentage, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "undercollateralized-threshold-percent", - Usage: "Calls the constant method undercollateralizedThresholdPercent on the Deposit contract.", + Name: "get-owner-redemption-tbtc-requirement", + Usage: "Calls the constant method getOwnerRedemptionTbtcRequirement on the Deposit contract.", + ArgsUsage: "[_redeemer] ", + Action: dGetOwnerRedemptionTbtcRequirement, + Before: cmd.ArgCountChecker(1), + Flags: cmd.ConstFlags, + }, { + Name: "lot-size-satoshis", + Usage: "Calls the constant method lotSizeSatoshis on the Deposit contract.", ArgsUsage: "", - Action: dUndercollateralizedThresholdPercent, + Action: dLotSizeSatoshis, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "withdrawable-amount", - Usage: "Calls the constant method withdrawableAmount on the Deposit contract.", + Name: "auction-value", + Usage: "Calls the constant method auctionValue on the Deposit contract.", ArgsUsage: "", - Action: dWithdrawableAmount, + Action: dAuctionValue, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "signer-fee-tbtc", - Usage: "Calls the constant method signerFeeTbtc on the Deposit contract.", + Name: "undercollateralized-threshold-percent", + Usage: "Calls the constant method undercollateralizedThresholdPercent on the Deposit contract.", ArgsUsage: "", - Action: dSignerFeeTbtc, + Action: dUndercollateralizedThresholdPercent, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "utxo-value", - Usage: "Calls the constant method utxoValue on the Deposit contract.", + Name: "in-active", + Usage: "Calls the constant method inActive on the Deposit contract.", ArgsUsage: "", - Action: dUtxoValue, + Action: dInActive, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "lot-size-satoshis", - Usage: "Calls the constant method lotSizeSatoshis on the Deposit contract.", + Name: "funding-info", + Usage: "Calls the constant method fundingInfo on the Deposit contract.", ArgsUsage: "", - Action: dLotSizeSatoshis, + Action: dFundingInfo, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "lot-size-tbtc", - Usage: "Calls the constant method lotSizeTbtc on the Deposit contract.", + Name: "remaining-term", + Usage: "Calls the constant method remainingTerm on the Deposit contract.", ArgsUsage: "", - Action: dLotSizeTbtc, + Action: dRemainingTerm, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-owner-redemption-tbtc-requirement", - Usage: "Calls the constant method getOwnerRedemptionTbtcRequirement on the Deposit contract.", + Name: "get-redemption-tbtc-requirement", + Usage: "Calls the constant method getRedemptionTbtcRequirement on the Deposit contract.", ArgsUsage: "[_redeemer] ", - Action: dGetOwnerRedemptionTbtcRequirement, + Action: dGetRedemptionTbtcRequirement, Before: cmd.ArgCountChecker(1), Flags: cmd.ConstFlags, }, { @@ -150,17 +150,17 @@ func init() { Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "current-state", - Usage: "Calls the constant method currentState on the Deposit contract.", + Name: "utxo-value", + Usage: "Calls the constant method utxoValue on the Deposit contract.", ArgsUsage: "", - Action: dCurrentState, + Action: dUtxoValue, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "initial-collateralized-percent", - Usage: "Calls the constant method initialCollateralizedPercent on the Deposit contract.", + Name: "current-state", + Usage: "Calls the constant method currentState on the Deposit contract.", ArgsUsage: "", - Action: dInitialCollateralizedPercent, + Action: dCurrentState, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { @@ -171,24 +171,17 @@ func init() { Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "initialize", - Usage: "Calls the method initialize on the Deposit contract.", - ArgsUsage: "[_factory] ", - Action: dInitialize, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), - Flags: cmd.NonConstFlags, - }, { - Name: "notify-redemption-signature-timed-out", - Usage: "Calls the method notifyRedemptionSignatureTimedOut on the Deposit contract.", + Name: "notify-courtesy-call", + Usage: "Calls the method notifyCourtesyCall on the Deposit contract.", ArgsUsage: "", - Action: dNotifyRedemptionSignatureTimedOut, + Action: dNotifyCourtesyCall, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "purchase-signer-bonds-at-auction", - Usage: "Calls the method purchaseSignerBondsAtAuction on the Deposit contract.", + Name: "notify-undercollateralized-liquidation", + Usage: "Calls the method notifyUndercollateralizedLiquidation on the Deposit contract.", ArgsUsage: "", - Action: dPurchaseSignerBondsAtAuction, + Action: dNotifyUndercollateralizedLiquidation, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { @@ -199,17 +192,17 @@ func init() { Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "notify-redemption-proof-timed-out", - Usage: "Calls the method notifyRedemptionProofTimedOut on the Deposit contract.", + Name: "notify-courtesy-call-expired", + Usage: "Calls the method notifyCourtesyCallExpired on the Deposit contract.", ArgsUsage: "", - Action: dNotifyRedemptionProofTimedOut, + Action: dNotifyCourtesyCallExpired, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "notify-signer-setup-failed", - Usage: "Calls the method notifySignerSetupFailed on the Deposit contract.", + Name: "notify-redemption-proof-timed-out", + Usage: "Calls the method notifyRedemptionProofTimedOut on the Deposit contract.", ArgsUsage: "", - Action: dNotifySignerSetupFailed, + Action: dNotifyRedemptionProofTimedOut, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { @@ -220,45 +213,52 @@ func init() { Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), Flags: cmd.NonConstFlags, }, { - Name: "withdraw-funds", - Usage: "Calls the method withdrawFunds on the Deposit contract.", + Name: "retrieve-signer-pubkey", + Usage: "Calls the method retrieveSignerPubkey on the Deposit contract.", ArgsUsage: "", - Action: dWithdrawFunds, + Action: dRetrieveSignerPubkey, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "notify-courtesy-call-expired", - Usage: "Calls the method notifyCourtesyCallExpired on the Deposit contract.", + Name: "notify-funding-timed-out", + Usage: "Calls the method notifyFundingTimedOut on the Deposit contract.", ArgsUsage: "", - Action: dNotifyCourtesyCallExpired, + Action: dNotifyFundingTimedOut, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "notify-funding-timed-out", - Usage: "Calls the method notifyFundingTimedOut on the Deposit contract.", + Name: "purchase-signer-bonds-at-auction", + Usage: "Calls the method purchaseSignerBondsAtAuction on the Deposit contract.", ArgsUsage: "", - Action: dNotifyFundingTimedOut, + Action: dPurchaseSignerBondsAtAuction, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "notify-courtesy-call", - Usage: "Calls the method notifyCourtesyCall on the Deposit contract.", + Name: "notify-redemption-signature-timed-out", + Usage: "Calls the method notifyRedemptionSignatureTimedOut on the Deposit contract.", ArgsUsage: "", - Action: dNotifyCourtesyCall, + Action: dNotifyRedemptionSignatureTimedOut, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "notify-undercollateralized-liquidation", - Usage: "Calls the method notifyUndercollateralizedLiquidation on the Deposit contract.", + Name: "withdraw-funds", + Usage: "Calls the method withdrawFunds on the Deposit contract.", ArgsUsage: "", - Action: dNotifyUndercollateralizedLiquidation, + Action: dWithdrawFunds, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "retrieve-signer-pubkey", - Usage: "Calls the method retrieveSignerPubkey on the Deposit contract.", + Name: "initialize", + Usage: "Calls the method initialize on the Deposit contract.", + ArgsUsage: "[_factory] ", + Action: dInitialize, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), + Flags: cmd.NonConstFlags, + }, { + Name: "notify-signer-setup-failed", + Usage: "Calls the method notifySignerSetupFailed on the Deposit contract.", ArgsUsage: "", - Action: dRetrieveSignerPubkey, + Action: dNotifySignerSetupFailed, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }}, @@ -267,13 +267,13 @@ func init() { /// ------------------- Const methods ------------------- -func dCollateralizationPercentage(c *cli.Context) error { +func dInitialCollateralizedPercent(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.CollateralizationPercentageAtBlock( + result, err := contract.InitialCollateralizedPercentAtBlock( cmd.BlockFlagValue.Uint, ) @@ -287,21 +287,13 @@ func dCollateralizationPercentage(c *cli.Context) error { return nil } -func dGetRedemptionTbtcRequirement(c *cli.Context) error { +func dLotSizeTbtc(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - _redeemer, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _redeemer, a address, from passed value %v", - c.Args()[0], - ) - } - result, err := contract.GetRedemptionTbtcRequirementAtBlock( - _redeemer, + result, err := contract.LotSizeTbtcAtBlock( cmd.BlockFlagValue.Uint, ) @@ -315,13 +307,13 @@ func dGetRedemptionTbtcRequirement(c *cli.Context) error { return nil } -func dInActive(c *cli.Context) error { +func dSignerFeeTbtc(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.InActiveAtBlock( + result, err := contract.SignerFeeTbtcAtBlock( cmd.BlockFlagValue.Uint, ) @@ -335,13 +327,13 @@ func dInActive(c *cli.Context) error { return nil } -func dAuctionValue(c *cli.Context) error { +func dWithdrawableAmount(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.AuctionValueAtBlock( + result, err := contract.WithdrawableAmountAtBlock( cmd.BlockFlagValue.Uint, ) @@ -355,13 +347,13 @@ func dAuctionValue(c *cli.Context) error { return nil } -func dFundingInfo(c *cli.Context) error { +func dCollateralizationPercentage(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.FundingInfoAtBlock( + result, err := contract.CollateralizationPercentageAtBlock( cmd.BlockFlagValue.Uint, ) @@ -375,13 +367,21 @@ func dFundingInfo(c *cli.Context) error { return nil } -func dRemainingTerm(c *cli.Context) error { +func dGetOwnerRedemptionTbtcRequirement(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } + _redeemer, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _redeemer, a address, from passed value %v", + c.Args()[0], + ) + } - result, err := contract.RemainingTermAtBlock( + result, err := contract.GetOwnerRedemptionTbtcRequirementAtBlock( + _redeemer, cmd.BlockFlagValue.Uint, ) @@ -395,13 +395,13 @@ func dRemainingTerm(c *cli.Context) error { return nil } -func dUndercollateralizedThresholdPercent(c *cli.Context) error { +func dLotSizeSatoshis(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.UndercollateralizedThresholdPercentAtBlock( + result, err := contract.LotSizeSatoshisAtBlock( cmd.BlockFlagValue.Uint, ) @@ -415,13 +415,13 @@ func dUndercollateralizedThresholdPercent(c *cli.Context) error { return nil } -func dWithdrawableAmount(c *cli.Context) error { +func dAuctionValue(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.WithdrawableAmountAtBlock( + result, err := contract.AuctionValueAtBlock( cmd.BlockFlagValue.Uint, ) @@ -435,13 +435,13 @@ func dWithdrawableAmount(c *cli.Context) error { return nil } -func dSignerFeeTbtc(c *cli.Context) error { +func dUndercollateralizedThresholdPercent(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.SignerFeeTbtcAtBlock( + result, err := contract.UndercollateralizedThresholdPercentAtBlock( cmd.BlockFlagValue.Uint, ) @@ -455,13 +455,13 @@ func dSignerFeeTbtc(c *cli.Context) error { return nil } -func dUtxoValue(c *cli.Context) error { +func dInActive(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.UtxoValueAtBlock( + result, err := contract.InActiveAtBlock( cmd.BlockFlagValue.Uint, ) @@ -475,13 +475,13 @@ func dUtxoValue(c *cli.Context) error { return nil } -func dLotSizeSatoshis(c *cli.Context) error { +func dFundingInfo(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.LotSizeSatoshisAtBlock( + result, err := contract.FundingInfoAtBlock( cmd.BlockFlagValue.Uint, ) @@ -495,13 +495,13 @@ func dLotSizeSatoshis(c *cli.Context) error { return nil } -func dLotSizeTbtc(c *cli.Context) error { +func dRemainingTerm(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.LotSizeTbtcAtBlock( + result, err := contract.RemainingTermAtBlock( cmd.BlockFlagValue.Uint, ) @@ -515,7 +515,7 @@ func dLotSizeTbtc(c *cli.Context) error { return nil } -func dGetOwnerRedemptionTbtcRequirement(c *cli.Context) error { +func dGetRedemptionTbtcRequirement(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -528,7 +528,7 @@ func dGetOwnerRedemptionTbtcRequirement(c *cli.Context) error { ) } - result, err := contract.GetOwnerRedemptionTbtcRequirementAtBlock( + result, err := contract.GetRedemptionTbtcRequirementAtBlock( _redeemer, cmd.BlockFlagValue.Uint, @@ -563,13 +563,13 @@ func dKeepAddress(c *cli.Context) error { return nil } -func dCurrentState(c *cli.Context) error { +func dUtxoValue(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.CurrentStateAtBlock( + result, err := contract.UtxoValueAtBlock( cmd.BlockFlagValue.Uint, ) @@ -583,13 +583,13 @@ func dCurrentState(c *cli.Context) error { return nil } -func dInitialCollateralizedPercent(c *cli.Context) error { +func dCurrentState(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.InitialCollateralizedPercentAtBlock( + result, err := contract.CurrentStateAtBlock( cmd.BlockFlagValue.Uint, ) @@ -625,29 +625,19 @@ func dSeverelyUndercollateralizedThresholdPercent(c *cli.Context) error { /// ------------------- Non-const methods ------------------- -func dInitialize(c *cli.Context) error { +func dNotifyCourtesyCall(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - _factory, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _factory, a address, from passed value %v", - c.Args()[0], - ) - } - var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.Initialize( - _factory, - ) + transaction, err = contract.NotifyCourtesyCall() if err != nil { return err } @@ -655,8 +645,7 @@ func dInitialize(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallInitialize( - _factory, + err = contract.CallNotifyCourtesyCall( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -669,7 +658,7 @@ func dInitialize(c *cli.Context) error { return nil } -func dNotifyRedemptionSignatureTimedOut(c *cli.Context) error { +func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -681,7 +670,7 @@ func dNotifyRedemptionSignatureTimedOut(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyRedemptionSignatureTimedOut() + transaction, err = contract.NotifyUndercollateralizedLiquidation() if err != nil { return err } @@ -689,7 +678,7 @@ func dNotifyRedemptionSignatureTimedOut(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyRedemptionSignatureTimedOut( + err = contract.CallNotifyUndercollateralizedLiquidation( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -702,7 +691,7 @@ func dNotifyRedemptionSignatureTimedOut(c *cli.Context) error { return nil } -func dPurchaseSignerBondsAtAuction(c *cli.Context) error { +func dExitCourtesyCall(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -714,7 +703,7 @@ func dPurchaseSignerBondsAtAuction(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.PurchaseSignerBondsAtAuction() + transaction, err = contract.ExitCourtesyCall() if err != nil { return err } @@ -722,7 +711,7 @@ func dPurchaseSignerBondsAtAuction(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallPurchaseSignerBondsAtAuction( + err = contract.CallExitCourtesyCall( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -735,7 +724,7 @@ func dPurchaseSignerBondsAtAuction(c *cli.Context) error { return nil } -func dExitCourtesyCall(c *cli.Context) error { +func dNotifyCourtesyCallExpired(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -747,7 +736,7 @@ func dExitCourtesyCall(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.ExitCourtesyCall() + transaction, err = contract.NotifyCourtesyCallExpired() if err != nil { return err } @@ -755,7 +744,7 @@ func dExitCourtesyCall(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallExitCourtesyCall( + err = contract.CallNotifyCourtesyCallExpired( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -801,19 +790,29 @@ func dNotifyRedemptionProofTimedOut(c *cli.Context) error { return nil } -func dNotifySignerSetupFailed(c *cli.Context) error { +func dRequestFunderAbort(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } + _abortOutputScript, err := hexutil.Decode(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _abortOutputScript, a bytes, from passed value %v", + c.Args()[0], + ) + } + var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifySignerSetupFailed() + transaction, err = contract.RequestFunderAbort( + _abortOutputScript, + ) if err != nil { return err } @@ -821,7 +820,8 @@ func dNotifySignerSetupFailed(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifySignerSetupFailed( + err = contract.CallRequestFunderAbort( + _abortOutputScript, cmd.BlockFlagValue.Uint, ) if err != nil { @@ -834,29 +834,19 @@ func dNotifySignerSetupFailed(c *cli.Context) error { return nil } -func dRequestFunderAbort(c *cli.Context) error { +func dRetrieveSignerPubkey(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - _abortOutputScript, err := hexutil.Decode(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _abortOutputScript, a bytes, from passed value %v", - c.Args()[0], - ) - } - var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.RequestFunderAbort( - _abortOutputScript, - ) + transaction, err = contract.RetrieveSignerPubkey() if err != nil { return err } @@ -864,8 +854,7 @@ func dRequestFunderAbort(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallRequestFunderAbort( - _abortOutputScript, + err = contract.CallRetrieveSignerPubkey( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -878,7 +867,7 @@ func dRequestFunderAbort(c *cli.Context) error { return nil } -func dWithdrawFunds(c *cli.Context) error { +func dNotifyFundingTimedOut(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -890,7 +879,7 @@ func dWithdrawFunds(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.WithdrawFunds() + transaction, err = contract.NotifyFundingTimedOut() if err != nil { return err } @@ -898,7 +887,7 @@ func dWithdrawFunds(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallWithdrawFunds( + err = contract.CallNotifyFundingTimedOut( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -911,7 +900,7 @@ func dWithdrawFunds(c *cli.Context) error { return nil } -func dNotifyCourtesyCallExpired(c *cli.Context) error { +func dPurchaseSignerBondsAtAuction(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -923,7 +912,7 @@ func dNotifyCourtesyCallExpired(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyCourtesyCallExpired() + transaction, err = contract.PurchaseSignerBondsAtAuction() if err != nil { return err } @@ -931,7 +920,7 @@ func dNotifyCourtesyCallExpired(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyCourtesyCallExpired( + err = contract.CallPurchaseSignerBondsAtAuction( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -944,7 +933,7 @@ func dNotifyCourtesyCallExpired(c *cli.Context) error { return nil } -func dNotifyFundingTimedOut(c *cli.Context) error { +func dNotifyRedemptionSignatureTimedOut(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -956,7 +945,7 @@ func dNotifyFundingTimedOut(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyFundingTimedOut() + transaction, err = contract.NotifyRedemptionSignatureTimedOut() if err != nil { return err } @@ -964,7 +953,7 @@ func dNotifyFundingTimedOut(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyFundingTimedOut( + err = contract.CallNotifyRedemptionSignatureTimedOut( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -977,7 +966,7 @@ func dNotifyFundingTimedOut(c *cli.Context) error { return nil } -func dNotifyCourtesyCall(c *cli.Context) error { +func dWithdrawFunds(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -989,7 +978,7 @@ func dNotifyCourtesyCall(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyCourtesyCall() + transaction, err = contract.WithdrawFunds() if err != nil { return err } @@ -997,7 +986,7 @@ func dNotifyCourtesyCall(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyCourtesyCall( + err = contract.CallWithdrawFunds( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1010,19 +999,29 @@ func dNotifyCourtesyCall(c *cli.Context) error { return nil } -func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { +func dInitialize(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } + _factory, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _factory, a address, from passed value %v", + c.Args()[0], + ) + } + var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyUndercollateralizedLiquidation() + transaction, err = contract.Initialize( + _factory, + ) if err != nil { return err } @@ -1030,7 +1029,8 @@ func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyUndercollateralizedLiquidation( + err = contract.CallInitialize( + _factory, cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1043,7 +1043,7 @@ func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { return nil } -func dRetrieveSignerPubkey(c *cli.Context) error { +func dNotifySignerSetupFailed(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -1055,7 +1055,7 @@ func dRetrieveSignerPubkey(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.RetrieveSignerPubkey() + transaction, err = contract.NotifySignerSetupFailed() if err != nil { return err } @@ -1063,7 +1063,7 @@ func dRetrieveSignerPubkey(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallRetrieveSignerPubkey( + err = contract.CallNotifySignerSetupFailed( cmd.BlockFlagValue.Uint, ) if err != nil { diff --git a/go/cmd/DepositLog.go b/go/cmd/DepositLog.go deleted file mode 100644 index dcfb72587..000000000 --- a/go/cmd/DepositLog.go +++ /dev/null @@ -1,445 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated command and any manual changes will be lost. - -package cmd - -import ( - "fmt" - "math/big" - "sync" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - - "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" - "github.com/keep-network/keep-common/pkg/cmd" - "github.com/keep-network/keep-core/config" - "github.com/keep-network/tbtc/go/contract" - - "github.com/urfave/cli" -) - -var DepositLogCommand cli.Command - -var depositLogDescription = `The deposit-log command allows calling the DepositLog 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. - - All subcommands can be used to investigate the result of a previous - transaction that called that same method by passing the -t/--transaction - flag with the transaction hash. - - 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() { - AvailableCommands = append(AvailableCommands, cli.Command{ - Name: "deposit-log", - Usage: `Provides access to the DepositLog contract.`, - Description: depositLogDescription, - Subcommands: []cli.Command{{ - Name: "approved-to-log", - Usage: "Calls the constant method approvedToLog on the DepositLog contract.", - ArgsUsage: "[_caller] ", - Action: dlApprovedToLog, - Before: cmd.ArgCountChecker(1), - Flags: cmd.ConstFlags, - }, { - Name: "log-courtesy-called", - Usage: "Calls the method logCourtesyCalled on the DepositLog contract.", - ArgsUsage: "", - Action: dlLogCourtesyCalled, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "log-exited-courtesy-call", - Usage: "Calls the method logExitedCourtesyCall on the DepositLog contract.", - ArgsUsage: "", - Action: dlLogExitedCourtesyCall, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "log-created", - Usage: "Calls the method logCreated on the DepositLog contract.", - ArgsUsage: "[_keepAddress] ", - Action: dlLogCreated, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), - Flags: cmd.NonConstFlags, - }, { - Name: "log-fraud-during-setup", - Usage: "Calls the method logFraudDuringSetup on the DepositLog contract.", - ArgsUsage: "", - Action: dlLogFraudDuringSetup, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "log-setup-failed", - Usage: "Calls the method logSetupFailed on the DepositLog contract.", - ArgsUsage: "", - Action: dlLogSetupFailed, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "log-funder-requested-abort", - Usage: "Calls the method logFunderRequestedAbort on the DepositLog contract.", - ArgsUsage: "[_abortOutputScript] ", - Action: dlLogFunderRequestedAbort, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), - Flags: cmd.NonConstFlags, - }, { - Name: "log-liquidated", - Usage: "Calls the method logLiquidated on the DepositLog contract.", - ArgsUsage: "", - Action: dlLogLiquidated, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }}, - }) -} - -/// ------------------- Const methods ------------------- - -func dlApprovedToLog(c *cli.Context) error { - contract, err := initializeDepositLog(c) - if err != nil { - return err - } - _caller, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _caller, a address, from passed value %v", - c.Args()[0], - ) - } - - result, err := contract.ApprovedToLogAtBlock( - _caller, - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -/// ------------------- Non-const methods ------------------- - -func dlLogCourtesyCalled(c *cli.Context) error { - contract, err := initializeDepositLog(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.LogCourtesyCalled() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallLogCourtesyCalled( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func dlLogExitedCourtesyCall(c *cli.Context) error { - contract, err := initializeDepositLog(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.LogExitedCourtesyCall() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallLogExitedCourtesyCall( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func dlLogCreated(c *cli.Context) error { - contract, err := initializeDepositLog(c) - if err != nil { - return err - } - - _keepAddress, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _keepAddress, a address, from passed value %v", - c.Args()[0], - ) - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.LogCreated( - _keepAddress, - ) - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallLogCreated( - _keepAddress, - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func dlLogFraudDuringSetup(c *cli.Context) error { - contract, err := initializeDepositLog(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.LogFraudDuringSetup() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallLogFraudDuringSetup( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func dlLogSetupFailed(c *cli.Context) error { - contract, err := initializeDepositLog(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.LogSetupFailed() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallLogSetupFailed( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func dlLogFunderRequestedAbort(c *cli.Context) error { - contract, err := initializeDepositLog(c) - if err != nil { - return err - } - - _abortOutputScript, err := hexutil.Decode(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _abortOutputScript, a bytes, from passed value %v", - c.Args()[0], - ) - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.LogFunderRequestedAbort( - _abortOutputScript, - ) - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallLogFunderRequestedAbort( - _abortOutputScript, - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func dlLogLiquidated(c *cli.Context) error { - contract, err := initializeDepositLog(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.LogLiquidated() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallLogLiquidated( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -/// ------------------- Initialization ------------------- - -func initializeDepositLog(c *cli.Context) (*contract.DepositLog, error) { - config, err := config.ReadEthereumConfig(c.GlobalString("config")) - if err != nil { - return nil, fmt.Errorf("error reading Ethereum config from file: [%v]", err) - } - - client, _, _, err := ethutil.ConnectClients(config.URL, config.URLRPC) - if err != nil { - return nil, fmt.Errorf("error connecting to Ethereum node: [%v]", err) - } - - key, err := ethutil.DecryptKeyFile( - config.Account.KeyFile, - config.Account.KeyFilePassword, - ) - if err != nil { - return nil, fmt.Errorf( - "failed to read KeyFile: %s: [%v]", - config.Account.KeyFile, - err, - ) - } - - checkInterval := cmd.DefaultMiningCheckInterval - maxGasPrice := cmd.DefaultMaxGasPrice - if config.MiningCheckInterval != 0 { - checkInterval = time.Duration(config.MiningCheckInterval) * time.Second - } - if config.MaxGasPrice != 0 { - maxGasPrice = new(big.Int).SetUint64(config.MaxGasPrice) - } - - miningWaiter := ethutil.NewMiningWaiter(client, checkInterval, maxGasPrice) - - address := common.HexToAddress(config.ContractAddresses["DepositLog"]) - - return contract.NewDepositLog( - address, - key, - client, - ethutil.NewNonceManager(key.Address, client), - miningWaiter, - &sync.Mutex{}, - ) -} diff --git a/go/cmd/TBTCSystem.go b/go/cmd/TBTCSystem.go new file mode 100644 index 000000000..ff8a68bac --- /dev/null +++ b/go/cmd/TBTCSystem.go @@ -0,0 +1,1734 @@ +// Code generated - DO NOT EDIT. +// This file is a generated command and any manual changes will be lost. + +package cmd + +import ( + "fmt" + "math/big" + "sync" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + + "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" + "github.com/keep-network/keep-common/pkg/cmd" + "github.com/keep-network/keep-core/config" + "github.com/keep-network/tbtc/go/contract" + + "github.com/urfave/cli" +) + +var TBTCSystemCommand cli.Command + +var tBTCSystemDescription = `The t-b-t-c-system command allows calling the TBTCSystem 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. + + All subcommands can be used to investigate the result of a previous + transaction that called that same method by passing the -t/--transaction + flag with the transaction hash. + + 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() { + AvailableCommands = append(AvailableCommands, cli.Command{ + Name: "t-b-t-c-system", + Usage: `Provides access to the TBTCSystem contract.`, + Description: tBTCSystemDescription, + Subcommands: []cli.Command{{ + Name: "get-undercollateralized-threshold-percent", + Usage: "Calls the constant method getUndercollateralizedThresholdPercent on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsGetUndercollateralizedThresholdPercent, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "get-remaining-eth-btc-price-feed-addition-time", + Usage: "Calls the constant method getRemainingEthBtcPriceFeedAdditionTime on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsGetRemainingEthBtcPriceFeedAdditionTime, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "get-initial-collateralized-percent", + Usage: "Calls the constant method getInitialCollateralizedPercent on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsGetInitialCollateralizedPercent, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "get-allow-new-deposits", + Usage: "Calls the constant method getAllowNewDeposits on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsGetAllowNewDeposits, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "get-severely-undercollateralized-threshold-percent", + Usage: "Calls the constant method getSeverelyUndercollateralizedThresholdPercent on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsGetSeverelyUndercollateralizedThresholdPercent, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "get-price-feed-governance-time-delay", + Usage: "Calls the constant method getPriceFeedGovernanceTimeDelay on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsGetPriceFeedGovernanceTimeDelay, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "get-remaining-keep-factories-update-time", + Usage: "Calls the constant method getRemainingKeepFactoriesUpdateTime on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsGetRemainingKeepFactoriesUpdateTime, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "get-remaining-pause-term", + Usage: "Calls the constant method getRemainingPauseTerm on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsGetRemainingPauseTerm, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "relay", + Usage: "Calls the constant method relay on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsRelay, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "approved-to-log", + Usage: "Calls the constant method approvedToLog on the TBTCSystem contract.", + ArgsUsage: "[_caller] ", + Action: tbtcsApprovedToLog, + Before: cmd.ArgCountChecker(1), + Flags: cmd.ConstFlags, + }, { + Name: "fetch-relay-previous-difficulty", + Usage: "Calls the constant method fetchRelayPreviousDifficulty on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsFetchRelayPreviousDifficulty, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "get-maximum-lot-size", + Usage: "Calls the constant method getMaximumLotSize on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsGetMaximumLotSize, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "get-remaining-signer-fee-divisor-update-time", + Usage: "Calls the constant method getRemainingSignerFeeDivisorUpdateTime on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsGetRemainingSignerFeeDivisorUpdateTime, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "fetch-bitcoin-price", + Usage: "Calls the constant method fetchBitcoinPrice on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsFetchBitcoinPrice, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "owner", + Usage: "Calls the constant method owner on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsOwner, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "get-minimum-lot-size", + Usage: "Calls the constant method getMinimumLotSize on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsGetMinimumLotSize, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "fetch-relay-current-difficulty", + Usage: "Calls the constant method fetchRelayCurrentDifficulty on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsFetchRelayCurrentDifficulty, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "get-keep-factories-upgradeability-period", + Usage: "Calls the constant method getKeepFactoriesUpgradeabilityPeriod on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsGetKeepFactoriesUpgradeabilityPeriod, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "price-feed", + Usage: "Calls the constant method priceFeed on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsPriceFeed, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "get-governance-time-delay", + Usage: "Calls the constant method getGovernanceTimeDelay on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsGetGovernanceTimeDelay, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "get-remaining-keep-factories-upgradeability-time", + Usage: "Calls the constant method getRemainingKeepFactoriesUpgradeabilityTime on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsGetRemainingKeepFactoriesUpgradeabilityTime, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "get-remaining-collateralization-thresholds-update-time", + Usage: "Calls the constant method getRemainingCollateralizationThresholdsUpdateTime on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsGetRemainingCollateralizationThresholdsUpdateTime, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "get-remaining-lot-sizes-update-time", + Usage: "Calls the constant method getRemainingLotSizesUpdateTime on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsGetRemainingLotSizesUpdateTime, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "get-signer-fee-divisor", + Usage: "Calls the constant method getSignerFeeDivisor on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsGetSignerFeeDivisor, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "keep-size", + Usage: "Calls the constant method keepSize on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsKeepSize, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "get-new-deposit-fee-estimate", + Usage: "Calls the constant method getNewDepositFeeEstimate on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsGetNewDepositFeeEstimate, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "is-owner", + Usage: "Calls the constant method isOwner on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsIsOwner, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "keep-threshold", + Usage: "Calls the constant method keepThreshold on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsKeepThreshold, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "get-allowed-lot-sizes", + Usage: "Calls the constant method getAllowedLotSizes on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsGetAllowedLotSizes, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "log-setup-failed", + Usage: "Calls the method logSetupFailed on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsLogSetupFailed, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "begin-eth-btc-price-feed-addition", + Usage: "Calls the method beginEthBtcPriceFeedAddition on the TBTCSystem contract.", + ArgsUsage: "[_ethBtcPriceFeed] ", + Action: tbtcsBeginEthBtcPriceFeedAddition, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), + Flags: cmd.NonConstFlags, + }, { + Name: "begin-keep-factories-update", + Usage: "Calls the method beginKeepFactoriesUpdate on the TBTCSystem contract.", + ArgsUsage: "[_keepStakedFactory] [_fullyBackedFactory] [_factorySelector] ", + Action: tbtcsBeginKeepFactoriesUpdate, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(3))), + Flags: cmd.NonConstFlags, + }, { + Name: "refresh-minimum-bondable-value", + Usage: "Calls the method refreshMinimumBondableValue on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsRefreshMinimumBondableValue, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "finalize-eth-btc-price-feed-addition", + Usage: "Calls the method finalizeEthBtcPriceFeedAddition on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsFinalizeEthBtcPriceFeedAddition, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "finalize-signer-fee-divisor-update", + Usage: "Calls the method finalizeSignerFeeDivisorUpdate on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsFinalizeSignerFeeDivisorUpdate, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "log-courtesy-called", + Usage: "Calls the method logCourtesyCalled on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsLogCourtesyCalled, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "resume-new-deposits", + Usage: "Calls the method resumeNewDeposits on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsResumeNewDeposits, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "finalize-lot-sizes-update", + Usage: "Calls the method finalizeLotSizesUpdate on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsFinalizeLotSizesUpdate, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "transfer-ownership", + Usage: "Calls the method transferOwnership on the TBTCSystem contract.", + ArgsUsage: "[newOwner] ", + Action: tbtcsTransferOwnership, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), + Flags: cmd.NonConstFlags, + }, { + Name: "log-fraud-during-setup", + Usage: "Calls the method logFraudDuringSetup on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsLogFraudDuringSetup, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "renounce-ownership", + Usage: "Calls the method renounceOwnership on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsRenounceOwnership, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "log-liquidated", + Usage: "Calls the method logLiquidated on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsLogLiquidated, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "log-exited-courtesy-call", + Usage: "Calls the method logExitedCourtesyCall on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsLogExitedCourtesyCall, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "emergency-pause-new-deposits", + Usage: "Calls the method emergencyPauseNewDeposits on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsEmergencyPauseNewDeposits, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "log-funder-requested-abort", + Usage: "Calls the method logFunderRequestedAbort on the TBTCSystem contract.", + ArgsUsage: "[_abortOutputScript] ", + Action: tbtcsLogFunderRequestedAbort, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), + Flags: cmd.NonConstFlags, + }, { + Name: "finalize-keep-factories-update", + Usage: "Calls the method finalizeKeepFactoriesUpdate on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsFinalizeKeepFactoriesUpdate, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "log-created", + Usage: "Calls the method logCreated on the TBTCSystem contract.", + ArgsUsage: "[_keepAddress] ", + Action: tbtcsLogCreated, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), + Flags: cmd.NonConstFlags, + }, { + Name: "finalize-collateralization-thresholds-update", + Usage: "Calls the method finalizeCollateralizationThresholdsUpdate on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsFinalizeCollateralizationThresholdsUpdate, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }}, + }) +} + +/// ------------------- Const methods ------------------- + +func tbtcsGetUndercollateralizedThresholdPercent(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.GetUndercollateralizedThresholdPercentAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsGetRemainingEthBtcPriceFeedAdditionTime(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.GetRemainingEthBtcPriceFeedAdditionTimeAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsGetInitialCollateralizedPercent(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.GetInitialCollateralizedPercentAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsGetAllowNewDeposits(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.GetAllowNewDepositsAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsGetSeverelyUndercollateralizedThresholdPercent(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.GetSeverelyUndercollateralizedThresholdPercentAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsGetPriceFeedGovernanceTimeDelay(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.GetPriceFeedGovernanceTimeDelayAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsGetRemainingKeepFactoriesUpdateTime(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.GetRemainingKeepFactoriesUpdateTimeAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsGetRemainingPauseTerm(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.GetRemainingPauseTermAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsRelay(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.RelayAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsApprovedToLog(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + _caller, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _caller, a address, from passed value %v", + c.Args()[0], + ) + } + + result, err := contract.ApprovedToLogAtBlock( + _caller, + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsFetchRelayPreviousDifficulty(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.FetchRelayPreviousDifficultyAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsGetMaximumLotSize(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.GetMaximumLotSizeAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsGetRemainingSignerFeeDivisorUpdateTime(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.GetRemainingSignerFeeDivisorUpdateTimeAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsFetchBitcoinPrice(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.FetchBitcoinPriceAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsOwner(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.OwnerAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsGetMinimumLotSize(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.GetMinimumLotSizeAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsFetchRelayCurrentDifficulty(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.FetchRelayCurrentDifficultyAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsGetKeepFactoriesUpgradeabilityPeriod(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.GetKeepFactoriesUpgradeabilityPeriodAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsPriceFeed(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.PriceFeedAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsGetGovernanceTimeDelay(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.GetGovernanceTimeDelayAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsGetRemainingKeepFactoriesUpgradeabilityTime(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.GetRemainingKeepFactoriesUpgradeabilityTimeAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsGetRemainingCollateralizationThresholdsUpdateTime(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.GetRemainingCollateralizationThresholdsUpdateTimeAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsGetRemainingLotSizesUpdateTime(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.GetRemainingLotSizesUpdateTimeAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsGetSignerFeeDivisor(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.GetSignerFeeDivisorAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsKeepSize(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.KeepSizeAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsGetNewDepositFeeEstimate(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.GetNewDepositFeeEstimateAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsIsOwner(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.IsOwnerAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsKeepThreshold(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.KeepThresholdAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func tbtcsGetAllowedLotSizes(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + result, err := contract.GetAllowedLotSizesAtBlock( + + cmd.BlockFlagValue.Uint, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +/// ------------------- Non-const methods ------------------- + +func tbtcsLogSetupFailed(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.LogSetupFailed() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallLogSetupFailed( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func tbtcsBeginEthBtcPriceFeedAddition(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + _ethBtcPriceFeed, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _ethBtcPriceFeed, a address, from passed value %v", + c.Args()[0], + ) + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.BeginEthBtcPriceFeedAddition( + _ethBtcPriceFeed, + ) + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallBeginEthBtcPriceFeedAddition( + _ethBtcPriceFeed, + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func tbtcsBeginKeepFactoriesUpdate(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + _keepStakedFactory, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _keepStakedFactory, a address, from passed value %v", + c.Args()[0], + ) + } + + _fullyBackedFactory, err := ethutil.AddressFromHex(c.Args()[1]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _fullyBackedFactory, a address, from passed value %v", + c.Args()[1], + ) + } + + _factorySelector, err := ethutil.AddressFromHex(c.Args()[2]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _factorySelector, a address, from passed value %v", + c.Args()[2], + ) + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.BeginKeepFactoriesUpdate( + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, + ) + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallBeginKeepFactoriesUpdate( + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func tbtcsRefreshMinimumBondableValue(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.RefreshMinimumBondableValue() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallRefreshMinimumBondableValue( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func tbtcsFinalizeEthBtcPriceFeedAddition(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.FinalizeEthBtcPriceFeedAddition() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallFinalizeEthBtcPriceFeedAddition( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func tbtcsFinalizeSignerFeeDivisorUpdate(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.FinalizeSignerFeeDivisorUpdate() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallFinalizeSignerFeeDivisorUpdate( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func tbtcsLogCourtesyCalled(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.LogCourtesyCalled() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallLogCourtesyCalled( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func tbtcsResumeNewDeposits(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.ResumeNewDeposits() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallResumeNewDeposits( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func tbtcsFinalizeLotSizesUpdate(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.FinalizeLotSizesUpdate() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallFinalizeLotSizesUpdate( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func tbtcsTransferOwnership(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + newOwner, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter newOwner, a address, from passed value %v", + c.Args()[0], + ) + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.TransferOwnership( + newOwner, + ) + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallTransferOwnership( + newOwner, + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func tbtcsLogFraudDuringSetup(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.LogFraudDuringSetup() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallLogFraudDuringSetup( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func tbtcsRenounceOwnership(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // 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.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func tbtcsLogLiquidated(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.LogLiquidated() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallLogLiquidated( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func tbtcsLogExitedCourtesyCall(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.LogExitedCourtesyCall() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallLogExitedCourtesyCall( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func tbtcsEmergencyPauseNewDeposits(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.EmergencyPauseNewDeposits() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallEmergencyPauseNewDeposits( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func tbtcsLogFunderRequestedAbort(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + _abortOutputScript, err := hexutil.Decode(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _abortOutputScript, a bytes, from passed value %v", + c.Args()[0], + ) + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.LogFunderRequestedAbort( + _abortOutputScript, + ) + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallLogFunderRequestedAbort( + _abortOutputScript, + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func tbtcsFinalizeKeepFactoriesUpdate(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.FinalizeKeepFactoriesUpdate() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallFinalizeKeepFactoriesUpdate( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func tbtcsLogCreated(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + _keepAddress, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _keepAddress, a address, from passed value %v", + c.Args()[0], + ) + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.LogCreated( + _keepAddress, + ) + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallLogCreated( + _keepAddress, + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func tbtcsFinalizeCollateralizationThresholdsUpdate(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.FinalizeCollateralizationThresholdsUpdate() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallFinalizeCollateralizationThresholdsUpdate( + cmd.BlockFlagValue.Uint, + ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +/// ------------------- Initialization ------------------- + +func initializeTBTCSystem(c *cli.Context) (*contract.TBTCSystem, error) { + config, err := config.ReadEthereumConfig(c.GlobalString("config")) + if err != nil { + return nil, fmt.Errorf("error reading Ethereum config from file: [%v]", err) + } + + client, _, _, err := ethutil.ConnectClients(config.URL, config.URLRPC) + if err != nil { + return nil, fmt.Errorf("error connecting to Ethereum node: [%v]", err) + } + + key, err := ethutil.DecryptKeyFile( + config.Account.KeyFile, + config.Account.KeyFilePassword, + ) + if err != nil { + return nil, fmt.Errorf( + "failed to read KeyFile: %s: [%v]", + config.Account.KeyFile, + err, + ) + } + + checkInterval := cmd.DefaultMiningCheckInterval + maxGasPrice := cmd.DefaultMaxGasPrice + if config.MiningCheckInterval != 0 { + checkInterval = time.Duration(config.MiningCheckInterval) * time.Second + } + if config.MaxGasPrice != 0 { + maxGasPrice = new(big.Int).SetUint64(config.MaxGasPrice) + } + + miningWaiter := ethutil.NewMiningWaiter(client, checkInterval, maxGasPrice) + + address := common.HexToAddress(config.ContractAddresses["TBTCSystem"]) + + return contract.NewTBTCSystem( + address, + key, + client, + ethutil.NewNonceManager(key.Address, client), + miningWaiter, + &sync.Mutex{}, + ) +} diff --git a/go/contract/Deposit.go b/go/contract/Deposit.go index dee497bb0..0d2a7a78e 100644 --- a/go/contract/Deposit.go +++ b/go/contract/Deposit.go @@ -92,17 +92,12 @@ func NewDeposit( // ----- Non-const Methods ------ // Transaction submission. -func (d *Deposit) Initialize( - _factory common.Address, +func (d *Deposit) NotifyCourtesyCall( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction initialize", - "params: ", - fmt.Sprint( - _factory, - ), + "submitting transaction notifyCourtesyCall", ) d.transactionMutex.Lock() @@ -127,22 +122,20 @@ func (d *Deposit) Initialize( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.Initialize( + transaction, err := d.contract.NotifyCourtesyCall( transactorOptions, - _factory, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "initialize", - _factory, + "notifyCourtesyCall", ) } dLogger.Infof( - "submitted transaction initialize with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -153,22 +146,20 @@ func (d *Deposit) Initialize( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.Initialize( + transaction, err := d.contract.NotifyCourtesyCall( transactorOptions, - _factory, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "initialize", - _factory, + "notifyCourtesyCall", ) } dLogger.Infof( - "submitted transaction initialize with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -183,8 +174,7 @@ func (d *Deposit) Initialize( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallInitialize( - _factory common.Address, +func (d *Deposit) CallNotifyCourtesyCall( blockNumber *big.Int, ) error { var result interface{} = nil @@ -196,55 +186,34 @@ func (d *Deposit) CallInitialize( d.caller, d.errorResolver, d.contractAddress, - "initialize", + "notifyCourtesyCall", &result, - _factory, ) return err } -func (d *Deposit) InitializeGasEstimate( - _factory common.Address, -) (uint64, error) { +func (d *Deposit) NotifyCourtesyCallGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "initialize", + "notifyCourtesyCall", d.contractABI, d.transactor, - _factory, ) return result, err } // Transaction submission. -func (d *Deposit) InitializeDeposit( - _tbtcSystem common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachineAddress common.Address, - _lotSizeSatoshis uint64, - value *big.Int, +func (d *Deposit) NotifyUndercollateralizedLiquidation( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction initializeDeposit", - "params: ", - fmt.Sprint( - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, - ), - "value: ", value, + "submitting transaction notifyUndercollateralizedLiquidation", ) d.transactionMutex.Lock() @@ -254,8 +223,6 @@ func (d *Deposit) InitializeDeposit( transactorOptions := new(bind.TransactOpts) *transactorOptions = *d.transactorOptions - transactorOptions.Value = value - if len(transactionOptions) > 1 { return nil, fmt.Errorf( "could not process multiple transaction options sets", @@ -271,32 +238,20 @@ func (d *Deposit) InitializeDeposit( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.InitializeDeposit( + transaction, err := d.contract.NotifyUndercollateralizedLiquidation( transactorOptions, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, - value, - "initializeDeposit", - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, + nil, + "notifyUndercollateralizedLiquidation", ) } dLogger.Infof( - "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", + "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -307,32 +262,20 @@ func (d *Deposit) InitializeDeposit( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.InitializeDeposit( + transaction, err := d.contract.NotifyUndercollateralizedLiquidation( transactorOptions, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, - value, - "initializeDeposit", - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, + nil, + "notifyUndercollateralizedLiquidation", ) } dLogger.Infof( - "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", + "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -347,72 +290,55 @@ func (d *Deposit) InitializeDeposit( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallInitializeDeposit( - _tbtcSystem common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachineAddress common.Address, - _lotSizeSatoshis uint64, - value *big.Int, +func (d *Deposit) CallNotifyUndercollateralizedLiquidation( blockNumber *big.Int, ) error { var result interface{} = nil err := ethutil.CallAtBlock( d.transactorOptions.From, - blockNumber, value, + blockNumber, nil, d.contractABI, d.caller, d.errorResolver, d.contractAddress, - "initializeDeposit", + "notifyUndercollateralizedLiquidation", &result, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, ) return err } -func (d *Deposit) InitializeDepositGasEstimate( - _tbtcSystem common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachineAddress common.Address, - _lotSizeSatoshis uint64, -) (uint64, error) { +func (d *Deposit) NotifyUndercollateralizedLiquidationGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "initializeDeposit", + "notifyUndercollateralizedLiquidation", d.contractABI, d.transactor, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyRedemptionSignatureTimedOut( +func (d *Deposit) TransferAndRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyRedemptionSignatureTimedOut", + "submitting transaction transferAndRequestRedemption", + "params: ", + fmt.Sprint( + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, + ), ) d.transactionMutex.Lock() @@ -437,20 +363,26 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( + transaction, err := d.contract.TransferAndRequestRedemption( transactorOptions, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyRedemptionSignatureTimedOut", + "transferAndRequestRedemption", + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) } dLogger.Infof( - "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", + "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -461,20 +393,26 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( + transaction, err := d.contract.TransferAndRequestRedemption( transactorOptions, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyRedemptionSignatureTimedOut", + "transferAndRequestRedemption", + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) } dLogger.Infof( - "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", + "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -489,7 +427,10 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyRedemptionSignatureTimedOut( +func (d *Deposit) CallTransferAndRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -501,47 +442,44 @@ func (d *Deposit) CallNotifyRedemptionSignatureTimedOut( d.caller, d.errorResolver, d.contractAddress, - "notifyRedemptionSignatureTimedOut", + "transferAndRequestRedemption", &result, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) return err } -func (d *Deposit) NotifyRedemptionSignatureTimedOutGasEstimate() (uint64, error) { +func (d *Deposit) TransferAndRequestRedemptionGasEstimate( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyRedemptionSignatureTimedOut", + "transferAndRequestRedemption", d.contractABI, d.transactor, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) return result, err } // Transaction submission. -func (d *Deposit) ProvideECDSAFraudProof( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) ExitCourtesyCall( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideECDSAFraudProof", - "params: ", - fmt.Sprint( - _v, - _r, - _s, - _signedDigest, - _preimage, - ), + "submitting transaction exitCourtesyCall", ) d.transactionMutex.Lock() @@ -566,30 +504,20 @@ func (d *Deposit) ProvideECDSAFraudProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideECDSAFraudProof( + transaction, err := d.contract.ExitCourtesyCall( transactorOptions, - _v, - _r, - _s, - _signedDigest, - _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideECDSAFraudProof", - _v, - _r, - _s, - _signedDigest, - _preimage, + "exitCourtesyCall", ) } dLogger.Infof( - "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", + "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -600,30 +528,20 @@ func (d *Deposit) ProvideECDSAFraudProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideECDSAFraudProof( + transaction, err := d.contract.ExitCourtesyCall( transactorOptions, - _v, - _r, - _s, - _signedDigest, - _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideECDSAFraudProof", - _v, - _r, - _s, - _signedDigest, - _preimage, + "exitCourtesyCall", ) } dLogger.Infof( - "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", + "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -638,12 +556,7 @@ func (d *Deposit) ProvideECDSAFraudProof( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideECDSAFraudProof( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) CallExitCourtesyCall( blockNumber *big.Int, ) error { var result interface{} = nil @@ -655,49 +568,34 @@ func (d *Deposit) CallProvideECDSAFraudProof( d.caller, d.errorResolver, d.contractAddress, - "provideECDSAFraudProof", + "exitCourtesyCall", &result, - _v, - _r, - _s, - _signedDigest, - _preimage, ) return err } -func (d *Deposit) ProvideECDSAFraudProofGasEstimate( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, -) (uint64, error) { +func (d *Deposit) ExitCourtesyCallGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideECDSAFraudProof", + "exitCourtesyCall", d.contractABI, d.transactor, - _v, - _r, - _s, - _signedDigest, - _preimage, ) return result, err } // Transaction submission. -func (d *Deposit) ProvideRedemptionProof( +func (d *Deposit) ProvideBTCFundingProof( _txVersion [4]uint8, _txInputVector []uint8, _txOutputVector []uint8, _txLocktime [4]uint8, + _fundingOutputIndex uint8, _merkleProof []uint8, _txIndexInBlock *big.Int, _bitcoinHeaders []uint8, @@ -705,13 +603,14 @@ func (d *Deposit) ProvideRedemptionProof( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideRedemptionProof", + "submitting transaction provideBTCFundingProof", "params: ", fmt.Sprint( _txVersion, _txInputVector, _txOutputVector, _txLocktime, + _fundingOutputIndex, _merkleProof, _txIndexInBlock, _bitcoinHeaders, @@ -740,12 +639,13 @@ func (d *Deposit) ProvideRedemptionProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideRedemptionProof( + transaction, err := d.contract.ProvideBTCFundingProof( transactorOptions, _txVersion, _txInputVector, _txOutputVector, _txLocktime, + _fundingOutputIndex, _merkleProof, _txIndexInBlock, _bitcoinHeaders, @@ -755,11 +655,12 @@ func (d *Deposit) ProvideRedemptionProof( err, d.transactorOptions.From, nil, - "provideRedemptionProof", + "provideBTCFundingProof", _txVersion, _txInputVector, _txOutputVector, _txLocktime, + _fundingOutputIndex, _merkleProof, _txIndexInBlock, _bitcoinHeaders, @@ -767,7 +668,7 @@ func (d *Deposit) ProvideRedemptionProof( } dLogger.Infof( - "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", + "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -778,12 +679,13 @@ func (d *Deposit) ProvideRedemptionProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideRedemptionProof( + transaction, err := d.contract.ProvideBTCFundingProof( transactorOptions, _txVersion, _txInputVector, _txOutputVector, _txLocktime, + _fundingOutputIndex, _merkleProof, _txIndexInBlock, _bitcoinHeaders, @@ -793,11 +695,12 @@ func (d *Deposit) ProvideRedemptionProof( err, d.transactorOptions.From, nil, - "provideRedemptionProof", + "provideBTCFundingProof", _txVersion, _txInputVector, _txOutputVector, _txLocktime, + _fundingOutputIndex, _merkleProof, _txIndexInBlock, _bitcoinHeaders, @@ -805,7 +708,7 @@ func (d *Deposit) ProvideRedemptionProof( } dLogger.Infof( - "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", + "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -820,11 +723,12 @@ func (d *Deposit) ProvideRedemptionProof( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideRedemptionProof( +func (d *Deposit) CallProvideBTCFundingProof( _txVersion [4]uint8, _txInputVector []uint8, _txOutputVector []uint8, _txLocktime [4]uint8, + _fundingOutputIndex uint8, _merkleProof []uint8, _txIndexInBlock *big.Int, _bitcoinHeaders []uint8, @@ -839,12 +743,13 @@ func (d *Deposit) CallProvideRedemptionProof( d.caller, d.errorResolver, d.contractAddress, - "provideRedemptionProof", + "provideBTCFundingProof", &result, _txVersion, _txInputVector, _txOutputVector, _txLocktime, + _fundingOutputIndex, _merkleProof, _txIndexInBlock, _bitcoinHeaders, @@ -853,11 +758,12 @@ func (d *Deposit) CallProvideRedemptionProof( return err } -func (d *Deposit) ProvideRedemptionProofGasEstimate( +func (d *Deposit) ProvideBTCFundingProofGasEstimate( _txVersion [4]uint8, _txInputVector []uint8, _txOutputVector []uint8, _txLocktime [4]uint8, + _fundingOutputIndex uint8, _merkleProof []uint8, _txIndexInBlock *big.Int, _bitcoinHeaders []uint8, @@ -867,13 +773,14 @@ func (d *Deposit) ProvideRedemptionProofGasEstimate( result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideRedemptionProof", + "provideBTCFundingProof", d.contractABI, d.transactor, _txVersion, _txInputVector, _txOutputVector, _txLocktime, + _fundingOutputIndex, _merkleProof, _txIndexInBlock, _bitcoinHeaders, @@ -883,21 +790,12 @@ func (d *Deposit) ProvideRedemptionProofGasEstimate( } // Transaction submission. -func (d *Deposit) ProvideRedemptionSignature( - _v uint8, - _r [32]uint8, - _s [32]uint8, +func (d *Deposit) NotifyCourtesyCallExpired( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideRedemptionSignature", - "params: ", - fmt.Sprint( - _v, - _r, - _s, - ), + "submitting transaction notifyCourtesyCallExpired", ) d.transactionMutex.Lock() @@ -922,26 +820,20 @@ func (d *Deposit) ProvideRedemptionSignature( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideRedemptionSignature( + transaction, err := d.contract.NotifyCourtesyCallExpired( transactorOptions, - _v, - _r, - _s, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideRedemptionSignature", - _v, - _r, - _s, + "notifyCourtesyCallExpired", ) } dLogger.Infof( - "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -952,26 +844,20 @@ func (d *Deposit) ProvideRedemptionSignature( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideRedemptionSignature( + transaction, err := d.contract.NotifyCourtesyCallExpired( transactorOptions, - _v, - _r, - _s, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideRedemptionSignature", - _v, - _r, - _s, + "notifyCourtesyCallExpired", ) } dLogger.Infof( - "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -986,10 +872,7 @@ func (d *Deposit) ProvideRedemptionSignature( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideRedemptionSignature( - _v uint8, - _r [32]uint8, - _s [32]uint8, +func (d *Deposit) CallNotifyCourtesyCallExpired( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1001,57 +884,34 @@ func (d *Deposit) CallProvideRedemptionSignature( d.caller, d.errorResolver, d.contractAddress, - "provideRedemptionSignature", + "notifyCourtesyCallExpired", &result, - _v, - _r, - _s, ) return err } -func (d *Deposit) ProvideRedemptionSignatureGasEstimate( - _v uint8, - _r [32]uint8, - _s [32]uint8, -) (uint64, error) { +func (d *Deposit) NotifyCourtesyCallExpiredGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideRedemptionSignature", + "notifyCourtesyCallExpired", d.contractABI, d.transactor, - _v, - _r, - _s, ) return result, err } // Transaction submission. -func (d *Deposit) ProvideFundingECDSAFraudProof( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) NotifyRedemptionProofTimedOut( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideFundingECDSAFraudProof", - "params: ", - fmt.Sprint( - _v, - _r, - _s, - _signedDigest, - _preimage, - ), + "submitting transaction notifyRedemptionProofTimedOut", ) d.transactionMutex.Lock() @@ -1076,30 +936,20 @@ func (d *Deposit) ProvideFundingECDSAFraudProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideFundingECDSAFraudProof( + transaction, err := d.contract.NotifyRedemptionProofTimedOut( transactorOptions, - _v, - _r, - _s, - _signedDigest, - _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideFundingECDSAFraudProof", - _v, - _r, - _s, - _signedDigest, - _preimage, + "notifyRedemptionProofTimedOut", ) } dLogger.Infof( - "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", + "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1110,30 +960,20 @@ func (d *Deposit) ProvideFundingECDSAFraudProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideFundingECDSAFraudProof( + transaction, err := d.contract.NotifyRedemptionProofTimedOut( transactorOptions, - _v, - _r, - _s, - _signedDigest, - _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideFundingECDSAFraudProof", - _v, - _r, - _s, - _signedDigest, - _preimage, + "notifyRedemptionProofTimedOut", ) } dLogger.Infof( - "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", + "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1148,12 +988,7 @@ func (d *Deposit) ProvideFundingECDSAFraudProof( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideFundingECDSAFraudProof( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) CallNotifyRedemptionProofTimedOut( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1165,50 +1000,47 @@ func (d *Deposit) CallProvideFundingECDSAFraudProof( d.caller, d.errorResolver, d.contractAddress, - "provideFundingECDSAFraudProof", + "notifyRedemptionProofTimedOut", &result, - _v, - _r, - _s, - _signedDigest, - _preimage, ) return err } -func (d *Deposit) ProvideFundingECDSAFraudProofGasEstimate( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, -) (uint64, error) { +func (d *Deposit) NotifyRedemptionProofTimedOutGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideFundingECDSAFraudProof", + "notifyRedemptionProofTimedOut", d.contractABI, d.transactor, - _v, - _r, - _s, - _signedDigest, - _preimage, ) return result, err } // Transaction submission. -func (d *Deposit) PurchaseSignerBondsAtAuction( +func (d *Deposit) ProvideECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction purchaseSignerBondsAtAuction", + "submitting transaction provideECDSAFraudProof", + "params: ", + fmt.Sprint( + _v, + _r, + _s, + _signedDigest, + _preimage, + ), ) d.transactionMutex.Lock() @@ -1233,20 +1065,30 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.PurchaseSignerBondsAtAuction( + transaction, err := d.contract.ProvideECDSAFraudProof( transactorOptions, + _v, + _r, + _s, + _signedDigest, + _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "purchaseSignerBondsAtAuction", + "provideECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, ) } dLogger.Infof( - "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", + "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1257,20 +1099,30 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.PurchaseSignerBondsAtAuction( + transaction, err := d.contract.ProvideECDSAFraudProof( transactorOptions, + _v, + _r, + _s, + _signedDigest, + _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "purchaseSignerBondsAtAuction", + "provideECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, ) } dLogger.Infof( - "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", + "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1285,7 +1137,12 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallPurchaseSignerBondsAtAuction( +func (d *Deposit) CallProvideECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1297,34 +1154,63 @@ func (d *Deposit) CallPurchaseSignerBondsAtAuction( d.caller, d.errorResolver, d.contractAddress, - "purchaseSignerBondsAtAuction", + "provideECDSAFraudProof", &result, + _v, + _r, + _s, + _signedDigest, + _preimage, ) return err } -func (d *Deposit) PurchaseSignerBondsAtAuctionGasEstimate() (uint64, error) { - var result uint64 - - result, err := ethutil.EstimateGas( - d.callerOptions.From, - d.contractAddress, - "purchaseSignerBondsAtAuction", +func (d *Deposit) ProvideECDSAFraudProofGasEstimate( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "provideECDSAFraudProof", d.contractABI, d.transactor, + _v, + _r, + _s, + _signedDigest, + _preimage, ) return result, err } // Transaction submission. -func (d *Deposit) ExitCourtesyCall( +func (d *Deposit) ProvideFundingECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction exitCourtesyCall", + "submitting transaction provideFundingECDSAFraudProof", + "params: ", + fmt.Sprint( + _v, + _r, + _s, + _signedDigest, + _preimage, + ), ) d.transactionMutex.Lock() @@ -1349,20 +1235,30 @@ func (d *Deposit) ExitCourtesyCall( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ExitCourtesyCall( + transaction, err := d.contract.ProvideFundingECDSAFraudProof( transactorOptions, + _v, + _r, + _s, + _signedDigest, + _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "exitCourtesyCall", + "provideFundingECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, ) } dLogger.Infof( - "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1373,20 +1269,30 @@ func (d *Deposit) ExitCourtesyCall( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ExitCourtesyCall( + transaction, err := d.contract.ProvideFundingECDSAFraudProof( transactorOptions, + _v, + _r, + _s, + _signedDigest, + _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "exitCourtesyCall", + "provideFundingECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, ) } dLogger.Infof( - "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1401,7 +1307,12 @@ func (d *Deposit) ExitCourtesyCall( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallExitCourtesyCall( +func (d *Deposit) CallProvideFundingECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1413,34 +1324,67 @@ func (d *Deposit) CallExitCourtesyCall( d.caller, d.errorResolver, d.contractAddress, - "exitCourtesyCall", + "provideFundingECDSAFraudProof", &result, + _v, + _r, + _s, + _signedDigest, + _preimage, ) return err } -func (d *Deposit) ExitCourtesyCallGasEstimate() (uint64, error) { +func (d *Deposit) ProvideFundingECDSAFraudProofGasEstimate( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "exitCourtesyCall", + "provideFundingECDSAFraudProof", d.contractABI, d.transactor, + _v, + _r, + _s, + _signedDigest, + _preimage, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyRedemptionProofTimedOut( +func (d *Deposit) ProvideRedemptionProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyRedemptionProofTimedOut", + "submitting transaction provideRedemptionProof", + "params: ", + fmt.Sprint( + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ), ) d.transactionMutex.Lock() @@ -1465,20 +1409,34 @@ func (d *Deposit) NotifyRedemptionProofTimedOut( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyRedemptionProofTimedOut( + transaction, err := d.contract.ProvideRedemptionProof( transactorOptions, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyRedemptionProofTimedOut", + "provideRedemptionProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) } dLogger.Infof( - "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1489,20 +1447,34 @@ func (d *Deposit) NotifyRedemptionProofTimedOut( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyRedemptionProofTimedOut( + transaction, err := d.contract.ProvideRedemptionProof( transactorOptions, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyRedemptionProofTimedOut", + "provideRedemptionProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) } dLogger.Infof( - "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1517,7 +1489,14 @@ func (d *Deposit) NotifyRedemptionProofTimedOut( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyRedemptionProofTimedOut( +func (d *Deposit) CallProvideRedemptionProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1529,34 +1508,61 @@ func (d *Deposit) CallNotifyRedemptionProofTimedOut( d.caller, d.errorResolver, d.contractAddress, - "notifyRedemptionProofTimedOut", + "provideRedemptionProof", &result, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) return err } -func (d *Deposit) NotifyRedemptionProofTimedOutGasEstimate() (uint64, error) { +func (d *Deposit) ProvideRedemptionProofGasEstimate( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyRedemptionProofTimedOut", + "provideRedemptionProof", d.contractABI, d.transactor, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) return result, err } // Transaction submission. -func (d *Deposit) NotifySignerSetupFailed( +func (d *Deposit) RequestFunderAbort( + _abortOutputScript []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifySignerSetupFailed", + "submitting transaction requestFunderAbort", + "params: ", + fmt.Sprint( + _abortOutputScript, + ), ) d.transactionMutex.Lock() @@ -1581,20 +1587,22 @@ func (d *Deposit) NotifySignerSetupFailed( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifySignerSetupFailed( + transaction, err := d.contract.RequestFunderAbort( transactorOptions, + _abortOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifySignerSetupFailed", + "requestFunderAbort", + _abortOutputScript, ) } dLogger.Infof( - "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", + "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1605,20 +1613,22 @@ func (d *Deposit) NotifySignerSetupFailed( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifySignerSetupFailed( + transaction, err := d.contract.RequestFunderAbort( transactorOptions, + _abortOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifySignerSetupFailed", + "requestFunderAbort", + _abortOutputScript, ) } dLogger.Infof( - "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", + "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1633,7 +1643,8 @@ func (d *Deposit) NotifySignerSetupFailed( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifySignerSetupFailed( +func (d *Deposit) CallRequestFunderAbort( + _abortOutputScript []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1645,41 +1656,38 @@ func (d *Deposit) CallNotifySignerSetupFailed( d.caller, d.errorResolver, d.contractAddress, - "notifySignerSetupFailed", + "requestFunderAbort", &result, + _abortOutputScript, ) return err } -func (d *Deposit) NotifySignerSetupFailedGasEstimate() (uint64, error) { +func (d *Deposit) RequestFunderAbortGasEstimate( + _abortOutputScript []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifySignerSetupFailed", + "requestFunderAbort", d.contractABI, d.transactor, + _abortOutputScript, ) return result, err } // Transaction submission. -func (d *Deposit) RequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, +func (d *Deposit) RetrieveSignerPubkey( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction requestRedemption", - "params: ", - fmt.Sprint( - _outputValueBytes, - _redeemerOutputScript, - ), + "submitting transaction retrieveSignerPubkey", ) d.transactionMutex.Lock() @@ -1704,24 +1712,20 @@ func (d *Deposit) RequestRedemption( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.RequestRedemption( + transaction, err := d.contract.RetrieveSignerPubkey( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "requestRedemption", - _outputValueBytes, - _redeemerOutputScript, + "retrieveSignerPubkey", ) } dLogger.Infof( - "submitted transaction requestRedemption with id: [%v] and nonce [%v]", + "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1732,24 +1736,20 @@ func (d *Deposit) RequestRedemption( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.RequestRedemption( + transaction, err := d.contract.RetrieveSignerPubkey( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "requestRedemption", - _outputValueBytes, - _redeemerOutputScript, + "retrieveSignerPubkey", ) } dLogger.Infof( - "submitted transaction requestRedemption with id: [%v] and nonce [%v]", + "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1764,9 +1764,7 @@ func (d *Deposit) RequestRedemption( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallRequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, +func (d *Deposit) CallRetrieveSignerPubkey( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1778,45 +1776,40 @@ func (d *Deposit) CallRequestRedemption( d.caller, d.errorResolver, d.contractAddress, - "requestRedemption", + "retrieveSignerPubkey", &result, - _outputValueBytes, - _redeemerOutputScript, ) return err } -func (d *Deposit) RequestRedemptionGasEstimate( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, -) (uint64, error) { +func (d *Deposit) RetrieveSignerPubkeyGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "requestRedemption", + "retrieveSignerPubkey", d.contractABI, d.transactor, - _outputValueBytes, - _redeemerOutputScript, ) return result, err } // Transaction submission. -func (d *Deposit) RequestFunderAbort( - _abortOutputScript []uint8, +func (d *Deposit) IncreaseRedemptionFee( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction requestFunderAbort", + "submitting transaction increaseRedemptionFee", "params: ", fmt.Sprint( - _abortOutputScript, + _previousOutputValueBytes, + _newOutputValueBytes, ), ) @@ -1842,22 +1835,24 @@ func (d *Deposit) RequestFunderAbort( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.RequestFunderAbort( + transaction, err := d.contract.IncreaseRedemptionFee( transactorOptions, - _abortOutputScript, + _previousOutputValueBytes, + _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "requestFunderAbort", - _abortOutputScript, + "increaseRedemptionFee", + _previousOutputValueBytes, + _newOutputValueBytes, ) } dLogger.Infof( - "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", + "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1868,22 +1863,24 @@ func (d *Deposit) RequestFunderAbort( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.RequestFunderAbort( + transaction, err := d.contract.IncreaseRedemptionFee( transactorOptions, - _abortOutputScript, + _previousOutputValueBytes, + _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "requestFunderAbort", - _abortOutputScript, + "increaseRedemptionFee", + _previousOutputValueBytes, + _newOutputValueBytes, ) } dLogger.Infof( - "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", + "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1898,8 +1895,9 @@ func (d *Deposit) RequestFunderAbort( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallRequestFunderAbort( - _abortOutputScript []uint8, +func (d *Deposit) CallIncreaseRedemptionFee( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1911,38 +1909,41 @@ func (d *Deposit) CallRequestFunderAbort( d.caller, d.errorResolver, d.contractAddress, - "requestFunderAbort", + "increaseRedemptionFee", &result, - _abortOutputScript, + _previousOutputValueBytes, + _newOutputValueBytes, ) return err } -func (d *Deposit) RequestFunderAbortGasEstimate( - _abortOutputScript []uint8, +func (d *Deposit) IncreaseRedemptionFeeGasEstimate( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "requestFunderAbort", + "increaseRedemptionFee", d.contractABI, d.transactor, - _abortOutputScript, + _previousOutputValueBytes, + _newOutputValueBytes, ) return result, err } // Transaction submission. -func (d *Deposit) WithdrawFunds( +func (d *Deposit) NotifyFundingTimedOut( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction withdrawFunds", + "submitting transaction notifyFundingTimedOut", ) d.transactionMutex.Lock() @@ -1967,7 +1968,7 @@ func (d *Deposit) WithdrawFunds( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.WithdrawFunds( + transaction, err := d.contract.NotifyFundingTimedOut( transactorOptions, ) if err != nil { @@ -1975,12 +1976,12 @@ func (d *Deposit) WithdrawFunds( err, d.transactorOptions.From, nil, - "withdrawFunds", + "notifyFundingTimedOut", ) } dLogger.Infof( - "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", + "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1991,7 +1992,7 @@ func (d *Deposit) WithdrawFunds( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.WithdrawFunds( + transaction, err := d.contract.NotifyFundingTimedOut( transactorOptions, ) if err != nil { @@ -1999,12 +2000,12 @@ func (d *Deposit) WithdrawFunds( err, d.transactorOptions.From, nil, - "withdrawFunds", + "notifyFundingTimedOut", ) } dLogger.Infof( - "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", + "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2019,7 +2020,7 @@ func (d *Deposit) WithdrawFunds( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallWithdrawFunds( +func (d *Deposit) CallNotifyFundingTimedOut( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2031,20 +2032,20 @@ func (d *Deposit) CallWithdrawFunds( d.caller, d.errorResolver, d.contractAddress, - "withdrawFunds", + "notifyFundingTimedOut", &result, ) return err } -func (d *Deposit) WithdrawFundsGasEstimate() (uint64, error) { +func (d *Deposit) NotifyFundingTimedOutGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "withdrawFunds", + "notifyFundingTimedOut", d.contractABI, d.transactor, ) @@ -2053,12 +2054,21 @@ func (d *Deposit) WithdrawFundsGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) NotifyCourtesyCallExpired( +func (d *Deposit) ProvideRedemptionSignature( + _v uint8, + _r [32]uint8, + _s [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyCourtesyCallExpired", + "submitting transaction provideRedemptionSignature", + "params: ", + fmt.Sprint( + _v, + _r, + _s, + ), ) d.transactionMutex.Lock() @@ -2083,20 +2093,26 @@ func (d *Deposit) NotifyCourtesyCallExpired( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyCourtesyCallExpired( + transaction, err := d.contract.ProvideRedemptionSignature( transactorOptions, + _v, + _r, + _s, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyCourtesyCallExpired", + "provideRedemptionSignature", + _v, + _r, + _s, ) } dLogger.Infof( - "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2107,20 +2123,26 @@ func (d *Deposit) NotifyCourtesyCallExpired( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyCourtesyCallExpired( + transaction, err := d.contract.ProvideRedemptionSignature( transactorOptions, + _v, + _r, + _s, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyCourtesyCallExpired", + "provideRedemptionSignature", + _v, + _r, + _s, ) } dLogger.Infof( - "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2135,7 +2157,10 @@ func (d *Deposit) NotifyCourtesyCallExpired( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyCourtesyCallExpired( +func (d *Deposit) CallProvideRedemptionSignature( + _v uint8, + _r [32]uint8, + _s [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2147,34 +2172,44 @@ func (d *Deposit) CallNotifyCourtesyCallExpired( d.caller, d.errorResolver, d.contractAddress, - "notifyCourtesyCallExpired", + "provideRedemptionSignature", &result, + _v, + _r, + _s, ) return err } -func (d *Deposit) NotifyCourtesyCallExpiredGasEstimate() (uint64, error) { +func (d *Deposit) ProvideRedemptionSignatureGasEstimate( + _v uint8, + _r [32]uint8, + _s [32]uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyCourtesyCallExpired", + "provideRedemptionSignature", d.contractABI, d.transactor, + _v, + _r, + _s, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyFundingTimedOut( +func (d *Deposit) PurchaseSignerBondsAtAuction( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyFundingTimedOut", + "submitting transaction purchaseSignerBondsAtAuction", ) d.transactionMutex.Lock() @@ -2199,7 +2234,7 @@ func (d *Deposit) NotifyFundingTimedOut( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyFundingTimedOut( + transaction, err := d.contract.PurchaseSignerBondsAtAuction( transactorOptions, ) if err != nil { @@ -2207,12 +2242,12 @@ func (d *Deposit) NotifyFundingTimedOut( err, d.transactorOptions.From, nil, - "notifyFundingTimedOut", + "purchaseSignerBondsAtAuction", ) } dLogger.Infof( - "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", + "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2223,7 +2258,7 @@ func (d *Deposit) NotifyFundingTimedOut( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyFundingTimedOut( + transaction, err := d.contract.PurchaseSignerBondsAtAuction( transactorOptions, ) if err != nil { @@ -2231,12 +2266,12 @@ func (d *Deposit) NotifyFundingTimedOut( err, d.transactorOptions.From, nil, - "notifyFundingTimedOut", + "purchaseSignerBondsAtAuction", ) } dLogger.Infof( - "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", + "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2251,7 +2286,7 @@ func (d *Deposit) NotifyFundingTimedOut( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyFundingTimedOut( +func (d *Deposit) CallPurchaseSignerBondsAtAuction( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2263,20 +2298,20 @@ func (d *Deposit) CallNotifyFundingTimedOut( d.caller, d.errorResolver, d.contractAddress, - "notifyFundingTimedOut", + "purchaseSignerBondsAtAuction", &result, ) return err } -func (d *Deposit) NotifyFundingTimedOutGasEstimate() (uint64, error) { +func (d *Deposit) PurchaseSignerBondsAtAuctionGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyFundingTimedOut", + "purchaseSignerBondsAtAuction", d.contractABI, d.transactor, ) @@ -2285,19 +2320,12 @@ func (d *Deposit) NotifyFundingTimedOutGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) IncreaseRedemptionFee( - _previousOutputValueBytes [8]uint8, - _newOutputValueBytes [8]uint8, +func (d *Deposit) NotifyRedemptionSignatureTimedOut( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction increaseRedemptionFee", - "params: ", - fmt.Sprint( - _previousOutputValueBytes, - _newOutputValueBytes, - ), + "submitting transaction notifyRedemptionSignatureTimedOut", ) d.transactionMutex.Lock() @@ -2322,24 +2350,20 @@ func (d *Deposit) IncreaseRedemptionFee( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.IncreaseRedemptionFee( + transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( transactorOptions, - _previousOutputValueBytes, - _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "increaseRedemptionFee", - _previousOutputValueBytes, - _newOutputValueBytes, + "notifyRedemptionSignatureTimedOut", ) } dLogger.Infof( - "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", + "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2350,24 +2374,20 @@ func (d *Deposit) IncreaseRedemptionFee( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.IncreaseRedemptionFee( + transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( transactorOptions, - _previousOutputValueBytes, - _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "increaseRedemptionFee", - _previousOutputValueBytes, - _newOutputValueBytes, + "notifyRedemptionSignatureTimedOut", ) } dLogger.Infof( - "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", + "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2382,9 +2402,7 @@ func (d *Deposit) IncreaseRedemptionFee( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallIncreaseRedemptionFee( - _previousOutputValueBytes [8]uint8, - _newOutputValueBytes [8]uint8, +func (d *Deposit) CallNotifyRedemptionSignatureTimedOut( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2396,41 +2414,34 @@ func (d *Deposit) CallIncreaseRedemptionFee( d.caller, d.errorResolver, d.contractAddress, - "increaseRedemptionFee", + "notifyRedemptionSignatureTimedOut", &result, - _previousOutputValueBytes, - _newOutputValueBytes, ) return err } -func (d *Deposit) IncreaseRedemptionFeeGasEstimate( - _previousOutputValueBytes [8]uint8, - _newOutputValueBytes [8]uint8, -) (uint64, error) { +func (d *Deposit) NotifyRedemptionSignatureTimedOutGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "increaseRedemptionFee", + "notifyRedemptionSignatureTimedOut", d.contractABI, d.transactor, - _previousOutputValueBytes, - _newOutputValueBytes, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyCourtesyCall( +func (d *Deposit) WithdrawFunds( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyCourtesyCall", + "submitting transaction withdrawFunds", ) d.transactionMutex.Lock() @@ -2455,7 +2466,7 @@ func (d *Deposit) NotifyCourtesyCall( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyCourtesyCall( + transaction, err := d.contract.WithdrawFunds( transactorOptions, ) if err != nil { @@ -2463,12 +2474,12 @@ func (d *Deposit) NotifyCourtesyCall( err, d.transactorOptions.From, nil, - "notifyCourtesyCall", + "withdrawFunds", ) } dLogger.Infof( - "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2479,7 +2490,7 @@ func (d *Deposit) NotifyCourtesyCall( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyCourtesyCall( + transaction, err := d.contract.WithdrawFunds( transactorOptions, ) if err != nil { @@ -2487,12 +2498,12 @@ func (d *Deposit) NotifyCourtesyCall( err, d.transactorOptions.From, nil, - "notifyCourtesyCall", + "withdrawFunds", ) } dLogger.Infof( - "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2507,7 +2518,7 @@ func (d *Deposit) NotifyCourtesyCall( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyCourtesyCall( +func (d *Deposit) CallWithdrawFunds( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2519,20 +2530,20 @@ func (d *Deposit) CallNotifyCourtesyCall( d.caller, d.errorResolver, d.contractAddress, - "notifyCourtesyCall", + "withdrawFunds", &result, ) return err } -func (d *Deposit) NotifyCourtesyCallGasEstimate() (uint64, error) { +func (d *Deposit) WithdrawFundsGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyCourtesyCall", + "withdrawFunds", d.contractABI, d.transactor, ) @@ -2541,12 +2552,17 @@ func (d *Deposit) NotifyCourtesyCallGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) NotifyUndercollateralizedLiquidation( +func (d *Deposit) Initialize( + _factory common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyUndercollateralizedLiquidation", + "submitting transaction initialize", + "params: ", + fmt.Sprint( + _factory, + ), ) d.transactionMutex.Lock() @@ -2571,20 +2587,22 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyUndercollateralizedLiquidation( + transaction, err := d.contract.Initialize( transactorOptions, + _factory, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyUndercollateralizedLiquidation", + "initialize", + _factory, ) } dLogger.Infof( - "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction initialize with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2595,20 +2613,22 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyUndercollateralizedLiquidation( + transaction, err := d.contract.Initialize( transactorOptions, + _factory, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyUndercollateralizedLiquidation", + "initialize", + _factory, ) } dLogger.Infof( - "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction initialize with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2623,7 +2643,8 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyUndercollateralizedLiquidation( +func (d *Deposit) CallInitialize( + _factory common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2635,52 +2656,44 @@ func (d *Deposit) CallNotifyUndercollateralizedLiquidation( d.caller, d.errorResolver, d.contractAddress, - "notifyUndercollateralizedLiquidation", + "initialize", &result, + _factory, ) return err } -func (d *Deposit) NotifyUndercollateralizedLiquidationGasEstimate() (uint64, error) { +func (d *Deposit) InitializeGasEstimate( + _factory common.Address, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyUndercollateralizedLiquidation", + "initialize", d.contractABI, d.transactor, + _factory, ) return result, err } // Transaction submission. -func (d *Deposit) ProvideBTCFundingProof( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _fundingOutputIndex uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) RequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideBTCFundingProof", + "submitting transaction requestRedemption", "params: ", fmt.Sprint( - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _outputValueBytes, + _redeemerOutputScript, ), ) @@ -2706,36 +2719,24 @@ func (d *Deposit) ProvideBTCFundingProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideBTCFundingProof( + transaction, err := d.contract.RequestRedemption( transactorOptions, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _outputValueBytes, + _redeemerOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideBTCFundingProof", - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + "requestRedemption", + _outputValueBytes, + _redeemerOutputScript, ) } dLogger.Infof( - "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", + "submitted transaction requestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2746,36 +2747,24 @@ func (d *Deposit) ProvideBTCFundingProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideBTCFundingProof( + transaction, err := d.contract.RequestRedemption( transactorOptions, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _outputValueBytes, + _redeemerOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideBTCFundingProof", - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + "requestRedemption", + _outputValueBytes, + _redeemerOutputScript, ) } dLogger.Infof( - "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", + "submitted transaction requestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2790,15 +2779,9 @@ func (d *Deposit) ProvideBTCFundingProof( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideBTCFundingProof( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _fundingOutputIndex uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) CallRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2810,59 +2793,41 @@ func (d *Deposit) CallProvideBTCFundingProof( d.caller, d.errorResolver, d.contractAddress, - "provideBTCFundingProof", + "requestRedemption", &result, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _outputValueBytes, + _redeemerOutputScript, ) return err } -func (d *Deposit) ProvideBTCFundingProofGasEstimate( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _fundingOutputIndex uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) RequestRedemptionGasEstimate( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideBTCFundingProof", + "requestRedemption", d.contractABI, d.transactor, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _outputValueBytes, + _redeemerOutputScript, ) return result, err } // Transaction submission. -func (d *Deposit) RetrieveSignerPubkey( +func (d *Deposit) NotifySignerSetupFailed( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction retrieveSignerPubkey", + "submitting transaction notifySignerSetupFailed", ) d.transactionMutex.Lock() @@ -2887,7 +2852,7 @@ func (d *Deposit) RetrieveSignerPubkey( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.RetrieveSignerPubkey( + transaction, err := d.contract.NotifySignerSetupFailed( transactorOptions, ) if err != nil { @@ -2895,12 +2860,12 @@ func (d *Deposit) RetrieveSignerPubkey( err, d.transactorOptions.From, nil, - "retrieveSignerPubkey", + "notifySignerSetupFailed", ) } dLogger.Infof( - "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", + "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2911,7 +2876,7 @@ func (d *Deposit) RetrieveSignerPubkey( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.RetrieveSignerPubkey( + transaction, err := d.contract.NotifySignerSetupFailed( transactorOptions, ) if err != nil { @@ -2919,12 +2884,12 @@ func (d *Deposit) RetrieveSignerPubkey( err, d.transactorOptions.From, nil, - "retrieveSignerPubkey", + "notifySignerSetupFailed", ) } dLogger.Infof( - "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", + "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2939,7 +2904,7 @@ func (d *Deposit) RetrieveSignerPubkey( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallRetrieveSignerPubkey( +func (d *Deposit) CallNotifySignerSetupFailed( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2951,20 +2916,20 @@ func (d *Deposit) CallRetrieveSignerPubkey( d.caller, d.errorResolver, d.contractAddress, - "retrieveSignerPubkey", + "notifySignerSetupFailed", &result, ) return err } -func (d *Deposit) RetrieveSignerPubkeyGasEstimate() (uint64, error) { +func (d *Deposit) NotifySignerSetupFailedGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "retrieveSignerPubkey", + "notifySignerSetupFailed", d.contractABI, d.transactor, ) @@ -2973,21 +2938,29 @@ func (d *Deposit) RetrieveSignerPubkeyGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) TransferAndRequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, - _finalRecipient common.Address, +func (d *Deposit) InitializeDeposit( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, + value *big.Int, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction transferAndRequestRedemption", + "submitting transaction initializeDeposit", "params: ", fmt.Sprint( - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ), + "value: ", value, ) d.transactionMutex.Lock() @@ -2997,6 +2970,8 @@ func (d *Deposit) TransferAndRequestRedemption( transactorOptions := new(bind.TransactOpts) *transactorOptions = *d.transactorOptions + transactorOptions.Value = value + if len(transactionOptions) > 1 { return nil, fmt.Errorf( "could not process multiple transaction options sets", @@ -3012,26 +2987,32 @@ func (d *Deposit) TransferAndRequestRedemption( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.TransferAndRequestRedemption( + transaction, err := d.contract.InitializeDeposit( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, - nil, - "transferAndRequestRedemption", - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + value, + "initializeDeposit", + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) } dLogger.Infof( - "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", + "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3042,26 +3023,32 @@ func (d *Deposit) TransferAndRequestRedemption( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.TransferAndRequestRedemption( + transaction, err := d.contract.InitializeDeposit( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, - nil, - "transferAndRequestRedemption", - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + value, + "initializeDeposit", + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) } dLogger.Infof( - "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", + "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3076,47 +3063,60 @@ func (d *Deposit) TransferAndRequestRedemption( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallTransferAndRequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, - _finalRecipient common.Address, +func (d *Deposit) CallInitializeDeposit( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, + value *big.Int, blockNumber *big.Int, ) error { var result interface{} = nil err := ethutil.CallAtBlock( d.transactorOptions.From, - blockNumber, nil, + blockNumber, value, d.contractABI, d.caller, d.errorResolver, d.contractAddress, - "transferAndRequestRedemption", + "initializeDeposit", &result, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) return err } -func (d *Deposit) TransferAndRequestRedemptionGasEstimate( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, - _finalRecipient common.Address, +func (d *Deposit) InitializeDepositGasEstimate( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "transferAndRequestRedemption", + "initializeDeposit", d.contractABI, d.transactor, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) return result, err @@ -3124,9 +3124,9 @@ func (d *Deposit) TransferAndRequestRedemptionGasEstimate( // ----- Const Methods ------ -func (d *Deposit) CollateralizationPercentage() (*big.Int, error) { - var result *big.Int - result, err := d.contract.CollateralizationPercentage( +func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { + var result uint16 + result, err := d.contract.InitialCollateralizedPercent( d.callerOptions, ) @@ -3135,17 +3135,17 @@ func (d *Deposit) CollateralizationPercentage() (*big.Int, error) { err, d.callerOptions.From, nil, - "collateralizationPercentage", + "initialCollateralizedPercent", ) } return result, err } -func (d *Deposit) CollateralizationPercentageAtBlock( +func (d *Deposit) InitialCollateralizedPercentAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3155,20 +3155,17 @@ func (d *Deposit) CollateralizationPercentageAtBlock( d.caller, d.errorResolver, d.contractAddress, - "collateralizationPercentage", + "initialCollateralizedPercent", &result, ) return result, err } -func (d *Deposit) GetRedemptionTbtcRequirement( - _redeemer common.Address, -) (*big.Int, error) { +func (d *Deposit) LotSizeTbtc() (*big.Int, error) { var result *big.Int - result, err := d.contract.GetRedemptionTbtcRequirement( + result, err := d.contract.LotSizeTbtc( d.callerOptions, - _redeemer, ) if err != nil { @@ -3176,16 +3173,14 @@ func (d *Deposit) GetRedemptionTbtcRequirement( err, d.callerOptions.From, nil, - "getRedemptionTbtcRequirement", - _redeemer, + "lotSizeTbtc", ) } return result, err } -func (d *Deposit) GetRedemptionTbtcRequirementAtBlock( - _redeemer common.Address, +func (d *Deposit) LotSizeTbtcAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3198,17 +3193,16 @@ func (d *Deposit) GetRedemptionTbtcRequirementAtBlock( d.caller, d.errorResolver, d.contractAddress, - "getRedemptionTbtcRequirement", + "lotSizeTbtc", &result, - _redeemer, ) return result, err } -func (d *Deposit) InActive() (bool, error) { - var result bool - result, err := d.contract.InActive( +func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { + var result *big.Int + result, err := d.contract.SignerFeeTbtc( d.callerOptions, ) @@ -3217,17 +3211,17 @@ func (d *Deposit) InActive() (bool, error) { err, d.callerOptions.From, nil, - "inActive", + "signerFeeTbtc", ) } return result, err } -func (d *Deposit) InActiveAtBlock( +func (d *Deposit) SignerFeeTbtcAtBlock( blockNumber *big.Int, -) (bool, error) { - var result bool +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3237,16 +3231,16 @@ func (d *Deposit) InActiveAtBlock( d.caller, d.errorResolver, d.contractAddress, - "inActive", + "signerFeeTbtc", &result, ) return result, err } -func (d *Deposit) AuctionValue() (*big.Int, error) { +func (d *Deposit) WithdrawableAmount() (*big.Int, error) { var result *big.Int - result, err := d.contract.AuctionValue( + result, err := d.contract.WithdrawableAmount( d.callerOptions, ) @@ -3255,14 +3249,14 @@ func (d *Deposit) AuctionValue() (*big.Int, error) { err, d.callerOptions.From, nil, - "auctionValue", + "withdrawableAmount", ) } return result, err } -func (d *Deposit) AuctionValueAtBlock( +func (d *Deposit) WithdrawableAmountAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3275,22 +3269,16 @@ func (d *Deposit) AuctionValueAtBlock( d.caller, d.errorResolver, d.contractAddress, - "auctionValue", + "withdrawableAmount", &result, ) return result, err } -type fundingInfo struct { - UtxoValueBytes [8]uint8 - FundedAt *big.Int - UtxoOutpoint []uint8 -} - -func (d *Deposit) FundingInfo() (fundingInfo, error) { - var result fundingInfo - result, err := d.contract.FundingInfo( +func (d *Deposit) CollateralizationPercentage() (*big.Int, error) { + var result *big.Int + result, err := d.contract.CollateralizationPercentage( d.callerOptions, ) @@ -3299,17 +3287,17 @@ func (d *Deposit) FundingInfo() (fundingInfo, error) { err, d.callerOptions.From, nil, - "fundingInfo", + "collateralizationPercentage", ) } return result, err } -func (d *Deposit) FundingInfoAtBlock( +func (d *Deposit) CollateralizationPercentageAtBlock( blockNumber *big.Int, -) (fundingInfo, error) { - var result fundingInfo +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3319,17 +3307,20 @@ func (d *Deposit) FundingInfoAtBlock( d.caller, d.errorResolver, d.contractAddress, - "fundingInfo", + "collateralizationPercentage", &result, ) return result, err } -func (d *Deposit) RemainingTerm() (*big.Int, error) { +func (d *Deposit) GetOwnerRedemptionTbtcRequirement( + _redeemer common.Address, +) (*big.Int, error) { var result *big.Int - result, err := d.contract.RemainingTerm( + result, err := d.contract.GetOwnerRedemptionTbtcRequirement( d.callerOptions, + _redeemer, ) if err != nil { @@ -3337,14 +3328,16 @@ func (d *Deposit) RemainingTerm() (*big.Int, error) { err, d.callerOptions.From, nil, - "remainingTerm", + "getOwnerRedemptionTbtcRequirement", + _redeemer, ) } return result, err } -func (d *Deposit) RemainingTermAtBlock( +func (d *Deposit) GetOwnerRedemptionTbtcRequirementAtBlock( + _redeemer common.Address, blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3357,16 +3350,17 @@ func (d *Deposit) RemainingTermAtBlock( d.caller, d.errorResolver, d.contractAddress, - "remainingTerm", + "getOwnerRedemptionTbtcRequirement", &result, + _redeemer, ) return result, err } -func (d *Deposit) UndercollateralizedThresholdPercent() (uint16, error) { - var result uint16 - result, err := d.contract.UndercollateralizedThresholdPercent( +func (d *Deposit) LotSizeSatoshis() (uint64, error) { + var result uint64 + result, err := d.contract.LotSizeSatoshis( d.callerOptions, ) @@ -3375,17 +3369,17 @@ func (d *Deposit) UndercollateralizedThresholdPercent() (uint16, error) { err, d.callerOptions.From, nil, - "undercollateralizedThresholdPercent", + "lotSizeSatoshis", ) } return result, err } -func (d *Deposit) UndercollateralizedThresholdPercentAtBlock( +func (d *Deposit) LotSizeSatoshisAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (uint64, error) { + var result uint64 err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3395,16 +3389,16 @@ func (d *Deposit) UndercollateralizedThresholdPercentAtBlock( d.caller, d.errorResolver, d.contractAddress, - "undercollateralizedThresholdPercent", + "lotSizeSatoshis", &result, ) return result, err } -func (d *Deposit) WithdrawableAmount() (*big.Int, error) { +func (d *Deposit) AuctionValue() (*big.Int, error) { var result *big.Int - result, err := d.contract.WithdrawableAmount( + result, err := d.contract.AuctionValue( d.callerOptions, ) @@ -3413,14 +3407,14 @@ func (d *Deposit) WithdrawableAmount() (*big.Int, error) { err, d.callerOptions.From, nil, - "withdrawableAmount", + "auctionValue", ) } return result, err } -func (d *Deposit) WithdrawableAmountAtBlock( +func (d *Deposit) AuctionValueAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3433,16 +3427,16 @@ func (d *Deposit) WithdrawableAmountAtBlock( d.caller, d.errorResolver, d.contractAddress, - "withdrawableAmount", + "auctionValue", &result, ) return result, err } -func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { - var result *big.Int - result, err := d.contract.SignerFeeTbtc( +func (d *Deposit) UndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := d.contract.UndercollateralizedThresholdPercent( d.callerOptions, ) @@ -3451,17 +3445,17 @@ func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { err, d.callerOptions.From, nil, - "signerFeeTbtc", + "undercollateralizedThresholdPercent", ) } return result, err } -func (d *Deposit) SignerFeeTbtcAtBlock( +func (d *Deposit) UndercollateralizedThresholdPercentAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3471,16 +3465,16 @@ func (d *Deposit) SignerFeeTbtcAtBlock( d.caller, d.errorResolver, d.contractAddress, - "signerFeeTbtc", + "undercollateralizedThresholdPercent", &result, ) return result, err } -func (d *Deposit) UtxoValue() (*big.Int, error) { - var result *big.Int - result, err := d.contract.UtxoValue( +func (d *Deposit) InActive() (bool, error) { + var result bool + result, err := d.contract.InActive( d.callerOptions, ) @@ -3489,17 +3483,17 @@ func (d *Deposit) UtxoValue() (*big.Int, error) { err, d.callerOptions.From, nil, - "utxoValue", + "inActive", ) } return result, err } -func (d *Deposit) UtxoValueAtBlock( +func (d *Deposit) InActiveAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (bool, error) { + var result bool err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3509,16 +3503,22 @@ func (d *Deposit) UtxoValueAtBlock( d.caller, d.errorResolver, d.contractAddress, - "utxoValue", + "inActive", &result, ) return result, err } -func (d *Deposit) LotSizeSatoshis() (uint64, error) { - var result uint64 - result, err := d.contract.LotSizeSatoshis( +type fundingInfo struct { + UtxoValueBytes [8]uint8 + FundedAt *big.Int + UtxoOutpoint []uint8 +} + +func (d *Deposit) FundingInfo() (fundingInfo, error) { + var result fundingInfo + result, err := d.contract.FundingInfo( d.callerOptions, ) @@ -3527,17 +3527,17 @@ func (d *Deposit) LotSizeSatoshis() (uint64, error) { err, d.callerOptions.From, nil, - "lotSizeSatoshis", + "fundingInfo", ) } return result, err } -func (d *Deposit) LotSizeSatoshisAtBlock( +func (d *Deposit) FundingInfoAtBlock( blockNumber *big.Int, -) (uint64, error) { - var result uint64 +) (fundingInfo, error) { + var result fundingInfo err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3547,16 +3547,16 @@ func (d *Deposit) LotSizeSatoshisAtBlock( d.caller, d.errorResolver, d.contractAddress, - "lotSizeSatoshis", + "fundingInfo", &result, ) return result, err } -func (d *Deposit) LotSizeTbtc() (*big.Int, error) { +func (d *Deposit) RemainingTerm() (*big.Int, error) { var result *big.Int - result, err := d.contract.LotSizeTbtc( + result, err := d.contract.RemainingTerm( d.callerOptions, ) @@ -3565,14 +3565,14 @@ func (d *Deposit) LotSizeTbtc() (*big.Int, error) { err, d.callerOptions.From, nil, - "lotSizeTbtc", + "remainingTerm", ) } return result, err } -func (d *Deposit) LotSizeTbtcAtBlock( +func (d *Deposit) RemainingTermAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3585,18 +3585,18 @@ func (d *Deposit) LotSizeTbtcAtBlock( d.caller, d.errorResolver, d.contractAddress, - "lotSizeTbtc", + "remainingTerm", &result, ) return result, err } -func (d *Deposit) GetOwnerRedemptionTbtcRequirement( +func (d *Deposit) GetRedemptionTbtcRequirement( _redeemer common.Address, ) (*big.Int, error) { var result *big.Int - result, err := d.contract.GetOwnerRedemptionTbtcRequirement( + result, err := d.contract.GetRedemptionTbtcRequirement( d.callerOptions, _redeemer, ) @@ -3606,7 +3606,7 @@ func (d *Deposit) GetOwnerRedemptionTbtcRequirement( err, d.callerOptions.From, nil, - "getOwnerRedemptionTbtcRequirement", + "getRedemptionTbtcRequirement", _redeemer, ) } @@ -3614,7 +3614,7 @@ func (d *Deposit) GetOwnerRedemptionTbtcRequirement( return result, err } -func (d *Deposit) GetOwnerRedemptionTbtcRequirementAtBlock( +func (d *Deposit) GetRedemptionTbtcRequirementAtBlock( _redeemer common.Address, blockNumber *big.Int, ) (*big.Int, error) { @@ -3628,7 +3628,7 @@ func (d *Deposit) GetOwnerRedemptionTbtcRequirementAtBlock( d.caller, d.errorResolver, d.contractAddress, - "getOwnerRedemptionTbtcRequirement", + "getRedemptionTbtcRequirement", &result, _redeemer, ) @@ -3674,9 +3674,9 @@ func (d *Deposit) KeepAddressAtBlock( return result, err } -func (d *Deposit) CurrentState() (*big.Int, error) { +func (d *Deposit) UtxoValue() (*big.Int, error) { var result *big.Int - result, err := d.contract.CurrentState( + result, err := d.contract.UtxoValue( d.callerOptions, ) @@ -3685,14 +3685,14 @@ func (d *Deposit) CurrentState() (*big.Int, error) { err, d.callerOptions.From, nil, - "currentState", + "utxoValue", ) } return result, err } -func (d *Deposit) CurrentStateAtBlock( +func (d *Deposit) UtxoValueAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3705,16 +3705,16 @@ func (d *Deposit) CurrentStateAtBlock( d.caller, d.errorResolver, d.contractAddress, - "currentState", + "utxoValue", &result, ) return result, err } -func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { - var result uint16 - result, err := d.contract.InitialCollateralizedPercent( +func (d *Deposit) CurrentState() (*big.Int, error) { + var result *big.Int + result, err := d.contract.CurrentState( d.callerOptions, ) @@ -3723,17 +3723,17 @@ func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { err, d.callerOptions.From, nil, - "initialCollateralizedPercent", + "currentState", ) } return result, err } -func (d *Deposit) InitialCollateralizedPercentAtBlock( +func (d *Deposit) CurrentStateAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3743,7 +3743,7 @@ func (d *Deposit) InitialCollateralizedPercentAtBlock( d.caller, d.errorResolver, d.contractAddress, - "initialCollateralizedPercent", + "currentState", &result, ) diff --git a/go/contract/DepositLog.go b/go/contract/DepositLog.go deleted file mode 100644 index 9bc33d28f..000000000 --- a/go/contract/DepositLog.go +++ /dev/null @@ -1,3519 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package contract - -import ( - "fmt" - "math/big" - "strings" - "sync" - "time" - - ethereumabi "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/ipfs/go-log" - - "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" - "github.com/keep-network/keep-common/pkg/subscription" - "github.com/keep-network/tbtc/go/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 dlLogger = log.Logger("keep-contract-DepositLog") - -type DepositLog struct { - contract *abi.DepositLog - contractAddress common.Address - contractABI *ethereumabi.ABI - caller bind.ContractCaller - transactor bind.ContractTransactor - callerOptions *bind.CallOpts - transactorOptions *bind.TransactOpts - errorResolver *ethutil.ErrorResolver - nonceManager *ethutil.NonceManager - miningWaiter *ethutil.MiningWaiter - - transactionMutex *sync.Mutex -} - -func NewDepositLog( - contractAddress common.Address, - accountKey *keystore.Key, - backend bind.ContractBackend, - nonceManager *ethutil.NonceManager, - miningWaiter *ethutil.MiningWaiter, - transactionMutex *sync.Mutex, -) (*DepositLog, error) { - callerOptions := &bind.CallOpts{ - From: accountKey.Address, - } - - transactorOptions := bind.NewKeyedTransactor( - accountKey.PrivateKey, - ) - - randomBeaconContract, err := abi.NewDepositLog( - contractAddress, - backend, - ) - if err != nil { - return nil, fmt.Errorf( - "failed to instantiate contract at address: %s [%v]", - contractAddress.String(), - err, - ) - } - - contractABI, err := ethereumabi.JSON(strings.NewReader(abi.DepositLogABI)) - if err != nil { - return nil, fmt.Errorf("failed to instantiate ABI: [%v]", err) - } - - return &DepositLog{ - contract: randomBeaconContract, - contractAddress: contractAddress, - contractABI: &contractABI, - caller: backend, - transactor: backend, - callerOptions: callerOptions, - transactorOptions: transactorOptions, - errorResolver: ethutil.NewErrorResolver(backend, &contractABI, &contractAddress), - nonceManager: nonceManager, - miningWaiter: miningWaiter, - transactionMutex: transactionMutex, - }, nil -} - -// ----- Non-const Methods ------ - -// Transaction submission. -func (dl *DepositLog) LogCourtesyCalled( - - transactionOptions ...ethutil.TransactionOptions, -) (*types.Transaction, error) { - dlLogger.Debug( - "submitting transaction logCourtesyCalled", - ) - - dl.transactionMutex.Lock() - defer dl.transactionMutex.Unlock() - - // create a copy - transactorOptions := new(bind.TransactOpts) - *transactorOptions = *dl.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 := dl.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 := dl.contract.LogCourtesyCalled( - transactorOptions, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logCourtesyCalled", - ) - } - - dlLogger.Infof( - "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - go dl.miningWaiter.ForceMining( - transaction, - func(newGasPrice *big.Int) (*types.Transaction, error) { - transactorOptions.GasLimit = transaction.Gas() - transactorOptions.GasPrice = newGasPrice - - transaction, err := dl.contract.LogCourtesyCalled( - transactorOptions, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logCourtesyCalled", - ) - } - - dlLogger.Infof( - "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - return transaction, nil - }, - ) - - dl.nonceManager.IncrementNonce() - - return transaction, err -} - -// Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogCourtesyCalled( - blockNumber *big.Int, -) error { - var result interface{} = nil - - err := ethutil.CallAtBlock( - dl.transactorOptions.From, - blockNumber, nil, - dl.contractABI, - dl.caller, - dl.errorResolver, - dl.contractAddress, - "logCourtesyCalled", - &result, - ) - - return err -} - -func (dl *DepositLog) LogCourtesyCalledGasEstimate() (uint64, error) { - var result uint64 - - result, err := ethutil.EstimateGas( - dl.callerOptions.From, - dl.contractAddress, - "logCourtesyCalled", - dl.contractABI, - dl.transactor, - ) - - return result, err -} - -// Transaction submission. -func (dl *DepositLog) LogExitedCourtesyCall( - - transactionOptions ...ethutil.TransactionOptions, -) (*types.Transaction, error) { - dlLogger.Debug( - "submitting transaction logExitedCourtesyCall", - ) - - dl.transactionMutex.Lock() - defer dl.transactionMutex.Unlock() - - // create a copy - transactorOptions := new(bind.TransactOpts) - *transactorOptions = *dl.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 := dl.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 := dl.contract.LogExitedCourtesyCall( - transactorOptions, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logExitedCourtesyCall", - ) - } - - dlLogger.Infof( - "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - go dl.miningWaiter.ForceMining( - transaction, - func(newGasPrice *big.Int) (*types.Transaction, error) { - transactorOptions.GasLimit = transaction.Gas() - transactorOptions.GasPrice = newGasPrice - - transaction, err := dl.contract.LogExitedCourtesyCall( - transactorOptions, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logExitedCourtesyCall", - ) - } - - dlLogger.Infof( - "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - return transaction, nil - }, - ) - - dl.nonceManager.IncrementNonce() - - return transaction, err -} - -// Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogExitedCourtesyCall( - blockNumber *big.Int, -) error { - var result interface{} = nil - - err := ethutil.CallAtBlock( - dl.transactorOptions.From, - blockNumber, nil, - dl.contractABI, - dl.caller, - dl.errorResolver, - dl.contractAddress, - "logExitedCourtesyCall", - &result, - ) - - return err -} - -func (dl *DepositLog) LogExitedCourtesyCallGasEstimate() (uint64, error) { - var result uint64 - - result, err := ethutil.EstimateGas( - dl.callerOptions.From, - dl.contractAddress, - "logExitedCourtesyCall", - dl.contractABI, - dl.transactor, - ) - - return result, err -} - -// Transaction submission. -func (dl *DepositLog) LogGotRedemptionSignature( - _digest [32]uint8, - _r [32]uint8, - _s [32]uint8, - - transactionOptions ...ethutil.TransactionOptions, -) (*types.Transaction, error) { - dlLogger.Debug( - "submitting transaction logGotRedemptionSignature", - "params: ", - fmt.Sprint( - _digest, - _r, - _s, - ), - ) - - dl.transactionMutex.Lock() - defer dl.transactionMutex.Unlock() - - // create a copy - transactorOptions := new(bind.TransactOpts) - *transactorOptions = *dl.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 := dl.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 := dl.contract.LogGotRedemptionSignature( - transactorOptions, - _digest, - _r, - _s, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logGotRedemptionSignature", - _digest, - _r, - _s, - ) - } - - dlLogger.Infof( - "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - go dl.miningWaiter.ForceMining( - transaction, - func(newGasPrice *big.Int) (*types.Transaction, error) { - transactorOptions.GasLimit = transaction.Gas() - transactorOptions.GasPrice = newGasPrice - - transaction, err := dl.contract.LogGotRedemptionSignature( - transactorOptions, - _digest, - _r, - _s, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logGotRedemptionSignature", - _digest, - _r, - _s, - ) - } - - dlLogger.Infof( - "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - return transaction, nil - }, - ) - - dl.nonceManager.IncrementNonce() - - return transaction, err -} - -// Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogGotRedemptionSignature( - _digest [32]uint8, - _r [32]uint8, - _s [32]uint8, - blockNumber *big.Int, -) error { - var result interface{} = nil - - err := ethutil.CallAtBlock( - dl.transactorOptions.From, - blockNumber, nil, - dl.contractABI, - dl.caller, - dl.errorResolver, - dl.contractAddress, - "logGotRedemptionSignature", - &result, - _digest, - _r, - _s, - ) - - return err -} - -func (dl *DepositLog) LogGotRedemptionSignatureGasEstimate( - _digest [32]uint8, - _r [32]uint8, - _s [32]uint8, -) (uint64, error) { - var result uint64 - - result, err := ethutil.EstimateGas( - dl.callerOptions.From, - dl.contractAddress, - "logGotRedemptionSignature", - dl.contractABI, - dl.transactor, - _digest, - _r, - _s, - ) - - return result, err -} - -// Transaction submission. -func (dl *DepositLog) LogRedemptionRequested( - _requester common.Address, - _digest [32]uint8, - _utxoValue *big.Int, - _redeemerOutputScript []uint8, - _requestedFee *big.Int, - _outpoint []uint8, - - transactionOptions ...ethutil.TransactionOptions, -) (*types.Transaction, error) { - dlLogger.Debug( - "submitting transaction logRedemptionRequested", - "params: ", - fmt.Sprint( - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, - ), - ) - - dl.transactionMutex.Lock() - defer dl.transactionMutex.Unlock() - - // create a copy - transactorOptions := new(bind.TransactOpts) - *transactorOptions = *dl.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 := dl.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 := dl.contract.LogRedemptionRequested( - transactorOptions, - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logRedemptionRequested", - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, - ) - } - - dlLogger.Infof( - "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - go dl.miningWaiter.ForceMining( - transaction, - func(newGasPrice *big.Int) (*types.Transaction, error) { - transactorOptions.GasLimit = transaction.Gas() - transactorOptions.GasPrice = newGasPrice - - transaction, err := dl.contract.LogRedemptionRequested( - transactorOptions, - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logRedemptionRequested", - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, - ) - } - - dlLogger.Infof( - "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - return transaction, nil - }, - ) - - dl.nonceManager.IncrementNonce() - - return transaction, err -} - -// Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogRedemptionRequested( - _requester common.Address, - _digest [32]uint8, - _utxoValue *big.Int, - _redeemerOutputScript []uint8, - _requestedFee *big.Int, - _outpoint []uint8, - blockNumber *big.Int, -) error { - var result interface{} = nil - - err := ethutil.CallAtBlock( - dl.transactorOptions.From, - blockNumber, nil, - dl.contractABI, - dl.caller, - dl.errorResolver, - dl.contractAddress, - "logRedemptionRequested", - &result, - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, - ) - - return err -} - -func (dl *DepositLog) LogRedemptionRequestedGasEstimate( - _requester common.Address, - _digest [32]uint8, - _utxoValue *big.Int, - _redeemerOutputScript []uint8, - _requestedFee *big.Int, - _outpoint []uint8, -) (uint64, error) { - var result uint64 - - result, err := ethutil.EstimateGas( - dl.callerOptions.From, - dl.contractAddress, - "logRedemptionRequested", - dl.contractABI, - dl.transactor, - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, - ) - - return result, err -} - -// Transaction submission. -func (dl *DepositLog) LogRegisteredPubkey( - _signingGroupPubkeyX [32]uint8, - _signingGroupPubkeyY [32]uint8, - - transactionOptions ...ethutil.TransactionOptions, -) (*types.Transaction, error) { - dlLogger.Debug( - "submitting transaction logRegisteredPubkey", - "params: ", - fmt.Sprint( - _signingGroupPubkeyX, - _signingGroupPubkeyY, - ), - ) - - dl.transactionMutex.Lock() - defer dl.transactionMutex.Unlock() - - // create a copy - transactorOptions := new(bind.TransactOpts) - *transactorOptions = *dl.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 := dl.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 := dl.contract.LogRegisteredPubkey( - transactorOptions, - _signingGroupPubkeyX, - _signingGroupPubkeyY, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logRegisteredPubkey", - _signingGroupPubkeyX, - _signingGroupPubkeyY, - ) - } - - dlLogger.Infof( - "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - go dl.miningWaiter.ForceMining( - transaction, - func(newGasPrice *big.Int) (*types.Transaction, error) { - transactorOptions.GasLimit = transaction.Gas() - transactorOptions.GasPrice = newGasPrice - - transaction, err := dl.contract.LogRegisteredPubkey( - transactorOptions, - _signingGroupPubkeyX, - _signingGroupPubkeyY, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logRegisteredPubkey", - _signingGroupPubkeyX, - _signingGroupPubkeyY, - ) - } - - dlLogger.Infof( - "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - return transaction, nil - }, - ) - - dl.nonceManager.IncrementNonce() - - return transaction, err -} - -// Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogRegisteredPubkey( - _signingGroupPubkeyX [32]uint8, - _signingGroupPubkeyY [32]uint8, - blockNumber *big.Int, -) error { - var result interface{} = nil - - err := ethutil.CallAtBlock( - dl.transactorOptions.From, - blockNumber, nil, - dl.contractABI, - dl.caller, - dl.errorResolver, - dl.contractAddress, - "logRegisteredPubkey", - &result, - _signingGroupPubkeyX, - _signingGroupPubkeyY, - ) - - return err -} - -func (dl *DepositLog) LogRegisteredPubkeyGasEstimate( - _signingGroupPubkeyX [32]uint8, - _signingGroupPubkeyY [32]uint8, -) (uint64, error) { - var result uint64 - - result, err := ethutil.EstimateGas( - dl.callerOptions.From, - dl.contractAddress, - "logRegisteredPubkey", - dl.contractABI, - dl.transactor, - _signingGroupPubkeyX, - _signingGroupPubkeyY, - ) - - return result, err -} - -// Transaction submission. -func (dl *DepositLog) LogCreated( - _keepAddress common.Address, - - transactionOptions ...ethutil.TransactionOptions, -) (*types.Transaction, error) { - dlLogger.Debug( - "submitting transaction logCreated", - "params: ", - fmt.Sprint( - _keepAddress, - ), - ) - - dl.transactionMutex.Lock() - defer dl.transactionMutex.Unlock() - - // create a copy - transactorOptions := new(bind.TransactOpts) - *transactorOptions = *dl.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 := dl.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 := dl.contract.LogCreated( - transactorOptions, - _keepAddress, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logCreated", - _keepAddress, - ) - } - - dlLogger.Infof( - "submitted transaction logCreated with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - go dl.miningWaiter.ForceMining( - transaction, - func(newGasPrice *big.Int) (*types.Transaction, error) { - transactorOptions.GasLimit = transaction.Gas() - transactorOptions.GasPrice = newGasPrice - - transaction, err := dl.contract.LogCreated( - transactorOptions, - _keepAddress, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logCreated", - _keepAddress, - ) - } - - dlLogger.Infof( - "submitted transaction logCreated with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - return transaction, nil - }, - ) - - dl.nonceManager.IncrementNonce() - - return transaction, err -} - -// Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogCreated( - _keepAddress common.Address, - blockNumber *big.Int, -) error { - var result interface{} = nil - - err := ethutil.CallAtBlock( - dl.transactorOptions.From, - blockNumber, nil, - dl.contractABI, - dl.caller, - dl.errorResolver, - dl.contractAddress, - "logCreated", - &result, - _keepAddress, - ) - - return err -} - -func (dl *DepositLog) LogCreatedGasEstimate( - _keepAddress common.Address, -) (uint64, error) { - var result uint64 - - result, err := ethutil.EstimateGas( - dl.callerOptions.From, - dl.contractAddress, - "logCreated", - dl.contractABI, - dl.transactor, - _keepAddress, - ) - - return result, err -} - -// Transaction submission. -func (dl *DepositLog) LogFraudDuringSetup( - - transactionOptions ...ethutil.TransactionOptions, -) (*types.Transaction, error) { - dlLogger.Debug( - "submitting transaction logFraudDuringSetup", - ) - - dl.transactionMutex.Lock() - defer dl.transactionMutex.Unlock() - - // create a copy - transactorOptions := new(bind.TransactOpts) - *transactorOptions = *dl.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 := dl.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 := dl.contract.LogFraudDuringSetup( - transactorOptions, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logFraudDuringSetup", - ) - } - - dlLogger.Infof( - "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - go dl.miningWaiter.ForceMining( - transaction, - func(newGasPrice *big.Int) (*types.Transaction, error) { - transactorOptions.GasLimit = transaction.Gas() - transactorOptions.GasPrice = newGasPrice - - transaction, err := dl.contract.LogFraudDuringSetup( - transactorOptions, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logFraudDuringSetup", - ) - } - - dlLogger.Infof( - "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - return transaction, nil - }, - ) - - dl.nonceManager.IncrementNonce() - - return transaction, err -} - -// Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogFraudDuringSetup( - blockNumber *big.Int, -) error { - var result interface{} = nil - - err := ethutil.CallAtBlock( - dl.transactorOptions.From, - blockNumber, nil, - dl.contractABI, - dl.caller, - dl.errorResolver, - dl.contractAddress, - "logFraudDuringSetup", - &result, - ) - - return err -} - -func (dl *DepositLog) LogFraudDuringSetupGasEstimate() (uint64, error) { - var result uint64 - - result, err := ethutil.EstimateGas( - dl.callerOptions.From, - dl.contractAddress, - "logFraudDuringSetup", - dl.contractABI, - dl.transactor, - ) - - return result, err -} - -// Transaction submission. -func (dl *DepositLog) LogFunded( - _txid [32]uint8, - - transactionOptions ...ethutil.TransactionOptions, -) (*types.Transaction, error) { - dlLogger.Debug( - "submitting transaction logFunded", - "params: ", - fmt.Sprint( - _txid, - ), - ) - - dl.transactionMutex.Lock() - defer dl.transactionMutex.Unlock() - - // create a copy - transactorOptions := new(bind.TransactOpts) - *transactorOptions = *dl.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 := dl.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 := dl.contract.LogFunded( - transactorOptions, - _txid, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logFunded", - _txid, - ) - } - - dlLogger.Infof( - "submitted transaction logFunded with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - go dl.miningWaiter.ForceMining( - transaction, - func(newGasPrice *big.Int) (*types.Transaction, error) { - transactorOptions.GasLimit = transaction.Gas() - transactorOptions.GasPrice = newGasPrice - - transaction, err := dl.contract.LogFunded( - transactorOptions, - _txid, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logFunded", - _txid, - ) - } - - dlLogger.Infof( - "submitted transaction logFunded with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - return transaction, nil - }, - ) - - dl.nonceManager.IncrementNonce() - - return transaction, err -} - -// Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogFunded( - _txid [32]uint8, - blockNumber *big.Int, -) error { - var result interface{} = nil - - err := ethutil.CallAtBlock( - dl.transactorOptions.From, - blockNumber, nil, - dl.contractABI, - dl.caller, - dl.errorResolver, - dl.contractAddress, - "logFunded", - &result, - _txid, - ) - - return err -} - -func (dl *DepositLog) LogFundedGasEstimate( - _txid [32]uint8, -) (uint64, error) { - var result uint64 - - result, err := ethutil.EstimateGas( - dl.callerOptions.From, - dl.contractAddress, - "logFunded", - dl.contractABI, - dl.transactor, - _txid, - ) - - return result, err -} - -// Transaction submission. -func (dl *DepositLog) LogRedeemed( - _txid [32]uint8, - - transactionOptions ...ethutil.TransactionOptions, -) (*types.Transaction, error) { - dlLogger.Debug( - "submitting transaction logRedeemed", - "params: ", - fmt.Sprint( - _txid, - ), - ) - - dl.transactionMutex.Lock() - defer dl.transactionMutex.Unlock() - - // create a copy - transactorOptions := new(bind.TransactOpts) - *transactorOptions = *dl.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 := dl.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 := dl.contract.LogRedeemed( - transactorOptions, - _txid, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logRedeemed", - _txid, - ) - } - - dlLogger.Infof( - "submitted transaction logRedeemed with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - go dl.miningWaiter.ForceMining( - transaction, - func(newGasPrice *big.Int) (*types.Transaction, error) { - transactorOptions.GasLimit = transaction.Gas() - transactorOptions.GasPrice = newGasPrice - - transaction, err := dl.contract.LogRedeemed( - transactorOptions, - _txid, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logRedeemed", - _txid, - ) - } - - dlLogger.Infof( - "submitted transaction logRedeemed with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - return transaction, nil - }, - ) - - dl.nonceManager.IncrementNonce() - - return transaction, err -} - -// Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogRedeemed( - _txid [32]uint8, - blockNumber *big.Int, -) error { - var result interface{} = nil - - err := ethutil.CallAtBlock( - dl.transactorOptions.From, - blockNumber, nil, - dl.contractABI, - dl.caller, - dl.errorResolver, - dl.contractAddress, - "logRedeemed", - &result, - _txid, - ) - - return err -} - -func (dl *DepositLog) LogRedeemedGasEstimate( - _txid [32]uint8, -) (uint64, error) { - var result uint64 - - result, err := ethutil.EstimateGas( - dl.callerOptions.From, - dl.contractAddress, - "logRedeemed", - dl.contractABI, - dl.transactor, - _txid, - ) - - return result, err -} - -// Transaction submission. -func (dl *DepositLog) LogSetupFailed( - - transactionOptions ...ethutil.TransactionOptions, -) (*types.Transaction, error) { - dlLogger.Debug( - "submitting transaction logSetupFailed", - ) - - dl.transactionMutex.Lock() - defer dl.transactionMutex.Unlock() - - // create a copy - transactorOptions := new(bind.TransactOpts) - *transactorOptions = *dl.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 := dl.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 := dl.contract.LogSetupFailed( - transactorOptions, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logSetupFailed", - ) - } - - dlLogger.Infof( - "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - go dl.miningWaiter.ForceMining( - transaction, - func(newGasPrice *big.Int) (*types.Transaction, error) { - transactorOptions.GasLimit = transaction.Gas() - transactorOptions.GasPrice = newGasPrice - - transaction, err := dl.contract.LogSetupFailed( - transactorOptions, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logSetupFailed", - ) - } - - dlLogger.Infof( - "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - return transaction, nil - }, - ) - - dl.nonceManager.IncrementNonce() - - return transaction, err -} - -// Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogSetupFailed( - blockNumber *big.Int, -) error { - var result interface{} = nil - - err := ethutil.CallAtBlock( - dl.transactorOptions.From, - blockNumber, nil, - dl.contractABI, - dl.caller, - dl.errorResolver, - dl.contractAddress, - "logSetupFailed", - &result, - ) - - return err -} - -func (dl *DepositLog) LogSetupFailedGasEstimate() (uint64, error) { - var result uint64 - - result, err := ethutil.EstimateGas( - dl.callerOptions.From, - dl.contractAddress, - "logSetupFailed", - dl.contractABI, - dl.transactor, - ) - - return result, err -} - -// Transaction submission. -func (dl *DepositLog) LogFunderRequestedAbort( - _abortOutputScript []uint8, - - transactionOptions ...ethutil.TransactionOptions, -) (*types.Transaction, error) { - dlLogger.Debug( - "submitting transaction logFunderRequestedAbort", - "params: ", - fmt.Sprint( - _abortOutputScript, - ), - ) - - dl.transactionMutex.Lock() - defer dl.transactionMutex.Unlock() - - // create a copy - transactorOptions := new(bind.TransactOpts) - *transactorOptions = *dl.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 := dl.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 := dl.contract.LogFunderRequestedAbort( - transactorOptions, - _abortOutputScript, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logFunderRequestedAbort", - _abortOutputScript, - ) - } - - dlLogger.Infof( - "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - go dl.miningWaiter.ForceMining( - transaction, - func(newGasPrice *big.Int) (*types.Transaction, error) { - transactorOptions.GasLimit = transaction.Gas() - transactorOptions.GasPrice = newGasPrice - - transaction, err := dl.contract.LogFunderRequestedAbort( - transactorOptions, - _abortOutputScript, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logFunderRequestedAbort", - _abortOutputScript, - ) - } - - dlLogger.Infof( - "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - return transaction, nil - }, - ) - - dl.nonceManager.IncrementNonce() - - return transaction, err -} - -// Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogFunderRequestedAbort( - _abortOutputScript []uint8, - blockNumber *big.Int, -) error { - var result interface{} = nil - - err := ethutil.CallAtBlock( - dl.transactorOptions.From, - blockNumber, nil, - dl.contractABI, - dl.caller, - dl.errorResolver, - dl.contractAddress, - "logFunderRequestedAbort", - &result, - _abortOutputScript, - ) - - return err -} - -func (dl *DepositLog) LogFunderRequestedAbortGasEstimate( - _abortOutputScript []uint8, -) (uint64, error) { - var result uint64 - - result, err := ethutil.EstimateGas( - dl.callerOptions.From, - dl.contractAddress, - "logFunderRequestedAbort", - dl.contractABI, - dl.transactor, - _abortOutputScript, - ) - - return result, err -} - -// Transaction submission. -func (dl *DepositLog) LogLiquidated( - - transactionOptions ...ethutil.TransactionOptions, -) (*types.Transaction, error) { - dlLogger.Debug( - "submitting transaction logLiquidated", - ) - - dl.transactionMutex.Lock() - defer dl.transactionMutex.Unlock() - - // create a copy - transactorOptions := new(bind.TransactOpts) - *transactorOptions = *dl.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 := dl.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 := dl.contract.LogLiquidated( - transactorOptions, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logLiquidated", - ) - } - - dlLogger.Infof( - "submitted transaction logLiquidated with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - go dl.miningWaiter.ForceMining( - transaction, - func(newGasPrice *big.Int) (*types.Transaction, error) { - transactorOptions.GasLimit = transaction.Gas() - transactorOptions.GasPrice = newGasPrice - - transaction, err := dl.contract.LogLiquidated( - transactorOptions, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logLiquidated", - ) - } - - dlLogger.Infof( - "submitted transaction logLiquidated with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - return transaction, nil - }, - ) - - dl.nonceManager.IncrementNonce() - - return transaction, err -} - -// Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogLiquidated( - blockNumber *big.Int, -) error { - var result interface{} = nil - - err := ethutil.CallAtBlock( - dl.transactorOptions.From, - blockNumber, nil, - dl.contractABI, - dl.caller, - dl.errorResolver, - dl.contractAddress, - "logLiquidated", - &result, - ) - - return err -} - -func (dl *DepositLog) LogLiquidatedGasEstimate() (uint64, error) { - var result uint64 - - result, err := ethutil.EstimateGas( - dl.callerOptions.From, - dl.contractAddress, - "logLiquidated", - dl.contractABI, - dl.transactor, - ) - - return result, err -} - -// Transaction submission. -func (dl *DepositLog) LogStartedLiquidation( - _wasFraud bool, - - transactionOptions ...ethutil.TransactionOptions, -) (*types.Transaction, error) { - dlLogger.Debug( - "submitting transaction logStartedLiquidation", - "params: ", - fmt.Sprint( - _wasFraud, - ), - ) - - dl.transactionMutex.Lock() - defer dl.transactionMutex.Unlock() - - // create a copy - transactorOptions := new(bind.TransactOpts) - *transactorOptions = *dl.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 := dl.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 := dl.contract.LogStartedLiquidation( - transactorOptions, - _wasFraud, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logStartedLiquidation", - _wasFraud, - ) - } - - dlLogger.Infof( - "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - go dl.miningWaiter.ForceMining( - transaction, - func(newGasPrice *big.Int) (*types.Transaction, error) { - transactorOptions.GasLimit = transaction.Gas() - transactorOptions.GasPrice = newGasPrice - - transaction, err := dl.contract.LogStartedLiquidation( - transactorOptions, - _wasFraud, - ) - if err != nil { - return transaction, dl.errorResolver.ResolveError( - err, - dl.transactorOptions.From, - nil, - "logStartedLiquidation", - _wasFraud, - ) - } - - dlLogger.Infof( - "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - return transaction, nil - }, - ) - - dl.nonceManager.IncrementNonce() - - return transaction, err -} - -// Non-mutating call, not a transaction submission. -func (dl *DepositLog) CallLogStartedLiquidation( - _wasFraud bool, - blockNumber *big.Int, -) error { - var result interface{} = nil - - err := ethutil.CallAtBlock( - dl.transactorOptions.From, - blockNumber, nil, - dl.contractABI, - dl.caller, - dl.errorResolver, - dl.contractAddress, - "logStartedLiquidation", - &result, - _wasFraud, - ) - - return err -} - -func (dl *DepositLog) LogStartedLiquidationGasEstimate( - _wasFraud bool, -) (uint64, error) { - var result uint64 - - result, err := ethutil.EstimateGas( - dl.callerOptions.From, - dl.contractAddress, - "logStartedLiquidation", - dl.contractABI, - dl.transactor, - _wasFraud, - ) - - return result, err -} - -// ----- Const Methods ------ - -func (dl *DepositLog) ApprovedToLog( - _caller common.Address, -) (bool, error) { - var result bool - result, err := dl.contract.ApprovedToLog( - dl.callerOptions, - _caller, - ) - - if err != nil { - return result, dl.errorResolver.ResolveError( - err, - dl.callerOptions.From, - nil, - "approvedToLog", - _caller, - ) - } - - return result, err -} - -func (dl *DepositLog) ApprovedToLogAtBlock( - _caller common.Address, - blockNumber *big.Int, -) (bool, error) { - var result bool - - err := ethutil.CallAtBlock( - dl.callerOptions.From, - blockNumber, - nil, - dl.contractABI, - dl.caller, - dl.errorResolver, - dl.contractAddress, - "approvedToLog", - &result, - _caller, - ) - - return result, err -} - -// ------ Events ------- - -type depositLogLiquidatedFunc func( - DepositContractAddress common.Address, - Timestamp *big.Int, - blockNumber uint64, -) - -func (dl *DepositLog) WatchLiquidated( - success depositLogLiquidatedFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, -) (subscription.EventSubscription, error) { - errorChan := make(chan error) - unsubscribeChan := make(chan struct{}) - - // Delay which must be preserved before a new resubscription attempt. - // There is no sense to resubscribe immediately after the fail of current - // subscription because the publisher must have some time to recover. - retryDelay := 5 * time.Second - - watch := func() { - failCallback := func(err error) error { - fail(err) - errorChan <- err // trigger resubscription signal - return err - } - - subscription, err := dl.subscribeLiquidated( - success, - failCallback, - _depositContractAddressFilter, - ) - if err != nil { - errorChan <- err // trigger resubscription signal - return - } - - // wait for unsubscription signal - <-unsubscribeChan - subscription.Unsubscribe() - } - - // trigger the resubscriber goroutine - go func() { - go watch() // trigger first subscription - - for { - select { - case <-errorChan: - dlLogger.Warning( - "subscription to event Liquidated terminated with error; " + - "resubscription attempt will be performed after the retry delay", - ) - time.Sleep(retryDelay) - go watch() - case <-unsubscribeChan: - // shutdown the resubscriber goroutine on unsubscribe signal - return - } - } - }() - - // closing the unsubscribeChan will trigger a unsubscribe signal and - // run unsubscription for all subscription instances - unsubscribeCallback := func() { - close(unsubscribeChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -func (dl *DepositLog) subscribeLiquidated( - success depositLogLiquidatedFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, -) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogLiquidated) - eventSubscription, err := dl.contract.WatchLiquidated( - nil, - eventChan, - _depositContractAddressFilter, - ) - if err != nil { - close(eventChan) - return eventSubscription, fmt.Errorf( - "error creating watch for Liquidated events: [%v]", - err, - ) - } - - var subscriptionMutex = &sync.Mutex{} - - go func() { - for { - select { - case event, subscribed := <-eventChan: - subscriptionMutex.Lock() - // if eventChan has been closed, it means we have unsubscribed - if !subscribed { - subscriptionMutex.Unlock() - return - } - success( - event.DepositContractAddress, - event.Timestamp, - event.Raw.BlockNumber, - ) - subscriptionMutex.Unlock() - case ee := <-eventSubscription.Err(): - fail(ee) - return - } - } - }() - - unsubscribeCallback := func() { - subscriptionMutex.Lock() - defer subscriptionMutex.Unlock() - - eventSubscription.Unsubscribe() - close(eventChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -type depositLogRedeemedFunc func( - DepositContractAddress common.Address, - Txid [32]uint8, - Timestamp *big.Int, - blockNumber uint64, -) - -func (dl *DepositLog) WatchRedeemed( - success depositLogRedeemedFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, - _txidFilter [][32]uint8, -) (subscription.EventSubscription, error) { - errorChan := make(chan error) - unsubscribeChan := make(chan struct{}) - - // Delay which must be preserved before a new resubscription attempt. - // There is no sense to resubscribe immediately after the fail of current - // subscription because the publisher must have some time to recover. - retryDelay := 5 * time.Second - - watch := func() { - failCallback := func(err error) error { - fail(err) - errorChan <- err // trigger resubscription signal - return err - } - - subscription, err := dl.subscribeRedeemed( - success, - failCallback, - _depositContractAddressFilter, - _txidFilter, - ) - if err != nil { - errorChan <- err // trigger resubscription signal - return - } - - // wait for unsubscription signal - <-unsubscribeChan - subscription.Unsubscribe() - } - - // trigger the resubscriber goroutine - go func() { - go watch() // trigger first subscription - - for { - select { - case <-errorChan: - dlLogger.Warning( - "subscription to event Redeemed terminated with error; " + - "resubscription attempt will be performed after the retry delay", - ) - time.Sleep(retryDelay) - go watch() - case <-unsubscribeChan: - // shutdown the resubscriber goroutine on unsubscribe signal - return - } - } - }() - - // closing the unsubscribeChan will trigger a unsubscribe signal and - // run unsubscription for all subscription instances - unsubscribeCallback := func() { - close(unsubscribeChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -func (dl *DepositLog) subscribeRedeemed( - success depositLogRedeemedFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, - _txidFilter [][32]uint8, -) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogRedeemed) - eventSubscription, err := dl.contract.WatchRedeemed( - nil, - eventChan, - _depositContractAddressFilter, - _txidFilter, - ) - if err != nil { - close(eventChan) - return eventSubscription, fmt.Errorf( - "error creating watch for Redeemed events: [%v]", - err, - ) - } - - var subscriptionMutex = &sync.Mutex{} - - go func() { - for { - select { - case event, subscribed := <-eventChan: - subscriptionMutex.Lock() - // if eventChan has been closed, it means we have unsubscribed - if !subscribed { - subscriptionMutex.Unlock() - return - } - success( - event.DepositContractAddress, - event.Txid, - event.Timestamp, - event.Raw.BlockNumber, - ) - subscriptionMutex.Unlock() - case ee := <-eventSubscription.Err(): - fail(ee) - return - } - } - }() - - unsubscribeCallback := func() { - subscriptionMutex.Lock() - defer subscriptionMutex.Unlock() - - eventSubscription.Unsubscribe() - close(eventChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -type depositLogRedemptionRequestedFunc func( - DepositContractAddress common.Address, - Requester common.Address, - Digest [32]uint8, - UtxoValue *big.Int, - RedeemerOutputScript []uint8, - RequestedFee *big.Int, - Outpoint []uint8, - blockNumber uint64, -) - -func (dl *DepositLog) WatchRedemptionRequested( - success depositLogRedemptionRequestedFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, - _requesterFilter []common.Address, - _digestFilter [][32]uint8, -) (subscription.EventSubscription, error) { - errorChan := make(chan error) - unsubscribeChan := make(chan struct{}) - - // Delay which must be preserved before a new resubscription attempt. - // There is no sense to resubscribe immediately after the fail of current - // subscription because the publisher must have some time to recover. - retryDelay := 5 * time.Second - - watch := func() { - failCallback := func(err error) error { - fail(err) - errorChan <- err // trigger resubscription signal - return err - } - - subscription, err := dl.subscribeRedemptionRequested( - success, - failCallback, - _depositContractAddressFilter, - _requesterFilter, - _digestFilter, - ) - if err != nil { - errorChan <- err // trigger resubscription signal - return - } - - // wait for unsubscription signal - <-unsubscribeChan - subscription.Unsubscribe() - } - - // trigger the resubscriber goroutine - go func() { - go watch() // trigger first subscription - - for { - select { - case <-errorChan: - dlLogger.Warning( - "subscription to event RedemptionRequested terminated with error; " + - "resubscription attempt will be performed after the retry delay", - ) - time.Sleep(retryDelay) - go watch() - case <-unsubscribeChan: - // shutdown the resubscriber goroutine on unsubscribe signal - return - } - } - }() - - // closing the unsubscribeChan will trigger a unsubscribe signal and - // run unsubscription for all subscription instances - unsubscribeCallback := func() { - close(unsubscribeChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -func (dl *DepositLog) subscribeRedemptionRequested( - success depositLogRedemptionRequestedFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, - _requesterFilter []common.Address, - _digestFilter [][32]uint8, -) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogRedemptionRequested) - eventSubscription, err := dl.contract.WatchRedemptionRequested( - nil, - eventChan, - _depositContractAddressFilter, - _requesterFilter, - _digestFilter, - ) - if err != nil { - close(eventChan) - return eventSubscription, fmt.Errorf( - "error creating watch for RedemptionRequested events: [%v]", - err, - ) - } - - var subscriptionMutex = &sync.Mutex{} - - go func() { - for { - select { - case event, subscribed := <-eventChan: - subscriptionMutex.Lock() - // if eventChan has been closed, it means we have unsubscribed - if !subscribed { - subscriptionMutex.Unlock() - return - } - success( - event.DepositContractAddress, - event.Requester, - event.Digest, - event.UtxoValue, - event.RedeemerOutputScript, - event.RequestedFee, - event.Outpoint, - event.Raw.BlockNumber, - ) - subscriptionMutex.Unlock() - case ee := <-eventSubscription.Err(): - fail(ee) - return - } - } - }() - - unsubscribeCallback := func() { - subscriptionMutex.Lock() - defer subscriptionMutex.Unlock() - - eventSubscription.Unsubscribe() - close(eventChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -type depositLogRegisteredPubkeyFunc func( - DepositContractAddress common.Address, - SigningGroupPubkeyX [32]uint8, - SigningGroupPubkeyY [32]uint8, - Timestamp *big.Int, - blockNumber uint64, -) - -func (dl *DepositLog) WatchRegisteredPubkey( - success depositLogRegisteredPubkeyFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, -) (subscription.EventSubscription, error) { - errorChan := make(chan error) - unsubscribeChan := make(chan struct{}) - - // Delay which must be preserved before a new resubscription attempt. - // There is no sense to resubscribe immediately after the fail of current - // subscription because the publisher must have some time to recover. - retryDelay := 5 * time.Second - - watch := func() { - failCallback := func(err error) error { - fail(err) - errorChan <- err // trigger resubscription signal - return err - } - - subscription, err := dl.subscribeRegisteredPubkey( - success, - failCallback, - _depositContractAddressFilter, - ) - if err != nil { - errorChan <- err // trigger resubscription signal - return - } - - // wait for unsubscription signal - <-unsubscribeChan - subscription.Unsubscribe() - } - - // trigger the resubscriber goroutine - go func() { - go watch() // trigger first subscription - - for { - select { - case <-errorChan: - dlLogger.Warning( - "subscription to event RegisteredPubkey terminated with error; " + - "resubscription attempt will be performed after the retry delay", - ) - time.Sleep(retryDelay) - go watch() - case <-unsubscribeChan: - // shutdown the resubscriber goroutine on unsubscribe signal - return - } - } - }() - - // closing the unsubscribeChan will trigger a unsubscribe signal and - // run unsubscription for all subscription instances - unsubscribeCallback := func() { - close(unsubscribeChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -func (dl *DepositLog) subscribeRegisteredPubkey( - success depositLogRegisteredPubkeyFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, -) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogRegisteredPubkey) - eventSubscription, err := dl.contract.WatchRegisteredPubkey( - nil, - eventChan, - _depositContractAddressFilter, - ) - if err != nil { - close(eventChan) - return eventSubscription, fmt.Errorf( - "error creating watch for RegisteredPubkey events: [%v]", - err, - ) - } - - var subscriptionMutex = &sync.Mutex{} - - go func() { - for { - select { - case event, subscribed := <-eventChan: - subscriptionMutex.Lock() - // if eventChan has been closed, it means we have unsubscribed - if !subscribed { - subscriptionMutex.Unlock() - return - } - success( - event.DepositContractAddress, - event.SigningGroupPubkeyX, - event.SigningGroupPubkeyY, - event.Timestamp, - event.Raw.BlockNumber, - ) - subscriptionMutex.Unlock() - case ee := <-eventSubscription.Err(): - fail(ee) - return - } - } - }() - - unsubscribeCallback := func() { - subscriptionMutex.Lock() - defer subscriptionMutex.Unlock() - - eventSubscription.Unsubscribe() - close(eventChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -type depositLogCourtesyCalledFunc func( - DepositContractAddress common.Address, - Timestamp *big.Int, - blockNumber uint64, -) - -func (dl *DepositLog) WatchCourtesyCalled( - success depositLogCourtesyCalledFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, -) (subscription.EventSubscription, error) { - errorChan := make(chan error) - unsubscribeChan := make(chan struct{}) - - // Delay which must be preserved before a new resubscription attempt. - // There is no sense to resubscribe immediately after the fail of current - // subscription because the publisher must have some time to recover. - retryDelay := 5 * time.Second - - watch := func() { - failCallback := func(err error) error { - fail(err) - errorChan <- err // trigger resubscription signal - return err - } - - subscription, err := dl.subscribeCourtesyCalled( - success, - failCallback, - _depositContractAddressFilter, - ) - if err != nil { - errorChan <- err // trigger resubscription signal - return - } - - // wait for unsubscription signal - <-unsubscribeChan - subscription.Unsubscribe() - } - - // trigger the resubscriber goroutine - go func() { - go watch() // trigger first subscription - - for { - select { - case <-errorChan: - dlLogger.Warning( - "subscription to event CourtesyCalled terminated with error; " + - "resubscription attempt will be performed after the retry delay", - ) - time.Sleep(retryDelay) - go watch() - case <-unsubscribeChan: - // shutdown the resubscriber goroutine on unsubscribe signal - return - } - } - }() - - // closing the unsubscribeChan will trigger a unsubscribe signal and - // run unsubscription for all subscription instances - unsubscribeCallback := func() { - close(unsubscribeChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -func (dl *DepositLog) subscribeCourtesyCalled( - success depositLogCourtesyCalledFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, -) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogCourtesyCalled) - eventSubscription, err := dl.contract.WatchCourtesyCalled( - nil, - eventChan, - _depositContractAddressFilter, - ) - if err != nil { - close(eventChan) - return eventSubscription, fmt.Errorf( - "error creating watch for CourtesyCalled events: [%v]", - err, - ) - } - - var subscriptionMutex = &sync.Mutex{} - - go func() { - for { - select { - case event, subscribed := <-eventChan: - subscriptionMutex.Lock() - // if eventChan has been closed, it means we have unsubscribed - if !subscribed { - subscriptionMutex.Unlock() - return - } - success( - event.DepositContractAddress, - event.Timestamp, - event.Raw.BlockNumber, - ) - subscriptionMutex.Unlock() - case ee := <-eventSubscription.Err(): - fail(ee) - return - } - } - }() - - unsubscribeCallback := func() { - subscriptionMutex.Lock() - defer subscriptionMutex.Unlock() - - eventSubscription.Unsubscribe() - close(eventChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -type depositLogCreatedFunc func( - DepositContractAddress common.Address, - KeepAddress common.Address, - Timestamp *big.Int, - blockNumber uint64, -) - -func (dl *DepositLog) WatchCreated( - success depositLogCreatedFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, - _keepAddressFilter []common.Address, -) (subscription.EventSubscription, error) { - errorChan := make(chan error) - unsubscribeChan := make(chan struct{}) - - // Delay which must be preserved before a new resubscription attempt. - // There is no sense to resubscribe immediately after the fail of current - // subscription because the publisher must have some time to recover. - retryDelay := 5 * time.Second - - watch := func() { - failCallback := func(err error) error { - fail(err) - errorChan <- err // trigger resubscription signal - return err - } - - subscription, err := dl.subscribeCreated( - success, - failCallback, - _depositContractAddressFilter, - _keepAddressFilter, - ) - if err != nil { - errorChan <- err // trigger resubscription signal - return - } - - // wait for unsubscription signal - <-unsubscribeChan - subscription.Unsubscribe() - } - - // trigger the resubscriber goroutine - go func() { - go watch() // trigger first subscription - - for { - select { - case <-errorChan: - dlLogger.Warning( - "subscription to event Created terminated with error; " + - "resubscription attempt will be performed after the retry delay", - ) - time.Sleep(retryDelay) - go watch() - case <-unsubscribeChan: - // shutdown the resubscriber goroutine on unsubscribe signal - return - } - } - }() - - // closing the unsubscribeChan will trigger a unsubscribe signal and - // run unsubscription for all subscription instances - unsubscribeCallback := func() { - close(unsubscribeChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -func (dl *DepositLog) subscribeCreated( - success depositLogCreatedFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, - _keepAddressFilter []common.Address, -) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogCreated) - eventSubscription, err := dl.contract.WatchCreated( - nil, - eventChan, - _depositContractAddressFilter, - _keepAddressFilter, - ) - if err != nil { - close(eventChan) - return eventSubscription, fmt.Errorf( - "error creating watch for Created events: [%v]", - err, - ) - } - - var subscriptionMutex = &sync.Mutex{} - - go func() { - for { - select { - case event, subscribed := <-eventChan: - subscriptionMutex.Lock() - // if eventChan has been closed, it means we have unsubscribed - if !subscribed { - subscriptionMutex.Unlock() - return - } - success( - event.DepositContractAddress, - event.KeepAddress, - event.Timestamp, - event.Raw.BlockNumber, - ) - subscriptionMutex.Unlock() - case ee := <-eventSubscription.Err(): - fail(ee) - return - } - } - }() - - unsubscribeCallback := func() { - subscriptionMutex.Lock() - defer subscriptionMutex.Unlock() - - eventSubscription.Unsubscribe() - close(eventChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -type depositLogFundedFunc func( - DepositContractAddress common.Address, - Txid [32]uint8, - Timestamp *big.Int, - blockNumber uint64, -) - -func (dl *DepositLog) WatchFunded( - success depositLogFundedFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, - _txidFilter [][32]uint8, -) (subscription.EventSubscription, error) { - errorChan := make(chan error) - unsubscribeChan := make(chan struct{}) - - // Delay which must be preserved before a new resubscription attempt. - // There is no sense to resubscribe immediately after the fail of current - // subscription because the publisher must have some time to recover. - retryDelay := 5 * time.Second - - watch := func() { - failCallback := func(err error) error { - fail(err) - errorChan <- err // trigger resubscription signal - return err - } - - subscription, err := dl.subscribeFunded( - success, - failCallback, - _depositContractAddressFilter, - _txidFilter, - ) - if err != nil { - errorChan <- err // trigger resubscription signal - return - } - - // wait for unsubscription signal - <-unsubscribeChan - subscription.Unsubscribe() - } - - // trigger the resubscriber goroutine - go func() { - go watch() // trigger first subscription - - for { - select { - case <-errorChan: - dlLogger.Warning( - "subscription to event Funded terminated with error; " + - "resubscription attempt will be performed after the retry delay", - ) - time.Sleep(retryDelay) - go watch() - case <-unsubscribeChan: - // shutdown the resubscriber goroutine on unsubscribe signal - return - } - } - }() - - // closing the unsubscribeChan will trigger a unsubscribe signal and - // run unsubscription for all subscription instances - unsubscribeCallback := func() { - close(unsubscribeChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -func (dl *DepositLog) subscribeFunded( - success depositLogFundedFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, - _txidFilter [][32]uint8, -) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogFunded) - eventSubscription, err := dl.contract.WatchFunded( - nil, - eventChan, - _depositContractAddressFilter, - _txidFilter, - ) - if err != nil { - close(eventChan) - return eventSubscription, fmt.Errorf( - "error creating watch for Funded events: [%v]", - err, - ) - } - - var subscriptionMutex = &sync.Mutex{} - - go func() { - for { - select { - case event, subscribed := <-eventChan: - subscriptionMutex.Lock() - // if eventChan has been closed, it means we have unsubscribed - if !subscribed { - subscriptionMutex.Unlock() - return - } - success( - event.DepositContractAddress, - event.Txid, - event.Timestamp, - event.Raw.BlockNumber, - ) - subscriptionMutex.Unlock() - case ee := <-eventSubscription.Err(): - fail(ee) - return - } - } - }() - - unsubscribeCallback := func() { - subscriptionMutex.Lock() - defer subscriptionMutex.Unlock() - - eventSubscription.Unsubscribe() - close(eventChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -type depositLogGotRedemptionSignatureFunc func( - DepositContractAddress common.Address, - Digest [32]uint8, - R [32]uint8, - S [32]uint8, - Timestamp *big.Int, - blockNumber uint64, -) - -func (dl *DepositLog) WatchGotRedemptionSignature( - success depositLogGotRedemptionSignatureFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, - _digestFilter [][32]uint8, -) (subscription.EventSubscription, error) { - errorChan := make(chan error) - unsubscribeChan := make(chan struct{}) - - // Delay which must be preserved before a new resubscription attempt. - // There is no sense to resubscribe immediately after the fail of current - // subscription because the publisher must have some time to recover. - retryDelay := 5 * time.Second - - watch := func() { - failCallback := func(err error) error { - fail(err) - errorChan <- err // trigger resubscription signal - return err - } - - subscription, err := dl.subscribeGotRedemptionSignature( - success, - failCallback, - _depositContractAddressFilter, - _digestFilter, - ) - if err != nil { - errorChan <- err // trigger resubscription signal - return - } - - // wait for unsubscription signal - <-unsubscribeChan - subscription.Unsubscribe() - } - - // trigger the resubscriber goroutine - go func() { - go watch() // trigger first subscription - - for { - select { - case <-errorChan: - dlLogger.Warning( - "subscription to event GotRedemptionSignature terminated with error; " + - "resubscription attempt will be performed after the retry delay", - ) - time.Sleep(retryDelay) - go watch() - case <-unsubscribeChan: - // shutdown the resubscriber goroutine on unsubscribe signal - return - } - } - }() - - // closing the unsubscribeChan will trigger a unsubscribe signal and - // run unsubscription for all subscription instances - unsubscribeCallback := func() { - close(unsubscribeChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -func (dl *DepositLog) subscribeGotRedemptionSignature( - success depositLogGotRedemptionSignatureFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, - _digestFilter [][32]uint8, -) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogGotRedemptionSignature) - eventSubscription, err := dl.contract.WatchGotRedemptionSignature( - nil, - eventChan, - _depositContractAddressFilter, - _digestFilter, - ) - if err != nil { - close(eventChan) - return eventSubscription, fmt.Errorf( - "error creating watch for GotRedemptionSignature events: [%v]", - err, - ) - } - - var subscriptionMutex = &sync.Mutex{} - - go func() { - for { - select { - case event, subscribed := <-eventChan: - subscriptionMutex.Lock() - // if eventChan has been closed, it means we have unsubscribed - if !subscribed { - subscriptionMutex.Unlock() - return - } - success( - event.DepositContractAddress, - event.Digest, - event.R, - event.S, - event.Timestamp, - event.Raw.BlockNumber, - ) - subscriptionMutex.Unlock() - case ee := <-eventSubscription.Err(): - fail(ee) - return - } - } - }() - - unsubscribeCallback := func() { - subscriptionMutex.Lock() - defer subscriptionMutex.Unlock() - - eventSubscription.Unsubscribe() - close(eventChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -type depositLogSetupFailedFunc func( - DepositContractAddress common.Address, - Timestamp *big.Int, - blockNumber uint64, -) - -func (dl *DepositLog) WatchSetupFailed( - success depositLogSetupFailedFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, -) (subscription.EventSubscription, error) { - errorChan := make(chan error) - unsubscribeChan := make(chan struct{}) - - // Delay which must be preserved before a new resubscription attempt. - // There is no sense to resubscribe immediately after the fail of current - // subscription because the publisher must have some time to recover. - retryDelay := 5 * time.Second - - watch := func() { - failCallback := func(err error) error { - fail(err) - errorChan <- err // trigger resubscription signal - return err - } - - subscription, err := dl.subscribeSetupFailed( - success, - failCallback, - _depositContractAddressFilter, - ) - if err != nil { - errorChan <- err // trigger resubscription signal - return - } - - // wait for unsubscription signal - <-unsubscribeChan - subscription.Unsubscribe() - } - - // trigger the resubscriber goroutine - go func() { - go watch() // trigger first subscription - - for { - select { - case <-errorChan: - dlLogger.Warning( - "subscription to event SetupFailed terminated with error; " + - "resubscription attempt will be performed after the retry delay", - ) - time.Sleep(retryDelay) - go watch() - case <-unsubscribeChan: - // shutdown the resubscriber goroutine on unsubscribe signal - return - } - } - }() - - // closing the unsubscribeChan will trigger a unsubscribe signal and - // run unsubscription for all subscription instances - unsubscribeCallback := func() { - close(unsubscribeChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -func (dl *DepositLog) subscribeSetupFailed( - success depositLogSetupFailedFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, -) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogSetupFailed) - eventSubscription, err := dl.contract.WatchSetupFailed( - nil, - eventChan, - _depositContractAddressFilter, - ) - if err != nil { - close(eventChan) - return eventSubscription, fmt.Errorf( - "error creating watch for SetupFailed events: [%v]", - err, - ) - } - - var subscriptionMutex = &sync.Mutex{} - - go func() { - for { - select { - case event, subscribed := <-eventChan: - subscriptionMutex.Lock() - // if eventChan has been closed, it means we have unsubscribed - if !subscribed { - subscriptionMutex.Unlock() - return - } - success( - event.DepositContractAddress, - event.Timestamp, - event.Raw.BlockNumber, - ) - subscriptionMutex.Unlock() - case ee := <-eventSubscription.Err(): - fail(ee) - return - } - } - }() - - unsubscribeCallback := func() { - subscriptionMutex.Lock() - defer subscriptionMutex.Unlock() - - eventSubscription.Unsubscribe() - close(eventChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -type depositLogExitedCourtesyCallFunc func( - DepositContractAddress common.Address, - Timestamp *big.Int, - blockNumber uint64, -) - -func (dl *DepositLog) WatchExitedCourtesyCall( - success depositLogExitedCourtesyCallFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, -) (subscription.EventSubscription, error) { - errorChan := make(chan error) - unsubscribeChan := make(chan struct{}) - - // Delay which must be preserved before a new resubscription attempt. - // There is no sense to resubscribe immediately after the fail of current - // subscription because the publisher must have some time to recover. - retryDelay := 5 * time.Second - - watch := func() { - failCallback := func(err error) error { - fail(err) - errorChan <- err // trigger resubscription signal - return err - } - - subscription, err := dl.subscribeExitedCourtesyCall( - success, - failCallback, - _depositContractAddressFilter, - ) - if err != nil { - errorChan <- err // trigger resubscription signal - return - } - - // wait for unsubscription signal - <-unsubscribeChan - subscription.Unsubscribe() - } - - // trigger the resubscriber goroutine - go func() { - go watch() // trigger first subscription - - for { - select { - case <-errorChan: - dlLogger.Warning( - "subscription to event ExitedCourtesyCall terminated with error; " + - "resubscription attempt will be performed after the retry delay", - ) - time.Sleep(retryDelay) - go watch() - case <-unsubscribeChan: - // shutdown the resubscriber goroutine on unsubscribe signal - return - } - } - }() - - // closing the unsubscribeChan will trigger a unsubscribe signal and - // run unsubscription for all subscription instances - unsubscribeCallback := func() { - close(unsubscribeChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -func (dl *DepositLog) subscribeExitedCourtesyCall( - success depositLogExitedCourtesyCallFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, -) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogExitedCourtesyCall) - eventSubscription, err := dl.contract.WatchExitedCourtesyCall( - nil, - eventChan, - _depositContractAddressFilter, - ) - if err != nil { - close(eventChan) - return eventSubscription, fmt.Errorf( - "error creating watch for ExitedCourtesyCall events: [%v]", - err, - ) - } - - var subscriptionMutex = &sync.Mutex{} - - go func() { - for { - select { - case event, subscribed := <-eventChan: - subscriptionMutex.Lock() - // if eventChan has been closed, it means we have unsubscribed - if !subscribed { - subscriptionMutex.Unlock() - return - } - success( - event.DepositContractAddress, - event.Timestamp, - event.Raw.BlockNumber, - ) - subscriptionMutex.Unlock() - case ee := <-eventSubscription.Err(): - fail(ee) - return - } - } - }() - - unsubscribeCallback := func() { - subscriptionMutex.Lock() - defer subscriptionMutex.Unlock() - - eventSubscription.Unsubscribe() - close(eventChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -type depositLogFraudDuringSetupFunc func( - DepositContractAddress common.Address, - Timestamp *big.Int, - blockNumber uint64, -) - -func (dl *DepositLog) WatchFraudDuringSetup( - success depositLogFraudDuringSetupFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, -) (subscription.EventSubscription, error) { - errorChan := make(chan error) - unsubscribeChan := make(chan struct{}) - - // Delay which must be preserved before a new resubscription attempt. - // There is no sense to resubscribe immediately after the fail of current - // subscription because the publisher must have some time to recover. - retryDelay := 5 * time.Second - - watch := func() { - failCallback := func(err error) error { - fail(err) - errorChan <- err // trigger resubscription signal - return err - } - - subscription, err := dl.subscribeFraudDuringSetup( - success, - failCallback, - _depositContractAddressFilter, - ) - if err != nil { - errorChan <- err // trigger resubscription signal - return - } - - // wait for unsubscription signal - <-unsubscribeChan - subscription.Unsubscribe() - } - - // trigger the resubscriber goroutine - go func() { - go watch() // trigger first subscription - - for { - select { - case <-errorChan: - dlLogger.Warning( - "subscription to event FraudDuringSetup terminated with error; " + - "resubscription attempt will be performed after the retry delay", - ) - time.Sleep(retryDelay) - go watch() - case <-unsubscribeChan: - // shutdown the resubscriber goroutine on unsubscribe signal - return - } - } - }() - - // closing the unsubscribeChan will trigger a unsubscribe signal and - // run unsubscription for all subscription instances - unsubscribeCallback := func() { - close(unsubscribeChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -func (dl *DepositLog) subscribeFraudDuringSetup( - success depositLogFraudDuringSetupFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, -) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogFraudDuringSetup) - eventSubscription, err := dl.contract.WatchFraudDuringSetup( - nil, - eventChan, - _depositContractAddressFilter, - ) - if err != nil { - close(eventChan) - return eventSubscription, fmt.Errorf( - "error creating watch for FraudDuringSetup events: [%v]", - err, - ) - } - - var subscriptionMutex = &sync.Mutex{} - - go func() { - for { - select { - case event, subscribed := <-eventChan: - subscriptionMutex.Lock() - // if eventChan has been closed, it means we have unsubscribed - if !subscribed { - subscriptionMutex.Unlock() - return - } - success( - event.DepositContractAddress, - event.Timestamp, - event.Raw.BlockNumber, - ) - subscriptionMutex.Unlock() - case ee := <-eventSubscription.Err(): - fail(ee) - return - } - } - }() - - unsubscribeCallback := func() { - subscriptionMutex.Lock() - defer subscriptionMutex.Unlock() - - eventSubscription.Unsubscribe() - close(eventChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -type depositLogFunderAbortRequestedFunc func( - DepositContractAddress common.Address, - AbortOutputScript []uint8, - blockNumber uint64, -) - -func (dl *DepositLog) WatchFunderAbortRequested( - success depositLogFunderAbortRequestedFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, -) (subscription.EventSubscription, error) { - errorChan := make(chan error) - unsubscribeChan := make(chan struct{}) - - // Delay which must be preserved before a new resubscription attempt. - // There is no sense to resubscribe immediately after the fail of current - // subscription because the publisher must have some time to recover. - retryDelay := 5 * time.Second - - watch := func() { - failCallback := func(err error) error { - fail(err) - errorChan <- err // trigger resubscription signal - return err - } - - subscription, err := dl.subscribeFunderAbortRequested( - success, - failCallback, - _depositContractAddressFilter, - ) - if err != nil { - errorChan <- err // trigger resubscription signal - return - } - - // wait for unsubscription signal - <-unsubscribeChan - subscription.Unsubscribe() - } - - // trigger the resubscriber goroutine - go func() { - go watch() // trigger first subscription - - for { - select { - case <-errorChan: - dlLogger.Warning( - "subscription to event FunderAbortRequested terminated with error; " + - "resubscription attempt will be performed after the retry delay", - ) - time.Sleep(retryDelay) - go watch() - case <-unsubscribeChan: - // shutdown the resubscriber goroutine on unsubscribe signal - return - } - } - }() - - // closing the unsubscribeChan will trigger a unsubscribe signal and - // run unsubscription for all subscription instances - unsubscribeCallback := func() { - close(unsubscribeChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -func (dl *DepositLog) subscribeFunderAbortRequested( - success depositLogFunderAbortRequestedFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, -) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogFunderAbortRequested) - eventSubscription, err := dl.contract.WatchFunderAbortRequested( - nil, - eventChan, - _depositContractAddressFilter, - ) - if err != nil { - close(eventChan) - return eventSubscription, fmt.Errorf( - "error creating watch for FunderAbortRequested events: [%v]", - err, - ) - } - - var subscriptionMutex = &sync.Mutex{} - - go func() { - for { - select { - case event, subscribed := <-eventChan: - subscriptionMutex.Lock() - // if eventChan has been closed, it means we have unsubscribed - if !subscribed { - subscriptionMutex.Unlock() - return - } - success( - event.DepositContractAddress, - event.AbortOutputScript, - event.Raw.BlockNumber, - ) - subscriptionMutex.Unlock() - case ee := <-eventSubscription.Err(): - fail(ee) - return - } - } - }() - - unsubscribeCallback := func() { - subscriptionMutex.Lock() - defer subscriptionMutex.Unlock() - - eventSubscription.Unsubscribe() - close(eventChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -type depositLogStartedLiquidationFunc func( - DepositContractAddress common.Address, - WasFraud bool, - Timestamp *big.Int, - blockNumber uint64, -) - -func (dl *DepositLog) WatchStartedLiquidation( - success depositLogStartedLiquidationFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, -) (subscription.EventSubscription, error) { - errorChan := make(chan error) - unsubscribeChan := make(chan struct{}) - - // Delay which must be preserved before a new resubscription attempt. - // There is no sense to resubscribe immediately after the fail of current - // subscription because the publisher must have some time to recover. - retryDelay := 5 * time.Second - - watch := func() { - failCallback := func(err error) error { - fail(err) - errorChan <- err // trigger resubscription signal - return err - } - - subscription, err := dl.subscribeStartedLiquidation( - success, - failCallback, - _depositContractAddressFilter, - ) - if err != nil { - errorChan <- err // trigger resubscription signal - return - } - - // wait for unsubscription signal - <-unsubscribeChan - subscription.Unsubscribe() - } - - // trigger the resubscriber goroutine - go func() { - go watch() // trigger first subscription - - for { - select { - case <-errorChan: - dlLogger.Warning( - "subscription to event StartedLiquidation terminated with error; " + - "resubscription attempt will be performed after the retry delay", - ) - time.Sleep(retryDelay) - go watch() - case <-unsubscribeChan: - // shutdown the resubscriber goroutine on unsubscribe signal - return - } - } - }() - - // closing the unsubscribeChan will trigger a unsubscribe signal and - // run unsubscription for all subscription instances - unsubscribeCallback := func() { - close(unsubscribeChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} - -func (dl *DepositLog) subscribeStartedLiquidation( - success depositLogStartedLiquidationFunc, - fail func(err error) error, - _depositContractAddressFilter []common.Address, -) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.DepositLogStartedLiquidation) - eventSubscription, err := dl.contract.WatchStartedLiquidation( - nil, - eventChan, - _depositContractAddressFilter, - ) - if err != nil { - close(eventChan) - return eventSubscription, fmt.Errorf( - "error creating watch for StartedLiquidation events: [%v]", - err, - ) - } - - var subscriptionMutex = &sync.Mutex{} - - go func() { - for { - select { - case event, subscribed := <-eventChan: - subscriptionMutex.Lock() - // if eventChan has been closed, it means we have unsubscribed - if !subscribed { - subscriptionMutex.Unlock() - return - } - success( - event.DepositContractAddress, - event.WasFraud, - event.Timestamp, - event.Raw.BlockNumber, - ) - subscriptionMutex.Unlock() - case ee := <-eventSubscription.Err(): - fail(ee) - return - } - } - }() - - unsubscribeCallback := func() { - subscriptionMutex.Lock() - defer subscriptionMutex.Unlock() - - eventSubscription.Unsubscribe() - close(eventChan) - } - - return subscription.NewEventSubscription(unsubscribeCallback), nil -} diff --git a/go/contract/TBTCSystem.go b/go/contract/TBTCSystem.go new file mode 100644 index 000000000..84af1f8dd --- /dev/null +++ b/go/contract/TBTCSystem.go @@ -0,0 +1,8310 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package contract + +import ( + "fmt" + "math/big" + "strings" + "sync" + "time" + + ethereumabi "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/ipfs/go-log" + + "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" + "github.com/keep-network/keep-common/pkg/subscription" + abi "github.com/keep-network/tbtc/go/abi/system" +) + +// 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 tbtcsLogger = log.Logger("keep-contract-TBTCSystem") + +type TBTCSystem struct { + contract *abi.TBTCSystem + contractAddress common.Address + contractABI *ethereumabi.ABI + caller bind.ContractCaller + transactor bind.ContractTransactor + callerOptions *bind.CallOpts + transactorOptions *bind.TransactOpts + errorResolver *ethutil.ErrorResolver + nonceManager *ethutil.NonceManager + miningWaiter *ethutil.MiningWaiter + + transactionMutex *sync.Mutex +} + +func NewTBTCSystem( + contractAddress common.Address, + accountKey *keystore.Key, + backend bind.ContractBackend, + nonceManager *ethutil.NonceManager, + miningWaiter *ethutil.MiningWaiter, + transactionMutex *sync.Mutex, +) (*TBTCSystem, error) { + callerOptions := &bind.CallOpts{ + From: accountKey.Address, + } + + transactorOptions := bind.NewKeyedTransactor( + accountKey.PrivateKey, + ) + + randomBeaconContract, err := abi.NewTBTCSystem( + contractAddress, + backend, + ) + if err != nil { + return nil, fmt.Errorf( + "failed to instantiate contract at address: %s [%v]", + contractAddress.String(), + err, + ) + } + + contractABI, err := ethereumabi.JSON(strings.NewReader(abi.TBTCSystemABI)) + if err != nil { + return nil, fmt.Errorf("failed to instantiate ABI: [%v]", err) + } + + return &TBTCSystem{ + contract: randomBeaconContract, + contractAddress: contractAddress, + contractABI: &contractABI, + caller: backend, + transactor: backend, + callerOptions: callerOptions, + transactorOptions: transactorOptions, + errorResolver: ethutil.NewErrorResolver(backend, &contractABI, &contractAddress), + nonceManager: nonceManager, + miningWaiter: miningWaiter, + transactionMutex: transactionMutex, + }, nil +} + +// ----- Non-const Methods ------ + +// Transaction submission. +func (tbtcs *TBTCSystem) LogRedemptionRequested( + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logRedemptionRequested", + "params: ", + fmt.Sprint( + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.LogRedemptionRequested( + transactorOptions, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logRedemptionRequested", + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogRedemptionRequested( + transactorOptions, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logRedemptionRequested", + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogRedemptionRequested( + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logRedemptionRequested", + &result, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogRedemptionRequestedGasEstimate( + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logRedemptionRequested", + tbtcs.contractABI, + tbtcs.transactor, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogSetupFailed( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logSetupFailed", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.LogSetupFailed( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logSetupFailed", + ) + } + + tbtcsLogger.Infof( + "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogSetupFailed( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logSetupFailed", + ) + } + + tbtcsLogger.Infof( + "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogSetupFailed( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logSetupFailed", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogSetupFailedGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logSetupFailed", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAddition( + _ethBtcPriceFeed common.Address, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction beginEthBtcPriceFeedAddition", + "params: ", + fmt.Sprint( + _ethBtcPriceFeed, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.BeginEthBtcPriceFeedAddition( + transactorOptions, + _ethBtcPriceFeed, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "beginEthBtcPriceFeedAddition", + _ethBtcPriceFeed, + ) + } + + tbtcsLogger.Infof( + "submitted transaction beginEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.BeginEthBtcPriceFeedAddition( + transactorOptions, + _ethBtcPriceFeed, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "beginEthBtcPriceFeedAddition", + _ethBtcPriceFeed, + ) + } + + tbtcsLogger.Infof( + "submitted transaction beginEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallBeginEthBtcPriceFeedAddition( + _ethBtcPriceFeed common.Address, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "beginEthBtcPriceFeedAddition", + &result, + _ethBtcPriceFeed, + ) + + return err +} + +func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAdditionGasEstimate( + _ethBtcPriceFeed common.Address, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "beginEthBtcPriceFeedAddition", + tbtcs.contractABI, + tbtcs.transactor, + _ethBtcPriceFeed, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdate( + _keepStakedFactory common.Address, + _fullyBackedFactory common.Address, + _factorySelector common.Address, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction beginKeepFactoriesUpdate", + "params: ", + fmt.Sprint( + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.BeginKeepFactoriesUpdate( + transactorOptions, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "beginKeepFactoriesUpdate", + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, + ) + } + + tbtcsLogger.Infof( + "submitted transaction beginKeepFactoriesUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.BeginKeepFactoriesUpdate( + transactorOptions, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "beginKeepFactoriesUpdate", + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, + ) + } + + tbtcsLogger.Infof( + "submitted transaction beginKeepFactoriesUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallBeginKeepFactoriesUpdate( + _keepStakedFactory common.Address, + _fullyBackedFactory common.Address, + _factorySelector common.Address, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "beginKeepFactoriesUpdate", + &result, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, + ) + + return err +} + +func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdateGasEstimate( + _keepStakedFactory common.Address, + _fullyBackedFactory common.Address, + _factorySelector common.Address, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "beginKeepFactoriesUpdate", + tbtcs.contractABI, + tbtcs.transactor, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogStartedLiquidation( + _wasFraud bool, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logStartedLiquidation", + "params: ", + fmt.Sprint( + _wasFraud, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.LogStartedLiquidation( + transactorOptions, + _wasFraud, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logStartedLiquidation", + _wasFraud, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogStartedLiquidation( + transactorOptions, + _wasFraud, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logStartedLiquidation", + _wasFraud, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogStartedLiquidation( + _wasFraud bool, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logStartedLiquidation", + &result, + _wasFraud, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogStartedLiquidationGasEstimate( + _wasFraud bool, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logStartedLiquidation", + tbtcs.contractABI, + tbtcs.transactor, + _wasFraud, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction refreshMinimumBondableValue", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.RefreshMinimumBondableValue( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "refreshMinimumBondableValue", + ) + } + + tbtcsLogger.Infof( + "submitted transaction refreshMinimumBondableValue with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.RefreshMinimumBondableValue( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "refreshMinimumBondableValue", + ) + } + + tbtcsLogger.Infof( + "submitted transaction refreshMinimumBondableValue with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallRefreshMinimumBondableValue( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "refreshMinimumBondableValue", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) RefreshMinimumBondableValueGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "refreshMinimumBondableValue", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAddition( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction finalizeEthBtcPriceFeedAddition", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.FinalizeEthBtcPriceFeedAddition( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "finalizeEthBtcPriceFeedAddition", + ) + } + + tbtcsLogger.Infof( + "submitted transaction finalizeEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.FinalizeEthBtcPriceFeedAddition( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "finalizeEthBtcPriceFeedAddition", + ) + } + + tbtcsLogger.Infof( + "submitted transaction finalizeEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallFinalizeEthBtcPriceFeedAddition( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "finalizeEthBtcPriceFeedAddition", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAdditionGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "finalizeEthBtcPriceFeedAddition", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdate( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction finalizeSignerFeeDivisorUpdate", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.FinalizeSignerFeeDivisorUpdate( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "finalizeSignerFeeDivisorUpdate", + ) + } + + tbtcsLogger.Infof( + "submitted transaction finalizeSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.FinalizeSignerFeeDivisorUpdate( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "finalizeSignerFeeDivisorUpdate", + ) + } + + tbtcsLogger.Infof( + "submitted transaction finalizeSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallFinalizeSignerFeeDivisorUpdate( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "finalizeSignerFeeDivisorUpdate", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdateGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "finalizeSignerFeeDivisorUpdate", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) Initialize( + _defaultKeepFactory common.Address, + _depositFactory common.Address, + _masterDepositAddress common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachine common.Address, + _keepThreshold uint16, + _keepSize uint16, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction initialize", + "params: ", + fmt.Sprint( + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.Initialize( + transactorOptions, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "initialize", + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, + ) + } + + tbtcsLogger.Infof( + "submitted transaction initialize with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.Initialize( + transactorOptions, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "initialize", + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, + ) + } + + tbtcsLogger.Infof( + "submitted transaction initialize with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallInitialize( + _defaultKeepFactory common.Address, + _depositFactory common.Address, + _masterDepositAddress common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachine common.Address, + _keepThreshold uint16, + _keepSize uint16, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "initialize", + &result, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, + ) + + return err +} + +func (tbtcs *TBTCSystem) InitializeGasEstimate( + _defaultKeepFactory common.Address, + _depositFactory common.Address, + _masterDepositAddress common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachine common.Address, + _keepThreshold uint16, + _keepSize uint16, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "initialize", + tbtcs.contractABI, + tbtcs.transactor, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogCourtesyCalled( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logCourtesyCalled", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.LogCourtesyCalled( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logCourtesyCalled", + ) + } + + tbtcsLogger.Infof( + "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogCourtesyCalled( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logCourtesyCalled", + ) + } + + tbtcsLogger.Infof( + "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogCourtesyCalled( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logCourtesyCalled", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogCourtesyCalledGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logCourtesyCalled", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdate( + _signerFeeDivisor uint16, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction beginSignerFeeDivisorUpdate", + "params: ", + fmt.Sprint( + _signerFeeDivisor, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.BeginSignerFeeDivisorUpdate( + transactorOptions, + _signerFeeDivisor, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "beginSignerFeeDivisorUpdate", + _signerFeeDivisor, + ) + } + + tbtcsLogger.Infof( + "submitted transaction beginSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.BeginSignerFeeDivisorUpdate( + transactorOptions, + _signerFeeDivisor, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "beginSignerFeeDivisorUpdate", + _signerFeeDivisor, + ) + } + + tbtcsLogger.Infof( + "submitted transaction beginSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallBeginSignerFeeDivisorUpdate( + _signerFeeDivisor uint16, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "beginSignerFeeDivisorUpdate", + &result, + _signerFeeDivisor, + ) + + return err +} + +func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdateGasEstimate( + _signerFeeDivisor uint16, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "beginSignerFeeDivisorUpdate", + tbtcs.contractABI, + tbtcs.transactor, + _signerFeeDivisor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) ResumeNewDeposits( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction resumeNewDeposits", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.ResumeNewDeposits( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "resumeNewDeposits", + ) + } + + tbtcsLogger.Infof( + "submitted transaction resumeNewDeposits with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.ResumeNewDeposits( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "resumeNewDeposits", + ) + } + + tbtcsLogger.Infof( + "submitted transaction resumeNewDeposits with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallResumeNewDeposits( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "resumeNewDeposits", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) ResumeNewDepositsGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "resumeNewDeposits", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction finalizeLotSizesUpdate", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.FinalizeLotSizesUpdate( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "finalizeLotSizesUpdate", + ) + } + + tbtcsLogger.Infof( + "submitted transaction finalizeLotSizesUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.FinalizeLotSizesUpdate( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "finalizeLotSizesUpdate", + ) + } + + tbtcsLogger.Infof( + "submitted transaction finalizeLotSizesUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallFinalizeLotSizesUpdate( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "finalizeLotSizesUpdate", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) FinalizeLotSizesUpdateGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "finalizeLotSizesUpdate", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogRedeemed( + _txid [32]uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logRedeemed", + "params: ", + fmt.Sprint( + _txid, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.LogRedeemed( + transactorOptions, + _txid, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logRedeemed", + _txid, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logRedeemed with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogRedeemed( + transactorOptions, + _txid, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logRedeemed", + _txid, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logRedeemed with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogRedeemed( + _txid [32]uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logRedeemed", + &result, + _txid, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogRedeemedGasEstimate( + _txid [32]uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logRedeemed", + tbtcs.contractABI, + tbtcs.transactor, + _txid, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogRegisteredPubkey( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logRegisteredPubkey", + "params: ", + fmt.Sprint( + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.LogRegisteredPubkey( + transactorOptions, + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logRegisteredPubkey", + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogRegisteredPubkey( + transactorOptions, + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logRegisteredPubkey", + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogRegisteredPubkey( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logRegisteredPubkey", + &result, + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogRegisteredPubkeyGasEstimate( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logRegisteredPubkey", + tbtcs.contractABI, + tbtcs.transactor, + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) BeginLotSizesUpdate( + _lotSizes []uint64, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction beginLotSizesUpdate", + "params: ", + fmt.Sprint( + _lotSizes, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.BeginLotSizesUpdate( + transactorOptions, + _lotSizes, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "beginLotSizesUpdate", + _lotSizes, + ) + } + + tbtcsLogger.Infof( + "submitted transaction beginLotSizesUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.BeginLotSizesUpdate( + transactorOptions, + _lotSizes, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "beginLotSizesUpdate", + _lotSizes, + ) + } + + tbtcsLogger.Infof( + "submitted transaction beginLotSizesUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallBeginLotSizesUpdate( + _lotSizes []uint64, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "beginLotSizesUpdate", + &result, + _lotSizes, + ) + + return err +} + +func (tbtcs *TBTCSystem) BeginLotSizesUpdateGasEstimate( + _lotSizes []uint64, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "beginLotSizesUpdate", + tbtcs.contractABI, + tbtcs.transactor, + _lotSizes, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogGotRedemptionSignature( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logGotRedemptionSignature", + "params: ", + fmt.Sprint( + _digest, + _r, + _s, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.LogGotRedemptionSignature( + transactorOptions, + _digest, + _r, + _s, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logGotRedemptionSignature", + _digest, + _r, + _s, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogGotRedemptionSignature( + transactorOptions, + _digest, + _r, + _s, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logGotRedemptionSignature", + _digest, + _r, + _s, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogGotRedemptionSignature( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logGotRedemptionSignature", + &result, + _digest, + _r, + _s, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogGotRedemptionSignatureGasEstimate( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logGotRedemptionSignature", + tbtcs.contractABI, + tbtcs.transactor, + _digest, + _r, + _s, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) TransferOwnership( + newOwner common.Address, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction transferOwnership", + "params: ", + fmt.Sprint( + newOwner, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.TransferOwnership( + transactorOptions, + newOwner, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "transferOwnership", + newOwner, + ) + } + + tbtcsLogger.Infof( + "submitted transaction transferOwnership with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.TransferOwnership( + transactorOptions, + newOwner, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "transferOwnership", + newOwner, + ) + } + + tbtcsLogger.Infof( + "submitted transaction transferOwnership with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallTransferOwnership( + newOwner common.Address, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "transferOwnership", + &result, + newOwner, + ) + + return err +} + +func (tbtcs *TBTCSystem) TransferOwnershipGasEstimate( + newOwner common.Address, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "transferOwnership", + tbtcs.contractABI, + tbtcs.transactor, + newOwner, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdate( + _initialCollateralizedPercent uint16, + _undercollateralizedThresholdPercent uint16, + _severelyUndercollateralizedThresholdPercent uint16, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction beginCollateralizationThresholdsUpdate", + "params: ", + fmt.Sprint( + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.BeginCollateralizationThresholdsUpdate( + transactorOptions, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "beginCollateralizationThresholdsUpdate", + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, + ) + } + + tbtcsLogger.Infof( + "submitted transaction beginCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.BeginCollateralizationThresholdsUpdate( + transactorOptions, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "beginCollateralizationThresholdsUpdate", + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, + ) + } + + tbtcsLogger.Infof( + "submitted transaction beginCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallBeginCollateralizationThresholdsUpdate( + _initialCollateralizedPercent uint16, + _undercollateralizedThresholdPercent uint16, + _severelyUndercollateralizedThresholdPercent uint16, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "beginCollateralizationThresholdsUpdate", + &result, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, + ) + + return err +} + +func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdateGasEstimate( + _initialCollateralizedPercent uint16, + _undercollateralizedThresholdPercent uint16, + _severelyUndercollateralizedThresholdPercent uint16, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "beginCollateralizationThresholdsUpdate", + tbtcs.contractABI, + tbtcs.transactor, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogFraudDuringSetup( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logFraudDuringSetup", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.LogFraudDuringSetup( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logFraudDuringSetup", + ) + } + + tbtcsLogger.Infof( + "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogFraudDuringSetup( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logFraudDuringSetup", + ) + } + + tbtcsLogger.Infof( + "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogFraudDuringSetup( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logFraudDuringSetup", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogFraudDuringSetupGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logFraudDuringSetup", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) RenounceOwnership( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction renounceOwnership", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.RenounceOwnership( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "renounceOwnership", + ) + } + + tbtcsLogger.Infof( + "submitted transaction renounceOwnership with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.RenounceOwnership( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "renounceOwnership", + ) + } + + tbtcsLogger.Infof( + "submitted transaction renounceOwnership with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallRenounceOwnership( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "renounceOwnership", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) RenounceOwnershipGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "renounceOwnership", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogLiquidated( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logLiquidated", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.LogLiquidated( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logLiquidated", + ) + } + + tbtcsLogger.Infof( + "submitted transaction logLiquidated with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogLiquidated( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logLiquidated", + ) + } + + tbtcsLogger.Infof( + "submitted transaction logLiquidated with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogLiquidated( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logLiquidated", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogLiquidatedGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logLiquidated", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) RequestNewKeep( + _requestedLotSizeSatoshis uint64, + _maxSecuredLifetime *big.Int, + value *big.Int, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction requestNewKeep", + "params: ", + fmt.Sprint( + _requestedLotSizeSatoshis, + _maxSecuredLifetime, + ), + "value: ", value, + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.transactorOptions + + transactorOptions.Value = value + + 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 := tbtcs.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 := tbtcs.contract.RequestNewKeep( + transactorOptions, + _requestedLotSizeSatoshis, + _maxSecuredLifetime, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + value, + "requestNewKeep", + _requestedLotSizeSatoshis, + _maxSecuredLifetime, + ) + } + + tbtcsLogger.Infof( + "submitted transaction requestNewKeep with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.RequestNewKeep( + transactorOptions, + _requestedLotSizeSatoshis, + _maxSecuredLifetime, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + value, + "requestNewKeep", + _requestedLotSizeSatoshis, + _maxSecuredLifetime, + ) + } + + tbtcsLogger.Infof( + "submitted transaction requestNewKeep with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallRequestNewKeep( + _requestedLotSizeSatoshis uint64, + _maxSecuredLifetime *big.Int, + value *big.Int, + blockNumber *big.Int, +) (common.Address, error) { + var result common.Address + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, value, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "requestNewKeep", + &result, + _requestedLotSizeSatoshis, + _maxSecuredLifetime, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) RequestNewKeepGasEstimate( + _requestedLotSizeSatoshis uint64, + _maxSecuredLifetime *big.Int, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "requestNewKeep", + tbtcs.contractABI, + tbtcs.transactor, + _requestedLotSizeSatoshis, + _maxSecuredLifetime, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogExitedCourtesyCall( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logExitedCourtesyCall", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.LogExitedCourtesyCall( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logExitedCourtesyCall", + ) + } + + tbtcsLogger.Infof( + "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogExitedCourtesyCall( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logExitedCourtesyCall", + ) + } + + tbtcsLogger.Infof( + "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogExitedCourtesyCall( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logExitedCourtesyCall", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogExitedCourtesyCallGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logExitedCourtesyCall", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) EmergencyPauseNewDeposits( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction emergencyPauseNewDeposits", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.EmergencyPauseNewDeposits( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "emergencyPauseNewDeposits", + ) + } + + tbtcsLogger.Infof( + "submitted transaction emergencyPauseNewDeposits with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.EmergencyPauseNewDeposits( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "emergencyPauseNewDeposits", + ) + } + + tbtcsLogger.Infof( + "submitted transaction emergencyPauseNewDeposits with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallEmergencyPauseNewDeposits( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "emergencyPauseNewDeposits", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) EmergencyPauseNewDepositsGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "emergencyPauseNewDeposits", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogFunderRequestedAbort( + _abortOutputScript []uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logFunderRequestedAbort", + "params: ", + fmt.Sprint( + _abortOutputScript, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.LogFunderRequestedAbort( + transactorOptions, + _abortOutputScript, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logFunderRequestedAbort", + _abortOutputScript, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogFunderRequestedAbort( + transactorOptions, + _abortOutputScript, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logFunderRequestedAbort", + _abortOutputScript, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogFunderRequestedAbort( + _abortOutputScript []uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logFunderRequestedAbort", + &result, + _abortOutputScript, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogFunderRequestedAbortGasEstimate( + _abortOutputScript []uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logFunderRequestedAbort", + tbtcs.contractABI, + tbtcs.transactor, + _abortOutputScript, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction finalizeKeepFactoriesUpdate", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.FinalizeKeepFactoriesUpdate( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "finalizeKeepFactoriesUpdate", + ) + } + + tbtcsLogger.Infof( + "submitted transaction finalizeKeepFactoriesUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.FinalizeKeepFactoriesUpdate( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "finalizeKeepFactoriesUpdate", + ) + } + + tbtcsLogger.Infof( + "submitted transaction finalizeKeepFactoriesUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallFinalizeKeepFactoriesUpdate( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "finalizeKeepFactoriesUpdate", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdateGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "finalizeKeepFactoriesUpdate", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogCreated( + _keepAddress common.Address, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logCreated", + "params: ", + fmt.Sprint( + _keepAddress, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.LogCreated( + transactorOptions, + _keepAddress, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logCreated", + _keepAddress, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logCreated with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogCreated( + transactorOptions, + _keepAddress, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logCreated", + _keepAddress, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logCreated with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogCreated( + _keepAddress common.Address, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logCreated", + &result, + _keepAddress, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogCreatedGasEstimate( + _keepAddress common.Address, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logCreated", + tbtcs.contractABI, + tbtcs.transactor, + _keepAddress, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogFunded( + _txid [32]uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logFunded", + "params: ", + fmt.Sprint( + _txid, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.LogFunded( + transactorOptions, + _txid, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logFunded", + _txid, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logFunded with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogFunded( + transactorOptions, + _txid, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logFunded", + _txid, + ) + } + + tbtcsLogger.Infof( + "submitted transaction logFunded with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogFunded( + _txid [32]uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logFunded", + &result, + _txid, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogFundedGasEstimate( + _txid [32]uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logFunded", + tbtcs.contractABI, + tbtcs.transactor, + _txid, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdate( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction finalizeCollateralizationThresholdsUpdate", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.FinalizeCollateralizationThresholdsUpdate( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "finalizeCollateralizationThresholdsUpdate", + ) + } + + tbtcsLogger.Infof( + "submitted transaction finalizeCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.FinalizeCollateralizationThresholdsUpdate( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "finalizeCollateralizationThresholdsUpdate", + ) + } + + tbtcsLogger.Infof( + "submitted transaction finalizeCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallFinalizeCollateralizationThresholdsUpdate( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "finalizeCollateralizationThresholdsUpdate", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdateGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "finalizeCollateralizationThresholdsUpdate", + tbtcs.contractABI, + tbtcs.transactor, + ) + + return result, err +} + +// ----- Const Methods ------ + +func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.GetUndercollateralizedThresholdPercent( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getUndercollateralizedThresholdPercent", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercentAtBlock( + blockNumber *big.Int, +) (uint16, error) { + var result uint16 + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getUndercollateralizedThresholdPercent", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTime() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingEthBtcPriceFeedAdditionTime( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getRemainingEthBtcPriceFeedAdditionTime", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTimeAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getRemainingEthBtcPriceFeedAdditionTime", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetInitialCollateralizedPercent() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.GetInitialCollateralizedPercent( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getInitialCollateralizedPercent", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetInitialCollateralizedPercentAtBlock( + blockNumber *big.Int, +) (uint16, error) { + var result uint16 + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getInitialCollateralizedPercent", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetAllowNewDeposits() (bool, error) { + var result bool + result, err := tbtcs.contract.GetAllowNewDeposits( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getAllowNewDeposits", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetAllowNewDepositsAtBlock( + blockNumber *big.Int, +) (bool, error) { + var result bool + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getAllowNewDeposits", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.GetSeverelyUndercollateralizedThresholdPercent( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getSeverelyUndercollateralizedThresholdPercent", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercentAtBlock( + blockNumber *big.Int, +) (uint16, error) { + var result uint16 + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getSeverelyUndercollateralizedThresholdPercent", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelay() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetPriceFeedGovernanceTimeDelay( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getPriceFeedGovernanceTimeDelay", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelayAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getPriceFeedGovernanceTimeDelay", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTime() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingKeepFactoriesUpdateTime( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getRemainingKeepFactoriesUpdateTime", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTimeAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getRemainingKeepFactoriesUpdateTime", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingPauseTerm() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingPauseTerm( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getRemainingPauseTerm", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingPauseTermAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getRemainingPauseTerm", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) Relay() (common.Address, error) { + var result common.Address + result, err := tbtcs.contract.Relay( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "relay", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) RelayAtBlock( + blockNumber *big.Int, +) (common.Address, error) { + var result common.Address + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "relay", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) ApprovedToLog( + _caller common.Address, +) (bool, error) { + var result bool + result, err := tbtcs.contract.ApprovedToLog( + tbtcs.callerOptions, + _caller, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "approvedToLog", + _caller, + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) ApprovedToLogAtBlock( + _caller common.Address, + blockNumber *big.Int, +) (bool, error) { + var result bool + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "approvedToLog", + &result, + _caller, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) FetchRelayPreviousDifficulty() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.FetchRelayPreviousDifficulty( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "fetchRelayPreviousDifficulty", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) FetchRelayPreviousDifficultyAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "fetchRelayPreviousDifficulty", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetMaximumLotSize() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetMaximumLotSize( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getMaximumLotSize", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetMaximumLotSizeAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getMaximumLotSize", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTime() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingSignerFeeDivisorUpdateTime( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getRemainingSignerFeeDivisorUpdateTime", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTimeAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getRemainingSignerFeeDivisorUpdateTime", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) FetchBitcoinPrice() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.FetchBitcoinPrice( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "fetchBitcoinPrice", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) FetchBitcoinPriceAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "fetchBitcoinPrice", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) IsAllowedLotSize( + _requestedLotSizeSatoshis uint64, +) (bool, error) { + var result bool + result, err := tbtcs.contract.IsAllowedLotSize( + tbtcs.callerOptions, + _requestedLotSizeSatoshis, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "isAllowedLotSize", + _requestedLotSizeSatoshis, + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) IsAllowedLotSizeAtBlock( + _requestedLotSizeSatoshis uint64, + blockNumber *big.Int, +) (bool, error) { + var result bool + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "isAllowedLotSize", + &result, + _requestedLotSizeSatoshis, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) Owner() (common.Address, error) { + var result common.Address + result, err := tbtcs.contract.Owner( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "owner", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) OwnerAtBlock( + blockNumber *big.Int, +) (common.Address, error) { + var result common.Address + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "owner", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetMinimumLotSize() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetMinimumLotSize( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getMinimumLotSize", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetMinimumLotSizeAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getMinimumLotSize", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) FetchRelayCurrentDifficulty() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.FetchRelayCurrentDifficulty( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "fetchRelayCurrentDifficulty", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) FetchRelayCurrentDifficultyAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "fetchRelayCurrentDifficulty", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriod() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetKeepFactoriesUpgradeabilityPeriod( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getKeepFactoriesUpgradeabilityPeriod", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriodAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getKeepFactoriesUpgradeabilityPeriod", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) PriceFeed() (common.Address, error) { + var result common.Address + result, err := tbtcs.contract.PriceFeed( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "priceFeed", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) PriceFeedAtBlock( + blockNumber *big.Int, +) (common.Address, error) { + var result common.Address + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "priceFeed", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetGovernanceTimeDelay() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetGovernanceTimeDelay( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getGovernanceTimeDelay", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetGovernanceTimeDelayAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getGovernanceTimeDelay", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTime() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingKeepFactoriesUpgradeabilityTime( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getRemainingKeepFactoriesUpgradeabilityTime", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTimeAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getRemainingKeepFactoriesUpgradeabilityTime", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTime() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingCollateralizationThresholdsUpdateTime( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getRemainingCollateralizationThresholdsUpdateTime", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTimeAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getRemainingCollateralizationThresholdsUpdateTime", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTime() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingLotSizesUpdateTime( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getRemainingLotSizesUpdateTime", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTimeAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getRemainingLotSizesUpdateTime", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetSignerFeeDivisor() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.GetSignerFeeDivisor( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getSignerFeeDivisor", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetSignerFeeDivisorAtBlock( + blockNumber *big.Int, +) (uint16, error) { + var result uint16 + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getSignerFeeDivisor", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) KeepSize() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.KeepSize( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "keepSize", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) KeepSizeAtBlock( + blockNumber *big.Int, +) (uint16, error) { + var result uint16 + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "keepSize", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetNewDepositFeeEstimate() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetNewDepositFeeEstimate( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getNewDepositFeeEstimate", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetNewDepositFeeEstimateAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getNewDepositFeeEstimate", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) IsOwner() (bool, error) { + var result bool + result, err := tbtcs.contract.IsOwner( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "isOwner", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) IsOwnerAtBlock( + blockNumber *big.Int, +) (bool, error) { + var result bool + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "isOwner", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) KeepThreshold() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.KeepThreshold( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "keepThreshold", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) KeepThresholdAtBlock( + blockNumber *big.Int, +) (uint16, error) { + var result uint16 + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "keepThreshold", + &result, + ) + + return result, err +} + +func (tbtcs *TBTCSystem) GetAllowedLotSizes() ([]uint64, error) { + var result []uint64 + result, err := tbtcs.contract.GetAllowedLotSizes( + tbtcs.callerOptions, + ) + + if err != nil { + return result, tbtcs.errorResolver.ResolveError( + err, + tbtcs.callerOptions.From, + nil, + "getAllowedLotSizes", + ) + } + + return result, err +} + +func (tbtcs *TBTCSystem) GetAllowedLotSizesAtBlock( + blockNumber *big.Int, +) ([]uint64, error) { + var result []uint64 + + err := ethutil.CallAtBlock( + tbtcs.callerOptions.From, + blockNumber, + nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "getAllowedLotSizes", + &result, + ) + + return result, err +} + +// ------ Events ------- + +type tBTCSystemExitedCourtesyCallFunc func( + DepositContractAddress common.Address, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchExitedCourtesyCall( + success tBTCSystemExitedCourtesyCallFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeExitedCourtesyCall( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event ExitedCourtesyCall terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeExitedCourtesyCall( + success tBTCSystemExitedCourtesyCallFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemExitedCourtesyCall) + eventSubscription, err := tbtcs.contract.WatchExitedCourtesyCall( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for ExitedCourtesyCall events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemLiquidatedFunc func( + DepositContractAddress common.Address, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchLiquidated( + success tBTCSystemLiquidatedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeLiquidated( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event Liquidated terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeLiquidated( + success tBTCSystemLiquidatedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemLiquidated) + eventSubscription, err := tbtcs.contract.WatchLiquidated( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for Liquidated events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemLotSizesUpdateStartedFunc func( + LotSizes []uint64, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchLotSizesUpdateStarted( + success tBTCSystemLotSizesUpdateStartedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeLotSizesUpdateStarted( + success, + failCallback, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event LotSizesUpdateStarted terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeLotSizesUpdateStarted( + success tBTCSystemLotSizesUpdateStartedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemLotSizesUpdateStarted) + eventSubscription, err := tbtcs.contract.WatchLotSizesUpdateStarted( + nil, + eventChan, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for LotSizesUpdateStarted events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.LotSizes, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemLotSizesUpdatedFunc func( + LotSizes []uint64, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchLotSizesUpdated( + success tBTCSystemLotSizesUpdatedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeLotSizesUpdated( + success, + failCallback, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event LotSizesUpdated terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeLotSizesUpdated( + success tBTCSystemLotSizesUpdatedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemLotSizesUpdated) + eventSubscription, err := tbtcs.contract.WatchLotSizesUpdated( + nil, + eventChan, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for LotSizesUpdated events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.LotSizes, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemSignerFeeDivisorUpdateStartedFunc func( + SignerFeeDivisor uint16, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdateStarted( + success tBTCSystemSignerFeeDivisorUpdateStartedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeSignerFeeDivisorUpdateStarted( + success, + failCallback, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event SignerFeeDivisorUpdateStarted terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdateStarted( + success tBTCSystemSignerFeeDivisorUpdateStartedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemSignerFeeDivisorUpdateStarted) + eventSubscription, err := tbtcs.contract.WatchSignerFeeDivisorUpdateStarted( + nil, + eventChan, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for SignerFeeDivisorUpdateStarted events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.SignerFeeDivisor, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemSignerFeeDivisorUpdatedFunc func( + SignerFeeDivisor uint16, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdated( + success tBTCSystemSignerFeeDivisorUpdatedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeSignerFeeDivisorUpdated( + success, + failCallback, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event SignerFeeDivisorUpdated terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdated( + success tBTCSystemSignerFeeDivisorUpdatedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemSignerFeeDivisorUpdated) + eventSubscription, err := tbtcs.contract.WatchSignerFeeDivisorUpdated( + nil, + eventChan, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for SignerFeeDivisorUpdated events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.SignerFeeDivisor, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemCourtesyCalledFunc func( + DepositContractAddress common.Address, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchCourtesyCalled( + success tBTCSystemCourtesyCalledFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeCourtesyCalled( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event CourtesyCalled terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeCourtesyCalled( + success tBTCSystemCourtesyCalledFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemCourtesyCalled) + eventSubscription, err := tbtcs.contract.WatchCourtesyCalled( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for CourtesyCalled events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemKeepFactoriesUpdateStartedFunc func( + KeepStakedFactory common.Address, + FullyBackedFactory common.Address, + FactorySelector common.Address, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdateStarted( + success tBTCSystemKeepFactoriesUpdateStartedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeKeepFactoriesUpdateStarted( + success, + failCallback, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event KeepFactoriesUpdateStarted terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdateStarted( + success tBTCSystemKeepFactoriesUpdateStartedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemKeepFactoriesUpdateStarted) + eventSubscription, err := tbtcs.contract.WatchKeepFactoriesUpdateStarted( + nil, + eventChan, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for KeepFactoriesUpdateStarted events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.KeepStakedFactory, + event.FullyBackedFactory, + event.FactorySelector, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemRedeemedFunc func( + DepositContractAddress common.Address, + Txid [32]uint8, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchRedeemed( + success tBTCSystemRedeemedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeRedeemed( + success, + failCallback, + _depositContractAddressFilter, + _txidFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event Redeemed terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeRedeemed( + success tBTCSystemRedeemedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemRedeemed) + eventSubscription, err := tbtcs.contract.WatchRedeemed( + nil, + eventChan, + _depositContractAddressFilter, + _txidFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for Redeemed events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.Txid, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemRedemptionRequestedFunc func( + DepositContractAddress common.Address, + Requester common.Address, + Digest [32]uint8, + UtxoValue *big.Int, + RedeemerOutputScript []uint8, + RequestedFee *big.Int, + Outpoint []uint8, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchRedemptionRequested( + success tBTCSystemRedemptionRequestedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _requesterFilter []common.Address, + _digestFilter [][32]uint8, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeRedemptionRequested( + success, + failCallback, + _depositContractAddressFilter, + _requesterFilter, + _digestFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event RedemptionRequested terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeRedemptionRequested( + success tBTCSystemRedemptionRequestedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _requesterFilter []common.Address, + _digestFilter [][32]uint8, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemRedemptionRequested) + eventSubscription, err := tbtcs.contract.WatchRedemptionRequested( + nil, + eventChan, + _depositContractAddressFilter, + _requesterFilter, + _digestFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for RedemptionRequested events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.Requester, + event.Digest, + event.UtxoValue, + event.RedeemerOutputScript, + event.RequestedFee, + event.Outpoint, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemRegisteredPubkeyFunc func( + DepositContractAddress common.Address, + SigningGroupPubkeyX [32]uint8, + SigningGroupPubkeyY [32]uint8, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchRegisteredPubkey( + success tBTCSystemRegisteredPubkeyFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeRegisteredPubkey( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event RegisteredPubkey terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeRegisteredPubkey( + success tBTCSystemRegisteredPubkeyFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemRegisteredPubkey) + eventSubscription, err := tbtcs.contract.WatchRegisteredPubkey( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for RegisteredPubkey events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.SigningGroupPubkeyX, + event.SigningGroupPubkeyY, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemSetupFailedFunc func( + DepositContractAddress common.Address, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchSetupFailed( + success tBTCSystemSetupFailedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeSetupFailed( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event SetupFailed terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeSetupFailed( + success tBTCSystemSetupFailedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemSetupFailed) + eventSubscription, err := tbtcs.contract.WatchSetupFailed( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for SetupFailed events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemFraudDuringSetupFunc func( + DepositContractAddress common.Address, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchFraudDuringSetup( + success tBTCSystemFraudDuringSetupFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeFraudDuringSetup( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event FraudDuringSetup terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeFraudDuringSetup( + success tBTCSystemFraudDuringSetupFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemFraudDuringSetup) + eventSubscription, err := tbtcs.contract.WatchFraudDuringSetup( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for FraudDuringSetup events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemCollateralizationThresholdsUpdatedFunc func( + InitialCollateralizedPercent uint16, + UndercollateralizedThresholdPercent uint16, + SeverelyUndercollateralizedThresholdPercent uint16, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdated( + success tBTCSystemCollateralizationThresholdsUpdatedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeCollateralizationThresholdsUpdated( + success, + failCallback, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event CollateralizationThresholdsUpdated terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdated( + success tBTCSystemCollateralizationThresholdsUpdatedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemCollateralizationThresholdsUpdated) + eventSubscription, err := tbtcs.contract.WatchCollateralizationThresholdsUpdated( + nil, + eventChan, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for CollateralizationThresholdsUpdated events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.InitialCollateralizedPercent, + event.UndercollateralizedThresholdPercent, + event.SeverelyUndercollateralizedThresholdPercent, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemCreatedFunc func( + DepositContractAddress common.Address, + KeepAddress common.Address, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchCreated( + success tBTCSystemCreatedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _keepAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeCreated( + success, + failCallback, + _depositContractAddressFilter, + _keepAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event Created terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeCreated( + success tBTCSystemCreatedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _keepAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemCreated) + eventSubscription, err := tbtcs.contract.WatchCreated( + nil, + eventChan, + _depositContractAddressFilter, + _keepAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for Created events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.KeepAddress, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemFundedFunc func( + DepositContractAddress common.Address, + Txid [32]uint8, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchFunded( + success tBTCSystemFundedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeFunded( + success, + failCallback, + _depositContractAddressFilter, + _txidFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event Funded terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeFunded( + success tBTCSystemFundedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemFunded) + eventSubscription, err := tbtcs.contract.WatchFunded( + nil, + eventChan, + _depositContractAddressFilter, + _txidFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for Funded events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.Txid, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemGotRedemptionSignatureFunc func( + DepositContractAddress common.Address, + Digest [32]uint8, + R [32]uint8, + S [32]uint8, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchGotRedemptionSignature( + success tBTCSystemGotRedemptionSignatureFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _digestFilter [][32]uint8, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeGotRedemptionSignature( + success, + failCallback, + _depositContractAddressFilter, + _digestFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event GotRedemptionSignature terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeGotRedemptionSignature( + success tBTCSystemGotRedemptionSignatureFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, + _digestFilter [][32]uint8, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemGotRedemptionSignature) + eventSubscription, err := tbtcs.contract.WatchGotRedemptionSignature( + nil, + eventChan, + _depositContractAddressFilter, + _digestFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for GotRedemptionSignature events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.Digest, + event.R, + event.S, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemKeepFactoriesUpdatedFunc func( + KeepStakedFactory common.Address, + FullyBackedFactory common.Address, + FactorySelector common.Address, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdated( + success tBTCSystemKeepFactoriesUpdatedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeKeepFactoriesUpdated( + success, + failCallback, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event KeepFactoriesUpdated terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdated( + success tBTCSystemKeepFactoriesUpdatedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemKeepFactoriesUpdated) + eventSubscription, err := tbtcs.contract.WatchKeepFactoriesUpdated( + nil, + eventChan, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for KeepFactoriesUpdated events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.KeepStakedFactory, + event.FullyBackedFactory, + event.FactorySelector, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemStartedLiquidationFunc func( + DepositContractAddress common.Address, + WasFraud bool, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchStartedLiquidation( + success tBTCSystemStartedLiquidationFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeStartedLiquidation( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event StartedLiquidation terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeStartedLiquidation( + success tBTCSystemStartedLiquidationFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemStartedLiquidation) + eventSubscription, err := tbtcs.contract.WatchStartedLiquidation( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for StartedLiquidation events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.WasFraud, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemCollateralizationThresholdsUpdateStartedFunc func( + InitialCollateralizedPercent uint16, + UndercollateralizedThresholdPercent uint16, + SeverelyUndercollateralizedThresholdPercent uint16, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdateStarted( + success tBTCSystemCollateralizationThresholdsUpdateStartedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeCollateralizationThresholdsUpdateStarted( + success, + failCallback, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event CollateralizationThresholdsUpdateStarted terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdateStarted( + success tBTCSystemCollateralizationThresholdsUpdateStartedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemCollateralizationThresholdsUpdateStarted) + eventSubscription, err := tbtcs.contract.WatchCollateralizationThresholdsUpdateStarted( + nil, + eventChan, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for CollateralizationThresholdsUpdateStarted events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.InitialCollateralizedPercent, + event.UndercollateralizedThresholdPercent, + event.SeverelyUndercollateralizedThresholdPercent, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemEthBtcPriceFeedAddedFunc func( + PriceFeed common.Address, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdded( + success tBTCSystemEthBtcPriceFeedAddedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeEthBtcPriceFeedAdded( + success, + failCallback, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event EthBtcPriceFeedAdded terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdded( + success tBTCSystemEthBtcPriceFeedAddedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemEthBtcPriceFeedAdded) + eventSubscription, err := tbtcs.contract.WatchEthBtcPriceFeedAdded( + nil, + eventChan, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for EthBtcPriceFeedAdded events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.PriceFeed, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemEthBtcPriceFeedAdditionStartedFunc func( + PriceFeed common.Address, + Timestamp *big.Int, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdditionStarted( + success tBTCSystemEthBtcPriceFeedAdditionStartedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeEthBtcPriceFeedAdditionStarted( + success, + failCallback, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event EthBtcPriceFeedAdditionStarted terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdditionStarted( + success tBTCSystemEthBtcPriceFeedAdditionStartedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemEthBtcPriceFeedAdditionStarted) + eventSubscription, err := tbtcs.contract.WatchEthBtcPriceFeedAdditionStarted( + nil, + eventChan, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for EthBtcPriceFeedAdditionStarted events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.PriceFeed, + event.Timestamp, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemFunderAbortRequestedFunc func( + DepositContractAddress common.Address, + AbortOutputScript []uint8, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchFunderAbortRequested( + success tBTCSystemFunderAbortRequestedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeFunderAbortRequested( + success, + failCallback, + _depositContractAddressFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event FunderAbortRequested terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeFunderAbortRequested( + success tBTCSystemFunderAbortRequestedFunc, + fail func(err error) error, + _depositContractAddressFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemFunderAbortRequested) + eventSubscription, err := tbtcs.contract.WatchFunderAbortRequested( + nil, + eventChan, + _depositContractAddressFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for FunderAbortRequested events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.DepositContractAddress, + event.AbortOutputScript, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemOwnershipTransferredFunc func( + PreviousOwner common.Address, + NewOwner common.Address, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchOwnershipTransferred( + success tBTCSystemOwnershipTransferredFunc, + fail func(err error) error, + previousOwnerFilter []common.Address, + newOwnerFilter []common.Address, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeOwnershipTransferred( + success, + failCallback, + previousOwnerFilter, + newOwnerFilter, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event OwnershipTransferred terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeOwnershipTransferred( + success tBTCSystemOwnershipTransferredFunc, + fail func(err error) error, + previousOwnerFilter []common.Address, + newOwnerFilter []common.Address, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemOwnershipTransferred) + eventSubscription, err := tbtcs.contract.WatchOwnershipTransferred( + nil, + eventChan, + previousOwnerFilter, + newOwnerFilter, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for OwnershipTransferred events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.PreviousOwner, + event.NewOwner, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemAllowNewDepositsUpdatedFunc func( + AllowNewDeposits bool, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) WatchAllowNewDepositsUpdated( + success tBTCSystemAllowNewDepositsUpdatedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + errorChan := make(chan error) + unsubscribeChan := make(chan struct{}) + + // Delay which must be preserved before a new resubscription attempt. + // There is no sense to resubscribe immediately after the fail of current + // subscription because the publisher must have some time to recover. + retryDelay := 5 * time.Second + + watch := func() { + failCallback := func(err error) error { + fail(err) + errorChan <- err // trigger resubscription signal + return err + } + + subscription, err := tbtcs.subscribeAllowNewDepositsUpdated( + success, + failCallback, + ) + if err != nil { + errorChan <- err // trigger resubscription signal + return + } + + // wait for unsubscription signal + <-unsubscribeChan + subscription.Unsubscribe() + } + + // trigger the resubscriber goroutine + go func() { + go watch() // trigger first subscription + + for { + select { + case <-errorChan: + tbtcsLogger.Warning( + "subscription to event AllowNewDepositsUpdated terminated with error; " + + "resubscription attempt will be performed after the retry delay", + ) + time.Sleep(retryDelay) + go watch() + case <-unsubscribeChan: + // shutdown the resubscriber goroutine on unsubscribe signal + return + } + } + }() + + // closing the unsubscribeChan will trigger a unsubscribe signal and + // run unsubscription for all subscription instances + unsubscribeCallback := func() { + close(unsubscribeChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +func (tbtcs *TBTCSystem) subscribeAllowNewDepositsUpdated( + success tBTCSystemAllowNewDepositsUpdatedFunc, + fail func(err error) error, +) (subscription.EventSubscription, error) { + eventChan := make(chan *abi.TBTCSystemAllowNewDepositsUpdated) + eventSubscription, err := tbtcs.contract.WatchAllowNewDepositsUpdated( + nil, + eventChan, + ) + if err != nil { + close(eventChan) + return eventSubscription, fmt.Errorf( + "error creating watch for AllowNewDepositsUpdated events: [%v]", + err, + ) + } + + var subscriptionMutex = &sync.Mutex{} + + go func() { + for { + select { + case event, subscribed := <-eventChan: + subscriptionMutex.Lock() + // if eventChan has been closed, it means we have unsubscribed + if !subscribed { + subscriptionMutex.Unlock() + return + } + success( + event.AllowNewDeposits, + event.Raw.BlockNumber, + ) + subscriptionMutex.Unlock() + case ee := <-eventSubscription.Err(): + fail(ee) + return + } + } + }() + + unsubscribeCallback := func() { + subscriptionMutex.Lock() + defer subscriptionMutex.Unlock() + + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} diff --git a/go/gen.go b/go/gen.go index e63e947f1..1db66cb5d 100644 --- a/go/gen.go +++ b/go/gen.go @@ -1,3 +1,3 @@ package gen -//go:generate ./generate.sh +//go:generate sh -c "SOLIDITY_DIR=../solidity SOLIDITY_FILES='deposit/Deposit.sol system/TBTCSystem.sol' make" diff --git a/go/generate.sh b/go/generate.sh deleted file mode 100755 index 97d6b956e..000000000 --- a/go/generate.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -DIR=../solidity - -# Source contracts for binding generation. -# They should include the subdirectory prefix if any. -FILES="DepositLog.sol deposit/Deposit.sol" - -SOLIDITY_DIR=$DIR SOLIDITY_FILES=$FILES make From c606d6ccc6a0a59d58cde82edc8a2fae25b79a86 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Mon, 19 Oct 2020 13:07:51 +0200 Subject: [PATCH 08/14] Add docs to the bindings Makefile --- go/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/go/Makefile b/go/Makefile index 0efae55a3..1068fe650 100644 --- a/go/Makefile +++ b/go/Makefile @@ -1,9 +1,15 @@ +# Environment `SOLIDITY_DIR` provides the solidity directory as a +# potentially-relative path, which we resolve. However, because +# Solidity files are grouped into separate subdirectories, specific +# files must be provided explicitly via `SOLIDITY_FILES` variable +# to handle them in a correct way. solidity_dir=$(realpath ${SOLIDITY_DIR}) solidity_files := $(foreach file,${SOLIDITY_FILES},$(file)) # Solidity filenames without .sol with subdirectories prefixes. contract_stems := $(basename $(solidity_files)) - +# Go abigen bindings in abi/ subdirectory with .go suffix, alongside solc ABI +# files with .abi suffix. abi_files := $(addprefix abi/,$(addsuffix .abi,$(contract_stems))) abigen_files := $(addprefix abi/,$(addsuffix .go,$(contract_stems))) contract_files := $(addprefix contract/,$(addsuffix .go,$(contract_stems))) From 5fc16fd63d6c6e7127149b0de41df925b48683a6 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Mon, 19 Oct 2020 13:09:45 +0200 Subject: [PATCH 09/14] Move bindings to `pkg/chain/ethereum/gen` --- {go => pkg/chain/ethereum/gen}/Makefile | 0 {go => pkg/chain/ethereum/gen}/abi/deposit/Deposit.go | 0 {go => pkg/chain/ethereum/gen}/abi/system/TBTCSystem.go | 0 {go => pkg/chain/ethereum/gen}/cmd/.keep | 0 {go => pkg/chain/ethereum/gen}/cmd/Deposit.go | 0 {go => pkg/chain/ethereum/gen}/cmd/TBTCSystem.go | 0 {go => pkg/chain/ethereum/gen}/contract/.keep | 0 {go => pkg/chain/ethereum/gen}/contract/Deposit.go | 0 {go => pkg/chain/ethereum/gen}/contract/TBTCSystem.go | 0 {go => pkg/chain/ethereum/gen}/gen.go | 0 {go => pkg/chain/ethereum/gen}/go.mod | 0 {go => pkg/chain/ethereum/gen}/go.sum | 0 12 files changed, 0 insertions(+), 0 deletions(-) rename {go => pkg/chain/ethereum/gen}/Makefile (100%) rename {go => pkg/chain/ethereum/gen}/abi/deposit/Deposit.go (100%) rename {go => pkg/chain/ethereum/gen}/abi/system/TBTCSystem.go (100%) rename {go => pkg/chain/ethereum/gen}/cmd/.keep (100%) rename {go => pkg/chain/ethereum/gen}/cmd/Deposit.go (100%) rename {go => pkg/chain/ethereum/gen}/cmd/TBTCSystem.go (100%) rename {go => pkg/chain/ethereum/gen}/contract/.keep (100%) rename {go => pkg/chain/ethereum/gen}/contract/Deposit.go (100%) rename {go => pkg/chain/ethereum/gen}/contract/TBTCSystem.go (100%) rename {go => pkg/chain/ethereum/gen}/gen.go (100%) rename {go => pkg/chain/ethereum/gen}/go.mod (100%) rename {go => pkg/chain/ethereum/gen}/go.sum (100%) diff --git a/go/Makefile b/pkg/chain/ethereum/gen/Makefile similarity index 100% rename from go/Makefile rename to pkg/chain/ethereum/gen/Makefile diff --git a/go/abi/deposit/Deposit.go b/pkg/chain/ethereum/gen/abi/deposit/Deposit.go similarity index 100% rename from go/abi/deposit/Deposit.go rename to pkg/chain/ethereum/gen/abi/deposit/Deposit.go diff --git a/go/abi/system/TBTCSystem.go b/pkg/chain/ethereum/gen/abi/system/TBTCSystem.go similarity index 100% rename from go/abi/system/TBTCSystem.go rename to pkg/chain/ethereum/gen/abi/system/TBTCSystem.go diff --git a/go/cmd/.keep b/pkg/chain/ethereum/gen/cmd/.keep similarity index 100% rename from go/cmd/.keep rename to pkg/chain/ethereum/gen/cmd/.keep diff --git a/go/cmd/Deposit.go b/pkg/chain/ethereum/gen/cmd/Deposit.go similarity index 100% rename from go/cmd/Deposit.go rename to pkg/chain/ethereum/gen/cmd/Deposit.go diff --git a/go/cmd/TBTCSystem.go b/pkg/chain/ethereum/gen/cmd/TBTCSystem.go similarity index 100% rename from go/cmd/TBTCSystem.go rename to pkg/chain/ethereum/gen/cmd/TBTCSystem.go diff --git a/go/contract/.keep b/pkg/chain/ethereum/gen/contract/.keep similarity index 100% rename from go/contract/.keep rename to pkg/chain/ethereum/gen/contract/.keep diff --git a/go/contract/Deposit.go b/pkg/chain/ethereum/gen/contract/Deposit.go similarity index 100% rename from go/contract/Deposit.go rename to pkg/chain/ethereum/gen/contract/Deposit.go diff --git a/go/contract/TBTCSystem.go b/pkg/chain/ethereum/gen/contract/TBTCSystem.go similarity index 100% rename from go/contract/TBTCSystem.go rename to pkg/chain/ethereum/gen/contract/TBTCSystem.go diff --git a/go/gen.go b/pkg/chain/ethereum/gen/gen.go similarity index 100% rename from go/gen.go rename to pkg/chain/ethereum/gen/gen.go diff --git a/go/go.mod b/pkg/chain/ethereum/gen/go.mod similarity index 100% rename from go/go.mod rename to pkg/chain/ethereum/gen/go.mod diff --git a/go/go.sum b/pkg/chain/ethereum/gen/go.sum similarity index 100% rename from go/go.sum rename to pkg/chain/ethereum/gen/go.sum From 94c079d3a95fbfa9a6a37d9f4a3792506412116d Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Mon, 19 Oct 2020 13:21:26 +0200 Subject: [PATCH 10/14] Regenerate bindings --- .gitignore | 2 +- pkg/chain/ethereum/gen/cmd/Deposit.go | 368 +-- pkg/chain/ethereum/gen/cmd/TBTCSystem.go | 636 ++-- pkg/chain/ethereum/gen/contract/Deposit.go | 1726 +++++------ pkg/chain/ethereum/gen/contract/TBTCSystem.go | 2688 ++++++++--------- pkg/chain/ethereum/gen/gen.go | 2 +- 6 files changed, 2711 insertions(+), 2711 deletions(-) diff --git a/.gitignore b/.gitignore index e87e4f831..add318d06 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,7 @@ __pycache__/ node_modules/ artifacts/ .mypy_cache -go/abi/**/*.abi +pkg/chain/ethereum/gen/abi/**/*.abi # Visual Studio Code *.code-workspace diff --git a/pkg/chain/ethereum/gen/cmd/Deposit.go b/pkg/chain/ethereum/gen/cmd/Deposit.go index f1633fc2a..1f5308119 100644 --- a/pkg/chain/ethereum/gen/cmd/Deposit.go +++ b/pkg/chain/ethereum/gen/cmd/Deposit.go @@ -52,24 +52,38 @@ func init() { Usage: `Provides access to the Deposit contract.`, Description: depositDescription, Subcommands: []cli.Command{{ - Name: "initial-collateralized-percent", - Usage: "Calls the constant method initialCollateralizedPercent on the Deposit contract.", + Name: "severely-undercollateralized-threshold-percent", + Usage: "Calls the constant method severelyUndercollateralizedThresholdPercent on the Deposit contract.", ArgsUsage: "", - Action: dInitialCollateralizedPercent, + Action: dSeverelyUndercollateralizedThresholdPercent, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "lot-size-tbtc", - Usage: "Calls the constant method lotSizeTbtc on the Deposit contract.", + Name: "lot-size-satoshis", + Usage: "Calls the constant method lotSizeSatoshis on the Deposit contract.", ArgsUsage: "", - Action: dLotSizeTbtc, + Action: dLotSizeSatoshis, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "signer-fee-tbtc", - Usage: "Calls the constant method signerFeeTbtc on the Deposit contract.", + Name: "current-state", + Usage: "Calls the constant method currentState on the Deposit contract.", ArgsUsage: "", - Action: dSignerFeeTbtc, + Action: dCurrentState, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "keep-address", + Usage: "Calls the constant method keepAddress on the Deposit contract.", + ArgsUsage: "", + Action: dKeepAddress, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "undercollateralized-threshold-percent", + Usage: "Calls the constant method undercollateralizedThresholdPercent on the Deposit contract.", + ArgsUsage: "", + Action: dUndercollateralizedThresholdPercent, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { @@ -87,17 +101,10 @@ func init() { Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-owner-redemption-tbtc-requirement", - Usage: "Calls the constant method getOwnerRedemptionTbtcRequirement on the Deposit contract.", - ArgsUsage: "[_redeemer] ", - Action: dGetOwnerRedemptionTbtcRequirement, - Before: cmd.ArgCountChecker(1), - Flags: cmd.ConstFlags, - }, { - Name: "lot-size-satoshis", - Usage: "Calls the constant method lotSizeSatoshis on the Deposit contract.", + Name: "funding-info", + Usage: "Calls the constant method fundingInfo on the Deposit contract.", ArgsUsage: "", - Action: dLotSizeSatoshis, + Action: dFundingInfo, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { @@ -108,24 +115,24 @@ func init() { Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "undercollateralized-threshold-percent", - Usage: "Calls the constant method undercollateralizedThresholdPercent on the Deposit contract.", + Name: "signer-fee-tbtc", + Usage: "Calls the constant method signerFeeTbtc on the Deposit contract.", ArgsUsage: "", - Action: dUndercollateralizedThresholdPercent, + Action: dSignerFeeTbtc, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "in-active", - Usage: "Calls the constant method inActive on the Deposit contract.", - ArgsUsage: "", - Action: dInActive, - Before: cmd.ArgCountChecker(0), + Name: "get-owner-redemption-tbtc-requirement", + Usage: "Calls the constant method getOwnerRedemptionTbtcRequirement on the Deposit contract.", + ArgsUsage: "[_redeemer] ", + Action: dGetOwnerRedemptionTbtcRequirement, + Before: cmd.ArgCountChecker(1), Flags: cmd.ConstFlags, }, { - Name: "funding-info", - Usage: "Calls the constant method fundingInfo on the Deposit contract.", + Name: "initial-collateralized-percent", + Usage: "Calls the constant method initialCollateralizedPercent on the Deposit contract.", ArgsUsage: "", - Action: dFundingInfo, + Action: dInitialCollateralizedPercent, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { @@ -135,6 +142,20 @@ func init() { Action: dRemainingTerm, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, + }, { + Name: "in-active", + Usage: "Calls the constant method inActive on the Deposit contract.", + ArgsUsage: "", + Action: dInActive, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "lot-size-tbtc", + Usage: "Calls the constant method lotSizeTbtc on the Deposit contract.", + ArgsUsage: "", + Action: dLotSizeTbtc, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, }, { Name: "get-redemption-tbtc-requirement", Usage: "Calls the constant method getRedemptionTbtcRequirement on the Deposit contract.", @@ -142,13 +163,6 @@ func init() { Action: dGetRedemptionTbtcRequirement, Before: cmd.ArgCountChecker(1), Flags: cmd.ConstFlags, - }, { - Name: "keep-address", - Usage: "Calls the constant method keepAddress on the Deposit contract.", - ArgsUsage: "", - Action: dKeepAddress, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, }, { Name: "utxo-value", Usage: "Calls the constant method utxoValue on the Deposit contract.", @@ -157,24 +171,17 @@ func init() { Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "current-state", - Usage: "Calls the constant method currentState on the Deposit contract.", - ArgsUsage: "", - Action: dCurrentState, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "severely-undercollateralized-threshold-percent", - Usage: "Calls the constant method severelyUndercollateralizedThresholdPercent on the Deposit contract.", + Name: "exit-courtesy-call", + Usage: "Calls the method exitCourtesyCall on the Deposit contract.", ArgsUsage: "", - Action: dSeverelyUndercollateralizedThresholdPercent, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, + Action: dExitCourtesyCall, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, }, { - Name: "notify-courtesy-call", - Usage: "Calls the method notifyCourtesyCall on the Deposit contract.", + Name: "notify-funding-timed-out", + Usage: "Calls the method notifyFundingTimedOut on the Deposit contract.", ArgsUsage: "", - Action: dNotifyCourtesyCall, + Action: dNotifyFundingTimedOut, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { @@ -185,24 +192,17 @@ func init() { Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "exit-courtesy-call", - Usage: "Calls the method exitCourtesyCall on the Deposit contract.", - ArgsUsage: "", - Action: dExitCourtesyCall, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "notify-courtesy-call-expired", - Usage: "Calls the method notifyCourtesyCallExpired on the Deposit contract.", + Name: "notify-redemption-proof-timed-out", + Usage: "Calls the method notifyRedemptionProofTimedOut on the Deposit contract.", ArgsUsage: "", - Action: dNotifyCourtesyCallExpired, + Action: dNotifyRedemptionProofTimedOut, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "notify-redemption-proof-timed-out", - Usage: "Calls the method notifyRedemptionProofTimedOut on the Deposit contract.", + Name: "notify-signer-setup-failed", + Usage: "Calls the method notifySignerSetupFailed on the Deposit contract.", ArgsUsage: "", - Action: dNotifyRedemptionProofTimedOut, + Action: dNotifySignerSetupFailed, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { @@ -213,26 +213,33 @@ func init() { Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), Flags: cmd.NonConstFlags, }, { - Name: "retrieve-signer-pubkey", - Usage: "Calls the method retrieveSignerPubkey on the Deposit contract.", + Name: "notify-courtesy-call-expired", + Usage: "Calls the method notifyCourtesyCallExpired on the Deposit contract.", ArgsUsage: "", - Action: dRetrieveSignerPubkey, + Action: dNotifyCourtesyCallExpired, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "notify-funding-timed-out", - Usage: "Calls the method notifyFundingTimedOut on the Deposit contract.", + Name: "purchase-signer-bonds-at-auction", + Usage: "Calls the method purchaseSignerBondsAtAuction on the Deposit contract.", ArgsUsage: "", - Action: dNotifyFundingTimedOut, + Action: dPurchaseSignerBondsAtAuction, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "purchase-signer-bonds-at-auction", - Usage: "Calls the method purchaseSignerBondsAtAuction on the Deposit contract.", + Name: "retrieve-signer-pubkey", + Usage: "Calls the method retrieveSignerPubkey on the Deposit contract.", ArgsUsage: "", - Action: dPurchaseSignerBondsAtAuction, + Action: dRetrieveSignerPubkey, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, + }, { + Name: "initialize", + Usage: "Calls the method initialize on the Deposit contract.", + ArgsUsage: "[_factory] ", + Action: dInitialize, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), + Flags: cmd.NonConstFlags, }, { Name: "notify-redemption-signature-timed-out", Usage: "Calls the method notifyRedemptionSignatureTimedOut on the Deposit contract.", @@ -241,24 +248,17 @@ func init() { Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "withdraw-funds", - Usage: "Calls the method withdrawFunds on the Deposit contract.", + Name: "notify-courtesy-call", + Usage: "Calls the method notifyCourtesyCall on the Deposit contract.", ArgsUsage: "", - Action: dWithdrawFunds, + Action: dNotifyCourtesyCall, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "initialize", - Usage: "Calls the method initialize on the Deposit contract.", - ArgsUsage: "[_factory] ", - Action: dInitialize, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), - Flags: cmd.NonConstFlags, - }, { - Name: "notify-signer-setup-failed", - Usage: "Calls the method notifySignerSetupFailed on the Deposit contract.", + Name: "withdraw-funds", + Usage: "Calls the method withdrawFunds on the Deposit contract.", ArgsUsage: "", - Action: dNotifySignerSetupFailed, + Action: dWithdrawFunds, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }}, @@ -267,13 +267,13 @@ func init() { /// ------------------- Const methods ------------------- -func dInitialCollateralizedPercent(c *cli.Context) error { +func dSeverelyUndercollateralizedThresholdPercent(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.InitialCollateralizedPercentAtBlock( + result, err := contract.SeverelyUndercollateralizedThresholdPercentAtBlock( cmd.BlockFlagValue.Uint, ) @@ -287,13 +287,13 @@ func dInitialCollateralizedPercent(c *cli.Context) error { return nil } -func dLotSizeTbtc(c *cli.Context) error { +func dLotSizeSatoshis(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.LotSizeTbtcAtBlock( + result, err := contract.LotSizeSatoshisAtBlock( cmd.BlockFlagValue.Uint, ) @@ -307,13 +307,13 @@ func dLotSizeTbtc(c *cli.Context) error { return nil } -func dSignerFeeTbtc(c *cli.Context) error { +func dCurrentState(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.SignerFeeTbtcAtBlock( + result, err := contract.CurrentStateAtBlock( cmd.BlockFlagValue.Uint, ) @@ -327,13 +327,13 @@ func dSignerFeeTbtc(c *cli.Context) error { return nil } -func dWithdrawableAmount(c *cli.Context) error { +func dKeepAddress(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.WithdrawableAmountAtBlock( + result, err := contract.KeepAddressAtBlock( cmd.BlockFlagValue.Uint, ) @@ -347,13 +347,13 @@ func dWithdrawableAmount(c *cli.Context) error { return nil } -func dCollateralizationPercentage(c *cli.Context) error { +func dUndercollateralizedThresholdPercent(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.CollateralizationPercentageAtBlock( + result, err := contract.UndercollateralizedThresholdPercentAtBlock( cmd.BlockFlagValue.Uint, ) @@ -367,21 +367,13 @@ func dCollateralizationPercentage(c *cli.Context) error { return nil } -func dGetOwnerRedemptionTbtcRequirement(c *cli.Context) error { +func dWithdrawableAmount(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - _redeemer, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _redeemer, a address, from passed value %v", - c.Args()[0], - ) - } - result, err := contract.GetOwnerRedemptionTbtcRequirementAtBlock( - _redeemer, + result, err := contract.WithdrawableAmountAtBlock( cmd.BlockFlagValue.Uint, ) @@ -395,13 +387,13 @@ func dGetOwnerRedemptionTbtcRequirement(c *cli.Context) error { return nil } -func dLotSizeSatoshis(c *cli.Context) error { +func dCollateralizationPercentage(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.LotSizeSatoshisAtBlock( + result, err := contract.CollateralizationPercentageAtBlock( cmd.BlockFlagValue.Uint, ) @@ -415,13 +407,13 @@ func dLotSizeSatoshis(c *cli.Context) error { return nil } -func dAuctionValue(c *cli.Context) error { +func dFundingInfo(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.AuctionValueAtBlock( + result, err := contract.FundingInfoAtBlock( cmd.BlockFlagValue.Uint, ) @@ -435,13 +427,13 @@ func dAuctionValue(c *cli.Context) error { return nil } -func dUndercollateralizedThresholdPercent(c *cli.Context) error { +func dAuctionValue(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.UndercollateralizedThresholdPercentAtBlock( + result, err := contract.AuctionValueAtBlock( cmd.BlockFlagValue.Uint, ) @@ -455,13 +447,13 @@ func dUndercollateralizedThresholdPercent(c *cli.Context) error { return nil } -func dInActive(c *cli.Context) error { +func dSignerFeeTbtc(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.InActiveAtBlock( + result, err := contract.SignerFeeTbtcAtBlock( cmd.BlockFlagValue.Uint, ) @@ -475,13 +467,21 @@ func dInActive(c *cli.Context) error { return nil } -func dFundingInfo(c *cli.Context) error { +func dGetOwnerRedemptionTbtcRequirement(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } + _redeemer, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _redeemer, a address, from passed value %v", + c.Args()[0], + ) + } - result, err := contract.FundingInfoAtBlock( + result, err := contract.GetOwnerRedemptionTbtcRequirementAtBlock( + _redeemer, cmd.BlockFlagValue.Uint, ) @@ -495,13 +495,13 @@ func dFundingInfo(c *cli.Context) error { return nil } -func dRemainingTerm(c *cli.Context) error { +func dInitialCollateralizedPercent(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.RemainingTermAtBlock( + result, err := contract.InitialCollateralizedPercentAtBlock( cmd.BlockFlagValue.Uint, ) @@ -515,21 +515,13 @@ func dRemainingTerm(c *cli.Context) error { return nil } -func dGetRedemptionTbtcRequirement(c *cli.Context) error { +func dRemainingTerm(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - _redeemer, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _redeemer, a address, from passed value %v", - c.Args()[0], - ) - } - result, err := contract.GetRedemptionTbtcRequirementAtBlock( - _redeemer, + result, err := contract.RemainingTermAtBlock( cmd.BlockFlagValue.Uint, ) @@ -543,13 +535,13 @@ func dGetRedemptionTbtcRequirement(c *cli.Context) error { return nil } -func dKeepAddress(c *cli.Context) error { +func dInActive(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.KeepAddressAtBlock( + result, err := contract.InActiveAtBlock( cmd.BlockFlagValue.Uint, ) @@ -563,13 +555,13 @@ func dKeepAddress(c *cli.Context) error { return nil } -func dUtxoValue(c *cli.Context) error { +func dLotSizeTbtc(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.UtxoValueAtBlock( + result, err := contract.LotSizeTbtcAtBlock( cmd.BlockFlagValue.Uint, ) @@ -583,13 +575,21 @@ func dUtxoValue(c *cli.Context) error { return nil } -func dCurrentState(c *cli.Context) error { +func dGetRedemptionTbtcRequirement(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } + _redeemer, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _redeemer, a address, from passed value %v", + c.Args()[0], + ) + } - result, err := contract.CurrentStateAtBlock( + result, err := contract.GetRedemptionTbtcRequirementAtBlock( + _redeemer, cmd.BlockFlagValue.Uint, ) @@ -603,13 +603,13 @@ func dCurrentState(c *cli.Context) error { return nil } -func dSeverelyUndercollateralizedThresholdPercent(c *cli.Context) error { +func dUtxoValue(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.SeverelyUndercollateralizedThresholdPercentAtBlock( + result, err := contract.UtxoValueAtBlock( cmd.BlockFlagValue.Uint, ) @@ -625,7 +625,7 @@ func dSeverelyUndercollateralizedThresholdPercent(c *cli.Context) error { /// ------------------- Non-const methods ------------------- -func dNotifyCourtesyCall(c *cli.Context) error { +func dExitCourtesyCall(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -637,7 +637,7 @@ func dNotifyCourtesyCall(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyCourtesyCall() + transaction, err = contract.ExitCourtesyCall() if err != nil { return err } @@ -645,7 +645,7 @@ func dNotifyCourtesyCall(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyCourtesyCall( + err = contract.CallExitCourtesyCall( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -658,7 +658,7 @@ func dNotifyCourtesyCall(c *cli.Context) error { return nil } -func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { +func dNotifyFundingTimedOut(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -670,7 +670,7 @@ func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyUndercollateralizedLiquidation() + transaction, err = contract.NotifyFundingTimedOut() if err != nil { return err } @@ -678,7 +678,7 @@ func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyUndercollateralizedLiquidation( + err = contract.CallNotifyFundingTimedOut( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -691,7 +691,7 @@ func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { return nil } -func dExitCourtesyCall(c *cli.Context) error { +func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -703,7 +703,7 @@ func dExitCourtesyCall(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.ExitCourtesyCall() + transaction, err = contract.NotifyUndercollateralizedLiquidation() if err != nil { return err } @@ -711,7 +711,7 @@ func dExitCourtesyCall(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallExitCourtesyCall( + err = contract.CallNotifyUndercollateralizedLiquidation( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -724,7 +724,7 @@ func dExitCourtesyCall(c *cli.Context) error { return nil } -func dNotifyCourtesyCallExpired(c *cli.Context) error { +func dNotifyRedemptionProofTimedOut(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -736,7 +736,7 @@ func dNotifyCourtesyCallExpired(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyCourtesyCallExpired() + transaction, err = contract.NotifyRedemptionProofTimedOut() if err != nil { return err } @@ -744,7 +744,7 @@ func dNotifyCourtesyCallExpired(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyCourtesyCallExpired( + err = contract.CallNotifyRedemptionProofTimedOut( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -757,7 +757,7 @@ func dNotifyCourtesyCallExpired(c *cli.Context) error { return nil } -func dNotifyRedemptionProofTimedOut(c *cli.Context) error { +func dNotifySignerSetupFailed(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -769,7 +769,7 @@ func dNotifyRedemptionProofTimedOut(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyRedemptionProofTimedOut() + transaction, err = contract.NotifySignerSetupFailed() if err != nil { return err } @@ -777,7 +777,7 @@ func dNotifyRedemptionProofTimedOut(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyRedemptionProofTimedOut( + err = contract.CallNotifySignerSetupFailed( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -834,7 +834,7 @@ func dRequestFunderAbort(c *cli.Context) error { return nil } -func dRetrieveSignerPubkey(c *cli.Context) error { +func dNotifyCourtesyCallExpired(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -846,7 +846,7 @@ func dRetrieveSignerPubkey(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.RetrieveSignerPubkey() + transaction, err = contract.NotifyCourtesyCallExpired() if err != nil { return err } @@ -854,7 +854,7 @@ func dRetrieveSignerPubkey(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallRetrieveSignerPubkey( + err = contract.CallNotifyCourtesyCallExpired( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -867,7 +867,7 @@ func dRetrieveSignerPubkey(c *cli.Context) error { return nil } -func dNotifyFundingTimedOut(c *cli.Context) error { +func dPurchaseSignerBondsAtAuction(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -879,7 +879,7 @@ func dNotifyFundingTimedOut(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyFundingTimedOut() + transaction, err = contract.PurchaseSignerBondsAtAuction() if err != nil { return err } @@ -887,7 +887,7 @@ func dNotifyFundingTimedOut(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyFundingTimedOut( + err = contract.CallPurchaseSignerBondsAtAuction( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -900,7 +900,7 @@ func dNotifyFundingTimedOut(c *cli.Context) error { return nil } -func dPurchaseSignerBondsAtAuction(c *cli.Context) error { +func dRetrieveSignerPubkey(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -912,7 +912,7 @@ func dPurchaseSignerBondsAtAuction(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.PurchaseSignerBondsAtAuction() + transaction, err = contract.RetrieveSignerPubkey() if err != nil { return err } @@ -920,7 +920,7 @@ func dPurchaseSignerBondsAtAuction(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallPurchaseSignerBondsAtAuction( + err = contract.CallRetrieveSignerPubkey( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -933,19 +933,29 @@ func dPurchaseSignerBondsAtAuction(c *cli.Context) error { return nil } -func dNotifyRedemptionSignatureTimedOut(c *cli.Context) error { +func dInitialize(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } + _factory, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _factory, a address, from passed value %v", + c.Args()[0], + ) + } + var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyRedemptionSignatureTimedOut() + transaction, err = contract.Initialize( + _factory, + ) if err != nil { return err } @@ -953,7 +963,8 @@ func dNotifyRedemptionSignatureTimedOut(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyRedemptionSignatureTimedOut( + err = contract.CallInitialize( + _factory, cmd.BlockFlagValue.Uint, ) if err != nil { @@ -966,7 +977,7 @@ func dNotifyRedemptionSignatureTimedOut(c *cli.Context) error { return nil } -func dWithdrawFunds(c *cli.Context) error { +func dNotifyRedemptionSignatureTimedOut(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -978,7 +989,7 @@ func dWithdrawFunds(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.WithdrawFunds() + transaction, err = contract.NotifyRedemptionSignatureTimedOut() if err != nil { return err } @@ -986,7 +997,7 @@ func dWithdrawFunds(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallWithdrawFunds( + err = contract.CallNotifyRedemptionSignatureTimedOut( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -999,29 +1010,19 @@ func dWithdrawFunds(c *cli.Context) error { return nil } -func dInitialize(c *cli.Context) error { +func dNotifyCourtesyCall(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - _factory, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _factory, a address, from passed value %v", - c.Args()[0], - ) - } - var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.Initialize( - _factory, - ) + transaction, err = contract.NotifyCourtesyCall() if err != nil { return err } @@ -1029,8 +1030,7 @@ func dInitialize(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallInitialize( - _factory, + err = contract.CallNotifyCourtesyCall( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1043,7 +1043,7 @@ func dInitialize(c *cli.Context) error { return nil } -func dNotifySignerSetupFailed(c *cli.Context) error { +func dWithdrawFunds(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -1055,7 +1055,7 @@ func dNotifySignerSetupFailed(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifySignerSetupFailed() + transaction, err = contract.WithdrawFunds() if err != nil { return err } @@ -1063,7 +1063,7 @@ func dNotifySignerSetupFailed(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifySignerSetupFailed( + err = contract.CallWithdrawFunds( cmd.BlockFlagValue.Uint, ) if err != nil { diff --git a/pkg/chain/ethereum/gen/cmd/TBTCSystem.go b/pkg/chain/ethereum/gen/cmd/TBTCSystem.go index ff8a68bac..5706566c1 100644 --- a/pkg/chain/ethereum/gen/cmd/TBTCSystem.go +++ b/pkg/chain/ethereum/gen/cmd/TBTCSystem.go @@ -52,38 +52,31 @@ func init() { Usage: `Provides access to the TBTCSystem contract.`, Description: tBTCSystemDescription, Subcommands: []cli.Command{{ - Name: "get-undercollateralized-threshold-percent", - Usage: "Calls the constant method getUndercollateralizedThresholdPercent on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsGetUndercollateralizedThresholdPercent, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "get-remaining-eth-btc-price-feed-addition-time", - Usage: "Calls the constant method getRemainingEthBtcPriceFeedAdditionTime on the TBTCSystem contract.", + Name: "price-feed", + Usage: "Calls the constant method priceFeed on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetRemainingEthBtcPriceFeedAdditionTime, + Action: tbtcsPriceFeed, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-initial-collateralized-percent", - Usage: "Calls the constant method getInitialCollateralizedPercent on the TBTCSystem contract.", + Name: "get-remaining-pause-term", + Usage: "Calls the constant method getRemainingPauseTerm on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetInitialCollateralizedPercent, + Action: tbtcsGetRemainingPauseTerm, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-allow-new-deposits", - Usage: "Calls the constant method getAllowNewDeposits on the TBTCSystem contract.", + Name: "get-remaining-signer-fee-divisor-update-time", + Usage: "Calls the constant method getRemainingSignerFeeDivisorUpdateTime on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetAllowNewDeposits, + Action: tbtcsGetRemainingSignerFeeDivisorUpdateTime, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-severely-undercollateralized-threshold-percent", - Usage: "Calls the constant method getSeverelyUndercollateralizedThresholdPercent on the TBTCSystem contract.", + Name: "fetch-relay-previous-difficulty", + Usage: "Calls the constant method fetchRelayPreviousDifficulty on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetSeverelyUndercollateralizedThresholdPercent, + Action: tbtcsFetchRelayPreviousDifficulty, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { @@ -94,179 +87,193 @@ func init() { Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-remaining-keep-factories-update-time", - Usage: "Calls the constant method getRemainingKeepFactoriesUpdateTime on the TBTCSystem contract.", + Name: "owner", + Usage: "Calls the constant method owner on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetRemainingKeepFactoriesUpdateTime, + Action: tbtcsOwner, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-remaining-pause-term", - Usage: "Calls the constant method getRemainingPauseTerm on the TBTCSystem contract.", + Name: "get-remaining-keep-factories-upgradeability-time", + Usage: "Calls the constant method getRemainingKeepFactoriesUpgradeabilityTime on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetRemainingPauseTerm, + Action: tbtcsGetRemainingKeepFactoriesUpgradeabilityTime, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "relay", - Usage: "Calls the constant method relay on the TBTCSystem contract.", + Name: "get-keep-factories-upgradeability-period", + Usage: "Calls the constant method getKeepFactoriesUpgradeabilityPeriod on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsRelay, + Action: tbtcsGetKeepFactoriesUpgradeabilityPeriod, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "approved-to-log", - Usage: "Calls the constant method approvedToLog on the TBTCSystem contract.", - ArgsUsage: "[_caller] ", - Action: tbtcsApprovedToLog, - Before: cmd.ArgCountChecker(1), + Name: "get-maximum-lot-size", + Usage: "Calls the constant method getMaximumLotSize on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsGetMaximumLotSize, + Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "fetch-relay-previous-difficulty", - Usage: "Calls the constant method fetchRelayPreviousDifficulty on the TBTCSystem contract.", + Name: "get-remaining-keep-factories-update-time", + Usage: "Calls the constant method getRemainingKeepFactoriesUpdateTime on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsFetchRelayPreviousDifficulty, + Action: tbtcsGetRemainingKeepFactoriesUpdateTime, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-maximum-lot-size", - Usage: "Calls the constant method getMaximumLotSize on the TBTCSystem contract.", + Name: "get-severely-undercollateralized-threshold-percent", + Usage: "Calls the constant method getSeverelyUndercollateralizedThresholdPercent on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetMaximumLotSize, + Action: tbtcsGetSeverelyUndercollateralizedThresholdPercent, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-remaining-signer-fee-divisor-update-time", - Usage: "Calls the constant method getRemainingSignerFeeDivisorUpdateTime on the TBTCSystem contract.", + Name: "get-allowed-lot-sizes", + Usage: "Calls the constant method getAllowedLotSizes on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetRemainingSignerFeeDivisorUpdateTime, + Action: tbtcsGetAllowedLotSizes, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "fetch-bitcoin-price", - Usage: "Calls the constant method fetchBitcoinPrice on the TBTCSystem contract.", + Name: "get-remaining-lot-sizes-update-time", + Usage: "Calls the constant method getRemainingLotSizesUpdateTime on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsFetchBitcoinPrice, + Action: tbtcsGetRemainingLotSizesUpdateTime, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "owner", - Usage: "Calls the constant method owner on the TBTCSystem contract.", + Name: "get-governance-time-delay", + Usage: "Calls the constant method getGovernanceTimeDelay on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsOwner, + Action: tbtcsGetGovernanceTimeDelay, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-minimum-lot-size", - Usage: "Calls the constant method getMinimumLotSize on the TBTCSystem contract.", + Name: "get-signer-fee-divisor", + Usage: "Calls the constant method getSignerFeeDivisor on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetMinimumLotSize, + Action: tbtcsGetSignerFeeDivisor, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "fetch-relay-current-difficulty", - Usage: "Calls the constant method fetchRelayCurrentDifficulty on the TBTCSystem contract.", + Name: "relay", + Usage: "Calls the constant method relay on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsFetchRelayCurrentDifficulty, + Action: tbtcsRelay, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-keep-factories-upgradeability-period", - Usage: "Calls the constant method getKeepFactoriesUpgradeabilityPeriod on the TBTCSystem contract.", + Name: "get-remaining-collateralization-thresholds-update-time", + Usage: "Calls the constant method getRemainingCollateralizationThresholdsUpdateTime on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetKeepFactoriesUpgradeabilityPeriod, + Action: tbtcsGetRemainingCollateralizationThresholdsUpdateTime, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "price-feed", - Usage: "Calls the constant method priceFeed on the TBTCSystem contract.", + Name: "get-allow-new-deposits", + Usage: "Calls the constant method getAllowNewDeposits on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsPriceFeed, + Action: tbtcsGetAllowNewDeposits, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-governance-time-delay", - Usage: "Calls the constant method getGovernanceTimeDelay on the TBTCSystem contract.", + Name: "get-new-deposit-fee-estimate", + Usage: "Calls the constant method getNewDepositFeeEstimate on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetGovernanceTimeDelay, + Action: tbtcsGetNewDepositFeeEstimate, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-remaining-keep-factories-upgradeability-time", - Usage: "Calls the constant method getRemainingKeepFactoriesUpgradeabilityTime on the TBTCSystem contract.", + Name: "is-owner", + Usage: "Calls the constant method isOwner on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetRemainingKeepFactoriesUpgradeabilityTime, + Action: tbtcsIsOwner, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-remaining-collateralization-thresholds-update-time", - Usage: "Calls the constant method getRemainingCollateralizationThresholdsUpdateTime on the TBTCSystem contract.", + Name: "get-undercollateralized-threshold-percent", + Usage: "Calls the constant method getUndercollateralizedThresholdPercent on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetRemainingCollateralizationThresholdsUpdateTime, + Action: tbtcsGetUndercollateralizedThresholdPercent, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-remaining-lot-sizes-update-time", - Usage: "Calls the constant method getRemainingLotSizesUpdateTime on the TBTCSystem contract.", + Name: "keep-threshold", + Usage: "Calls the constant method keepThreshold on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetRemainingLotSizesUpdateTime, + Action: tbtcsKeepThreshold, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-signer-fee-divisor", - Usage: "Calls the constant method getSignerFeeDivisor on the TBTCSystem contract.", + Name: "approved-to-log", + Usage: "Calls the constant method approvedToLog on the TBTCSystem contract.", + ArgsUsage: "[_caller] ", + Action: tbtcsApprovedToLog, + Before: cmd.ArgCountChecker(1), + Flags: cmd.ConstFlags, + }, { + Name: "get-minimum-lot-size", + Usage: "Calls the constant method getMinimumLotSize on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetSignerFeeDivisor, + Action: tbtcsGetMinimumLotSize, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "keep-size", - Usage: "Calls the constant method keepSize on the TBTCSystem contract.", + Name: "get-initial-collateralized-percent", + Usage: "Calls the constant method getInitialCollateralizedPercent on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsKeepSize, + Action: tbtcsGetInitialCollateralizedPercent, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-new-deposit-fee-estimate", - Usage: "Calls the constant method getNewDepositFeeEstimate on the TBTCSystem contract.", + Name: "get-remaining-eth-btc-price-feed-addition-time", + Usage: "Calls the constant method getRemainingEthBtcPriceFeedAdditionTime on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetNewDepositFeeEstimate, + Action: tbtcsGetRemainingEthBtcPriceFeedAdditionTime, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "is-owner", - Usage: "Calls the constant method isOwner on the TBTCSystem contract.", + Name: "fetch-bitcoin-price", + Usage: "Calls the constant method fetchBitcoinPrice on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsIsOwner, + Action: tbtcsFetchBitcoinPrice, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "keep-threshold", - Usage: "Calls the constant method keepThreshold on the TBTCSystem contract.", + Name: "fetch-relay-current-difficulty", + Usage: "Calls the constant method fetchRelayCurrentDifficulty on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsKeepThreshold, + Action: tbtcsFetchRelayCurrentDifficulty, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-allowed-lot-sizes", - Usage: "Calls the constant method getAllowedLotSizes on the TBTCSystem contract.", + Name: "keep-size", + Usage: "Calls the constant method keepSize on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetAllowedLotSizes, + Action: tbtcsKeepSize, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "log-setup-failed", - Usage: "Calls the method logSetupFailed on the TBTCSystem contract.", + Name: "refresh-minimum-bondable-value", + Usage: "Calls the method refreshMinimumBondableValue on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsLogSetupFailed, + Action: tbtcsRefreshMinimumBondableValue, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "begin-eth-btc-price-feed-addition", - Usage: "Calls the method beginEthBtcPriceFeedAddition on the TBTCSystem contract.", - ArgsUsage: "[_ethBtcPriceFeed] ", - Action: tbtcsBeginEthBtcPriceFeedAddition, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), + Name: "resume-new-deposits", + Usage: "Calls the method resumeNewDeposits on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsResumeNewDeposits, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "emergency-pause-new-deposits", + Usage: "Calls the method emergencyPauseNewDeposits on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsEmergencyPauseNewDeposits, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { Name: "begin-keep-factories-update", @@ -276,11 +283,11 @@ func init() { Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(3))), Flags: cmd.NonConstFlags, }, { - Name: "refresh-minimum-bondable-value", - Usage: "Calls the method refreshMinimumBondableValue on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsRefreshMinimumBondableValue, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Name: "log-created", + Usage: "Calls the method logCreated on the TBTCSystem contract.", + ArgsUsage: "[_keepAddress] ", + Action: tbtcsLogCreated, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), Flags: cmd.NonConstFlags, }, { Name: "finalize-eth-btc-price-feed-addition", @@ -290,24 +297,10 @@ func init() { Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "finalize-signer-fee-divisor-update", - Usage: "Calls the method finalizeSignerFeeDivisorUpdate on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsFinalizeSignerFeeDivisorUpdate, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "log-courtesy-called", - Usage: "Calls the method logCourtesyCalled on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsLogCourtesyCalled, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "resume-new-deposits", - Usage: "Calls the method resumeNewDeposits on the TBTCSystem contract.", + Name: "finalize-keep-factories-update", + Usage: "Calls the method finalizeKeepFactoriesUpdate on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsResumeNewDeposits, + Action: tbtcsFinalizeKeepFactoriesUpdate, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { @@ -318,17 +311,10 @@ func init() { Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "transfer-ownership", - Usage: "Calls the method transferOwnership on the TBTCSystem contract.", - ArgsUsage: "[newOwner] ", - Action: tbtcsTransferOwnership, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), - Flags: cmd.NonConstFlags, - }, { - Name: "log-fraud-during-setup", - Usage: "Calls the method logFraudDuringSetup on the TBTCSystem contract.", + Name: "log-courtesy-called", + Usage: "Calls the method logCourtesyCalled on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsLogFraudDuringSetup, + Action: tbtcsLogCourtesyCalled, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { @@ -339,10 +325,10 @@ func init() { Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "log-liquidated", - Usage: "Calls the method logLiquidated on the TBTCSystem contract.", + Name: "finalize-signer-fee-divisor-update", + Usage: "Calls the method finalizeSignerFeeDivisorUpdate on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsLogLiquidated, + Action: tbtcsFinalizeSignerFeeDivisorUpdate, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { @@ -353,10 +339,17 @@ func init() { Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "emergency-pause-new-deposits", - Usage: "Calls the method emergencyPauseNewDeposits on the TBTCSystem contract.", + Name: "begin-eth-btc-price-feed-addition", + Usage: "Calls the method beginEthBtcPriceFeedAddition on the TBTCSystem contract.", + ArgsUsage: "[_ethBtcPriceFeed] ", + Action: tbtcsBeginEthBtcPriceFeedAddition, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), + Flags: cmd.NonConstFlags, + }, { + Name: "log-setup-failed", + Usage: "Calls the method logSetupFailed on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsEmergencyPauseNewDeposits, + Action: tbtcsLogSetupFailed, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { @@ -367,17 +360,24 @@ func init() { Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), Flags: cmd.NonConstFlags, }, { - Name: "finalize-keep-factories-update", - Usage: "Calls the method finalizeKeepFactoriesUpdate on the TBTCSystem contract.", + Name: "log-liquidated", + Usage: "Calls the method logLiquidated on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsFinalizeKeepFactoriesUpdate, + Action: tbtcsLogLiquidated, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "log-created", - Usage: "Calls the method logCreated on the TBTCSystem contract.", - ArgsUsage: "[_keepAddress] ", - Action: tbtcsLogCreated, + Name: "log-fraud-during-setup", + Usage: "Calls the method logFraudDuringSetup on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsLogFraudDuringSetup, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "transfer-ownership", + Usage: "Calls the method transferOwnership on the TBTCSystem contract.", + ArgsUsage: "[newOwner] ", + Action: tbtcsTransferOwnership, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), Flags: cmd.NonConstFlags, }, { @@ -393,13 +393,13 @@ func init() { /// ------------------- Const methods ------------------- -func tbtcsGetUndercollateralizedThresholdPercent(c *cli.Context) error { +func tbtcsPriceFeed(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetUndercollateralizedThresholdPercentAtBlock( + result, err := contract.PriceFeedAtBlock( cmd.BlockFlagValue.Uint, ) @@ -413,13 +413,13 @@ func tbtcsGetUndercollateralizedThresholdPercent(c *cli.Context) error { return nil } -func tbtcsGetRemainingEthBtcPriceFeedAdditionTime(c *cli.Context) error { +func tbtcsGetRemainingPauseTerm(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetRemainingEthBtcPriceFeedAdditionTimeAtBlock( + result, err := contract.GetRemainingPauseTermAtBlock( cmd.BlockFlagValue.Uint, ) @@ -433,13 +433,13 @@ func tbtcsGetRemainingEthBtcPriceFeedAdditionTime(c *cli.Context) error { return nil } -func tbtcsGetInitialCollateralizedPercent(c *cli.Context) error { +func tbtcsGetRemainingSignerFeeDivisorUpdateTime(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetInitialCollateralizedPercentAtBlock( + result, err := contract.GetRemainingSignerFeeDivisorUpdateTimeAtBlock( cmd.BlockFlagValue.Uint, ) @@ -453,13 +453,13 @@ func tbtcsGetInitialCollateralizedPercent(c *cli.Context) error { return nil } -func tbtcsGetAllowNewDeposits(c *cli.Context) error { +func tbtcsFetchRelayPreviousDifficulty(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetAllowNewDepositsAtBlock( + result, err := contract.FetchRelayPreviousDifficultyAtBlock( cmd.BlockFlagValue.Uint, ) @@ -473,13 +473,13 @@ func tbtcsGetAllowNewDeposits(c *cli.Context) error { return nil } -func tbtcsGetSeverelyUndercollateralizedThresholdPercent(c *cli.Context) error { +func tbtcsGetPriceFeedGovernanceTimeDelay(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetSeverelyUndercollateralizedThresholdPercentAtBlock( + result, err := contract.GetPriceFeedGovernanceTimeDelayAtBlock( cmd.BlockFlagValue.Uint, ) @@ -493,13 +493,13 @@ func tbtcsGetSeverelyUndercollateralizedThresholdPercent(c *cli.Context) error { return nil } -func tbtcsGetPriceFeedGovernanceTimeDelay(c *cli.Context) error { +func tbtcsOwner(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetPriceFeedGovernanceTimeDelayAtBlock( + result, err := contract.OwnerAtBlock( cmd.BlockFlagValue.Uint, ) @@ -513,13 +513,13 @@ func tbtcsGetPriceFeedGovernanceTimeDelay(c *cli.Context) error { return nil } -func tbtcsGetRemainingKeepFactoriesUpdateTime(c *cli.Context) error { +func tbtcsGetRemainingKeepFactoriesUpgradeabilityTime(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetRemainingKeepFactoriesUpdateTimeAtBlock( + result, err := contract.GetRemainingKeepFactoriesUpgradeabilityTimeAtBlock( cmd.BlockFlagValue.Uint, ) @@ -533,13 +533,13 @@ func tbtcsGetRemainingKeepFactoriesUpdateTime(c *cli.Context) error { return nil } -func tbtcsGetRemainingPauseTerm(c *cli.Context) error { +func tbtcsGetKeepFactoriesUpgradeabilityPeriod(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetRemainingPauseTermAtBlock( + result, err := contract.GetKeepFactoriesUpgradeabilityPeriodAtBlock( cmd.BlockFlagValue.Uint, ) @@ -553,13 +553,13 @@ func tbtcsGetRemainingPauseTerm(c *cli.Context) error { return nil } -func tbtcsRelay(c *cli.Context) error { +func tbtcsGetMaximumLotSize(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.RelayAtBlock( + result, err := contract.GetMaximumLotSizeAtBlock( cmd.BlockFlagValue.Uint, ) @@ -573,21 +573,13 @@ func tbtcsRelay(c *cli.Context) error { return nil } -func tbtcsApprovedToLog(c *cli.Context) error { +func tbtcsGetRemainingKeepFactoriesUpdateTime(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - _caller, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _caller, a address, from passed value %v", - c.Args()[0], - ) - } - result, err := contract.ApprovedToLogAtBlock( - _caller, + result, err := contract.GetRemainingKeepFactoriesUpdateTimeAtBlock( cmd.BlockFlagValue.Uint, ) @@ -601,13 +593,13 @@ func tbtcsApprovedToLog(c *cli.Context) error { return nil } -func tbtcsFetchRelayPreviousDifficulty(c *cli.Context) error { +func tbtcsGetSeverelyUndercollateralizedThresholdPercent(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.FetchRelayPreviousDifficultyAtBlock( + result, err := contract.GetSeverelyUndercollateralizedThresholdPercentAtBlock( cmd.BlockFlagValue.Uint, ) @@ -621,13 +613,13 @@ func tbtcsFetchRelayPreviousDifficulty(c *cli.Context) error { return nil } -func tbtcsGetMaximumLotSize(c *cli.Context) error { +func tbtcsGetAllowedLotSizes(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetMaximumLotSizeAtBlock( + result, err := contract.GetAllowedLotSizesAtBlock( cmd.BlockFlagValue.Uint, ) @@ -641,13 +633,13 @@ func tbtcsGetMaximumLotSize(c *cli.Context) error { return nil } -func tbtcsGetRemainingSignerFeeDivisorUpdateTime(c *cli.Context) error { +func tbtcsGetRemainingLotSizesUpdateTime(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetRemainingSignerFeeDivisorUpdateTimeAtBlock( + result, err := contract.GetRemainingLotSizesUpdateTimeAtBlock( cmd.BlockFlagValue.Uint, ) @@ -661,13 +653,13 @@ func tbtcsGetRemainingSignerFeeDivisorUpdateTime(c *cli.Context) error { return nil } -func tbtcsFetchBitcoinPrice(c *cli.Context) error { +func tbtcsGetGovernanceTimeDelay(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.FetchBitcoinPriceAtBlock( + result, err := contract.GetGovernanceTimeDelayAtBlock( cmd.BlockFlagValue.Uint, ) @@ -681,13 +673,13 @@ func tbtcsFetchBitcoinPrice(c *cli.Context) error { return nil } -func tbtcsOwner(c *cli.Context) error { +func tbtcsGetSignerFeeDivisor(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.OwnerAtBlock( + result, err := contract.GetSignerFeeDivisorAtBlock( cmd.BlockFlagValue.Uint, ) @@ -701,13 +693,13 @@ func tbtcsOwner(c *cli.Context) error { return nil } -func tbtcsGetMinimumLotSize(c *cli.Context) error { +func tbtcsRelay(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetMinimumLotSizeAtBlock( + result, err := contract.RelayAtBlock( cmd.BlockFlagValue.Uint, ) @@ -721,13 +713,13 @@ func tbtcsGetMinimumLotSize(c *cli.Context) error { return nil } -func tbtcsFetchRelayCurrentDifficulty(c *cli.Context) error { +func tbtcsGetRemainingCollateralizationThresholdsUpdateTime(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.FetchRelayCurrentDifficultyAtBlock( + result, err := contract.GetRemainingCollateralizationThresholdsUpdateTimeAtBlock( cmd.BlockFlagValue.Uint, ) @@ -741,13 +733,13 @@ func tbtcsFetchRelayCurrentDifficulty(c *cli.Context) error { return nil } -func tbtcsGetKeepFactoriesUpgradeabilityPeriod(c *cli.Context) error { +func tbtcsGetAllowNewDeposits(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetKeepFactoriesUpgradeabilityPeriodAtBlock( + result, err := contract.GetAllowNewDepositsAtBlock( cmd.BlockFlagValue.Uint, ) @@ -761,13 +753,13 @@ func tbtcsGetKeepFactoriesUpgradeabilityPeriod(c *cli.Context) error { return nil } -func tbtcsPriceFeed(c *cli.Context) error { +func tbtcsGetNewDepositFeeEstimate(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.PriceFeedAtBlock( + result, err := contract.GetNewDepositFeeEstimateAtBlock( cmd.BlockFlagValue.Uint, ) @@ -781,13 +773,13 @@ func tbtcsPriceFeed(c *cli.Context) error { return nil } -func tbtcsGetGovernanceTimeDelay(c *cli.Context) error { +func tbtcsIsOwner(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetGovernanceTimeDelayAtBlock( + result, err := contract.IsOwnerAtBlock( cmd.BlockFlagValue.Uint, ) @@ -801,13 +793,13 @@ func tbtcsGetGovernanceTimeDelay(c *cli.Context) error { return nil } -func tbtcsGetRemainingKeepFactoriesUpgradeabilityTime(c *cli.Context) error { +func tbtcsGetUndercollateralizedThresholdPercent(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetRemainingKeepFactoriesUpgradeabilityTimeAtBlock( + result, err := contract.GetUndercollateralizedThresholdPercentAtBlock( cmd.BlockFlagValue.Uint, ) @@ -821,13 +813,13 @@ func tbtcsGetRemainingKeepFactoriesUpgradeabilityTime(c *cli.Context) error { return nil } -func tbtcsGetRemainingCollateralizationThresholdsUpdateTime(c *cli.Context) error { +func tbtcsKeepThreshold(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetRemainingCollateralizationThresholdsUpdateTimeAtBlock( + result, err := contract.KeepThresholdAtBlock( cmd.BlockFlagValue.Uint, ) @@ -841,13 +833,21 @@ func tbtcsGetRemainingCollateralizationThresholdsUpdateTime(c *cli.Context) erro return nil } -func tbtcsGetRemainingLotSizesUpdateTime(c *cli.Context) error { +func tbtcsApprovedToLog(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } + _caller, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _caller, a address, from passed value %v", + c.Args()[0], + ) + } - result, err := contract.GetRemainingLotSizesUpdateTimeAtBlock( + result, err := contract.ApprovedToLogAtBlock( + _caller, cmd.BlockFlagValue.Uint, ) @@ -861,13 +861,13 @@ func tbtcsGetRemainingLotSizesUpdateTime(c *cli.Context) error { return nil } -func tbtcsGetSignerFeeDivisor(c *cli.Context) error { +func tbtcsGetMinimumLotSize(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetSignerFeeDivisorAtBlock( + result, err := contract.GetMinimumLotSizeAtBlock( cmd.BlockFlagValue.Uint, ) @@ -881,13 +881,13 @@ func tbtcsGetSignerFeeDivisor(c *cli.Context) error { return nil } -func tbtcsKeepSize(c *cli.Context) error { +func tbtcsGetInitialCollateralizedPercent(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.KeepSizeAtBlock( + result, err := contract.GetInitialCollateralizedPercentAtBlock( cmd.BlockFlagValue.Uint, ) @@ -901,13 +901,13 @@ func tbtcsKeepSize(c *cli.Context) error { return nil } -func tbtcsGetNewDepositFeeEstimate(c *cli.Context) error { +func tbtcsGetRemainingEthBtcPriceFeedAdditionTime(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetNewDepositFeeEstimateAtBlock( + result, err := contract.GetRemainingEthBtcPriceFeedAdditionTimeAtBlock( cmd.BlockFlagValue.Uint, ) @@ -921,13 +921,13 @@ func tbtcsGetNewDepositFeeEstimate(c *cli.Context) error { return nil } -func tbtcsIsOwner(c *cli.Context) error { +func tbtcsFetchBitcoinPrice(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.IsOwnerAtBlock( + result, err := contract.FetchBitcoinPriceAtBlock( cmd.BlockFlagValue.Uint, ) @@ -941,13 +941,13 @@ func tbtcsIsOwner(c *cli.Context) error { return nil } -func tbtcsKeepThreshold(c *cli.Context) error { +func tbtcsFetchRelayCurrentDifficulty(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.KeepThresholdAtBlock( + result, err := contract.FetchRelayCurrentDifficultyAtBlock( cmd.BlockFlagValue.Uint, ) @@ -961,13 +961,13 @@ func tbtcsKeepThreshold(c *cli.Context) error { return nil } -func tbtcsGetAllowedLotSizes(c *cli.Context) error { +func tbtcsKeepSize(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetAllowedLotSizesAtBlock( + result, err := contract.KeepSizeAtBlock( cmd.BlockFlagValue.Uint, ) @@ -983,7 +983,7 @@ func tbtcsGetAllowedLotSizes(c *cli.Context) error { /// ------------------- Non-const methods ------------------- -func tbtcsLogSetupFailed(c *cli.Context) error { +func tbtcsRefreshMinimumBondableValue(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err @@ -995,7 +995,7 @@ func tbtcsLogSetupFailed(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogSetupFailed() + transaction, err = contract.RefreshMinimumBondableValue() if err != nil { return err } @@ -1003,7 +1003,7 @@ func tbtcsLogSetupFailed(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogSetupFailed( + err = contract.CallRefreshMinimumBondableValue( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1016,18 +1016,43 @@ func tbtcsLogSetupFailed(c *cli.Context) error { return nil } -func tbtcsBeginEthBtcPriceFeedAddition(c *cli.Context) error { +func tbtcsResumeNewDeposits(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - _ethBtcPriceFeed, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _ethBtcPriceFeed, a address, from passed value %v", - c.Args()[0], + var ( + transaction *types.Transaction + ) + + if c.Bool(cmd.SubmitFlag) { + // Do a regular submission. Take payable into account. + transaction, err = contract.ResumeNewDeposits() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash) + } else { + // Do a call. + err = contract.CallResumeNewDeposits( + cmd.BlockFlagValue.Uint, ) + if err != nil { + return err + } + + cmd.PrintOutput(nil) + } + + return nil +} + +func tbtcsEmergencyPauseNewDeposits(c *cli.Context) error { + contract, err := initializeTBTCSystem(c) + if err != nil { + return err } var ( @@ -1036,9 +1061,7 @@ func tbtcsBeginEthBtcPriceFeedAddition(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.BeginEthBtcPriceFeedAddition( - _ethBtcPriceFeed, - ) + transaction, err = contract.EmergencyPauseNewDeposits() if err != nil { return err } @@ -1046,8 +1069,7 @@ func tbtcsBeginEthBtcPriceFeedAddition(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallBeginEthBtcPriceFeedAddition( - _ethBtcPriceFeed, + err = contract.CallEmergencyPauseNewDeposits( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1124,19 +1146,29 @@ func tbtcsBeginKeepFactoriesUpdate(c *cli.Context) error { return nil } -func tbtcsRefreshMinimumBondableValue(c *cli.Context) error { +func tbtcsLogCreated(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } + _keepAddress, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _keepAddress, a address, from passed value %v", + c.Args()[0], + ) + } + var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.RefreshMinimumBondableValue() + transaction, err = contract.LogCreated( + _keepAddress, + ) if err != nil { return err } @@ -1144,7 +1176,8 @@ func tbtcsRefreshMinimumBondableValue(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallRefreshMinimumBondableValue( + err = contract.CallLogCreated( + _keepAddress, cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1190,7 +1223,7 @@ func tbtcsFinalizeEthBtcPriceFeedAddition(c *cli.Context) error { return nil } -func tbtcsFinalizeSignerFeeDivisorUpdate(c *cli.Context) error { +func tbtcsFinalizeKeepFactoriesUpdate(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err @@ -1202,7 +1235,7 @@ func tbtcsFinalizeSignerFeeDivisorUpdate(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.FinalizeSignerFeeDivisorUpdate() + transaction, err = contract.FinalizeKeepFactoriesUpdate() if err != nil { return err } @@ -1210,7 +1243,7 @@ func tbtcsFinalizeSignerFeeDivisorUpdate(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallFinalizeSignerFeeDivisorUpdate( + err = contract.CallFinalizeKeepFactoriesUpdate( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1223,7 +1256,7 @@ func tbtcsFinalizeSignerFeeDivisorUpdate(c *cli.Context) error { return nil } -func tbtcsLogCourtesyCalled(c *cli.Context) error { +func tbtcsFinalizeLotSizesUpdate(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err @@ -1235,7 +1268,7 @@ func tbtcsLogCourtesyCalled(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogCourtesyCalled() + transaction, err = contract.FinalizeLotSizesUpdate() if err != nil { return err } @@ -1243,7 +1276,7 @@ func tbtcsLogCourtesyCalled(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogCourtesyCalled( + err = contract.CallFinalizeLotSizesUpdate( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1256,7 +1289,7 @@ func tbtcsLogCourtesyCalled(c *cli.Context) error { return nil } -func tbtcsResumeNewDeposits(c *cli.Context) error { +func tbtcsLogCourtesyCalled(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err @@ -1268,7 +1301,7 @@ func tbtcsResumeNewDeposits(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.ResumeNewDeposits() + transaction, err = contract.LogCourtesyCalled() if err != nil { return err } @@ -1276,7 +1309,7 @@ func tbtcsResumeNewDeposits(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallResumeNewDeposits( + err = contract.CallLogCourtesyCalled( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1289,7 +1322,7 @@ func tbtcsResumeNewDeposits(c *cli.Context) error { return nil } -func tbtcsFinalizeLotSizesUpdate(c *cli.Context) error { +func tbtcsRenounceOwnership(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err @@ -1301,7 +1334,7 @@ func tbtcsFinalizeLotSizesUpdate(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.FinalizeLotSizesUpdate() + transaction, err = contract.RenounceOwnership() if err != nil { return err } @@ -1309,7 +1342,7 @@ func tbtcsFinalizeLotSizesUpdate(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallFinalizeLotSizesUpdate( + err = contract.CallRenounceOwnership( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1322,29 +1355,19 @@ func tbtcsFinalizeLotSizesUpdate(c *cli.Context) error { return nil } -func tbtcsTransferOwnership(c *cli.Context) error { +func tbtcsFinalizeSignerFeeDivisorUpdate(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - newOwner, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter newOwner, a address, from passed value %v", - c.Args()[0], - ) - } - var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.TransferOwnership( - newOwner, - ) + transaction, err = contract.FinalizeSignerFeeDivisorUpdate() if err != nil { return err } @@ -1352,8 +1375,7 @@ func tbtcsTransferOwnership(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallTransferOwnership( - newOwner, + err = contract.CallFinalizeSignerFeeDivisorUpdate( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1366,7 +1388,7 @@ func tbtcsTransferOwnership(c *cli.Context) error { return nil } -func tbtcsLogFraudDuringSetup(c *cli.Context) error { +func tbtcsLogExitedCourtesyCall(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err @@ -1378,7 +1400,7 @@ func tbtcsLogFraudDuringSetup(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogFraudDuringSetup() + transaction, err = contract.LogExitedCourtesyCall() if err != nil { return err } @@ -1386,7 +1408,7 @@ func tbtcsLogFraudDuringSetup(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogFraudDuringSetup( + err = contract.CallLogExitedCourtesyCall( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1399,43 +1421,18 @@ func tbtcsLogFraudDuringSetup(c *cli.Context) error { return nil } -func tbtcsRenounceOwnership(c *cli.Context) error { +func tbtcsBeginEthBtcPriceFeedAddition(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // 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.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func tbtcsLogLiquidated(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) + _ethBtcPriceFeed, err := ethutil.AddressFromHex(c.Args()[0]) if err != nil { - return err + return fmt.Errorf( + "couldn't parse parameter _ethBtcPriceFeed, a address, from passed value %v", + c.Args()[0], + ) } var ( @@ -1444,7 +1441,9 @@ func tbtcsLogLiquidated(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogLiquidated() + transaction, err = contract.BeginEthBtcPriceFeedAddition( + _ethBtcPriceFeed, + ) if err != nil { return err } @@ -1452,7 +1451,8 @@ func tbtcsLogLiquidated(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogLiquidated( + err = contract.CallBeginEthBtcPriceFeedAddition( + _ethBtcPriceFeed, cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1465,7 +1465,7 @@ func tbtcsLogLiquidated(c *cli.Context) error { return nil } -func tbtcsLogExitedCourtesyCall(c *cli.Context) error { +func tbtcsLogSetupFailed(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err @@ -1477,7 +1477,7 @@ func tbtcsLogExitedCourtesyCall(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogExitedCourtesyCall() + transaction, err = contract.LogSetupFailed() if err != nil { return err } @@ -1485,7 +1485,7 @@ func tbtcsLogExitedCourtesyCall(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogExitedCourtesyCall( + err = contract.CallLogSetupFailed( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1498,19 +1498,29 @@ func tbtcsLogExitedCourtesyCall(c *cli.Context) error { return nil } -func tbtcsEmergencyPauseNewDeposits(c *cli.Context) error { +func tbtcsLogFunderRequestedAbort(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } + _abortOutputScript, err := hexutil.Decode(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _abortOutputScript, a bytes, from passed value %v", + c.Args()[0], + ) + } + var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.EmergencyPauseNewDeposits() + transaction, err = contract.LogFunderRequestedAbort( + _abortOutputScript, + ) if err != nil { return err } @@ -1518,7 +1528,8 @@ func tbtcsEmergencyPauseNewDeposits(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallEmergencyPauseNewDeposits( + err = contract.CallLogFunderRequestedAbort( + _abortOutputScript, cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1531,29 +1542,19 @@ func tbtcsEmergencyPauseNewDeposits(c *cli.Context) error { return nil } -func tbtcsLogFunderRequestedAbort(c *cli.Context) error { +func tbtcsLogLiquidated(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - _abortOutputScript, err := hexutil.Decode(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _abortOutputScript, a bytes, from passed value %v", - c.Args()[0], - ) - } - var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogFunderRequestedAbort( - _abortOutputScript, - ) + transaction, err = contract.LogLiquidated() if err != nil { return err } @@ -1561,8 +1562,7 @@ func tbtcsLogFunderRequestedAbort(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogFunderRequestedAbort( - _abortOutputScript, + err = contract.CallLogLiquidated( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1575,7 +1575,7 @@ func tbtcsLogFunderRequestedAbort(c *cli.Context) error { return nil } -func tbtcsFinalizeKeepFactoriesUpdate(c *cli.Context) error { +func tbtcsLogFraudDuringSetup(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err @@ -1587,7 +1587,7 @@ func tbtcsFinalizeKeepFactoriesUpdate(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.FinalizeKeepFactoriesUpdate() + transaction, err = contract.LogFraudDuringSetup() if err != nil { return err } @@ -1595,7 +1595,7 @@ func tbtcsFinalizeKeepFactoriesUpdate(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallFinalizeKeepFactoriesUpdate( + err = contract.CallLogFraudDuringSetup( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1608,16 +1608,16 @@ func tbtcsFinalizeKeepFactoriesUpdate(c *cli.Context) error { return nil } -func tbtcsLogCreated(c *cli.Context) error { +func tbtcsTransferOwnership(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - _keepAddress, err := ethutil.AddressFromHex(c.Args()[0]) + newOwner, err := ethutil.AddressFromHex(c.Args()[0]) if err != nil { return fmt.Errorf( - "couldn't parse parameter _keepAddress, a address, from passed value %v", + "couldn't parse parameter newOwner, a address, from passed value %v", c.Args()[0], ) } @@ -1628,8 +1628,8 @@ func tbtcsLogCreated(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogCreated( - _keepAddress, + transaction, err = contract.TransferOwnership( + newOwner, ) if err != nil { return err @@ -1638,8 +1638,8 @@ func tbtcsLogCreated(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogCreated( - _keepAddress, + err = contract.CallTransferOwnership( + newOwner, cmd.BlockFlagValue.Uint, ) if err != nil { diff --git a/pkg/chain/ethereum/gen/contract/Deposit.go b/pkg/chain/ethereum/gen/contract/Deposit.go index 0d2a7a78e..b166b9885 100644 --- a/pkg/chain/ethereum/gen/contract/Deposit.go +++ b/pkg/chain/ethereum/gen/contract/Deposit.go @@ -92,12 +92,12 @@ func NewDeposit( // ----- Non-const Methods ------ // Transaction submission. -func (d *Deposit) NotifyCourtesyCall( +func (d *Deposit) ExitCourtesyCall( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyCourtesyCall", + "submitting transaction exitCourtesyCall", ) d.transactionMutex.Lock() @@ -122,7 +122,7 @@ func (d *Deposit) NotifyCourtesyCall( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyCourtesyCall( + transaction, err := d.contract.ExitCourtesyCall( transactorOptions, ) if err != nil { @@ -130,12 +130,12 @@ func (d *Deposit) NotifyCourtesyCall( err, d.transactorOptions.From, nil, - "notifyCourtesyCall", + "exitCourtesyCall", ) } dLogger.Infof( - "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -146,7 +146,7 @@ func (d *Deposit) NotifyCourtesyCall( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyCourtesyCall( + transaction, err := d.contract.ExitCourtesyCall( transactorOptions, ) if err != nil { @@ -154,12 +154,12 @@ func (d *Deposit) NotifyCourtesyCall( err, d.transactorOptions.From, nil, - "notifyCourtesyCall", + "exitCourtesyCall", ) } dLogger.Infof( - "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -174,7 +174,7 @@ func (d *Deposit) NotifyCourtesyCall( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyCourtesyCall( +func (d *Deposit) CallExitCourtesyCall( blockNumber *big.Int, ) error { var result interface{} = nil @@ -186,20 +186,20 @@ func (d *Deposit) CallNotifyCourtesyCall( d.caller, d.errorResolver, d.contractAddress, - "notifyCourtesyCall", + "exitCourtesyCall", &result, ) return err } -func (d *Deposit) NotifyCourtesyCallGasEstimate() (uint64, error) { +func (d *Deposit) ExitCourtesyCallGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyCourtesyCall", + "exitCourtesyCall", d.contractABI, d.transactor, ) @@ -208,12 +208,12 @@ func (d *Deposit) NotifyCourtesyCallGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) NotifyUndercollateralizedLiquidation( +func (d *Deposit) NotifyFundingTimedOut( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyUndercollateralizedLiquidation", + "submitting transaction notifyFundingTimedOut", ) d.transactionMutex.Lock() @@ -238,7 +238,7 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyUndercollateralizedLiquidation( + transaction, err := d.contract.NotifyFundingTimedOut( transactorOptions, ) if err != nil { @@ -246,12 +246,12 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( err, d.transactorOptions.From, nil, - "notifyUndercollateralizedLiquidation", + "notifyFundingTimedOut", ) } dLogger.Infof( - "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -262,7 +262,7 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyUndercollateralizedLiquidation( + transaction, err := d.contract.NotifyFundingTimedOut( transactorOptions, ) if err != nil { @@ -270,12 +270,12 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( err, d.transactorOptions.From, nil, - "notifyUndercollateralizedLiquidation", + "notifyFundingTimedOut", ) } dLogger.Infof( - "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -290,7 +290,7 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyUndercollateralizedLiquidation( +func (d *Deposit) CallNotifyFundingTimedOut( blockNumber *big.Int, ) error { var result interface{} = nil @@ -302,20 +302,20 @@ func (d *Deposit) CallNotifyUndercollateralizedLiquidation( d.caller, d.errorResolver, d.contractAddress, - "notifyUndercollateralizedLiquidation", + "notifyFundingTimedOut", &result, ) return err } -func (d *Deposit) NotifyUndercollateralizedLiquidationGasEstimate() (uint64, error) { +func (d *Deposit) NotifyFundingTimedOutGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyUndercollateralizedLiquidation", + "notifyFundingTimedOut", d.contractABI, d.transactor, ) @@ -324,21 +324,12 @@ func (d *Deposit) NotifyUndercollateralizedLiquidationGasEstimate() (uint64, err } // Transaction submission. -func (d *Deposit) TransferAndRequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, - _finalRecipient common.Address, +func (d *Deposit) NotifyUndercollateralizedLiquidation( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction transferAndRequestRedemption", - "params: ", - fmt.Sprint( - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, - ), + "submitting transaction notifyUndercollateralizedLiquidation", ) d.transactionMutex.Lock() @@ -363,26 +354,20 @@ func (d *Deposit) TransferAndRequestRedemption( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.TransferAndRequestRedemption( + transaction, err := d.contract.NotifyUndercollateralizedLiquidation( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "transferAndRequestRedemption", - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + "notifyUndercollateralizedLiquidation", ) } dLogger.Infof( - "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", + "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -393,26 +378,20 @@ func (d *Deposit) TransferAndRequestRedemption( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.TransferAndRequestRedemption( + transaction, err := d.contract.NotifyUndercollateralizedLiquidation( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "transferAndRequestRedemption", - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + "notifyUndercollateralizedLiquidation", ) } dLogger.Infof( - "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", + "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -427,10 +406,7 @@ func (d *Deposit) TransferAndRequestRedemption( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallTransferAndRequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, - _finalRecipient common.Address, +func (d *Deposit) CallNotifyUndercollateralizedLiquidation( blockNumber *big.Int, ) error { var result interface{} = nil @@ -442,44 +418,41 @@ func (d *Deposit) CallTransferAndRequestRedemption( d.caller, d.errorResolver, d.contractAddress, - "transferAndRequestRedemption", + "notifyUndercollateralizedLiquidation", &result, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, ) return err } -func (d *Deposit) TransferAndRequestRedemptionGasEstimate( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, - _finalRecipient common.Address, -) (uint64, error) { +func (d *Deposit) NotifyUndercollateralizedLiquidationGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "transferAndRequestRedemption", + "notifyUndercollateralizedLiquidation", d.contractABI, d.transactor, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, ) return result, err } // Transaction submission. -func (d *Deposit) ExitCourtesyCall( +func (d *Deposit) RequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction exitCourtesyCall", + "submitting transaction requestRedemption", + "params: ", + fmt.Sprint( + _outputValueBytes, + _redeemerOutputScript, + ), ) d.transactionMutex.Lock() @@ -504,20 +477,24 @@ func (d *Deposit) ExitCourtesyCall( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ExitCourtesyCall( + transaction, err := d.contract.RequestRedemption( transactorOptions, + _outputValueBytes, + _redeemerOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "exitCourtesyCall", + "requestRedemption", + _outputValueBytes, + _redeemerOutputScript, ) } dLogger.Infof( - "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction requestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -528,20 +505,24 @@ func (d *Deposit) ExitCourtesyCall( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ExitCourtesyCall( + transaction, err := d.contract.RequestRedemption( transactorOptions, + _outputValueBytes, + _redeemerOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "exitCourtesyCall", + "requestRedemption", + _outputValueBytes, + _redeemerOutputScript, ) } dLogger.Infof( - "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction requestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -556,7 +537,9 @@ func (d *Deposit) ExitCourtesyCall( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallExitCourtesyCall( +func (d *Deposit) CallRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -568,53 +551,41 @@ func (d *Deposit) CallExitCourtesyCall( d.caller, d.errorResolver, d.contractAddress, - "exitCourtesyCall", + "requestRedemption", &result, + _outputValueBytes, + _redeemerOutputScript, ) return err } -func (d *Deposit) ExitCourtesyCallGasEstimate() (uint64, error) { +func (d *Deposit) RequestRedemptionGasEstimate( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "exitCourtesyCall", + "requestRedemption", d.contractABI, d.transactor, + _outputValueBytes, + _redeemerOutputScript, ) return result, err } // Transaction submission. -func (d *Deposit) ProvideBTCFundingProof( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _fundingOutputIndex uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) NotifyRedemptionProofTimedOut( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideBTCFundingProof", - "params: ", - fmt.Sprint( - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, - ), + "submitting transaction notifyRedemptionProofTimedOut", ) d.transactionMutex.Lock() @@ -639,36 +610,20 @@ func (d *Deposit) ProvideBTCFundingProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideBTCFundingProof( + transaction, err := d.contract.NotifyRedemptionProofTimedOut( transactorOptions, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideBTCFundingProof", - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + "notifyRedemptionProofTimedOut", ) } dLogger.Infof( - "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", + "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -679,36 +634,20 @@ func (d *Deposit) ProvideBTCFundingProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideBTCFundingProof( + transaction, err := d.contract.NotifyRedemptionProofTimedOut( transactorOptions, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideBTCFundingProof", - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + "notifyRedemptionProofTimedOut", ) } dLogger.Infof( - "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", + "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -723,15 +662,7 @@ func (d *Deposit) ProvideBTCFundingProof( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideBTCFundingProof( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _fundingOutputIndex uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) CallNotifyRedemptionProofTimedOut( blockNumber *big.Int, ) error { var result interface{} = nil @@ -743,59 +674,34 @@ func (d *Deposit) CallProvideBTCFundingProof( d.caller, d.errorResolver, d.contractAddress, - "provideBTCFundingProof", + "notifyRedemptionProofTimedOut", &result, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, ) return err } -func (d *Deposit) ProvideBTCFundingProofGasEstimate( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _fundingOutputIndex uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, -) (uint64, error) { +func (d *Deposit) NotifyRedemptionProofTimedOutGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideBTCFundingProof", + "notifyRedemptionProofTimedOut", d.contractABI, d.transactor, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyCourtesyCallExpired( +func (d *Deposit) NotifySignerSetupFailed( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyCourtesyCallExpired", + "submitting transaction notifySignerSetupFailed", ) d.transactionMutex.Lock() @@ -820,7 +726,7 @@ func (d *Deposit) NotifyCourtesyCallExpired( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyCourtesyCallExpired( + transaction, err := d.contract.NotifySignerSetupFailed( transactorOptions, ) if err != nil { @@ -828,12 +734,12 @@ func (d *Deposit) NotifyCourtesyCallExpired( err, d.transactorOptions.From, nil, - "notifyCourtesyCallExpired", + "notifySignerSetupFailed", ) } dLogger.Infof( - "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", + "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -844,7 +750,7 @@ func (d *Deposit) NotifyCourtesyCallExpired( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyCourtesyCallExpired( + transaction, err := d.contract.NotifySignerSetupFailed( transactorOptions, ) if err != nil { @@ -852,12 +758,12 @@ func (d *Deposit) NotifyCourtesyCallExpired( err, d.transactorOptions.From, nil, - "notifyCourtesyCallExpired", + "notifySignerSetupFailed", ) } dLogger.Infof( - "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", + "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -872,7 +778,7 @@ func (d *Deposit) NotifyCourtesyCallExpired( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyCourtesyCallExpired( +func (d *Deposit) CallNotifySignerSetupFailed( blockNumber *big.Int, ) error { var result interface{} = nil @@ -884,20 +790,20 @@ func (d *Deposit) CallNotifyCourtesyCallExpired( d.caller, d.errorResolver, d.contractAddress, - "notifyCourtesyCallExpired", + "notifySignerSetupFailed", &result, ) return err } -func (d *Deposit) NotifyCourtesyCallExpiredGasEstimate() (uint64, error) { +func (d *Deposit) NotifySignerSetupFailedGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyCourtesyCallExpired", + "notifySignerSetupFailed", d.contractABI, d.transactor, ) @@ -906,12 +812,31 @@ func (d *Deposit) NotifyCourtesyCallExpiredGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) NotifyRedemptionProofTimedOut( +func (d *Deposit) ProvideBTCFundingProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _fundingOutputIndex uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyRedemptionProofTimedOut", + "submitting transaction provideBTCFundingProof", + "params: ", + fmt.Sprint( + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ), ) d.transactionMutex.Lock() @@ -936,20 +861,36 @@ func (d *Deposit) NotifyRedemptionProofTimedOut( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyRedemptionProofTimedOut( + transaction, err := d.contract.ProvideBTCFundingProof( transactorOptions, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyRedemptionProofTimedOut", + "provideBTCFundingProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) } dLogger.Infof( - "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", + "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -960,20 +901,36 @@ func (d *Deposit) NotifyRedemptionProofTimedOut( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyRedemptionProofTimedOut( + transaction, err := d.contract.ProvideBTCFundingProof( transactorOptions, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyRedemptionProofTimedOut", + "provideBTCFundingProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) } dLogger.Infof( - "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", + "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -988,7 +945,15 @@ func (d *Deposit) NotifyRedemptionProofTimedOut( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyRedemptionProofTimedOut( +func (d *Deposit) CallProvideBTCFundingProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _fundingOutputIndex uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1000,46 +965,75 @@ func (d *Deposit) CallNotifyRedemptionProofTimedOut( d.caller, d.errorResolver, d.contractAddress, - "notifyRedemptionProofTimedOut", + "provideBTCFundingProof", &result, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) return err } -func (d *Deposit) NotifyRedemptionProofTimedOutGasEstimate() (uint64, error) { +func (d *Deposit) ProvideBTCFundingProofGasEstimate( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _fundingOutputIndex uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyRedemptionProofTimedOut", + "provideBTCFundingProof", d.contractABI, d.transactor, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) return result, err } // Transaction submission. -func (d *Deposit) ProvideECDSAFraudProof( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) ProvideRedemptionProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideECDSAFraudProof", + "submitting transaction provideRedemptionProof", "params: ", fmt.Sprint( - _v, - _r, - _s, - _signedDigest, - _preimage, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ), ) @@ -1065,30 +1059,34 @@ func (d *Deposit) ProvideECDSAFraudProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideECDSAFraudProof( + transaction, err := d.contract.ProvideRedemptionProof( transactorOptions, - _v, - _r, - _s, - _signedDigest, - _preimage, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideECDSAFraudProof", - _v, - _r, - _s, - _signedDigest, - _preimage, + "provideRedemptionProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) } dLogger.Infof( - "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1099,30 +1097,34 @@ func (d *Deposit) ProvideECDSAFraudProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideECDSAFraudProof( + transaction, err := d.contract.ProvideRedemptionProof( transactorOptions, - _v, - _r, - _s, - _signedDigest, - _preimage, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideECDSAFraudProof", - _v, - _r, - _s, - _signedDigest, - _preimage, + "provideRedemptionProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) } dLogger.Infof( - "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1137,12 +1139,14 @@ func (d *Deposit) ProvideECDSAFraudProof( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideECDSAFraudProof( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) CallProvideRedemptionProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1154,62 +1158,62 @@ func (d *Deposit) CallProvideECDSAFraudProof( d.caller, d.errorResolver, d.contractAddress, - "provideECDSAFraudProof", + "provideRedemptionProof", &result, - _v, - _r, - _s, - _signedDigest, - _preimage, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) return err } -func (d *Deposit) ProvideECDSAFraudProofGasEstimate( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) ProvideRedemptionProofGasEstimate( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideECDSAFraudProof", + "provideRedemptionProof", d.contractABI, d.transactor, - _v, - _r, - _s, - _signedDigest, - _preimage, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) return result, err } // Transaction submission. -func (d *Deposit) ProvideFundingECDSAFraudProof( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) IncreaseRedemptionFee( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideFundingECDSAFraudProof", + "submitting transaction increaseRedemptionFee", "params: ", fmt.Sprint( - _v, - _r, - _s, - _signedDigest, - _preimage, + _previousOutputValueBytes, + _newOutputValueBytes, ), ) @@ -1235,30 +1239,24 @@ func (d *Deposit) ProvideFundingECDSAFraudProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideFundingECDSAFraudProof( + transaction, err := d.contract.IncreaseRedemptionFee( transactorOptions, - _v, - _r, - _s, - _signedDigest, - _preimage, + _previousOutputValueBytes, + _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideFundingECDSAFraudProof", - _v, - _r, - _s, - _signedDigest, - _preimage, + "increaseRedemptionFee", + _previousOutputValueBytes, + _newOutputValueBytes, ) } dLogger.Infof( - "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", + "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1269,30 +1267,24 @@ func (d *Deposit) ProvideFundingECDSAFraudProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideFundingECDSAFraudProof( + transaction, err := d.contract.IncreaseRedemptionFee( transactorOptions, - _v, - _r, - _s, - _signedDigest, - _preimage, + _previousOutputValueBytes, + _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideFundingECDSAFraudProof", - _v, - _r, - _s, - _signedDigest, - _preimage, + "increaseRedemptionFee", + _previousOutputValueBytes, + _newOutputValueBytes, ) } dLogger.Infof( - "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", + "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1307,12 +1299,9 @@ func (d *Deposit) ProvideFundingECDSAFraudProof( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideFundingECDSAFraudProof( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) CallIncreaseRedemptionFee( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1324,66 +1313,49 @@ func (d *Deposit) CallProvideFundingECDSAFraudProof( d.caller, d.errorResolver, d.contractAddress, - "provideFundingECDSAFraudProof", + "increaseRedemptionFee", &result, - _v, - _r, - _s, - _signedDigest, - _preimage, + _previousOutputValueBytes, + _newOutputValueBytes, ) return err } -func (d *Deposit) ProvideFundingECDSAFraudProofGasEstimate( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) IncreaseRedemptionFeeGasEstimate( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideFundingECDSAFraudProof", + "increaseRedemptionFee", d.contractABI, d.transactor, - _v, - _r, - _s, - _signedDigest, - _preimage, + _previousOutputValueBytes, + _newOutputValueBytes, ) return result, err } // Transaction submission. -func (d *Deposit) ProvideRedemptionProof( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) TransferAndRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideRedemptionProof", + "submitting transaction transferAndRequestRedemption", "params: ", fmt.Sprint( - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ), ) @@ -1409,34 +1381,26 @@ func (d *Deposit) ProvideRedemptionProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideRedemptionProof( + transaction, err := d.contract.TransferAndRequestRedemption( transactorOptions, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideRedemptionProof", - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + "transferAndRequestRedemption", + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) } dLogger.Infof( - "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", + "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1447,34 +1411,26 @@ func (d *Deposit) ProvideRedemptionProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideRedemptionProof( + transaction, err := d.contract.TransferAndRequestRedemption( transactorOptions, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideRedemptionProof", - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + "transferAndRequestRedemption", + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) } dLogger.Infof( - "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", + "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1489,14 +1445,10 @@ func (d *Deposit) ProvideRedemptionProof( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideRedemptionProof( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) CallTransferAndRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1508,60 +1460,56 @@ func (d *Deposit) CallProvideRedemptionProof( d.caller, d.errorResolver, d.contractAddress, - "provideRedemptionProof", + "transferAndRequestRedemption", &result, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) return err } -func (d *Deposit) ProvideRedemptionProofGasEstimate( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) TransferAndRequestRedemptionGasEstimate( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideRedemptionProof", + "transferAndRequestRedemption", d.contractABI, d.transactor, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) return result, err } // Transaction submission. -func (d *Deposit) RequestFunderAbort( - _abortOutputScript []uint8, +func (d *Deposit) ProvideECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction requestFunderAbort", + "submitting transaction provideECDSAFraudProof", "params: ", fmt.Sprint( - _abortOutputScript, + _v, + _r, + _s, + _signedDigest, + _preimage, ), ) @@ -1587,22 +1535,30 @@ func (d *Deposit) RequestFunderAbort( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.RequestFunderAbort( + transaction, err := d.contract.ProvideECDSAFraudProof( transactorOptions, - _abortOutputScript, + _v, + _r, + _s, + _signedDigest, + _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "requestFunderAbort", - _abortOutputScript, + "provideECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, ) } dLogger.Infof( - "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", + "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1613,22 +1569,30 @@ func (d *Deposit) RequestFunderAbort( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.RequestFunderAbort( + transaction, err := d.contract.ProvideECDSAFraudProof( transactorOptions, - _abortOutputScript, + _v, + _r, + _s, + _signedDigest, + _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "requestFunderAbort", - _abortOutputScript, + "provideECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, ) } dLogger.Infof( - "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", + "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1643,8 +1607,12 @@ func (d *Deposit) RequestFunderAbort( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallRequestFunderAbort( - _abortOutputScript []uint8, +func (d *Deposit) CallProvideECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1656,38 +1624,59 @@ func (d *Deposit) CallRequestFunderAbort( d.caller, d.errorResolver, d.contractAddress, - "requestFunderAbort", + "provideECDSAFraudProof", &result, - _abortOutputScript, + _v, + _r, + _s, + _signedDigest, + _preimage, ) return err } -func (d *Deposit) RequestFunderAbortGasEstimate( - _abortOutputScript []uint8, +func (d *Deposit) ProvideECDSAFraudProofGasEstimate( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "requestFunderAbort", + "provideECDSAFraudProof", d.contractABI, d.transactor, - _abortOutputScript, + _v, + _r, + _s, + _signedDigest, + _preimage, ) return result, err } // Transaction submission. -func (d *Deposit) RetrieveSignerPubkey( +func (d *Deposit) ProvideRedemptionSignature( + _v uint8, + _r [32]uint8, + _s [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction retrieveSignerPubkey", + "submitting transaction provideRedemptionSignature", + "params: ", + fmt.Sprint( + _v, + _r, + _s, + ), ) d.transactionMutex.Lock() @@ -1712,20 +1701,26 @@ func (d *Deposit) RetrieveSignerPubkey( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.RetrieveSignerPubkey( + transaction, err := d.contract.ProvideRedemptionSignature( transactorOptions, + _v, + _r, + _s, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "retrieveSignerPubkey", + "provideRedemptionSignature", + _v, + _r, + _s, ) } dLogger.Infof( - "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1736,20 +1731,26 @@ func (d *Deposit) RetrieveSignerPubkey( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.RetrieveSignerPubkey( + transaction, err := d.contract.ProvideRedemptionSignature( transactorOptions, + _v, + _r, + _s, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "retrieveSignerPubkey", + "provideRedemptionSignature", + _v, + _r, + _s, ) } dLogger.Infof( - "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1764,7 +1765,10 @@ func (d *Deposit) RetrieveSignerPubkey( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallRetrieveSignerPubkey( +func (d *Deposit) CallProvideRedemptionSignature( + _v uint8, + _r [32]uint8, + _s [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1776,40 +1780,48 @@ func (d *Deposit) CallRetrieveSignerPubkey( d.caller, d.errorResolver, d.contractAddress, - "retrieveSignerPubkey", + "provideRedemptionSignature", &result, + _v, + _r, + _s, ) return err } -func (d *Deposit) RetrieveSignerPubkeyGasEstimate() (uint64, error) { +func (d *Deposit) ProvideRedemptionSignatureGasEstimate( + _v uint8, + _r [32]uint8, + _s [32]uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "retrieveSignerPubkey", + "provideRedemptionSignature", d.contractABI, d.transactor, + _v, + _r, + _s, ) return result, err } // Transaction submission. -func (d *Deposit) IncreaseRedemptionFee( - _previousOutputValueBytes [8]uint8, - _newOutputValueBytes [8]uint8, +func (d *Deposit) RequestFunderAbort( + _abortOutputScript []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction increaseRedemptionFee", + "submitting transaction requestFunderAbort", "params: ", fmt.Sprint( - _previousOutputValueBytes, - _newOutputValueBytes, + _abortOutputScript, ), ) @@ -1835,24 +1847,22 @@ func (d *Deposit) IncreaseRedemptionFee( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.IncreaseRedemptionFee( + transaction, err := d.contract.RequestFunderAbort( transactorOptions, - _previousOutputValueBytes, - _newOutputValueBytes, + _abortOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "increaseRedemptionFee", - _previousOutputValueBytes, - _newOutputValueBytes, + "requestFunderAbort", + _abortOutputScript, ) } dLogger.Infof( - "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", + "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1863,24 +1873,22 @@ func (d *Deposit) IncreaseRedemptionFee( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.IncreaseRedemptionFee( + transaction, err := d.contract.RequestFunderAbort( transactorOptions, - _previousOutputValueBytes, - _newOutputValueBytes, + _abortOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "increaseRedemptionFee", - _previousOutputValueBytes, - _newOutputValueBytes, + "requestFunderAbort", + _abortOutputScript, ) } dLogger.Infof( - "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", + "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1895,9 +1903,8 @@ func (d *Deposit) IncreaseRedemptionFee( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallIncreaseRedemptionFee( - _previousOutputValueBytes [8]uint8, - _newOutputValueBytes [8]uint8, +func (d *Deposit) CallRequestFunderAbort( + _abortOutputScript []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1909,41 +1916,51 @@ func (d *Deposit) CallIncreaseRedemptionFee( d.caller, d.errorResolver, d.contractAddress, - "increaseRedemptionFee", + "requestFunderAbort", &result, - _previousOutputValueBytes, - _newOutputValueBytes, + _abortOutputScript, ) return err } -func (d *Deposit) IncreaseRedemptionFeeGasEstimate( - _previousOutputValueBytes [8]uint8, - _newOutputValueBytes [8]uint8, +func (d *Deposit) RequestFunderAbortGasEstimate( + _abortOutputScript []uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "increaseRedemptionFee", + "requestFunderAbort", d.contractABI, d.transactor, - _previousOutputValueBytes, - _newOutputValueBytes, + _abortOutputScript, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyFundingTimedOut( +func (d *Deposit) ProvideFundingECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyFundingTimedOut", + "submitting transaction provideFundingECDSAFraudProof", + "params: ", + fmt.Sprint( + _v, + _r, + _s, + _signedDigest, + _preimage, + ), ) d.transactionMutex.Lock() @@ -1968,20 +1985,30 @@ func (d *Deposit) NotifyFundingTimedOut( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyFundingTimedOut( + transaction, err := d.contract.ProvideFundingECDSAFraudProof( transactorOptions, + _v, + _r, + _s, + _signedDigest, + _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyFundingTimedOut", + "provideFundingECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, ) } dLogger.Infof( - "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", + "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1992,20 +2019,30 @@ func (d *Deposit) NotifyFundingTimedOut( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyFundingTimedOut( + transaction, err := d.contract.ProvideFundingECDSAFraudProof( transactorOptions, + _v, + _r, + _s, + _signedDigest, + _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyFundingTimedOut", + "provideFundingECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, ) } dLogger.Infof( - "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", + "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2020,7 +2057,12 @@ func (d *Deposit) NotifyFundingTimedOut( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyFundingTimedOut( +func (d *Deposit) CallProvideFundingECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2032,43 +2074,50 @@ func (d *Deposit) CallNotifyFundingTimedOut( d.caller, d.errorResolver, d.contractAddress, - "notifyFundingTimedOut", + "provideFundingECDSAFraudProof", &result, + _v, + _r, + _s, + _signedDigest, + _preimage, ) return err } -func (d *Deposit) NotifyFundingTimedOutGasEstimate() (uint64, error) { +func (d *Deposit) ProvideFundingECDSAFraudProofGasEstimate( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyFundingTimedOut", + "provideFundingECDSAFraudProof", d.contractABI, d.transactor, + _v, + _r, + _s, + _signedDigest, + _preimage, ) return result, err } // Transaction submission. -func (d *Deposit) ProvideRedemptionSignature( - _v uint8, - _r [32]uint8, - _s [32]uint8, +func (d *Deposit) NotifyCourtesyCallExpired( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideRedemptionSignature", - "params: ", - fmt.Sprint( - _v, - _r, - _s, - ), + "submitting transaction notifyCourtesyCallExpired", ) d.transactionMutex.Lock() @@ -2093,26 +2142,20 @@ func (d *Deposit) ProvideRedemptionSignature( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideRedemptionSignature( + transaction, err := d.contract.NotifyCourtesyCallExpired( transactorOptions, - _v, - _r, - _s, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideRedemptionSignature", - _v, - _r, - _s, + "notifyCourtesyCallExpired", ) } dLogger.Infof( - "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2123,26 +2166,20 @@ func (d *Deposit) ProvideRedemptionSignature( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideRedemptionSignature( + transaction, err := d.contract.NotifyCourtesyCallExpired( transactorOptions, - _v, - _r, - _s, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideRedemptionSignature", - _v, - _r, - _s, + "notifyCourtesyCallExpired", ) } dLogger.Infof( - "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2157,10 +2194,7 @@ func (d *Deposit) ProvideRedemptionSignature( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideRedemptionSignature( - _v uint8, - _r [32]uint8, - _s [32]uint8, +func (d *Deposit) CallNotifyCourtesyCallExpired( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2172,32 +2206,22 @@ func (d *Deposit) CallProvideRedemptionSignature( d.caller, d.errorResolver, d.contractAddress, - "provideRedemptionSignature", + "notifyCourtesyCallExpired", &result, - _v, - _r, - _s, ) return err } -func (d *Deposit) ProvideRedemptionSignatureGasEstimate( - _v uint8, - _r [32]uint8, - _s [32]uint8, -) (uint64, error) { +func (d *Deposit) NotifyCourtesyCallExpiredGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideRedemptionSignature", + "notifyCourtesyCallExpired", d.contractABI, d.transactor, - _v, - _r, - _s, ) return result, err @@ -2320,12 +2344,12 @@ func (d *Deposit) PurchaseSignerBondsAtAuctionGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) NotifyRedemptionSignatureTimedOut( +func (d *Deposit) RetrieveSignerPubkey( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyRedemptionSignatureTimedOut", + "submitting transaction retrieveSignerPubkey", ) d.transactionMutex.Lock() @@ -2350,7 +2374,7 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( + transaction, err := d.contract.RetrieveSignerPubkey( transactorOptions, ) if err != nil { @@ -2358,12 +2382,12 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( err, d.transactorOptions.From, nil, - "notifyRedemptionSignatureTimedOut", + "retrieveSignerPubkey", ) } dLogger.Infof( - "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", + "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2374,7 +2398,7 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( + transaction, err := d.contract.RetrieveSignerPubkey( transactorOptions, ) if err != nil { @@ -2382,12 +2406,12 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( err, d.transactorOptions.From, nil, - "notifyRedemptionSignatureTimedOut", + "retrieveSignerPubkey", ) } dLogger.Infof( - "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", + "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2402,7 +2426,7 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyRedemptionSignatureTimedOut( +func (d *Deposit) CallRetrieveSignerPubkey( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2414,20 +2438,20 @@ func (d *Deposit) CallNotifyRedemptionSignatureTimedOut( d.caller, d.errorResolver, d.contractAddress, - "notifyRedemptionSignatureTimedOut", + "retrieveSignerPubkey", &result, ) return err } -func (d *Deposit) NotifyRedemptionSignatureTimedOutGasEstimate() (uint64, error) { +func (d *Deposit) RetrieveSignerPubkeyGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyRedemptionSignatureTimedOut", + "retrieveSignerPubkey", d.contractABI, d.transactor, ) @@ -2436,12 +2460,17 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOutGasEstimate() (uint64, error) } // Transaction submission. -func (d *Deposit) WithdrawFunds( +func (d *Deposit) Initialize( + _factory common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction withdrawFunds", + "submitting transaction initialize", + "params: ", + fmt.Sprint( + _factory, + ), ) d.transactionMutex.Lock() @@ -2466,20 +2495,22 @@ func (d *Deposit) WithdrawFunds( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.WithdrawFunds( + transaction, err := d.contract.Initialize( transactorOptions, + _factory, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "withdrawFunds", + "initialize", + _factory, ) } dLogger.Infof( - "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", + "submitted transaction initialize with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2490,20 +2521,22 @@ func (d *Deposit) WithdrawFunds( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.WithdrawFunds( + transaction, err := d.contract.Initialize( transactorOptions, + _factory, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "withdrawFunds", + "initialize", + _factory, ) } dLogger.Infof( - "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", + "submitted transaction initialize with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2518,7 +2551,8 @@ func (d *Deposit) WithdrawFunds( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallWithdrawFunds( +func (d *Deposit) CallInitialize( + _factory common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2530,39 +2564,55 @@ func (d *Deposit) CallWithdrawFunds( d.caller, d.errorResolver, d.contractAddress, - "withdrawFunds", + "initialize", &result, + _factory, ) return err } -func (d *Deposit) WithdrawFundsGasEstimate() (uint64, error) { +func (d *Deposit) InitializeGasEstimate( + _factory common.Address, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "withdrawFunds", + "initialize", d.contractABI, d.transactor, + _factory, ) return result, err } // Transaction submission. -func (d *Deposit) Initialize( - _factory common.Address, +func (d *Deposit) InitializeDeposit( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, + value *big.Int, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction initialize", + "submitting transaction initializeDeposit", "params: ", fmt.Sprint( - _factory, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ), + "value: ", value, ) d.transactionMutex.Lock() @@ -2572,6 +2622,8 @@ func (d *Deposit) Initialize( transactorOptions := new(bind.TransactOpts) *transactorOptions = *d.transactorOptions + transactorOptions.Value = value + if len(transactionOptions) > 1 { return nil, fmt.Errorf( "could not process multiple transaction options sets", @@ -2587,22 +2639,32 @@ func (d *Deposit) Initialize( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.Initialize( + transaction, err := d.contract.InitializeDeposit( transactorOptions, - _factory, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, - nil, - "initialize", - _factory, + value, + "initializeDeposit", + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) } dLogger.Infof( - "submitted transaction initialize with id: [%v] and nonce [%v]", + "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2613,22 +2675,32 @@ func (d *Deposit) Initialize( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.Initialize( + transaction, err := d.contract.InitializeDeposit( transactorOptions, - _factory, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, - nil, - "initialize", - _factory, + value, + "initializeDeposit", + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) } dLogger.Infof( - "submitted transaction initialize with id: [%v] and nonce [%v]", + "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2643,58 +2715,72 @@ func (d *Deposit) Initialize( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallInitialize( - _factory common.Address, +func (d *Deposit) CallInitializeDeposit( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, + value *big.Int, blockNumber *big.Int, ) error { var result interface{} = nil err := ethutil.CallAtBlock( d.transactorOptions.From, - blockNumber, nil, + blockNumber, value, d.contractABI, d.caller, d.errorResolver, d.contractAddress, - "initialize", + "initializeDeposit", &result, - _factory, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) return err } -func (d *Deposit) InitializeGasEstimate( - _factory common.Address, +func (d *Deposit) InitializeDepositGasEstimate( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "initialize", + "initializeDeposit", d.contractABI, d.transactor, - _factory, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) return result, err } // Transaction submission. -func (d *Deposit) RequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, +func (d *Deposit) NotifyRedemptionSignatureTimedOut( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction requestRedemption", - "params: ", - fmt.Sprint( - _outputValueBytes, - _redeemerOutputScript, - ), + "submitting transaction notifyRedemptionSignatureTimedOut", ) d.transactionMutex.Lock() @@ -2719,24 +2805,20 @@ func (d *Deposit) RequestRedemption( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.RequestRedemption( + transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "requestRedemption", - _outputValueBytes, - _redeemerOutputScript, + "notifyRedemptionSignatureTimedOut", ) } dLogger.Infof( - "submitted transaction requestRedemption with id: [%v] and nonce [%v]", + "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2747,24 +2829,20 @@ func (d *Deposit) RequestRedemption( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.RequestRedemption( + transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "requestRedemption", - _outputValueBytes, - _redeemerOutputScript, + "notifyRedemptionSignatureTimedOut", ) } dLogger.Infof( - "submitted transaction requestRedemption with id: [%v] and nonce [%v]", + "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2779,9 +2857,7 @@ func (d *Deposit) RequestRedemption( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallRequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, +func (d *Deposit) CallNotifyRedemptionSignatureTimedOut( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2793,41 +2869,34 @@ func (d *Deposit) CallRequestRedemption( d.caller, d.errorResolver, d.contractAddress, - "requestRedemption", + "notifyRedemptionSignatureTimedOut", &result, - _outputValueBytes, - _redeemerOutputScript, ) return err } -func (d *Deposit) RequestRedemptionGasEstimate( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, -) (uint64, error) { +func (d *Deposit) NotifyRedemptionSignatureTimedOutGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "requestRedemption", + "notifyRedemptionSignatureTimedOut", d.contractABI, d.transactor, - _outputValueBytes, - _redeemerOutputScript, ) return result, err } // Transaction submission. -func (d *Deposit) NotifySignerSetupFailed( +func (d *Deposit) NotifyCourtesyCall( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifySignerSetupFailed", + "submitting transaction notifyCourtesyCall", ) d.transactionMutex.Lock() @@ -2852,7 +2921,7 @@ func (d *Deposit) NotifySignerSetupFailed( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifySignerSetupFailed( + transaction, err := d.contract.NotifyCourtesyCall( transactorOptions, ) if err != nil { @@ -2860,12 +2929,12 @@ func (d *Deposit) NotifySignerSetupFailed( err, d.transactorOptions.From, nil, - "notifySignerSetupFailed", + "notifyCourtesyCall", ) } dLogger.Infof( - "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2876,7 +2945,7 @@ func (d *Deposit) NotifySignerSetupFailed( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifySignerSetupFailed( + transaction, err := d.contract.NotifyCourtesyCall( transactorOptions, ) if err != nil { @@ -2884,12 +2953,12 @@ func (d *Deposit) NotifySignerSetupFailed( err, d.transactorOptions.From, nil, - "notifySignerSetupFailed", + "notifyCourtesyCall", ) } dLogger.Infof( - "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2904,7 +2973,7 @@ func (d *Deposit) NotifySignerSetupFailed( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifySignerSetupFailed( +func (d *Deposit) CallNotifyCourtesyCall( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2916,20 +2985,20 @@ func (d *Deposit) CallNotifySignerSetupFailed( d.caller, d.errorResolver, d.contractAddress, - "notifySignerSetupFailed", + "notifyCourtesyCall", &result, ) return err } -func (d *Deposit) NotifySignerSetupFailedGasEstimate() (uint64, error) { +func (d *Deposit) NotifyCourtesyCallGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifySignerSetupFailed", + "notifyCourtesyCall", d.contractABI, d.transactor, ) @@ -2938,29 +3007,12 @@ func (d *Deposit) NotifySignerSetupFailedGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) InitializeDeposit( - _tbtcSystem common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachineAddress common.Address, - _lotSizeSatoshis uint64, - value *big.Int, +func (d *Deposit) WithdrawFunds( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction initializeDeposit", - "params: ", - fmt.Sprint( - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, - ), - "value: ", value, + "submitting transaction withdrawFunds", ) d.transactionMutex.Lock() @@ -2970,8 +3022,6 @@ func (d *Deposit) InitializeDeposit( transactorOptions := new(bind.TransactOpts) *transactorOptions = *d.transactorOptions - transactorOptions.Value = value - if len(transactionOptions) > 1 { return nil, fmt.Errorf( "could not process multiple transaction options sets", @@ -2987,32 +3037,20 @@ func (d *Deposit) InitializeDeposit( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.InitializeDeposit( + transaction, err := d.contract.WithdrawFunds( transactorOptions, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, - value, - "initializeDeposit", - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, + nil, + "withdrawFunds", ) } dLogger.Infof( - "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", + "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3023,32 +3061,20 @@ func (d *Deposit) InitializeDeposit( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.InitializeDeposit( + transaction, err := d.contract.WithdrawFunds( transactorOptions, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, - value, - "initializeDeposit", - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, + nil, + "withdrawFunds", ) } dLogger.Infof( - "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", + "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3063,60 +3089,34 @@ func (d *Deposit) InitializeDeposit( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallInitializeDeposit( - _tbtcSystem common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachineAddress common.Address, - _lotSizeSatoshis uint64, - value *big.Int, +func (d *Deposit) CallWithdrawFunds( blockNumber *big.Int, ) error { var result interface{} = nil err := ethutil.CallAtBlock( d.transactorOptions.From, - blockNumber, value, + blockNumber, nil, d.contractABI, d.caller, d.errorResolver, d.contractAddress, - "initializeDeposit", + "withdrawFunds", &result, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, ) return err } -func (d *Deposit) InitializeDepositGasEstimate( - _tbtcSystem common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachineAddress common.Address, - _lotSizeSatoshis uint64, -) (uint64, error) { +func (d *Deposit) WithdrawFundsGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "initializeDeposit", + "withdrawFunds", d.contractABI, d.transactor, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, ) return result, err @@ -3124,9 +3124,9 @@ func (d *Deposit) InitializeDepositGasEstimate( // ----- Const Methods ------ -func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { +func (d *Deposit) SeverelyUndercollateralizedThresholdPercent() (uint16, error) { var result uint16 - result, err := d.contract.InitialCollateralizedPercent( + result, err := d.contract.SeverelyUndercollateralizedThresholdPercent( d.callerOptions, ) @@ -3135,14 +3135,14 @@ func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { err, d.callerOptions.From, nil, - "initialCollateralizedPercent", + "severelyUndercollateralizedThresholdPercent", ) } return result, err } -func (d *Deposit) InitialCollateralizedPercentAtBlock( +func (d *Deposit) SeverelyUndercollateralizedThresholdPercentAtBlock( blockNumber *big.Int, ) (uint16, error) { var result uint16 @@ -3155,16 +3155,54 @@ func (d *Deposit) InitialCollateralizedPercentAtBlock( d.caller, d.errorResolver, d.contractAddress, - "initialCollateralizedPercent", + "severelyUndercollateralizedThresholdPercent", + &result, + ) + + return result, err +} + +func (d *Deposit) LotSizeSatoshis() (uint64, error) { + var result uint64 + result, err := d.contract.LotSizeSatoshis( + d.callerOptions, + ) + + if err != nil { + return result, d.errorResolver.ResolveError( + err, + d.callerOptions.From, + nil, + "lotSizeSatoshis", + ) + } + + return result, err +} + +func (d *Deposit) LotSizeSatoshisAtBlock( + blockNumber *big.Int, +) (uint64, error) { + var result uint64 + + err := ethutil.CallAtBlock( + d.callerOptions.From, + blockNumber, + nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "lotSizeSatoshis", &result, ) return result, err } -func (d *Deposit) LotSizeTbtc() (*big.Int, error) { +func (d *Deposit) CurrentState() (*big.Int, error) { var result *big.Int - result, err := d.contract.LotSizeTbtc( + result, err := d.contract.CurrentState( d.callerOptions, ) @@ -3173,14 +3211,14 @@ func (d *Deposit) LotSizeTbtc() (*big.Int, error) { err, d.callerOptions.From, nil, - "lotSizeTbtc", + "currentState", ) } return result, err } -func (d *Deposit) LotSizeTbtcAtBlock( +func (d *Deposit) CurrentStateAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3193,16 +3231,16 @@ func (d *Deposit) LotSizeTbtcAtBlock( d.caller, d.errorResolver, d.contractAddress, - "lotSizeTbtc", + "currentState", &result, ) return result, err } -func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { - var result *big.Int - result, err := d.contract.SignerFeeTbtc( +func (d *Deposit) KeepAddress() (common.Address, error) { + var result common.Address + result, err := d.contract.KeepAddress( d.callerOptions, ) @@ -3211,17 +3249,17 @@ func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { err, d.callerOptions.From, nil, - "signerFeeTbtc", + "keepAddress", ) } return result, err } -func (d *Deposit) SignerFeeTbtcAtBlock( +func (d *Deposit) KeepAddressAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (common.Address, error) { + var result common.Address err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3231,16 +3269,16 @@ func (d *Deposit) SignerFeeTbtcAtBlock( d.caller, d.errorResolver, d.contractAddress, - "signerFeeTbtc", + "keepAddress", &result, ) return result, err } -func (d *Deposit) WithdrawableAmount() (*big.Int, error) { - var result *big.Int - result, err := d.contract.WithdrawableAmount( +func (d *Deposit) UndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := d.contract.UndercollateralizedThresholdPercent( d.callerOptions, ) @@ -3249,17 +3287,17 @@ func (d *Deposit) WithdrawableAmount() (*big.Int, error) { err, d.callerOptions.From, nil, - "withdrawableAmount", + "undercollateralizedThresholdPercent", ) } return result, err } -func (d *Deposit) WithdrawableAmountAtBlock( +func (d *Deposit) UndercollateralizedThresholdPercentAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3269,16 +3307,16 @@ func (d *Deposit) WithdrawableAmountAtBlock( d.caller, d.errorResolver, d.contractAddress, - "withdrawableAmount", + "undercollateralizedThresholdPercent", &result, ) return result, err } -func (d *Deposit) CollateralizationPercentage() (*big.Int, error) { +func (d *Deposit) WithdrawableAmount() (*big.Int, error) { var result *big.Int - result, err := d.contract.CollateralizationPercentage( + result, err := d.contract.WithdrawableAmount( d.callerOptions, ) @@ -3287,14 +3325,14 @@ func (d *Deposit) CollateralizationPercentage() (*big.Int, error) { err, d.callerOptions.From, nil, - "collateralizationPercentage", + "withdrawableAmount", ) } return result, err } -func (d *Deposit) CollateralizationPercentageAtBlock( +func (d *Deposit) WithdrawableAmountAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3307,20 +3345,17 @@ func (d *Deposit) CollateralizationPercentageAtBlock( d.caller, d.errorResolver, d.contractAddress, - "collateralizationPercentage", + "withdrawableAmount", &result, ) return result, err } -func (d *Deposit) GetOwnerRedemptionTbtcRequirement( - _redeemer common.Address, -) (*big.Int, error) { +func (d *Deposit) CollateralizationPercentage() (*big.Int, error) { var result *big.Int - result, err := d.contract.GetOwnerRedemptionTbtcRequirement( + result, err := d.contract.CollateralizationPercentage( d.callerOptions, - _redeemer, ) if err != nil { @@ -3328,16 +3363,14 @@ func (d *Deposit) GetOwnerRedemptionTbtcRequirement( err, d.callerOptions.From, nil, - "getOwnerRedemptionTbtcRequirement", - _redeemer, + "collateralizationPercentage", ) } return result, err } -func (d *Deposit) GetOwnerRedemptionTbtcRequirementAtBlock( - _redeemer common.Address, +func (d *Deposit) CollateralizationPercentageAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3350,17 +3383,22 @@ func (d *Deposit) GetOwnerRedemptionTbtcRequirementAtBlock( d.caller, d.errorResolver, d.contractAddress, - "getOwnerRedemptionTbtcRequirement", + "collateralizationPercentage", &result, - _redeemer, ) return result, err } -func (d *Deposit) LotSizeSatoshis() (uint64, error) { - var result uint64 - result, err := d.contract.LotSizeSatoshis( +type fundingInfo struct { + UtxoValueBytes [8]uint8 + FundedAt *big.Int + UtxoOutpoint []uint8 +} + +func (d *Deposit) FundingInfo() (fundingInfo, error) { + var result fundingInfo + result, err := d.contract.FundingInfo( d.callerOptions, ) @@ -3369,17 +3407,17 @@ func (d *Deposit) LotSizeSatoshis() (uint64, error) { err, d.callerOptions.From, nil, - "lotSizeSatoshis", + "fundingInfo", ) } return result, err } -func (d *Deposit) LotSizeSatoshisAtBlock( +func (d *Deposit) FundingInfoAtBlock( blockNumber *big.Int, -) (uint64, error) { - var result uint64 +) (fundingInfo, error) { + var result fundingInfo err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3389,7 +3427,7 @@ func (d *Deposit) LotSizeSatoshisAtBlock( d.caller, d.errorResolver, d.contractAddress, - "lotSizeSatoshis", + "fundingInfo", &result, ) @@ -3434,9 +3472,9 @@ func (d *Deposit) AuctionValueAtBlock( return result, err } -func (d *Deposit) UndercollateralizedThresholdPercent() (uint16, error) { - var result uint16 - result, err := d.contract.UndercollateralizedThresholdPercent( +func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { + var result *big.Int + result, err := d.contract.SignerFeeTbtc( d.callerOptions, ) @@ -3445,17 +3483,17 @@ func (d *Deposit) UndercollateralizedThresholdPercent() (uint16, error) { err, d.callerOptions.From, nil, - "undercollateralizedThresholdPercent", + "signerFeeTbtc", ) } return result, err } -func (d *Deposit) UndercollateralizedThresholdPercentAtBlock( +func (d *Deposit) SignerFeeTbtcAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3465,17 +3503,20 @@ func (d *Deposit) UndercollateralizedThresholdPercentAtBlock( d.caller, d.errorResolver, d.contractAddress, - "undercollateralizedThresholdPercent", + "signerFeeTbtc", &result, ) return result, err } -func (d *Deposit) InActive() (bool, error) { - var result bool - result, err := d.contract.InActive( +func (d *Deposit) GetOwnerRedemptionTbtcRequirement( + _redeemer common.Address, +) (*big.Int, error) { + var result *big.Int + result, err := d.contract.GetOwnerRedemptionTbtcRequirement( d.callerOptions, + _redeemer, ) if err != nil { @@ -3483,17 +3524,19 @@ func (d *Deposit) InActive() (bool, error) { err, d.callerOptions.From, nil, - "inActive", + "getOwnerRedemptionTbtcRequirement", + _redeemer, ) } return result, err } -func (d *Deposit) InActiveAtBlock( +func (d *Deposit) GetOwnerRedemptionTbtcRequirementAtBlock( + _redeemer common.Address, blockNumber *big.Int, -) (bool, error) { - var result bool +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3503,22 +3546,17 @@ func (d *Deposit) InActiveAtBlock( d.caller, d.errorResolver, d.contractAddress, - "inActive", + "getOwnerRedemptionTbtcRequirement", &result, + _redeemer, ) return result, err } -type fundingInfo struct { - UtxoValueBytes [8]uint8 - FundedAt *big.Int - UtxoOutpoint []uint8 -} - -func (d *Deposit) FundingInfo() (fundingInfo, error) { - var result fundingInfo - result, err := d.contract.FundingInfo( +func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { + var result uint16 + result, err := d.contract.InitialCollateralizedPercent( d.callerOptions, ) @@ -3527,17 +3565,17 @@ func (d *Deposit) FundingInfo() (fundingInfo, error) { err, d.callerOptions.From, nil, - "fundingInfo", + "initialCollateralizedPercent", ) } return result, err } -func (d *Deposit) FundingInfoAtBlock( +func (d *Deposit) InitialCollateralizedPercentAtBlock( blockNumber *big.Int, -) (fundingInfo, error) { - var result fundingInfo +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3547,7 +3585,7 @@ func (d *Deposit) FundingInfoAtBlock( d.caller, d.errorResolver, d.contractAddress, - "fundingInfo", + "initialCollateralizedPercent", &result, ) @@ -3592,53 +3630,9 @@ func (d *Deposit) RemainingTermAtBlock( return result, err } -func (d *Deposit) GetRedemptionTbtcRequirement( - _redeemer common.Address, -) (*big.Int, error) { - var result *big.Int - result, err := d.contract.GetRedemptionTbtcRequirement( - d.callerOptions, - _redeemer, - ) - - if err != nil { - return result, d.errorResolver.ResolveError( - err, - d.callerOptions.From, - nil, - "getRedemptionTbtcRequirement", - _redeemer, - ) - } - - return result, err -} - -func (d *Deposit) GetRedemptionTbtcRequirementAtBlock( - _redeemer common.Address, - blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int - - err := ethutil.CallAtBlock( - d.callerOptions.From, - blockNumber, - nil, - d.contractABI, - d.caller, - d.errorResolver, - d.contractAddress, - "getRedemptionTbtcRequirement", - &result, - _redeemer, - ) - - return result, err -} - -func (d *Deposit) KeepAddress() (common.Address, error) { - var result common.Address - result, err := d.contract.KeepAddress( +func (d *Deposit) InActive() (bool, error) { + var result bool + result, err := d.contract.InActive( d.callerOptions, ) @@ -3647,17 +3641,17 @@ func (d *Deposit) KeepAddress() (common.Address, error) { err, d.callerOptions.From, nil, - "keepAddress", + "inActive", ) } return result, err } -func (d *Deposit) KeepAddressAtBlock( +func (d *Deposit) InActiveAtBlock( blockNumber *big.Int, -) (common.Address, error) { - var result common.Address +) (bool, error) { + var result bool err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3667,16 +3661,16 @@ func (d *Deposit) KeepAddressAtBlock( d.caller, d.errorResolver, d.contractAddress, - "keepAddress", + "inActive", &result, ) return result, err } -func (d *Deposit) UtxoValue() (*big.Int, error) { +func (d *Deposit) LotSizeTbtc() (*big.Int, error) { var result *big.Int - result, err := d.contract.UtxoValue( + result, err := d.contract.LotSizeTbtc( d.callerOptions, ) @@ -3685,14 +3679,14 @@ func (d *Deposit) UtxoValue() (*big.Int, error) { err, d.callerOptions.From, nil, - "utxoValue", + "lotSizeTbtc", ) } return result, err } -func (d *Deposit) UtxoValueAtBlock( +func (d *Deposit) LotSizeTbtcAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3705,17 +3699,20 @@ func (d *Deposit) UtxoValueAtBlock( d.caller, d.errorResolver, d.contractAddress, - "utxoValue", + "lotSizeTbtc", &result, ) return result, err } -func (d *Deposit) CurrentState() (*big.Int, error) { +func (d *Deposit) GetRedemptionTbtcRequirement( + _redeemer common.Address, +) (*big.Int, error) { var result *big.Int - result, err := d.contract.CurrentState( + result, err := d.contract.GetRedemptionTbtcRequirement( d.callerOptions, + _redeemer, ) if err != nil { @@ -3723,14 +3720,16 @@ func (d *Deposit) CurrentState() (*big.Int, error) { err, d.callerOptions.From, nil, - "currentState", + "getRedemptionTbtcRequirement", + _redeemer, ) } return result, err } -func (d *Deposit) CurrentStateAtBlock( +func (d *Deposit) GetRedemptionTbtcRequirementAtBlock( + _redeemer common.Address, blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3743,16 +3742,17 @@ func (d *Deposit) CurrentStateAtBlock( d.caller, d.errorResolver, d.contractAddress, - "currentState", + "getRedemptionTbtcRequirement", &result, + _redeemer, ) return result, err } -func (d *Deposit) SeverelyUndercollateralizedThresholdPercent() (uint16, error) { - var result uint16 - result, err := d.contract.SeverelyUndercollateralizedThresholdPercent( +func (d *Deposit) UtxoValue() (*big.Int, error) { + var result *big.Int + result, err := d.contract.UtxoValue( d.callerOptions, ) @@ -3761,17 +3761,17 @@ func (d *Deposit) SeverelyUndercollateralizedThresholdPercent() (uint16, error) err, d.callerOptions.From, nil, - "severelyUndercollateralizedThresholdPercent", + "utxoValue", ) } return result, err } -func (d *Deposit) SeverelyUndercollateralizedThresholdPercentAtBlock( +func (d *Deposit) UtxoValueAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3781,7 +3781,7 @@ func (d *Deposit) SeverelyUndercollateralizedThresholdPercentAtBlock( d.caller, d.errorResolver, d.contractAddress, - "severelyUndercollateralizedThresholdPercent", + "utxoValue", &result, ) diff --git a/pkg/chain/ethereum/gen/contract/TBTCSystem.go b/pkg/chain/ethereum/gen/contract/TBTCSystem.go index 84af1f8dd..f9dee2b32 100644 --- a/pkg/chain/ethereum/gen/contract/TBTCSystem.go +++ b/pkg/chain/ethereum/gen/contract/TBTCSystem.go @@ -94,27 +94,12 @@ func NewTBTCSystem( // ----- Non-const Methods ------ // Transaction submission. -func (tbtcs *TBTCSystem) LogRedemptionRequested( - _requester common.Address, - _digest [32]uint8, - _utxoValue *big.Int, - _redeemerOutputScript []uint8, - _requestedFee *big.Int, - _outpoint []uint8, +func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logRedemptionRequested", - "params: ", - fmt.Sprint( - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, - ), + "submitting transaction refreshMinimumBondableValue", ) tbtcs.transactionMutex.Lock() @@ -139,32 +124,20 @@ func (tbtcs *TBTCSystem) LogRedemptionRequested( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogRedemptionRequested( + transaction, err := tbtcs.contract.RefreshMinimumBondableValue( transactorOptions, - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logRedemptionRequested", - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, + "refreshMinimumBondableValue", ) } tbtcsLogger.Infof( - "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", + "submitted transaction refreshMinimumBondableValue with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -175,32 +148,20 @@ func (tbtcs *TBTCSystem) LogRedemptionRequested( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogRedemptionRequested( + transaction, err := tbtcs.contract.RefreshMinimumBondableValue( transactorOptions, - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logRedemptionRequested", - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, + "refreshMinimumBondableValue", ) } tbtcsLogger.Infof( - "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", + "submitted transaction refreshMinimumBondableValue with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -215,13 +176,7 @@ func (tbtcs *TBTCSystem) LogRedemptionRequested( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogRedemptionRequested( - _requester common.Address, - _digest [32]uint8, - _utxoValue *big.Int, - _redeemerOutputScript []uint8, - _requestedFee *big.Int, - _outpoint []uint8, +func (tbtcs *TBTCSystem) CallRefreshMinimumBondableValue( blockNumber *big.Int, ) error { var result interface{} = nil @@ -233,53 +188,34 @@ func (tbtcs *TBTCSystem) CallLogRedemptionRequested( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logRedemptionRequested", + "refreshMinimumBondableValue", &result, - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, ) return err } -func (tbtcs *TBTCSystem) LogRedemptionRequestedGasEstimate( - _requester common.Address, - _digest [32]uint8, - _utxoValue *big.Int, - _redeemerOutputScript []uint8, - _requestedFee *big.Int, - _outpoint []uint8, -) (uint64, error) { +func (tbtcs *TBTCSystem) RefreshMinimumBondableValueGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logRedemptionRequested", + "refreshMinimumBondableValue", tbtcs.contractABI, tbtcs.transactor, - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogSetupFailed( +func (tbtcs *TBTCSystem) ResumeNewDeposits( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logSetupFailed", + "submitting transaction resumeNewDeposits", ) tbtcs.transactionMutex.Lock() @@ -304,7 +240,7 @@ func (tbtcs *TBTCSystem) LogSetupFailed( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogSetupFailed( + transaction, err := tbtcs.contract.ResumeNewDeposits( transactorOptions, ) if err != nil { @@ -312,12 +248,12 @@ func (tbtcs *TBTCSystem) LogSetupFailed( err, tbtcs.transactorOptions.From, nil, - "logSetupFailed", + "resumeNewDeposits", ) } tbtcsLogger.Infof( - "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", + "submitted transaction resumeNewDeposits with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -328,7 +264,7 @@ func (tbtcs *TBTCSystem) LogSetupFailed( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogSetupFailed( + transaction, err := tbtcs.contract.ResumeNewDeposits( transactorOptions, ) if err != nil { @@ -336,12 +272,12 @@ func (tbtcs *TBTCSystem) LogSetupFailed( err, tbtcs.transactorOptions.From, nil, - "logSetupFailed", + "resumeNewDeposits", ) } tbtcsLogger.Infof( - "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", + "submitted transaction resumeNewDeposits with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -356,7 +292,7 @@ func (tbtcs *TBTCSystem) LogSetupFailed( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogSetupFailed( +func (tbtcs *TBTCSystem) CallResumeNewDeposits( blockNumber *big.Int, ) error { var result interface{} = nil @@ -368,20 +304,20 @@ func (tbtcs *TBTCSystem) CallLogSetupFailed( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logSetupFailed", + "resumeNewDeposits", &result, ) return err } -func (tbtcs *TBTCSystem) LogSetupFailedGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) ResumeNewDepositsGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logSetupFailed", + "resumeNewDeposits", tbtcs.contractABI, tbtcs.transactor, ) @@ -390,17 +326,12 @@ func (tbtcs *TBTCSystem) LogSetupFailedGasEstimate() (uint64, error) { } // Transaction submission. -func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAddition( - _ethBtcPriceFeed common.Address, +func (tbtcs *TBTCSystem) EmergencyPauseNewDeposits( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction beginEthBtcPriceFeedAddition", - "params: ", - fmt.Sprint( - _ethBtcPriceFeed, - ), + "submitting transaction emergencyPauseNewDeposits", ) tbtcs.transactionMutex.Lock() @@ -425,22 +356,20 @@ func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAddition( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.BeginEthBtcPriceFeedAddition( + transaction, err := tbtcs.contract.EmergencyPauseNewDeposits( transactorOptions, - _ethBtcPriceFeed, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginEthBtcPriceFeedAddition", - _ethBtcPriceFeed, + "emergencyPauseNewDeposits", ) } tbtcsLogger.Infof( - "submitted transaction beginEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + "submitted transaction emergencyPauseNewDeposits with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -451,22 +380,20 @@ func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAddition( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.BeginEthBtcPriceFeedAddition( + transaction, err := tbtcs.contract.EmergencyPauseNewDeposits( transactorOptions, - _ethBtcPriceFeed, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginEthBtcPriceFeedAddition", - _ethBtcPriceFeed, + "emergencyPauseNewDeposits", ) } tbtcsLogger.Infof( - "submitted transaction beginEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + "submitted transaction emergencyPauseNewDeposits with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -481,8 +408,7 @@ func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAddition( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallBeginEthBtcPriceFeedAddition( - _ethBtcPriceFeed common.Address, +func (tbtcs *TBTCSystem) CallEmergencyPauseNewDeposits( blockNumber *big.Int, ) error { var result interface{} = nil @@ -494,46 +420,42 @@ func (tbtcs *TBTCSystem) CallBeginEthBtcPriceFeedAddition( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "beginEthBtcPriceFeedAddition", + "emergencyPauseNewDeposits", &result, - _ethBtcPriceFeed, ) return err } -func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAdditionGasEstimate( - _ethBtcPriceFeed common.Address, -) (uint64, error) { +func (tbtcs *TBTCSystem) EmergencyPauseNewDepositsGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "beginEthBtcPriceFeedAddition", + "emergencyPauseNewDeposits", tbtcs.contractABI, tbtcs.transactor, - _ethBtcPriceFeed, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdate( - _keepStakedFactory common.Address, - _fullyBackedFactory common.Address, - _factorySelector common.Address, +func (tbtcs *TBTCSystem) LogGotRedemptionSignature( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction beginKeepFactoriesUpdate", + "submitting transaction logGotRedemptionSignature", "params: ", fmt.Sprint( - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + _digest, + _r, + _s, ), ) @@ -559,26 +481,26 @@ func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.BeginKeepFactoriesUpdate( + transaction, err := tbtcs.contract.LogGotRedemptionSignature( transactorOptions, - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + _digest, + _r, + _s, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginKeepFactoriesUpdate", - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + "logGotRedemptionSignature", + _digest, + _r, + _s, ) } tbtcsLogger.Infof( - "submitted transaction beginKeepFactoriesUpdate with id: [%v] and nonce [%v]", + "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -589,26 +511,26 @@ func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.BeginKeepFactoriesUpdate( + transaction, err := tbtcs.contract.LogGotRedemptionSignature( transactorOptions, - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + _digest, + _r, + _s, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginKeepFactoriesUpdate", - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + "logGotRedemptionSignature", + _digest, + _r, + _s, ) } tbtcsLogger.Infof( - "submitted transaction beginKeepFactoriesUpdate with id: [%v] and nonce [%v]", + "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -623,10 +545,10 @@ func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallBeginKeepFactoriesUpdate( - _keepStakedFactory common.Address, - _fullyBackedFactory common.Address, - _factorySelector common.Address, +func (tbtcs *TBTCSystem) CallLogGotRedemptionSignature( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -638,48 +560,58 @@ func (tbtcs *TBTCSystem) CallBeginKeepFactoriesUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "beginKeepFactoriesUpdate", + "logGotRedemptionSignature", &result, - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + _digest, + _r, + _s, ) return err } -func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdateGasEstimate( - _keepStakedFactory common.Address, - _fullyBackedFactory common.Address, - _factorySelector common.Address, +func (tbtcs *TBTCSystem) LogGotRedemptionSignatureGasEstimate( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "beginKeepFactoriesUpdate", + "logGotRedemptionSignature", tbtcs.contractABI, tbtcs.transactor, - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + _digest, + _r, + _s, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogStartedLiquidation( - _wasFraud bool, +func (tbtcs *TBTCSystem) LogRedemptionRequested( + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logStartedLiquidation", + "submitting transaction logRedemptionRequested", "params: ", fmt.Sprint( - _wasFraud, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ), ) @@ -705,22 +637,32 @@ func (tbtcs *TBTCSystem) LogStartedLiquidation( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogStartedLiquidation( + transaction, err := tbtcs.contract.LogRedemptionRequested( transactorOptions, - _wasFraud, - ) + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logStartedLiquidation", - _wasFraud, + "logRedemptionRequested", + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) } tbtcsLogger.Infof( - "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -731,22 +673,32 @@ func (tbtcs *TBTCSystem) LogStartedLiquidation( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogStartedLiquidation( + transaction, err := tbtcs.contract.LogRedemptionRequested( transactorOptions, - _wasFraud, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logStartedLiquidation", - _wasFraud, + "logRedemptionRequested", + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) } tbtcsLogger.Infof( - "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -761,8 +713,13 @@ func (tbtcs *TBTCSystem) LogStartedLiquidation( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogStartedLiquidation( - _wasFraud bool, +func (tbtcs *TBTCSystem) CallLogRedemptionRequested( + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -774,38 +731,62 @@ func (tbtcs *TBTCSystem) CallLogStartedLiquidation( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logStartedLiquidation", + "logRedemptionRequested", &result, - _wasFraud, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) return err } -func (tbtcs *TBTCSystem) LogStartedLiquidationGasEstimate( - _wasFraud bool, +func (tbtcs *TBTCSystem) LogRedemptionRequestedGasEstimate( + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logStartedLiquidation", + "logRedemptionRequested", tbtcs.contractABI, tbtcs.transactor, - _wasFraud, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( +func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdate( + _keepStakedFactory common.Address, + _fullyBackedFactory common.Address, + _factorySelector common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction refreshMinimumBondableValue", + "submitting transaction beginKeepFactoriesUpdate", + "params: ", + fmt.Sprint( + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, + ), ) tbtcs.transactionMutex.Lock() @@ -830,20 +811,26 @@ func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.RefreshMinimumBondableValue( + transaction, err := tbtcs.contract.BeginKeepFactoriesUpdate( transactorOptions, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "refreshMinimumBondableValue", + "beginKeepFactoriesUpdate", + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) } tbtcsLogger.Infof( - "submitted transaction refreshMinimumBondableValue with id: [%v] and nonce [%v]", + "submitted transaction beginKeepFactoriesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -854,20 +841,26 @@ func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.RefreshMinimumBondableValue( + transaction, err := tbtcs.contract.BeginKeepFactoriesUpdate( transactorOptions, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "refreshMinimumBondableValue", + "beginKeepFactoriesUpdate", + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) } tbtcsLogger.Infof( - "submitted transaction refreshMinimumBondableValue with id: [%v] and nonce [%v]", + "submitted transaction beginKeepFactoriesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -882,7 +875,10 @@ func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallRefreshMinimumBondableValue( +func (tbtcs *TBTCSystem) CallBeginKeepFactoriesUpdate( + _keepStakedFactory common.Address, + _fullyBackedFactory common.Address, + _factorySelector common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -894,34 +890,49 @@ func (tbtcs *TBTCSystem) CallRefreshMinimumBondableValue( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "refreshMinimumBondableValue", + "beginKeepFactoriesUpdate", &result, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) return err } -func (tbtcs *TBTCSystem) RefreshMinimumBondableValueGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdateGasEstimate( + _keepStakedFactory common.Address, + _fullyBackedFactory common.Address, + _factorySelector common.Address, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "refreshMinimumBondableValue", + "beginKeepFactoriesUpdate", tbtcs.contractABI, tbtcs.transactor, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAddition( +func (tbtcs *TBTCSystem) LogCreated( + _keepAddress common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction finalizeEthBtcPriceFeedAddition", + "submitting transaction logCreated", + "params: ", + fmt.Sprint( + _keepAddress, + ), ) tbtcs.transactionMutex.Lock() @@ -946,20 +957,22 @@ func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAddition( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.FinalizeEthBtcPriceFeedAddition( + transaction, err := tbtcs.contract.LogCreated( transactorOptions, + _keepAddress, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeEthBtcPriceFeedAddition", + "logCreated", + _keepAddress, ) } tbtcsLogger.Infof( - "submitted transaction finalizeEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + "submitted transaction logCreated with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -970,20 +983,22 @@ func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAddition( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.FinalizeEthBtcPriceFeedAddition( + transaction, err := tbtcs.contract.LogCreated( transactorOptions, + _keepAddress, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeEthBtcPriceFeedAddition", + "logCreated", + _keepAddress, ) } tbtcsLogger.Infof( - "submitted transaction finalizeEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + "submitted transaction logCreated with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -998,7 +1013,8 @@ func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAddition( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallFinalizeEthBtcPriceFeedAddition( +func (tbtcs *TBTCSystem) CallLogCreated( + _keepAddress common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1010,34 +1026,43 @@ func (tbtcs *TBTCSystem) CallFinalizeEthBtcPriceFeedAddition( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "finalizeEthBtcPriceFeedAddition", + "logCreated", &result, + _keepAddress, ) return err } -func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAdditionGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogCreatedGasEstimate( + _keepAddress common.Address, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "finalizeEthBtcPriceFeedAddition", + "logCreated", tbtcs.contractABI, tbtcs.transactor, + _keepAddress, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdate( +func (tbtcs *TBTCSystem) LogStartedLiquidation( + _wasFraud bool, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction finalizeSignerFeeDivisorUpdate", + "submitting transaction logStartedLiquidation", + "params: ", + fmt.Sprint( + _wasFraud, + ), ) tbtcs.transactionMutex.Lock() @@ -1062,20 +1087,22 @@ func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.FinalizeSignerFeeDivisorUpdate( + transaction, err := tbtcs.contract.LogStartedLiquidation( transactorOptions, + _wasFraud, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeSignerFeeDivisorUpdate", + "logStartedLiquidation", + _wasFraud, ) } tbtcsLogger.Infof( - "submitted transaction finalizeSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1086,20 +1113,22 @@ func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.FinalizeSignerFeeDivisorUpdate( + transaction, err := tbtcs.contract.LogStartedLiquidation( transactorOptions, + _wasFraud, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeSignerFeeDivisorUpdate", + "logStartedLiquidation", + _wasFraud, ) } tbtcsLogger.Infof( - "submitted transaction finalizeSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1114,7 +1143,8 @@ func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallFinalizeSignerFeeDivisorUpdate( +func (tbtcs *TBTCSystem) CallLogStartedLiquidation( + _wasFraud bool, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1126,55 +1156,38 @@ func (tbtcs *TBTCSystem) CallFinalizeSignerFeeDivisorUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "finalizeSignerFeeDivisorUpdate", + "logStartedLiquidation", &result, + _wasFraud, ) return err } -func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdateGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogStartedLiquidationGasEstimate( + _wasFraud bool, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "finalizeSignerFeeDivisorUpdate", + "logStartedLiquidation", tbtcs.contractABI, tbtcs.transactor, + _wasFraud, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) Initialize( - _defaultKeepFactory common.Address, - _depositFactory common.Address, - _masterDepositAddress common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachine common.Address, - _keepThreshold uint16, - _keepSize uint16, +func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAddition( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction initialize", - "params: ", - fmt.Sprint( - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, - ), + "submitting transaction finalizeEthBtcPriceFeedAddition", ) tbtcs.transactionMutex.Lock() @@ -1199,38 +1212,20 @@ func (tbtcs *TBTCSystem) Initialize( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.Initialize( + transaction, err := tbtcs.contract.FinalizeEthBtcPriceFeedAddition( transactorOptions, - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "initialize", - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, + "finalizeEthBtcPriceFeedAddition", ) } tbtcsLogger.Infof( - "submitted transaction initialize with id: [%v] and nonce [%v]", + "submitted transaction finalizeEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1241,38 +1236,20 @@ func (tbtcs *TBTCSystem) Initialize( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.Initialize( + transaction, err := tbtcs.contract.FinalizeEthBtcPriceFeedAddition( transactorOptions, - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "initialize", - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, + "finalizeEthBtcPriceFeedAddition", ) } tbtcsLogger.Infof( - "submitted transaction initialize with id: [%v] and nonce [%v]", + "submitted transaction finalizeEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1287,16 +1264,7 @@ func (tbtcs *TBTCSystem) Initialize( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallInitialize( - _defaultKeepFactory common.Address, - _depositFactory common.Address, - _masterDepositAddress common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachine common.Address, - _keepThreshold uint16, - _keepSize uint16, +func (tbtcs *TBTCSystem) CallFinalizeEthBtcPriceFeedAddition( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1308,62 +1276,41 @@ func (tbtcs *TBTCSystem) CallInitialize( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "initialize", + "finalizeEthBtcPriceFeedAddition", &result, - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, ) return err } -func (tbtcs *TBTCSystem) InitializeGasEstimate( - _defaultKeepFactory common.Address, - _depositFactory common.Address, - _masterDepositAddress common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachine common.Address, - _keepThreshold uint16, - _keepSize uint16, -) (uint64, error) { +func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAdditionGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "initialize", + "finalizeEthBtcPriceFeedAddition", tbtcs.contractABI, tbtcs.transactor, - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogCourtesyCalled( +func (tbtcs *TBTCSystem) LogRegisteredPubkey( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logCourtesyCalled", + "submitting transaction logRegisteredPubkey", + "params: ", + fmt.Sprint( + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ), ) tbtcs.transactionMutex.Lock() @@ -1388,20 +1335,24 @@ func (tbtcs *TBTCSystem) LogCourtesyCalled( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogCourtesyCalled( + transaction, err := tbtcs.contract.LogRegisteredPubkey( transactorOptions, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logCourtesyCalled", + "logRegisteredPubkey", + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) } tbtcsLogger.Infof( - "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", + "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1412,20 +1363,24 @@ func (tbtcs *TBTCSystem) LogCourtesyCalled( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogCourtesyCalled( + transaction, err := tbtcs.contract.LogRegisteredPubkey( transactorOptions, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logCourtesyCalled", + "logRegisteredPubkey", + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) } tbtcsLogger.Infof( - "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", + "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1440,7 +1395,9 @@ func (tbtcs *TBTCSystem) LogCourtesyCalled( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogCourtesyCalled( +func (tbtcs *TBTCSystem) CallLogRegisteredPubkey( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1452,39 +1409,41 @@ func (tbtcs *TBTCSystem) CallLogCourtesyCalled( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logCourtesyCalled", + "logRegisteredPubkey", &result, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) return err } -func (tbtcs *TBTCSystem) LogCourtesyCalledGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogRegisteredPubkeyGasEstimate( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logCourtesyCalled", + "logRegisteredPubkey", tbtcs.contractABI, tbtcs.transactor, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdate( - _signerFeeDivisor uint16, +func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction beginSignerFeeDivisorUpdate", - "params: ", - fmt.Sprint( - _signerFeeDivisor, - ), + "submitting transaction finalizeKeepFactoriesUpdate", ) tbtcs.transactionMutex.Lock() @@ -1509,22 +1468,20 @@ func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.BeginSignerFeeDivisorUpdate( + transaction, err := tbtcs.contract.FinalizeKeepFactoriesUpdate( transactorOptions, - _signerFeeDivisor, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginSignerFeeDivisorUpdate", - _signerFeeDivisor, + "finalizeKeepFactoriesUpdate", ) } tbtcsLogger.Infof( - "submitted transaction beginSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + "submitted transaction finalizeKeepFactoriesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1535,22 +1492,20 @@ func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.BeginSignerFeeDivisorUpdate( + transaction, err := tbtcs.contract.FinalizeKeepFactoriesUpdate( transactorOptions, - _signerFeeDivisor, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginSignerFeeDivisorUpdate", - _signerFeeDivisor, + "finalizeKeepFactoriesUpdate", ) } tbtcsLogger.Infof( - "submitted transaction beginSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + "submitted transaction finalizeKeepFactoriesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1565,8 +1520,7 @@ func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallBeginSignerFeeDivisorUpdate( - _signerFeeDivisor uint16, +func (tbtcs *TBTCSystem) CallFinalizeKeepFactoriesUpdate( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1578,38 +1532,39 @@ func (tbtcs *TBTCSystem) CallBeginSignerFeeDivisorUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "beginSignerFeeDivisorUpdate", + "finalizeKeepFactoriesUpdate", &result, - _signerFeeDivisor, ) return err } -func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdateGasEstimate( - _signerFeeDivisor uint16, -) (uint64, error) { +func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdateGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "beginSignerFeeDivisorUpdate", + "finalizeKeepFactoriesUpdate", tbtcs.contractABI, tbtcs.transactor, - _signerFeeDivisor, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) ResumeNewDeposits( +func (tbtcs *TBTCSystem) LogFunded( + _txid [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction resumeNewDeposits", + "submitting transaction logFunded", + "params: ", + fmt.Sprint( + _txid, + ), ) tbtcs.transactionMutex.Lock() @@ -1634,20 +1589,22 @@ func (tbtcs *TBTCSystem) ResumeNewDeposits( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.ResumeNewDeposits( + transaction, err := tbtcs.contract.LogFunded( transactorOptions, + _txid, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "resumeNewDeposits", + "logFunded", + _txid, ) } tbtcsLogger.Infof( - "submitted transaction resumeNewDeposits with id: [%v] and nonce [%v]", + "submitted transaction logFunded with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1658,20 +1615,22 @@ func (tbtcs *TBTCSystem) ResumeNewDeposits( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.ResumeNewDeposits( + transaction, err := tbtcs.contract.LogFunded( transactorOptions, + _txid, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "resumeNewDeposits", + "logFunded", + _txid, ) } tbtcsLogger.Infof( - "submitted transaction resumeNewDeposits with id: [%v] and nonce [%v]", + "submitted transaction logFunded with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1686,7 +1645,8 @@ func (tbtcs *TBTCSystem) ResumeNewDeposits( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallResumeNewDeposits( +func (tbtcs *TBTCSystem) CallLogFunded( + _txid [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1698,34 +1658,47 @@ func (tbtcs *TBTCSystem) CallResumeNewDeposits( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "resumeNewDeposits", + "logFunded", &result, + _txid, ) return err } -func (tbtcs *TBTCSystem) ResumeNewDepositsGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogFundedGasEstimate( + _txid [32]uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "resumeNewDeposits", + "logFunded", tbtcs.contractABI, tbtcs.transactor, + _txid, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( +func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdate( + _initialCollateralizedPercent uint16, + _undercollateralizedThresholdPercent uint16, + _severelyUndercollateralizedThresholdPercent uint16, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction finalizeLotSizesUpdate", + "submitting transaction beginCollateralizationThresholdsUpdate", + "params: ", + fmt.Sprint( + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, + ), ) tbtcs.transactionMutex.Lock() @@ -1750,20 +1723,26 @@ func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.FinalizeLotSizesUpdate( + transaction, err := tbtcs.contract.BeginCollateralizationThresholdsUpdate( transactorOptions, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeLotSizesUpdate", + "beginCollateralizationThresholdsUpdate", + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) } tbtcsLogger.Infof( - "submitted transaction finalizeLotSizesUpdate with id: [%v] and nonce [%v]", + "submitted transaction beginCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1774,20 +1753,26 @@ func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.FinalizeLotSizesUpdate( + transaction, err := tbtcs.contract.BeginCollateralizationThresholdsUpdate( transactorOptions, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeLotSizesUpdate", + "beginCollateralizationThresholdsUpdate", + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) } tbtcsLogger.Infof( - "submitted transaction finalizeLotSizesUpdate with id: [%v] and nonce [%v]", + "submitted transaction beginCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1802,7 +1787,10 @@ func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallFinalizeLotSizesUpdate( +func (tbtcs *TBTCSystem) CallBeginCollateralizationThresholdsUpdate( + _initialCollateralizedPercent uint16, + _undercollateralizedThresholdPercent uint16, + _severelyUndercollateralizedThresholdPercent uint16, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1814,38 +1802,48 @@ func (tbtcs *TBTCSystem) CallFinalizeLotSizesUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "finalizeLotSizesUpdate", + "beginCollateralizationThresholdsUpdate", &result, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) return err } -func (tbtcs *TBTCSystem) FinalizeLotSizesUpdateGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdateGasEstimate( + _initialCollateralizedPercent uint16, + _undercollateralizedThresholdPercent uint16, + _severelyUndercollateralizedThresholdPercent uint16, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "finalizeLotSizesUpdate", + "beginCollateralizationThresholdsUpdate", tbtcs.contractABI, tbtcs.transactor, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogRedeemed( - _txid [32]uint8, +func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdate( + _signerFeeDivisor uint16, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logRedeemed", + "submitting transaction beginSignerFeeDivisorUpdate", "params: ", fmt.Sprint( - _txid, + _signerFeeDivisor, ), ) @@ -1871,22 +1869,22 @@ func (tbtcs *TBTCSystem) LogRedeemed( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogRedeemed( + transaction, err := tbtcs.contract.BeginSignerFeeDivisorUpdate( transactorOptions, - _txid, + _signerFeeDivisor, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logRedeemed", - _txid, + "beginSignerFeeDivisorUpdate", + _signerFeeDivisor, ) } tbtcsLogger.Infof( - "submitted transaction logRedeemed with id: [%v] and nonce [%v]", + "submitted transaction beginSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1897,22 +1895,22 @@ func (tbtcs *TBTCSystem) LogRedeemed( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogRedeemed( + transaction, err := tbtcs.contract.BeginSignerFeeDivisorUpdate( transactorOptions, - _txid, + _signerFeeDivisor, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logRedeemed", - _txid, + "beginSignerFeeDivisorUpdate", + _signerFeeDivisor, ) } tbtcsLogger.Infof( - "submitted transaction logRedeemed with id: [%v] and nonce [%v]", + "submitted transaction beginSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1927,8 +1925,8 @@ func (tbtcs *TBTCSystem) LogRedeemed( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogRedeemed( - _txid [32]uint8, +func (tbtcs *TBTCSystem) CallBeginSignerFeeDivisorUpdate( + _signerFeeDivisor uint16, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1940,45 +1938,38 @@ func (tbtcs *TBTCSystem) CallLogRedeemed( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logRedeemed", + "beginSignerFeeDivisorUpdate", &result, - _txid, + _signerFeeDivisor, ) return err } -func (tbtcs *TBTCSystem) LogRedeemedGasEstimate( - _txid [32]uint8, +func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdateGasEstimate( + _signerFeeDivisor uint16, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logRedeemed", + "beginSignerFeeDivisorUpdate", tbtcs.contractABI, tbtcs.transactor, - _txid, + _signerFeeDivisor, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogRegisteredPubkey( - _signingGroupPubkeyX [32]uint8, - _signingGroupPubkeyY [32]uint8, +func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logRegisteredPubkey", - "params: ", - fmt.Sprint( - _signingGroupPubkeyX, - _signingGroupPubkeyY, - ), + "submitting transaction finalizeLotSizesUpdate", ) tbtcs.transactionMutex.Lock() @@ -2003,24 +1994,20 @@ func (tbtcs *TBTCSystem) LogRegisteredPubkey( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogRegisteredPubkey( + transaction, err := tbtcs.contract.FinalizeLotSizesUpdate( transactorOptions, - _signingGroupPubkeyX, - _signingGroupPubkeyY, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logRegisteredPubkey", - _signingGroupPubkeyX, - _signingGroupPubkeyY, + "finalizeLotSizesUpdate", ) } tbtcsLogger.Infof( - "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", + "submitted transaction finalizeLotSizesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2031,24 +2018,20 @@ func (tbtcs *TBTCSystem) LogRegisteredPubkey( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogRegisteredPubkey( + transaction, err := tbtcs.contract.FinalizeLotSizesUpdate( transactorOptions, - _signingGroupPubkeyX, - _signingGroupPubkeyY, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logRegisteredPubkey", - _signingGroupPubkeyX, - _signingGroupPubkeyY, + "finalizeLotSizesUpdate", ) } tbtcsLogger.Infof( - "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", + "submitted transaction finalizeLotSizesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2063,9 +2046,7 @@ func (tbtcs *TBTCSystem) LogRegisteredPubkey( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogRegisteredPubkey( - _signingGroupPubkeyX [32]uint8, - _signingGroupPubkeyY [32]uint8, +func (tbtcs *TBTCSystem) CallFinalizeLotSizesUpdate( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2077,46 +2058,34 @@ func (tbtcs *TBTCSystem) CallLogRegisteredPubkey( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logRegisteredPubkey", + "finalizeLotSizesUpdate", &result, - _signingGroupPubkeyX, - _signingGroupPubkeyY, ) return err } -func (tbtcs *TBTCSystem) LogRegisteredPubkeyGasEstimate( - _signingGroupPubkeyX [32]uint8, - _signingGroupPubkeyY [32]uint8, -) (uint64, error) { +func (tbtcs *TBTCSystem) FinalizeLotSizesUpdateGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logRegisteredPubkey", + "finalizeLotSizesUpdate", tbtcs.contractABI, tbtcs.transactor, - _signingGroupPubkeyX, - _signingGroupPubkeyY, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) BeginLotSizesUpdate( - _lotSizes []uint64, +func (tbtcs *TBTCSystem) LogCourtesyCalled( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction beginLotSizesUpdate", - "params: ", - fmt.Sprint( - _lotSizes, - ), + "submitting transaction logCourtesyCalled", ) tbtcs.transactionMutex.Lock() @@ -2141,22 +2110,20 @@ func (tbtcs *TBTCSystem) BeginLotSizesUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.BeginLotSizesUpdate( + transaction, err := tbtcs.contract.LogCourtesyCalled( transactorOptions, - _lotSizes, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginLotSizesUpdate", - _lotSizes, + "logCourtesyCalled", ) } tbtcsLogger.Infof( - "submitted transaction beginLotSizesUpdate with id: [%v] and nonce [%v]", + "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2167,22 +2134,20 @@ func (tbtcs *TBTCSystem) BeginLotSizesUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.BeginLotSizesUpdate( + transaction, err := tbtcs.contract.LogCourtesyCalled( transactorOptions, - _lotSizes, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginLotSizesUpdate", - _lotSizes, + "logCourtesyCalled", ) } tbtcsLogger.Infof( - "submitted transaction beginLotSizesUpdate with id: [%v] and nonce [%v]", + "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2197,8 +2162,7 @@ func (tbtcs *TBTCSystem) BeginLotSizesUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallBeginLotSizesUpdate( - _lotSizes []uint64, +func (tbtcs *TBTCSystem) CallLogCourtesyCalled( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2210,47 +2174,34 @@ func (tbtcs *TBTCSystem) CallBeginLotSizesUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "beginLotSizesUpdate", + "logCourtesyCalled", &result, - _lotSizes, ) return err } -func (tbtcs *TBTCSystem) BeginLotSizesUpdateGasEstimate( - _lotSizes []uint64, -) (uint64, error) { +func (tbtcs *TBTCSystem) LogCourtesyCalledGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "beginLotSizesUpdate", + "logCourtesyCalled", tbtcs.contractABI, tbtcs.transactor, - _lotSizes, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogGotRedemptionSignature( - _digest [32]uint8, - _r [32]uint8, - _s [32]uint8, +func (tbtcs *TBTCSystem) RenounceOwnership( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logGotRedemptionSignature", - "params: ", - fmt.Sprint( - _digest, - _r, - _s, - ), + "submitting transaction renounceOwnership", ) tbtcs.transactionMutex.Lock() @@ -2275,26 +2226,20 @@ func (tbtcs *TBTCSystem) LogGotRedemptionSignature( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogGotRedemptionSignature( + transaction, err := tbtcs.contract.RenounceOwnership( transactorOptions, - _digest, - _r, - _s, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logGotRedemptionSignature", - _digest, - _r, - _s, + "renounceOwnership", ) } tbtcsLogger.Infof( - "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", + "submitted transaction renounceOwnership with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2305,26 +2250,20 @@ func (tbtcs *TBTCSystem) LogGotRedemptionSignature( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogGotRedemptionSignature( + transaction, err := tbtcs.contract.RenounceOwnership( transactorOptions, - _digest, - _r, - _s, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logGotRedemptionSignature", - _digest, - _r, - _s, + "renounceOwnership", ) } tbtcsLogger.Infof( - "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", + "submitted transaction renounceOwnership with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2339,10 +2278,7 @@ func (tbtcs *TBTCSystem) LogGotRedemptionSignature( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogGotRedemptionSignature( - _digest [32]uint8, - _r [32]uint8, - _s [32]uint8, +func (tbtcs *TBTCSystem) CallRenounceOwnership( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2354,49 +2290,43 @@ func (tbtcs *TBTCSystem) CallLogGotRedemptionSignature( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logGotRedemptionSignature", + "renounceOwnership", &result, - _digest, - _r, - _s, ) return err } -func (tbtcs *TBTCSystem) LogGotRedemptionSignatureGasEstimate( - _digest [32]uint8, - _r [32]uint8, - _s [32]uint8, -) (uint64, error) { +func (tbtcs *TBTCSystem) RenounceOwnershipGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logGotRedemptionSignature", + "renounceOwnership", tbtcs.contractABI, tbtcs.transactor, - _digest, - _r, - _s, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) TransferOwnership( - newOwner common.Address, +func (tbtcs *TBTCSystem) RequestNewKeep( + _requestedLotSizeSatoshis uint64, + _maxSecuredLifetime *big.Int, + value *big.Int, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction transferOwnership", + "submitting transaction requestNewKeep", "params: ", fmt.Sprint( - newOwner, + _requestedLotSizeSatoshis, + _maxSecuredLifetime, ), + "value: ", value, ) tbtcs.transactionMutex.Lock() @@ -2406,6 +2336,8 @@ func (tbtcs *TBTCSystem) TransferOwnership( transactorOptions := new(bind.TransactOpts) *transactorOptions = *tbtcs.transactorOptions + transactorOptions.Value = value + if len(transactionOptions) > 1 { return nil, fmt.Errorf( "could not process multiple transaction options sets", @@ -2421,22 +2353,24 @@ func (tbtcs *TBTCSystem) TransferOwnership( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.TransferOwnership( + transaction, err := tbtcs.contract.RequestNewKeep( transactorOptions, - newOwner, + _requestedLotSizeSatoshis, + _maxSecuredLifetime, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, - nil, - "transferOwnership", - newOwner, + value, + "requestNewKeep", + _requestedLotSizeSatoshis, + _maxSecuredLifetime, ) } tbtcsLogger.Infof( - "submitted transaction transferOwnership with id: [%v] and nonce [%v]", + "submitted transaction requestNewKeep with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2447,22 +2381,24 @@ func (tbtcs *TBTCSystem) TransferOwnership( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.TransferOwnership( + transaction, err := tbtcs.contract.RequestNewKeep( transactorOptions, - newOwner, + _requestedLotSizeSatoshis, + _maxSecuredLifetime, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, - nil, - "transferOwnership", - newOwner, + value, + "requestNewKeep", + _requestedLotSizeSatoshis, + _maxSecuredLifetime, ) } tbtcsLogger.Infof( - "submitted transaction transferOwnership with id: [%v] and nonce [%v]", + "submitted transaction requestNewKeep with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2477,59 +2413,76 @@ func (tbtcs *TBTCSystem) TransferOwnership( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallTransferOwnership( - newOwner common.Address, +func (tbtcs *TBTCSystem) CallRequestNewKeep( + _requestedLotSizeSatoshis uint64, + _maxSecuredLifetime *big.Int, + value *big.Int, blockNumber *big.Int, -) error { - var result interface{} = nil +) (common.Address, error) { + var result common.Address err := ethutil.CallAtBlock( tbtcs.transactorOptions.From, - blockNumber, nil, + blockNumber, value, tbtcs.contractABI, tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "transferOwnership", + "requestNewKeep", &result, - newOwner, + _requestedLotSizeSatoshis, + _maxSecuredLifetime, ) - return err + return result, err } -func (tbtcs *TBTCSystem) TransferOwnershipGasEstimate( - newOwner common.Address, +func (tbtcs *TBTCSystem) RequestNewKeepGasEstimate( + _requestedLotSizeSatoshis uint64, + _maxSecuredLifetime *big.Int, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "transferOwnership", + "requestNewKeep", tbtcs.contractABI, tbtcs.transactor, - newOwner, + _requestedLotSizeSatoshis, + _maxSecuredLifetime, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdate( - _initialCollateralizedPercent uint16, - _undercollateralizedThresholdPercent uint16, - _severelyUndercollateralizedThresholdPercent uint16, +func (tbtcs *TBTCSystem) Initialize( + _defaultKeepFactory common.Address, + _depositFactory common.Address, + _masterDepositAddress common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachine common.Address, + _keepThreshold uint16, + _keepSize uint16, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction beginCollateralizationThresholdsUpdate", + "submitting transaction initialize", "params: ", fmt.Sprint( - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ), ) @@ -2555,26 +2508,38 @@ func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.BeginCollateralizationThresholdsUpdate( + transaction, err := tbtcs.contract.Initialize( transactorOptions, - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginCollateralizationThresholdsUpdate", - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, + "initialize", + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ) } tbtcsLogger.Infof( - "submitted transaction beginCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", + "submitted transaction initialize with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2585,26 +2550,38 @@ func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.BeginCollateralizationThresholdsUpdate( + transaction, err := tbtcs.contract.Initialize( transactorOptions, - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginCollateralizationThresholdsUpdate", - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, + "initialize", + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ) } tbtcsLogger.Infof( - "submitted transaction beginCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", + "submitted transaction initialize with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2619,10 +2596,16 @@ func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallBeginCollateralizationThresholdsUpdate( - _initialCollateralizedPercent uint16, - _undercollateralizedThresholdPercent uint16, - _severelyUndercollateralizedThresholdPercent uint16, +func (tbtcs *TBTCSystem) CallInitialize( + _defaultKeepFactory common.Address, + _depositFactory common.Address, + _masterDepositAddress common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachine common.Address, + _keepThreshold uint16, + _keepSize uint16, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2634,44 +2617,62 @@ func (tbtcs *TBTCSystem) CallBeginCollateralizationThresholdsUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "beginCollateralizationThresholdsUpdate", + "initialize", &result, - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ) return err } -func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdateGasEstimate( - _initialCollateralizedPercent uint16, - _undercollateralizedThresholdPercent uint16, - _severelyUndercollateralizedThresholdPercent uint16, +func (tbtcs *TBTCSystem) InitializeGasEstimate( + _defaultKeepFactory common.Address, + _depositFactory common.Address, + _masterDepositAddress common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachine common.Address, + _keepThreshold uint16, + _keepSize uint16, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "beginCollateralizationThresholdsUpdate", + "initialize", tbtcs.contractABI, tbtcs.transactor, - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogFraudDuringSetup( +func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdate( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logFraudDuringSetup", + "submitting transaction finalizeSignerFeeDivisorUpdate", ) tbtcs.transactionMutex.Lock() @@ -2696,7 +2697,7 @@ func (tbtcs *TBTCSystem) LogFraudDuringSetup( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogFraudDuringSetup( + transaction, err := tbtcs.contract.FinalizeSignerFeeDivisorUpdate( transactorOptions, ) if err != nil { @@ -2704,12 +2705,12 @@ func (tbtcs *TBTCSystem) LogFraudDuringSetup( err, tbtcs.transactorOptions.From, nil, - "logFraudDuringSetup", + "finalizeSignerFeeDivisorUpdate", ) } tbtcsLogger.Infof( - "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", + "submitted transaction finalizeSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2720,7 +2721,7 @@ func (tbtcs *TBTCSystem) LogFraudDuringSetup( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogFraudDuringSetup( + transaction, err := tbtcs.contract.FinalizeSignerFeeDivisorUpdate( transactorOptions, ) if err != nil { @@ -2728,12 +2729,12 @@ func (tbtcs *TBTCSystem) LogFraudDuringSetup( err, tbtcs.transactorOptions.From, nil, - "logFraudDuringSetup", + "finalizeSignerFeeDivisorUpdate", ) } tbtcsLogger.Infof( - "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", + "submitted transaction finalizeSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2748,7 +2749,7 @@ func (tbtcs *TBTCSystem) LogFraudDuringSetup( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogFraudDuringSetup( +func (tbtcs *TBTCSystem) CallFinalizeSignerFeeDivisorUpdate( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2760,20 +2761,20 @@ func (tbtcs *TBTCSystem) CallLogFraudDuringSetup( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logFraudDuringSetup", + "finalizeSignerFeeDivisorUpdate", &result, ) return err } -func (tbtcs *TBTCSystem) LogFraudDuringSetupGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdateGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logFraudDuringSetup", + "finalizeSignerFeeDivisorUpdate", tbtcs.contractABI, tbtcs.transactor, ) @@ -2782,12 +2783,12 @@ func (tbtcs *TBTCSystem) LogFraudDuringSetupGasEstimate() (uint64, error) { } // Transaction submission. -func (tbtcs *TBTCSystem) RenounceOwnership( +func (tbtcs *TBTCSystem) LogExitedCourtesyCall( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction renounceOwnership", + "submitting transaction logExitedCourtesyCall", ) tbtcs.transactionMutex.Lock() @@ -2812,7 +2813,7 @@ func (tbtcs *TBTCSystem) RenounceOwnership( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.RenounceOwnership( + transaction, err := tbtcs.contract.LogExitedCourtesyCall( transactorOptions, ) if err != nil { @@ -2820,12 +2821,12 @@ func (tbtcs *TBTCSystem) RenounceOwnership( err, tbtcs.transactorOptions.From, nil, - "renounceOwnership", + "logExitedCourtesyCall", ) } tbtcsLogger.Infof( - "submitted transaction renounceOwnership with id: [%v] and nonce [%v]", + "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2836,7 +2837,7 @@ func (tbtcs *TBTCSystem) RenounceOwnership( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.RenounceOwnership( + transaction, err := tbtcs.contract.LogExitedCourtesyCall( transactorOptions, ) if err != nil { @@ -2844,12 +2845,12 @@ func (tbtcs *TBTCSystem) RenounceOwnership( err, tbtcs.transactorOptions.From, nil, - "renounceOwnership", + "logExitedCourtesyCall", ) } tbtcsLogger.Infof( - "submitted transaction renounceOwnership with id: [%v] and nonce [%v]", + "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2864,7 +2865,7 @@ func (tbtcs *TBTCSystem) RenounceOwnership( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallRenounceOwnership( +func (tbtcs *TBTCSystem) CallLogExitedCourtesyCall( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2876,20 +2877,20 @@ func (tbtcs *TBTCSystem) CallRenounceOwnership( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "renounceOwnership", + "logExitedCourtesyCall", &result, ) return err } -func (tbtcs *TBTCSystem) RenounceOwnershipGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogExitedCourtesyCallGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "renounceOwnership", + "logExitedCourtesyCall", tbtcs.contractABI, tbtcs.transactor, ) @@ -2898,12 +2899,17 @@ func (tbtcs *TBTCSystem) RenounceOwnershipGasEstimate() (uint64, error) { } // Transaction submission. -func (tbtcs *TBTCSystem) LogLiquidated( +func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAddition( + _ethBtcPriceFeed common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logLiquidated", + "submitting transaction beginEthBtcPriceFeedAddition", + "params: ", + fmt.Sprint( + _ethBtcPriceFeed, + ), ) tbtcs.transactionMutex.Lock() @@ -2928,20 +2934,22 @@ func (tbtcs *TBTCSystem) LogLiquidated( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogLiquidated( + transaction, err := tbtcs.contract.BeginEthBtcPriceFeedAddition( transactorOptions, + _ethBtcPriceFeed, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logLiquidated", + "beginEthBtcPriceFeedAddition", + _ethBtcPriceFeed, ) } tbtcsLogger.Infof( - "submitted transaction logLiquidated with id: [%v] and nonce [%v]", + "submitted transaction beginEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2952,20 +2960,22 @@ func (tbtcs *TBTCSystem) LogLiquidated( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogLiquidated( + transaction, err := tbtcs.contract.BeginEthBtcPriceFeedAddition( transactorOptions, + _ethBtcPriceFeed, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logLiquidated", + "beginEthBtcPriceFeedAddition", + _ethBtcPriceFeed, ) } tbtcsLogger.Infof( - "submitted transaction logLiquidated with id: [%v] and nonce [%v]", + "submitted transaction beginEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2980,7 +2990,8 @@ func (tbtcs *TBTCSystem) LogLiquidated( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogLiquidated( +func (tbtcs *TBTCSystem) CallBeginEthBtcPriceFeedAddition( + _ethBtcPriceFeed common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2992,43 +3003,43 @@ func (tbtcs *TBTCSystem) CallLogLiquidated( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logLiquidated", + "beginEthBtcPriceFeedAddition", &result, + _ethBtcPriceFeed, ) return err } -func (tbtcs *TBTCSystem) LogLiquidatedGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAdditionGasEstimate( + _ethBtcPriceFeed common.Address, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logLiquidated", + "beginEthBtcPriceFeedAddition", tbtcs.contractABI, tbtcs.transactor, + _ethBtcPriceFeed, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) RequestNewKeep( - _requestedLotSizeSatoshis uint64, - _maxSecuredLifetime *big.Int, - value *big.Int, +func (tbtcs *TBTCSystem) BeginLotSizesUpdate( + _lotSizes []uint64, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction requestNewKeep", + "submitting transaction beginLotSizesUpdate", "params: ", fmt.Sprint( - _requestedLotSizeSatoshis, - _maxSecuredLifetime, + _lotSizes, ), - "value: ", value, ) tbtcs.transactionMutex.Lock() @@ -3038,8 +3049,6 @@ func (tbtcs *TBTCSystem) RequestNewKeep( transactorOptions := new(bind.TransactOpts) *transactorOptions = *tbtcs.transactorOptions - transactorOptions.Value = value - if len(transactionOptions) > 1 { return nil, fmt.Errorf( "could not process multiple transaction options sets", @@ -3055,24 +3064,22 @@ func (tbtcs *TBTCSystem) RequestNewKeep( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.RequestNewKeep( + transaction, err := tbtcs.contract.BeginLotSizesUpdate( transactorOptions, - _requestedLotSizeSatoshis, - _maxSecuredLifetime, + _lotSizes, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, - value, - "requestNewKeep", - _requestedLotSizeSatoshis, - _maxSecuredLifetime, + nil, + "beginLotSizesUpdate", + _lotSizes, ) } tbtcsLogger.Infof( - "submitted transaction requestNewKeep with id: [%v] and nonce [%v]", + "submitted transaction beginLotSizesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3083,24 +3090,22 @@ func (tbtcs *TBTCSystem) RequestNewKeep( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.RequestNewKeep( + transaction, err := tbtcs.contract.BeginLotSizesUpdate( transactorOptions, - _requestedLotSizeSatoshis, - _maxSecuredLifetime, + _lotSizes, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, - value, - "requestNewKeep", - _requestedLotSizeSatoshis, - _maxSecuredLifetime, + nil, + "beginLotSizesUpdate", + _lotSizes, ) } tbtcsLogger.Infof( - "submitted transaction requestNewKeep with id: [%v] and nonce [%v]", + "submitted transaction beginLotSizesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3115,56 +3120,51 @@ func (tbtcs *TBTCSystem) RequestNewKeep( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallRequestNewKeep( - _requestedLotSizeSatoshis uint64, - _maxSecuredLifetime *big.Int, - value *big.Int, +func (tbtcs *TBTCSystem) CallBeginLotSizesUpdate( + _lotSizes []uint64, blockNumber *big.Int, -) (common.Address, error) { - var result common.Address +) error { + var result interface{} = nil err := ethutil.CallAtBlock( tbtcs.transactorOptions.From, - blockNumber, value, + blockNumber, nil, tbtcs.contractABI, tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "requestNewKeep", + "beginLotSizesUpdate", &result, - _requestedLotSizeSatoshis, - _maxSecuredLifetime, + _lotSizes, ) - return result, err + return err } -func (tbtcs *TBTCSystem) RequestNewKeepGasEstimate( - _requestedLotSizeSatoshis uint64, - _maxSecuredLifetime *big.Int, +func (tbtcs *TBTCSystem) BeginLotSizesUpdateGasEstimate( + _lotSizes []uint64, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "requestNewKeep", + "beginLotSizesUpdate", tbtcs.contractABI, tbtcs.transactor, - _requestedLotSizeSatoshis, - _maxSecuredLifetime, + _lotSizes, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogExitedCourtesyCall( +func (tbtcs *TBTCSystem) LogSetupFailed( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logExitedCourtesyCall", + "submitting transaction logSetupFailed", ) tbtcs.transactionMutex.Lock() @@ -3189,7 +3189,7 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCall( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogExitedCourtesyCall( + transaction, err := tbtcs.contract.LogSetupFailed( transactorOptions, ) if err != nil { @@ -3197,12 +3197,12 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCall( err, tbtcs.transactorOptions.From, nil, - "logExitedCourtesyCall", + "logSetupFailed", ) } tbtcsLogger.Infof( - "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3213,7 +3213,7 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCall( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogExitedCourtesyCall( + transaction, err := tbtcs.contract.LogSetupFailed( transactorOptions, ) if err != nil { @@ -3221,12 +3221,12 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCall( err, tbtcs.transactorOptions.From, nil, - "logExitedCourtesyCall", + "logSetupFailed", ) } tbtcsLogger.Infof( - "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3241,7 +3241,7 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCall( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogExitedCourtesyCall( +func (tbtcs *TBTCSystem) CallLogSetupFailed( blockNumber *big.Int, ) error { var result interface{} = nil @@ -3253,20 +3253,20 @@ func (tbtcs *TBTCSystem) CallLogExitedCourtesyCall( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logExitedCourtesyCall", + "logSetupFailed", &result, ) return err } -func (tbtcs *TBTCSystem) LogExitedCourtesyCallGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogSetupFailedGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logExitedCourtesyCall", + "logSetupFailed", tbtcs.contractABI, tbtcs.transactor, ) @@ -3275,12 +3275,17 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCallGasEstimate() (uint64, error) { } // Transaction submission. -func (tbtcs *TBTCSystem) EmergencyPauseNewDeposits( +func (tbtcs *TBTCSystem) LogRedeemed( + _txid [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction emergencyPauseNewDeposits", + "submitting transaction logRedeemed", + "params: ", + fmt.Sprint( + _txid, + ), ) tbtcs.transactionMutex.Lock() @@ -3305,20 +3310,22 @@ func (tbtcs *TBTCSystem) EmergencyPauseNewDeposits( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.EmergencyPauseNewDeposits( + transaction, err := tbtcs.contract.LogRedeemed( transactorOptions, + _txid, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "emergencyPauseNewDeposits", + "logRedeemed", + _txid, ) } tbtcsLogger.Infof( - "submitted transaction emergencyPauseNewDeposits with id: [%v] and nonce [%v]", + "submitted transaction logRedeemed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3329,20 +3336,22 @@ func (tbtcs *TBTCSystem) EmergencyPauseNewDeposits( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.EmergencyPauseNewDeposits( + transaction, err := tbtcs.contract.LogRedeemed( transactorOptions, + _txid, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "emergencyPauseNewDeposits", + "logRedeemed", + _txid, ) } tbtcsLogger.Infof( - "submitted transaction emergencyPauseNewDeposits with id: [%v] and nonce [%v]", + "submitted transaction logRedeemed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3357,7 +3366,8 @@ func (tbtcs *TBTCSystem) EmergencyPauseNewDeposits( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallEmergencyPauseNewDeposits( +func (tbtcs *TBTCSystem) CallLogRedeemed( + _txid [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -3369,22 +3379,26 @@ func (tbtcs *TBTCSystem) CallEmergencyPauseNewDeposits( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "emergencyPauseNewDeposits", + "logRedeemed", &result, + _txid, ) return err } -func (tbtcs *TBTCSystem) EmergencyPauseNewDepositsGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogRedeemedGasEstimate( + _txid [32]uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "emergencyPauseNewDeposits", + "logRedeemed", tbtcs.contractABI, tbtcs.transactor, + _txid, ) return result, err @@ -3521,12 +3535,12 @@ func (tbtcs *TBTCSystem) LogFunderRequestedAbortGasEstimate( } // Transaction submission. -func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( +func (tbtcs *TBTCSystem) LogLiquidated( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction finalizeKeepFactoriesUpdate", + "submitting transaction logLiquidated", ) tbtcs.transactionMutex.Lock() @@ -3551,7 +3565,7 @@ func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.FinalizeKeepFactoriesUpdate( + transaction, err := tbtcs.contract.LogLiquidated( transactorOptions, ) if err != nil { @@ -3559,12 +3573,12 @@ func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( err, tbtcs.transactorOptions.From, nil, - "finalizeKeepFactoriesUpdate", + "logLiquidated", ) } tbtcsLogger.Infof( - "submitted transaction finalizeKeepFactoriesUpdate with id: [%v] and nonce [%v]", + "submitted transaction logLiquidated with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3575,7 +3589,7 @@ func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.FinalizeKeepFactoriesUpdate( + transaction, err := tbtcs.contract.LogLiquidated( transactorOptions, ) if err != nil { @@ -3583,12 +3597,12 @@ func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( err, tbtcs.transactorOptions.From, nil, - "finalizeKeepFactoriesUpdate", + "logLiquidated", ) } tbtcsLogger.Infof( - "submitted transaction finalizeKeepFactoriesUpdate with id: [%v] and nonce [%v]", + "submitted transaction logLiquidated with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3603,7 +3617,7 @@ func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallFinalizeKeepFactoriesUpdate( +func (tbtcs *TBTCSystem) CallLogLiquidated( blockNumber *big.Int, ) error { var result interface{} = nil @@ -3615,20 +3629,20 @@ func (tbtcs *TBTCSystem) CallFinalizeKeepFactoriesUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "finalizeKeepFactoriesUpdate", + "logLiquidated", &result, ) return err } -func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdateGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogLiquidatedGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "finalizeKeepFactoriesUpdate", + "logLiquidated", tbtcs.contractABI, tbtcs.transactor, ) @@ -3637,17 +3651,12 @@ func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdateGasEstimate() (uint64, error } // Transaction submission. -func (tbtcs *TBTCSystem) LogCreated( - _keepAddress common.Address, +func (tbtcs *TBTCSystem) LogFraudDuringSetup( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logCreated", - "params: ", - fmt.Sprint( - _keepAddress, - ), + "submitting transaction logFraudDuringSetup", ) tbtcs.transactionMutex.Lock() @@ -3672,22 +3681,20 @@ func (tbtcs *TBTCSystem) LogCreated( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogCreated( + transaction, err := tbtcs.contract.LogFraudDuringSetup( transactorOptions, - _keepAddress, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logCreated", - _keepAddress, + "logFraudDuringSetup", ) } tbtcsLogger.Infof( - "submitted transaction logCreated with id: [%v] and nonce [%v]", + "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3698,22 +3705,20 @@ func (tbtcs *TBTCSystem) LogCreated( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogCreated( + transaction, err := tbtcs.contract.LogFraudDuringSetup( transactorOptions, - _keepAddress, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logCreated", - _keepAddress, + "logFraudDuringSetup", ) } tbtcsLogger.Infof( - "submitted transaction logCreated with id: [%v] and nonce [%v]", + "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3728,8 +3733,7 @@ func (tbtcs *TBTCSystem) LogCreated( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogCreated( - _keepAddress common.Address, +func (tbtcs *TBTCSystem) CallLogFraudDuringSetup( blockNumber *big.Int, ) error { var result interface{} = nil @@ -3741,42 +3745,38 @@ func (tbtcs *TBTCSystem) CallLogCreated( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logCreated", + "logFraudDuringSetup", &result, - _keepAddress, ) return err } -func (tbtcs *TBTCSystem) LogCreatedGasEstimate( - _keepAddress common.Address, -) (uint64, error) { +func (tbtcs *TBTCSystem) LogFraudDuringSetupGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logCreated", + "logFraudDuringSetup", tbtcs.contractABI, tbtcs.transactor, - _keepAddress, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogFunded( - _txid [32]uint8, +func (tbtcs *TBTCSystem) TransferOwnership( + newOwner common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logFunded", + "submitting transaction transferOwnership", "params: ", fmt.Sprint( - _txid, + newOwner, ), ) @@ -3802,22 +3802,22 @@ func (tbtcs *TBTCSystem) LogFunded( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogFunded( + transaction, err := tbtcs.contract.TransferOwnership( transactorOptions, - _txid, + newOwner, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logFunded", - _txid, + "transferOwnership", + newOwner, ) } tbtcsLogger.Infof( - "submitted transaction logFunded with id: [%v] and nonce [%v]", + "submitted transaction transferOwnership with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3828,22 +3828,22 @@ func (tbtcs *TBTCSystem) LogFunded( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogFunded( + transaction, err := tbtcs.contract.TransferOwnership( transactorOptions, - _txid, + newOwner, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logFunded", - _txid, + "transferOwnership", + newOwner, ) } tbtcsLogger.Infof( - "submitted transaction logFunded with id: [%v] and nonce [%v]", + "submitted transaction transferOwnership with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3858,8 +3858,8 @@ func (tbtcs *TBTCSystem) LogFunded( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogFunded( - _txid [32]uint8, +func (tbtcs *TBTCSystem) CallTransferOwnership( + newOwner common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -3871,26 +3871,26 @@ func (tbtcs *TBTCSystem) CallLogFunded( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logFunded", + "transferOwnership", &result, - _txid, + newOwner, ) return err } -func (tbtcs *TBTCSystem) LogFundedGasEstimate( - _txid [32]uint8, +func (tbtcs *TBTCSystem) TransferOwnershipGasEstimate( + newOwner common.Address, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logFunded", + "transferOwnership", tbtcs.contractABI, tbtcs.transactor, - _txid, + newOwner, ) return result, err @@ -4014,9 +4014,9 @@ func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdateGasEstimate() // ----- Const Methods ------ -func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercent() (uint16, error) { - var result uint16 - result, err := tbtcs.contract.GetUndercollateralizedThresholdPercent( +func (tbtcs *TBTCSystem) PriceFeed() (common.Address, error) { + var result common.Address + result, err := tbtcs.contract.PriceFeed( tbtcs.callerOptions, ) @@ -4025,17 +4025,17 @@ func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercent() (uint16, error err, tbtcs.callerOptions.From, nil, - "getUndercollateralizedThresholdPercent", + "priceFeed", ) } return result, err } -func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercentAtBlock( +func (tbtcs *TBTCSystem) PriceFeedAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (common.Address, error) { + var result common.Address err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4045,16 +4045,16 @@ func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercentAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getUndercollateralizedThresholdPercent", + "priceFeed", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTime() (*big.Int, error) { +func (tbtcs *TBTCSystem) GetRemainingPauseTerm() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.GetRemainingEthBtcPriceFeedAdditionTime( + result, err := tbtcs.contract.GetRemainingPauseTerm( tbtcs.callerOptions, ) @@ -4063,14 +4063,14 @@ func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTime() (*big.Int, er err, tbtcs.callerOptions.From, nil, - "getRemainingEthBtcPriceFeedAdditionTime", + "getRemainingPauseTerm", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTimeAtBlock( +func (tbtcs *TBTCSystem) GetRemainingPauseTermAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -4083,16 +4083,16 @@ func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTimeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingEthBtcPriceFeedAdditionTime", + "getRemainingPauseTerm", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetInitialCollateralizedPercent() (uint16, error) { - var result uint16 - result, err := tbtcs.contract.GetInitialCollateralizedPercent( +func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTime() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingSignerFeeDivisorUpdateTime( tbtcs.callerOptions, ) @@ -4101,17 +4101,17 @@ func (tbtcs *TBTCSystem) GetInitialCollateralizedPercent() (uint16, error) { err, tbtcs.callerOptions.From, nil, - "getInitialCollateralizedPercent", + "getRemainingSignerFeeDivisorUpdateTime", ) } return result, err } -func (tbtcs *TBTCSystem) GetInitialCollateralizedPercentAtBlock( +func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTimeAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4121,16 +4121,16 @@ func (tbtcs *TBTCSystem) GetInitialCollateralizedPercentAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getInitialCollateralizedPercent", + "getRemainingSignerFeeDivisorUpdateTime", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetAllowNewDeposits() (bool, error) { - var result bool - result, err := tbtcs.contract.GetAllowNewDeposits( +func (tbtcs *TBTCSystem) FetchRelayPreviousDifficulty() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.FetchRelayPreviousDifficulty( tbtcs.callerOptions, ) @@ -4139,17 +4139,17 @@ func (tbtcs *TBTCSystem) GetAllowNewDeposits() (bool, error) { err, tbtcs.callerOptions.From, nil, - "getAllowNewDeposits", + "fetchRelayPreviousDifficulty", ) } return result, err } -func (tbtcs *TBTCSystem) GetAllowNewDepositsAtBlock( +func (tbtcs *TBTCSystem) FetchRelayPreviousDifficultyAtBlock( blockNumber *big.Int, -) (bool, error) { - var result bool +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4159,16 +4159,16 @@ func (tbtcs *TBTCSystem) GetAllowNewDepositsAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getAllowNewDeposits", + "fetchRelayPreviousDifficulty", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercent() (uint16, error) { - var result uint16 - result, err := tbtcs.contract.GetSeverelyUndercollateralizedThresholdPercent( +func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelay() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetPriceFeedGovernanceTimeDelay( tbtcs.callerOptions, ) @@ -4177,17 +4177,17 @@ func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercent() (uint1 err, tbtcs.callerOptions.From, nil, - "getSeverelyUndercollateralizedThresholdPercent", + "getPriceFeedGovernanceTimeDelay", ) } return result, err } -func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercentAtBlock( +func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelayAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4197,16 +4197,16 @@ func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercentAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getSeverelyUndercollateralizedThresholdPercent", + "getPriceFeedGovernanceTimeDelay", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelay() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetPriceFeedGovernanceTimeDelay( +func (tbtcs *TBTCSystem) Owner() (common.Address, error) { + var result common.Address + result, err := tbtcs.contract.Owner( tbtcs.callerOptions, ) @@ -4215,17 +4215,17 @@ func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelay() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getPriceFeedGovernanceTimeDelay", + "owner", ) } return result, err } -func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelayAtBlock( +func (tbtcs *TBTCSystem) OwnerAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (common.Address, error) { + var result common.Address err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4235,16 +4235,16 @@ func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelayAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getPriceFeedGovernanceTimeDelay", + "owner", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTime() (*big.Int, error) { +func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTime() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.GetRemainingKeepFactoriesUpdateTime( + result, err := tbtcs.contract.GetRemainingKeepFactoriesUpgradeabilityTime( tbtcs.callerOptions, ) @@ -4253,14 +4253,14 @@ func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTime() (*big.Int, error) err, tbtcs.callerOptions.From, nil, - "getRemainingKeepFactoriesUpdateTime", + "getRemainingKeepFactoriesUpgradeabilityTime", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTimeAtBlock( +func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTimeAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -4273,16 +4273,16 @@ func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTimeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingKeepFactoriesUpdateTime", + "getRemainingKeepFactoriesUpgradeabilityTime", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingPauseTerm() (*big.Int, error) { +func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriod() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.GetRemainingPauseTerm( + result, err := tbtcs.contract.GetKeepFactoriesUpgradeabilityPeriod( tbtcs.callerOptions, ) @@ -4291,14 +4291,14 @@ func (tbtcs *TBTCSystem) GetRemainingPauseTerm() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getRemainingPauseTerm", + "getKeepFactoriesUpgradeabilityPeriod", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingPauseTermAtBlock( +func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriodAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -4311,16 +4311,16 @@ func (tbtcs *TBTCSystem) GetRemainingPauseTermAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingPauseTerm", + "getKeepFactoriesUpgradeabilityPeriod", &result, ) return result, err } -func (tbtcs *TBTCSystem) Relay() (common.Address, error) { - var result common.Address - result, err := tbtcs.contract.Relay( +func (tbtcs *TBTCSystem) GetMaximumLotSize() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetMaximumLotSize( tbtcs.callerOptions, ) @@ -4329,17 +4329,17 @@ func (tbtcs *TBTCSystem) Relay() (common.Address, error) { err, tbtcs.callerOptions.From, nil, - "relay", + "getMaximumLotSize", ) } return result, err } -func (tbtcs *TBTCSystem) RelayAtBlock( +func (tbtcs *TBTCSystem) GetMaximumLotSizeAtBlock( blockNumber *big.Int, -) (common.Address, error) { - var result common.Address +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4349,20 +4349,17 @@ func (tbtcs *TBTCSystem) RelayAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "relay", + "getMaximumLotSize", &result, ) return result, err } -func (tbtcs *TBTCSystem) ApprovedToLog( - _caller common.Address, -) (bool, error) { - var result bool - result, err := tbtcs.contract.ApprovedToLog( +func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTime() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingKeepFactoriesUpdateTime( tbtcs.callerOptions, - _caller, ) if err != nil { @@ -4370,19 +4367,17 @@ func (tbtcs *TBTCSystem) ApprovedToLog( err, tbtcs.callerOptions.From, nil, - "approvedToLog", - _caller, + "getRemainingKeepFactoriesUpdateTime", ) } return result, err } -func (tbtcs *TBTCSystem) ApprovedToLogAtBlock( - _caller common.Address, +func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTimeAtBlock( blockNumber *big.Int, -) (bool, error) { - var result bool +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4392,17 +4387,16 @@ func (tbtcs *TBTCSystem) ApprovedToLogAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "approvedToLog", + "getRemainingKeepFactoriesUpdateTime", &result, - _caller, ) return result, err } -func (tbtcs *TBTCSystem) FetchRelayPreviousDifficulty() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.FetchRelayPreviousDifficulty( +func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.GetSeverelyUndercollateralizedThresholdPercent( tbtcs.callerOptions, ) @@ -4411,17 +4405,17 @@ func (tbtcs *TBTCSystem) FetchRelayPreviousDifficulty() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "fetchRelayPreviousDifficulty", + "getSeverelyUndercollateralizedThresholdPercent", ) } return result, err } -func (tbtcs *TBTCSystem) FetchRelayPreviousDifficultyAtBlock( +func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercentAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4431,16 +4425,16 @@ func (tbtcs *TBTCSystem) FetchRelayPreviousDifficultyAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "fetchRelayPreviousDifficulty", + "getSeverelyUndercollateralizedThresholdPercent", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetMaximumLotSize() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetMaximumLotSize( +func (tbtcs *TBTCSystem) GetAllowedLotSizes() ([]uint64, error) { + var result []uint64 + result, err := tbtcs.contract.GetAllowedLotSizes( tbtcs.callerOptions, ) @@ -4449,17 +4443,17 @@ func (tbtcs *TBTCSystem) GetMaximumLotSize() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getMaximumLotSize", + "getAllowedLotSizes", ) } return result, err } -func (tbtcs *TBTCSystem) GetMaximumLotSizeAtBlock( +func (tbtcs *TBTCSystem) GetAllowedLotSizesAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) ([]uint64, error) { + var result []uint64 err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4469,16 +4463,16 @@ func (tbtcs *TBTCSystem) GetMaximumLotSizeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getMaximumLotSize", + "getAllowedLotSizes", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTime() (*big.Int, error) { +func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTime() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.GetRemainingSignerFeeDivisorUpdateTime( + result, err := tbtcs.contract.GetRemainingLotSizesUpdateTime( tbtcs.callerOptions, ) @@ -4487,14 +4481,14 @@ func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTime() (*big.Int, err err, tbtcs.callerOptions.From, nil, - "getRemainingSignerFeeDivisorUpdateTime", + "getRemainingLotSizesUpdateTime", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTimeAtBlock( +func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTimeAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -4507,16 +4501,16 @@ func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTimeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingSignerFeeDivisorUpdateTime", + "getRemainingLotSizesUpdateTime", &result, ) return result, err } -func (tbtcs *TBTCSystem) FetchBitcoinPrice() (*big.Int, error) { +func (tbtcs *TBTCSystem) GetGovernanceTimeDelay() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.FetchBitcoinPrice( + result, err := tbtcs.contract.GetGovernanceTimeDelay( tbtcs.callerOptions, ) @@ -4525,14 +4519,14 @@ func (tbtcs *TBTCSystem) FetchBitcoinPrice() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "fetchBitcoinPrice", + "getGovernanceTimeDelay", ) } return result, err } -func (tbtcs *TBTCSystem) FetchBitcoinPriceAtBlock( +func (tbtcs *TBTCSystem) GetGovernanceTimeDelayAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -4545,20 +4539,17 @@ func (tbtcs *TBTCSystem) FetchBitcoinPriceAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "fetchBitcoinPrice", + "getGovernanceTimeDelay", &result, ) return result, err } -func (tbtcs *TBTCSystem) IsAllowedLotSize( - _requestedLotSizeSatoshis uint64, -) (bool, error) { - var result bool - result, err := tbtcs.contract.IsAllowedLotSize( +func (tbtcs *TBTCSystem) GetSignerFeeDivisor() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.GetSignerFeeDivisor( tbtcs.callerOptions, - _requestedLotSizeSatoshis, ) if err != nil { @@ -4566,19 +4557,17 @@ func (tbtcs *TBTCSystem) IsAllowedLotSize( err, tbtcs.callerOptions.From, nil, - "isAllowedLotSize", - _requestedLotSizeSatoshis, + "getSignerFeeDivisor", ) } return result, err } -func (tbtcs *TBTCSystem) IsAllowedLotSizeAtBlock( - _requestedLotSizeSatoshis uint64, +func (tbtcs *TBTCSystem) GetSignerFeeDivisorAtBlock( blockNumber *big.Int, -) (bool, error) { - var result bool +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4588,17 +4577,16 @@ func (tbtcs *TBTCSystem) IsAllowedLotSizeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "isAllowedLotSize", + "getSignerFeeDivisor", &result, - _requestedLotSizeSatoshis, ) return result, err } -func (tbtcs *TBTCSystem) Owner() (common.Address, error) { +func (tbtcs *TBTCSystem) Relay() (common.Address, error) { var result common.Address - result, err := tbtcs.contract.Owner( + result, err := tbtcs.contract.Relay( tbtcs.callerOptions, ) @@ -4607,14 +4595,14 @@ func (tbtcs *TBTCSystem) Owner() (common.Address, error) { err, tbtcs.callerOptions.From, nil, - "owner", + "relay", ) } return result, err } -func (tbtcs *TBTCSystem) OwnerAtBlock( +func (tbtcs *TBTCSystem) RelayAtBlock( blockNumber *big.Int, ) (common.Address, error) { var result common.Address @@ -4627,16 +4615,16 @@ func (tbtcs *TBTCSystem) OwnerAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "owner", + "relay", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetMinimumLotSize() (*big.Int, error) { +func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTime() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.GetMinimumLotSize( + result, err := tbtcs.contract.GetRemainingCollateralizationThresholdsUpdateTime( tbtcs.callerOptions, ) @@ -4645,14 +4633,14 @@ func (tbtcs *TBTCSystem) GetMinimumLotSize() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getMinimumLotSize", + "getRemainingCollateralizationThresholdsUpdateTime", ) } return result, err } -func (tbtcs *TBTCSystem) GetMinimumLotSizeAtBlock( +func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTimeAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -4665,16 +4653,16 @@ func (tbtcs *TBTCSystem) GetMinimumLotSizeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getMinimumLotSize", + "getRemainingCollateralizationThresholdsUpdateTime", &result, ) return result, err } -func (tbtcs *TBTCSystem) FetchRelayCurrentDifficulty() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.FetchRelayCurrentDifficulty( +func (tbtcs *TBTCSystem) GetAllowNewDeposits() (bool, error) { + var result bool + result, err := tbtcs.contract.GetAllowNewDeposits( tbtcs.callerOptions, ) @@ -4683,17 +4671,17 @@ func (tbtcs *TBTCSystem) FetchRelayCurrentDifficulty() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "fetchRelayCurrentDifficulty", + "getAllowNewDeposits", ) } return result, err } -func (tbtcs *TBTCSystem) FetchRelayCurrentDifficultyAtBlock( +func (tbtcs *TBTCSystem) GetAllowNewDepositsAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (bool, error) { + var result bool err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4703,16 +4691,16 @@ func (tbtcs *TBTCSystem) FetchRelayCurrentDifficultyAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "fetchRelayCurrentDifficulty", + "getAllowNewDeposits", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriod() (*big.Int, error) { +func (tbtcs *TBTCSystem) GetNewDepositFeeEstimate() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.GetKeepFactoriesUpgradeabilityPeriod( + result, err := tbtcs.contract.GetNewDepositFeeEstimate( tbtcs.callerOptions, ) @@ -4721,14 +4709,14 @@ func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriod() (*big.Int, error err, tbtcs.callerOptions.From, nil, - "getKeepFactoriesUpgradeabilityPeriod", + "getNewDepositFeeEstimate", ) } return result, err } -func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriodAtBlock( +func (tbtcs *TBTCSystem) GetNewDepositFeeEstimateAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -4741,16 +4729,16 @@ func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriodAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getKeepFactoriesUpgradeabilityPeriod", + "getNewDepositFeeEstimate", &result, ) return result, err } -func (tbtcs *TBTCSystem) PriceFeed() (common.Address, error) { - var result common.Address - result, err := tbtcs.contract.PriceFeed( +func (tbtcs *TBTCSystem) IsOwner() (bool, error) { + var result bool + result, err := tbtcs.contract.IsOwner( tbtcs.callerOptions, ) @@ -4759,17 +4747,17 @@ func (tbtcs *TBTCSystem) PriceFeed() (common.Address, error) { err, tbtcs.callerOptions.From, nil, - "priceFeed", + "isOwner", ) } return result, err } -func (tbtcs *TBTCSystem) PriceFeedAtBlock( +func (tbtcs *TBTCSystem) IsOwnerAtBlock( blockNumber *big.Int, -) (common.Address, error) { - var result common.Address +) (bool, error) { + var result bool err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4779,16 +4767,16 @@ func (tbtcs *TBTCSystem) PriceFeedAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "priceFeed", + "isOwner", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetGovernanceTimeDelay() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetGovernanceTimeDelay( +func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.GetUndercollateralizedThresholdPercent( tbtcs.callerOptions, ) @@ -4797,17 +4785,17 @@ func (tbtcs *TBTCSystem) GetGovernanceTimeDelay() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getGovernanceTimeDelay", + "getUndercollateralizedThresholdPercent", ) } return result, err } -func (tbtcs *TBTCSystem) GetGovernanceTimeDelayAtBlock( +func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercentAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4817,16 +4805,16 @@ func (tbtcs *TBTCSystem) GetGovernanceTimeDelayAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getGovernanceTimeDelay", + "getUndercollateralizedThresholdPercent", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTime() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetRemainingKeepFactoriesUpgradeabilityTime( +func (tbtcs *TBTCSystem) KeepThreshold() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.KeepThreshold( tbtcs.callerOptions, ) @@ -4835,17 +4823,17 @@ func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTime() (*big.Int err, tbtcs.callerOptions.From, nil, - "getRemainingKeepFactoriesUpgradeabilityTime", + "keepThreshold", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTimeAtBlock( +func (tbtcs *TBTCSystem) KeepThresholdAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4855,17 +4843,20 @@ func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTimeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingKeepFactoriesUpgradeabilityTime", + "keepThreshold", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTime() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetRemainingCollateralizationThresholdsUpdateTime( +func (tbtcs *TBTCSystem) ApprovedToLog( + _caller common.Address, +) (bool, error) { + var result bool + result, err := tbtcs.contract.ApprovedToLog( tbtcs.callerOptions, + _caller, ) if err != nil { @@ -4873,17 +4864,19 @@ func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTime() (*b err, tbtcs.callerOptions.From, nil, - "getRemainingCollateralizationThresholdsUpdateTime", + "approvedToLog", + _caller, ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTimeAtBlock( +func (tbtcs *TBTCSystem) ApprovedToLogAtBlock( + _caller common.Address, blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (bool, error) { + var result bool err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4893,16 +4886,17 @@ func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTimeAtBloc tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingCollateralizationThresholdsUpdateTime", + "approvedToLog", &result, + _caller, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTime() (*big.Int, error) { +func (tbtcs *TBTCSystem) GetMinimumLotSize() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.GetRemainingLotSizesUpdateTime( + result, err := tbtcs.contract.GetMinimumLotSize( tbtcs.callerOptions, ) @@ -4911,14 +4905,14 @@ func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTime() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getRemainingLotSizesUpdateTime", + "getMinimumLotSize", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTimeAtBlock( +func (tbtcs *TBTCSystem) GetMinimumLotSizeAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -4931,17 +4925,20 @@ func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTimeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingLotSizesUpdateTime", + "getMinimumLotSize", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetSignerFeeDivisor() (uint16, error) { - var result uint16 - result, err := tbtcs.contract.GetSignerFeeDivisor( +func (tbtcs *TBTCSystem) IsAllowedLotSize( + _requestedLotSizeSatoshis uint64, +) (bool, error) { + var result bool + result, err := tbtcs.contract.IsAllowedLotSize( tbtcs.callerOptions, + _requestedLotSizeSatoshis, ) if err != nil { @@ -4949,17 +4946,19 @@ func (tbtcs *TBTCSystem) GetSignerFeeDivisor() (uint16, error) { err, tbtcs.callerOptions.From, nil, - "getSignerFeeDivisor", + "isAllowedLotSize", + _requestedLotSizeSatoshis, ) } return result, err } -func (tbtcs *TBTCSystem) GetSignerFeeDivisorAtBlock( +func (tbtcs *TBTCSystem) IsAllowedLotSizeAtBlock( + _requestedLotSizeSatoshis uint64, blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (bool, error) { + var result bool err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4969,16 +4968,17 @@ func (tbtcs *TBTCSystem) GetSignerFeeDivisorAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getSignerFeeDivisor", + "isAllowedLotSize", &result, + _requestedLotSizeSatoshis, ) return result, err } -func (tbtcs *TBTCSystem) KeepSize() (uint16, error) { +func (tbtcs *TBTCSystem) GetInitialCollateralizedPercent() (uint16, error) { var result uint16 - result, err := tbtcs.contract.KeepSize( + result, err := tbtcs.contract.GetInitialCollateralizedPercent( tbtcs.callerOptions, ) @@ -4987,14 +4987,14 @@ func (tbtcs *TBTCSystem) KeepSize() (uint16, error) { err, tbtcs.callerOptions.From, nil, - "keepSize", + "getInitialCollateralizedPercent", ) } return result, err } -func (tbtcs *TBTCSystem) KeepSizeAtBlock( +func (tbtcs *TBTCSystem) GetInitialCollateralizedPercentAtBlock( blockNumber *big.Int, ) (uint16, error) { var result uint16 @@ -5007,16 +5007,16 @@ func (tbtcs *TBTCSystem) KeepSizeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "keepSize", + "getInitialCollateralizedPercent", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetNewDepositFeeEstimate() (*big.Int, error) { +func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTime() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.GetNewDepositFeeEstimate( + result, err := tbtcs.contract.GetRemainingEthBtcPriceFeedAdditionTime( tbtcs.callerOptions, ) @@ -5025,14 +5025,14 @@ func (tbtcs *TBTCSystem) GetNewDepositFeeEstimate() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getNewDepositFeeEstimate", + "getRemainingEthBtcPriceFeedAdditionTime", ) } return result, err } -func (tbtcs *TBTCSystem) GetNewDepositFeeEstimateAtBlock( +func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTimeAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -5045,16 +5045,16 @@ func (tbtcs *TBTCSystem) GetNewDepositFeeEstimateAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getNewDepositFeeEstimate", + "getRemainingEthBtcPriceFeedAdditionTime", &result, ) return result, err } -func (tbtcs *TBTCSystem) IsOwner() (bool, error) { - var result bool - result, err := tbtcs.contract.IsOwner( +func (tbtcs *TBTCSystem) FetchBitcoinPrice() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.FetchBitcoinPrice( tbtcs.callerOptions, ) @@ -5063,17 +5063,17 @@ func (tbtcs *TBTCSystem) IsOwner() (bool, error) { err, tbtcs.callerOptions.From, nil, - "isOwner", + "fetchBitcoinPrice", ) } return result, err } -func (tbtcs *TBTCSystem) IsOwnerAtBlock( +func (tbtcs *TBTCSystem) FetchBitcoinPriceAtBlock( blockNumber *big.Int, -) (bool, error) { - var result bool +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -5083,16 +5083,16 @@ func (tbtcs *TBTCSystem) IsOwnerAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "isOwner", + "fetchBitcoinPrice", &result, ) return result, err } -func (tbtcs *TBTCSystem) KeepThreshold() (uint16, error) { - var result uint16 - result, err := tbtcs.contract.KeepThreshold( +func (tbtcs *TBTCSystem) FetchRelayCurrentDifficulty() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.FetchRelayCurrentDifficulty( tbtcs.callerOptions, ) @@ -5101,17 +5101,17 @@ func (tbtcs *TBTCSystem) KeepThreshold() (uint16, error) { err, tbtcs.callerOptions.From, nil, - "keepThreshold", + "fetchRelayCurrentDifficulty", ) } return result, err } -func (tbtcs *TBTCSystem) KeepThresholdAtBlock( +func (tbtcs *TBTCSystem) FetchRelayCurrentDifficultyAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -5121,16 +5121,16 @@ func (tbtcs *TBTCSystem) KeepThresholdAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "keepThreshold", + "fetchRelayCurrentDifficulty", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetAllowedLotSizes() ([]uint64, error) { - var result []uint64 - result, err := tbtcs.contract.GetAllowedLotSizes( +func (tbtcs *TBTCSystem) KeepSize() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.KeepSize( tbtcs.callerOptions, ) @@ -5139,17 +5139,17 @@ func (tbtcs *TBTCSystem) GetAllowedLotSizes() ([]uint64, error) { err, tbtcs.callerOptions.From, nil, - "getAllowedLotSizes", + "keepSize", ) } return result, err } -func (tbtcs *TBTCSystem) GetAllowedLotSizesAtBlock( +func (tbtcs *TBTCSystem) KeepSizeAtBlock( blockNumber *big.Int, -) ([]uint64, error) { - var result []uint64 +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -5159,7 +5159,7 @@ func (tbtcs *TBTCSystem) GetAllowedLotSizesAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getAllowedLotSizes", + "keepSize", &result, ) @@ -5168,16 +5168,14 @@ func (tbtcs *TBTCSystem) GetAllowedLotSizesAtBlock( // ------ Events ------- -type tBTCSystemExitedCourtesyCallFunc func( - DepositContractAddress common.Address, - Timestamp *big.Int, +type tBTCSystemAllowNewDepositsUpdatedFunc func( + AllowNewDeposits bool, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchExitedCourtesyCall( - success tBTCSystemExitedCourtesyCallFunc, +func (tbtcs *TBTCSystem) WatchAllowNewDepositsUpdated( + success tBTCSystemAllowNewDepositsUpdatedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -5194,10 +5192,9 @@ func (tbtcs *TBTCSystem) WatchExitedCourtesyCall( return err } - subscription, err := tbtcs.subscribeExitedCourtesyCall( + subscription, err := tbtcs.subscribeAllowNewDepositsUpdated( success, failCallback, - _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -5217,7 +5214,7 @@ func (tbtcs *TBTCSystem) WatchExitedCourtesyCall( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event ExitedCourtesyCall terminated with error; " + + "subscription to event AllowNewDepositsUpdated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5238,21 +5235,19 @@ func (tbtcs *TBTCSystem) WatchExitedCourtesyCall( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeExitedCourtesyCall( - success tBTCSystemExitedCourtesyCallFunc, +func (tbtcs *TBTCSystem) subscribeAllowNewDepositsUpdated( + success tBTCSystemAllowNewDepositsUpdatedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemExitedCourtesyCall) - eventSubscription, err := tbtcs.contract.WatchExitedCourtesyCall( + eventChan := make(chan *abi.TBTCSystemAllowNewDepositsUpdated) + eventSubscription, err := tbtcs.contract.WatchAllowNewDepositsUpdated( nil, eventChan, - _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for ExitedCourtesyCall events: [%v]", + "error creating watch for AllowNewDepositsUpdated events: [%v]", err, ) } @@ -5270,8 +5265,7 @@ func (tbtcs *TBTCSystem) subscribeExitedCourtesyCall( return } success( - event.DepositContractAddress, - event.Timestamp, + event.AllowNewDeposits, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -5293,14 +5287,14 @@ func (tbtcs *TBTCSystem) subscribeExitedCourtesyCall( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemLiquidatedFunc func( +type tBTCSystemFraudDuringSetupFunc func( DepositContractAddress common.Address, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchLiquidated( - success tBTCSystemLiquidatedFunc, +func (tbtcs *TBTCSystem) WatchFraudDuringSetup( + success tBTCSystemFraudDuringSetupFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { @@ -5319,7 +5313,7 @@ func (tbtcs *TBTCSystem) WatchLiquidated( return err } - subscription, err := tbtcs.subscribeLiquidated( + subscription, err := tbtcs.subscribeFraudDuringSetup( success, failCallback, _depositContractAddressFilter, @@ -5342,7 +5336,7 @@ func (tbtcs *TBTCSystem) WatchLiquidated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event Liquidated terminated with error; " + + "subscription to event FraudDuringSetup terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5363,13 +5357,13 @@ func (tbtcs *TBTCSystem) WatchLiquidated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeLiquidated( - success tBTCSystemLiquidatedFunc, +func (tbtcs *TBTCSystem) subscribeFraudDuringSetup( + success tBTCSystemFraudDuringSetupFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemLiquidated) - eventSubscription, err := tbtcs.contract.WatchLiquidated( + eventChan := make(chan *abi.TBTCSystemFraudDuringSetup) + eventSubscription, err := tbtcs.contract.WatchFraudDuringSetup( nil, eventChan, _depositContractAddressFilter, @@ -5377,7 +5371,7 @@ func (tbtcs *TBTCSystem) subscribeLiquidated( if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for Liquidated events: [%v]", + "error creating watch for FraudDuringSetup events: [%v]", err, ) } @@ -5418,15 +5412,18 @@ func (tbtcs *TBTCSystem) subscribeLiquidated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemLotSizesUpdateStartedFunc func( - LotSizes []uint64, +type tBTCSystemFundedFunc func( + DepositContractAddress common.Address, + Txid [32]uint8, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchLotSizesUpdateStarted( - success tBTCSystemLotSizesUpdateStartedFunc, +func (tbtcs *TBTCSystem) WatchFunded( + success tBTCSystemFundedFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -5443,9 +5440,11 @@ func (tbtcs *TBTCSystem) WatchLotSizesUpdateStarted( return err } - subscription, err := tbtcs.subscribeLotSizesUpdateStarted( + subscription, err := tbtcs.subscribeFunded( success, failCallback, + _depositContractAddressFilter, + _txidFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -5465,7 +5464,7 @@ func (tbtcs *TBTCSystem) WatchLotSizesUpdateStarted( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event LotSizesUpdateStarted terminated with error; " + + "subscription to event Funded terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5486,19 +5485,23 @@ func (tbtcs *TBTCSystem) WatchLotSizesUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeLotSizesUpdateStarted( - success tBTCSystemLotSizesUpdateStartedFunc, +func (tbtcs *TBTCSystem) subscribeFunded( + success tBTCSystemFundedFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemLotSizesUpdateStarted) - eventSubscription, err := tbtcs.contract.WatchLotSizesUpdateStarted( + eventChan := make(chan *abi.TBTCSystemFunded) + eventSubscription, err := tbtcs.contract.WatchFunded( nil, eventChan, + _depositContractAddressFilter, + _txidFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for LotSizesUpdateStarted events: [%v]", + "error creating watch for Funded events: [%v]", err, ) } @@ -5516,7 +5519,8 @@ func (tbtcs *TBTCSystem) subscribeLotSizesUpdateStarted( return } success( - event.LotSizes, + event.DepositContractAddress, + event.Txid, event.Timestamp, event.Raw.BlockNumber, ) @@ -5658,15 +5662,17 @@ func (tbtcs *TBTCSystem) subscribeLotSizesUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemSignerFeeDivisorUpdateStartedFunc func( - SignerFeeDivisor uint16, - Timestamp *big.Int, +type tBTCSystemOwnershipTransferredFunc func( + PreviousOwner common.Address, + NewOwner common.Address, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdateStarted( - success tBTCSystemSignerFeeDivisorUpdateStartedFunc, +func (tbtcs *TBTCSystem) WatchOwnershipTransferred( + success tBTCSystemOwnershipTransferredFunc, fail func(err error) error, + previousOwnerFilter []common.Address, + newOwnerFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -5683,9 +5689,11 @@ func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdateStarted( return err } - subscription, err := tbtcs.subscribeSignerFeeDivisorUpdateStarted( + subscription, err := tbtcs.subscribeOwnershipTransferred( success, failCallback, + previousOwnerFilter, + newOwnerFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -5705,7 +5713,7 @@ func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdateStarted( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event SignerFeeDivisorUpdateStarted terminated with error; " + + "subscription to event OwnershipTransferred terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5726,19 +5734,23 @@ func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdateStarted( - success tBTCSystemSignerFeeDivisorUpdateStartedFunc, +func (tbtcs *TBTCSystem) subscribeOwnershipTransferred( + success tBTCSystemOwnershipTransferredFunc, fail func(err error) error, + previousOwnerFilter []common.Address, + newOwnerFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemSignerFeeDivisorUpdateStarted) - eventSubscription, err := tbtcs.contract.WatchSignerFeeDivisorUpdateStarted( + eventChan := make(chan *abi.TBTCSystemOwnershipTransferred) + eventSubscription, err := tbtcs.contract.WatchOwnershipTransferred( nil, eventChan, + previousOwnerFilter, + newOwnerFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for SignerFeeDivisorUpdateStarted events: [%v]", + "error creating watch for OwnershipTransferred events: [%v]", err, ) } @@ -5756,8 +5768,8 @@ func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdateStarted( return } success( - event.SignerFeeDivisor, - event.Timestamp, + event.PreviousOwner, + event.NewOwner, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -5779,14 +5791,18 @@ func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemSignerFeeDivisorUpdatedFunc func( - SignerFeeDivisor uint16, +type tBTCSystemRedeemedFunc func( + DepositContractAddress common.Address, + Txid [32]uint8, + Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdated( - success tBTCSystemSignerFeeDivisorUpdatedFunc, +func (tbtcs *TBTCSystem) WatchRedeemed( + success tBTCSystemRedeemedFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -5803,9 +5819,11 @@ func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdated( return err } - subscription, err := tbtcs.subscribeSignerFeeDivisorUpdated( + subscription, err := tbtcs.subscribeRedeemed( success, failCallback, + _depositContractAddressFilter, + _txidFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -5825,7 +5843,7 @@ func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event SignerFeeDivisorUpdated terminated with error; " + + "subscription to event Redeemed terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5846,19 +5864,23 @@ func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdated( - success tBTCSystemSignerFeeDivisorUpdatedFunc, +func (tbtcs *TBTCSystem) subscribeRedeemed( + success tBTCSystemRedeemedFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemSignerFeeDivisorUpdated) - eventSubscription, err := tbtcs.contract.WatchSignerFeeDivisorUpdated( + eventChan := make(chan *abi.TBTCSystemRedeemed) + eventSubscription, err := tbtcs.contract.WatchRedeemed( nil, eventChan, + _depositContractAddressFilter, + _txidFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for SignerFeeDivisorUpdated events: [%v]", + "error creating watch for Redeemed events: [%v]", err, ) } @@ -5876,7 +5898,9 @@ func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdated( return } success( - event.SignerFeeDivisor, + event.DepositContractAddress, + event.Txid, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -5898,16 +5922,15 @@ func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemCourtesyCalledFunc func( - DepositContractAddress common.Address, +type tBTCSystemSignerFeeDivisorUpdateStartedFunc func( + SignerFeeDivisor uint16, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchCourtesyCalled( - success tBTCSystemCourtesyCalledFunc, +func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdateStarted( + success tBTCSystemSignerFeeDivisorUpdateStartedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -5924,10 +5947,9 @@ func (tbtcs *TBTCSystem) WatchCourtesyCalled( return err } - subscription, err := tbtcs.subscribeCourtesyCalled( + subscription, err := tbtcs.subscribeSignerFeeDivisorUpdateStarted( success, failCallback, - _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -5947,7 +5969,7 @@ func (tbtcs *TBTCSystem) WatchCourtesyCalled( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event CourtesyCalled terminated with error; " + + "subscription to event SignerFeeDivisorUpdateStarted terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5968,21 +5990,19 @@ func (tbtcs *TBTCSystem) WatchCourtesyCalled( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeCourtesyCalled( - success tBTCSystemCourtesyCalledFunc, +func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdateStarted( + success tBTCSystemSignerFeeDivisorUpdateStartedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemCourtesyCalled) - eventSubscription, err := tbtcs.contract.WatchCourtesyCalled( + eventChan := make(chan *abi.TBTCSystemSignerFeeDivisorUpdateStarted) + eventSubscription, err := tbtcs.contract.WatchSignerFeeDivisorUpdateStarted( nil, eventChan, - _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for CourtesyCalled events: [%v]", + "error creating watch for SignerFeeDivisorUpdateStarted events: [%v]", err, ) } @@ -6000,7 +6020,7 @@ func (tbtcs *TBTCSystem) subscribeCourtesyCalled( return } success( - event.DepositContractAddress, + event.SignerFeeDivisor, event.Timestamp, event.Raw.BlockNumber, ) @@ -6023,16 +6043,16 @@ func (tbtcs *TBTCSystem) subscribeCourtesyCalled( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemKeepFactoriesUpdateStartedFunc func( - KeepStakedFactory common.Address, - FullyBackedFactory common.Address, - FactorySelector common.Address, +type tBTCSystemCollateralizationThresholdsUpdateStartedFunc func( + InitialCollateralizedPercent uint16, + UndercollateralizedThresholdPercent uint16, + SeverelyUndercollateralizedThresholdPercent uint16, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdateStarted( - success tBTCSystemKeepFactoriesUpdateStartedFunc, +func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdateStarted( + success tBTCSystemCollateralizationThresholdsUpdateStartedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { errorChan := make(chan error) @@ -6050,7 +6070,7 @@ func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdateStarted( return err } - subscription, err := tbtcs.subscribeKeepFactoriesUpdateStarted( + subscription, err := tbtcs.subscribeCollateralizationThresholdsUpdateStarted( success, failCallback, ) @@ -6072,7 +6092,7 @@ func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdateStarted( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event KeepFactoriesUpdateStarted terminated with error; " + + "subscription to event CollateralizationThresholdsUpdateStarted terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6093,19 +6113,19 @@ func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdateStarted( - success tBTCSystemKeepFactoriesUpdateStartedFunc, +func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdateStarted( + success tBTCSystemCollateralizationThresholdsUpdateStartedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemKeepFactoriesUpdateStarted) - eventSubscription, err := tbtcs.contract.WatchKeepFactoriesUpdateStarted( + eventChan := make(chan *abi.TBTCSystemCollateralizationThresholdsUpdateStarted) + eventSubscription, err := tbtcs.contract.WatchCollateralizationThresholdsUpdateStarted( nil, eventChan, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for KeepFactoriesUpdateStarted events: [%v]", + "error creating watch for CollateralizationThresholdsUpdateStarted events: [%v]", err, ) } @@ -6123,9 +6143,9 @@ func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdateStarted( return } success( - event.KeepStakedFactory, - event.FullyBackedFactory, - event.FactorySelector, + event.InitialCollateralizedPercent, + event.UndercollateralizedThresholdPercent, + event.SeverelyUndercollateralizedThresholdPercent, event.Timestamp, event.Raw.BlockNumber, ) @@ -6148,18 +6168,16 @@ func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemRedeemedFunc func( +type tBTCSystemFunderAbortRequestedFunc func( DepositContractAddress common.Address, - Txid [32]uint8, - Timestamp *big.Int, + AbortOutputScript []uint8, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchRedeemed( - success tBTCSystemRedeemedFunc, +func (tbtcs *TBTCSystem) WatchFunderAbortRequested( + success tBTCSystemFunderAbortRequestedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -6176,11 +6194,10 @@ func (tbtcs *TBTCSystem) WatchRedeemed( return err } - subscription, err := tbtcs.subscribeRedeemed( + subscription, err := tbtcs.subscribeFunderAbortRequested( success, failCallback, _depositContractAddressFilter, - _txidFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -6200,7 +6217,7 @@ func (tbtcs *TBTCSystem) WatchRedeemed( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event Redeemed terminated with error; " + + "subscription to event FunderAbortRequested terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6221,23 +6238,21 @@ func (tbtcs *TBTCSystem) WatchRedeemed( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeRedeemed( - success tBTCSystemRedeemedFunc, +func (tbtcs *TBTCSystem) subscribeFunderAbortRequested( + success tBTCSystemFunderAbortRequestedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemRedeemed) - eventSubscription, err := tbtcs.contract.WatchRedeemed( + eventChan := make(chan *abi.TBTCSystemFunderAbortRequested) + eventSubscription, err := tbtcs.contract.WatchFunderAbortRequested( nil, eventChan, _depositContractAddressFilter, - _txidFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for Redeemed events: [%v]", + "error creating watch for FunderAbortRequested events: [%v]", err, ) } @@ -6255,9 +6270,8 @@ func (tbtcs *TBTCSystem) subscribeRedeemed( return } success( - event.DepositContractAddress, - event.Txid, - event.Timestamp, + event.DepositContractAddress, + event.AbortOutputScript, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -6279,22 +6293,19 @@ func (tbtcs *TBTCSystem) subscribeRedeemed( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemRedemptionRequestedFunc func( +type tBTCSystemGotRedemptionSignatureFunc func( DepositContractAddress common.Address, - Requester common.Address, Digest [32]uint8, - UtxoValue *big.Int, - RedeemerOutputScript []uint8, - RequestedFee *big.Int, - Outpoint []uint8, + R [32]uint8, + S [32]uint8, + Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchRedemptionRequested( - success tBTCSystemRedemptionRequestedFunc, +func (tbtcs *TBTCSystem) WatchGotRedemptionSignature( + success tBTCSystemGotRedemptionSignatureFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _requesterFilter []common.Address, _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) @@ -6312,11 +6323,10 @@ func (tbtcs *TBTCSystem) WatchRedemptionRequested( return err } - subscription, err := tbtcs.subscribeRedemptionRequested( + subscription, err := tbtcs.subscribeGotRedemptionSignature( success, failCallback, _depositContractAddressFilter, - _requesterFilter, _digestFilter, ) if err != nil { @@ -6337,7 +6347,7 @@ func (tbtcs *TBTCSystem) WatchRedemptionRequested( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event RedemptionRequested terminated with error; " + + "subscription to event GotRedemptionSignature terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6358,25 +6368,23 @@ func (tbtcs *TBTCSystem) WatchRedemptionRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeRedemptionRequested( - success tBTCSystemRedemptionRequestedFunc, +func (tbtcs *TBTCSystem) subscribeGotRedemptionSignature( + success tBTCSystemGotRedemptionSignatureFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _requesterFilter []common.Address, _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemRedemptionRequested) - eventSubscription, err := tbtcs.contract.WatchRedemptionRequested( + eventChan := make(chan *abi.TBTCSystemGotRedemptionSignature) + eventSubscription, err := tbtcs.contract.WatchGotRedemptionSignature( nil, eventChan, _depositContractAddressFilter, - _requesterFilter, _digestFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for RedemptionRequested events: [%v]", + "error creating watch for GotRedemptionSignature events: [%v]", err, ) } @@ -6395,12 +6403,10 @@ func (tbtcs *TBTCSystem) subscribeRedemptionRequested( } success( event.DepositContractAddress, - event.Requester, event.Digest, - event.UtxoValue, - event.RedeemerOutputScript, - event.RequestedFee, - event.Outpoint, + event.R, + event.S, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -6422,16 +6428,15 @@ func (tbtcs *TBTCSystem) subscribeRedemptionRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemRegisteredPubkeyFunc func( +type tBTCSystemStartedLiquidationFunc func( DepositContractAddress common.Address, - SigningGroupPubkeyX [32]uint8, - SigningGroupPubkeyY [32]uint8, + WasFraud bool, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchRegisteredPubkey( - success tBTCSystemRegisteredPubkeyFunc, +func (tbtcs *TBTCSystem) WatchStartedLiquidation( + success tBTCSystemStartedLiquidationFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { @@ -6450,7 +6455,7 @@ func (tbtcs *TBTCSystem) WatchRegisteredPubkey( return err } - subscription, err := tbtcs.subscribeRegisteredPubkey( + subscription, err := tbtcs.subscribeStartedLiquidation( success, failCallback, _depositContractAddressFilter, @@ -6473,7 +6478,7 @@ func (tbtcs *TBTCSystem) WatchRegisteredPubkey( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event RegisteredPubkey terminated with error; " + + "subscription to event StartedLiquidation terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6494,13 +6499,13 @@ func (tbtcs *TBTCSystem) WatchRegisteredPubkey( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeRegisteredPubkey( - success tBTCSystemRegisteredPubkeyFunc, +func (tbtcs *TBTCSystem) subscribeStartedLiquidation( + success tBTCSystemStartedLiquidationFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemRegisteredPubkey) - eventSubscription, err := tbtcs.contract.WatchRegisteredPubkey( + eventChan := make(chan *abi.TBTCSystemStartedLiquidation) + eventSubscription, err := tbtcs.contract.WatchStartedLiquidation( nil, eventChan, _depositContractAddressFilter, @@ -6508,7 +6513,7 @@ func (tbtcs *TBTCSystem) subscribeRegisteredPubkey( if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for RegisteredPubkey events: [%v]", + "error creating watch for StartedLiquidation events: [%v]", err, ) } @@ -6527,8 +6532,7 @@ func (tbtcs *TBTCSystem) subscribeRegisteredPubkey( } success( event.DepositContractAddress, - event.SigningGroupPubkeyX, - event.SigningGroupPubkeyY, + event.WasFraud, event.Timestamp, event.Raw.BlockNumber, ) @@ -6551,16 +6555,16 @@ func (tbtcs *TBTCSystem) subscribeRegisteredPubkey( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemSetupFailedFunc func( - DepositContractAddress common.Address, - Timestamp *big.Int, +type tBTCSystemCollateralizationThresholdsUpdatedFunc func( + InitialCollateralizedPercent uint16, + UndercollateralizedThresholdPercent uint16, + SeverelyUndercollateralizedThresholdPercent uint16, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchSetupFailed( - success tBTCSystemSetupFailedFunc, +func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdated( + success tBTCSystemCollateralizationThresholdsUpdatedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -6577,10 +6581,9 @@ func (tbtcs *TBTCSystem) WatchSetupFailed( return err } - subscription, err := tbtcs.subscribeSetupFailed( + subscription, err := tbtcs.subscribeCollateralizationThresholdsUpdated( success, failCallback, - _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -6600,7 +6603,7 @@ func (tbtcs *TBTCSystem) WatchSetupFailed( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event SetupFailed terminated with error; " + + "subscription to event CollateralizationThresholdsUpdated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6621,21 +6624,19 @@ func (tbtcs *TBTCSystem) WatchSetupFailed( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeSetupFailed( - success tBTCSystemSetupFailedFunc, +func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdated( + success tBTCSystemCollateralizationThresholdsUpdatedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemSetupFailed) - eventSubscription, err := tbtcs.contract.WatchSetupFailed( + eventChan := make(chan *abi.TBTCSystemCollateralizationThresholdsUpdated) + eventSubscription, err := tbtcs.contract.WatchCollateralizationThresholdsUpdated( nil, eventChan, - _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for SetupFailed events: [%v]", + "error creating watch for CollateralizationThresholdsUpdated events: [%v]", err, ) } @@ -6653,8 +6654,9 @@ func (tbtcs *TBTCSystem) subscribeSetupFailed( return } success( - event.DepositContractAddress, - event.Timestamp, + event.InitialCollateralizedPercent, + event.UndercollateralizedThresholdPercent, + event.SeverelyUndercollateralizedThresholdPercent, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -6676,14 +6678,14 @@ func (tbtcs *TBTCSystem) subscribeSetupFailed( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemFraudDuringSetupFunc func( +type tBTCSystemCourtesyCalledFunc func( DepositContractAddress common.Address, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchFraudDuringSetup( - success tBTCSystemFraudDuringSetupFunc, +func (tbtcs *TBTCSystem) WatchCourtesyCalled( + success tBTCSystemCourtesyCalledFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { @@ -6702,7 +6704,7 @@ func (tbtcs *TBTCSystem) WatchFraudDuringSetup( return err } - subscription, err := tbtcs.subscribeFraudDuringSetup( + subscription, err := tbtcs.subscribeCourtesyCalled( success, failCallback, _depositContractAddressFilter, @@ -6725,7 +6727,7 @@ func (tbtcs *TBTCSystem) WatchFraudDuringSetup( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event FraudDuringSetup terminated with error; " + + "subscription to event CourtesyCalled terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6746,13 +6748,13 @@ func (tbtcs *TBTCSystem) WatchFraudDuringSetup( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeFraudDuringSetup( - success tBTCSystemFraudDuringSetupFunc, +func (tbtcs *TBTCSystem) subscribeCourtesyCalled( + success tBTCSystemCourtesyCalledFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemFraudDuringSetup) - eventSubscription, err := tbtcs.contract.WatchFraudDuringSetup( + eventChan := make(chan *abi.TBTCSystemCourtesyCalled) + eventSubscription, err := tbtcs.contract.WatchCourtesyCalled( nil, eventChan, _depositContractAddressFilter, @@ -6760,7 +6762,7 @@ func (tbtcs *TBTCSystem) subscribeFraudDuringSetup( if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for FraudDuringSetup events: [%v]", + "error creating watch for CourtesyCalled events: [%v]", err, ) } @@ -6801,16 +6803,18 @@ func (tbtcs *TBTCSystem) subscribeFraudDuringSetup( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemCollateralizationThresholdsUpdatedFunc func( - InitialCollateralizedPercent uint16, - UndercollateralizedThresholdPercent uint16, - SeverelyUndercollateralizedThresholdPercent uint16, +type tBTCSystemCreatedFunc func( + DepositContractAddress common.Address, + KeepAddress common.Address, + Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdated( - success tBTCSystemCollateralizationThresholdsUpdatedFunc, +func (tbtcs *TBTCSystem) WatchCreated( + success tBTCSystemCreatedFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, + _keepAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -6827,9 +6831,11 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdated( return err } - subscription, err := tbtcs.subscribeCollateralizationThresholdsUpdated( + subscription, err := tbtcs.subscribeCreated( success, failCallback, + _depositContractAddressFilter, + _keepAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -6849,7 +6855,7 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event CollateralizationThresholdsUpdated terminated with error; " + + "subscription to event Created terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6870,19 +6876,23 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdated( - success tBTCSystemCollateralizationThresholdsUpdatedFunc, +func (tbtcs *TBTCSystem) subscribeCreated( + success tBTCSystemCreatedFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, + _keepAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemCollateralizationThresholdsUpdated) - eventSubscription, err := tbtcs.contract.WatchCollateralizationThresholdsUpdated( + eventChan := make(chan *abi.TBTCSystemCreated) + eventSubscription, err := tbtcs.contract.WatchCreated( nil, eventChan, + _depositContractAddressFilter, + _keepAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for CollateralizationThresholdsUpdated events: [%v]", + "error creating watch for Created events: [%v]", err, ) } @@ -6900,9 +6910,9 @@ func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdated( return } success( - event.InitialCollateralizedPercent, - event.UndercollateralizedThresholdPercent, - event.SeverelyUndercollateralizedThresholdPercent, + event.DepositContractAddress, + event.KeepAddress, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -6924,18 +6934,15 @@ func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemCreatedFunc func( - DepositContractAddress common.Address, - KeepAddress common.Address, +type tBTCSystemLotSizesUpdateStartedFunc func( + LotSizes []uint64, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchCreated( - success tBTCSystemCreatedFunc, +func (tbtcs *TBTCSystem) WatchLotSizesUpdateStarted( + success tBTCSystemLotSizesUpdateStartedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, - _keepAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -6952,11 +6959,9 @@ func (tbtcs *TBTCSystem) WatchCreated( return err } - subscription, err := tbtcs.subscribeCreated( + subscription, err := tbtcs.subscribeLotSizesUpdateStarted( success, failCallback, - _depositContractAddressFilter, - _keepAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -6976,7 +6981,7 @@ func (tbtcs *TBTCSystem) WatchCreated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event Created terminated with error; " + + "subscription to event LotSizesUpdateStarted terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6997,23 +7002,19 @@ func (tbtcs *TBTCSystem) WatchCreated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeCreated( - success tBTCSystemCreatedFunc, +func (tbtcs *TBTCSystem) subscribeLotSizesUpdateStarted( + success tBTCSystemLotSizesUpdateStartedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, - _keepAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemCreated) - eventSubscription, err := tbtcs.contract.WatchCreated( + eventChan := make(chan *abi.TBTCSystemLotSizesUpdateStarted) + eventSubscription, err := tbtcs.contract.WatchLotSizesUpdateStarted( nil, eventChan, - _depositContractAddressFilter, - _keepAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for Created events: [%v]", + "error creating watch for LotSizesUpdateStarted events: [%v]", err, ) } @@ -7031,8 +7032,7 @@ func (tbtcs *TBTCSystem) subscribeCreated( return } success( - event.DepositContractAddress, - event.KeepAddress, + event.LotSizes, event.Timestamp, event.Raw.BlockNumber, ) @@ -7055,18 +7055,18 @@ func (tbtcs *TBTCSystem) subscribeCreated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemFundedFunc func( +type tBTCSystemRegisteredPubkeyFunc func( DepositContractAddress common.Address, - Txid [32]uint8, + SigningGroupPubkeyX [32]uint8, + SigningGroupPubkeyY [32]uint8, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchFunded( - success tBTCSystemFundedFunc, +func (tbtcs *TBTCSystem) WatchRegisteredPubkey( + success tBTCSystemRegisteredPubkeyFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -7083,11 +7083,10 @@ func (tbtcs *TBTCSystem) WatchFunded( return err } - subscription, err := tbtcs.subscribeFunded( + subscription, err := tbtcs.subscribeRegisteredPubkey( success, failCallback, _depositContractAddressFilter, - _txidFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -7107,7 +7106,7 @@ func (tbtcs *TBTCSystem) WatchFunded( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event Funded terminated with error; " + + "subscription to event RegisteredPubkey terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7128,23 +7127,21 @@ func (tbtcs *TBTCSystem) WatchFunded( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeFunded( - success tBTCSystemFundedFunc, +func (tbtcs *TBTCSystem) subscribeRegisteredPubkey( + success tBTCSystemRegisteredPubkeyFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemFunded) - eventSubscription, err := tbtcs.contract.WatchFunded( + eventChan := make(chan *abi.TBTCSystemRegisteredPubkey) + eventSubscription, err := tbtcs.contract.WatchRegisteredPubkey( nil, eventChan, _depositContractAddressFilter, - _txidFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for Funded events: [%v]", + "error creating watch for RegisteredPubkey events: [%v]", err, ) } @@ -7163,7 +7160,8 @@ func (tbtcs *TBTCSystem) subscribeFunded( } success( event.DepositContractAddress, - event.Txid, + event.SigningGroupPubkeyX, + event.SigningGroupPubkeyY, event.Timestamp, event.Raw.BlockNumber, ) @@ -7186,20 +7184,16 @@ func (tbtcs *TBTCSystem) subscribeFunded( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemGotRedemptionSignatureFunc func( +type tBTCSystemSetupFailedFunc func( DepositContractAddress common.Address, - Digest [32]uint8, - R [32]uint8, - S [32]uint8, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchGotRedemptionSignature( - success tBTCSystemGotRedemptionSignatureFunc, +func (tbtcs *TBTCSystem) WatchSetupFailed( + success tBTCSystemSetupFailedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -7216,11 +7210,10 @@ func (tbtcs *TBTCSystem) WatchGotRedemptionSignature( return err } - subscription, err := tbtcs.subscribeGotRedemptionSignature( + subscription, err := tbtcs.subscribeSetupFailed( success, failCallback, _depositContractAddressFilter, - _digestFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -7240,7 +7233,7 @@ func (tbtcs *TBTCSystem) WatchGotRedemptionSignature( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event GotRedemptionSignature terminated with error; " + + "subscription to event SetupFailed terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7261,23 +7254,21 @@ func (tbtcs *TBTCSystem) WatchGotRedemptionSignature( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeGotRedemptionSignature( - success tBTCSystemGotRedemptionSignatureFunc, +func (tbtcs *TBTCSystem) subscribeSetupFailed( + success tBTCSystemSetupFailedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemGotRedemptionSignature) - eventSubscription, err := tbtcs.contract.WatchGotRedemptionSignature( + eventChan := make(chan *abi.TBTCSystemSetupFailed) + eventSubscription, err := tbtcs.contract.WatchSetupFailed( nil, eventChan, _depositContractAddressFilter, - _digestFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for GotRedemptionSignature events: [%v]", + "error creating watch for SetupFailed events: [%v]", err, ) } @@ -7296,9 +7287,6 @@ func (tbtcs *TBTCSystem) subscribeGotRedemptionSignature( } success( event.DepositContractAddress, - event.Digest, - event.R, - event.S, event.Timestamp, event.Raw.BlockNumber, ) @@ -7321,15 +7309,13 @@ func (tbtcs *TBTCSystem) subscribeGotRedemptionSignature( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemKeepFactoriesUpdatedFunc func( - KeepStakedFactory common.Address, - FullyBackedFactory common.Address, - FactorySelector common.Address, +type tBTCSystemEthBtcPriceFeedAddedFunc func( + PriceFeed common.Address, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdated( - success tBTCSystemKeepFactoriesUpdatedFunc, +func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdded( + success tBTCSystemEthBtcPriceFeedAddedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { errorChan := make(chan error) @@ -7347,7 +7333,7 @@ func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdated( return err } - subscription, err := tbtcs.subscribeKeepFactoriesUpdated( + subscription, err := tbtcs.subscribeEthBtcPriceFeedAdded( success, failCallback, ) @@ -7369,7 +7355,7 @@ func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event KeepFactoriesUpdated terminated with error; " + + "subscription to event EthBtcPriceFeedAdded terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7390,19 +7376,19 @@ func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdated( - success tBTCSystemKeepFactoriesUpdatedFunc, +func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdded( + success tBTCSystemEthBtcPriceFeedAddedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemKeepFactoriesUpdated) - eventSubscription, err := tbtcs.contract.WatchKeepFactoriesUpdated( + eventChan := make(chan *abi.TBTCSystemEthBtcPriceFeedAdded) + eventSubscription, err := tbtcs.contract.WatchEthBtcPriceFeedAdded( nil, eventChan, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for KeepFactoriesUpdated events: [%v]", + "error creating watch for EthBtcPriceFeedAdded events: [%v]", err, ) } @@ -7420,9 +7406,7 @@ func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdated( return } success( - event.KeepStakedFactory, - event.FullyBackedFactory, - event.FactorySelector, + event.PriceFeed, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -7444,17 +7428,15 @@ func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemStartedLiquidationFunc func( - DepositContractAddress common.Address, - WasFraud bool, +type tBTCSystemEthBtcPriceFeedAdditionStartedFunc func( + PriceFeed common.Address, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchStartedLiquidation( - success tBTCSystemStartedLiquidationFunc, +func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdditionStarted( + success tBTCSystemEthBtcPriceFeedAdditionStartedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -7471,10 +7453,9 @@ func (tbtcs *TBTCSystem) WatchStartedLiquidation( return err } - subscription, err := tbtcs.subscribeStartedLiquidation( + subscription, err := tbtcs.subscribeEthBtcPriceFeedAdditionStarted( success, failCallback, - _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -7494,7 +7475,7 @@ func (tbtcs *TBTCSystem) WatchStartedLiquidation( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event StartedLiquidation terminated with error; " + + "subscription to event EthBtcPriceFeedAdditionStarted terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7515,21 +7496,19 @@ func (tbtcs *TBTCSystem) WatchStartedLiquidation( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeStartedLiquidation( - success tBTCSystemStartedLiquidationFunc, +func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdditionStarted( + success tBTCSystemEthBtcPriceFeedAdditionStartedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemStartedLiquidation) - eventSubscription, err := tbtcs.contract.WatchStartedLiquidation( + eventChan := make(chan *abi.TBTCSystemEthBtcPriceFeedAdditionStarted) + eventSubscription, err := tbtcs.contract.WatchEthBtcPriceFeedAdditionStarted( nil, eventChan, - _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for StartedLiquidation events: [%v]", + "error creating watch for EthBtcPriceFeedAdditionStarted events: [%v]", err, ) } @@ -7547,8 +7526,7 @@ func (tbtcs *TBTCSystem) subscribeStartedLiquidation( return } success( - event.DepositContractAddress, - event.WasFraud, + event.PriceFeed, event.Timestamp, event.Raw.BlockNumber, ) @@ -7571,17 +7549,16 @@ func (tbtcs *TBTCSystem) subscribeStartedLiquidation( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemCollateralizationThresholdsUpdateStartedFunc func( - InitialCollateralizedPercent uint16, - UndercollateralizedThresholdPercent uint16, - SeverelyUndercollateralizedThresholdPercent uint16, +type tBTCSystemExitedCourtesyCallFunc func( + DepositContractAddress common.Address, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdateStarted( - success tBTCSystemCollateralizationThresholdsUpdateStartedFunc, +func (tbtcs *TBTCSystem) WatchExitedCourtesyCall( + success tBTCSystemExitedCourtesyCallFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -7598,9 +7575,10 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdateStarted( return err } - subscription, err := tbtcs.subscribeCollateralizationThresholdsUpdateStarted( + subscription, err := tbtcs.subscribeExitedCourtesyCall( success, failCallback, + _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -7620,7 +7598,7 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdateStarted( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event CollateralizationThresholdsUpdateStarted terminated with error; " + + "subscription to event ExitedCourtesyCall terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7641,19 +7619,21 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdateStarted( - success tBTCSystemCollateralizationThresholdsUpdateStartedFunc, +func (tbtcs *TBTCSystem) subscribeExitedCourtesyCall( + success tBTCSystemExitedCourtesyCallFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemCollateralizationThresholdsUpdateStarted) - eventSubscription, err := tbtcs.contract.WatchCollateralizationThresholdsUpdateStarted( + eventChan := make(chan *abi.TBTCSystemExitedCourtesyCall) + eventSubscription, err := tbtcs.contract.WatchExitedCourtesyCall( nil, eventChan, + _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for CollateralizationThresholdsUpdateStarted events: [%v]", + "error creating watch for ExitedCourtesyCall events: [%v]", err, ) } @@ -7671,9 +7651,7 @@ func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdateStarted( return } success( - event.InitialCollateralizedPercent, - event.UndercollateralizedThresholdPercent, - event.SeverelyUndercollateralizedThresholdPercent, + event.DepositContractAddress, event.Timestamp, event.Raw.BlockNumber, ) @@ -7696,13 +7674,16 @@ func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemEthBtcPriceFeedAddedFunc func( - PriceFeed common.Address, +type tBTCSystemKeepFactoriesUpdateStartedFunc func( + KeepStakedFactory common.Address, + FullyBackedFactory common.Address, + FactorySelector common.Address, + Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdded( - success tBTCSystemEthBtcPriceFeedAddedFunc, +func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdateStarted( + success tBTCSystemKeepFactoriesUpdateStartedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { errorChan := make(chan error) @@ -7720,7 +7701,7 @@ func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdded( return err } - subscription, err := tbtcs.subscribeEthBtcPriceFeedAdded( + subscription, err := tbtcs.subscribeKeepFactoriesUpdateStarted( success, failCallback, ) @@ -7742,7 +7723,7 @@ func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdded( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event EthBtcPriceFeedAdded terminated with error; " + + "subscription to event KeepFactoriesUpdateStarted terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7763,19 +7744,19 @@ func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdded( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdded( - success tBTCSystemEthBtcPriceFeedAddedFunc, +func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdateStarted( + success tBTCSystemKeepFactoriesUpdateStartedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemEthBtcPriceFeedAdded) - eventSubscription, err := tbtcs.contract.WatchEthBtcPriceFeedAdded( + eventChan := make(chan *abi.TBTCSystemKeepFactoriesUpdateStarted) + eventSubscription, err := tbtcs.contract.WatchKeepFactoriesUpdateStarted( nil, eventChan, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for EthBtcPriceFeedAdded events: [%v]", + "error creating watch for KeepFactoriesUpdateStarted events: [%v]", err, ) } @@ -7793,7 +7774,10 @@ func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdded( return } success( - event.PriceFeed, + event.KeepStakedFactory, + event.FullyBackedFactory, + event.FactorySelector, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -7815,14 +7799,15 @@ func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdded( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemEthBtcPriceFeedAdditionStartedFunc func( - PriceFeed common.Address, - Timestamp *big.Int, +type tBTCSystemKeepFactoriesUpdatedFunc func( + KeepStakedFactory common.Address, + FullyBackedFactory common.Address, + FactorySelector common.Address, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdditionStarted( - success tBTCSystemEthBtcPriceFeedAdditionStartedFunc, +func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdated( + success tBTCSystemKeepFactoriesUpdatedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { errorChan := make(chan error) @@ -7840,7 +7825,7 @@ func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdditionStarted( return err } - subscription, err := tbtcs.subscribeEthBtcPriceFeedAdditionStarted( + subscription, err := tbtcs.subscribeKeepFactoriesUpdated( success, failCallback, ) @@ -7862,7 +7847,7 @@ func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdditionStarted( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event EthBtcPriceFeedAdditionStarted terminated with error; " + + "subscription to event KeepFactoriesUpdated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7883,19 +7868,19 @@ func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdditionStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdditionStarted( - success tBTCSystemEthBtcPriceFeedAdditionStartedFunc, +func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdated( + success tBTCSystemKeepFactoriesUpdatedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemEthBtcPriceFeedAdditionStarted) - eventSubscription, err := tbtcs.contract.WatchEthBtcPriceFeedAdditionStarted( + eventChan := make(chan *abi.TBTCSystemKeepFactoriesUpdated) + eventSubscription, err := tbtcs.contract.WatchKeepFactoriesUpdated( nil, eventChan, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for EthBtcPriceFeedAdditionStarted events: [%v]", + "error creating watch for KeepFactoriesUpdated events: [%v]", err, ) } @@ -7913,8 +7898,9 @@ func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdditionStarted( return } success( - event.PriceFeed, - event.Timestamp, + event.KeepStakedFactory, + event.FullyBackedFactory, + event.FactorySelector, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -7936,14 +7922,14 @@ func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdditionStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemFunderAbortRequestedFunc func( +type tBTCSystemLiquidatedFunc func( DepositContractAddress common.Address, - AbortOutputScript []uint8, + Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchFunderAbortRequested( - success tBTCSystemFunderAbortRequestedFunc, +func (tbtcs *TBTCSystem) WatchLiquidated( + success tBTCSystemLiquidatedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { @@ -7962,7 +7948,7 @@ func (tbtcs *TBTCSystem) WatchFunderAbortRequested( return err } - subscription, err := tbtcs.subscribeFunderAbortRequested( + subscription, err := tbtcs.subscribeLiquidated( success, failCallback, _depositContractAddressFilter, @@ -7985,7 +7971,7 @@ func (tbtcs *TBTCSystem) WatchFunderAbortRequested( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event FunderAbortRequested terminated with error; " + + "subscription to event Liquidated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -8006,13 +7992,13 @@ func (tbtcs *TBTCSystem) WatchFunderAbortRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeFunderAbortRequested( - success tBTCSystemFunderAbortRequestedFunc, +func (tbtcs *TBTCSystem) subscribeLiquidated( + success tBTCSystemLiquidatedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemFunderAbortRequested) - eventSubscription, err := tbtcs.contract.WatchFunderAbortRequested( + eventChan := make(chan *abi.TBTCSystemLiquidated) + eventSubscription, err := tbtcs.contract.WatchLiquidated( nil, eventChan, _depositContractAddressFilter, @@ -8020,7 +8006,7 @@ func (tbtcs *TBTCSystem) subscribeFunderAbortRequested( if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for FunderAbortRequested events: [%v]", + "error creating watch for Liquidated events: [%v]", err, ) } @@ -8039,7 +8025,7 @@ func (tbtcs *TBTCSystem) subscribeFunderAbortRequested( } success( event.DepositContractAddress, - event.AbortOutputScript, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -8061,17 +8047,23 @@ func (tbtcs *TBTCSystem) subscribeFunderAbortRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemOwnershipTransferredFunc func( - PreviousOwner common.Address, - NewOwner common.Address, +type tBTCSystemRedemptionRequestedFunc func( + DepositContractAddress common.Address, + Requester common.Address, + Digest [32]uint8, + UtxoValue *big.Int, + RedeemerOutputScript []uint8, + RequestedFee *big.Int, + Outpoint []uint8, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchOwnershipTransferred( - success tBTCSystemOwnershipTransferredFunc, +func (tbtcs *TBTCSystem) WatchRedemptionRequested( + success tBTCSystemRedemptionRequestedFunc, fail func(err error) error, - previousOwnerFilter []common.Address, - newOwnerFilter []common.Address, + _depositContractAddressFilter []common.Address, + _requesterFilter []common.Address, + _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -8088,11 +8080,12 @@ func (tbtcs *TBTCSystem) WatchOwnershipTransferred( return err } - subscription, err := tbtcs.subscribeOwnershipTransferred( + subscription, err := tbtcs.subscribeRedemptionRequested( success, failCallback, - previousOwnerFilter, - newOwnerFilter, + _depositContractAddressFilter, + _requesterFilter, + _digestFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -8112,7 +8105,7 @@ func (tbtcs *TBTCSystem) WatchOwnershipTransferred( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event OwnershipTransferred terminated with error; " + + "subscription to event RedemptionRequested terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -8133,23 +8126,25 @@ func (tbtcs *TBTCSystem) WatchOwnershipTransferred( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeOwnershipTransferred( - success tBTCSystemOwnershipTransferredFunc, +func (tbtcs *TBTCSystem) subscribeRedemptionRequested( + success tBTCSystemRedemptionRequestedFunc, fail func(err error) error, - previousOwnerFilter []common.Address, - newOwnerFilter []common.Address, + _depositContractAddressFilter []common.Address, + _requesterFilter []common.Address, + _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemOwnershipTransferred) - eventSubscription, err := tbtcs.contract.WatchOwnershipTransferred( + eventChan := make(chan *abi.TBTCSystemRedemptionRequested) + eventSubscription, err := tbtcs.contract.WatchRedemptionRequested( nil, eventChan, - previousOwnerFilter, - newOwnerFilter, + _depositContractAddressFilter, + _requesterFilter, + _digestFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for OwnershipTransferred events: [%v]", + "error creating watch for RedemptionRequested events: [%v]", err, ) } @@ -8167,8 +8162,13 @@ func (tbtcs *TBTCSystem) subscribeOwnershipTransferred( return } success( - event.PreviousOwner, - event.NewOwner, + event.DepositContractAddress, + event.Requester, + event.Digest, + event.UtxoValue, + event.RedeemerOutputScript, + event.RequestedFee, + event.Outpoint, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -8190,13 +8190,13 @@ func (tbtcs *TBTCSystem) subscribeOwnershipTransferred( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemAllowNewDepositsUpdatedFunc func( - AllowNewDeposits bool, +type tBTCSystemSignerFeeDivisorUpdatedFunc func( + SignerFeeDivisor uint16, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchAllowNewDepositsUpdated( - success tBTCSystemAllowNewDepositsUpdatedFunc, +func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdated( + success tBTCSystemSignerFeeDivisorUpdatedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { errorChan := make(chan error) @@ -8214,7 +8214,7 @@ func (tbtcs *TBTCSystem) WatchAllowNewDepositsUpdated( return err } - subscription, err := tbtcs.subscribeAllowNewDepositsUpdated( + subscription, err := tbtcs.subscribeSignerFeeDivisorUpdated( success, failCallback, ) @@ -8236,7 +8236,7 @@ func (tbtcs *TBTCSystem) WatchAllowNewDepositsUpdated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event AllowNewDepositsUpdated terminated with error; " + + "subscription to event SignerFeeDivisorUpdated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -8257,19 +8257,19 @@ func (tbtcs *TBTCSystem) WatchAllowNewDepositsUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeAllowNewDepositsUpdated( - success tBTCSystemAllowNewDepositsUpdatedFunc, +func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdated( + success tBTCSystemSignerFeeDivisorUpdatedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemAllowNewDepositsUpdated) - eventSubscription, err := tbtcs.contract.WatchAllowNewDepositsUpdated( + eventChan := make(chan *abi.TBTCSystemSignerFeeDivisorUpdated) + eventSubscription, err := tbtcs.contract.WatchSignerFeeDivisorUpdated( nil, eventChan, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for AllowNewDepositsUpdated events: [%v]", + "error creating watch for SignerFeeDivisorUpdated events: [%v]", err, ) } @@ -8287,7 +8287,7 @@ func (tbtcs *TBTCSystem) subscribeAllowNewDepositsUpdated( return } success( - event.AllowNewDeposits, + event.SignerFeeDivisor, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() diff --git a/pkg/chain/ethereum/gen/gen.go b/pkg/chain/ethereum/gen/gen.go index 1db66cb5d..c0db2dd19 100644 --- a/pkg/chain/ethereum/gen/gen.go +++ b/pkg/chain/ethereum/gen/gen.go @@ -1,3 +1,3 @@ package gen -//go:generate sh -c "SOLIDITY_DIR=../solidity SOLIDITY_FILES='deposit/Deposit.sol system/TBTCSystem.sol' make" +//go:generate sh -c "SOLIDITY_DIR=../../../../solidity SOLIDITY_FILES='deposit/Deposit.sol system/TBTCSystem.sol' make" From 3db1a2ab52a2f24766ef62ae702ace6324d234a4 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Mon, 19 Oct 2020 13:28:48 +0200 Subject: [PATCH 11/14] Move mod.go to the project root --- pkg/chain/ethereum/gen/go.mod => go.mod | 2 +- pkg/chain/ethereum/gen/go.sum => go.sum | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename pkg/chain/ethereum/gen/go.mod => go.mod (86%) rename pkg/chain/ethereum/gen/go.sum => go.sum (100%) diff --git a/pkg/chain/ethereum/gen/go.mod b/go.mod similarity index 86% rename from pkg/chain/ethereum/gen/go.mod rename to go.mod index 7e54794fb..bf7242836 100644 --- a/pkg/chain/ethereum/gen/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/keep-network/tbtc/go +module github.com/keep-network/tbtc go 1.13 diff --git a/pkg/chain/ethereum/gen/go.sum b/go.sum similarity index 100% rename from pkg/chain/ethereum/gen/go.sum rename to go.sum From 4337c22f085fd6713e3f9dafcadcb8f05c5df231 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Mon, 19 Oct 2020 13:29:58 +0200 Subject: [PATCH 12/14] Regenerate bindings after moving go.mod --- pkg/chain/ethereum/gen/cmd/Deposit.go | 380 +-- pkg/chain/ethereum/gen/cmd/TBTCSystem.go | 598 ++-- pkg/chain/ethereum/gen/contract/Deposit.go | 1760 +++++------ pkg/chain/ethereum/gen/contract/TBTCSystem.go | 2694 ++++++++--------- 4 files changed, 2716 insertions(+), 2716 deletions(-) diff --git a/pkg/chain/ethereum/gen/cmd/Deposit.go b/pkg/chain/ethereum/gen/cmd/Deposit.go index 1f5308119..81d90584f 100644 --- a/pkg/chain/ethereum/gen/cmd/Deposit.go +++ b/pkg/chain/ethereum/gen/cmd/Deposit.go @@ -16,7 +16,7 @@ import ( "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" "github.com/keep-network/keep-common/pkg/cmd" "github.com/keep-network/keep-core/config" - "github.com/keep-network/tbtc/go/contract" + "github.com/keep-network/tbtc/pkg/chain/ethereum/gen/contract" "github.com/urfave/cli" ) @@ -52,10 +52,10 @@ func init() { Usage: `Provides access to the Deposit contract.`, Description: depositDescription, Subcommands: []cli.Command{{ - Name: "severely-undercollateralized-threshold-percent", - Usage: "Calls the constant method severelyUndercollateralizedThresholdPercent on the Deposit contract.", + Name: "remaining-term", + Usage: "Calls the constant method remainingTerm on the Deposit contract.", ArgsUsage: "", - Action: dSeverelyUndercollateralizedThresholdPercent, + Action: dRemainingTerm, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { @@ -66,94 +66,80 @@ func init() { Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "current-state", - Usage: "Calls the constant method currentState on the Deposit contract.", - ArgsUsage: "", - Action: dCurrentState, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "keep-address", - Usage: "Calls the constant method keepAddress on the Deposit contract.", + Name: "in-active", + Usage: "Calls the constant method inActive on the Deposit contract.", ArgsUsage: "", - Action: dKeepAddress, + Action: dInActive, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "undercollateralized-threshold-percent", - Usage: "Calls the constant method undercollateralizedThresholdPercent on the Deposit contract.", + Name: "funding-info", + Usage: "Calls the constant method fundingInfo on the Deposit contract.", ArgsUsage: "", - Action: dUndercollateralizedThresholdPercent, + Action: dFundingInfo, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "withdrawable-amount", - Usage: "Calls the constant method withdrawableAmount on the Deposit contract.", + Name: "auction-value", + Usage: "Calls the constant method auctionValue on the Deposit contract.", ArgsUsage: "", - Action: dWithdrawableAmount, + Action: dAuctionValue, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "collateralization-percentage", - Usage: "Calls the constant method collateralizationPercentage on the Deposit contract.", + Name: "lot-size-tbtc", + Usage: "Calls the constant method lotSizeTbtc on the Deposit contract.", ArgsUsage: "", - Action: dCollateralizationPercentage, + Action: dLotSizeTbtc, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "funding-info", - Usage: "Calls the constant method fundingInfo on the Deposit contract.", + Name: "severely-undercollateralized-threshold-percent", + Usage: "Calls the constant method severelyUndercollateralizedThresholdPercent on the Deposit contract.", ArgsUsage: "", - Action: dFundingInfo, + Action: dSeverelyUndercollateralizedThresholdPercent, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "auction-value", - Usage: "Calls the constant method auctionValue on the Deposit contract.", + Name: "initial-collateralized-percent", + Usage: "Calls the constant method initialCollateralizedPercent on the Deposit contract.", ArgsUsage: "", - Action: dAuctionValue, + Action: dInitialCollateralizedPercent, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "signer-fee-tbtc", - Usage: "Calls the constant method signerFeeTbtc on the Deposit contract.", + Name: "keep-address", + Usage: "Calls the constant method keepAddress on the Deposit contract.", ArgsUsage: "", - Action: dSignerFeeTbtc, + Action: dKeepAddress, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-owner-redemption-tbtc-requirement", - Usage: "Calls the constant method getOwnerRedemptionTbtcRequirement on the Deposit contract.", - ArgsUsage: "[_redeemer] ", - Action: dGetOwnerRedemptionTbtcRequirement, - Before: cmd.ArgCountChecker(1), - Flags: cmd.ConstFlags, - }, { - Name: "initial-collateralized-percent", - Usage: "Calls the constant method initialCollateralizedPercent on the Deposit contract.", + Name: "collateralization-percentage", + Usage: "Calls the constant method collateralizationPercentage on the Deposit contract.", ArgsUsage: "", - Action: dInitialCollateralizedPercent, + Action: dCollateralizationPercentage, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "remaining-term", - Usage: "Calls the constant method remainingTerm on the Deposit contract.", + Name: "signer-fee-tbtc", + Usage: "Calls the constant method signerFeeTbtc on the Deposit contract.", ArgsUsage: "", - Action: dRemainingTerm, + Action: dSignerFeeTbtc, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "in-active", - Usage: "Calls the constant method inActive on the Deposit contract.", + Name: "undercollateralized-threshold-percent", + Usage: "Calls the constant method undercollateralizedThresholdPercent on the Deposit contract.", ArgsUsage: "", - Action: dInActive, + Action: dUndercollateralizedThresholdPercent, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "lot-size-tbtc", - Usage: "Calls the constant method lotSizeTbtc on the Deposit contract.", + Name: "withdrawable-amount", + Usage: "Calls the constant method withdrawableAmount on the Deposit contract.", ArgsUsage: "", - Action: dLotSizeTbtc, + Action: dWithdrawableAmount, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { @@ -171,38 +157,38 @@ func init() { Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "exit-courtesy-call", - Usage: "Calls the method exitCourtesyCall on the Deposit contract.", + Name: "current-state", + Usage: "Calls the constant method currentState on the Deposit contract.", ArgsUsage: "", - Action: dExitCourtesyCall, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, + Action: dCurrentState, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, }, { - Name: "notify-funding-timed-out", - Usage: "Calls the method notifyFundingTimedOut on the Deposit contract.", - ArgsUsage: "", - Action: dNotifyFundingTimedOut, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, + Name: "get-owner-redemption-tbtc-requirement", + Usage: "Calls the constant method getOwnerRedemptionTbtcRequirement on the Deposit contract.", + ArgsUsage: "[_redeemer] ", + Action: dGetOwnerRedemptionTbtcRequirement, + Before: cmd.ArgCountChecker(1), + Flags: cmd.ConstFlags, }, { - Name: "notify-undercollateralized-liquidation", - Usage: "Calls the method notifyUndercollateralizedLiquidation on the Deposit contract.", + Name: "notify-redemption-proof-timed-out", + Usage: "Calls the method notifyRedemptionProofTimedOut on the Deposit contract.", ArgsUsage: "", - Action: dNotifyUndercollateralizedLiquidation, + Action: dNotifyRedemptionProofTimedOut, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "notify-redemption-proof-timed-out", - Usage: "Calls the method notifyRedemptionProofTimedOut on the Deposit contract.", + Name: "purchase-signer-bonds-at-auction", + Usage: "Calls the method purchaseSignerBondsAtAuction on the Deposit contract.", ArgsUsage: "", - Action: dNotifyRedemptionProofTimedOut, + Action: dPurchaseSignerBondsAtAuction, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "notify-signer-setup-failed", - Usage: "Calls the method notifySignerSetupFailed on the Deposit contract.", + Name: "notify-courtesy-call", + Usage: "Calls the method notifyCourtesyCall on the Deposit contract.", ArgsUsage: "", - Action: dNotifySignerSetupFailed, + Action: dNotifyCourtesyCall, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { @@ -212,6 +198,20 @@ func init() { Action: dRequestFunderAbort, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), Flags: cmd.NonConstFlags, + }, { + Name: "retrieve-signer-pubkey", + Usage: "Calls the method retrieveSignerPubkey on the Deposit contract.", + ArgsUsage: "", + Action: dRetrieveSignerPubkey, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "exit-courtesy-call", + Usage: "Calls the method exitCourtesyCall on the Deposit contract.", + ArgsUsage: "", + Action: dExitCourtesyCall, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, }, { Name: "notify-courtesy-call-expired", Usage: "Calls the method notifyCourtesyCallExpired on the Deposit contract.", @@ -220,26 +220,19 @@ func init() { Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "purchase-signer-bonds-at-auction", - Usage: "Calls the method purchaseSignerBondsAtAuction on the Deposit contract.", + Name: "notify-funding-timed-out", + Usage: "Calls the method notifyFundingTimedOut on the Deposit contract.", ArgsUsage: "", - Action: dPurchaseSignerBondsAtAuction, + Action: dNotifyFundingTimedOut, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "retrieve-signer-pubkey", - Usage: "Calls the method retrieveSignerPubkey on the Deposit contract.", + Name: "notify-undercollateralized-liquidation", + Usage: "Calls the method notifyUndercollateralizedLiquidation on the Deposit contract.", ArgsUsage: "", - Action: dRetrieveSignerPubkey, + Action: dNotifyUndercollateralizedLiquidation, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, - }, { - Name: "initialize", - Usage: "Calls the method initialize on the Deposit contract.", - ArgsUsage: "[_factory] ", - Action: dInitialize, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), - Flags: cmd.NonConstFlags, }, { Name: "notify-redemption-signature-timed-out", Usage: "Calls the method notifyRedemptionSignatureTimedOut on the Deposit contract.", @@ -248,10 +241,17 @@ func init() { Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "notify-courtesy-call", - Usage: "Calls the method notifyCourtesyCall on the Deposit contract.", + Name: "initialize", + Usage: "Calls the method initialize on the Deposit contract.", + ArgsUsage: "[_factory] ", + Action: dInitialize, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), + Flags: cmd.NonConstFlags, + }, { + Name: "notify-signer-setup-failed", + Usage: "Calls the method notifySignerSetupFailed on the Deposit contract.", ArgsUsage: "", - Action: dNotifyCourtesyCall, + Action: dNotifySignerSetupFailed, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { @@ -267,13 +267,13 @@ func init() { /// ------------------- Const methods ------------------- -func dSeverelyUndercollateralizedThresholdPercent(c *cli.Context) error { +func dRemainingTerm(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.SeverelyUndercollateralizedThresholdPercentAtBlock( + result, err := contract.RemainingTermAtBlock( cmd.BlockFlagValue.Uint, ) @@ -307,13 +307,13 @@ func dLotSizeSatoshis(c *cli.Context) error { return nil } -func dCurrentState(c *cli.Context) error { +func dInActive(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.CurrentStateAtBlock( + result, err := contract.InActiveAtBlock( cmd.BlockFlagValue.Uint, ) @@ -327,13 +327,13 @@ func dCurrentState(c *cli.Context) error { return nil } -func dKeepAddress(c *cli.Context) error { +func dFundingInfo(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.KeepAddressAtBlock( + result, err := contract.FundingInfoAtBlock( cmd.BlockFlagValue.Uint, ) @@ -347,13 +347,13 @@ func dKeepAddress(c *cli.Context) error { return nil } -func dUndercollateralizedThresholdPercent(c *cli.Context) error { +func dAuctionValue(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.UndercollateralizedThresholdPercentAtBlock( + result, err := contract.AuctionValueAtBlock( cmd.BlockFlagValue.Uint, ) @@ -367,13 +367,13 @@ func dUndercollateralizedThresholdPercent(c *cli.Context) error { return nil } -func dWithdrawableAmount(c *cli.Context) error { +func dLotSizeTbtc(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.WithdrawableAmountAtBlock( + result, err := contract.LotSizeTbtcAtBlock( cmd.BlockFlagValue.Uint, ) @@ -387,13 +387,13 @@ func dWithdrawableAmount(c *cli.Context) error { return nil } -func dCollateralizationPercentage(c *cli.Context) error { +func dSeverelyUndercollateralizedThresholdPercent(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.CollateralizationPercentageAtBlock( + result, err := contract.SeverelyUndercollateralizedThresholdPercentAtBlock( cmd.BlockFlagValue.Uint, ) @@ -407,13 +407,13 @@ func dCollateralizationPercentage(c *cli.Context) error { return nil } -func dFundingInfo(c *cli.Context) error { +func dInitialCollateralizedPercent(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.FundingInfoAtBlock( + result, err := contract.InitialCollateralizedPercentAtBlock( cmd.BlockFlagValue.Uint, ) @@ -427,13 +427,13 @@ func dFundingInfo(c *cli.Context) error { return nil } -func dAuctionValue(c *cli.Context) error { +func dKeepAddress(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.AuctionValueAtBlock( + result, err := contract.KeepAddressAtBlock( cmd.BlockFlagValue.Uint, ) @@ -447,13 +447,13 @@ func dAuctionValue(c *cli.Context) error { return nil } -func dSignerFeeTbtc(c *cli.Context) error { +func dCollateralizationPercentage(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.SignerFeeTbtcAtBlock( + result, err := contract.CollateralizationPercentageAtBlock( cmd.BlockFlagValue.Uint, ) @@ -467,21 +467,13 @@ func dSignerFeeTbtc(c *cli.Context) error { return nil } -func dGetOwnerRedemptionTbtcRequirement(c *cli.Context) error { +func dSignerFeeTbtc(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - _redeemer, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _redeemer, a address, from passed value %v", - c.Args()[0], - ) - } - result, err := contract.GetOwnerRedemptionTbtcRequirementAtBlock( - _redeemer, + result, err := contract.SignerFeeTbtcAtBlock( cmd.BlockFlagValue.Uint, ) @@ -495,13 +487,13 @@ func dGetOwnerRedemptionTbtcRequirement(c *cli.Context) error { return nil } -func dInitialCollateralizedPercent(c *cli.Context) error { +func dUndercollateralizedThresholdPercent(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.InitialCollateralizedPercentAtBlock( + result, err := contract.UndercollateralizedThresholdPercentAtBlock( cmd.BlockFlagValue.Uint, ) @@ -515,13 +507,13 @@ func dInitialCollateralizedPercent(c *cli.Context) error { return nil } -func dRemainingTerm(c *cli.Context) error { +func dWithdrawableAmount(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.RemainingTermAtBlock( + result, err := contract.WithdrawableAmountAtBlock( cmd.BlockFlagValue.Uint, ) @@ -535,13 +527,21 @@ func dRemainingTerm(c *cli.Context) error { return nil } -func dInActive(c *cli.Context) error { +func dGetRedemptionTbtcRequirement(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } + _redeemer, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _redeemer, a address, from passed value %v", + c.Args()[0], + ) + } - result, err := contract.InActiveAtBlock( + result, err := contract.GetRedemptionTbtcRequirementAtBlock( + _redeemer, cmd.BlockFlagValue.Uint, ) @@ -555,13 +555,13 @@ func dInActive(c *cli.Context) error { return nil } -func dLotSizeTbtc(c *cli.Context) error { +func dUtxoValue(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - result, err := contract.LotSizeTbtcAtBlock( + result, err := contract.UtxoValueAtBlock( cmd.BlockFlagValue.Uint, ) @@ -575,21 +575,13 @@ func dLotSizeTbtc(c *cli.Context) error { return nil } -func dGetRedemptionTbtcRequirement(c *cli.Context) error { +func dCurrentState(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - _redeemer, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _redeemer, a address, from passed value %v", - c.Args()[0], - ) - } - result, err := contract.GetRedemptionTbtcRequirementAtBlock( - _redeemer, + result, err := contract.CurrentStateAtBlock( cmd.BlockFlagValue.Uint, ) @@ -603,13 +595,21 @@ func dGetRedemptionTbtcRequirement(c *cli.Context) error { return nil } -func dUtxoValue(c *cli.Context) error { +func dGetOwnerRedemptionTbtcRequirement(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } + _redeemer, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _redeemer, a address, from passed value %v", + c.Args()[0], + ) + } - result, err := contract.UtxoValueAtBlock( + result, err := contract.GetOwnerRedemptionTbtcRequirementAtBlock( + _redeemer, cmd.BlockFlagValue.Uint, ) @@ -625,7 +625,7 @@ func dUtxoValue(c *cli.Context) error { /// ------------------- Non-const methods ------------------- -func dExitCourtesyCall(c *cli.Context) error { +func dNotifyRedemptionProofTimedOut(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -637,7 +637,7 @@ func dExitCourtesyCall(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.ExitCourtesyCall() + transaction, err = contract.NotifyRedemptionProofTimedOut() if err != nil { return err } @@ -645,7 +645,7 @@ func dExitCourtesyCall(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallExitCourtesyCall( + err = contract.CallNotifyRedemptionProofTimedOut( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -658,7 +658,7 @@ func dExitCourtesyCall(c *cli.Context) error { return nil } -func dNotifyFundingTimedOut(c *cli.Context) error { +func dPurchaseSignerBondsAtAuction(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -670,7 +670,7 @@ func dNotifyFundingTimedOut(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyFundingTimedOut() + transaction, err = contract.PurchaseSignerBondsAtAuction() if err != nil { return err } @@ -678,7 +678,7 @@ func dNotifyFundingTimedOut(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyFundingTimedOut( + err = contract.CallPurchaseSignerBondsAtAuction( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -691,7 +691,7 @@ func dNotifyFundingTimedOut(c *cli.Context) error { return nil } -func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { +func dNotifyCourtesyCall(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -703,7 +703,7 @@ func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyUndercollateralizedLiquidation() + transaction, err = contract.NotifyCourtesyCall() if err != nil { return err } @@ -711,7 +711,7 @@ func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyUndercollateralizedLiquidation( + err = contract.CallNotifyCourtesyCall( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -724,19 +724,29 @@ func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { return nil } -func dNotifyRedemptionProofTimedOut(c *cli.Context) error { +func dRequestFunderAbort(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } + _abortOutputScript, err := hexutil.Decode(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _abortOutputScript, a bytes, from passed value %v", + c.Args()[0], + ) + } + var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyRedemptionProofTimedOut() + transaction, err = contract.RequestFunderAbort( + _abortOutputScript, + ) if err != nil { return err } @@ -744,7 +754,8 @@ func dNotifyRedemptionProofTimedOut(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyRedemptionProofTimedOut( + err = contract.CallRequestFunderAbort( + _abortOutputScript, cmd.BlockFlagValue.Uint, ) if err != nil { @@ -757,7 +768,7 @@ func dNotifyRedemptionProofTimedOut(c *cli.Context) error { return nil } -func dNotifySignerSetupFailed(c *cli.Context) error { +func dRetrieveSignerPubkey(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -769,7 +780,7 @@ func dNotifySignerSetupFailed(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifySignerSetupFailed() + transaction, err = contract.RetrieveSignerPubkey() if err != nil { return err } @@ -777,7 +788,7 @@ func dNotifySignerSetupFailed(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifySignerSetupFailed( + err = contract.CallRetrieveSignerPubkey( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -790,29 +801,19 @@ func dNotifySignerSetupFailed(c *cli.Context) error { return nil } -func dRequestFunderAbort(c *cli.Context) error { +func dExitCourtesyCall(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - _abortOutputScript, err := hexutil.Decode(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _abortOutputScript, a bytes, from passed value %v", - c.Args()[0], - ) - } - var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.RequestFunderAbort( - _abortOutputScript, - ) + transaction, err = contract.ExitCourtesyCall() if err != nil { return err } @@ -820,8 +821,7 @@ func dRequestFunderAbort(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallRequestFunderAbort( - _abortOutputScript, + err = contract.CallExitCourtesyCall( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -867,7 +867,7 @@ func dNotifyCourtesyCallExpired(c *cli.Context) error { return nil } -func dPurchaseSignerBondsAtAuction(c *cli.Context) error { +func dNotifyFundingTimedOut(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -879,7 +879,7 @@ func dPurchaseSignerBondsAtAuction(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.PurchaseSignerBondsAtAuction() + transaction, err = contract.NotifyFundingTimedOut() if err != nil { return err } @@ -887,7 +887,7 @@ func dPurchaseSignerBondsAtAuction(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallPurchaseSignerBondsAtAuction( + err = contract.CallNotifyFundingTimedOut( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -900,7 +900,7 @@ func dPurchaseSignerBondsAtAuction(c *cli.Context) error { return nil } -func dRetrieveSignerPubkey(c *cli.Context) error { +func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -912,7 +912,7 @@ func dRetrieveSignerPubkey(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.RetrieveSignerPubkey() + transaction, err = contract.NotifyUndercollateralizedLiquidation() if err != nil { return err } @@ -920,7 +920,7 @@ func dRetrieveSignerPubkey(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallRetrieveSignerPubkey( + err = contract.CallNotifyUndercollateralizedLiquidation( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -933,29 +933,19 @@ func dRetrieveSignerPubkey(c *cli.Context) error { return nil } -func dInitialize(c *cli.Context) error { +func dNotifyRedemptionSignatureTimedOut(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } - _factory, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _factory, a address, from passed value %v", - c.Args()[0], - ) - } - var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.Initialize( - _factory, - ) + transaction, err = contract.NotifyRedemptionSignatureTimedOut() if err != nil { return err } @@ -963,8 +953,7 @@ func dInitialize(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallInitialize( - _factory, + err = contract.CallNotifyRedemptionSignatureTimedOut( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -977,19 +966,29 @@ func dInitialize(c *cli.Context) error { return nil } -func dNotifyRedemptionSignatureTimedOut(c *cli.Context) error { +func dInitialize(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err } + _factory, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _factory, a address, from passed value %v", + c.Args()[0], + ) + } + var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyRedemptionSignatureTimedOut() + transaction, err = contract.Initialize( + _factory, + ) if err != nil { return err } @@ -997,7 +996,8 @@ func dNotifyRedemptionSignatureTimedOut(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyRedemptionSignatureTimedOut( + err = contract.CallInitialize( + _factory, cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1010,7 +1010,7 @@ func dNotifyRedemptionSignatureTimedOut(c *cli.Context) error { return nil } -func dNotifyCourtesyCall(c *cli.Context) error { +func dNotifySignerSetupFailed(c *cli.Context) error { contract, err := initializeDeposit(c) if err != nil { return err @@ -1022,7 +1022,7 @@ func dNotifyCourtesyCall(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyCourtesyCall() + transaction, err = contract.NotifySignerSetupFailed() if err != nil { return err } @@ -1030,7 +1030,7 @@ func dNotifyCourtesyCall(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallNotifyCourtesyCall( + err = contract.CallNotifySignerSetupFailed( cmd.BlockFlagValue.Uint, ) if err != nil { diff --git a/pkg/chain/ethereum/gen/cmd/TBTCSystem.go b/pkg/chain/ethereum/gen/cmd/TBTCSystem.go index 5706566c1..1531217e9 100644 --- a/pkg/chain/ethereum/gen/cmd/TBTCSystem.go +++ b/pkg/chain/ethereum/gen/cmd/TBTCSystem.go @@ -16,7 +16,7 @@ import ( "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" "github.com/keep-network/keep-common/pkg/cmd" "github.com/keep-network/keep-core/config" - "github.com/keep-network/tbtc/go/contract" + "github.com/keep-network/tbtc/pkg/chain/ethereum/gen/contract" "github.com/urfave/cli" ) @@ -73,17 +73,31 @@ func init() { Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "fetch-relay-previous-difficulty", - Usage: "Calls the constant method fetchRelayPreviousDifficulty on the TBTCSystem contract.", + Name: "relay", + Usage: "Calls the constant method relay on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsFetchRelayPreviousDifficulty, + Action: tbtcsRelay, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-price-feed-governance-time-delay", - Usage: "Calls the constant method getPriceFeedGovernanceTimeDelay on the TBTCSystem contract.", + Name: "get-maximum-lot-size", + Usage: "Calls the constant method getMaximumLotSize on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetPriceFeedGovernanceTimeDelay, + Action: tbtcsGetMaximumLotSize, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "get-minimum-lot-size", + Usage: "Calls the constant method getMinimumLotSize on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsGetMinimumLotSize, + Before: cmd.ArgCountChecker(0), + Flags: cmd.ConstFlags, + }, { + Name: "is-owner", + Usage: "Calls the constant method isOwner on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsIsOwner, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { @@ -94,87 +108,87 @@ func init() { Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-remaining-keep-factories-upgradeability-time", - Usage: "Calls the constant method getRemainingKeepFactoriesUpgradeabilityTime on the TBTCSystem contract.", + Name: "fetch-relay-previous-difficulty", + Usage: "Calls the constant method fetchRelayPreviousDifficulty on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetRemainingKeepFactoriesUpgradeabilityTime, + Action: tbtcsFetchRelayPreviousDifficulty, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-keep-factories-upgradeability-period", - Usage: "Calls the constant method getKeepFactoriesUpgradeabilityPeriod on the TBTCSystem contract.", + Name: "fetch-bitcoin-price", + Usage: "Calls the constant method fetchBitcoinPrice on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetKeepFactoriesUpgradeabilityPeriod, + Action: tbtcsFetchBitcoinPrice, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-maximum-lot-size", - Usage: "Calls the constant method getMaximumLotSize on the TBTCSystem contract.", + Name: "get-remaining-lot-sizes-update-time", + Usage: "Calls the constant method getRemainingLotSizesUpdateTime on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetMaximumLotSize, + Action: tbtcsGetRemainingLotSizesUpdateTime, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-remaining-keep-factories-update-time", - Usage: "Calls the constant method getRemainingKeepFactoriesUpdateTime on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsGetRemainingKeepFactoriesUpdateTime, - Before: cmd.ArgCountChecker(0), + Name: "approved-to-log", + Usage: "Calls the constant method approvedToLog on the TBTCSystem contract.", + ArgsUsage: "[_caller] ", + Action: tbtcsApprovedToLog, + Before: cmd.ArgCountChecker(1), Flags: cmd.ConstFlags, }, { - Name: "get-severely-undercollateralized-threshold-percent", - Usage: "Calls the constant method getSeverelyUndercollateralizedThresholdPercent on the TBTCSystem contract.", + Name: "get-allow-new-deposits", + Usage: "Calls the constant method getAllowNewDeposits on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetSeverelyUndercollateralizedThresholdPercent, + Action: tbtcsGetAllowNewDeposits, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-allowed-lot-sizes", - Usage: "Calls the constant method getAllowedLotSizes on the TBTCSystem contract.", + Name: "keep-threshold", + Usage: "Calls the constant method keepThreshold on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetAllowedLotSizes, + Action: tbtcsKeepThreshold, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-remaining-lot-sizes-update-time", - Usage: "Calls the constant method getRemainingLotSizesUpdateTime on the TBTCSystem contract.", + Name: "get-undercollateralized-threshold-percent", + Usage: "Calls the constant method getUndercollateralizedThresholdPercent on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetRemainingLotSizesUpdateTime, + Action: tbtcsGetUndercollateralizedThresholdPercent, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-governance-time-delay", - Usage: "Calls the constant method getGovernanceTimeDelay on the TBTCSystem contract.", + Name: "get-remaining-keep-factories-upgradeability-time", + Usage: "Calls the constant method getRemainingKeepFactoriesUpgradeabilityTime on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetGovernanceTimeDelay, + Action: tbtcsGetRemainingKeepFactoriesUpgradeabilityTime, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-signer-fee-divisor", - Usage: "Calls the constant method getSignerFeeDivisor on the TBTCSystem contract.", + Name: "get-keep-factories-upgradeability-period", + Usage: "Calls the constant method getKeepFactoriesUpgradeabilityPeriod on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetSignerFeeDivisor, + Action: tbtcsGetKeepFactoriesUpgradeabilityPeriod, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "relay", - Usage: "Calls the constant method relay on the TBTCSystem contract.", + Name: "get-initial-collateralized-percent", + Usage: "Calls the constant method getInitialCollateralizedPercent on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsRelay, + Action: tbtcsGetInitialCollateralizedPercent, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-remaining-collateralization-thresholds-update-time", - Usage: "Calls the constant method getRemainingCollateralizationThresholdsUpdateTime on the TBTCSystem contract.", + Name: "get-remaining-keep-factories-update-time", + Usage: "Calls the constant method getRemainingKeepFactoriesUpdateTime on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetRemainingCollateralizationThresholdsUpdateTime, + Action: tbtcsGetRemainingKeepFactoriesUpdateTime, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-allow-new-deposits", - Usage: "Calls the constant method getAllowNewDeposits on the TBTCSystem contract.", + Name: "get-governance-time-delay", + Usage: "Calls the constant method getGovernanceTimeDelay on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetAllowNewDeposits, + Action: tbtcsGetGovernanceTimeDelay, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { @@ -185,45 +199,45 @@ func init() { Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "is-owner", - Usage: "Calls the constant method isOwner on the TBTCSystem contract.", + Name: "get-remaining-collateralization-thresholds-update-time", + Usage: "Calls the constant method getRemainingCollateralizationThresholdsUpdateTime on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsIsOwner, + Action: tbtcsGetRemainingCollateralizationThresholdsUpdateTime, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-undercollateralized-threshold-percent", - Usage: "Calls the constant method getUndercollateralizedThresholdPercent on the TBTCSystem contract.", + Name: "get-price-feed-governance-time-delay", + Usage: "Calls the constant method getPriceFeedGovernanceTimeDelay on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetUndercollateralizedThresholdPercent, + Action: tbtcsGetPriceFeedGovernanceTimeDelay, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "keep-threshold", - Usage: "Calls the constant method keepThreshold on the TBTCSystem contract.", + Name: "fetch-relay-current-difficulty", + Usage: "Calls the constant method fetchRelayCurrentDifficulty on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsKeepThreshold, + Action: tbtcsFetchRelayCurrentDifficulty, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "approved-to-log", - Usage: "Calls the constant method approvedToLog on the TBTCSystem contract.", - ArgsUsage: "[_caller] ", - Action: tbtcsApprovedToLog, - Before: cmd.ArgCountChecker(1), + Name: "get-allowed-lot-sizes", + Usage: "Calls the constant method getAllowedLotSizes on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsGetAllowedLotSizes, + Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-minimum-lot-size", - Usage: "Calls the constant method getMinimumLotSize on the TBTCSystem contract.", + Name: "get-severely-undercollateralized-threshold-percent", + Usage: "Calls the constant method getSeverelyUndercollateralizedThresholdPercent on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetMinimumLotSize, + Action: tbtcsGetSeverelyUndercollateralizedThresholdPercent, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "get-initial-collateralized-percent", - Usage: "Calls the constant method getInitialCollateralizedPercent on the TBTCSystem contract.", + Name: "get-signer-fee-divisor", + Usage: "Calls the constant method getSignerFeeDivisor on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsGetInitialCollateralizedPercent, + Action: tbtcsGetSignerFeeDivisor, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { @@ -233,20 +247,6 @@ func init() { Action: tbtcsGetRemainingEthBtcPriceFeedAdditionTime, Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, - }, { - Name: "fetch-bitcoin-price", - Usage: "Calls the constant method fetchBitcoinPrice on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsFetchBitcoinPrice, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "fetch-relay-current-difficulty", - Usage: "Calls the constant method fetchRelayCurrentDifficulty on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsFetchRelayCurrentDifficulty, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, }, { Name: "keep-size", Usage: "Calls the constant method keepSize on the TBTCSystem contract.", @@ -255,18 +255,18 @@ func init() { Before: cmd.ArgCountChecker(0), Flags: cmd.ConstFlags, }, { - Name: "refresh-minimum-bondable-value", - Usage: "Calls the method refreshMinimumBondableValue on the TBTCSystem contract.", + Name: "finalize-keep-factories-update", + Usage: "Calls the method finalizeKeepFactoriesUpdate on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsRefreshMinimumBondableValue, + Action: tbtcsFinalizeKeepFactoriesUpdate, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "resume-new-deposits", - Usage: "Calls the method resumeNewDeposits on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsResumeNewDeposits, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Name: "begin-keep-factories-update", + Usage: "Calls the method beginKeepFactoriesUpdate on the TBTCSystem contract.", + ArgsUsage: "[_keepStakedFactory] [_fullyBackedFactory] [_factorySelector] ", + Action: tbtcsBeginKeepFactoriesUpdate, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(3))), Flags: cmd.NonConstFlags, }, { Name: "emergency-pause-new-deposits", @@ -276,45 +276,38 @@ func init() { Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "begin-keep-factories-update", - Usage: "Calls the method beginKeepFactoriesUpdate on the TBTCSystem contract.", - ArgsUsage: "[_keepStakedFactory] [_fullyBackedFactory] [_factorySelector] ", - Action: tbtcsBeginKeepFactoriesUpdate, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(3))), - Flags: cmd.NonConstFlags, - }, { - Name: "log-created", - Usage: "Calls the method logCreated on the TBTCSystem contract.", - ArgsUsage: "[_keepAddress] ", - Action: tbtcsLogCreated, + Name: "begin-eth-btc-price-feed-addition", + Usage: "Calls the method beginEthBtcPriceFeedAddition on the TBTCSystem contract.", + ArgsUsage: "[_ethBtcPriceFeed] ", + Action: tbtcsBeginEthBtcPriceFeedAddition, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), Flags: cmd.NonConstFlags, }, { - Name: "finalize-eth-btc-price-feed-addition", - Usage: "Calls the method finalizeEthBtcPriceFeedAddition on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsFinalizeEthBtcPriceFeedAddition, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Name: "transfer-ownership", + Usage: "Calls the method transferOwnership on the TBTCSystem contract.", + ArgsUsage: "[newOwner] ", + Action: tbtcsTransferOwnership, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), Flags: cmd.NonConstFlags, }, { - Name: "finalize-keep-factories-update", - Usage: "Calls the method finalizeKeepFactoriesUpdate on the TBTCSystem contract.", + Name: "finalize-signer-fee-divisor-update", + Usage: "Calls the method finalizeSignerFeeDivisorUpdate on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsFinalizeKeepFactoriesUpdate, + Action: tbtcsFinalizeSignerFeeDivisorUpdate, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "finalize-lot-sizes-update", - Usage: "Calls the method finalizeLotSizesUpdate on the TBTCSystem contract.", + Name: "resume-new-deposits", + Usage: "Calls the method resumeNewDeposits on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsFinalizeLotSizesUpdate, + Action: tbtcsResumeNewDeposits, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "log-courtesy-called", - Usage: "Calls the method logCourtesyCalled on the TBTCSystem contract.", + Name: "refresh-minimum-bondable-value", + Usage: "Calls the method refreshMinimumBondableValue on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsLogCourtesyCalled, + Action: tbtcsRefreshMinimumBondableValue, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { @@ -325,31 +318,24 @@ func init() { Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "finalize-signer-fee-divisor-update", - Usage: "Calls the method finalizeSignerFeeDivisorUpdate on the TBTCSystem contract.", + Name: "finalize-collateralization-thresholds-update", + Usage: "Calls the method finalizeCollateralizationThresholdsUpdate on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsFinalizeSignerFeeDivisorUpdate, + Action: tbtcsFinalizeCollateralizationThresholdsUpdate, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "log-exited-courtesy-call", - Usage: "Calls the method logExitedCourtesyCall on the TBTCSystem contract.", + Name: "finalize-lot-sizes-update", + Usage: "Calls the method finalizeLotSizesUpdate on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsLogExitedCourtesyCall, + Action: tbtcsFinalizeLotSizesUpdate, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "begin-eth-btc-price-feed-addition", - Usage: "Calls the method beginEthBtcPriceFeedAddition on the TBTCSystem contract.", - ArgsUsage: "[_ethBtcPriceFeed] ", - Action: tbtcsBeginEthBtcPriceFeedAddition, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), - Flags: cmd.NonConstFlags, - }, { - Name: "log-setup-failed", - Usage: "Calls the method logSetupFailed on the TBTCSystem contract.", + Name: "log-courtesy-called", + Usage: "Calls the method logCourtesyCalled on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsLogSetupFailed, + Action: tbtcsLogCourtesyCalled, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { @@ -360,10 +346,10 @@ func init() { Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), Flags: cmd.NonConstFlags, }, { - Name: "log-liquidated", - Usage: "Calls the method logLiquidated on the TBTCSystem contract.", + Name: "log-setup-failed", + Usage: "Calls the method logSetupFailed on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsLogLiquidated, + Action: tbtcsLogSetupFailed, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { @@ -374,19 +360,33 @@ func init() { Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "transfer-ownership", - Usage: "Calls the method transferOwnership on the TBTCSystem contract.", - ArgsUsage: "[newOwner] ", - Action: tbtcsTransferOwnership, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), + Name: "log-liquidated", + Usage: "Calls the method logLiquidated on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsLogLiquidated, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, }, { - Name: "finalize-collateralization-thresholds-update", - Usage: "Calls the method finalizeCollateralizationThresholdsUpdate on the TBTCSystem contract.", + Name: "log-exited-courtesy-call", + Usage: "Calls the method logExitedCourtesyCall on the TBTCSystem contract.", ArgsUsage: "", - Action: tbtcsFinalizeCollateralizationThresholdsUpdate, + Action: tbtcsLogExitedCourtesyCall, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), + Flags: cmd.NonConstFlags, + }, { + Name: "finalize-eth-btc-price-feed-addition", + Usage: "Calls the method finalizeEthBtcPriceFeedAddition on the TBTCSystem contract.", + ArgsUsage: "", + Action: tbtcsFinalizeEthBtcPriceFeedAddition, Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), Flags: cmd.NonConstFlags, + }, { + Name: "log-created", + Usage: "Calls the method logCreated on the TBTCSystem contract.", + ArgsUsage: "[_keepAddress] ", + Action: tbtcsLogCreated, + Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), + Flags: cmd.NonConstFlags, }}, }) } @@ -453,13 +453,13 @@ func tbtcsGetRemainingSignerFeeDivisorUpdateTime(c *cli.Context) error { return nil } -func tbtcsFetchRelayPreviousDifficulty(c *cli.Context) error { +func tbtcsRelay(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.FetchRelayPreviousDifficultyAtBlock( + result, err := contract.RelayAtBlock( cmd.BlockFlagValue.Uint, ) @@ -473,13 +473,13 @@ func tbtcsFetchRelayPreviousDifficulty(c *cli.Context) error { return nil } -func tbtcsGetPriceFeedGovernanceTimeDelay(c *cli.Context) error { +func tbtcsGetMaximumLotSize(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetPriceFeedGovernanceTimeDelayAtBlock( + result, err := contract.GetMaximumLotSizeAtBlock( cmd.BlockFlagValue.Uint, ) @@ -493,13 +493,13 @@ func tbtcsGetPriceFeedGovernanceTimeDelay(c *cli.Context) error { return nil } -func tbtcsOwner(c *cli.Context) error { +func tbtcsGetMinimumLotSize(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.OwnerAtBlock( + result, err := contract.GetMinimumLotSizeAtBlock( cmd.BlockFlagValue.Uint, ) @@ -513,13 +513,13 @@ func tbtcsOwner(c *cli.Context) error { return nil } -func tbtcsGetRemainingKeepFactoriesUpgradeabilityTime(c *cli.Context) error { +func tbtcsIsOwner(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetRemainingKeepFactoriesUpgradeabilityTimeAtBlock( + result, err := contract.IsOwnerAtBlock( cmd.BlockFlagValue.Uint, ) @@ -533,13 +533,13 @@ func tbtcsGetRemainingKeepFactoriesUpgradeabilityTime(c *cli.Context) error { return nil } -func tbtcsGetKeepFactoriesUpgradeabilityPeriod(c *cli.Context) error { +func tbtcsOwner(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetKeepFactoriesUpgradeabilityPeriodAtBlock( + result, err := contract.OwnerAtBlock( cmd.BlockFlagValue.Uint, ) @@ -553,13 +553,13 @@ func tbtcsGetKeepFactoriesUpgradeabilityPeriod(c *cli.Context) error { return nil } -func tbtcsGetMaximumLotSize(c *cli.Context) error { +func tbtcsFetchRelayPreviousDifficulty(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetMaximumLotSizeAtBlock( + result, err := contract.FetchRelayPreviousDifficultyAtBlock( cmd.BlockFlagValue.Uint, ) @@ -573,13 +573,13 @@ func tbtcsGetMaximumLotSize(c *cli.Context) error { return nil } -func tbtcsGetRemainingKeepFactoriesUpdateTime(c *cli.Context) error { +func tbtcsFetchBitcoinPrice(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetRemainingKeepFactoriesUpdateTimeAtBlock( + result, err := contract.FetchBitcoinPriceAtBlock( cmd.BlockFlagValue.Uint, ) @@ -593,13 +593,13 @@ func tbtcsGetRemainingKeepFactoriesUpdateTime(c *cli.Context) error { return nil } -func tbtcsGetSeverelyUndercollateralizedThresholdPercent(c *cli.Context) error { +func tbtcsGetRemainingLotSizesUpdateTime(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetSeverelyUndercollateralizedThresholdPercentAtBlock( + result, err := contract.GetRemainingLotSizesUpdateTimeAtBlock( cmd.BlockFlagValue.Uint, ) @@ -613,13 +613,21 @@ func tbtcsGetSeverelyUndercollateralizedThresholdPercent(c *cli.Context) error { return nil } -func tbtcsGetAllowedLotSizes(c *cli.Context) error { +func tbtcsApprovedToLog(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } + _caller, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _caller, a address, from passed value %v", + c.Args()[0], + ) + } - result, err := contract.GetAllowedLotSizesAtBlock( + result, err := contract.ApprovedToLogAtBlock( + _caller, cmd.BlockFlagValue.Uint, ) @@ -633,13 +641,13 @@ func tbtcsGetAllowedLotSizes(c *cli.Context) error { return nil } -func tbtcsGetRemainingLotSizesUpdateTime(c *cli.Context) error { +func tbtcsGetAllowNewDeposits(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetRemainingLotSizesUpdateTimeAtBlock( + result, err := contract.GetAllowNewDepositsAtBlock( cmd.BlockFlagValue.Uint, ) @@ -653,13 +661,13 @@ func tbtcsGetRemainingLotSizesUpdateTime(c *cli.Context) error { return nil } -func tbtcsGetGovernanceTimeDelay(c *cli.Context) error { +func tbtcsKeepThreshold(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetGovernanceTimeDelayAtBlock( + result, err := contract.KeepThresholdAtBlock( cmd.BlockFlagValue.Uint, ) @@ -673,13 +681,13 @@ func tbtcsGetGovernanceTimeDelay(c *cli.Context) error { return nil } -func tbtcsGetSignerFeeDivisor(c *cli.Context) error { +func tbtcsGetUndercollateralizedThresholdPercent(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetSignerFeeDivisorAtBlock( + result, err := contract.GetUndercollateralizedThresholdPercentAtBlock( cmd.BlockFlagValue.Uint, ) @@ -693,13 +701,13 @@ func tbtcsGetSignerFeeDivisor(c *cli.Context) error { return nil } -func tbtcsRelay(c *cli.Context) error { +func tbtcsGetRemainingKeepFactoriesUpgradeabilityTime(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.RelayAtBlock( + result, err := contract.GetRemainingKeepFactoriesUpgradeabilityTimeAtBlock( cmd.BlockFlagValue.Uint, ) @@ -713,13 +721,13 @@ func tbtcsRelay(c *cli.Context) error { return nil } -func tbtcsGetRemainingCollateralizationThresholdsUpdateTime(c *cli.Context) error { +func tbtcsGetKeepFactoriesUpgradeabilityPeriod(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetRemainingCollateralizationThresholdsUpdateTimeAtBlock( + result, err := contract.GetKeepFactoriesUpgradeabilityPeriodAtBlock( cmd.BlockFlagValue.Uint, ) @@ -733,13 +741,13 @@ func tbtcsGetRemainingCollateralizationThresholdsUpdateTime(c *cli.Context) erro return nil } -func tbtcsGetAllowNewDeposits(c *cli.Context) error { +func tbtcsGetInitialCollateralizedPercent(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetAllowNewDepositsAtBlock( + result, err := contract.GetInitialCollateralizedPercentAtBlock( cmd.BlockFlagValue.Uint, ) @@ -753,13 +761,13 @@ func tbtcsGetAllowNewDeposits(c *cli.Context) error { return nil } -func tbtcsGetNewDepositFeeEstimate(c *cli.Context) error { +func tbtcsGetRemainingKeepFactoriesUpdateTime(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetNewDepositFeeEstimateAtBlock( + result, err := contract.GetRemainingKeepFactoriesUpdateTimeAtBlock( cmd.BlockFlagValue.Uint, ) @@ -773,13 +781,13 @@ func tbtcsGetNewDepositFeeEstimate(c *cli.Context) error { return nil } -func tbtcsIsOwner(c *cli.Context) error { +func tbtcsGetGovernanceTimeDelay(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.IsOwnerAtBlock( + result, err := contract.GetGovernanceTimeDelayAtBlock( cmd.BlockFlagValue.Uint, ) @@ -793,13 +801,13 @@ func tbtcsIsOwner(c *cli.Context) error { return nil } -func tbtcsGetUndercollateralizedThresholdPercent(c *cli.Context) error { +func tbtcsGetNewDepositFeeEstimate(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetUndercollateralizedThresholdPercentAtBlock( + result, err := contract.GetNewDepositFeeEstimateAtBlock( cmd.BlockFlagValue.Uint, ) @@ -813,13 +821,13 @@ func tbtcsGetUndercollateralizedThresholdPercent(c *cli.Context) error { return nil } -func tbtcsKeepThreshold(c *cli.Context) error { +func tbtcsGetRemainingCollateralizationThresholdsUpdateTime(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.KeepThresholdAtBlock( + result, err := contract.GetRemainingCollateralizationThresholdsUpdateTimeAtBlock( cmd.BlockFlagValue.Uint, ) @@ -833,21 +841,13 @@ func tbtcsKeepThreshold(c *cli.Context) error { return nil } -func tbtcsApprovedToLog(c *cli.Context) error { +func tbtcsGetPriceFeedGovernanceTimeDelay(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - _caller, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _caller, a address, from passed value %v", - c.Args()[0], - ) - } - result, err := contract.ApprovedToLogAtBlock( - _caller, + result, err := contract.GetPriceFeedGovernanceTimeDelayAtBlock( cmd.BlockFlagValue.Uint, ) @@ -861,13 +861,13 @@ func tbtcsApprovedToLog(c *cli.Context) error { return nil } -func tbtcsGetMinimumLotSize(c *cli.Context) error { +func tbtcsFetchRelayCurrentDifficulty(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetMinimumLotSizeAtBlock( + result, err := contract.FetchRelayCurrentDifficultyAtBlock( cmd.BlockFlagValue.Uint, ) @@ -881,13 +881,13 @@ func tbtcsGetMinimumLotSize(c *cli.Context) error { return nil } -func tbtcsGetInitialCollateralizedPercent(c *cli.Context) error { +func tbtcsGetAllowedLotSizes(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetInitialCollateralizedPercentAtBlock( + result, err := contract.GetAllowedLotSizesAtBlock( cmd.BlockFlagValue.Uint, ) @@ -901,13 +901,13 @@ func tbtcsGetInitialCollateralizedPercent(c *cli.Context) error { return nil } -func tbtcsGetRemainingEthBtcPriceFeedAdditionTime(c *cli.Context) error { +func tbtcsGetSeverelyUndercollateralizedThresholdPercent(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.GetRemainingEthBtcPriceFeedAdditionTimeAtBlock( + result, err := contract.GetSeverelyUndercollateralizedThresholdPercentAtBlock( cmd.BlockFlagValue.Uint, ) @@ -921,13 +921,13 @@ func tbtcsGetRemainingEthBtcPriceFeedAdditionTime(c *cli.Context) error { return nil } -func tbtcsFetchBitcoinPrice(c *cli.Context) error { +func tbtcsGetSignerFeeDivisor(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.FetchBitcoinPriceAtBlock( + result, err := contract.GetSignerFeeDivisorAtBlock( cmd.BlockFlagValue.Uint, ) @@ -941,13 +941,13 @@ func tbtcsFetchBitcoinPrice(c *cli.Context) error { return nil } -func tbtcsFetchRelayCurrentDifficulty(c *cli.Context) error { +func tbtcsGetRemainingEthBtcPriceFeedAdditionTime(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - result, err := contract.FetchRelayCurrentDifficultyAtBlock( + result, err := contract.GetRemainingEthBtcPriceFeedAdditionTimeAtBlock( cmd.BlockFlagValue.Uint, ) @@ -983,7 +983,7 @@ func tbtcsKeepSize(c *cli.Context) error { /// ------------------- Non-const methods ------------------- -func tbtcsRefreshMinimumBondableValue(c *cli.Context) error { +func tbtcsFinalizeKeepFactoriesUpdate(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err @@ -995,7 +995,7 @@ func tbtcsRefreshMinimumBondableValue(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.RefreshMinimumBondableValue() + transaction, err = contract.FinalizeKeepFactoriesUpdate() if err != nil { return err } @@ -1003,7 +1003,7 @@ func tbtcsRefreshMinimumBondableValue(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallRefreshMinimumBondableValue( + err = contract.CallFinalizeKeepFactoriesUpdate( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1016,19 +1016,47 @@ func tbtcsRefreshMinimumBondableValue(c *cli.Context) error { return nil } -func tbtcsResumeNewDeposits(c *cli.Context) error { +func tbtcsBeginKeepFactoriesUpdate(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } + _keepStakedFactory, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _keepStakedFactory, a address, from passed value %v", + c.Args()[0], + ) + } + + _fullyBackedFactory, err := ethutil.AddressFromHex(c.Args()[1]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _fullyBackedFactory, a address, from passed value %v", + c.Args()[1], + ) + } + + _factorySelector, err := ethutil.AddressFromHex(c.Args()[2]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _factorySelector, a address, from passed value %v", + c.Args()[2], + ) + } + var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.ResumeNewDeposits() + transaction, err = contract.BeginKeepFactoriesUpdate( + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, + ) if err != nil { return err } @@ -1036,7 +1064,10 @@ func tbtcsResumeNewDeposits(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallResumeNewDeposits( + err = contract.CallBeginKeepFactoriesUpdate( + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1082,46 +1113,28 @@ func tbtcsEmergencyPauseNewDeposits(c *cli.Context) error { return nil } -func tbtcsBeginKeepFactoriesUpdate(c *cli.Context) error { +func tbtcsBeginEthBtcPriceFeedAddition(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - _keepStakedFactory, err := ethutil.AddressFromHex(c.Args()[0]) + _ethBtcPriceFeed, err := ethutil.AddressFromHex(c.Args()[0]) if err != nil { return fmt.Errorf( - "couldn't parse parameter _keepStakedFactory, a address, from passed value %v", + "couldn't parse parameter _ethBtcPriceFeed, a address, from passed value %v", c.Args()[0], ) } - _fullyBackedFactory, err := ethutil.AddressFromHex(c.Args()[1]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _fullyBackedFactory, a address, from passed value %v", - c.Args()[1], - ) - } - - _factorySelector, err := ethutil.AddressFromHex(c.Args()[2]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _factorySelector, a address, from passed value %v", - c.Args()[2], - ) - } - var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.BeginKeepFactoriesUpdate( - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + transaction, err = contract.BeginEthBtcPriceFeedAddition( + _ethBtcPriceFeed, ) if err != nil { return err @@ -1130,10 +1143,8 @@ func tbtcsBeginKeepFactoriesUpdate(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallBeginKeepFactoriesUpdate( - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + err = contract.CallBeginEthBtcPriceFeedAddition( + _ethBtcPriceFeed, cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1146,16 +1157,16 @@ func tbtcsBeginKeepFactoriesUpdate(c *cli.Context) error { return nil } -func tbtcsLogCreated(c *cli.Context) error { +func tbtcsTransferOwnership(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - _keepAddress, err := ethutil.AddressFromHex(c.Args()[0]) + newOwner, err := ethutil.AddressFromHex(c.Args()[0]) if err != nil { return fmt.Errorf( - "couldn't parse parameter _keepAddress, a address, from passed value %v", + "couldn't parse parameter newOwner, a address, from passed value %v", c.Args()[0], ) } @@ -1166,8 +1177,8 @@ func tbtcsLogCreated(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogCreated( - _keepAddress, + transaction, err = contract.TransferOwnership( + newOwner, ) if err != nil { return err @@ -1176,8 +1187,8 @@ func tbtcsLogCreated(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogCreated( - _keepAddress, + err = contract.CallTransferOwnership( + newOwner, cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1190,7 +1201,7 @@ func tbtcsLogCreated(c *cli.Context) error { return nil } -func tbtcsFinalizeEthBtcPriceFeedAddition(c *cli.Context) error { +func tbtcsFinalizeSignerFeeDivisorUpdate(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err @@ -1202,7 +1213,7 @@ func tbtcsFinalizeEthBtcPriceFeedAddition(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.FinalizeEthBtcPriceFeedAddition() + transaction, err = contract.FinalizeSignerFeeDivisorUpdate() if err != nil { return err } @@ -1210,7 +1221,7 @@ func tbtcsFinalizeEthBtcPriceFeedAddition(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallFinalizeEthBtcPriceFeedAddition( + err = contract.CallFinalizeSignerFeeDivisorUpdate( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1223,7 +1234,7 @@ func tbtcsFinalizeEthBtcPriceFeedAddition(c *cli.Context) error { return nil } -func tbtcsFinalizeKeepFactoriesUpdate(c *cli.Context) error { +func tbtcsResumeNewDeposits(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err @@ -1235,7 +1246,7 @@ func tbtcsFinalizeKeepFactoriesUpdate(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.FinalizeKeepFactoriesUpdate() + transaction, err = contract.ResumeNewDeposits() if err != nil { return err } @@ -1243,7 +1254,7 @@ func tbtcsFinalizeKeepFactoriesUpdate(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallFinalizeKeepFactoriesUpdate( + err = contract.CallResumeNewDeposits( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1256,7 +1267,7 @@ func tbtcsFinalizeKeepFactoriesUpdate(c *cli.Context) error { return nil } -func tbtcsFinalizeLotSizesUpdate(c *cli.Context) error { +func tbtcsRefreshMinimumBondableValue(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err @@ -1268,7 +1279,7 @@ func tbtcsFinalizeLotSizesUpdate(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.FinalizeLotSizesUpdate() + transaction, err = contract.RefreshMinimumBondableValue() if err != nil { return err } @@ -1276,7 +1287,7 @@ func tbtcsFinalizeLotSizesUpdate(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallFinalizeLotSizesUpdate( + err = contract.CallRefreshMinimumBondableValue( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1289,7 +1300,7 @@ func tbtcsFinalizeLotSizesUpdate(c *cli.Context) error { return nil } -func tbtcsLogCourtesyCalled(c *cli.Context) error { +func tbtcsRenounceOwnership(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err @@ -1301,7 +1312,7 @@ func tbtcsLogCourtesyCalled(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogCourtesyCalled() + transaction, err = contract.RenounceOwnership() if err != nil { return err } @@ -1309,7 +1320,7 @@ func tbtcsLogCourtesyCalled(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogCourtesyCalled( + err = contract.CallRenounceOwnership( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1322,7 +1333,7 @@ func tbtcsLogCourtesyCalled(c *cli.Context) error { return nil } -func tbtcsRenounceOwnership(c *cli.Context) error { +func tbtcsFinalizeCollateralizationThresholdsUpdate(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err @@ -1334,7 +1345,7 @@ func tbtcsRenounceOwnership(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.RenounceOwnership() + transaction, err = contract.FinalizeCollateralizationThresholdsUpdate() if err != nil { return err } @@ -1342,7 +1353,7 @@ func tbtcsRenounceOwnership(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallRenounceOwnership( + err = contract.CallFinalizeCollateralizationThresholdsUpdate( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1355,7 +1366,7 @@ func tbtcsRenounceOwnership(c *cli.Context) error { return nil } -func tbtcsFinalizeSignerFeeDivisorUpdate(c *cli.Context) error { +func tbtcsFinalizeLotSizesUpdate(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err @@ -1367,7 +1378,7 @@ func tbtcsFinalizeSignerFeeDivisorUpdate(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.FinalizeSignerFeeDivisorUpdate() + transaction, err = contract.FinalizeLotSizesUpdate() if err != nil { return err } @@ -1375,7 +1386,7 @@ func tbtcsFinalizeSignerFeeDivisorUpdate(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallFinalizeSignerFeeDivisorUpdate( + err = contract.CallFinalizeLotSizesUpdate( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1388,7 +1399,7 @@ func tbtcsFinalizeSignerFeeDivisorUpdate(c *cli.Context) error { return nil } -func tbtcsLogExitedCourtesyCall(c *cli.Context) error { +func tbtcsLogCourtesyCalled(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err @@ -1400,7 +1411,7 @@ func tbtcsLogExitedCourtesyCall(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogExitedCourtesyCall() + transaction, err = contract.LogCourtesyCalled() if err != nil { return err } @@ -1408,7 +1419,7 @@ func tbtcsLogExitedCourtesyCall(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogExitedCourtesyCall( + err = contract.CallLogCourtesyCalled( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1421,16 +1432,16 @@ func tbtcsLogExitedCourtesyCall(c *cli.Context) error { return nil } -func tbtcsBeginEthBtcPriceFeedAddition(c *cli.Context) error { +func tbtcsLogFunderRequestedAbort(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - _ethBtcPriceFeed, err := ethutil.AddressFromHex(c.Args()[0]) + _abortOutputScript, err := hexutil.Decode(c.Args()[0]) if err != nil { return fmt.Errorf( - "couldn't parse parameter _ethBtcPriceFeed, a address, from passed value %v", + "couldn't parse parameter _abortOutputScript, a bytes, from passed value %v", c.Args()[0], ) } @@ -1441,8 +1452,8 @@ func tbtcsBeginEthBtcPriceFeedAddition(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.BeginEthBtcPriceFeedAddition( - _ethBtcPriceFeed, + transaction, err = contract.LogFunderRequestedAbort( + _abortOutputScript, ) if err != nil { return err @@ -1451,8 +1462,8 @@ func tbtcsBeginEthBtcPriceFeedAddition(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallBeginEthBtcPriceFeedAddition( - _ethBtcPriceFeed, + err = contract.CallLogFunderRequestedAbort( + _abortOutputScript, cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1498,29 +1509,19 @@ func tbtcsLogSetupFailed(c *cli.Context) error { return nil } -func tbtcsLogFunderRequestedAbort(c *cli.Context) error { +func tbtcsLogFraudDuringSetup(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - _abortOutputScript, err := hexutil.Decode(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _abortOutputScript, a bytes, from passed value %v", - c.Args()[0], - ) - } - var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogFunderRequestedAbort( - _abortOutputScript, - ) + transaction, err = contract.LogFraudDuringSetup() if err != nil { return err } @@ -1528,8 +1529,7 @@ func tbtcsLogFunderRequestedAbort(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogFunderRequestedAbort( - _abortOutputScript, + err = contract.CallLogFraudDuringSetup( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1575,7 +1575,7 @@ func tbtcsLogLiquidated(c *cli.Context) error { return nil } -func tbtcsLogFraudDuringSetup(c *cli.Context) error { +func tbtcsLogExitedCourtesyCall(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err @@ -1587,7 +1587,7 @@ func tbtcsLogFraudDuringSetup(c *cli.Context) error { if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.LogFraudDuringSetup() + transaction, err = contract.LogExitedCourtesyCall() if err != nil { return err } @@ -1595,7 +1595,7 @@ func tbtcsLogFraudDuringSetup(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallLogFraudDuringSetup( + err = contract.CallLogExitedCourtesyCall( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1608,29 +1608,19 @@ func tbtcsLogFraudDuringSetup(c *cli.Context) error { return nil } -func tbtcsTransferOwnership(c *cli.Context) error { +func tbtcsFinalizeEthBtcPriceFeedAddition(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } - newOwner, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter newOwner, a address, from passed value %v", - c.Args()[0], - ) - } - var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.TransferOwnership( - newOwner, - ) + transaction, err = contract.FinalizeEthBtcPriceFeedAddition() if err != nil { return err } @@ -1638,8 +1628,7 @@ func tbtcsTransferOwnership(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallTransferOwnership( - newOwner, + err = contract.CallFinalizeEthBtcPriceFeedAddition( cmd.BlockFlagValue.Uint, ) if err != nil { @@ -1652,19 +1641,29 @@ func tbtcsTransferOwnership(c *cli.Context) error { return nil } -func tbtcsFinalizeCollateralizationThresholdsUpdate(c *cli.Context) error { +func tbtcsLogCreated(c *cli.Context) error { contract, err := initializeTBTCSystem(c) if err != nil { return err } + _keepAddress, err := ethutil.AddressFromHex(c.Args()[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter _keepAddress, a address, from passed value %v", + c.Args()[0], + ) + } + var ( transaction *types.Transaction ) if c.Bool(cmd.SubmitFlag) { // Do a regular submission. Take payable into account. - transaction, err = contract.FinalizeCollateralizationThresholdsUpdate() + transaction, err = contract.LogCreated( + _keepAddress, + ) if err != nil { return err } @@ -1672,7 +1671,8 @@ func tbtcsFinalizeCollateralizationThresholdsUpdate(c *cli.Context) error { cmd.PrintOutput(transaction.Hash) } else { // Do a call. - err = contract.CallFinalizeCollateralizationThresholdsUpdate( + err = contract.CallLogCreated( + _keepAddress, cmd.BlockFlagValue.Uint, ) if err != nil { diff --git a/pkg/chain/ethereum/gen/contract/Deposit.go b/pkg/chain/ethereum/gen/contract/Deposit.go index b166b9885..d080cd83c 100644 --- a/pkg/chain/ethereum/gen/contract/Deposit.go +++ b/pkg/chain/ethereum/gen/contract/Deposit.go @@ -18,7 +18,7 @@ import ( "github.com/ipfs/go-log" "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" - abi "github.com/keep-network/tbtc/go/abi/deposit" + abi "github.com/keep-network/tbtc/pkg/chain/ethereum/gen/abi/deposit" ) // Create a package-level logger for this contract. The logger exists at @@ -92,12 +92,12 @@ func NewDeposit( // ----- Non-const Methods ------ // Transaction submission. -func (d *Deposit) ExitCourtesyCall( +func (d *Deposit) NotifyRedemptionProofTimedOut( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction exitCourtesyCall", + "submitting transaction notifyRedemptionProofTimedOut", ) d.transactionMutex.Lock() @@ -122,7 +122,7 @@ func (d *Deposit) ExitCourtesyCall( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ExitCourtesyCall( + transaction, err := d.contract.NotifyRedemptionProofTimedOut( transactorOptions, ) if err != nil { @@ -130,12 +130,12 @@ func (d *Deposit) ExitCourtesyCall( err, d.transactorOptions.From, nil, - "exitCourtesyCall", + "notifyRedemptionProofTimedOut", ) } dLogger.Infof( - "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -146,7 +146,7 @@ func (d *Deposit) ExitCourtesyCall( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ExitCourtesyCall( + transaction, err := d.contract.NotifyRedemptionProofTimedOut( transactorOptions, ) if err != nil { @@ -154,12 +154,12 @@ func (d *Deposit) ExitCourtesyCall( err, d.transactorOptions.From, nil, - "exitCourtesyCall", + "notifyRedemptionProofTimedOut", ) } dLogger.Infof( - "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -174,7 +174,7 @@ func (d *Deposit) ExitCourtesyCall( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallExitCourtesyCall( +func (d *Deposit) CallNotifyRedemptionProofTimedOut( blockNumber *big.Int, ) error { var result interface{} = nil @@ -186,20 +186,20 @@ func (d *Deposit) CallExitCourtesyCall( d.caller, d.errorResolver, d.contractAddress, - "exitCourtesyCall", + "notifyRedemptionProofTimedOut", &result, ) return err } -func (d *Deposit) ExitCourtesyCallGasEstimate() (uint64, error) { +func (d *Deposit) NotifyRedemptionProofTimedOutGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "exitCourtesyCall", + "notifyRedemptionProofTimedOut", d.contractABI, d.transactor, ) @@ -208,12 +208,12 @@ func (d *Deposit) ExitCourtesyCallGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) NotifyFundingTimedOut( +func (d *Deposit) PurchaseSignerBondsAtAuction( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyFundingTimedOut", + "submitting transaction purchaseSignerBondsAtAuction", ) d.transactionMutex.Lock() @@ -238,7 +238,7 @@ func (d *Deposit) NotifyFundingTimedOut( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyFundingTimedOut( + transaction, err := d.contract.PurchaseSignerBondsAtAuction( transactorOptions, ) if err != nil { @@ -246,12 +246,12 @@ func (d *Deposit) NotifyFundingTimedOut( err, d.transactorOptions.From, nil, - "notifyFundingTimedOut", + "purchaseSignerBondsAtAuction", ) } dLogger.Infof( - "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", + "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -262,7 +262,7 @@ func (d *Deposit) NotifyFundingTimedOut( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyFundingTimedOut( + transaction, err := d.contract.PurchaseSignerBondsAtAuction( transactorOptions, ) if err != nil { @@ -270,12 +270,12 @@ func (d *Deposit) NotifyFundingTimedOut( err, d.transactorOptions.From, nil, - "notifyFundingTimedOut", + "purchaseSignerBondsAtAuction", ) } dLogger.Infof( - "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", + "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -290,7 +290,7 @@ func (d *Deposit) NotifyFundingTimedOut( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyFundingTimedOut( +func (d *Deposit) CallPurchaseSignerBondsAtAuction( blockNumber *big.Int, ) error { var result interface{} = nil @@ -302,20 +302,20 @@ func (d *Deposit) CallNotifyFundingTimedOut( d.caller, d.errorResolver, d.contractAddress, - "notifyFundingTimedOut", + "purchaseSignerBondsAtAuction", &result, ) return err } -func (d *Deposit) NotifyFundingTimedOutGasEstimate() (uint64, error) { +func (d *Deposit) PurchaseSignerBondsAtAuctionGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyFundingTimedOut", + "purchaseSignerBondsAtAuction", d.contractABI, d.transactor, ) @@ -324,12 +324,25 @@ func (d *Deposit) NotifyFundingTimedOutGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) NotifyUndercollateralizedLiquidation( +func (d *Deposit) ProvideECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyUndercollateralizedLiquidation", + "submitting transaction provideECDSAFraudProof", + "params: ", + fmt.Sprint( + _v, + _r, + _s, + _signedDigest, + _preimage, + ), ) d.transactionMutex.Lock() @@ -354,20 +367,30 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyUndercollateralizedLiquidation( + transaction, err := d.contract.ProvideECDSAFraudProof( transactorOptions, + _v, + _r, + _s, + _signedDigest, + _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyUndercollateralizedLiquidation", + "provideECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, ) } dLogger.Infof( - "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -378,20 +401,30 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyUndercollateralizedLiquidation( + transaction, err := d.contract.ProvideECDSAFraudProof( transactorOptions, + _v, + _r, + _s, + _signedDigest, + _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyUndercollateralizedLiquidation", + "provideECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, ) } dLogger.Infof( - "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -406,7 +439,12 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyUndercollateralizedLiquidation( +func (d *Deposit) CallProvideECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -418,41 +456,67 @@ func (d *Deposit) CallNotifyUndercollateralizedLiquidation( d.caller, d.errorResolver, d.contractAddress, - "notifyUndercollateralizedLiquidation", + "provideECDSAFraudProof", &result, + _v, + _r, + _s, + _signedDigest, + _preimage, ) return err } -func (d *Deposit) NotifyUndercollateralizedLiquidationGasEstimate() (uint64, error) { +func (d *Deposit) ProvideECDSAFraudProofGasEstimate( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyUndercollateralizedLiquidation", + "provideECDSAFraudProof", d.contractABI, d.transactor, + _v, + _r, + _s, + _signedDigest, + _preimage, ) return result, err } // Transaction submission. -func (d *Deposit) RequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, +func (d *Deposit) InitializeDeposit( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, + value *big.Int, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction requestRedemption", + "submitting transaction initializeDeposit", "params: ", fmt.Sprint( - _outputValueBytes, - _redeemerOutputScript, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ), + "value: ", value, ) d.transactionMutex.Lock() @@ -462,6 +526,8 @@ func (d *Deposit) RequestRedemption( transactorOptions := new(bind.TransactOpts) *transactorOptions = *d.transactorOptions + transactorOptions.Value = value + if len(transactionOptions) > 1 { return nil, fmt.Errorf( "could not process multiple transaction options sets", @@ -477,24 +543,32 @@ func (d *Deposit) RequestRedemption( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.RequestRedemption( + transaction, err := d.contract.InitializeDeposit( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, - nil, - "requestRedemption", - _outputValueBytes, - _redeemerOutputScript, + value, + "initializeDeposit", + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) } dLogger.Infof( - "submitted transaction requestRedemption with id: [%v] and nonce [%v]", + "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -505,24 +579,32 @@ func (d *Deposit) RequestRedemption( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.RequestRedemption( + transaction, err := d.contract.InitializeDeposit( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, - nil, - "requestRedemption", - _outputValueBytes, - _redeemerOutputScript, + value, + "initializeDeposit", + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) } dLogger.Infof( - "submitted transaction requestRedemption with id: [%v] and nonce [%v]", + "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -537,55 +619,72 @@ func (d *Deposit) RequestRedemption( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallRequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, +func (d *Deposit) CallInitializeDeposit( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, + value *big.Int, blockNumber *big.Int, ) error { var result interface{} = nil err := ethutil.CallAtBlock( d.transactorOptions.From, - blockNumber, nil, + blockNumber, value, d.contractABI, d.caller, d.errorResolver, d.contractAddress, - "requestRedemption", + "initializeDeposit", &result, - _outputValueBytes, - _redeemerOutputScript, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) return err } -func (d *Deposit) RequestRedemptionGasEstimate( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, +func (d *Deposit) InitializeDepositGasEstimate( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "requestRedemption", + "initializeDeposit", d.contractABI, d.transactor, - _outputValueBytes, - _redeemerOutputScript, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyRedemptionProofTimedOut( +func (d *Deposit) NotifyCourtesyCall( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyRedemptionProofTimedOut", + "submitting transaction notifyCourtesyCall", ) d.transactionMutex.Lock() @@ -610,7 +709,7 @@ func (d *Deposit) NotifyRedemptionProofTimedOut( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyRedemptionProofTimedOut( + transaction, err := d.contract.NotifyCourtesyCall( transactorOptions, ) if err != nil { @@ -618,12 +717,12 @@ func (d *Deposit) NotifyRedemptionProofTimedOut( err, d.transactorOptions.From, nil, - "notifyRedemptionProofTimedOut", + "notifyCourtesyCall", ) } dLogger.Infof( - "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -634,7 +733,7 @@ func (d *Deposit) NotifyRedemptionProofTimedOut( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyRedemptionProofTimedOut( + transaction, err := d.contract.NotifyCourtesyCall( transactorOptions, ) if err != nil { @@ -642,12 +741,12 @@ func (d *Deposit) NotifyRedemptionProofTimedOut( err, d.transactorOptions.From, nil, - "notifyRedemptionProofTimedOut", + "notifyCourtesyCall", ) } dLogger.Infof( - "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -662,7 +761,7 @@ func (d *Deposit) NotifyRedemptionProofTimedOut( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyRedemptionProofTimedOut( +func (d *Deposit) CallNotifyCourtesyCall( blockNumber *big.Int, ) error { var result interface{} = nil @@ -674,20 +773,20 @@ func (d *Deposit) CallNotifyRedemptionProofTimedOut( d.caller, d.errorResolver, d.contractAddress, - "notifyRedemptionProofTimedOut", + "notifyCourtesyCall", &result, ) return err } -func (d *Deposit) NotifyRedemptionProofTimedOutGasEstimate() (uint64, error) { +func (d *Deposit) NotifyCourtesyCallGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyRedemptionProofTimedOut", + "notifyCourtesyCall", d.contractABI, d.transactor, ) @@ -696,12 +795,17 @@ func (d *Deposit) NotifyRedemptionProofTimedOutGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) NotifySignerSetupFailed( +func (d *Deposit) RequestFunderAbort( + _abortOutputScript []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifySignerSetupFailed", + "submitting transaction requestFunderAbort", + "params: ", + fmt.Sprint( + _abortOutputScript, + ), ) d.transactionMutex.Lock() @@ -726,20 +830,22 @@ func (d *Deposit) NotifySignerSetupFailed( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifySignerSetupFailed( + transaction, err := d.contract.RequestFunderAbort( transactorOptions, + _abortOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifySignerSetupFailed", + "requestFunderAbort", + _abortOutputScript, ) } dLogger.Infof( - "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", + "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -750,20 +856,22 @@ func (d *Deposit) NotifySignerSetupFailed( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifySignerSetupFailed( + transaction, err := d.contract.RequestFunderAbort( transactorOptions, + _abortOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifySignerSetupFailed", + "requestFunderAbort", + _abortOutputScript, ) } dLogger.Infof( - "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", + "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -778,7 +886,8 @@ func (d *Deposit) NotifySignerSetupFailed( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifySignerSetupFailed( +func (d *Deposit) CallRequestFunderAbort( + _abortOutputScript []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -790,53 +899,38 @@ func (d *Deposit) CallNotifySignerSetupFailed( d.caller, d.errorResolver, d.contractAddress, - "notifySignerSetupFailed", + "requestFunderAbort", &result, + _abortOutputScript, ) return err } -func (d *Deposit) NotifySignerSetupFailedGasEstimate() (uint64, error) { +func (d *Deposit) RequestFunderAbortGasEstimate( + _abortOutputScript []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifySignerSetupFailed", + "requestFunderAbort", d.contractABI, d.transactor, + _abortOutputScript, ) return result, err } // Transaction submission. -func (d *Deposit) ProvideBTCFundingProof( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _fundingOutputIndex uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) RetrieveSignerPubkey( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideBTCFundingProof", - "params: ", - fmt.Sprint( - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, - ), + "submitting transaction retrieveSignerPubkey", ) d.transactionMutex.Lock() @@ -861,36 +955,20 @@ func (d *Deposit) ProvideBTCFundingProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideBTCFundingProof( + transaction, err := d.contract.RetrieveSignerPubkey( transactorOptions, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideBTCFundingProof", - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + "retrieveSignerPubkey", ) } dLogger.Infof( - "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", + "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -901,36 +979,20 @@ func (d *Deposit) ProvideBTCFundingProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideBTCFundingProof( + transaction, err := d.contract.RetrieveSignerPubkey( transactorOptions, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideBTCFundingProof", - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + "retrieveSignerPubkey", ) } dLogger.Infof( - "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", + "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -945,15 +1007,7 @@ func (d *Deposit) ProvideBTCFundingProof( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideBTCFundingProof( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _fundingOutputIndex uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) CallRetrieveSignerPubkey( blockNumber *big.Int, ) error { var result interface{} = nil @@ -965,76 +1019,34 @@ func (d *Deposit) CallProvideBTCFundingProof( d.caller, d.errorResolver, d.contractAddress, - "provideBTCFundingProof", + "retrieveSignerPubkey", &result, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, ) return err } -func (d *Deposit) ProvideBTCFundingProofGasEstimate( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _fundingOutputIndex uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, -) (uint64, error) { +func (d *Deposit) RetrieveSignerPubkeyGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideBTCFundingProof", + "retrieveSignerPubkey", d.contractABI, d.transactor, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, ) return result, err } // Transaction submission. -func (d *Deposit) ProvideRedemptionProof( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) ExitCourtesyCall( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideRedemptionProof", - "params: ", - fmt.Sprint( - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, - ), + "submitting transaction exitCourtesyCall", ) d.transactionMutex.Lock() @@ -1059,34 +1071,20 @@ func (d *Deposit) ProvideRedemptionProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideRedemptionProof( + transaction, err := d.contract.ExitCourtesyCall( transactorOptions, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideRedemptionProof", - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + "exitCourtesyCall", ) } dLogger.Infof( - "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", + "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1097,34 +1095,20 @@ func (d *Deposit) ProvideRedemptionProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideRedemptionProof( + transaction, err := d.contract.ExitCourtesyCall( transactorOptions, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideRedemptionProof", - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + "exitCourtesyCall", ) } dLogger.Infof( - "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", + "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1139,14 +1123,7 @@ func (d *Deposit) ProvideRedemptionProof( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideRedemptionProof( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) CallExitCourtesyCall( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1158,63 +1135,34 @@ func (d *Deposit) CallProvideRedemptionProof( d.caller, d.errorResolver, d.contractAddress, - "provideRedemptionProof", + "exitCourtesyCall", &result, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, ) return err } -func (d *Deposit) ProvideRedemptionProofGasEstimate( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, -) (uint64, error) { +func (d *Deposit) ExitCourtesyCallGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideRedemptionProof", + "exitCourtesyCall", d.contractABI, d.transactor, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, ) return result, err } // Transaction submission. -func (d *Deposit) IncreaseRedemptionFee( - _previousOutputValueBytes [8]uint8, - _newOutputValueBytes [8]uint8, +func (d *Deposit) NotifyCourtesyCallExpired( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction increaseRedemptionFee", - "params: ", - fmt.Sprint( - _previousOutputValueBytes, - _newOutputValueBytes, - ), + "submitting transaction notifyCourtesyCallExpired", ) d.transactionMutex.Lock() @@ -1239,24 +1187,20 @@ func (d *Deposit) IncreaseRedemptionFee( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.IncreaseRedemptionFee( + transaction, err := d.contract.NotifyCourtesyCallExpired( transactorOptions, - _previousOutputValueBytes, - _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "increaseRedemptionFee", - _previousOutputValueBytes, - _newOutputValueBytes, + "notifyCourtesyCallExpired", ) } dLogger.Infof( - "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1267,24 +1211,20 @@ func (d *Deposit) IncreaseRedemptionFee( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.IncreaseRedemptionFee( + transaction, err := d.contract.NotifyCourtesyCallExpired( transactorOptions, - _previousOutputValueBytes, - _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "increaseRedemptionFee", - _previousOutputValueBytes, - _newOutputValueBytes, + "notifyCourtesyCallExpired", ) } dLogger.Infof( - "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1299,9 +1239,7 @@ func (d *Deposit) IncreaseRedemptionFee( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallIncreaseRedemptionFee( - _previousOutputValueBytes [8]uint8, - _newOutputValueBytes [8]uint8, +func (d *Deposit) CallNotifyCourtesyCallExpired( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1313,50 +1251,34 @@ func (d *Deposit) CallIncreaseRedemptionFee( d.caller, d.errorResolver, d.contractAddress, - "increaseRedemptionFee", + "notifyCourtesyCallExpired", &result, - _previousOutputValueBytes, - _newOutputValueBytes, ) return err } -func (d *Deposit) IncreaseRedemptionFeeGasEstimate( - _previousOutputValueBytes [8]uint8, - _newOutputValueBytes [8]uint8, -) (uint64, error) { +func (d *Deposit) NotifyCourtesyCallExpiredGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "increaseRedemptionFee", + "notifyCourtesyCallExpired", d.contractABI, d.transactor, - _previousOutputValueBytes, - _newOutputValueBytes, ) return result, err } // Transaction submission. -func (d *Deposit) TransferAndRequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, - _finalRecipient common.Address, +func (d *Deposit) NotifyFundingTimedOut( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction transferAndRequestRedemption", - "params: ", - fmt.Sprint( - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, - ), + "submitting transaction notifyFundingTimedOut", ) d.transactionMutex.Lock() @@ -1381,26 +1303,20 @@ func (d *Deposit) TransferAndRequestRedemption( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.TransferAndRequestRedemption( + transaction, err := d.contract.NotifyFundingTimedOut( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "transferAndRequestRedemption", - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + "notifyFundingTimedOut", ) } dLogger.Infof( - "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", + "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1411,26 +1327,20 @@ func (d *Deposit) TransferAndRequestRedemption( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.TransferAndRequestRedemption( + transaction, err := d.contract.NotifyFundingTimedOut( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "transferAndRequestRedemption", - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + "notifyFundingTimedOut", ) } dLogger.Infof( - "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", + "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1445,10 +1355,7 @@ func (d *Deposit) TransferAndRequestRedemption( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallTransferAndRequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, - _finalRecipient common.Address, +func (d *Deposit) CallNotifyFundingTimedOut( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1460,57 +1367,34 @@ func (d *Deposit) CallTransferAndRequestRedemption( d.caller, d.errorResolver, d.contractAddress, - "transferAndRequestRedemption", + "notifyFundingTimedOut", &result, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, ) return err } -func (d *Deposit) TransferAndRequestRedemptionGasEstimate( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, - _finalRecipient common.Address, -) (uint64, error) { +func (d *Deposit) NotifyFundingTimedOutGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "transferAndRequestRedemption", + "notifyFundingTimedOut", d.contractABI, d.transactor, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, ) return result, err } // Transaction submission. -func (d *Deposit) ProvideECDSAFraudProof( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) NotifyUndercollateralizedLiquidation( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideECDSAFraudProof", - "params: ", - fmt.Sprint( - _v, - _r, - _s, - _signedDigest, - _preimage, - ), + "submitting transaction notifyUndercollateralizedLiquidation", ) d.transactionMutex.Lock() @@ -1535,30 +1419,20 @@ func (d *Deposit) ProvideECDSAFraudProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideECDSAFraudProof( + transaction, err := d.contract.NotifyUndercollateralizedLiquidation( transactorOptions, - _v, - _r, - _s, - _signedDigest, - _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideECDSAFraudProof", - _v, - _r, - _s, - _signedDigest, - _preimage, + "notifyUndercollateralizedLiquidation", ) } dLogger.Infof( - "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", + "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1569,30 +1443,20 @@ func (d *Deposit) ProvideECDSAFraudProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideECDSAFraudProof( + transaction, err := d.contract.NotifyUndercollateralizedLiquidation( transactorOptions, - _v, - _r, - _s, - _signedDigest, - _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideECDSAFraudProof", - _v, - _r, - _s, - _signedDigest, - _preimage, + "notifyUndercollateralizedLiquidation", ) } dLogger.Infof( - "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", + "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1607,12 +1471,7 @@ func (d *Deposit) ProvideECDSAFraudProof( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideECDSAFraudProof( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) CallNotifyUndercollateralizedLiquidation( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1624,58 +1483,52 @@ func (d *Deposit) CallProvideECDSAFraudProof( d.caller, d.errorResolver, d.contractAddress, - "provideECDSAFraudProof", + "notifyUndercollateralizedLiquidation", &result, - _v, - _r, - _s, - _signedDigest, - _preimage, ) return err } -func (d *Deposit) ProvideECDSAFraudProofGasEstimate( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, -) (uint64, error) { +func (d *Deposit) NotifyUndercollateralizedLiquidationGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideECDSAFraudProof", + "notifyUndercollateralizedLiquidation", d.contractABI, d.transactor, - _v, - _r, - _s, - _signedDigest, - _preimage, ) return result, err } // Transaction submission. -func (d *Deposit) ProvideRedemptionSignature( - _v uint8, - _r [32]uint8, - _s [32]uint8, +func (d *Deposit) ProvideBTCFundingProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _fundingOutputIndex uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideRedemptionSignature", + "submitting transaction provideBTCFundingProof", "params: ", fmt.Sprint( - _v, - _r, - _s, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ), ) @@ -1701,26 +1554,36 @@ func (d *Deposit) ProvideRedemptionSignature( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideRedemptionSignature( + transaction, err := d.contract.ProvideBTCFundingProof( transactorOptions, - _v, - _r, - _s, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideRedemptionSignature", - _v, - _r, - _s, + "provideBTCFundingProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) } dLogger.Infof( - "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", + "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1731,26 +1594,36 @@ func (d *Deposit) ProvideRedemptionSignature( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideRedemptionSignature( + transaction, err := d.contract.ProvideBTCFundingProof( transactorOptions, - _v, - _r, - _s, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideRedemptionSignature", - _v, - _r, - _s, - ) - } - - dLogger.Infof( - "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", + "provideBTCFundingProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + } + + dLogger.Infof( + "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1765,10 +1638,15 @@ func (d *Deposit) ProvideRedemptionSignature( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideRedemptionSignature( - _v uint8, - _r [32]uint8, - _s [32]uint8, +func (d *Deposit) CallProvideBTCFundingProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _fundingOutputIndex uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1780,48 +1658,65 @@ func (d *Deposit) CallProvideRedemptionSignature( d.caller, d.errorResolver, d.contractAddress, - "provideRedemptionSignature", + "provideBTCFundingProof", &result, - _v, - _r, - _s, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) return err } -func (d *Deposit) ProvideRedemptionSignatureGasEstimate( - _v uint8, - _r [32]uint8, - _s [32]uint8, +func (d *Deposit) ProvideBTCFundingProofGasEstimate( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _fundingOutputIndex uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideRedemptionSignature", + "provideBTCFundingProof", d.contractABI, d.transactor, - _v, - _r, - _s, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) return result, err } // Transaction submission. -func (d *Deposit) RequestFunderAbort( - _abortOutputScript []uint8, +func (d *Deposit) RequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction requestFunderAbort", + "submitting transaction requestRedemption", "params: ", fmt.Sprint( - _abortOutputScript, + _outputValueBytes, + _redeemerOutputScript, ), ) @@ -1847,22 +1742,24 @@ func (d *Deposit) RequestFunderAbort( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.RequestFunderAbort( + transaction, err := d.contract.RequestRedemption( transactorOptions, - _abortOutputScript, + _outputValueBytes, + _redeemerOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "requestFunderAbort", - _abortOutputScript, + "requestRedemption", + _outputValueBytes, + _redeemerOutputScript, ) } dLogger.Infof( - "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", + "submitted transaction requestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1873,22 +1770,24 @@ func (d *Deposit) RequestFunderAbort( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.RequestFunderAbort( + transaction, err := d.contract.RequestRedemption( transactorOptions, - _abortOutputScript, + _outputValueBytes, + _redeemerOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "requestFunderAbort", - _abortOutputScript, + "requestRedemption", + _outputValueBytes, + _redeemerOutputScript, ) } dLogger.Infof( - "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", + "submitted transaction requestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1903,8 +1802,9 @@ func (d *Deposit) RequestFunderAbort( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallRequestFunderAbort( - _abortOutputScript []uint8, +func (d *Deposit) CallRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1916,26 +1816,145 @@ func (d *Deposit) CallRequestFunderAbort( d.caller, d.errorResolver, d.contractAddress, - "requestFunderAbort", + "requestRedemption", &result, - _abortOutputScript, + _outputValueBytes, + _redeemerOutputScript, ) return err } -func (d *Deposit) RequestFunderAbortGasEstimate( - _abortOutputScript []uint8, +func (d *Deposit) RequestRedemptionGasEstimate( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "requestFunderAbort", + "requestRedemption", + d.contractABI, + d.transactor, + _outputValueBytes, + _redeemerOutputScript, + ) + + return result, err +} + +// Transaction submission. +func (d *Deposit) NotifyRedemptionSignatureTimedOut( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction notifyRedemptionSignatureTimedOut", + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.NotifyRedemptionSignatureTimedOut( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyRedemptionSignatureTimedOut", + ) + } + + dLogger.Infof( + "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( + transactorOptions, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "notifyRedemptionSignatureTimedOut", + ) + } + + dLogger.Infof( + "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallNotifyRedemptionSignatureTimedOut( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "notifyRedemptionSignatureTimedOut", + &result, + ) + + return err +} + +func (d *Deposit) NotifyRedemptionSignatureTimedOutGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "notifyRedemptionSignatureTimedOut", d.contractABI, d.transactor, - _abortOutputScript, ) return result, err @@ -2112,12 +2131,21 @@ func (d *Deposit) ProvideFundingECDSAFraudProofGasEstimate( } // Transaction submission. -func (d *Deposit) NotifyCourtesyCallExpired( +func (d *Deposit) ProvideRedemptionSignature( + _v uint8, + _r [32]uint8, + _s [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyCourtesyCallExpired", + "submitting transaction provideRedemptionSignature", + "params: ", + fmt.Sprint( + _v, + _r, + _s, + ), ) d.transactionMutex.Lock() @@ -2142,20 +2170,26 @@ func (d *Deposit) NotifyCourtesyCallExpired( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyCourtesyCallExpired( + transaction, err := d.contract.ProvideRedemptionSignature( transactorOptions, + _v, + _r, + _s, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyCourtesyCallExpired", + "provideRedemptionSignature", + _v, + _r, + _s, ) } dLogger.Infof( - "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2166,20 +2200,26 @@ func (d *Deposit) NotifyCourtesyCallExpired( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyCourtesyCallExpired( + transaction, err := d.contract.ProvideRedemptionSignature( transactorOptions, + _v, + _r, + _s, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyCourtesyCallExpired", + "provideRedemptionSignature", + _v, + _r, + _s, ) } dLogger.Infof( - "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2194,7 +2234,10 @@ func (d *Deposit) NotifyCourtesyCallExpired( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyCourtesyCallExpired( +func (d *Deposit) CallProvideRedemptionSignature( + _v uint8, + _r [32]uint8, + _s [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2206,34 +2249,49 @@ func (d *Deposit) CallNotifyCourtesyCallExpired( d.caller, d.errorResolver, d.contractAddress, - "notifyCourtesyCallExpired", + "provideRedemptionSignature", &result, + _v, + _r, + _s, ) return err } -func (d *Deposit) NotifyCourtesyCallExpiredGasEstimate() (uint64, error) { +func (d *Deposit) ProvideRedemptionSignatureGasEstimate( + _v uint8, + _r [32]uint8, + _s [32]uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyCourtesyCallExpired", + "provideRedemptionSignature", d.contractABI, d.transactor, + _v, + _r, + _s, ) return result, err } // Transaction submission. -func (d *Deposit) PurchaseSignerBondsAtAuction( +func (d *Deposit) Initialize( + _factory common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction purchaseSignerBondsAtAuction", + "submitting transaction initialize", + "params: ", + fmt.Sprint( + _factory, + ), ) d.transactionMutex.Lock() @@ -2258,20 +2316,22 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.PurchaseSignerBondsAtAuction( + transaction, err := d.contract.Initialize( transactorOptions, + _factory, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "purchaseSignerBondsAtAuction", + "initialize", + _factory, ) } dLogger.Infof( - "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", + "submitted transaction initialize with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2282,20 +2342,22 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.PurchaseSignerBondsAtAuction( + transaction, err := d.contract.Initialize( transactorOptions, + _factory, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "purchaseSignerBondsAtAuction", + "initialize", + _factory, ) } dLogger.Infof( - "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", + "submitted transaction initialize with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2310,7 +2372,8 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallPurchaseSignerBondsAtAuction( +func (d *Deposit) CallInitialize( + _factory common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2322,34 +2385,38 @@ func (d *Deposit) CallPurchaseSignerBondsAtAuction( d.caller, d.errorResolver, d.contractAddress, - "purchaseSignerBondsAtAuction", + "initialize", &result, + _factory, ) return err } -func (d *Deposit) PurchaseSignerBondsAtAuctionGasEstimate() (uint64, error) { +func (d *Deposit) InitializeGasEstimate( + _factory common.Address, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "purchaseSignerBondsAtAuction", + "initialize", d.contractABI, d.transactor, + _factory, ) return result, err } // Transaction submission. -func (d *Deposit) RetrieveSignerPubkey( +func (d *Deposit) NotifySignerSetupFailed( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction retrieveSignerPubkey", + "submitting transaction notifySignerSetupFailed", ) d.transactionMutex.Lock() @@ -2374,7 +2441,7 @@ func (d *Deposit) RetrieveSignerPubkey( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.RetrieveSignerPubkey( + transaction, err := d.contract.NotifySignerSetupFailed( transactorOptions, ) if err != nil { @@ -2382,12 +2449,12 @@ func (d *Deposit) RetrieveSignerPubkey( err, d.transactorOptions.From, nil, - "retrieveSignerPubkey", + "notifySignerSetupFailed", ) } dLogger.Infof( - "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", + "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2398,7 +2465,7 @@ func (d *Deposit) RetrieveSignerPubkey( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.RetrieveSignerPubkey( + transaction, err := d.contract.NotifySignerSetupFailed( transactorOptions, ) if err != nil { @@ -2406,12 +2473,12 @@ func (d *Deposit) RetrieveSignerPubkey( err, d.transactorOptions.From, nil, - "retrieveSignerPubkey", + "notifySignerSetupFailed", ) } dLogger.Infof( - "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", + "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2426,7 +2493,7 @@ func (d *Deposit) RetrieveSignerPubkey( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallRetrieveSignerPubkey( +func (d *Deposit) CallNotifySignerSetupFailed( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2438,20 +2505,20 @@ func (d *Deposit) CallRetrieveSignerPubkey( d.caller, d.errorResolver, d.contractAddress, - "retrieveSignerPubkey", + "notifySignerSetupFailed", &result, ) return err } -func (d *Deposit) RetrieveSignerPubkeyGasEstimate() (uint64, error) { +func (d *Deposit) NotifySignerSetupFailedGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "retrieveSignerPubkey", + "notifySignerSetupFailed", d.contractABI, d.transactor, ) @@ -2460,16 +2527,28 @@ func (d *Deposit) RetrieveSignerPubkeyGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) Initialize( - _factory common.Address, +func (d *Deposit) ProvideRedemptionProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction initialize", + "submitting transaction provideRedemptionProof", "params: ", fmt.Sprint( - _factory, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ), ) @@ -2495,22 +2574,34 @@ func (d *Deposit) Initialize( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.Initialize( + transaction, err := d.contract.ProvideRedemptionProof( transactorOptions, - _factory, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "initialize", - _factory, + "provideRedemptionProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) } dLogger.Infof( - "submitted transaction initialize with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2521,22 +2612,34 @@ func (d *Deposit) Initialize( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.Initialize( + transaction, err := d.contract.ProvideRedemptionProof( transactorOptions, - _factory, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "initialize", - _factory, + "provideRedemptionProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) } dLogger.Infof( - "submitted transaction initialize with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2551,8 +2654,14 @@ func (d *Deposit) Initialize( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallInitialize( - _factory common.Address, +func (d *Deposit) CallProvideRedemptionProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2564,223 +2673,63 @@ func (d *Deposit) CallInitialize( d.caller, d.errorResolver, d.contractAddress, - "initialize", + "provideRedemptionProof", &result, - _factory, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) return err } -func (d *Deposit) InitializeGasEstimate( - _factory common.Address, +func (d *Deposit) ProvideRedemptionProofGasEstimate( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "initialize", + "provideRedemptionProof", d.contractABI, d.transactor, - _factory, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) return result, err } // Transaction submission. -func (d *Deposit) InitializeDeposit( - _tbtcSystem common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachineAddress common.Address, - _lotSizeSatoshis uint64, - value *big.Int, +func (d *Deposit) IncreaseRedemptionFee( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction initializeDeposit", + "submitting transaction increaseRedemptionFee", "params: ", fmt.Sprint( - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, + _previousOutputValueBytes, + _newOutputValueBytes, ), - "value: ", value, - ) - - d.transactionMutex.Lock() - defer d.transactionMutex.Unlock() - - // create a copy - transactorOptions := new(bind.TransactOpts) - *transactorOptions = *d.transactorOptions - - transactorOptions.Value = value - - 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 := d.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 := d.contract.InitializeDeposit( - transactorOptions, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, - ) - if err != nil { - return transaction, d.errorResolver.ResolveError( - err, - d.transactorOptions.From, - value, - "initializeDeposit", - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, - ) - } - - dLogger.Infof( - "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - go d.miningWaiter.ForceMining( - transaction, - func(newGasPrice *big.Int) (*types.Transaction, error) { - transactorOptions.GasLimit = transaction.Gas() - transactorOptions.GasPrice = newGasPrice - - transaction, err := d.contract.InitializeDeposit( - transactorOptions, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, - ) - if err != nil { - return transaction, d.errorResolver.ResolveError( - err, - d.transactorOptions.From, - value, - "initializeDeposit", - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, - ) - } - - dLogger.Infof( - "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - return transaction, nil - }, - ) - - d.nonceManager.IncrementNonce() - - return transaction, err -} - -// Non-mutating call, not a transaction submission. -func (d *Deposit) CallInitializeDeposit( - _tbtcSystem common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachineAddress common.Address, - _lotSizeSatoshis uint64, - value *big.Int, - blockNumber *big.Int, -) error { - var result interface{} = nil - - err := ethutil.CallAtBlock( - d.transactorOptions.From, - blockNumber, value, - d.contractABI, - d.caller, - d.errorResolver, - d.contractAddress, - "initializeDeposit", - &result, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, - ) - - return err -} - -func (d *Deposit) InitializeDepositGasEstimate( - _tbtcSystem common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachineAddress common.Address, - _lotSizeSatoshis uint64, -) (uint64, error) { - var result uint64 - - result, err := ethutil.EstimateGas( - d.callerOptions.From, - d.contractAddress, - "initializeDeposit", - d.contractABI, - d.transactor, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, - ) - - return result, err -} - -// Transaction submission. -func (d *Deposit) NotifyRedemptionSignatureTimedOut( - - transactionOptions ...ethutil.TransactionOptions, -) (*types.Transaction, error) { - dLogger.Debug( - "submitting transaction notifyRedemptionSignatureTimedOut", ) d.transactionMutex.Lock() @@ -2805,20 +2754,24 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( + transaction, err := d.contract.IncreaseRedemptionFee( transactorOptions, + _previousOutputValueBytes, + _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyRedemptionSignatureTimedOut", + "increaseRedemptionFee", + _previousOutputValueBytes, + _newOutputValueBytes, ) } dLogger.Infof( - "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", + "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2829,20 +2782,24 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( + transaction, err := d.contract.IncreaseRedemptionFee( transactorOptions, + _previousOutputValueBytes, + _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyRedemptionSignatureTimedOut", + "increaseRedemptionFee", + _previousOutputValueBytes, + _newOutputValueBytes, ) } dLogger.Infof( - "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", + "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2857,7 +2814,9 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyRedemptionSignatureTimedOut( +func (d *Deposit) CallIncreaseRedemptionFee( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2869,34 +2828,50 @@ func (d *Deposit) CallNotifyRedemptionSignatureTimedOut( d.caller, d.errorResolver, d.contractAddress, - "notifyRedemptionSignatureTimedOut", + "increaseRedemptionFee", &result, + _previousOutputValueBytes, + _newOutputValueBytes, ) return err } -func (d *Deposit) NotifyRedemptionSignatureTimedOutGasEstimate() (uint64, error) { +func (d *Deposit) IncreaseRedemptionFeeGasEstimate( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyRedemptionSignatureTimedOut", + "increaseRedemptionFee", d.contractABI, d.transactor, + _previousOutputValueBytes, + _newOutputValueBytes, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyCourtesyCall( +func (d *Deposit) TransferAndRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyCourtesyCall", + "submitting transaction transferAndRequestRedemption", + "params: ", + fmt.Sprint( + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, + ), ) d.transactionMutex.Lock() @@ -2921,20 +2896,26 @@ func (d *Deposit) NotifyCourtesyCall( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyCourtesyCall( + transaction, err := d.contract.TransferAndRequestRedemption( transactorOptions, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyCourtesyCall", + "transferAndRequestRedemption", + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) } dLogger.Infof( - "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2945,20 +2926,26 @@ func (d *Deposit) NotifyCourtesyCall( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyCourtesyCall( + transaction, err := d.contract.TransferAndRequestRedemption( transactorOptions, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyCourtesyCall", + "transferAndRequestRedemption", + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) } dLogger.Infof( - "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2973,7 +2960,10 @@ func (d *Deposit) NotifyCourtesyCall( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyCourtesyCall( +func (d *Deposit) CallTransferAndRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2985,22 +2975,32 @@ func (d *Deposit) CallNotifyCourtesyCall( d.caller, d.errorResolver, d.contractAddress, - "notifyCourtesyCall", + "transferAndRequestRedemption", &result, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) return err } -func (d *Deposit) NotifyCourtesyCallGasEstimate() (uint64, error) { +func (d *Deposit) TransferAndRequestRedemptionGasEstimate( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyCourtesyCall", + "transferAndRequestRedemption", d.contractABI, d.transactor, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) return result, err @@ -3124,9 +3124,9 @@ func (d *Deposit) WithdrawFundsGasEstimate() (uint64, error) { // ----- Const Methods ------ -func (d *Deposit) SeverelyUndercollateralizedThresholdPercent() (uint16, error) { - var result uint16 - result, err := d.contract.SeverelyUndercollateralizedThresholdPercent( +func (d *Deposit) RemainingTerm() (*big.Int, error) { + var result *big.Int + result, err := d.contract.RemainingTerm( d.callerOptions, ) @@ -3135,17 +3135,17 @@ func (d *Deposit) SeverelyUndercollateralizedThresholdPercent() (uint16, error) err, d.callerOptions.From, nil, - "severelyUndercollateralizedThresholdPercent", + "remainingTerm", ) } return result, err } -func (d *Deposit) SeverelyUndercollateralizedThresholdPercentAtBlock( +func (d *Deposit) RemainingTermAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3155,7 +3155,7 @@ func (d *Deposit) SeverelyUndercollateralizedThresholdPercentAtBlock( d.caller, d.errorResolver, d.contractAddress, - "severelyUndercollateralizedThresholdPercent", + "remainingTerm", &result, ) @@ -3200,9 +3200,9 @@ func (d *Deposit) LotSizeSatoshisAtBlock( return result, err } -func (d *Deposit) CurrentState() (*big.Int, error) { - var result *big.Int - result, err := d.contract.CurrentState( +func (d *Deposit) InActive() (bool, error) { + var result bool + result, err := d.contract.InActive( d.callerOptions, ) @@ -3211,17 +3211,17 @@ func (d *Deposit) CurrentState() (*big.Int, error) { err, d.callerOptions.From, nil, - "currentState", + "inActive", ) } return result, err } -func (d *Deposit) CurrentStateAtBlock( +func (d *Deposit) InActiveAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (bool, error) { + var result bool err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3231,16 +3231,22 @@ func (d *Deposit) CurrentStateAtBlock( d.caller, d.errorResolver, d.contractAddress, - "currentState", + "inActive", &result, ) return result, err } -func (d *Deposit) KeepAddress() (common.Address, error) { - var result common.Address - result, err := d.contract.KeepAddress( +type fundingInfo struct { + UtxoValueBytes [8]uint8 + FundedAt *big.Int + UtxoOutpoint []uint8 +} + +func (d *Deposit) FundingInfo() (fundingInfo, error) { + var result fundingInfo + result, err := d.contract.FundingInfo( d.callerOptions, ) @@ -3249,17 +3255,17 @@ func (d *Deposit) KeepAddress() (common.Address, error) { err, d.callerOptions.From, nil, - "keepAddress", + "fundingInfo", ) } return result, err } -func (d *Deposit) KeepAddressAtBlock( +func (d *Deposit) FundingInfoAtBlock( blockNumber *big.Int, -) (common.Address, error) { - var result common.Address +) (fundingInfo, error) { + var result fundingInfo err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3269,16 +3275,16 @@ func (d *Deposit) KeepAddressAtBlock( d.caller, d.errorResolver, d.contractAddress, - "keepAddress", + "fundingInfo", &result, ) return result, err } -func (d *Deposit) UndercollateralizedThresholdPercent() (uint16, error) { - var result uint16 - result, err := d.contract.UndercollateralizedThresholdPercent( +func (d *Deposit) AuctionValue() (*big.Int, error) { + var result *big.Int + result, err := d.contract.AuctionValue( d.callerOptions, ) @@ -3287,17 +3293,17 @@ func (d *Deposit) UndercollateralizedThresholdPercent() (uint16, error) { err, d.callerOptions.From, nil, - "undercollateralizedThresholdPercent", + "auctionValue", ) } return result, err } -func (d *Deposit) UndercollateralizedThresholdPercentAtBlock( +func (d *Deposit) AuctionValueAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3307,16 +3313,16 @@ func (d *Deposit) UndercollateralizedThresholdPercentAtBlock( d.caller, d.errorResolver, d.contractAddress, - "undercollateralizedThresholdPercent", + "auctionValue", &result, ) return result, err } -func (d *Deposit) WithdrawableAmount() (*big.Int, error) { +func (d *Deposit) LotSizeTbtc() (*big.Int, error) { var result *big.Int - result, err := d.contract.WithdrawableAmount( + result, err := d.contract.LotSizeTbtc( d.callerOptions, ) @@ -3325,14 +3331,14 @@ func (d *Deposit) WithdrawableAmount() (*big.Int, error) { err, d.callerOptions.From, nil, - "withdrawableAmount", + "lotSizeTbtc", ) } return result, err } -func (d *Deposit) WithdrawableAmountAtBlock( +func (d *Deposit) LotSizeTbtcAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3345,16 +3351,16 @@ func (d *Deposit) WithdrawableAmountAtBlock( d.caller, d.errorResolver, d.contractAddress, - "withdrawableAmount", + "lotSizeTbtc", &result, ) return result, err } -func (d *Deposit) CollateralizationPercentage() (*big.Int, error) { - var result *big.Int - result, err := d.contract.CollateralizationPercentage( +func (d *Deposit) SeverelyUndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := d.contract.SeverelyUndercollateralizedThresholdPercent( d.callerOptions, ) @@ -3363,17 +3369,17 @@ func (d *Deposit) CollateralizationPercentage() (*big.Int, error) { err, d.callerOptions.From, nil, - "collateralizationPercentage", + "severelyUndercollateralizedThresholdPercent", ) } return result, err } -func (d *Deposit) CollateralizationPercentageAtBlock( +func (d *Deposit) SeverelyUndercollateralizedThresholdPercentAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3383,22 +3389,16 @@ func (d *Deposit) CollateralizationPercentageAtBlock( d.caller, d.errorResolver, d.contractAddress, - "collateralizationPercentage", + "severelyUndercollateralizedThresholdPercent", &result, ) return result, err } -type fundingInfo struct { - UtxoValueBytes [8]uint8 - FundedAt *big.Int - UtxoOutpoint []uint8 -} - -func (d *Deposit) FundingInfo() (fundingInfo, error) { - var result fundingInfo - result, err := d.contract.FundingInfo( +func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { + var result uint16 + result, err := d.contract.InitialCollateralizedPercent( d.callerOptions, ) @@ -3407,17 +3407,17 @@ func (d *Deposit) FundingInfo() (fundingInfo, error) { err, d.callerOptions.From, nil, - "fundingInfo", + "initialCollateralizedPercent", ) } return result, err } -func (d *Deposit) FundingInfoAtBlock( +func (d *Deposit) InitialCollateralizedPercentAtBlock( blockNumber *big.Int, -) (fundingInfo, error) { - var result fundingInfo +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3427,16 +3427,16 @@ func (d *Deposit) FundingInfoAtBlock( d.caller, d.errorResolver, d.contractAddress, - "fundingInfo", + "initialCollateralizedPercent", &result, ) return result, err } -func (d *Deposit) AuctionValue() (*big.Int, error) { - var result *big.Int - result, err := d.contract.AuctionValue( +func (d *Deposit) KeepAddress() (common.Address, error) { + var result common.Address + result, err := d.contract.KeepAddress( d.callerOptions, ) @@ -3445,17 +3445,17 @@ func (d *Deposit) AuctionValue() (*big.Int, error) { err, d.callerOptions.From, nil, - "auctionValue", + "keepAddress", ) } return result, err } -func (d *Deposit) AuctionValueAtBlock( +func (d *Deposit) KeepAddressAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (common.Address, error) { + var result common.Address err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3465,16 +3465,16 @@ func (d *Deposit) AuctionValueAtBlock( d.caller, d.errorResolver, d.contractAddress, - "auctionValue", + "keepAddress", &result, ) return result, err } -func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { +func (d *Deposit) CollateralizationPercentage() (*big.Int, error) { var result *big.Int - result, err := d.contract.SignerFeeTbtc( + result, err := d.contract.CollateralizationPercentage( d.callerOptions, ) @@ -3483,14 +3483,14 @@ func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { err, d.callerOptions.From, nil, - "signerFeeTbtc", + "collateralizationPercentage", ) } return result, err } -func (d *Deposit) SignerFeeTbtcAtBlock( +func (d *Deposit) CollateralizationPercentageAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3503,20 +3503,17 @@ func (d *Deposit) SignerFeeTbtcAtBlock( d.caller, d.errorResolver, d.contractAddress, - "signerFeeTbtc", + "collateralizationPercentage", &result, ) return result, err } -func (d *Deposit) GetOwnerRedemptionTbtcRequirement( - _redeemer common.Address, -) (*big.Int, error) { +func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { var result *big.Int - result, err := d.contract.GetOwnerRedemptionTbtcRequirement( + result, err := d.contract.SignerFeeTbtc( d.callerOptions, - _redeemer, ) if err != nil { @@ -3524,16 +3521,14 @@ func (d *Deposit) GetOwnerRedemptionTbtcRequirement( err, d.callerOptions.From, nil, - "getOwnerRedemptionTbtcRequirement", - _redeemer, + "signerFeeTbtc", ) } return result, err } -func (d *Deposit) GetOwnerRedemptionTbtcRequirementAtBlock( - _redeemer common.Address, +func (d *Deposit) SignerFeeTbtcAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3546,17 +3541,16 @@ func (d *Deposit) GetOwnerRedemptionTbtcRequirementAtBlock( d.caller, d.errorResolver, d.contractAddress, - "getOwnerRedemptionTbtcRequirement", + "signerFeeTbtc", &result, - _redeemer, ) return result, err } -func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { +func (d *Deposit) UndercollateralizedThresholdPercent() (uint16, error) { var result uint16 - result, err := d.contract.InitialCollateralizedPercent( + result, err := d.contract.UndercollateralizedThresholdPercent( d.callerOptions, ) @@ -3565,14 +3559,14 @@ func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { err, d.callerOptions.From, nil, - "initialCollateralizedPercent", + "undercollateralizedThresholdPercent", ) } return result, err } -func (d *Deposit) InitialCollateralizedPercentAtBlock( +func (d *Deposit) UndercollateralizedThresholdPercentAtBlock( blockNumber *big.Int, ) (uint16, error) { var result uint16 @@ -3585,16 +3579,16 @@ func (d *Deposit) InitialCollateralizedPercentAtBlock( d.caller, d.errorResolver, d.contractAddress, - "initialCollateralizedPercent", + "undercollateralizedThresholdPercent", &result, ) return result, err } -func (d *Deposit) RemainingTerm() (*big.Int, error) { +func (d *Deposit) WithdrawableAmount() (*big.Int, error) { var result *big.Int - result, err := d.contract.RemainingTerm( + result, err := d.contract.WithdrawableAmount( d.callerOptions, ) @@ -3603,14 +3597,14 @@ func (d *Deposit) RemainingTerm() (*big.Int, error) { err, d.callerOptions.From, nil, - "remainingTerm", + "withdrawableAmount", ) } return result, err } -func (d *Deposit) RemainingTermAtBlock( +func (d *Deposit) WithdrawableAmountAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3623,17 +3617,20 @@ func (d *Deposit) RemainingTermAtBlock( d.caller, d.errorResolver, d.contractAddress, - "remainingTerm", + "withdrawableAmount", &result, ) return result, err } -func (d *Deposit) InActive() (bool, error) { - var result bool - result, err := d.contract.InActive( +func (d *Deposit) GetRedemptionTbtcRequirement( + _redeemer common.Address, +) (*big.Int, error) { + var result *big.Int + result, err := d.contract.GetRedemptionTbtcRequirement( d.callerOptions, + _redeemer, ) if err != nil { @@ -3641,17 +3638,19 @@ func (d *Deposit) InActive() (bool, error) { err, d.callerOptions.From, nil, - "inActive", + "getRedemptionTbtcRequirement", + _redeemer, ) } return result, err } -func (d *Deposit) InActiveAtBlock( +func (d *Deposit) GetRedemptionTbtcRequirementAtBlock( + _redeemer common.Address, blockNumber *big.Int, -) (bool, error) { - var result bool +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3661,16 +3660,17 @@ func (d *Deposit) InActiveAtBlock( d.caller, d.errorResolver, d.contractAddress, - "inActive", + "getRedemptionTbtcRequirement", &result, + _redeemer, ) return result, err } -func (d *Deposit) LotSizeTbtc() (*big.Int, error) { +func (d *Deposit) UtxoValue() (*big.Int, error) { var result *big.Int - result, err := d.contract.LotSizeTbtc( + result, err := d.contract.UtxoValue( d.callerOptions, ) @@ -3679,14 +3679,14 @@ func (d *Deposit) LotSizeTbtc() (*big.Int, error) { err, d.callerOptions.From, nil, - "lotSizeTbtc", + "utxoValue", ) } return result, err } -func (d *Deposit) LotSizeTbtcAtBlock( +func (d *Deposit) UtxoValueAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3699,20 +3699,17 @@ func (d *Deposit) LotSizeTbtcAtBlock( d.caller, d.errorResolver, d.contractAddress, - "lotSizeTbtc", + "utxoValue", &result, ) return result, err } -func (d *Deposit) GetRedemptionTbtcRequirement( - _redeemer common.Address, -) (*big.Int, error) { +func (d *Deposit) CurrentState() (*big.Int, error) { var result *big.Int - result, err := d.contract.GetRedemptionTbtcRequirement( + result, err := d.contract.CurrentState( d.callerOptions, - _redeemer, ) if err != nil { @@ -3720,16 +3717,14 @@ func (d *Deposit) GetRedemptionTbtcRequirement( err, d.callerOptions.From, nil, - "getRedemptionTbtcRequirement", - _redeemer, + "currentState", ) } return result, err } -func (d *Deposit) GetRedemptionTbtcRequirementAtBlock( - _redeemer common.Address, +func (d *Deposit) CurrentStateAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3742,18 +3737,20 @@ func (d *Deposit) GetRedemptionTbtcRequirementAtBlock( d.caller, d.errorResolver, d.contractAddress, - "getRedemptionTbtcRequirement", + "currentState", &result, - _redeemer, ) return result, err } -func (d *Deposit) UtxoValue() (*big.Int, error) { +func (d *Deposit) GetOwnerRedemptionTbtcRequirement( + _redeemer common.Address, +) (*big.Int, error) { var result *big.Int - result, err := d.contract.UtxoValue( + result, err := d.contract.GetOwnerRedemptionTbtcRequirement( d.callerOptions, + _redeemer, ) if err != nil { @@ -3761,14 +3758,16 @@ func (d *Deposit) UtxoValue() (*big.Int, error) { err, d.callerOptions.From, nil, - "utxoValue", + "getOwnerRedemptionTbtcRequirement", + _redeemer, ) } return result, err } -func (d *Deposit) UtxoValueAtBlock( +func (d *Deposit) GetOwnerRedemptionTbtcRequirementAtBlock( + _redeemer common.Address, blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3781,8 +3780,9 @@ func (d *Deposit) UtxoValueAtBlock( d.caller, d.errorResolver, d.contractAddress, - "utxoValue", + "getOwnerRedemptionTbtcRequirement", &result, + _redeemer, ) return result, err diff --git a/pkg/chain/ethereum/gen/contract/TBTCSystem.go b/pkg/chain/ethereum/gen/contract/TBTCSystem.go index f9dee2b32..caaa707ed 100644 --- a/pkg/chain/ethereum/gen/contract/TBTCSystem.go +++ b/pkg/chain/ethereum/gen/contract/TBTCSystem.go @@ -20,7 +20,7 @@ import ( "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" "github.com/keep-network/keep-common/pkg/subscription" - abi "github.com/keep-network/tbtc/go/abi/system" + abi "github.com/keep-network/tbtc/pkg/chain/ethereum/gen/abi/system" ) // Create a package-level logger for this contract. The logger exists at @@ -94,12 +94,12 @@ func NewTBTCSystem( // ----- Non-const Methods ------ // Transaction submission. -func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( +func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction refreshMinimumBondableValue", + "submitting transaction finalizeKeepFactoriesUpdate", ) tbtcs.transactionMutex.Lock() @@ -124,7 +124,7 @@ func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.RefreshMinimumBondableValue( + transaction, err := tbtcs.contract.FinalizeKeepFactoriesUpdate( transactorOptions, ) if err != nil { @@ -132,12 +132,12 @@ func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( err, tbtcs.transactorOptions.From, nil, - "refreshMinimumBondableValue", + "finalizeKeepFactoriesUpdate", ) } tbtcsLogger.Infof( - "submitted transaction refreshMinimumBondableValue with id: [%v] and nonce [%v]", + "submitted transaction finalizeKeepFactoriesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -148,7 +148,7 @@ func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.RefreshMinimumBondableValue( + transaction, err := tbtcs.contract.FinalizeKeepFactoriesUpdate( transactorOptions, ) if err != nil { @@ -156,12 +156,12 @@ func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( err, tbtcs.transactorOptions.From, nil, - "refreshMinimumBondableValue", + "finalizeKeepFactoriesUpdate", ) } tbtcsLogger.Infof( - "submitted transaction refreshMinimumBondableValue with id: [%v] and nonce [%v]", + "submitted transaction finalizeKeepFactoriesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -176,7 +176,7 @@ func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallRefreshMinimumBondableValue( +func (tbtcs *TBTCSystem) CallFinalizeKeepFactoriesUpdate( blockNumber *big.Int, ) error { var result interface{} = nil @@ -188,20 +188,20 @@ func (tbtcs *TBTCSystem) CallRefreshMinimumBondableValue( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "refreshMinimumBondableValue", + "finalizeKeepFactoriesUpdate", &result, ) return err } -func (tbtcs *TBTCSystem) RefreshMinimumBondableValueGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdateGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "refreshMinimumBondableValue", + "finalizeKeepFactoriesUpdate", tbtcs.contractABI, tbtcs.transactor, ) @@ -210,12 +210,21 @@ func (tbtcs *TBTCSystem) RefreshMinimumBondableValueGasEstimate() (uint64, error } // Transaction submission. -func (tbtcs *TBTCSystem) ResumeNewDeposits( +func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdate( + _keepStakedFactory common.Address, + _fullyBackedFactory common.Address, + _factorySelector common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction resumeNewDeposits", + "submitting transaction beginKeepFactoriesUpdate", + "params: ", + fmt.Sprint( + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, + ), ) tbtcs.transactionMutex.Lock() @@ -240,20 +249,26 @@ func (tbtcs *TBTCSystem) ResumeNewDeposits( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.ResumeNewDeposits( + transaction, err := tbtcs.contract.BeginKeepFactoriesUpdate( transactorOptions, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "resumeNewDeposits", + "beginKeepFactoriesUpdate", + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) } tbtcsLogger.Infof( - "submitted transaction resumeNewDeposits with id: [%v] and nonce [%v]", + "submitted transaction beginKeepFactoriesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -264,20 +279,26 @@ func (tbtcs *TBTCSystem) ResumeNewDeposits( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.ResumeNewDeposits( + transaction, err := tbtcs.contract.BeginKeepFactoriesUpdate( transactorOptions, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "resumeNewDeposits", + "beginKeepFactoriesUpdate", + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) } tbtcsLogger.Infof( - "submitted transaction resumeNewDeposits with id: [%v] and nonce [%v]", + "submitted transaction beginKeepFactoriesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -292,7 +313,10 @@ func (tbtcs *TBTCSystem) ResumeNewDeposits( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallResumeNewDeposits( +func (tbtcs *TBTCSystem) CallBeginKeepFactoriesUpdate( + _keepStakedFactory common.Address, + _fullyBackedFactory common.Address, + _factorySelector common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -304,22 +328,32 @@ func (tbtcs *TBTCSystem) CallResumeNewDeposits( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "resumeNewDeposits", + "beginKeepFactoriesUpdate", &result, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) return err } -func (tbtcs *TBTCSystem) ResumeNewDepositsGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdateGasEstimate( + _keepStakedFactory common.Address, + _fullyBackedFactory common.Address, + _factorySelector common.Address, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "resumeNewDeposits", + "beginKeepFactoriesUpdate", tbtcs.contractABI, tbtcs.transactor, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) return result, err @@ -441,156 +475,6 @@ func (tbtcs *TBTCSystem) EmergencyPauseNewDepositsGasEstimate() (uint64, error) return result, err } -// Transaction submission. -func (tbtcs *TBTCSystem) LogGotRedemptionSignature( - _digest [32]uint8, - _r [32]uint8, - _s [32]uint8, - - transactionOptions ...ethutil.TransactionOptions, -) (*types.Transaction, error) { - tbtcsLogger.Debug( - "submitting transaction logGotRedemptionSignature", - "params: ", - fmt.Sprint( - _digest, - _r, - _s, - ), - ) - - tbtcs.transactionMutex.Lock() - defer tbtcs.transactionMutex.Unlock() - - // create a copy - transactorOptions := new(bind.TransactOpts) - *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.LogGotRedemptionSignature( - transactorOptions, - _digest, - _r, - _s, - ) - if err != nil { - return transaction, tbtcs.errorResolver.ResolveError( - err, - tbtcs.transactorOptions.From, - nil, - "logGotRedemptionSignature", - _digest, - _r, - _s, - ) - } - - tbtcsLogger.Infof( - "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - go tbtcs.miningWaiter.ForceMining( - transaction, - func(newGasPrice *big.Int) (*types.Transaction, error) { - transactorOptions.GasLimit = transaction.Gas() - transactorOptions.GasPrice = newGasPrice - - transaction, err := tbtcs.contract.LogGotRedemptionSignature( - transactorOptions, - _digest, - _r, - _s, - ) - if err != nil { - return transaction, tbtcs.errorResolver.ResolveError( - err, - tbtcs.transactorOptions.From, - nil, - "logGotRedemptionSignature", - _digest, - _r, - _s, - ) - } - - tbtcsLogger.Infof( - "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - return transaction, nil - }, - ) - - tbtcs.nonceManager.IncrementNonce() - - return transaction, err -} - -// Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogGotRedemptionSignature( - _digest [32]uint8, - _r [32]uint8, - _s [32]uint8, - blockNumber *big.Int, -) error { - var result interface{} = nil - - err := ethutil.CallAtBlock( - tbtcs.transactorOptions.From, - blockNumber, nil, - tbtcs.contractABI, - tbtcs.caller, - tbtcs.errorResolver, - tbtcs.contractAddress, - "logGotRedemptionSignature", - &result, - _digest, - _r, - _s, - ) - - return err -} - -func (tbtcs *TBTCSystem) LogGotRedemptionSignatureGasEstimate( - _digest [32]uint8, - _r [32]uint8, - _s [32]uint8, -) (uint64, error) { - var result uint64 - - result, err := ethutil.EstimateGas( - tbtcs.callerOptions.From, - tbtcs.contractAddress, - "logGotRedemptionSignature", - tbtcs.contractABI, - tbtcs.transactor, - _digest, - _r, - _s, - ) - - return result, err -} - // Transaction submission. func (tbtcs *TBTCSystem) LogRedemptionRequested( _requester common.Address, @@ -772,20 +656,16 @@ func (tbtcs *TBTCSystem) LogRedemptionRequestedGasEstimate( } // Transaction submission. -func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdate( - _keepStakedFactory common.Address, - _fullyBackedFactory common.Address, - _factorySelector common.Address, +func (tbtcs *TBTCSystem) LogStartedLiquidation( + _wasFraud bool, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction beginKeepFactoriesUpdate", + "submitting transaction logStartedLiquidation", "params: ", fmt.Sprint( - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + _wasFraud, ), ) @@ -811,26 +691,22 @@ func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.BeginKeepFactoriesUpdate( + transaction, err := tbtcs.contract.LogStartedLiquidation( transactorOptions, - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + _wasFraud, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginKeepFactoriesUpdate", - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + "logStartedLiquidation", + _wasFraud, ) } tbtcsLogger.Infof( - "submitted transaction beginKeepFactoriesUpdate with id: [%v] and nonce [%v]", + "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -841,26 +717,22 @@ func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.BeginKeepFactoriesUpdate( + transaction, err := tbtcs.contract.LogStartedLiquidation( transactorOptions, - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + _wasFraud, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginKeepFactoriesUpdate", - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + "logStartedLiquidation", + _wasFraud, ) } tbtcsLogger.Infof( - "submitted transaction beginKeepFactoriesUpdate with id: [%v] and nonce [%v]", + "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -875,10 +747,8 @@ func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallBeginKeepFactoriesUpdate( - _keepStakedFactory common.Address, - _fullyBackedFactory common.Address, - _factorySelector common.Address, +func (tbtcs *TBTCSystem) CallLogStartedLiquidation( + _wasFraud bool, blockNumber *big.Int, ) error { var result interface{} = nil @@ -890,48 +760,42 @@ func (tbtcs *TBTCSystem) CallBeginKeepFactoriesUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "beginKeepFactoriesUpdate", + "logStartedLiquidation", &result, - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + _wasFraud, ) return err } -func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdateGasEstimate( - _keepStakedFactory common.Address, - _fullyBackedFactory common.Address, - _factorySelector common.Address, +func (tbtcs *TBTCSystem) LogStartedLiquidationGasEstimate( + _wasFraud bool, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "beginKeepFactoriesUpdate", + "logStartedLiquidation", tbtcs.contractABI, tbtcs.transactor, - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + _wasFraud, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogCreated( - _keepAddress common.Address, +func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAddition( + _ethBtcPriceFeed common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logCreated", + "submitting transaction beginEthBtcPriceFeedAddition", "params: ", fmt.Sprint( - _keepAddress, + _ethBtcPriceFeed, ), ) @@ -957,22 +821,22 @@ func (tbtcs *TBTCSystem) LogCreated( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogCreated( + transaction, err := tbtcs.contract.BeginEthBtcPriceFeedAddition( transactorOptions, - _keepAddress, + _ethBtcPriceFeed, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logCreated", - _keepAddress, + "beginEthBtcPriceFeedAddition", + _ethBtcPriceFeed, ) } tbtcsLogger.Infof( - "submitted transaction logCreated with id: [%v] and nonce [%v]", + "submitted transaction beginEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -983,22 +847,22 @@ func (tbtcs *TBTCSystem) LogCreated( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogCreated( + transaction, err := tbtcs.contract.BeginEthBtcPriceFeedAddition( transactorOptions, - _keepAddress, + _ethBtcPriceFeed, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logCreated", - _keepAddress, + "beginEthBtcPriceFeedAddition", + _ethBtcPriceFeed, ) } tbtcsLogger.Infof( - "submitted transaction logCreated with id: [%v] and nonce [%v]", + "submitted transaction beginEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1013,8 +877,8 @@ func (tbtcs *TBTCSystem) LogCreated( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogCreated( - _keepAddress common.Address, +func (tbtcs *TBTCSystem) CallBeginEthBtcPriceFeedAddition( + _ethBtcPriceFeed common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1026,42 +890,42 @@ func (tbtcs *TBTCSystem) CallLogCreated( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logCreated", + "beginEthBtcPriceFeedAddition", &result, - _keepAddress, + _ethBtcPriceFeed, ) return err } -func (tbtcs *TBTCSystem) LogCreatedGasEstimate( - _keepAddress common.Address, +func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAdditionGasEstimate( + _ethBtcPriceFeed common.Address, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logCreated", + "beginEthBtcPriceFeedAddition", tbtcs.contractABI, tbtcs.transactor, - _keepAddress, + _ethBtcPriceFeed, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogStartedLiquidation( - _wasFraud bool, +func (tbtcs *TBTCSystem) TransferOwnership( + newOwner common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logStartedLiquidation", + "submitting transaction transferOwnership", "params: ", fmt.Sprint( - _wasFraud, + newOwner, ), ) @@ -1087,22 +951,22 @@ func (tbtcs *TBTCSystem) LogStartedLiquidation( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogStartedLiquidation( + transaction, err := tbtcs.contract.TransferOwnership( transactorOptions, - _wasFraud, + newOwner, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logStartedLiquidation", - _wasFraud, + "transferOwnership", + newOwner, ) } tbtcsLogger.Infof( - "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction transferOwnership with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1113,22 +977,22 @@ func (tbtcs *TBTCSystem) LogStartedLiquidation( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogStartedLiquidation( + transaction, err := tbtcs.contract.TransferOwnership( transactorOptions, - _wasFraud, + newOwner, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logStartedLiquidation", - _wasFraud, + "transferOwnership", + newOwner, ) } tbtcsLogger.Infof( - "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction transferOwnership with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1143,8 +1007,8 @@ func (tbtcs *TBTCSystem) LogStartedLiquidation( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogStartedLiquidation( - _wasFraud bool, +func (tbtcs *TBTCSystem) CallTransferOwnership( + newOwner common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1156,38 +1020,43 @@ func (tbtcs *TBTCSystem) CallLogStartedLiquidation( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logStartedLiquidation", + "transferOwnership", &result, - _wasFraud, + newOwner, ) return err } -func (tbtcs *TBTCSystem) LogStartedLiquidationGasEstimate( - _wasFraud bool, +func (tbtcs *TBTCSystem) TransferOwnershipGasEstimate( + newOwner common.Address, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logStartedLiquidation", + "transferOwnership", tbtcs.contractABI, tbtcs.transactor, - _wasFraud, + newOwner, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAddition( +func (tbtcs *TBTCSystem) LogRedeemed( + _txid [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction finalizeEthBtcPriceFeedAddition", + "submitting transaction logRedeemed", + "params: ", + fmt.Sprint( + _txid, + ), ) tbtcs.transactionMutex.Lock() @@ -1212,20 +1081,22 @@ func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAddition( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.FinalizeEthBtcPriceFeedAddition( + transaction, err := tbtcs.contract.LogRedeemed( transactorOptions, + _txid, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeEthBtcPriceFeedAddition", + "logRedeemed", + _txid, ) } tbtcsLogger.Infof( - "submitted transaction finalizeEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + "submitted transaction logRedeemed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1236,20 +1107,22 @@ func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAddition( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.FinalizeEthBtcPriceFeedAddition( + transaction, err := tbtcs.contract.LogRedeemed( transactorOptions, + _txid, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeEthBtcPriceFeedAddition", + "logRedeemed", + _txid, ) } tbtcsLogger.Infof( - "submitted transaction finalizeEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + "submitted transaction logRedeemed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1264,7 +1137,8 @@ func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAddition( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallFinalizeEthBtcPriceFeedAddition( +func (tbtcs *TBTCSystem) CallLogRedeemed( + _txid [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1276,41 +1150,38 @@ func (tbtcs *TBTCSystem) CallFinalizeEthBtcPriceFeedAddition( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "finalizeEthBtcPriceFeedAddition", + "logRedeemed", &result, + _txid, ) return err } -func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAdditionGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogRedeemedGasEstimate( + _txid [32]uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "finalizeEthBtcPriceFeedAddition", + "logRedeemed", tbtcs.contractABI, tbtcs.transactor, + _txid, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogRegisteredPubkey( - _signingGroupPubkeyX [32]uint8, - _signingGroupPubkeyY [32]uint8, +func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdate( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logRegisteredPubkey", - "params: ", - fmt.Sprint( - _signingGroupPubkeyX, - _signingGroupPubkeyY, - ), + "submitting transaction finalizeSignerFeeDivisorUpdate", ) tbtcs.transactionMutex.Lock() @@ -1335,24 +1206,20 @@ func (tbtcs *TBTCSystem) LogRegisteredPubkey( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogRegisteredPubkey( + transaction, err := tbtcs.contract.FinalizeSignerFeeDivisorUpdate( transactorOptions, - _signingGroupPubkeyX, - _signingGroupPubkeyY, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logRegisteredPubkey", - _signingGroupPubkeyX, - _signingGroupPubkeyY, + "finalizeSignerFeeDivisorUpdate", ) } tbtcsLogger.Infof( - "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", + "submitted transaction finalizeSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1363,24 +1230,20 @@ func (tbtcs *TBTCSystem) LogRegisteredPubkey( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogRegisteredPubkey( + transaction, err := tbtcs.contract.FinalizeSignerFeeDivisorUpdate( transactorOptions, - _signingGroupPubkeyX, - _signingGroupPubkeyY, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logRegisteredPubkey", - _signingGroupPubkeyX, - _signingGroupPubkeyY, + "finalizeSignerFeeDivisorUpdate", ) } tbtcsLogger.Infof( - "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", + "submitted transaction finalizeSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1395,9 +1258,7 @@ func (tbtcs *TBTCSystem) LogRegisteredPubkey( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogRegisteredPubkey( - _signingGroupPubkeyX [32]uint8, - _signingGroupPubkeyY [32]uint8, +func (tbtcs *TBTCSystem) CallFinalizeSignerFeeDivisorUpdate( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1409,41 +1270,34 @@ func (tbtcs *TBTCSystem) CallLogRegisteredPubkey( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logRegisteredPubkey", + "finalizeSignerFeeDivisorUpdate", &result, - _signingGroupPubkeyX, - _signingGroupPubkeyY, ) return err } -func (tbtcs *TBTCSystem) LogRegisteredPubkeyGasEstimate( - _signingGroupPubkeyX [32]uint8, - _signingGroupPubkeyY [32]uint8, -) (uint64, error) { +func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdateGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logRegisteredPubkey", + "finalizeSignerFeeDivisorUpdate", tbtcs.contractABI, tbtcs.transactor, - _signingGroupPubkeyX, - _signingGroupPubkeyY, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( +func (tbtcs *TBTCSystem) ResumeNewDeposits( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction finalizeKeepFactoriesUpdate", + "submitting transaction resumeNewDeposits", ) tbtcs.transactionMutex.Lock() @@ -1468,7 +1322,7 @@ func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.FinalizeKeepFactoriesUpdate( + transaction, err := tbtcs.contract.ResumeNewDeposits( transactorOptions, ) if err != nil { @@ -1476,12 +1330,12 @@ func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( err, tbtcs.transactorOptions.From, nil, - "finalizeKeepFactoriesUpdate", + "resumeNewDeposits", ) } tbtcsLogger.Infof( - "submitted transaction finalizeKeepFactoriesUpdate with id: [%v] and nonce [%v]", + "submitted transaction resumeNewDeposits with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1492,7 +1346,7 @@ func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.FinalizeKeepFactoriesUpdate( + transaction, err := tbtcs.contract.ResumeNewDeposits( transactorOptions, ) if err != nil { @@ -1500,12 +1354,12 @@ func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( err, tbtcs.transactorOptions.From, nil, - "finalizeKeepFactoriesUpdate", + "resumeNewDeposits", ) } tbtcsLogger.Infof( - "submitted transaction finalizeKeepFactoriesUpdate with id: [%v] and nonce [%v]", + "submitted transaction resumeNewDeposits with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1520,7 +1374,7 @@ func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallFinalizeKeepFactoriesUpdate( +func (tbtcs *TBTCSystem) CallResumeNewDeposits( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1532,20 +1386,20 @@ func (tbtcs *TBTCSystem) CallFinalizeKeepFactoriesUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "finalizeKeepFactoriesUpdate", + "resumeNewDeposits", &result, ) return err } -func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdateGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) ResumeNewDepositsGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "finalizeKeepFactoriesUpdate", + "resumeNewDeposits", tbtcs.contractABI, tbtcs.transactor, ) @@ -1554,17 +1408,12 @@ func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdateGasEstimate() (uint64, error } // Transaction submission. -func (tbtcs *TBTCSystem) LogFunded( - _txid [32]uint8, +func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logFunded", - "params: ", - fmt.Sprint( - _txid, - ), + "submitting transaction refreshMinimumBondableValue", ) tbtcs.transactionMutex.Lock() @@ -1589,22 +1438,20 @@ func (tbtcs *TBTCSystem) LogFunded( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogFunded( + transaction, err := tbtcs.contract.RefreshMinimumBondableValue( transactorOptions, - _txid, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logFunded", - _txid, + "refreshMinimumBondableValue", ) } tbtcsLogger.Infof( - "submitted transaction logFunded with id: [%v] and nonce [%v]", + "submitted transaction refreshMinimumBondableValue with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1615,22 +1462,20 @@ func (tbtcs *TBTCSystem) LogFunded( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogFunded( + transaction, err := tbtcs.contract.RefreshMinimumBondableValue( transactorOptions, - _txid, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logFunded", - _txid, + "refreshMinimumBondableValue", ) } tbtcsLogger.Infof( - "submitted transaction logFunded with id: [%v] and nonce [%v]", + "submitted transaction refreshMinimumBondableValue with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1645,8 +1490,7 @@ func (tbtcs *TBTCSystem) LogFunded( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogFunded( - _txid [32]uint8, +func (tbtcs *TBTCSystem) CallRefreshMinimumBondableValue( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1658,47 +1502,34 @@ func (tbtcs *TBTCSystem) CallLogFunded( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logFunded", + "refreshMinimumBondableValue", &result, - _txid, ) return err } -func (tbtcs *TBTCSystem) LogFundedGasEstimate( - _txid [32]uint8, -) (uint64, error) { +func (tbtcs *TBTCSystem) RefreshMinimumBondableValueGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logFunded", + "refreshMinimumBondableValue", tbtcs.contractABI, tbtcs.transactor, - _txid, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdate( - _initialCollateralizedPercent uint16, - _undercollateralizedThresholdPercent uint16, - _severelyUndercollateralizedThresholdPercent uint16, +func (tbtcs *TBTCSystem) RenounceOwnership( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction beginCollateralizationThresholdsUpdate", - "params: ", - fmt.Sprint( - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, - ), + "submitting transaction renounceOwnership", ) tbtcs.transactionMutex.Lock() @@ -1723,26 +1554,20 @@ func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.BeginCollateralizationThresholdsUpdate( + transaction, err := tbtcs.contract.RenounceOwnership( transactorOptions, - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginCollateralizationThresholdsUpdate", - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, + "renounceOwnership", ) } tbtcsLogger.Infof( - "submitted transaction beginCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", + "submitted transaction renounceOwnership with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1753,26 +1578,20 @@ func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.BeginCollateralizationThresholdsUpdate( + transaction, err := tbtcs.contract.RenounceOwnership( transactorOptions, - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginCollateralizationThresholdsUpdate", - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, + "renounceOwnership", ) } tbtcsLogger.Infof( - "submitted transaction beginCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", + "submitted transaction renounceOwnership with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1787,10 +1606,7 @@ func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallBeginCollateralizationThresholdsUpdate( - _initialCollateralizedPercent uint16, - _undercollateralizedThresholdPercent uint16, - _severelyUndercollateralizedThresholdPercent uint16, +func (tbtcs *TBTCSystem) CallRenounceOwnership( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1802,49 +1618,34 @@ func (tbtcs *TBTCSystem) CallBeginCollateralizationThresholdsUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "beginCollateralizationThresholdsUpdate", + "renounceOwnership", &result, - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, ) return err } -func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdateGasEstimate( - _initialCollateralizedPercent uint16, - _undercollateralizedThresholdPercent uint16, - _severelyUndercollateralizedThresholdPercent uint16, -) (uint64, error) { +func (tbtcs *TBTCSystem) RenounceOwnershipGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "beginCollateralizationThresholdsUpdate", + "renounceOwnership", tbtcs.contractABI, tbtcs.transactor, - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdate( - _signerFeeDivisor uint16, +func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdate( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction beginSignerFeeDivisorUpdate", - "params: ", - fmt.Sprint( - _signerFeeDivisor, - ), + "submitting transaction finalizeCollateralizationThresholdsUpdate", ) tbtcs.transactionMutex.Lock() @@ -1869,22 +1670,20 @@ func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.BeginSignerFeeDivisorUpdate( + transaction, err := tbtcs.contract.FinalizeCollateralizationThresholdsUpdate( transactorOptions, - _signerFeeDivisor, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginSignerFeeDivisorUpdate", - _signerFeeDivisor, + "finalizeCollateralizationThresholdsUpdate", ) } tbtcsLogger.Infof( - "submitted transaction beginSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + "submitted transaction finalizeCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1895,22 +1694,20 @@ func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.BeginSignerFeeDivisorUpdate( + transaction, err := tbtcs.contract.FinalizeCollateralizationThresholdsUpdate( transactorOptions, - _signerFeeDivisor, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginSignerFeeDivisorUpdate", - _signerFeeDivisor, + "finalizeCollateralizationThresholdsUpdate", ) } tbtcsLogger.Infof( - "submitted transaction beginSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + "submitted transaction finalizeCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1925,8 +1722,7 @@ func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallBeginSignerFeeDivisorUpdate( - _signerFeeDivisor uint16, +func (tbtcs *TBTCSystem) CallFinalizeCollateralizationThresholdsUpdate( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1938,38 +1734,55 @@ func (tbtcs *TBTCSystem) CallBeginSignerFeeDivisorUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "beginSignerFeeDivisorUpdate", + "finalizeCollateralizationThresholdsUpdate", &result, - _signerFeeDivisor, ) return err } -func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdateGasEstimate( - _signerFeeDivisor uint16, -) (uint64, error) { +func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdateGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "beginSignerFeeDivisorUpdate", + "finalizeCollateralizationThresholdsUpdate", tbtcs.contractABI, tbtcs.transactor, - _signerFeeDivisor, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( +func (tbtcs *TBTCSystem) Initialize( + _defaultKeepFactory common.Address, + _depositFactory common.Address, + _masterDepositAddress common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachine common.Address, + _keepThreshold uint16, + _keepSize uint16, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction finalizeLotSizesUpdate", + "submitting transaction initialize", + "params: ", + fmt.Sprint( + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, + ), ) tbtcs.transactionMutex.Lock() @@ -1994,20 +1807,38 @@ func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.FinalizeLotSizesUpdate( + transaction, err := tbtcs.contract.Initialize( transactorOptions, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeLotSizesUpdate", + "initialize", + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ) } tbtcsLogger.Infof( - "submitted transaction finalizeLotSizesUpdate with id: [%v] and nonce [%v]", + "submitted transaction initialize with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2018,20 +1849,38 @@ func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.FinalizeLotSizesUpdate( + transaction, err := tbtcs.contract.Initialize( transactorOptions, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeLotSizesUpdate", + "initialize", + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ) } tbtcsLogger.Infof( - "submitted transaction finalizeLotSizesUpdate with id: [%v] and nonce [%v]", + "submitted transaction initialize with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2046,7 +1895,16 @@ func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallFinalizeLotSizesUpdate( +func (tbtcs *TBTCSystem) CallInitialize( + _defaultKeepFactory common.Address, + _depositFactory common.Address, + _masterDepositAddress common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachine common.Address, + _keepThreshold uint16, + _keepSize uint16, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2058,34 +1916,71 @@ func (tbtcs *TBTCSystem) CallFinalizeLotSizesUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "finalizeLotSizesUpdate", + "initialize", &result, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ) return err } -func (tbtcs *TBTCSystem) FinalizeLotSizesUpdateGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) InitializeGasEstimate( + _defaultKeepFactory common.Address, + _depositFactory common.Address, + _masterDepositAddress common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachine common.Address, + _keepThreshold uint16, + _keepSize uint16, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "finalizeLotSizesUpdate", + "initialize", tbtcs.contractABI, tbtcs.transactor, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogCourtesyCalled( +func (tbtcs *TBTCSystem) RequestNewKeep( + _requestedLotSizeSatoshis uint64, + _maxSecuredLifetime *big.Int, + value *big.Int, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logCourtesyCalled", + "submitting transaction requestNewKeep", + "params: ", + fmt.Sprint( + _requestedLotSizeSatoshis, + _maxSecuredLifetime, + ), + "value: ", value, ) tbtcs.transactionMutex.Lock() @@ -2095,6 +1990,8 @@ func (tbtcs *TBTCSystem) LogCourtesyCalled( transactorOptions := new(bind.TransactOpts) *transactorOptions = *tbtcs.transactorOptions + transactorOptions.Value = value + if len(transactionOptions) > 1 { return nil, fmt.Errorf( "could not process multiple transaction options sets", @@ -2110,20 +2007,24 @@ func (tbtcs *TBTCSystem) LogCourtesyCalled( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogCourtesyCalled( + transaction, err := tbtcs.contract.RequestNewKeep( transactorOptions, + _requestedLotSizeSatoshis, + _maxSecuredLifetime, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, - nil, - "logCourtesyCalled", - ) + value, + "requestNewKeep", + _requestedLotSizeSatoshis, + _maxSecuredLifetime, + ) } tbtcsLogger.Infof( - "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", + "submitted transaction requestNewKeep with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2134,20 +2035,24 @@ func (tbtcs *TBTCSystem) LogCourtesyCalled( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogCourtesyCalled( + transaction, err := tbtcs.contract.RequestNewKeep( transactorOptions, + _requestedLotSizeSatoshis, + _maxSecuredLifetime, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, - nil, - "logCourtesyCalled", + value, + "requestNewKeep", + _requestedLotSizeSatoshis, + _maxSecuredLifetime, ) } tbtcsLogger.Infof( - "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", + "submitted transaction requestNewKeep with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2162,46 +2067,56 @@ func (tbtcs *TBTCSystem) LogCourtesyCalled( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogCourtesyCalled( +func (tbtcs *TBTCSystem) CallRequestNewKeep( + _requestedLotSizeSatoshis uint64, + _maxSecuredLifetime *big.Int, + value *big.Int, blockNumber *big.Int, -) error { - var result interface{} = nil +) (common.Address, error) { + var result common.Address err := ethutil.CallAtBlock( tbtcs.transactorOptions.From, - blockNumber, nil, + blockNumber, value, tbtcs.contractABI, tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logCourtesyCalled", + "requestNewKeep", &result, + _requestedLotSizeSatoshis, + _maxSecuredLifetime, ) - return err + return result, err } -func (tbtcs *TBTCSystem) LogCourtesyCalledGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) RequestNewKeepGasEstimate( + _requestedLotSizeSatoshis uint64, + _maxSecuredLifetime *big.Int, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logCourtesyCalled", + "requestNewKeep", tbtcs.contractABI, tbtcs.transactor, + _requestedLotSizeSatoshis, + _maxSecuredLifetime, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) RenounceOwnership( +func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction renounceOwnership", + "submitting transaction finalizeLotSizesUpdate", ) tbtcs.transactionMutex.Lock() @@ -2226,7 +2141,7 @@ func (tbtcs *TBTCSystem) RenounceOwnership( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.RenounceOwnership( + transaction, err := tbtcs.contract.FinalizeLotSizesUpdate( transactorOptions, ) if err != nil { @@ -2234,12 +2149,12 @@ func (tbtcs *TBTCSystem) RenounceOwnership( err, tbtcs.transactorOptions.From, nil, - "renounceOwnership", + "finalizeLotSizesUpdate", ) } tbtcsLogger.Infof( - "submitted transaction renounceOwnership with id: [%v] and nonce [%v]", + "submitted transaction finalizeLotSizesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2250,7 +2165,7 @@ func (tbtcs *TBTCSystem) RenounceOwnership( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.RenounceOwnership( + transaction, err := tbtcs.contract.FinalizeLotSizesUpdate( transactorOptions, ) if err != nil { @@ -2258,12 +2173,12 @@ func (tbtcs *TBTCSystem) RenounceOwnership( err, tbtcs.transactorOptions.From, nil, - "renounceOwnership", + "finalizeLotSizesUpdate", ) } tbtcsLogger.Infof( - "submitted transaction renounceOwnership with id: [%v] and nonce [%v]", + "submitted transaction finalizeLotSizesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2278,7 +2193,7 @@ func (tbtcs *TBTCSystem) RenounceOwnership( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallRenounceOwnership( +func (tbtcs *TBTCSystem) CallFinalizeLotSizesUpdate( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2290,20 +2205,20 @@ func (tbtcs *TBTCSystem) CallRenounceOwnership( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "renounceOwnership", + "finalizeLotSizesUpdate", &result, ) return err } -func (tbtcs *TBTCSystem) RenounceOwnershipGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) FinalizeLotSizesUpdateGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "renounceOwnership", + "finalizeLotSizesUpdate", tbtcs.contractABI, tbtcs.transactor, ) @@ -2312,21 +2227,19 @@ func (tbtcs *TBTCSystem) RenounceOwnershipGasEstimate() (uint64, error) { } // Transaction submission. -func (tbtcs *TBTCSystem) RequestNewKeep( - _requestedLotSizeSatoshis uint64, - _maxSecuredLifetime *big.Int, - value *big.Int, +func (tbtcs *TBTCSystem) LogRegisteredPubkey( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction requestNewKeep", + "submitting transaction logRegisteredPubkey", "params: ", fmt.Sprint( - _requestedLotSizeSatoshis, - _maxSecuredLifetime, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ), - "value: ", value, ) tbtcs.transactionMutex.Lock() @@ -2336,8 +2249,6 @@ func (tbtcs *TBTCSystem) RequestNewKeep( transactorOptions := new(bind.TransactOpts) *transactorOptions = *tbtcs.transactorOptions - transactorOptions.Value = value - if len(transactionOptions) > 1 { return nil, fmt.Errorf( "could not process multiple transaction options sets", @@ -2353,24 +2264,24 @@ func (tbtcs *TBTCSystem) RequestNewKeep( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.RequestNewKeep( + transaction, err := tbtcs.contract.LogRegisteredPubkey( transactorOptions, - _requestedLotSizeSatoshis, - _maxSecuredLifetime, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, - value, - "requestNewKeep", - _requestedLotSizeSatoshis, - _maxSecuredLifetime, + nil, + "logRegisteredPubkey", + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) } tbtcsLogger.Infof( - "submitted transaction requestNewKeep with id: [%v] and nonce [%v]", + "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2381,24 +2292,24 @@ func (tbtcs *TBTCSystem) RequestNewKeep( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.RequestNewKeep( + transaction, err := tbtcs.contract.LogRegisteredPubkey( transactorOptions, - _requestedLotSizeSatoshis, - _maxSecuredLifetime, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, - value, - "requestNewKeep", - _requestedLotSizeSatoshis, - _maxSecuredLifetime, + nil, + "logRegisteredPubkey", + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) } tbtcsLogger.Infof( - "submitted transaction requestNewKeep with id: [%v] and nonce [%v]", + "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2413,76 +2324,59 @@ func (tbtcs *TBTCSystem) RequestNewKeep( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallRequestNewKeep( - _requestedLotSizeSatoshis uint64, - _maxSecuredLifetime *big.Int, - value *big.Int, +func (tbtcs *TBTCSystem) CallLogRegisteredPubkey( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, blockNumber *big.Int, -) (common.Address, error) { - var result common.Address +) error { + var result interface{} = nil err := ethutil.CallAtBlock( tbtcs.transactorOptions.From, - blockNumber, value, + blockNumber, nil, tbtcs.contractABI, tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "requestNewKeep", + "logRegisteredPubkey", &result, - _requestedLotSizeSatoshis, - _maxSecuredLifetime, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) - return result, err + return err } -func (tbtcs *TBTCSystem) RequestNewKeepGasEstimate( - _requestedLotSizeSatoshis uint64, - _maxSecuredLifetime *big.Int, +func (tbtcs *TBTCSystem) LogRegisteredPubkeyGasEstimate( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "requestNewKeep", + "logRegisteredPubkey", tbtcs.contractABI, tbtcs.transactor, - _requestedLotSizeSatoshis, - _maxSecuredLifetime, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) Initialize( - _defaultKeepFactory common.Address, - _depositFactory common.Address, - _masterDepositAddress common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachine common.Address, - _keepThreshold uint16, - _keepSize uint16, +func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdate( + _signerFeeDivisor uint16, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction initialize", + "submitting transaction beginSignerFeeDivisorUpdate", "params: ", fmt.Sprint( - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, + _signerFeeDivisor, ), ) @@ -2508,38 +2402,22 @@ func (tbtcs *TBTCSystem) Initialize( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.Initialize( + transaction, err := tbtcs.contract.BeginSignerFeeDivisorUpdate( transactorOptions, - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, + _signerFeeDivisor, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "initialize", - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, + "beginSignerFeeDivisorUpdate", + _signerFeeDivisor, ) } tbtcsLogger.Infof( - "submitted transaction initialize with id: [%v] and nonce [%v]", + "submitted transaction beginSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2550,38 +2428,22 @@ func (tbtcs *TBTCSystem) Initialize( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.Initialize( + transaction, err := tbtcs.contract.BeginSignerFeeDivisorUpdate( transactorOptions, - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, + _signerFeeDivisor, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "initialize", - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, + "beginSignerFeeDivisorUpdate", + _signerFeeDivisor, ) } tbtcsLogger.Infof( - "submitted transaction initialize with id: [%v] and nonce [%v]", + "submitted transaction beginSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2596,16 +2458,8 @@ func (tbtcs *TBTCSystem) Initialize( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallInitialize( - _defaultKeepFactory common.Address, - _depositFactory common.Address, - _masterDepositAddress common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachine common.Address, - _keepThreshold uint16, - _keepSize uint16, +func (tbtcs *TBTCSystem) CallBeginSignerFeeDivisorUpdate( + _signerFeeDivisor uint16, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2617,62 +2471,159 @@ func (tbtcs *TBTCSystem) CallInitialize( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "initialize", + "beginSignerFeeDivisorUpdate", &result, - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, + _signerFeeDivisor, ) return err } -func (tbtcs *TBTCSystem) InitializeGasEstimate( - _defaultKeepFactory common.Address, - _depositFactory common.Address, - _masterDepositAddress common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachine common.Address, - _keepThreshold uint16, - _keepSize uint16, +func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdateGasEstimate( + _signerFeeDivisor uint16, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "initialize", + "beginSignerFeeDivisorUpdate", + tbtcs.contractABI, + tbtcs.transactor, + _signerFeeDivisor, + ) + + return result, err +} + +// Transaction submission. +func (tbtcs *TBTCSystem) LogCourtesyCalled( + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + tbtcsLogger.Debug( + "submitting transaction logCourtesyCalled", + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *tbtcs.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 := tbtcs.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 := tbtcs.contract.LogCourtesyCalled( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logCourtesyCalled", + ) + } + + tbtcsLogger.Infof( + "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go tbtcs.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := tbtcs.contract.LogCourtesyCalled( + transactorOptions, + ) + if err != nil { + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "logCourtesyCalled", + ) + } + + tbtcsLogger.Infof( + "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + tbtcs.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (tbtcs *TBTCSystem) CallLogCourtesyCalled( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + tbtcs.transactorOptions.From, + blockNumber, nil, + tbtcs.contractABI, + tbtcs.caller, + tbtcs.errorResolver, + tbtcs.contractAddress, + "logCourtesyCalled", + &result, + ) + + return err +} + +func (tbtcs *TBTCSystem) LogCourtesyCalledGasEstimate() (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + tbtcs.callerOptions.From, + tbtcs.contractAddress, + "logCourtesyCalled", tbtcs.contractABI, tbtcs.transactor, - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdate( +func (tbtcs *TBTCSystem) LogFunderRequestedAbort( + _abortOutputScript []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction finalizeSignerFeeDivisorUpdate", + "submitting transaction logFunderRequestedAbort", + "params: ", + fmt.Sprint( + _abortOutputScript, + ), ) tbtcs.transactionMutex.Lock() @@ -2697,20 +2648,22 @@ func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.FinalizeSignerFeeDivisorUpdate( + transaction, err := tbtcs.contract.LogFunderRequestedAbort( transactorOptions, + _abortOutputScript, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeSignerFeeDivisorUpdate", + "logFunderRequestedAbort", + _abortOutputScript, ) } tbtcsLogger.Infof( - "submitted transaction finalizeSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2721,20 +2674,22 @@ func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.FinalizeSignerFeeDivisorUpdate( + transaction, err := tbtcs.contract.LogFunderRequestedAbort( transactorOptions, + _abortOutputScript, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeSignerFeeDivisorUpdate", + "logFunderRequestedAbort", + _abortOutputScript, ) } tbtcsLogger.Infof( - "submitted transaction finalizeSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2749,7 +2704,8 @@ func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallFinalizeSignerFeeDivisorUpdate( +func (tbtcs *TBTCSystem) CallLogFunderRequestedAbort( + _abortOutputScript []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2761,34 +2717,38 @@ func (tbtcs *TBTCSystem) CallFinalizeSignerFeeDivisorUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "finalizeSignerFeeDivisorUpdate", + "logFunderRequestedAbort", &result, + _abortOutputScript, ) return err } -func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdateGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogFunderRequestedAbortGasEstimate( + _abortOutputScript []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "finalizeSignerFeeDivisorUpdate", + "logFunderRequestedAbort", tbtcs.contractABI, tbtcs.transactor, + _abortOutputScript, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogExitedCourtesyCall( +func (tbtcs *TBTCSystem) LogSetupFailed( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logExitedCourtesyCall", + "submitting transaction logSetupFailed", ) tbtcs.transactionMutex.Lock() @@ -2813,7 +2773,7 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCall( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogExitedCourtesyCall( + transaction, err := tbtcs.contract.LogSetupFailed( transactorOptions, ) if err != nil { @@ -2821,12 +2781,12 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCall( err, tbtcs.transactorOptions.From, nil, - "logExitedCourtesyCall", + "logSetupFailed", ) } tbtcsLogger.Infof( - "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2837,7 +2797,7 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCall( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogExitedCourtesyCall( + transaction, err := tbtcs.contract.LogSetupFailed( transactorOptions, ) if err != nil { @@ -2845,12 +2805,12 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCall( err, tbtcs.transactorOptions.From, nil, - "logExitedCourtesyCall", + "logSetupFailed", ) } tbtcsLogger.Infof( - "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2865,7 +2825,7 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCall( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogExitedCourtesyCall( +func (tbtcs *TBTCSystem) CallLogSetupFailed( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2877,20 +2837,20 @@ func (tbtcs *TBTCSystem) CallLogExitedCourtesyCall( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logExitedCourtesyCall", + "logSetupFailed", &result, ) return err } -func (tbtcs *TBTCSystem) LogExitedCourtesyCallGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogSetupFailedGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logExitedCourtesyCall", + "logSetupFailed", tbtcs.contractABI, tbtcs.transactor, ) @@ -2899,16 +2859,16 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCallGasEstimate() (uint64, error) { } // Transaction submission. -func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAddition( - _ethBtcPriceFeed common.Address, +func (tbtcs *TBTCSystem) BeginLotSizesUpdate( + _lotSizes []uint64, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction beginEthBtcPriceFeedAddition", + "submitting transaction beginLotSizesUpdate", "params: ", fmt.Sprint( - _ethBtcPriceFeed, + _lotSizes, ), ) @@ -2934,22 +2894,22 @@ func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAddition( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.BeginEthBtcPriceFeedAddition( + transaction, err := tbtcs.contract.BeginLotSizesUpdate( transactorOptions, - _ethBtcPriceFeed, + _lotSizes, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginEthBtcPriceFeedAddition", - _ethBtcPriceFeed, + "beginLotSizesUpdate", + _lotSizes, ) } tbtcsLogger.Infof( - "submitted transaction beginEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + "submitted transaction beginLotSizesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2960,22 +2920,22 @@ func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAddition( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.BeginEthBtcPriceFeedAddition( + transaction, err := tbtcs.contract.BeginLotSizesUpdate( transactorOptions, - _ethBtcPriceFeed, + _lotSizes, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginEthBtcPriceFeedAddition", - _ethBtcPriceFeed, + "beginLotSizesUpdate", + _lotSizes, ) } tbtcsLogger.Infof( - "submitted transaction beginEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + "submitted transaction beginLotSizesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2990,8 +2950,8 @@ func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAddition( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallBeginEthBtcPriceFeedAddition( - _ethBtcPriceFeed common.Address, +func (tbtcs *TBTCSystem) CallBeginLotSizesUpdate( + _lotSizes []uint64, blockNumber *big.Int, ) error { var result interface{} = nil @@ -3003,43 +2963,38 @@ func (tbtcs *TBTCSystem) CallBeginEthBtcPriceFeedAddition( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "beginEthBtcPriceFeedAddition", + "beginLotSizesUpdate", &result, - _ethBtcPriceFeed, + _lotSizes, ) return err } -func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAdditionGasEstimate( - _ethBtcPriceFeed common.Address, +func (tbtcs *TBTCSystem) BeginLotSizesUpdateGasEstimate( + _lotSizes []uint64, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "beginEthBtcPriceFeedAddition", + "beginLotSizesUpdate", tbtcs.contractABI, tbtcs.transactor, - _ethBtcPriceFeed, + _lotSizes, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) BeginLotSizesUpdate( - _lotSizes []uint64, +func (tbtcs *TBTCSystem) LogFraudDuringSetup( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction beginLotSizesUpdate", - "params: ", - fmt.Sprint( - _lotSizes, - ), + "submitting transaction logFraudDuringSetup", ) tbtcs.transactionMutex.Lock() @@ -3064,22 +3019,20 @@ func (tbtcs *TBTCSystem) BeginLotSizesUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.BeginLotSizesUpdate( + transaction, err := tbtcs.contract.LogFraudDuringSetup( transactorOptions, - _lotSizes, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginLotSizesUpdate", - _lotSizes, + "logFraudDuringSetup", ) } tbtcsLogger.Infof( - "submitted transaction beginLotSizesUpdate with id: [%v] and nonce [%v]", + "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3090,22 +3043,20 @@ func (tbtcs *TBTCSystem) BeginLotSizesUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.BeginLotSizesUpdate( + transaction, err := tbtcs.contract.LogFraudDuringSetup( transactorOptions, - _lotSizes, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginLotSizesUpdate", - _lotSizes, + "logFraudDuringSetup", ) } tbtcsLogger.Infof( - "submitted transaction beginLotSizesUpdate with id: [%v] and nonce [%v]", + "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3120,8 +3071,7 @@ func (tbtcs *TBTCSystem) BeginLotSizesUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallBeginLotSizesUpdate( - _lotSizes []uint64, +func (tbtcs *TBTCSystem) CallLogFraudDuringSetup( blockNumber *big.Int, ) error { var result interface{} = nil @@ -3133,38 +3083,39 @@ func (tbtcs *TBTCSystem) CallBeginLotSizesUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "beginLotSizesUpdate", + "logFraudDuringSetup", &result, - _lotSizes, ) return err } -func (tbtcs *TBTCSystem) BeginLotSizesUpdateGasEstimate( - _lotSizes []uint64, -) (uint64, error) { +func (tbtcs *TBTCSystem) LogFraudDuringSetupGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "beginLotSizesUpdate", + "logFraudDuringSetup", tbtcs.contractABI, tbtcs.transactor, - _lotSizes, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogSetupFailed( +func (tbtcs *TBTCSystem) LogFunded( + _txid [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logSetupFailed", + "submitting transaction logFunded", + "params: ", + fmt.Sprint( + _txid, + ), ) tbtcs.transactionMutex.Lock() @@ -3189,20 +3140,22 @@ func (tbtcs *TBTCSystem) LogSetupFailed( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogSetupFailed( + transaction, err := tbtcs.contract.LogFunded( transactorOptions, + _txid, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logSetupFailed", + "logFunded", + _txid, ) } tbtcsLogger.Infof( - "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", + "submitted transaction logFunded with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3213,20 +3166,22 @@ func (tbtcs *TBTCSystem) LogSetupFailed( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogSetupFailed( + transaction, err := tbtcs.contract.LogFunded( transactorOptions, + _txid, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logSetupFailed", + "logFunded", + _txid, ) } tbtcsLogger.Infof( - "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", + "submitted transaction logFunded with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3241,7 +3196,8 @@ func (tbtcs *TBTCSystem) LogSetupFailed( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogSetupFailed( +func (tbtcs *TBTCSystem) CallLogFunded( + _txid [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -3253,38 +3209,46 @@ func (tbtcs *TBTCSystem) CallLogSetupFailed( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logSetupFailed", + "logFunded", &result, + _txid, ) return err } -func (tbtcs *TBTCSystem) LogSetupFailedGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogFundedGasEstimate( + _txid [32]uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logSetupFailed", + "logFunded", tbtcs.contractABI, tbtcs.transactor, + _txid, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogRedeemed( - _txid [32]uint8, +func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdate( + _initialCollateralizedPercent uint16, + _undercollateralizedThresholdPercent uint16, + _severelyUndercollateralizedThresholdPercent uint16, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logRedeemed", + "submitting transaction beginCollateralizationThresholdsUpdate", "params: ", fmt.Sprint( - _txid, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ), ) @@ -3310,22 +3274,26 @@ func (tbtcs *TBTCSystem) LogRedeemed( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogRedeemed( + transaction, err := tbtcs.contract.BeginCollateralizationThresholdsUpdate( transactorOptions, - _txid, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logRedeemed", - _txid, + "beginCollateralizationThresholdsUpdate", + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) } tbtcsLogger.Infof( - "submitted transaction logRedeemed with id: [%v] and nonce [%v]", + "submitted transaction beginCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3336,22 +3304,26 @@ func (tbtcs *TBTCSystem) LogRedeemed( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogRedeemed( + transaction, err := tbtcs.contract.BeginCollateralizationThresholdsUpdate( transactorOptions, - _txid, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logRedeemed", - _txid, + "beginCollateralizationThresholdsUpdate", + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) } tbtcsLogger.Infof( - "submitted transaction logRedeemed with id: [%v] and nonce [%v]", + "submitted transaction beginCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3366,8 +3338,10 @@ func (tbtcs *TBTCSystem) LogRedeemed( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogRedeemed( - _txid [32]uint8, +func (tbtcs *TBTCSystem) CallBeginCollateralizationThresholdsUpdate( + _initialCollateralizedPercent uint16, + _undercollateralizedThresholdPercent uint16, + _severelyUndercollateralizedThresholdPercent uint16, blockNumber *big.Int, ) error { var result interface{} = nil @@ -3379,43 +3353,44 @@ func (tbtcs *TBTCSystem) CallLogRedeemed( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logRedeemed", + "beginCollateralizationThresholdsUpdate", &result, - _txid, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) return err } -func (tbtcs *TBTCSystem) LogRedeemedGasEstimate( - _txid [32]uint8, +func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdateGasEstimate( + _initialCollateralizedPercent uint16, + _undercollateralizedThresholdPercent uint16, + _severelyUndercollateralizedThresholdPercent uint16, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logRedeemed", + "beginCollateralizationThresholdsUpdate", tbtcs.contractABI, tbtcs.transactor, - _txid, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogFunderRequestedAbort( - _abortOutputScript []uint8, +func (tbtcs *TBTCSystem) LogLiquidated( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logFunderRequestedAbort", - "params: ", - fmt.Sprint( - _abortOutputScript, - ), + "submitting transaction logLiquidated", ) tbtcs.transactionMutex.Lock() @@ -3440,22 +3415,20 @@ func (tbtcs *TBTCSystem) LogFunderRequestedAbort( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogFunderRequestedAbort( + transaction, err := tbtcs.contract.LogLiquidated( transactorOptions, - _abortOutputScript, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logFunderRequestedAbort", - _abortOutputScript, + "logLiquidated", ) } tbtcsLogger.Infof( - "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", + "submitted transaction logLiquidated with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3466,22 +3439,20 @@ func (tbtcs *TBTCSystem) LogFunderRequestedAbort( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogFunderRequestedAbort( + transaction, err := tbtcs.contract.LogLiquidated( transactorOptions, - _abortOutputScript, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logFunderRequestedAbort", - _abortOutputScript, + "logLiquidated", ) } tbtcsLogger.Infof( - "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", + "submitted transaction logLiquidated with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3496,8 +3467,7 @@ func (tbtcs *TBTCSystem) LogFunderRequestedAbort( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogFunderRequestedAbort( - _abortOutputScript []uint8, +func (tbtcs *TBTCSystem) CallLogLiquidated( blockNumber *big.Int, ) error { var result interface{} = nil @@ -3509,38 +3479,34 @@ func (tbtcs *TBTCSystem) CallLogFunderRequestedAbort( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logFunderRequestedAbort", + "logLiquidated", &result, - _abortOutputScript, ) return err } -func (tbtcs *TBTCSystem) LogFunderRequestedAbortGasEstimate( - _abortOutputScript []uint8, -) (uint64, error) { +func (tbtcs *TBTCSystem) LogLiquidatedGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logFunderRequestedAbort", + "logLiquidated", tbtcs.contractABI, tbtcs.transactor, - _abortOutputScript, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogLiquidated( +func (tbtcs *TBTCSystem) LogExitedCourtesyCall( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logLiquidated", + "submitting transaction logExitedCourtesyCall", ) tbtcs.transactionMutex.Lock() @@ -3565,7 +3531,7 @@ func (tbtcs *TBTCSystem) LogLiquidated( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogLiquidated( + transaction, err := tbtcs.contract.LogExitedCourtesyCall( transactorOptions, ) if err != nil { @@ -3573,12 +3539,12 @@ func (tbtcs *TBTCSystem) LogLiquidated( err, tbtcs.transactorOptions.From, nil, - "logLiquidated", + "logExitedCourtesyCall", ) } tbtcsLogger.Infof( - "submitted transaction logLiquidated with id: [%v] and nonce [%v]", + "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3589,7 +3555,7 @@ func (tbtcs *TBTCSystem) LogLiquidated( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogLiquidated( + transaction, err := tbtcs.contract.LogExitedCourtesyCall( transactorOptions, ) if err != nil { @@ -3597,12 +3563,12 @@ func (tbtcs *TBTCSystem) LogLiquidated( err, tbtcs.transactorOptions.From, nil, - "logLiquidated", + "logExitedCourtesyCall", ) } tbtcsLogger.Infof( - "submitted transaction logLiquidated with id: [%v] and nonce [%v]", + "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3617,7 +3583,7 @@ func (tbtcs *TBTCSystem) LogLiquidated( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogLiquidated( +func (tbtcs *TBTCSystem) CallLogExitedCourtesyCall( blockNumber *big.Int, ) error { var result interface{} = nil @@ -3629,20 +3595,20 @@ func (tbtcs *TBTCSystem) CallLogLiquidated( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logLiquidated", + "logExitedCourtesyCall", &result, ) return err } -func (tbtcs *TBTCSystem) LogLiquidatedGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogExitedCourtesyCallGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logLiquidated", + "logExitedCourtesyCall", tbtcs.contractABI, tbtcs.transactor, ) @@ -3651,12 +3617,12 @@ func (tbtcs *TBTCSystem) LogLiquidatedGasEstimate() (uint64, error) { } // Transaction submission. -func (tbtcs *TBTCSystem) LogFraudDuringSetup( +func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAddition( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logFraudDuringSetup", + "submitting transaction finalizeEthBtcPriceFeedAddition", ) tbtcs.transactionMutex.Lock() @@ -3681,7 +3647,7 @@ func (tbtcs *TBTCSystem) LogFraudDuringSetup( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogFraudDuringSetup( + transaction, err := tbtcs.contract.FinalizeEthBtcPriceFeedAddition( transactorOptions, ) if err != nil { @@ -3689,12 +3655,12 @@ func (tbtcs *TBTCSystem) LogFraudDuringSetup( err, tbtcs.transactorOptions.From, nil, - "logFraudDuringSetup", + "finalizeEthBtcPriceFeedAddition", ) } tbtcsLogger.Infof( - "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", + "submitted transaction finalizeEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3705,7 +3671,7 @@ func (tbtcs *TBTCSystem) LogFraudDuringSetup( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogFraudDuringSetup( + transaction, err := tbtcs.contract.FinalizeEthBtcPriceFeedAddition( transactorOptions, ) if err != nil { @@ -3713,12 +3679,12 @@ func (tbtcs *TBTCSystem) LogFraudDuringSetup( err, tbtcs.transactorOptions.From, nil, - "logFraudDuringSetup", + "finalizeEthBtcPriceFeedAddition", ) } tbtcsLogger.Infof( - "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", + "submitted transaction finalizeEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3733,7 +3699,7 @@ func (tbtcs *TBTCSystem) LogFraudDuringSetup( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogFraudDuringSetup( +func (tbtcs *TBTCSystem) CallFinalizeEthBtcPriceFeedAddition( blockNumber *big.Int, ) error { var result interface{} = nil @@ -3745,20 +3711,20 @@ func (tbtcs *TBTCSystem) CallLogFraudDuringSetup( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logFraudDuringSetup", + "finalizeEthBtcPriceFeedAddition", &result, ) return err } -func (tbtcs *TBTCSystem) LogFraudDuringSetupGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAdditionGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logFraudDuringSetup", + "finalizeEthBtcPriceFeedAddition", tbtcs.contractABI, tbtcs.transactor, ) @@ -3767,16 +3733,16 @@ func (tbtcs *TBTCSystem) LogFraudDuringSetupGasEstimate() (uint64, error) { } // Transaction submission. -func (tbtcs *TBTCSystem) TransferOwnership( - newOwner common.Address, +func (tbtcs *TBTCSystem) LogCreated( + _keepAddress common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction transferOwnership", + "submitting transaction logCreated", "params: ", fmt.Sprint( - newOwner, + _keepAddress, ), ) @@ -3802,22 +3768,22 @@ func (tbtcs *TBTCSystem) TransferOwnership( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.TransferOwnership( + transaction, err := tbtcs.contract.LogCreated( transactorOptions, - newOwner, + _keepAddress, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "transferOwnership", - newOwner, + "logCreated", + _keepAddress, ) } tbtcsLogger.Infof( - "submitted transaction transferOwnership with id: [%v] and nonce [%v]", + "submitted transaction logCreated with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3828,22 +3794,22 @@ func (tbtcs *TBTCSystem) TransferOwnership( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.TransferOwnership( + transaction, err := tbtcs.contract.LogCreated( transactorOptions, - newOwner, + _keepAddress, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "transferOwnership", - newOwner, + "logCreated", + _keepAddress, ) } tbtcsLogger.Infof( - "submitted transaction transferOwnership with id: [%v] and nonce [%v]", + "submitted transaction logCreated with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3858,8 +3824,8 @@ func (tbtcs *TBTCSystem) TransferOwnership( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallTransferOwnership( - newOwner common.Address, +func (tbtcs *TBTCSystem) CallLogCreated( + _keepAddress common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -3871,38 +3837,47 @@ func (tbtcs *TBTCSystem) CallTransferOwnership( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "transferOwnership", + "logCreated", &result, - newOwner, + _keepAddress, ) return err } -func (tbtcs *TBTCSystem) TransferOwnershipGasEstimate( - newOwner common.Address, +func (tbtcs *TBTCSystem) LogCreatedGasEstimate( + _keepAddress common.Address, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "transferOwnership", + "logCreated", tbtcs.contractABI, tbtcs.transactor, - newOwner, + _keepAddress, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdate( +func (tbtcs *TBTCSystem) LogGotRedemptionSignature( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction finalizeCollateralizationThresholdsUpdate", + "submitting transaction logGotRedemptionSignature", + "params: ", + fmt.Sprint( + _digest, + _r, + _s, + ), ) tbtcs.transactionMutex.Lock() @@ -3927,20 +3902,26 @@ func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.FinalizeCollateralizationThresholdsUpdate( + transaction, err := tbtcs.contract.LogGotRedemptionSignature( transactorOptions, + _digest, + _r, + _s, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeCollateralizationThresholdsUpdate", + "logGotRedemptionSignature", + _digest, + _r, + _s, ) } tbtcsLogger.Infof( - "submitted transaction finalizeCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", + "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3951,20 +3932,26 @@ func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.FinalizeCollateralizationThresholdsUpdate( + transaction, err := tbtcs.contract.LogGotRedemptionSignature( transactorOptions, + _digest, + _r, + _s, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeCollateralizationThresholdsUpdate", + "logGotRedemptionSignature", + _digest, + _r, + _s, ) } tbtcsLogger.Infof( - "submitted transaction finalizeCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", + "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3979,7 +3966,10 @@ func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallFinalizeCollateralizationThresholdsUpdate( +func (tbtcs *TBTCSystem) CallLogGotRedemptionSignature( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -3991,22 +3981,32 @@ func (tbtcs *TBTCSystem) CallFinalizeCollateralizationThresholdsUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "finalizeCollateralizationThresholdsUpdate", + "logGotRedemptionSignature", &result, + _digest, + _r, + _s, ) return err } -func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdateGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogGotRedemptionSignatureGasEstimate( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "finalizeCollateralizationThresholdsUpdate", + "logGotRedemptionSignature", tbtcs.contractABI, tbtcs.transactor, + _digest, + _r, + _s, ) return result, err @@ -4128,10 +4128,13 @@ func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTimeAtBlock( return result, err } -func (tbtcs *TBTCSystem) FetchRelayPreviousDifficulty() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.FetchRelayPreviousDifficulty( +func (tbtcs *TBTCSystem) IsAllowedLotSize( + _requestedLotSizeSatoshis uint64, +) (bool, error) { + var result bool + result, err := tbtcs.contract.IsAllowedLotSize( tbtcs.callerOptions, + _requestedLotSizeSatoshis, ) if err != nil { @@ -4139,17 +4142,19 @@ func (tbtcs *TBTCSystem) FetchRelayPreviousDifficulty() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "fetchRelayPreviousDifficulty", + "isAllowedLotSize", + _requestedLotSizeSatoshis, ) } return result, err } -func (tbtcs *TBTCSystem) FetchRelayPreviousDifficultyAtBlock( +func (tbtcs *TBTCSystem) IsAllowedLotSizeAtBlock( + _requestedLotSizeSatoshis uint64, blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (bool, error) { + var result bool err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4159,16 +4164,17 @@ func (tbtcs *TBTCSystem) FetchRelayPreviousDifficultyAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "fetchRelayPreviousDifficulty", + "isAllowedLotSize", &result, + _requestedLotSizeSatoshis, ) return result, err } -func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelay() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetPriceFeedGovernanceTimeDelay( +func (tbtcs *TBTCSystem) Relay() (common.Address, error) { + var result common.Address + result, err := tbtcs.contract.Relay( tbtcs.callerOptions, ) @@ -4177,17 +4183,17 @@ func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelay() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getPriceFeedGovernanceTimeDelay", + "relay", ) } return result, err } -func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelayAtBlock( +func (tbtcs *TBTCSystem) RelayAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (common.Address, error) { + var result common.Address err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4197,16 +4203,16 @@ func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelayAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getPriceFeedGovernanceTimeDelay", + "relay", &result, ) return result, err } -func (tbtcs *TBTCSystem) Owner() (common.Address, error) { - var result common.Address - result, err := tbtcs.contract.Owner( +func (tbtcs *TBTCSystem) GetMaximumLotSize() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetMaximumLotSize( tbtcs.callerOptions, ) @@ -4215,17 +4221,17 @@ func (tbtcs *TBTCSystem) Owner() (common.Address, error) { err, tbtcs.callerOptions.From, nil, - "owner", + "getMaximumLotSize", ) } return result, err } -func (tbtcs *TBTCSystem) OwnerAtBlock( +func (tbtcs *TBTCSystem) GetMaximumLotSizeAtBlock( blockNumber *big.Int, -) (common.Address, error) { - var result common.Address +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4235,16 +4241,16 @@ func (tbtcs *TBTCSystem) OwnerAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "owner", + "getMaximumLotSize", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTime() (*big.Int, error) { +func (tbtcs *TBTCSystem) GetMinimumLotSize() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.GetRemainingKeepFactoriesUpgradeabilityTime( + result, err := tbtcs.contract.GetMinimumLotSize( tbtcs.callerOptions, ) @@ -4253,14 +4259,14 @@ func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTime() (*big.Int err, tbtcs.callerOptions.From, nil, - "getRemainingKeepFactoriesUpgradeabilityTime", + "getMinimumLotSize", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTimeAtBlock( +func (tbtcs *TBTCSystem) GetMinimumLotSizeAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -4273,16 +4279,16 @@ func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTimeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingKeepFactoriesUpgradeabilityTime", + "getMinimumLotSize", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriod() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetKeepFactoriesUpgradeabilityPeriod( +func (tbtcs *TBTCSystem) IsOwner() (bool, error) { + var result bool + result, err := tbtcs.contract.IsOwner( tbtcs.callerOptions, ) @@ -4291,17 +4297,17 @@ func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriod() (*big.Int, error err, tbtcs.callerOptions.From, nil, - "getKeepFactoriesUpgradeabilityPeriod", + "isOwner", ) } return result, err } -func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriodAtBlock( +func (tbtcs *TBTCSystem) IsOwnerAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (bool, error) { + var result bool err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4311,16 +4317,16 @@ func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriodAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getKeepFactoriesUpgradeabilityPeriod", + "isOwner", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetMaximumLotSize() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetMaximumLotSize( +func (tbtcs *TBTCSystem) Owner() (common.Address, error) { + var result common.Address + result, err := tbtcs.contract.Owner( tbtcs.callerOptions, ) @@ -4329,17 +4335,17 @@ func (tbtcs *TBTCSystem) GetMaximumLotSize() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getMaximumLotSize", + "owner", ) } return result, err } -func (tbtcs *TBTCSystem) GetMaximumLotSizeAtBlock( +func (tbtcs *TBTCSystem) OwnerAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (common.Address, error) { + var result common.Address err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4349,16 +4355,16 @@ func (tbtcs *TBTCSystem) GetMaximumLotSizeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getMaximumLotSize", + "owner", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTime() (*big.Int, error) { +func (tbtcs *TBTCSystem) FetchRelayPreviousDifficulty() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.GetRemainingKeepFactoriesUpdateTime( + result, err := tbtcs.contract.FetchRelayPreviousDifficulty( tbtcs.callerOptions, ) @@ -4367,14 +4373,14 @@ func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTime() (*big.Int, error) err, tbtcs.callerOptions.From, nil, - "getRemainingKeepFactoriesUpdateTime", + "fetchRelayPreviousDifficulty", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTimeAtBlock( +func (tbtcs *TBTCSystem) FetchRelayPreviousDifficultyAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -4387,16 +4393,16 @@ func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTimeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingKeepFactoriesUpdateTime", + "fetchRelayPreviousDifficulty", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercent() (uint16, error) { - var result uint16 - result, err := tbtcs.contract.GetSeverelyUndercollateralizedThresholdPercent( +func (tbtcs *TBTCSystem) FetchBitcoinPrice() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.FetchBitcoinPrice( tbtcs.callerOptions, ) @@ -4405,17 +4411,17 @@ func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercent() (uint1 err, tbtcs.callerOptions.From, nil, - "getSeverelyUndercollateralizedThresholdPercent", + "fetchBitcoinPrice", ) } return result, err } -func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercentAtBlock( +func (tbtcs *TBTCSystem) FetchBitcoinPriceAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4425,16 +4431,16 @@ func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercentAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getSeverelyUndercollateralizedThresholdPercent", + "fetchBitcoinPrice", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetAllowedLotSizes() ([]uint64, error) { - var result []uint64 - result, err := tbtcs.contract.GetAllowedLotSizes( +func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTime() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingLotSizesUpdateTime( tbtcs.callerOptions, ) @@ -4443,17 +4449,17 @@ func (tbtcs *TBTCSystem) GetAllowedLotSizes() ([]uint64, error) { err, tbtcs.callerOptions.From, nil, - "getAllowedLotSizes", + "getRemainingLotSizesUpdateTime", ) } return result, err } -func (tbtcs *TBTCSystem) GetAllowedLotSizesAtBlock( +func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTimeAtBlock( blockNumber *big.Int, -) ([]uint64, error) { - var result []uint64 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4463,17 +4469,20 @@ func (tbtcs *TBTCSystem) GetAllowedLotSizesAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getAllowedLotSizes", + "getRemainingLotSizesUpdateTime", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTime() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetRemainingLotSizesUpdateTime( +func (tbtcs *TBTCSystem) ApprovedToLog( + _caller common.Address, +) (bool, error) { + var result bool + result, err := tbtcs.contract.ApprovedToLog( tbtcs.callerOptions, + _caller, ) if err != nil { @@ -4481,17 +4490,19 @@ func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTime() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getRemainingLotSizesUpdateTime", + "approvedToLog", + _caller, ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTimeAtBlock( +func (tbtcs *TBTCSystem) ApprovedToLogAtBlock( + _caller common.Address, blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (bool, error) { + var result bool err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4501,16 +4512,17 @@ func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTimeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingLotSizesUpdateTime", + "approvedToLog", &result, + _caller, ) return result, err } -func (tbtcs *TBTCSystem) GetGovernanceTimeDelay() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetGovernanceTimeDelay( +func (tbtcs *TBTCSystem) GetAllowNewDeposits() (bool, error) { + var result bool + result, err := tbtcs.contract.GetAllowNewDeposits( tbtcs.callerOptions, ) @@ -4519,17 +4531,17 @@ func (tbtcs *TBTCSystem) GetGovernanceTimeDelay() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getGovernanceTimeDelay", + "getAllowNewDeposits", ) } return result, err } -func (tbtcs *TBTCSystem) GetGovernanceTimeDelayAtBlock( +func (tbtcs *TBTCSystem) GetAllowNewDepositsAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (bool, error) { + var result bool err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4539,16 +4551,16 @@ func (tbtcs *TBTCSystem) GetGovernanceTimeDelayAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getGovernanceTimeDelay", + "getAllowNewDeposits", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetSignerFeeDivisor() (uint16, error) { +func (tbtcs *TBTCSystem) KeepThreshold() (uint16, error) { var result uint16 - result, err := tbtcs.contract.GetSignerFeeDivisor( + result, err := tbtcs.contract.KeepThreshold( tbtcs.callerOptions, ) @@ -4557,14 +4569,14 @@ func (tbtcs *TBTCSystem) GetSignerFeeDivisor() (uint16, error) { err, tbtcs.callerOptions.From, nil, - "getSignerFeeDivisor", + "keepThreshold", ) } return result, err } -func (tbtcs *TBTCSystem) GetSignerFeeDivisorAtBlock( +func (tbtcs *TBTCSystem) KeepThresholdAtBlock( blockNumber *big.Int, ) (uint16, error) { var result uint16 @@ -4577,16 +4589,16 @@ func (tbtcs *TBTCSystem) GetSignerFeeDivisorAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getSignerFeeDivisor", + "keepThreshold", &result, ) return result, err } -func (tbtcs *TBTCSystem) Relay() (common.Address, error) { - var result common.Address - result, err := tbtcs.contract.Relay( +func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.GetUndercollateralizedThresholdPercent( tbtcs.callerOptions, ) @@ -4595,17 +4607,17 @@ func (tbtcs *TBTCSystem) Relay() (common.Address, error) { err, tbtcs.callerOptions.From, nil, - "relay", + "getUndercollateralizedThresholdPercent", ) } return result, err } -func (tbtcs *TBTCSystem) RelayAtBlock( +func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercentAtBlock( blockNumber *big.Int, -) (common.Address, error) { - var result common.Address +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4615,16 +4627,16 @@ func (tbtcs *TBTCSystem) RelayAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "relay", + "getUndercollateralizedThresholdPercent", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTime() (*big.Int, error) { +func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTime() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.GetRemainingCollateralizationThresholdsUpdateTime( + result, err := tbtcs.contract.GetRemainingKeepFactoriesUpgradeabilityTime( tbtcs.callerOptions, ) @@ -4633,14 +4645,14 @@ func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTime() (*b err, tbtcs.callerOptions.From, nil, - "getRemainingCollateralizationThresholdsUpdateTime", + "getRemainingKeepFactoriesUpgradeabilityTime", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTimeAtBlock( +func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTimeAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -4653,16 +4665,16 @@ func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTimeAtBloc tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingCollateralizationThresholdsUpdateTime", + "getRemainingKeepFactoriesUpgradeabilityTime", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetAllowNewDeposits() (bool, error) { - var result bool - result, err := tbtcs.contract.GetAllowNewDeposits( +func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriod() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetKeepFactoriesUpgradeabilityPeriod( tbtcs.callerOptions, ) @@ -4671,17 +4683,17 @@ func (tbtcs *TBTCSystem) GetAllowNewDeposits() (bool, error) { err, tbtcs.callerOptions.From, nil, - "getAllowNewDeposits", + "getKeepFactoriesUpgradeabilityPeriod", ) } return result, err } -func (tbtcs *TBTCSystem) GetAllowNewDepositsAtBlock( +func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriodAtBlock( blockNumber *big.Int, -) (bool, error) { - var result bool +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4691,16 +4703,16 @@ func (tbtcs *TBTCSystem) GetAllowNewDepositsAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getAllowNewDeposits", + "getKeepFactoriesUpgradeabilityPeriod", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetNewDepositFeeEstimate() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetNewDepositFeeEstimate( +func (tbtcs *TBTCSystem) GetInitialCollateralizedPercent() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.GetInitialCollateralizedPercent( tbtcs.callerOptions, ) @@ -4709,17 +4721,17 @@ func (tbtcs *TBTCSystem) GetNewDepositFeeEstimate() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getNewDepositFeeEstimate", + "getInitialCollateralizedPercent", ) } return result, err } -func (tbtcs *TBTCSystem) GetNewDepositFeeEstimateAtBlock( +func (tbtcs *TBTCSystem) GetInitialCollateralizedPercentAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4729,16 +4741,16 @@ func (tbtcs *TBTCSystem) GetNewDepositFeeEstimateAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getNewDepositFeeEstimate", + "getInitialCollateralizedPercent", &result, ) return result, err } -func (tbtcs *TBTCSystem) IsOwner() (bool, error) { - var result bool - result, err := tbtcs.contract.IsOwner( +func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTime() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingKeepFactoriesUpdateTime( tbtcs.callerOptions, ) @@ -4747,17 +4759,17 @@ func (tbtcs *TBTCSystem) IsOwner() (bool, error) { err, tbtcs.callerOptions.From, nil, - "isOwner", + "getRemainingKeepFactoriesUpdateTime", ) } return result, err } -func (tbtcs *TBTCSystem) IsOwnerAtBlock( +func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTimeAtBlock( blockNumber *big.Int, -) (bool, error) { - var result bool +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4767,16 +4779,16 @@ func (tbtcs *TBTCSystem) IsOwnerAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "isOwner", + "getRemainingKeepFactoriesUpdateTime", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercent() (uint16, error) { - var result uint16 - result, err := tbtcs.contract.GetUndercollateralizedThresholdPercent( +func (tbtcs *TBTCSystem) GetGovernanceTimeDelay() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetGovernanceTimeDelay( tbtcs.callerOptions, ) @@ -4785,17 +4797,17 @@ func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercent() (uint16, error err, tbtcs.callerOptions.From, nil, - "getUndercollateralizedThresholdPercent", + "getGovernanceTimeDelay", ) } return result, err } -func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercentAtBlock( +func (tbtcs *TBTCSystem) GetGovernanceTimeDelayAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4805,16 +4817,16 @@ func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercentAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getUndercollateralizedThresholdPercent", + "getGovernanceTimeDelay", &result, ) return result, err } -func (tbtcs *TBTCSystem) KeepThreshold() (uint16, error) { - var result uint16 - result, err := tbtcs.contract.KeepThreshold( +func (tbtcs *TBTCSystem) GetNewDepositFeeEstimate() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetNewDepositFeeEstimate( tbtcs.callerOptions, ) @@ -4823,17 +4835,17 @@ func (tbtcs *TBTCSystem) KeepThreshold() (uint16, error) { err, tbtcs.callerOptions.From, nil, - "keepThreshold", + "getNewDepositFeeEstimate", ) } return result, err } -func (tbtcs *TBTCSystem) KeepThresholdAtBlock( +func (tbtcs *TBTCSystem) GetNewDepositFeeEstimateAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4843,20 +4855,17 @@ func (tbtcs *TBTCSystem) KeepThresholdAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "keepThreshold", + "getNewDepositFeeEstimate", &result, ) return result, err } -func (tbtcs *TBTCSystem) ApprovedToLog( - _caller common.Address, -) (bool, error) { - var result bool - result, err := tbtcs.contract.ApprovedToLog( +func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTime() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingCollateralizationThresholdsUpdateTime( tbtcs.callerOptions, - _caller, ) if err != nil { @@ -4864,19 +4873,17 @@ func (tbtcs *TBTCSystem) ApprovedToLog( err, tbtcs.callerOptions.From, nil, - "approvedToLog", - _caller, + "getRemainingCollateralizationThresholdsUpdateTime", ) } return result, err } -func (tbtcs *TBTCSystem) ApprovedToLogAtBlock( - _caller common.Address, +func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTimeAtBlock( blockNumber *big.Int, -) (bool, error) { - var result bool +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4886,17 +4893,16 @@ func (tbtcs *TBTCSystem) ApprovedToLogAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "approvedToLog", + "getRemainingCollateralizationThresholdsUpdateTime", &result, - _caller, ) return result, err } -func (tbtcs *TBTCSystem) GetMinimumLotSize() (*big.Int, error) { +func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelay() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.GetMinimumLotSize( + result, err := tbtcs.contract.GetPriceFeedGovernanceTimeDelay( tbtcs.callerOptions, ) @@ -4905,14 +4911,14 @@ func (tbtcs *TBTCSystem) GetMinimumLotSize() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getMinimumLotSize", + "getPriceFeedGovernanceTimeDelay", ) } return result, err } -func (tbtcs *TBTCSystem) GetMinimumLotSizeAtBlock( +func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelayAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -4925,20 +4931,17 @@ func (tbtcs *TBTCSystem) GetMinimumLotSizeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getMinimumLotSize", + "getPriceFeedGovernanceTimeDelay", &result, ) - return result, err -} - -func (tbtcs *TBTCSystem) IsAllowedLotSize( - _requestedLotSizeSatoshis uint64, -) (bool, error) { - var result bool - result, err := tbtcs.contract.IsAllowedLotSize( + return result, err +} + +func (tbtcs *TBTCSystem) FetchRelayCurrentDifficulty() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.FetchRelayCurrentDifficulty( tbtcs.callerOptions, - _requestedLotSizeSatoshis, ) if err != nil { @@ -4946,19 +4949,17 @@ func (tbtcs *TBTCSystem) IsAllowedLotSize( err, tbtcs.callerOptions.From, nil, - "isAllowedLotSize", - _requestedLotSizeSatoshis, + "fetchRelayCurrentDifficulty", ) } return result, err } -func (tbtcs *TBTCSystem) IsAllowedLotSizeAtBlock( - _requestedLotSizeSatoshis uint64, +func (tbtcs *TBTCSystem) FetchRelayCurrentDifficultyAtBlock( blockNumber *big.Int, -) (bool, error) { - var result bool +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4968,17 +4969,16 @@ func (tbtcs *TBTCSystem) IsAllowedLotSizeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "isAllowedLotSize", + "fetchRelayCurrentDifficulty", &result, - _requestedLotSizeSatoshis, ) return result, err } -func (tbtcs *TBTCSystem) GetInitialCollateralizedPercent() (uint16, error) { - var result uint16 - result, err := tbtcs.contract.GetInitialCollateralizedPercent( +func (tbtcs *TBTCSystem) GetAllowedLotSizes() ([]uint64, error) { + var result []uint64 + result, err := tbtcs.contract.GetAllowedLotSizes( tbtcs.callerOptions, ) @@ -4987,17 +4987,17 @@ func (tbtcs *TBTCSystem) GetInitialCollateralizedPercent() (uint16, error) { err, tbtcs.callerOptions.From, nil, - "getInitialCollateralizedPercent", + "getAllowedLotSizes", ) } return result, err } -func (tbtcs *TBTCSystem) GetInitialCollateralizedPercentAtBlock( +func (tbtcs *TBTCSystem) GetAllowedLotSizesAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) ([]uint64, error) { + var result []uint64 err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -5007,16 +5007,16 @@ func (tbtcs *TBTCSystem) GetInitialCollateralizedPercentAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getInitialCollateralizedPercent", + "getAllowedLotSizes", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTime() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetRemainingEthBtcPriceFeedAdditionTime( +func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.GetSeverelyUndercollateralizedThresholdPercent( tbtcs.callerOptions, ) @@ -5025,17 +5025,17 @@ func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTime() (*big.Int, er err, tbtcs.callerOptions.From, nil, - "getRemainingEthBtcPriceFeedAdditionTime", + "getSeverelyUndercollateralizedThresholdPercent", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTimeAtBlock( +func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercentAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -5045,16 +5045,16 @@ func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTimeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingEthBtcPriceFeedAdditionTime", + "getSeverelyUndercollateralizedThresholdPercent", &result, ) return result, err } -func (tbtcs *TBTCSystem) FetchBitcoinPrice() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.FetchBitcoinPrice( +func (tbtcs *TBTCSystem) GetSignerFeeDivisor() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.GetSignerFeeDivisor( tbtcs.callerOptions, ) @@ -5063,17 +5063,17 @@ func (tbtcs *TBTCSystem) FetchBitcoinPrice() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "fetchBitcoinPrice", + "getSignerFeeDivisor", ) } return result, err } -func (tbtcs *TBTCSystem) FetchBitcoinPriceAtBlock( +func (tbtcs *TBTCSystem) GetSignerFeeDivisorAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -5083,16 +5083,16 @@ func (tbtcs *TBTCSystem) FetchBitcoinPriceAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "fetchBitcoinPrice", + "getSignerFeeDivisor", &result, ) return result, err } -func (tbtcs *TBTCSystem) FetchRelayCurrentDifficulty() (*big.Int, error) { +func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTime() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.FetchRelayCurrentDifficulty( + result, err := tbtcs.contract.GetRemainingEthBtcPriceFeedAdditionTime( tbtcs.callerOptions, ) @@ -5101,14 +5101,14 @@ func (tbtcs *TBTCSystem) FetchRelayCurrentDifficulty() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "fetchRelayCurrentDifficulty", + "getRemainingEthBtcPriceFeedAdditionTime", ) } return result, err } -func (tbtcs *TBTCSystem) FetchRelayCurrentDifficultyAtBlock( +func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTimeAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -5121,7 +5121,7 @@ func (tbtcs *TBTCSystem) FetchRelayCurrentDifficultyAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "fetchRelayCurrentDifficulty", + "getRemainingEthBtcPriceFeedAdditionTime", &result, ) @@ -5168,14 +5168,16 @@ func (tbtcs *TBTCSystem) KeepSizeAtBlock( // ------ Events ------- -type tBTCSystemAllowNewDepositsUpdatedFunc func( - AllowNewDeposits bool, +type tBTCSystemFunderAbortRequestedFunc func( + DepositContractAddress common.Address, + AbortOutputScript []uint8, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchAllowNewDepositsUpdated( - success tBTCSystemAllowNewDepositsUpdatedFunc, +func (tbtcs *TBTCSystem) WatchFunderAbortRequested( + success tBTCSystemFunderAbortRequestedFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -5192,9 +5194,10 @@ func (tbtcs *TBTCSystem) WatchAllowNewDepositsUpdated( return err } - subscription, err := tbtcs.subscribeAllowNewDepositsUpdated( + subscription, err := tbtcs.subscribeFunderAbortRequested( success, failCallback, + _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -5214,7 +5217,7 @@ func (tbtcs *TBTCSystem) WatchAllowNewDepositsUpdated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event AllowNewDepositsUpdated terminated with error; " + + "subscription to event FunderAbortRequested terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5235,19 +5238,21 @@ func (tbtcs *TBTCSystem) WatchAllowNewDepositsUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeAllowNewDepositsUpdated( - success tBTCSystemAllowNewDepositsUpdatedFunc, +func (tbtcs *TBTCSystem) subscribeFunderAbortRequested( + success tBTCSystemFunderAbortRequestedFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemAllowNewDepositsUpdated) - eventSubscription, err := tbtcs.contract.WatchAllowNewDepositsUpdated( + eventChan := make(chan *abi.TBTCSystemFunderAbortRequested) + eventSubscription, err := tbtcs.contract.WatchFunderAbortRequested( nil, eventChan, + _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for AllowNewDepositsUpdated events: [%v]", + "error creating watch for FunderAbortRequested events: [%v]", err, ) } @@ -5265,7 +5270,8 @@ func (tbtcs *TBTCSystem) subscribeAllowNewDepositsUpdated( return } success( - event.AllowNewDeposits, + event.DepositContractAddress, + event.AbortOutputScript, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -5287,16 +5293,20 @@ func (tbtcs *TBTCSystem) subscribeAllowNewDepositsUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemFraudDuringSetupFunc func( +type tBTCSystemGotRedemptionSignatureFunc func( DepositContractAddress common.Address, + Digest [32]uint8, + R [32]uint8, + S [32]uint8, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchFraudDuringSetup( - success tBTCSystemFraudDuringSetupFunc, +func (tbtcs *TBTCSystem) WatchGotRedemptionSignature( + success tBTCSystemGotRedemptionSignatureFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -5313,10 +5323,11 @@ func (tbtcs *TBTCSystem) WatchFraudDuringSetup( return err } - subscription, err := tbtcs.subscribeFraudDuringSetup( + subscription, err := tbtcs.subscribeGotRedemptionSignature( success, failCallback, _depositContractAddressFilter, + _digestFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -5336,7 +5347,7 @@ func (tbtcs *TBTCSystem) WatchFraudDuringSetup( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event FraudDuringSetup terminated with error; " + + "subscription to event GotRedemptionSignature terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5357,21 +5368,23 @@ func (tbtcs *TBTCSystem) WatchFraudDuringSetup( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeFraudDuringSetup( - success tBTCSystemFraudDuringSetupFunc, +func (tbtcs *TBTCSystem) subscribeGotRedemptionSignature( + success tBTCSystemGotRedemptionSignatureFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemFraudDuringSetup) - eventSubscription, err := tbtcs.contract.WatchFraudDuringSetup( + eventChan := make(chan *abi.TBTCSystemGotRedemptionSignature) + eventSubscription, err := tbtcs.contract.WatchGotRedemptionSignature( nil, eventChan, _depositContractAddressFilter, + _digestFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for FraudDuringSetup events: [%v]", + "error creating watch for GotRedemptionSignature events: [%v]", err, ) } @@ -5390,6 +5403,9 @@ func (tbtcs *TBTCSystem) subscribeFraudDuringSetup( } success( event.DepositContractAddress, + event.Digest, + event.R, + event.S, event.Timestamp, event.Raw.BlockNumber, ) @@ -5412,18 +5428,16 @@ func (tbtcs *TBTCSystem) subscribeFraudDuringSetup( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemFundedFunc func( +type tBTCSystemLiquidatedFunc func( DepositContractAddress common.Address, - Txid [32]uint8, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchFunded( - success tBTCSystemFundedFunc, +func (tbtcs *TBTCSystem) WatchLiquidated( + success tBTCSystemLiquidatedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -5440,11 +5454,10 @@ func (tbtcs *TBTCSystem) WatchFunded( return err } - subscription, err := tbtcs.subscribeFunded( + subscription, err := tbtcs.subscribeLiquidated( success, failCallback, _depositContractAddressFilter, - _txidFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -5464,7 +5477,7 @@ func (tbtcs *TBTCSystem) WatchFunded( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event Funded terminated with error; " + + "subscription to event Liquidated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5485,23 +5498,21 @@ func (tbtcs *TBTCSystem) WatchFunded( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeFunded( - success tBTCSystemFundedFunc, +func (tbtcs *TBTCSystem) subscribeLiquidated( + success tBTCSystemLiquidatedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemFunded) - eventSubscription, err := tbtcs.contract.WatchFunded( + eventChan := make(chan *abi.TBTCSystemLiquidated) + eventSubscription, err := tbtcs.contract.WatchLiquidated( nil, eventChan, _depositContractAddressFilter, - _txidFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for Funded events: [%v]", + "error creating watch for Liquidated events: [%v]", err, ) } @@ -5520,7 +5531,6 @@ func (tbtcs *TBTCSystem) subscribeFunded( } success( event.DepositContractAddress, - event.Txid, event.Timestamp, event.Raw.BlockNumber, ) @@ -5543,13 +5553,13 @@ func (tbtcs *TBTCSystem) subscribeFunded( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemLotSizesUpdatedFunc func( - LotSizes []uint64, +type tBTCSystemAllowNewDepositsUpdatedFunc func( + AllowNewDeposits bool, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchLotSizesUpdated( - success tBTCSystemLotSizesUpdatedFunc, +func (tbtcs *TBTCSystem) WatchAllowNewDepositsUpdated( + success tBTCSystemAllowNewDepositsUpdatedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { errorChan := make(chan error) @@ -5567,7 +5577,7 @@ func (tbtcs *TBTCSystem) WatchLotSizesUpdated( return err } - subscription, err := tbtcs.subscribeLotSizesUpdated( + subscription, err := tbtcs.subscribeAllowNewDepositsUpdated( success, failCallback, ) @@ -5589,7 +5599,7 @@ func (tbtcs *TBTCSystem) WatchLotSizesUpdated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event LotSizesUpdated terminated with error; " + + "subscription to event AllowNewDepositsUpdated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5610,19 +5620,19 @@ func (tbtcs *TBTCSystem) WatchLotSizesUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeLotSizesUpdated( - success tBTCSystemLotSizesUpdatedFunc, +func (tbtcs *TBTCSystem) subscribeAllowNewDepositsUpdated( + success tBTCSystemAllowNewDepositsUpdatedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemLotSizesUpdated) - eventSubscription, err := tbtcs.contract.WatchLotSizesUpdated( + eventChan := make(chan *abi.TBTCSystemAllowNewDepositsUpdated) + eventSubscription, err := tbtcs.contract.WatchAllowNewDepositsUpdated( nil, eventChan, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for LotSizesUpdated events: [%v]", + "error creating watch for AllowNewDepositsUpdated events: [%v]", err, ) } @@ -5640,7 +5650,7 @@ func (tbtcs *TBTCSystem) subscribeLotSizesUpdated( return } success( - event.LotSizes, + event.AllowNewDeposits, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -5662,17 +5672,16 @@ func (tbtcs *TBTCSystem) subscribeLotSizesUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemOwnershipTransferredFunc func( - PreviousOwner common.Address, - NewOwner common.Address, +type tBTCSystemCollateralizationThresholdsUpdatedFunc func( + InitialCollateralizedPercent uint16, + UndercollateralizedThresholdPercent uint16, + SeverelyUndercollateralizedThresholdPercent uint16, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchOwnershipTransferred( - success tBTCSystemOwnershipTransferredFunc, +func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdated( + success tBTCSystemCollateralizationThresholdsUpdatedFunc, fail func(err error) error, - previousOwnerFilter []common.Address, - newOwnerFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -5689,11 +5698,9 @@ func (tbtcs *TBTCSystem) WatchOwnershipTransferred( return err } - subscription, err := tbtcs.subscribeOwnershipTransferred( + subscription, err := tbtcs.subscribeCollateralizationThresholdsUpdated( success, failCallback, - previousOwnerFilter, - newOwnerFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -5713,7 +5720,7 @@ func (tbtcs *TBTCSystem) WatchOwnershipTransferred( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event OwnershipTransferred terminated with error; " + + "subscription to event CollateralizationThresholdsUpdated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5734,23 +5741,19 @@ func (tbtcs *TBTCSystem) WatchOwnershipTransferred( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeOwnershipTransferred( - success tBTCSystemOwnershipTransferredFunc, +func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdated( + success tBTCSystemCollateralizationThresholdsUpdatedFunc, fail func(err error) error, - previousOwnerFilter []common.Address, - newOwnerFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemOwnershipTransferred) - eventSubscription, err := tbtcs.contract.WatchOwnershipTransferred( + eventChan := make(chan *abi.TBTCSystemCollateralizationThresholdsUpdated) + eventSubscription, err := tbtcs.contract.WatchCollateralizationThresholdsUpdated( nil, eventChan, - previousOwnerFilter, - newOwnerFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for OwnershipTransferred events: [%v]", + "error creating watch for CollateralizationThresholdsUpdated events: [%v]", err, ) } @@ -5768,8 +5771,9 @@ func (tbtcs *TBTCSystem) subscribeOwnershipTransferred( return } success( - event.PreviousOwner, - event.NewOwner, + event.InitialCollateralizedPercent, + event.UndercollateralizedThresholdPercent, + event.SeverelyUndercollateralizedThresholdPercent, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -5791,18 +5795,16 @@ func (tbtcs *TBTCSystem) subscribeOwnershipTransferred( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemRedeemedFunc func( +type tBTCSystemCourtesyCalledFunc func( DepositContractAddress common.Address, - Txid [32]uint8, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchRedeemed( - success tBTCSystemRedeemedFunc, +func (tbtcs *TBTCSystem) WatchCourtesyCalled( + success tBTCSystemCourtesyCalledFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -5819,11 +5821,10 @@ func (tbtcs *TBTCSystem) WatchRedeemed( return err } - subscription, err := tbtcs.subscribeRedeemed( + subscription, err := tbtcs.subscribeCourtesyCalled( success, failCallback, _depositContractAddressFilter, - _txidFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -5843,7 +5844,7 @@ func (tbtcs *TBTCSystem) WatchRedeemed( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event Redeemed terminated with error; " + + "subscription to event CourtesyCalled terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5864,23 +5865,21 @@ func (tbtcs *TBTCSystem) WatchRedeemed( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeRedeemed( - success tBTCSystemRedeemedFunc, +func (tbtcs *TBTCSystem) subscribeCourtesyCalled( + success tBTCSystemCourtesyCalledFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemRedeemed) - eventSubscription, err := tbtcs.contract.WatchRedeemed( + eventChan := make(chan *abi.TBTCSystemCourtesyCalled) + eventSubscription, err := tbtcs.contract.WatchCourtesyCalled( nil, eventChan, _depositContractAddressFilter, - _txidFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for Redeemed events: [%v]", + "error creating watch for CourtesyCalled events: [%v]", err, ) } @@ -5899,7 +5898,6 @@ func (tbtcs *TBTCSystem) subscribeRedeemed( } success( event.DepositContractAddress, - event.Txid, event.Timestamp, event.Raw.BlockNumber, ) @@ -5922,15 +5920,16 @@ func (tbtcs *TBTCSystem) subscribeRedeemed( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemSignerFeeDivisorUpdateStartedFunc func( - SignerFeeDivisor uint16, +type tBTCSystemFraudDuringSetupFunc func( + DepositContractAddress common.Address, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdateStarted( - success tBTCSystemSignerFeeDivisorUpdateStartedFunc, +func (tbtcs *TBTCSystem) WatchFraudDuringSetup( + success tBTCSystemFraudDuringSetupFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -5947,9 +5946,10 @@ func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdateStarted( return err } - subscription, err := tbtcs.subscribeSignerFeeDivisorUpdateStarted( + subscription, err := tbtcs.subscribeFraudDuringSetup( success, failCallback, + _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -5969,7 +5969,7 @@ func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdateStarted( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event SignerFeeDivisorUpdateStarted terminated with error; " + + "subscription to event FraudDuringSetup terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5990,19 +5990,21 @@ func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdateStarted( - success tBTCSystemSignerFeeDivisorUpdateStartedFunc, +func (tbtcs *TBTCSystem) subscribeFraudDuringSetup( + success tBTCSystemFraudDuringSetupFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemSignerFeeDivisorUpdateStarted) - eventSubscription, err := tbtcs.contract.WatchSignerFeeDivisorUpdateStarted( + eventChan := make(chan *abi.TBTCSystemFraudDuringSetup) + eventSubscription, err := tbtcs.contract.WatchFraudDuringSetup( nil, eventChan, + _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for SignerFeeDivisorUpdateStarted events: [%v]", + "error creating watch for FraudDuringSetup events: [%v]", err, ) } @@ -6020,7 +6022,7 @@ func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdateStarted( return } success( - event.SignerFeeDivisor, + event.DepositContractAddress, event.Timestamp, event.Raw.BlockNumber, ) @@ -6043,17 +6045,18 @@ func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemCollateralizationThresholdsUpdateStartedFunc func( - InitialCollateralizedPercent uint16, - UndercollateralizedThresholdPercent uint16, - SeverelyUndercollateralizedThresholdPercent uint16, +type tBTCSystemFundedFunc func( + DepositContractAddress common.Address, + Txid [32]uint8, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdateStarted( - success tBTCSystemCollateralizationThresholdsUpdateStartedFunc, +func (tbtcs *TBTCSystem) WatchFunded( + success tBTCSystemFundedFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -6070,9 +6073,11 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdateStarted( return err } - subscription, err := tbtcs.subscribeCollateralizationThresholdsUpdateStarted( + subscription, err := tbtcs.subscribeFunded( success, failCallback, + _depositContractAddressFilter, + _txidFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -6092,7 +6097,7 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdateStarted( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event CollateralizationThresholdsUpdateStarted terminated with error; " + + "subscription to event Funded terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6113,19 +6118,23 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdateStarted( - success tBTCSystemCollateralizationThresholdsUpdateStartedFunc, +func (tbtcs *TBTCSystem) subscribeFunded( + success tBTCSystemFundedFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemCollateralizationThresholdsUpdateStarted) - eventSubscription, err := tbtcs.contract.WatchCollateralizationThresholdsUpdateStarted( + eventChan := make(chan *abi.TBTCSystemFunded) + eventSubscription, err := tbtcs.contract.WatchFunded( nil, eventChan, + _depositContractAddressFilter, + _txidFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for CollateralizationThresholdsUpdateStarted events: [%v]", + "error creating watch for Funded events: [%v]", err, ) } @@ -6143,9 +6152,8 @@ func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdateStarted( return } success( - event.InitialCollateralizedPercent, - event.UndercollateralizedThresholdPercent, - event.SeverelyUndercollateralizedThresholdPercent, + event.DepositContractAddress, + event.Txid, event.Timestamp, event.Raw.BlockNumber, ) @@ -6168,16 +6176,18 @@ func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemFunderAbortRequestedFunc func( +type tBTCSystemRedeemedFunc func( DepositContractAddress common.Address, - AbortOutputScript []uint8, + Txid [32]uint8, + Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchFunderAbortRequested( - success tBTCSystemFunderAbortRequestedFunc, +func (tbtcs *TBTCSystem) WatchRedeemed( + success tBTCSystemRedeemedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -6194,10 +6204,11 @@ func (tbtcs *TBTCSystem) WatchFunderAbortRequested( return err } - subscription, err := tbtcs.subscribeFunderAbortRequested( + subscription, err := tbtcs.subscribeRedeemed( success, failCallback, _depositContractAddressFilter, + _txidFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -6217,7 +6228,7 @@ func (tbtcs *TBTCSystem) WatchFunderAbortRequested( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event FunderAbortRequested terminated with error; " + + "subscription to event Redeemed terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6238,21 +6249,23 @@ func (tbtcs *TBTCSystem) WatchFunderAbortRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeFunderAbortRequested( - success tBTCSystemFunderAbortRequestedFunc, +func (tbtcs *TBTCSystem) subscribeRedeemed( + success tBTCSystemRedeemedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemFunderAbortRequested) - eventSubscription, err := tbtcs.contract.WatchFunderAbortRequested( + eventChan := make(chan *abi.TBTCSystemRedeemed) + eventSubscription, err := tbtcs.contract.WatchRedeemed( nil, eventChan, _depositContractAddressFilter, + _txidFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for FunderAbortRequested events: [%v]", + "error creating watch for Redeemed events: [%v]", err, ) } @@ -6271,7 +6284,8 @@ func (tbtcs *TBTCSystem) subscribeFunderAbortRequested( } success( event.DepositContractAddress, - event.AbortOutputScript, + event.Txid, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -6293,19 +6307,22 @@ func (tbtcs *TBTCSystem) subscribeFunderAbortRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemGotRedemptionSignatureFunc func( +type tBTCSystemRedemptionRequestedFunc func( DepositContractAddress common.Address, + Requester common.Address, Digest [32]uint8, - R [32]uint8, - S [32]uint8, - Timestamp *big.Int, + UtxoValue *big.Int, + RedeemerOutputScript []uint8, + RequestedFee *big.Int, + Outpoint []uint8, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchGotRedemptionSignature( - success tBTCSystemGotRedemptionSignatureFunc, +func (tbtcs *TBTCSystem) WatchRedemptionRequested( + success tBTCSystemRedemptionRequestedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _requesterFilter []common.Address, _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) @@ -6323,10 +6340,11 @@ func (tbtcs *TBTCSystem) WatchGotRedemptionSignature( return err } - subscription, err := tbtcs.subscribeGotRedemptionSignature( + subscription, err := tbtcs.subscribeRedemptionRequested( success, failCallback, _depositContractAddressFilter, + _requesterFilter, _digestFilter, ) if err != nil { @@ -6347,7 +6365,7 @@ func (tbtcs *TBTCSystem) WatchGotRedemptionSignature( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event GotRedemptionSignature terminated with error; " + + "subscription to event RedemptionRequested terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6368,23 +6386,25 @@ func (tbtcs *TBTCSystem) WatchGotRedemptionSignature( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeGotRedemptionSignature( - success tBTCSystemGotRedemptionSignatureFunc, +func (tbtcs *TBTCSystem) subscribeRedemptionRequested( + success tBTCSystemRedemptionRequestedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _requesterFilter []common.Address, _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemGotRedemptionSignature) - eventSubscription, err := tbtcs.contract.WatchGotRedemptionSignature( + eventChan := make(chan *abi.TBTCSystemRedemptionRequested) + eventSubscription, err := tbtcs.contract.WatchRedemptionRequested( nil, eventChan, _depositContractAddressFilter, + _requesterFilter, _digestFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for GotRedemptionSignature events: [%v]", + "error creating watch for RedemptionRequested events: [%v]", err, ) } @@ -6403,10 +6423,12 @@ func (tbtcs *TBTCSystem) subscribeGotRedemptionSignature( } success( event.DepositContractAddress, + event.Requester, event.Digest, - event.R, - event.S, - event.Timestamp, + event.UtxoValue, + event.RedeemerOutputScript, + event.RequestedFee, + event.Outpoint, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -6428,15 +6450,16 @@ func (tbtcs *TBTCSystem) subscribeGotRedemptionSignature( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemStartedLiquidationFunc func( +type tBTCSystemRegisteredPubkeyFunc func( DepositContractAddress common.Address, - WasFraud bool, + SigningGroupPubkeyX [32]uint8, + SigningGroupPubkeyY [32]uint8, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchStartedLiquidation( - success tBTCSystemStartedLiquidationFunc, +func (tbtcs *TBTCSystem) WatchRegisteredPubkey( + success tBTCSystemRegisteredPubkeyFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { @@ -6455,7 +6478,7 @@ func (tbtcs *TBTCSystem) WatchStartedLiquidation( return err } - subscription, err := tbtcs.subscribeStartedLiquidation( + subscription, err := tbtcs.subscribeRegisteredPubkey( success, failCallback, _depositContractAddressFilter, @@ -6478,7 +6501,7 @@ func (tbtcs *TBTCSystem) WatchStartedLiquidation( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event StartedLiquidation terminated with error; " + + "subscription to event RegisteredPubkey terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6499,13 +6522,13 @@ func (tbtcs *TBTCSystem) WatchStartedLiquidation( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeStartedLiquidation( - success tBTCSystemStartedLiquidationFunc, +func (tbtcs *TBTCSystem) subscribeRegisteredPubkey( + success tBTCSystemRegisteredPubkeyFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemStartedLiquidation) - eventSubscription, err := tbtcs.contract.WatchStartedLiquidation( + eventChan := make(chan *abi.TBTCSystemRegisteredPubkey) + eventSubscription, err := tbtcs.contract.WatchRegisteredPubkey( nil, eventChan, _depositContractAddressFilter, @@ -6513,7 +6536,7 @@ func (tbtcs *TBTCSystem) subscribeStartedLiquidation( if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for StartedLiquidation events: [%v]", + "error creating watch for RegisteredPubkey events: [%v]", err, ) } @@ -6532,7 +6555,8 @@ func (tbtcs *TBTCSystem) subscribeStartedLiquidation( } success( event.DepositContractAddress, - event.WasFraud, + event.SigningGroupPubkeyX, + event.SigningGroupPubkeyY, event.Timestamp, event.Raw.BlockNumber, ) @@ -6555,16 +6579,17 @@ func (tbtcs *TBTCSystem) subscribeStartedLiquidation( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemCollateralizationThresholdsUpdatedFunc func( - InitialCollateralizedPercent uint16, - UndercollateralizedThresholdPercent uint16, - SeverelyUndercollateralizedThresholdPercent uint16, +type tBTCSystemStartedLiquidationFunc func( + DepositContractAddress common.Address, + WasFraud bool, + Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdated( - success tBTCSystemCollateralizationThresholdsUpdatedFunc, +func (tbtcs *TBTCSystem) WatchStartedLiquidation( + success tBTCSystemStartedLiquidationFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -6581,9 +6606,10 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdated( return err } - subscription, err := tbtcs.subscribeCollateralizationThresholdsUpdated( + subscription, err := tbtcs.subscribeStartedLiquidation( success, failCallback, + _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -6603,7 +6629,7 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event CollateralizationThresholdsUpdated terminated with error; " + + "subscription to event StartedLiquidation terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6624,19 +6650,21 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdated( - success tBTCSystemCollateralizationThresholdsUpdatedFunc, +func (tbtcs *TBTCSystem) subscribeStartedLiquidation( + success tBTCSystemStartedLiquidationFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemCollateralizationThresholdsUpdated) - eventSubscription, err := tbtcs.contract.WatchCollateralizationThresholdsUpdated( + eventChan := make(chan *abi.TBTCSystemStartedLiquidation) + eventSubscription, err := tbtcs.contract.WatchStartedLiquidation( nil, eventChan, + _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for CollateralizationThresholdsUpdated events: [%v]", + "error creating watch for StartedLiquidation events: [%v]", err, ) } @@ -6654,9 +6682,9 @@ func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdated( return } success( - event.InitialCollateralizedPercent, - event.UndercollateralizedThresholdPercent, - event.SeverelyUndercollateralizedThresholdPercent, + event.DepositContractAddress, + event.WasFraud, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -6678,16 +6706,18 @@ func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemCourtesyCalledFunc func( +type tBTCSystemCreatedFunc func( DepositContractAddress common.Address, + KeepAddress common.Address, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchCourtesyCalled( - success tBTCSystemCourtesyCalledFunc, +func (tbtcs *TBTCSystem) WatchCreated( + success tBTCSystemCreatedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _keepAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -6704,10 +6734,11 @@ func (tbtcs *TBTCSystem) WatchCourtesyCalled( return err } - subscription, err := tbtcs.subscribeCourtesyCalled( + subscription, err := tbtcs.subscribeCreated( success, failCallback, _depositContractAddressFilter, + _keepAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -6727,7 +6758,7 @@ func (tbtcs *TBTCSystem) WatchCourtesyCalled( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event CourtesyCalled terminated with error; " + + "subscription to event Created terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6748,21 +6779,23 @@ func (tbtcs *TBTCSystem) WatchCourtesyCalled( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeCourtesyCalled( - success tBTCSystemCourtesyCalledFunc, +func (tbtcs *TBTCSystem) subscribeCreated( + success tBTCSystemCreatedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _keepAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemCourtesyCalled) - eventSubscription, err := tbtcs.contract.WatchCourtesyCalled( + eventChan := make(chan *abi.TBTCSystemCreated) + eventSubscription, err := tbtcs.contract.WatchCreated( nil, eventChan, _depositContractAddressFilter, + _keepAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for CourtesyCalled events: [%v]", + "error creating watch for Created events: [%v]", err, ) } @@ -6781,6 +6814,7 @@ func (tbtcs *TBTCSystem) subscribeCourtesyCalled( } success( event.DepositContractAddress, + event.KeepAddress, event.Timestamp, event.Raw.BlockNumber, ) @@ -6803,18 +6837,14 @@ func (tbtcs *TBTCSystem) subscribeCourtesyCalled( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemCreatedFunc func( - DepositContractAddress common.Address, - KeepAddress common.Address, - Timestamp *big.Int, +type tBTCSystemEthBtcPriceFeedAddedFunc func( + PriceFeed common.Address, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchCreated( - success tBTCSystemCreatedFunc, +func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdded( + success tBTCSystemEthBtcPriceFeedAddedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, - _keepAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -6831,11 +6861,9 @@ func (tbtcs *TBTCSystem) WatchCreated( return err } - subscription, err := tbtcs.subscribeCreated( + subscription, err := tbtcs.subscribeEthBtcPriceFeedAdded( success, failCallback, - _depositContractAddressFilter, - _keepAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -6855,7 +6883,7 @@ func (tbtcs *TBTCSystem) WatchCreated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event Created terminated with error; " + + "subscription to event EthBtcPriceFeedAdded terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6876,23 +6904,19 @@ func (tbtcs *TBTCSystem) WatchCreated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeCreated( - success tBTCSystemCreatedFunc, +func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdded( + success tBTCSystemEthBtcPriceFeedAddedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, - _keepAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemCreated) - eventSubscription, err := tbtcs.contract.WatchCreated( + eventChan := make(chan *abi.TBTCSystemEthBtcPriceFeedAdded) + eventSubscription, err := tbtcs.contract.WatchEthBtcPriceFeedAdded( nil, eventChan, - _depositContractAddressFilter, - _keepAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for Created events: [%v]", + "error creating watch for EthBtcPriceFeedAdded events: [%v]", err, ) } @@ -6909,10 +6933,8 @@ func (tbtcs *TBTCSystem) subscribeCreated( subscriptionMutex.Unlock() return } - success( - event.DepositContractAddress, - event.KeepAddress, - event.Timestamp, + success( + event.PriceFeed, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -6934,15 +6956,16 @@ func (tbtcs *TBTCSystem) subscribeCreated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemLotSizesUpdateStartedFunc func( - LotSizes []uint64, +type tBTCSystemExitedCourtesyCallFunc func( + DepositContractAddress common.Address, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchLotSizesUpdateStarted( - success tBTCSystemLotSizesUpdateStartedFunc, +func (tbtcs *TBTCSystem) WatchExitedCourtesyCall( + success tBTCSystemExitedCourtesyCallFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -6959,9 +6982,10 @@ func (tbtcs *TBTCSystem) WatchLotSizesUpdateStarted( return err } - subscription, err := tbtcs.subscribeLotSizesUpdateStarted( + subscription, err := tbtcs.subscribeExitedCourtesyCall( success, failCallback, + _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -6981,7 +7005,7 @@ func (tbtcs *TBTCSystem) WatchLotSizesUpdateStarted( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event LotSizesUpdateStarted terminated with error; " + + "subscription to event ExitedCourtesyCall terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7002,19 +7026,21 @@ func (tbtcs *TBTCSystem) WatchLotSizesUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeLotSizesUpdateStarted( - success tBTCSystemLotSizesUpdateStartedFunc, +func (tbtcs *TBTCSystem) subscribeExitedCourtesyCall( + success tBTCSystemExitedCourtesyCallFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemLotSizesUpdateStarted) - eventSubscription, err := tbtcs.contract.WatchLotSizesUpdateStarted( + eventChan := make(chan *abi.TBTCSystemExitedCourtesyCall) + eventSubscription, err := tbtcs.contract.WatchExitedCourtesyCall( nil, eventChan, + _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for LotSizesUpdateStarted events: [%v]", + "error creating watch for ExitedCourtesyCall events: [%v]", err, ) } @@ -7032,7 +7058,7 @@ func (tbtcs *TBTCSystem) subscribeLotSizesUpdateStarted( return } success( - event.LotSizes, + event.DepositContractAddress, event.Timestamp, event.Raw.BlockNumber, ) @@ -7055,18 +7081,14 @@ func (tbtcs *TBTCSystem) subscribeLotSizesUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemRegisteredPubkeyFunc func( - DepositContractAddress common.Address, - SigningGroupPubkeyX [32]uint8, - SigningGroupPubkeyY [32]uint8, - Timestamp *big.Int, +type tBTCSystemLotSizesUpdatedFunc func( + LotSizes []uint64, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchRegisteredPubkey( - success tBTCSystemRegisteredPubkeyFunc, +func (tbtcs *TBTCSystem) WatchLotSizesUpdated( + success tBTCSystemLotSizesUpdatedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -7083,10 +7105,9 @@ func (tbtcs *TBTCSystem) WatchRegisteredPubkey( return err } - subscription, err := tbtcs.subscribeRegisteredPubkey( + subscription, err := tbtcs.subscribeLotSizesUpdated( success, failCallback, - _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -7106,7 +7127,7 @@ func (tbtcs *TBTCSystem) WatchRegisteredPubkey( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event RegisteredPubkey terminated with error; " + + "subscription to event LotSizesUpdated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7127,21 +7148,19 @@ func (tbtcs *TBTCSystem) WatchRegisteredPubkey( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeRegisteredPubkey( - success tBTCSystemRegisteredPubkeyFunc, +func (tbtcs *TBTCSystem) subscribeLotSizesUpdated( + success tBTCSystemLotSizesUpdatedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemRegisteredPubkey) - eventSubscription, err := tbtcs.contract.WatchRegisteredPubkey( + eventChan := make(chan *abi.TBTCSystemLotSizesUpdated) + eventSubscription, err := tbtcs.contract.WatchLotSizesUpdated( nil, eventChan, - _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for RegisteredPubkey events: [%v]", + "error creating watch for LotSizesUpdated events: [%v]", err, ) } @@ -7159,10 +7178,7 @@ func (tbtcs *TBTCSystem) subscribeRegisteredPubkey( return } success( - event.DepositContractAddress, - event.SigningGroupPubkeyX, - event.SigningGroupPubkeyY, - event.Timestamp, + event.LotSizes, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -7184,16 +7200,17 @@ func (tbtcs *TBTCSystem) subscribeRegisteredPubkey( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemSetupFailedFunc func( - DepositContractAddress common.Address, - Timestamp *big.Int, +type tBTCSystemOwnershipTransferredFunc func( + PreviousOwner common.Address, + NewOwner common.Address, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchSetupFailed( - success tBTCSystemSetupFailedFunc, +func (tbtcs *TBTCSystem) WatchOwnershipTransferred( + success tBTCSystemOwnershipTransferredFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, + previousOwnerFilter []common.Address, + newOwnerFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -7210,10 +7227,11 @@ func (tbtcs *TBTCSystem) WatchSetupFailed( return err } - subscription, err := tbtcs.subscribeSetupFailed( + subscription, err := tbtcs.subscribeOwnershipTransferred( success, failCallback, - _depositContractAddressFilter, + previousOwnerFilter, + newOwnerFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -7233,7 +7251,7 @@ func (tbtcs *TBTCSystem) WatchSetupFailed( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event SetupFailed terminated with error; " + + "subscription to event OwnershipTransferred terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7254,21 +7272,23 @@ func (tbtcs *TBTCSystem) WatchSetupFailed( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeSetupFailed( - success tBTCSystemSetupFailedFunc, +func (tbtcs *TBTCSystem) subscribeOwnershipTransferred( + success tBTCSystemOwnershipTransferredFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, + previousOwnerFilter []common.Address, + newOwnerFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemSetupFailed) - eventSubscription, err := tbtcs.contract.WatchSetupFailed( + eventChan := make(chan *abi.TBTCSystemOwnershipTransferred) + eventSubscription, err := tbtcs.contract.WatchOwnershipTransferred( nil, eventChan, - _depositContractAddressFilter, + previousOwnerFilter, + newOwnerFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for SetupFailed events: [%v]", + "error creating watch for OwnershipTransferred events: [%v]", err, ) } @@ -7286,8 +7306,8 @@ func (tbtcs *TBTCSystem) subscribeSetupFailed( return } success( - event.DepositContractAddress, - event.Timestamp, + event.PreviousOwner, + event.NewOwner, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -7309,13 +7329,16 @@ func (tbtcs *TBTCSystem) subscribeSetupFailed( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemEthBtcPriceFeedAddedFunc func( - PriceFeed common.Address, +type tBTCSystemCollateralizationThresholdsUpdateStartedFunc func( + InitialCollateralizedPercent uint16, + UndercollateralizedThresholdPercent uint16, + SeverelyUndercollateralizedThresholdPercent uint16, + Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdded( - success tBTCSystemEthBtcPriceFeedAddedFunc, +func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdateStarted( + success tBTCSystemCollateralizationThresholdsUpdateStartedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { errorChan := make(chan error) @@ -7333,7 +7356,7 @@ func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdded( return err } - subscription, err := tbtcs.subscribeEthBtcPriceFeedAdded( + subscription, err := tbtcs.subscribeCollateralizationThresholdsUpdateStarted( success, failCallback, ) @@ -7355,7 +7378,7 @@ func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdded( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event EthBtcPriceFeedAdded terminated with error; " + + "subscription to event CollateralizationThresholdsUpdateStarted terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7376,19 +7399,19 @@ func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdded( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdded( - success tBTCSystemEthBtcPriceFeedAddedFunc, +func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdateStarted( + success tBTCSystemCollateralizationThresholdsUpdateStartedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemEthBtcPriceFeedAdded) - eventSubscription, err := tbtcs.contract.WatchEthBtcPriceFeedAdded( + eventChan := make(chan *abi.TBTCSystemCollateralizationThresholdsUpdateStarted) + eventSubscription, err := tbtcs.contract.WatchCollateralizationThresholdsUpdateStarted( nil, eventChan, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for EthBtcPriceFeedAdded events: [%v]", + "error creating watch for CollateralizationThresholdsUpdateStarted events: [%v]", err, ) } @@ -7406,7 +7429,10 @@ func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdded( return } success( - event.PriceFeed, + event.InitialCollateralizedPercent, + event.UndercollateralizedThresholdPercent, + event.SeverelyUndercollateralizedThresholdPercent, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -7549,16 +7575,14 @@ func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdditionStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemExitedCourtesyCallFunc func( - DepositContractAddress common.Address, - Timestamp *big.Int, +type tBTCSystemSignerFeeDivisorUpdatedFunc func( + SignerFeeDivisor uint16, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchExitedCourtesyCall( - success tBTCSystemExitedCourtesyCallFunc, +func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdated( + success tBTCSystemSignerFeeDivisorUpdatedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -7575,10 +7599,9 @@ func (tbtcs *TBTCSystem) WatchExitedCourtesyCall( return err } - subscription, err := tbtcs.subscribeExitedCourtesyCall( + subscription, err := tbtcs.subscribeSignerFeeDivisorUpdated( success, failCallback, - _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -7598,7 +7621,7 @@ func (tbtcs *TBTCSystem) WatchExitedCourtesyCall( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event ExitedCourtesyCall terminated with error; " + + "subscription to event SignerFeeDivisorUpdated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7619,21 +7642,19 @@ func (tbtcs *TBTCSystem) WatchExitedCourtesyCall( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeExitedCourtesyCall( - success tBTCSystemExitedCourtesyCallFunc, +func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdated( + success tBTCSystemSignerFeeDivisorUpdatedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemExitedCourtesyCall) - eventSubscription, err := tbtcs.contract.WatchExitedCourtesyCall( + eventChan := make(chan *abi.TBTCSystemSignerFeeDivisorUpdated) + eventSubscription, err := tbtcs.contract.WatchSignerFeeDivisorUpdated( nil, eventChan, - _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for ExitedCourtesyCall events: [%v]", + "error creating watch for SignerFeeDivisorUpdated events: [%v]", err, ) } @@ -7651,8 +7672,7 @@ func (tbtcs *TBTCSystem) subscribeExitedCourtesyCall( return } success( - event.DepositContractAddress, - event.Timestamp, + event.SignerFeeDivisor, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -7922,16 +7942,15 @@ func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemLiquidatedFunc func( - DepositContractAddress common.Address, +type tBTCSystemLotSizesUpdateStartedFunc func( + LotSizes []uint64, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchLiquidated( - success tBTCSystemLiquidatedFunc, +func (tbtcs *TBTCSystem) WatchLotSizesUpdateStarted( + success tBTCSystemLotSizesUpdateStartedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -7948,10 +7967,9 @@ func (tbtcs *TBTCSystem) WatchLiquidated( return err } - subscription, err := tbtcs.subscribeLiquidated( + subscription, err := tbtcs.subscribeLotSizesUpdateStarted( success, failCallback, - _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -7971,7 +7989,7 @@ func (tbtcs *TBTCSystem) WatchLiquidated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event Liquidated terminated with error; " + + "subscription to event LotSizesUpdateStarted terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7992,21 +8010,19 @@ func (tbtcs *TBTCSystem) WatchLiquidated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeLiquidated( - success tBTCSystemLiquidatedFunc, +func (tbtcs *TBTCSystem) subscribeLotSizesUpdateStarted( + success tBTCSystemLotSizesUpdateStartedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemLiquidated) - eventSubscription, err := tbtcs.contract.WatchLiquidated( + eventChan := make(chan *abi.TBTCSystemLotSizesUpdateStarted) + eventSubscription, err := tbtcs.contract.WatchLotSizesUpdateStarted( nil, eventChan, - _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for Liquidated events: [%v]", + "error creating watch for LotSizesUpdateStarted events: [%v]", err, ) } @@ -8024,7 +8040,7 @@ func (tbtcs *TBTCSystem) subscribeLiquidated( return } success( - event.DepositContractAddress, + event.LotSizes, event.Timestamp, event.Raw.BlockNumber, ) @@ -8047,23 +8063,16 @@ func (tbtcs *TBTCSystem) subscribeLiquidated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemRedemptionRequestedFunc func( +type tBTCSystemSetupFailedFunc func( DepositContractAddress common.Address, - Requester common.Address, - Digest [32]uint8, - UtxoValue *big.Int, - RedeemerOutputScript []uint8, - RequestedFee *big.Int, - Outpoint []uint8, + Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchRedemptionRequested( - success tBTCSystemRedemptionRequestedFunc, +func (tbtcs *TBTCSystem) WatchSetupFailed( + success tBTCSystemSetupFailedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _requesterFilter []common.Address, - _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -8080,12 +8089,10 @@ func (tbtcs *TBTCSystem) WatchRedemptionRequested( return err } - subscription, err := tbtcs.subscribeRedemptionRequested( + subscription, err := tbtcs.subscribeSetupFailed( success, failCallback, _depositContractAddressFilter, - _requesterFilter, - _digestFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -8105,7 +8112,7 @@ func (tbtcs *TBTCSystem) WatchRedemptionRequested( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event RedemptionRequested terminated with error; " + + "subscription to event SetupFailed terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -8126,25 +8133,21 @@ func (tbtcs *TBTCSystem) WatchRedemptionRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeRedemptionRequested( - success tBTCSystemRedemptionRequestedFunc, +func (tbtcs *TBTCSystem) subscribeSetupFailed( + success tBTCSystemSetupFailedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _requesterFilter []common.Address, - _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemRedemptionRequested) - eventSubscription, err := tbtcs.contract.WatchRedemptionRequested( + eventChan := make(chan *abi.TBTCSystemSetupFailed) + eventSubscription, err := tbtcs.contract.WatchSetupFailed( nil, eventChan, _depositContractAddressFilter, - _requesterFilter, - _digestFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for RedemptionRequested events: [%v]", + "error creating watch for SetupFailed events: [%v]", err, ) } @@ -8163,12 +8166,7 @@ func (tbtcs *TBTCSystem) subscribeRedemptionRequested( } success( event.DepositContractAddress, - event.Requester, - event.Digest, - event.UtxoValue, - event.RedeemerOutputScript, - event.RequestedFee, - event.Outpoint, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -8190,13 +8188,14 @@ func (tbtcs *TBTCSystem) subscribeRedemptionRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemSignerFeeDivisorUpdatedFunc func( +type tBTCSystemSignerFeeDivisorUpdateStartedFunc func( SignerFeeDivisor uint16, + Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdated( - success tBTCSystemSignerFeeDivisorUpdatedFunc, +func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdateStarted( + success tBTCSystemSignerFeeDivisorUpdateStartedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { errorChan := make(chan error) @@ -8214,7 +8213,7 @@ func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdated( return err } - subscription, err := tbtcs.subscribeSignerFeeDivisorUpdated( + subscription, err := tbtcs.subscribeSignerFeeDivisorUpdateStarted( success, failCallback, ) @@ -8236,7 +8235,7 @@ func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event SignerFeeDivisorUpdated terminated with error; " + + "subscription to event SignerFeeDivisorUpdateStarted terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -8257,19 +8256,19 @@ func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdated( - success tBTCSystemSignerFeeDivisorUpdatedFunc, +func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdateStarted( + success tBTCSystemSignerFeeDivisorUpdateStartedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemSignerFeeDivisorUpdated) - eventSubscription, err := tbtcs.contract.WatchSignerFeeDivisorUpdated( + eventChan := make(chan *abi.TBTCSystemSignerFeeDivisorUpdateStarted) + eventSubscription, err := tbtcs.contract.WatchSignerFeeDivisorUpdateStarted( nil, eventChan, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for SignerFeeDivisorUpdated events: [%v]", + "error creating watch for SignerFeeDivisorUpdateStarted events: [%v]", err, ) } @@ -8288,6 +8287,7 @@ func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdated( } success( event.SignerFeeDivisor, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() From a9ae79a8a2c582d5b7c3ae503b848dd27463c2f1 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Tue, 20 Oct 2020 13:54:59 +0200 Subject: [PATCH 13/14] Get rid of the keep-core dependency --- go.mod | 4 +- go.sum | 4 + pkg/chain/ethereum/gen/Makefile | 4 +- pkg/chain/ethereum/gen/cmd/.keep | 0 pkg/chain/ethereum/gen/cmd/Deposit.go | 1125 -------- pkg/chain/ethereum/gen/cmd/TBTCSystem.go | 1734 ----------- pkg/chain/ethereum/gen/contract/Deposit.go | 1782 ++++++------ pkg/chain/ethereum/gen/contract/TBTCSystem.go | 2544 ++++++++--------- 8 files changed, 2170 insertions(+), 5027 deletions(-) delete mode 100644 pkg/chain/ethereum/gen/cmd/.keep delete mode 100644 pkg/chain/ethereum/gen/cmd/Deposit.go delete mode 100644 pkg/chain/ethereum/gen/cmd/TBTCSystem.go diff --git a/go.mod b/go.mod index bf7242836..60d84fcb9 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,5 @@ go 1.13 require ( github.com/ethereum/go-ethereum v1.9.10 github.com/ipfs/go-log v1.0.4 - github.com/keep-network/keep-common v1.2.1-0.20201015091820-496b0c87d6f5 - github.com/keep-network/keep-core v1.3.0 - github.com/urfave/cli v1.22.1 + github.com/keep-network/keep-common v1.2.1-0.20201020114759-19c123cbd4f4 ) diff --git a/go.sum b/go.sum index 2e54fc3f5..73ac54d61 100644 --- a/go.sum +++ b/go.sum @@ -293,6 +293,7 @@ github.com/ipfs/go-log v1.0.4 h1:6nLQdX4W8P9yZZFH7mO+X/PzjN8Laozm/lMJ6esdgzY= github.com/ipfs/go-log v1.0.4/go.mod h1:oDCg2FkjogeFOhqqb+N39l2RpTNPL6F/StPkB3kPgcs= github.com/ipfs/go-log/v2 v2.0.2/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBWFaa9+0= github.com/ipfs/go-log/v2 v2.0.3/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBWFaa9+0= +github.com/ipfs/go-log/v2 v2.0.5 h1:fL4YI+1g5V/b1Yxr1qAiXTMg1H8z9vx/VmJxBuQMHvU= github.com/ipfs/go-log/v2 v2.0.5/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscwkWG+dw= github.com/ipfs/go-log/v2 v2.1.1 h1:G4TtqN+V9y9HY9TA6BwbCVyyBZ2B9MbCjR2MtGx8FR0= github.com/ipfs/go-log/v2 v2.1.1/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= @@ -333,6 +334,8 @@ github.com/keep-network/keep-common v1.2.0 h1:hVd2tTd7vL+9CQP5Ntk5kjs+GYvkgrRNBc github.com/keep-network/keep-common v1.2.0/go.mod h1:emxogTbBdey7M3jOzfxZOdfn139kN2mI2b2wA6AHKKo= github.com/keep-network/keep-common v1.2.1-0.20201015091820-496b0c87d6f5 h1:HCQv0+3IhaH1zvRQ2cAinKK+HJCASI41EpZuUMKD278= github.com/keep-network/keep-common v1.2.1-0.20201015091820-496b0c87d6f5/go.mod h1:emxogTbBdey7M3jOzfxZOdfn139kN2mI2b2wA6AHKKo= +github.com/keep-network/keep-common v1.2.1-0.20201020114759-19c123cbd4f4 h1:CivupPSFswHACua5xZGKdeYxsCQ2cmRomTIBh8kfk70= +github.com/keep-network/keep-common v1.2.1-0.20201020114759-19c123cbd4f4/go.mod h1:emxogTbBdey7M3jOzfxZOdfn139kN2mI2b2wA6AHKKo= github.com/keep-network/keep-core v1.3.0 h1:7Tb33EmO/ntHOEbOiYciRlBhqu5Ln6KemWCaYK0Z6LA= github.com/keep-network/keep-core v1.3.0/go.mod h1:1KsSSTQoN754TrFLW7kLy50pOG2CQ4BOfnJqdvEG7FA= github.com/keep-network/tbtc v1.1.0 h1:9ZCuBsrJYN1L1V7bAC98ZAtxv+ZIHcMhz6RJLAizLvY= @@ -845,6 +848,7 @@ go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.14.1 h1:nYDKopTbvAPq/NrUVZwT15y2lpROBiLLyoRTbXOYWOo= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.15.0 h1:ZZCA22JRF2gQE5FoNmhmrf7jeJJ2uhqDUNRYKm8dvmM= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= diff --git a/pkg/chain/ethereum/gen/Makefile b/pkg/chain/ethereum/gen/Makefile index 1068fe650..db1cded2a 100644 --- a/pkg/chain/ethereum/gen/Makefile +++ b/pkg/chain/ethereum/gen/Makefile @@ -44,10 +44,10 @@ abi/%.go: abi/%.abi go run github.com/ethereum/go-ethereum/cmd/abigen --abi $< --pkg abi --type $(type) --out $@ contract/deposit/Deposit.go cmd/deposit/Deposit.go: abi/deposit/Deposit.abi abi/deposit/Deposit.go *.go - go run github.com/keep-network/keep-common/tools/generators/ethereum $< contract/Deposit.go cmd/Deposit.go + go run github.com/keep-network/keep-common/tools/generators/ethereum $< contract/Deposit.go contract/system/TBTCSystem.go cmd/system/TBTCSystem.go: abi/system/TBTCSystem.abi abi/system/TBTCSystem.go *.go - go run github.com/keep-network/keep-common/tools/generators/ethereum $< contract/TBTCSystem.go cmd/TBTCSystem.go + go run github.com/keep-network/keep-common/tools/generators/ethereum $< contract/TBTCSystem.go diff --git a/pkg/chain/ethereum/gen/cmd/.keep b/pkg/chain/ethereum/gen/cmd/.keep deleted file mode 100644 index e69de29bb..000000000 diff --git a/pkg/chain/ethereum/gen/cmd/Deposit.go b/pkg/chain/ethereum/gen/cmd/Deposit.go deleted file mode 100644 index 81d90584f..000000000 --- a/pkg/chain/ethereum/gen/cmd/Deposit.go +++ /dev/null @@ -1,1125 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated command and any manual changes will be lost. - -package cmd - -import ( - "fmt" - "math/big" - "sync" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - - "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" - "github.com/keep-network/keep-common/pkg/cmd" - "github.com/keep-network/keep-core/config" - "github.com/keep-network/tbtc/pkg/chain/ethereum/gen/contract" - - "github.com/urfave/cli" -) - -var DepositCommand cli.Command - -var depositDescription = `The deposit command allows calling the Deposit 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. - - All subcommands can be used to investigate the result of a previous - transaction that called that same method by passing the -t/--transaction - flag with the transaction hash. - - 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() { - AvailableCommands = append(AvailableCommands, cli.Command{ - Name: "deposit", - Usage: `Provides access to the Deposit contract.`, - Description: depositDescription, - Subcommands: []cli.Command{{ - Name: "remaining-term", - Usage: "Calls the constant method remainingTerm on the Deposit contract.", - ArgsUsage: "", - Action: dRemainingTerm, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "lot-size-satoshis", - Usage: "Calls the constant method lotSizeSatoshis on the Deposit contract.", - ArgsUsage: "", - Action: dLotSizeSatoshis, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "in-active", - Usage: "Calls the constant method inActive on the Deposit contract.", - ArgsUsage: "", - Action: dInActive, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "funding-info", - Usage: "Calls the constant method fundingInfo on the Deposit contract.", - ArgsUsage: "", - Action: dFundingInfo, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "auction-value", - Usage: "Calls the constant method auctionValue on the Deposit contract.", - ArgsUsage: "", - Action: dAuctionValue, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "lot-size-tbtc", - Usage: "Calls the constant method lotSizeTbtc on the Deposit contract.", - ArgsUsage: "", - Action: dLotSizeTbtc, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "severely-undercollateralized-threshold-percent", - Usage: "Calls the constant method severelyUndercollateralizedThresholdPercent on the Deposit contract.", - ArgsUsage: "", - Action: dSeverelyUndercollateralizedThresholdPercent, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "initial-collateralized-percent", - Usage: "Calls the constant method initialCollateralizedPercent on the Deposit contract.", - ArgsUsage: "", - Action: dInitialCollateralizedPercent, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "keep-address", - Usage: "Calls the constant method keepAddress on the Deposit contract.", - ArgsUsage: "", - Action: dKeepAddress, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "collateralization-percentage", - Usage: "Calls the constant method collateralizationPercentage on the Deposit contract.", - ArgsUsage: "", - Action: dCollateralizationPercentage, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "signer-fee-tbtc", - Usage: "Calls the constant method signerFeeTbtc on the Deposit contract.", - ArgsUsage: "", - Action: dSignerFeeTbtc, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "undercollateralized-threshold-percent", - Usage: "Calls the constant method undercollateralizedThresholdPercent on the Deposit contract.", - ArgsUsage: "", - Action: dUndercollateralizedThresholdPercent, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "withdrawable-amount", - Usage: "Calls the constant method withdrawableAmount on the Deposit contract.", - ArgsUsage: "", - Action: dWithdrawableAmount, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "get-redemption-tbtc-requirement", - Usage: "Calls the constant method getRedemptionTbtcRequirement on the Deposit contract.", - ArgsUsage: "[_redeemer] ", - Action: dGetRedemptionTbtcRequirement, - Before: cmd.ArgCountChecker(1), - Flags: cmd.ConstFlags, - }, { - Name: "utxo-value", - Usage: "Calls the constant method utxoValue on the Deposit contract.", - ArgsUsage: "", - Action: dUtxoValue, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "current-state", - Usage: "Calls the constant method currentState on the Deposit contract.", - ArgsUsage: "", - Action: dCurrentState, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "get-owner-redemption-tbtc-requirement", - Usage: "Calls the constant method getOwnerRedemptionTbtcRequirement on the Deposit contract.", - ArgsUsage: "[_redeemer] ", - Action: dGetOwnerRedemptionTbtcRequirement, - Before: cmd.ArgCountChecker(1), - Flags: cmd.ConstFlags, - }, { - Name: "notify-redemption-proof-timed-out", - Usage: "Calls the method notifyRedemptionProofTimedOut on the Deposit contract.", - ArgsUsage: "", - Action: dNotifyRedemptionProofTimedOut, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "purchase-signer-bonds-at-auction", - Usage: "Calls the method purchaseSignerBondsAtAuction on the Deposit contract.", - ArgsUsage: "", - Action: dPurchaseSignerBondsAtAuction, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "notify-courtesy-call", - Usage: "Calls the method notifyCourtesyCall on the Deposit contract.", - ArgsUsage: "", - Action: dNotifyCourtesyCall, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "request-funder-abort", - Usage: "Calls the method requestFunderAbort on the Deposit contract.", - ArgsUsage: "[_abortOutputScript] ", - Action: dRequestFunderAbort, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), - Flags: cmd.NonConstFlags, - }, { - Name: "retrieve-signer-pubkey", - Usage: "Calls the method retrieveSignerPubkey on the Deposit contract.", - ArgsUsage: "", - Action: dRetrieveSignerPubkey, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "exit-courtesy-call", - Usage: "Calls the method exitCourtesyCall on the Deposit contract.", - ArgsUsage: "", - Action: dExitCourtesyCall, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "notify-courtesy-call-expired", - Usage: "Calls the method notifyCourtesyCallExpired on the Deposit contract.", - ArgsUsage: "", - Action: dNotifyCourtesyCallExpired, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "notify-funding-timed-out", - Usage: "Calls the method notifyFundingTimedOut on the Deposit contract.", - ArgsUsage: "", - Action: dNotifyFundingTimedOut, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "notify-undercollateralized-liquidation", - Usage: "Calls the method notifyUndercollateralizedLiquidation on the Deposit contract.", - ArgsUsage: "", - Action: dNotifyUndercollateralizedLiquidation, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "notify-redemption-signature-timed-out", - Usage: "Calls the method notifyRedemptionSignatureTimedOut on the Deposit contract.", - ArgsUsage: "", - Action: dNotifyRedemptionSignatureTimedOut, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "initialize", - Usage: "Calls the method initialize on the Deposit contract.", - ArgsUsage: "[_factory] ", - Action: dInitialize, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), - Flags: cmd.NonConstFlags, - }, { - Name: "notify-signer-setup-failed", - Usage: "Calls the method notifySignerSetupFailed on the Deposit contract.", - ArgsUsage: "", - Action: dNotifySignerSetupFailed, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "withdraw-funds", - Usage: "Calls the method withdrawFunds on the Deposit contract.", - ArgsUsage: "", - Action: dWithdrawFunds, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }}, - }) -} - -/// ------------------- Const methods ------------------- - -func dRemainingTerm(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - result, err := contract.RemainingTermAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func dLotSizeSatoshis(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - result, err := contract.LotSizeSatoshisAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func dInActive(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - result, err := contract.InActiveAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func dFundingInfo(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - result, err := contract.FundingInfoAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func dAuctionValue(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - result, err := contract.AuctionValueAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func dLotSizeTbtc(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - result, err := contract.LotSizeTbtcAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func dSeverelyUndercollateralizedThresholdPercent(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - result, err := contract.SeverelyUndercollateralizedThresholdPercentAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func dInitialCollateralizedPercent(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - result, err := contract.InitialCollateralizedPercentAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func dKeepAddress(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - result, err := contract.KeepAddressAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func dCollateralizationPercentage(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - result, err := contract.CollateralizationPercentageAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func dSignerFeeTbtc(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - result, err := contract.SignerFeeTbtcAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func dUndercollateralizedThresholdPercent(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - result, err := contract.UndercollateralizedThresholdPercentAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func dWithdrawableAmount(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - result, err := contract.WithdrawableAmountAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func dGetRedemptionTbtcRequirement(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - _redeemer, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _redeemer, a address, from passed value %v", - c.Args()[0], - ) - } - - result, err := contract.GetRedemptionTbtcRequirementAtBlock( - _redeemer, - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func dUtxoValue(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - result, err := contract.UtxoValueAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func dCurrentState(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - result, err := contract.CurrentStateAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func dGetOwnerRedemptionTbtcRequirement(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - _redeemer, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _redeemer, a address, from passed value %v", - c.Args()[0], - ) - } - - result, err := contract.GetOwnerRedemptionTbtcRequirementAtBlock( - _redeemer, - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -/// ------------------- Non-const methods ------------------- - -func dNotifyRedemptionProofTimedOut(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyRedemptionProofTimedOut() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallNotifyRedemptionProofTimedOut( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func dPurchaseSignerBondsAtAuction(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.PurchaseSignerBondsAtAuction() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallPurchaseSignerBondsAtAuction( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func dNotifyCourtesyCall(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyCourtesyCall() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallNotifyCourtesyCall( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func dRequestFunderAbort(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - _abortOutputScript, err := hexutil.Decode(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _abortOutputScript, a bytes, from passed value %v", - c.Args()[0], - ) - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.RequestFunderAbort( - _abortOutputScript, - ) - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallRequestFunderAbort( - _abortOutputScript, - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func dRetrieveSignerPubkey(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.RetrieveSignerPubkey() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallRetrieveSignerPubkey( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func dExitCourtesyCall(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.ExitCourtesyCall() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallExitCourtesyCall( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func dNotifyCourtesyCallExpired(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyCourtesyCallExpired() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallNotifyCourtesyCallExpired( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func dNotifyFundingTimedOut(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyFundingTimedOut() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallNotifyFundingTimedOut( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func dNotifyUndercollateralizedLiquidation(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyUndercollateralizedLiquidation() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallNotifyUndercollateralizedLiquidation( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func dNotifyRedemptionSignatureTimedOut(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.NotifyRedemptionSignatureTimedOut() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallNotifyRedemptionSignatureTimedOut( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func dInitialize(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - _factory, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _factory, a address, from passed value %v", - c.Args()[0], - ) - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.Initialize( - _factory, - ) - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallInitialize( - _factory, - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func dNotifySignerSetupFailed(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.NotifySignerSetupFailed() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallNotifySignerSetupFailed( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func dWithdrawFunds(c *cli.Context) error { - contract, err := initializeDeposit(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.WithdrawFunds() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallWithdrawFunds( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -/// ------------------- Initialization ------------------- - -func initializeDeposit(c *cli.Context) (*contract.Deposit, error) { - config, err := config.ReadEthereumConfig(c.GlobalString("config")) - if err != nil { - return nil, fmt.Errorf("error reading Ethereum config from file: [%v]", err) - } - - client, _, _, err := ethutil.ConnectClients(config.URL, config.URLRPC) - if err != nil { - return nil, fmt.Errorf("error connecting to Ethereum node: [%v]", err) - } - - key, err := ethutil.DecryptKeyFile( - config.Account.KeyFile, - config.Account.KeyFilePassword, - ) - if err != nil { - return nil, fmt.Errorf( - "failed to read KeyFile: %s: [%v]", - config.Account.KeyFile, - err, - ) - } - - checkInterval := cmd.DefaultMiningCheckInterval - maxGasPrice := cmd.DefaultMaxGasPrice - if config.MiningCheckInterval != 0 { - checkInterval = time.Duration(config.MiningCheckInterval) * time.Second - } - if config.MaxGasPrice != 0 { - maxGasPrice = new(big.Int).SetUint64(config.MaxGasPrice) - } - - miningWaiter := ethutil.NewMiningWaiter(client, checkInterval, maxGasPrice) - - address := common.HexToAddress(config.ContractAddresses["Deposit"]) - - return contract.NewDeposit( - address, - key, - client, - ethutil.NewNonceManager(key.Address, client), - miningWaiter, - &sync.Mutex{}, - ) -} diff --git a/pkg/chain/ethereum/gen/cmd/TBTCSystem.go b/pkg/chain/ethereum/gen/cmd/TBTCSystem.go deleted file mode 100644 index 1531217e9..000000000 --- a/pkg/chain/ethereum/gen/cmd/TBTCSystem.go +++ /dev/null @@ -1,1734 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated command and any manual changes will be lost. - -package cmd - -import ( - "fmt" - "math/big" - "sync" - "time" - - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" - "github.com/ethereum/go-ethereum/core/types" - - "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" - "github.com/keep-network/keep-common/pkg/cmd" - "github.com/keep-network/keep-core/config" - "github.com/keep-network/tbtc/pkg/chain/ethereum/gen/contract" - - "github.com/urfave/cli" -) - -var TBTCSystemCommand cli.Command - -var tBTCSystemDescription = `The t-b-t-c-system command allows calling the TBTCSystem 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. - - All subcommands can be used to investigate the result of a previous - transaction that called that same method by passing the -t/--transaction - flag with the transaction hash. - - 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() { - AvailableCommands = append(AvailableCommands, cli.Command{ - Name: "t-b-t-c-system", - Usage: `Provides access to the TBTCSystem contract.`, - Description: tBTCSystemDescription, - Subcommands: []cli.Command{{ - Name: "price-feed", - Usage: "Calls the constant method priceFeed on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsPriceFeed, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "get-remaining-pause-term", - Usage: "Calls the constant method getRemainingPauseTerm on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsGetRemainingPauseTerm, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "get-remaining-signer-fee-divisor-update-time", - Usage: "Calls the constant method getRemainingSignerFeeDivisorUpdateTime on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsGetRemainingSignerFeeDivisorUpdateTime, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "relay", - Usage: "Calls the constant method relay on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsRelay, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "get-maximum-lot-size", - Usage: "Calls the constant method getMaximumLotSize on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsGetMaximumLotSize, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "get-minimum-lot-size", - Usage: "Calls the constant method getMinimumLotSize on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsGetMinimumLotSize, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "is-owner", - Usage: "Calls the constant method isOwner on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsIsOwner, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "owner", - Usage: "Calls the constant method owner on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsOwner, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "fetch-relay-previous-difficulty", - Usage: "Calls the constant method fetchRelayPreviousDifficulty on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsFetchRelayPreviousDifficulty, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "fetch-bitcoin-price", - Usage: "Calls the constant method fetchBitcoinPrice on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsFetchBitcoinPrice, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "get-remaining-lot-sizes-update-time", - Usage: "Calls the constant method getRemainingLotSizesUpdateTime on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsGetRemainingLotSizesUpdateTime, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "approved-to-log", - Usage: "Calls the constant method approvedToLog on the TBTCSystem contract.", - ArgsUsage: "[_caller] ", - Action: tbtcsApprovedToLog, - Before: cmd.ArgCountChecker(1), - Flags: cmd.ConstFlags, - }, { - Name: "get-allow-new-deposits", - Usage: "Calls the constant method getAllowNewDeposits on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsGetAllowNewDeposits, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "keep-threshold", - Usage: "Calls the constant method keepThreshold on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsKeepThreshold, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "get-undercollateralized-threshold-percent", - Usage: "Calls the constant method getUndercollateralizedThresholdPercent on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsGetUndercollateralizedThresholdPercent, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "get-remaining-keep-factories-upgradeability-time", - Usage: "Calls the constant method getRemainingKeepFactoriesUpgradeabilityTime on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsGetRemainingKeepFactoriesUpgradeabilityTime, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "get-keep-factories-upgradeability-period", - Usage: "Calls the constant method getKeepFactoriesUpgradeabilityPeriod on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsGetKeepFactoriesUpgradeabilityPeriod, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "get-initial-collateralized-percent", - Usage: "Calls the constant method getInitialCollateralizedPercent on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsGetInitialCollateralizedPercent, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "get-remaining-keep-factories-update-time", - Usage: "Calls the constant method getRemainingKeepFactoriesUpdateTime on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsGetRemainingKeepFactoriesUpdateTime, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "get-governance-time-delay", - Usage: "Calls the constant method getGovernanceTimeDelay on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsGetGovernanceTimeDelay, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "get-new-deposit-fee-estimate", - Usage: "Calls the constant method getNewDepositFeeEstimate on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsGetNewDepositFeeEstimate, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "get-remaining-collateralization-thresholds-update-time", - Usage: "Calls the constant method getRemainingCollateralizationThresholdsUpdateTime on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsGetRemainingCollateralizationThresholdsUpdateTime, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "get-price-feed-governance-time-delay", - Usage: "Calls the constant method getPriceFeedGovernanceTimeDelay on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsGetPriceFeedGovernanceTimeDelay, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "fetch-relay-current-difficulty", - Usage: "Calls the constant method fetchRelayCurrentDifficulty on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsFetchRelayCurrentDifficulty, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "get-allowed-lot-sizes", - Usage: "Calls the constant method getAllowedLotSizes on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsGetAllowedLotSizes, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "get-severely-undercollateralized-threshold-percent", - Usage: "Calls the constant method getSeverelyUndercollateralizedThresholdPercent on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsGetSeverelyUndercollateralizedThresholdPercent, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "get-signer-fee-divisor", - Usage: "Calls the constant method getSignerFeeDivisor on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsGetSignerFeeDivisor, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "get-remaining-eth-btc-price-feed-addition-time", - Usage: "Calls the constant method getRemainingEthBtcPriceFeedAdditionTime on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsGetRemainingEthBtcPriceFeedAdditionTime, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "keep-size", - Usage: "Calls the constant method keepSize on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsKeepSize, - Before: cmd.ArgCountChecker(0), - Flags: cmd.ConstFlags, - }, { - Name: "finalize-keep-factories-update", - Usage: "Calls the method finalizeKeepFactoriesUpdate on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsFinalizeKeepFactoriesUpdate, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "begin-keep-factories-update", - Usage: "Calls the method beginKeepFactoriesUpdate on the TBTCSystem contract.", - ArgsUsage: "[_keepStakedFactory] [_fullyBackedFactory] [_factorySelector] ", - Action: tbtcsBeginKeepFactoriesUpdate, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(3))), - Flags: cmd.NonConstFlags, - }, { - Name: "emergency-pause-new-deposits", - Usage: "Calls the method emergencyPauseNewDeposits on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsEmergencyPauseNewDeposits, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "begin-eth-btc-price-feed-addition", - Usage: "Calls the method beginEthBtcPriceFeedAddition on the TBTCSystem contract.", - ArgsUsage: "[_ethBtcPriceFeed] ", - Action: tbtcsBeginEthBtcPriceFeedAddition, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), - Flags: cmd.NonConstFlags, - }, { - Name: "transfer-ownership", - Usage: "Calls the method transferOwnership on the TBTCSystem contract.", - ArgsUsage: "[newOwner] ", - Action: tbtcsTransferOwnership, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), - Flags: cmd.NonConstFlags, - }, { - Name: "finalize-signer-fee-divisor-update", - Usage: "Calls the method finalizeSignerFeeDivisorUpdate on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsFinalizeSignerFeeDivisorUpdate, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "resume-new-deposits", - Usage: "Calls the method resumeNewDeposits on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsResumeNewDeposits, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "refresh-minimum-bondable-value", - Usage: "Calls the method refreshMinimumBondableValue on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsRefreshMinimumBondableValue, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "renounce-ownership", - Usage: "Calls the method renounceOwnership on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsRenounceOwnership, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "finalize-collateralization-thresholds-update", - Usage: "Calls the method finalizeCollateralizationThresholdsUpdate on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsFinalizeCollateralizationThresholdsUpdate, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "finalize-lot-sizes-update", - Usage: "Calls the method finalizeLotSizesUpdate on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsFinalizeLotSizesUpdate, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "log-courtesy-called", - Usage: "Calls the method logCourtesyCalled on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsLogCourtesyCalled, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "log-funder-requested-abort", - Usage: "Calls the method logFunderRequestedAbort on the TBTCSystem contract.", - ArgsUsage: "[_abortOutputScript] ", - Action: tbtcsLogFunderRequestedAbort, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), - Flags: cmd.NonConstFlags, - }, { - Name: "log-setup-failed", - Usage: "Calls the method logSetupFailed on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsLogSetupFailed, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "log-fraud-during-setup", - Usage: "Calls the method logFraudDuringSetup on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsLogFraudDuringSetup, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "log-liquidated", - Usage: "Calls the method logLiquidated on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsLogLiquidated, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "log-exited-courtesy-call", - Usage: "Calls the method logExitedCourtesyCall on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsLogExitedCourtesyCall, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "finalize-eth-btc-price-feed-addition", - Usage: "Calls the method finalizeEthBtcPriceFeedAddition on the TBTCSystem contract.", - ArgsUsage: "", - Action: tbtcsFinalizeEthBtcPriceFeedAddition, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(0))), - Flags: cmd.NonConstFlags, - }, { - Name: "log-created", - Usage: "Calls the method logCreated on the TBTCSystem contract.", - ArgsUsage: "[_keepAddress] ", - Action: tbtcsLogCreated, - Before: cli.BeforeFunc(cmd.NonConstArgsChecker.AndThen(cmd.ArgCountChecker(1))), - Flags: cmd.NonConstFlags, - }}, - }) -} - -/// ------------------- Const methods ------------------- - -func tbtcsPriceFeed(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.PriceFeedAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsGetRemainingPauseTerm(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.GetRemainingPauseTermAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsGetRemainingSignerFeeDivisorUpdateTime(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.GetRemainingSignerFeeDivisorUpdateTimeAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsRelay(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.RelayAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsGetMaximumLotSize(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.GetMaximumLotSizeAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsGetMinimumLotSize(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.GetMinimumLotSizeAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsIsOwner(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.IsOwnerAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsOwner(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.OwnerAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsFetchRelayPreviousDifficulty(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.FetchRelayPreviousDifficultyAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsFetchBitcoinPrice(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.FetchBitcoinPriceAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsGetRemainingLotSizesUpdateTime(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.GetRemainingLotSizesUpdateTimeAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsApprovedToLog(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - _caller, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _caller, a address, from passed value %v", - c.Args()[0], - ) - } - - result, err := contract.ApprovedToLogAtBlock( - _caller, - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsGetAllowNewDeposits(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.GetAllowNewDepositsAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsKeepThreshold(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.KeepThresholdAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsGetUndercollateralizedThresholdPercent(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.GetUndercollateralizedThresholdPercentAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsGetRemainingKeepFactoriesUpgradeabilityTime(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.GetRemainingKeepFactoriesUpgradeabilityTimeAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsGetKeepFactoriesUpgradeabilityPeriod(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.GetKeepFactoriesUpgradeabilityPeriodAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsGetInitialCollateralizedPercent(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.GetInitialCollateralizedPercentAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsGetRemainingKeepFactoriesUpdateTime(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.GetRemainingKeepFactoriesUpdateTimeAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsGetGovernanceTimeDelay(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.GetGovernanceTimeDelayAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsGetNewDepositFeeEstimate(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.GetNewDepositFeeEstimateAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsGetRemainingCollateralizationThresholdsUpdateTime(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.GetRemainingCollateralizationThresholdsUpdateTimeAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsGetPriceFeedGovernanceTimeDelay(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.GetPriceFeedGovernanceTimeDelayAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsFetchRelayCurrentDifficulty(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.FetchRelayCurrentDifficultyAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsGetAllowedLotSizes(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.GetAllowedLotSizesAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsGetSeverelyUndercollateralizedThresholdPercent(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.GetSeverelyUndercollateralizedThresholdPercentAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsGetSignerFeeDivisor(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.GetSignerFeeDivisorAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsGetRemainingEthBtcPriceFeedAdditionTime(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.GetRemainingEthBtcPriceFeedAdditionTimeAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -func tbtcsKeepSize(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - result, err := contract.KeepSizeAtBlock( - - cmd.BlockFlagValue.Uint, - ) - - if err != nil { - return err - } - - cmd.PrintOutput(result) - - return nil -} - -/// ------------------- Non-const methods ------------------- - -func tbtcsFinalizeKeepFactoriesUpdate(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.FinalizeKeepFactoriesUpdate() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallFinalizeKeepFactoriesUpdate( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func tbtcsBeginKeepFactoriesUpdate(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - _keepStakedFactory, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _keepStakedFactory, a address, from passed value %v", - c.Args()[0], - ) - } - - _fullyBackedFactory, err := ethutil.AddressFromHex(c.Args()[1]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _fullyBackedFactory, a address, from passed value %v", - c.Args()[1], - ) - } - - _factorySelector, err := ethutil.AddressFromHex(c.Args()[2]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _factorySelector, a address, from passed value %v", - c.Args()[2], - ) - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.BeginKeepFactoriesUpdate( - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, - ) - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallBeginKeepFactoriesUpdate( - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func tbtcsEmergencyPauseNewDeposits(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.EmergencyPauseNewDeposits() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallEmergencyPauseNewDeposits( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func tbtcsBeginEthBtcPriceFeedAddition(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - _ethBtcPriceFeed, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _ethBtcPriceFeed, a address, from passed value %v", - c.Args()[0], - ) - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.BeginEthBtcPriceFeedAddition( - _ethBtcPriceFeed, - ) - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallBeginEthBtcPriceFeedAddition( - _ethBtcPriceFeed, - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func tbtcsTransferOwnership(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - newOwner, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter newOwner, a address, from passed value %v", - c.Args()[0], - ) - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.TransferOwnership( - newOwner, - ) - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallTransferOwnership( - newOwner, - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func tbtcsFinalizeSignerFeeDivisorUpdate(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.FinalizeSignerFeeDivisorUpdate() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallFinalizeSignerFeeDivisorUpdate( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func tbtcsResumeNewDeposits(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.ResumeNewDeposits() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallResumeNewDeposits( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func tbtcsRefreshMinimumBondableValue(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.RefreshMinimumBondableValue() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallRefreshMinimumBondableValue( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func tbtcsRenounceOwnership(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // 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.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func tbtcsFinalizeCollateralizationThresholdsUpdate(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.FinalizeCollateralizationThresholdsUpdate() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallFinalizeCollateralizationThresholdsUpdate( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func tbtcsFinalizeLotSizesUpdate(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.FinalizeLotSizesUpdate() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallFinalizeLotSizesUpdate( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func tbtcsLogCourtesyCalled(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.LogCourtesyCalled() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallLogCourtesyCalled( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func tbtcsLogFunderRequestedAbort(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - _abortOutputScript, err := hexutil.Decode(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _abortOutputScript, a bytes, from passed value %v", - c.Args()[0], - ) - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.LogFunderRequestedAbort( - _abortOutputScript, - ) - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallLogFunderRequestedAbort( - _abortOutputScript, - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func tbtcsLogSetupFailed(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.LogSetupFailed() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallLogSetupFailed( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func tbtcsLogFraudDuringSetup(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.LogFraudDuringSetup() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallLogFraudDuringSetup( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func tbtcsLogLiquidated(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.LogLiquidated() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallLogLiquidated( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func tbtcsLogExitedCourtesyCall(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.LogExitedCourtesyCall() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallLogExitedCourtesyCall( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func tbtcsFinalizeEthBtcPriceFeedAddition(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.FinalizeEthBtcPriceFeedAddition() - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallFinalizeEthBtcPriceFeedAddition( - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -func tbtcsLogCreated(c *cli.Context) error { - contract, err := initializeTBTCSystem(c) - if err != nil { - return err - } - - _keepAddress, err := ethutil.AddressFromHex(c.Args()[0]) - if err != nil { - return fmt.Errorf( - "couldn't parse parameter _keepAddress, a address, from passed value %v", - c.Args()[0], - ) - } - - var ( - transaction *types.Transaction - ) - - if c.Bool(cmd.SubmitFlag) { - // Do a regular submission. Take payable into account. - transaction, err = contract.LogCreated( - _keepAddress, - ) - if err != nil { - return err - } - - cmd.PrintOutput(transaction.Hash) - } else { - // Do a call. - err = contract.CallLogCreated( - _keepAddress, - cmd.BlockFlagValue.Uint, - ) - if err != nil { - return err - } - - cmd.PrintOutput(nil) - } - - return nil -} - -/// ------------------- Initialization ------------------- - -func initializeTBTCSystem(c *cli.Context) (*contract.TBTCSystem, error) { - config, err := config.ReadEthereumConfig(c.GlobalString("config")) - if err != nil { - return nil, fmt.Errorf("error reading Ethereum config from file: [%v]", err) - } - - client, _, _, err := ethutil.ConnectClients(config.URL, config.URLRPC) - if err != nil { - return nil, fmt.Errorf("error connecting to Ethereum node: [%v]", err) - } - - key, err := ethutil.DecryptKeyFile( - config.Account.KeyFile, - config.Account.KeyFilePassword, - ) - if err != nil { - return nil, fmt.Errorf( - "failed to read KeyFile: %s: [%v]", - config.Account.KeyFile, - err, - ) - } - - checkInterval := cmd.DefaultMiningCheckInterval - maxGasPrice := cmd.DefaultMaxGasPrice - if config.MiningCheckInterval != 0 { - checkInterval = time.Duration(config.MiningCheckInterval) * time.Second - } - if config.MaxGasPrice != 0 { - maxGasPrice = new(big.Int).SetUint64(config.MaxGasPrice) - } - - miningWaiter := ethutil.NewMiningWaiter(client, checkInterval, maxGasPrice) - - address := common.HexToAddress(config.ContractAddresses["TBTCSystem"]) - - return contract.NewTBTCSystem( - address, - key, - client, - ethutil.NewNonceManager(key.Address, client), - miningWaiter, - &sync.Mutex{}, - ) -} diff --git a/pkg/chain/ethereum/gen/contract/Deposit.go b/pkg/chain/ethereum/gen/contract/Deposit.go index d080cd83c..ebba81f54 100644 --- a/pkg/chain/ethereum/gen/contract/Deposit.go +++ b/pkg/chain/ethereum/gen/contract/Deposit.go @@ -91,6 +91,196 @@ func NewDeposit( // ----- Non-const Methods ------ +// Transaction submission. +func (d *Deposit) ProvideRedemptionProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, + + transactionOptions ...ethutil.TransactionOptions, +) (*types.Transaction, error) { + dLogger.Debug( + "submitting transaction provideRedemptionProof", + "params: ", + fmt.Sprint( + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ), + ) + + d.transactionMutex.Lock() + defer d.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *d.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 := d.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 := d.contract.ProvideRedemptionProof( + transactorOptions, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "provideRedemptionProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + } + + dLogger.Infof( + "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + go d.miningWaiter.ForceMining( + transaction, + func(newGasPrice *big.Int) (*types.Transaction, error) { + transactorOptions.GasLimit = transaction.Gas() + transactorOptions.GasPrice = newGasPrice + + transaction, err := d.contract.ProvideRedemptionProof( + transactorOptions, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + if err != nil { + return transaction, d.errorResolver.ResolveError( + err, + d.transactorOptions.From, + nil, + "provideRedemptionProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + } + + dLogger.Infof( + "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", + transaction.Hash().Hex(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + d.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (d *Deposit) CallProvideRedemptionProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := ethutil.CallAtBlock( + d.transactorOptions.From, + blockNumber, nil, + d.contractABI, + d.caller, + d.errorResolver, + d.contractAddress, + "provideRedemptionProof", + &result, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + + return err +} + +func (d *Deposit) ProvideRedemptionProofGasEstimate( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, +) (uint64, error) { + var result uint64 + + result, err := ethutil.EstimateGas( + d.callerOptions.From, + d.contractAddress, + "provideRedemptionProof", + d.contractABI, + d.transactor, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ) + + return result, err +} + // Transaction submission. func (d *Deposit) NotifyRedemptionProofTimedOut( @@ -208,12 +398,12 @@ func (d *Deposit) NotifyRedemptionProofTimedOutGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) PurchaseSignerBondsAtAuction( +func (d *Deposit) NotifySignerSetupFailed( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction purchaseSignerBondsAtAuction", + "submitting transaction notifySignerSetupFailed", ) d.transactionMutex.Lock() @@ -238,7 +428,7 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.PurchaseSignerBondsAtAuction( + transaction, err := d.contract.NotifySignerSetupFailed( transactorOptions, ) if err != nil { @@ -246,12 +436,12 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( err, d.transactorOptions.From, nil, - "purchaseSignerBondsAtAuction", + "notifySignerSetupFailed", ) } dLogger.Infof( - "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", + "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -262,7 +452,7 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.PurchaseSignerBondsAtAuction( + transaction, err := d.contract.NotifySignerSetupFailed( transactorOptions, ) if err != nil { @@ -270,12 +460,12 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( err, d.transactorOptions.From, nil, - "purchaseSignerBondsAtAuction", + "notifySignerSetupFailed", ) } dLogger.Infof( - "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", + "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -290,7 +480,7 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallPurchaseSignerBondsAtAuction( +func (d *Deposit) CallNotifySignerSetupFailed( blockNumber *big.Int, ) error { var result interface{} = nil @@ -302,20 +492,20 @@ func (d *Deposit) CallPurchaseSignerBondsAtAuction( d.caller, d.errorResolver, d.contractAddress, - "purchaseSignerBondsAtAuction", + "notifySignerSetupFailed", &result, ) return err } -func (d *Deposit) PurchaseSignerBondsAtAuctionGasEstimate() (uint64, error) { +func (d *Deposit) NotifySignerSetupFailedGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "purchaseSignerBondsAtAuction", + "notifySignerSetupFailed", d.contractABI, d.transactor, ) @@ -494,29 +684,19 @@ func (d *Deposit) ProvideECDSAFraudProofGasEstimate( } // Transaction submission. -func (d *Deposit) InitializeDeposit( - _tbtcSystem common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachineAddress common.Address, - _lotSizeSatoshis uint64, - value *big.Int, +func (d *Deposit) IncreaseRedemptionFee( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction initializeDeposit", + "submitting transaction increaseRedemptionFee", "params: ", fmt.Sprint( - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, + _previousOutputValueBytes, + _newOutputValueBytes, ), - "value: ", value, ) d.transactionMutex.Lock() @@ -526,8 +706,6 @@ func (d *Deposit) InitializeDeposit( transactorOptions := new(bind.TransactOpts) *transactorOptions = *d.transactorOptions - transactorOptions.Value = value - if len(transactionOptions) > 1 { return nil, fmt.Errorf( "could not process multiple transaction options sets", @@ -543,32 +721,24 @@ func (d *Deposit) InitializeDeposit( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.InitializeDeposit( + transaction, err := d.contract.IncreaseRedemptionFee( transactorOptions, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, + _previousOutputValueBytes, + _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, - value, - "initializeDeposit", - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, + nil, + "increaseRedemptionFee", + _previousOutputValueBytes, + _newOutputValueBytes, ) } dLogger.Infof( - "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", + "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -579,32 +749,24 @@ func (d *Deposit) InitializeDeposit( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.InitializeDeposit( + transaction, err := d.contract.IncreaseRedemptionFee( transactorOptions, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, + _previousOutputValueBytes, + _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, - value, - "initializeDeposit", - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, + nil, + "increaseRedemptionFee", + _previousOutputValueBytes, + _newOutputValueBytes, ) } dLogger.Infof( - "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", + "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -619,72 +781,55 @@ func (d *Deposit) InitializeDeposit( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallInitializeDeposit( - _tbtcSystem common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachineAddress common.Address, - _lotSizeSatoshis uint64, - value *big.Int, +func (d *Deposit) CallIncreaseRedemptionFee( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, blockNumber *big.Int, ) error { var result interface{} = nil err := ethutil.CallAtBlock( d.transactorOptions.From, - blockNumber, value, + blockNumber, nil, d.contractABI, d.caller, d.errorResolver, d.contractAddress, - "initializeDeposit", + "increaseRedemptionFee", &result, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, + _previousOutputValueBytes, + _newOutputValueBytes, ) return err } -func (d *Deposit) InitializeDepositGasEstimate( - _tbtcSystem common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachineAddress common.Address, - _lotSizeSatoshis uint64, +func (d *Deposit) IncreaseRedemptionFeeGasEstimate( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "initializeDeposit", + "increaseRedemptionFee", d.contractABI, d.transactor, - _tbtcSystem, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachineAddress, - _lotSizeSatoshis, + _previousOutputValueBytes, + _newOutputValueBytes, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyCourtesyCall( +func (d *Deposit) NotifyCourtesyCallExpired( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyCourtesyCall", + "submitting transaction notifyCourtesyCallExpired", ) d.transactionMutex.Lock() @@ -709,7 +854,7 @@ func (d *Deposit) NotifyCourtesyCall( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyCourtesyCall( + transaction, err := d.contract.NotifyCourtesyCallExpired( transactorOptions, ) if err != nil { @@ -717,12 +862,12 @@ func (d *Deposit) NotifyCourtesyCall( err, d.transactorOptions.From, nil, - "notifyCourtesyCall", + "notifyCourtesyCallExpired", ) } dLogger.Infof( - "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -733,7 +878,7 @@ func (d *Deposit) NotifyCourtesyCall( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyCourtesyCall( + transaction, err := d.contract.NotifyCourtesyCallExpired( transactorOptions, ) if err != nil { @@ -741,12 +886,12 @@ func (d *Deposit) NotifyCourtesyCall( err, d.transactorOptions.From, nil, - "notifyCourtesyCall", + "notifyCourtesyCallExpired", ) } dLogger.Infof( - "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -761,7 +906,7 @@ func (d *Deposit) NotifyCourtesyCall( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyCourtesyCall( +func (d *Deposit) CallNotifyCourtesyCallExpired( blockNumber *big.Int, ) error { var result interface{} = nil @@ -773,20 +918,20 @@ func (d *Deposit) CallNotifyCourtesyCall( d.caller, d.errorResolver, d.contractAddress, - "notifyCourtesyCall", + "notifyCourtesyCallExpired", &result, ) return err } -func (d *Deposit) NotifyCourtesyCallGasEstimate() (uint64, error) { +func (d *Deposit) NotifyCourtesyCallExpiredGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyCourtesyCall", + "notifyCourtesyCallExpired", d.contractABI, d.transactor, ) @@ -795,17 +940,12 @@ func (d *Deposit) NotifyCourtesyCallGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) RequestFunderAbort( - _abortOutputScript []uint8, +func (d *Deposit) NotifyUndercollateralizedLiquidation( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction requestFunderAbort", - "params: ", - fmt.Sprint( - _abortOutputScript, - ), + "submitting transaction notifyUndercollateralizedLiquidation", ) d.transactionMutex.Lock() @@ -830,22 +970,20 @@ func (d *Deposit) RequestFunderAbort( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.RequestFunderAbort( + transaction, err := d.contract.NotifyUndercollateralizedLiquidation( transactorOptions, - _abortOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "requestFunderAbort", - _abortOutputScript, + "notifyUndercollateralizedLiquidation", ) } dLogger.Infof( - "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", + "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -856,22 +994,20 @@ func (d *Deposit) RequestFunderAbort( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.RequestFunderAbort( + transaction, err := d.contract.NotifyUndercollateralizedLiquidation( transactorOptions, - _abortOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "requestFunderAbort", - _abortOutputScript, + "notifyUndercollateralizedLiquidation", ) } dLogger.Infof( - "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", + "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -886,8 +1022,7 @@ func (d *Deposit) RequestFunderAbort( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallRequestFunderAbort( - _abortOutputScript []uint8, +func (d *Deposit) CallNotifyUndercollateralizedLiquidation( blockNumber *big.Int, ) error { var result interface{} = nil @@ -899,38 +1034,39 @@ func (d *Deposit) CallRequestFunderAbort( d.caller, d.errorResolver, d.contractAddress, - "requestFunderAbort", + "notifyUndercollateralizedLiquidation", &result, - _abortOutputScript, ) return err } -func (d *Deposit) RequestFunderAbortGasEstimate( - _abortOutputScript []uint8, -) (uint64, error) { +func (d *Deposit) NotifyUndercollateralizedLiquidationGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "requestFunderAbort", + "notifyUndercollateralizedLiquidation", d.contractABI, d.transactor, - _abortOutputScript, ) return result, err } // Transaction submission. -func (d *Deposit) RetrieveSignerPubkey( +func (d *Deposit) RequestFunderAbort( + _abortOutputScript []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction retrieveSignerPubkey", + "submitting transaction requestFunderAbort", + "params: ", + fmt.Sprint( + _abortOutputScript, + ), ) d.transactionMutex.Lock() @@ -955,20 +1091,22 @@ func (d *Deposit) RetrieveSignerPubkey( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.RetrieveSignerPubkey( + transaction, err := d.contract.RequestFunderAbort( transactorOptions, + _abortOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "retrieveSignerPubkey", + "requestFunderAbort", + _abortOutputScript, ) } dLogger.Infof( - "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", + "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -979,20 +1117,22 @@ func (d *Deposit) RetrieveSignerPubkey( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.RetrieveSignerPubkey( + transaction, err := d.contract.RequestFunderAbort( transactorOptions, + _abortOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "retrieveSignerPubkey", + "requestFunderAbort", + _abortOutputScript, ) } dLogger.Infof( - "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", + "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1007,7 +1147,8 @@ func (d *Deposit) RetrieveSignerPubkey( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallRetrieveSignerPubkey( +func (d *Deposit) CallRequestFunderAbort( + _abortOutputScript []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1019,34 +1160,51 @@ func (d *Deposit) CallRetrieveSignerPubkey( d.caller, d.errorResolver, d.contractAddress, - "retrieveSignerPubkey", + "requestFunderAbort", &result, + _abortOutputScript, ) return err } -func (d *Deposit) RetrieveSignerPubkeyGasEstimate() (uint64, error) { +func (d *Deposit) RequestFunderAbortGasEstimate( + _abortOutputScript []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "retrieveSignerPubkey", + "requestFunderAbort", d.contractABI, d.transactor, + _abortOutputScript, ) return result, err } // Transaction submission. -func (d *Deposit) ExitCourtesyCall( +func (d *Deposit) ProvideFundingECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction exitCourtesyCall", + "submitting transaction provideFundingECDSAFraudProof", + "params: ", + fmt.Sprint( + _v, + _r, + _s, + _signedDigest, + _preimage, + ), ) d.transactionMutex.Lock() @@ -1071,20 +1229,30 @@ func (d *Deposit) ExitCourtesyCall( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ExitCourtesyCall( + transaction, err := d.contract.ProvideFundingECDSAFraudProof( transactorOptions, + _v, + _r, + _s, + _signedDigest, + _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "exitCourtesyCall", + "provideFundingECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, ) } dLogger.Infof( - "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1095,20 +1263,30 @@ func (d *Deposit) ExitCourtesyCall( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ExitCourtesyCall( + transaction, err := d.contract.ProvideFundingECDSAFraudProof( transactorOptions, + _v, + _r, + _s, + _signedDigest, + _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "exitCourtesyCall", + "provideFundingECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, ) } dLogger.Infof( - "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1123,7 +1301,12 @@ func (d *Deposit) ExitCourtesyCall( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallExitCourtesyCall( +func (d *Deposit) CallProvideFundingECDSAFraudProof( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1135,34 +1318,57 @@ func (d *Deposit) CallExitCourtesyCall( d.caller, d.errorResolver, d.contractAddress, - "exitCourtesyCall", + "provideFundingECDSAFraudProof", &result, + _v, + _r, + _s, + _signedDigest, + _preimage, ) return err } -func (d *Deposit) ExitCourtesyCallGasEstimate() (uint64, error) { +func (d *Deposit) ProvideFundingECDSAFraudProofGasEstimate( + _v uint8, + _r [32]uint8, + _s [32]uint8, + _signedDigest [32]uint8, + _preimage []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "exitCourtesyCall", + "provideFundingECDSAFraudProof", d.contractABI, d.transactor, + _v, + _r, + _s, + _signedDigest, + _preimage, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyCourtesyCallExpired( +func (d *Deposit) RequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyCourtesyCallExpired", + "submitting transaction requestRedemption", + "params: ", + fmt.Sprint( + _outputValueBytes, + _redeemerOutputScript, + ), ) d.transactionMutex.Lock() @@ -1187,20 +1393,24 @@ func (d *Deposit) NotifyCourtesyCallExpired( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyCourtesyCallExpired( + transaction, err := d.contract.RequestRedemption( transactorOptions, + _outputValueBytes, + _redeemerOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyCourtesyCallExpired", + "requestRedemption", + _outputValueBytes, + _redeemerOutputScript, ) } dLogger.Infof( - "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", + "submitted transaction requestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1211,20 +1421,24 @@ func (d *Deposit) NotifyCourtesyCallExpired( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyCourtesyCallExpired( + transaction, err := d.contract.RequestRedemption( transactorOptions, + _outputValueBytes, + _redeemerOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyCourtesyCallExpired", + "requestRedemption", + _outputValueBytes, + _redeemerOutputScript, ) } dLogger.Infof( - "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", + "submitted transaction requestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1239,7 +1453,9 @@ func (d *Deposit) NotifyCourtesyCallExpired( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyCourtesyCallExpired( +func (d *Deposit) CallRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1251,34 +1467,50 @@ func (d *Deposit) CallNotifyCourtesyCallExpired( d.caller, d.errorResolver, d.contractAddress, - "notifyCourtesyCallExpired", + "requestRedemption", &result, + _outputValueBytes, + _redeemerOutputScript, ) return err } -func (d *Deposit) NotifyCourtesyCallExpiredGasEstimate() (uint64, error) { +func (d *Deposit) RequestRedemptionGasEstimate( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyCourtesyCallExpired", + "requestRedemption", d.contractABI, d.transactor, + _outputValueBytes, + _redeemerOutputScript, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyFundingTimedOut( +func (d *Deposit) TransferAndRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyFundingTimedOut", + "submitting transaction transferAndRequestRedemption", + "params: ", + fmt.Sprint( + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, + ), ) d.transactionMutex.Lock() @@ -1303,20 +1535,26 @@ func (d *Deposit) NotifyFundingTimedOut( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyFundingTimedOut( + transaction, err := d.contract.TransferAndRequestRedemption( transactorOptions, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyFundingTimedOut", + "transferAndRequestRedemption", + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) } dLogger.Infof( - "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", + "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1327,20 +1565,26 @@ func (d *Deposit) NotifyFundingTimedOut( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyFundingTimedOut( + transaction, err := d.contract.TransferAndRequestRedemption( transactorOptions, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyFundingTimedOut", + "transferAndRequestRedemption", + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) } dLogger.Infof( - "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", + "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1355,7 +1599,10 @@ func (d *Deposit) NotifyFundingTimedOut( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyFundingTimedOut( +func (d *Deposit) CallTransferAndRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1367,34 +1614,44 @@ func (d *Deposit) CallNotifyFundingTimedOut( d.caller, d.errorResolver, d.contractAddress, - "notifyFundingTimedOut", + "transferAndRequestRedemption", &result, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) return err } -func (d *Deposit) NotifyFundingTimedOutGasEstimate() (uint64, error) { +func (d *Deposit) TransferAndRequestRedemptionGasEstimate( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyFundingTimedOut", + "transferAndRequestRedemption", d.contractABI, d.transactor, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyUndercollateralizedLiquidation( +func (d *Deposit) NotifyRedemptionSignatureTimedOut( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyUndercollateralizedLiquidation", + "submitting transaction notifyRedemptionSignatureTimedOut", ) d.transactionMutex.Lock() @@ -1419,7 +1676,7 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyUndercollateralizedLiquidation( + transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( transactorOptions, ) if err != nil { @@ -1427,12 +1684,12 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( err, d.transactorOptions.From, nil, - "notifyUndercollateralizedLiquidation", + "notifyRedemptionSignatureTimedOut", ) } dLogger.Infof( - "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1443,7 +1700,7 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyUndercollateralizedLiquidation( + transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( transactorOptions, ) if err != nil { @@ -1451,12 +1708,12 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( err, d.transactorOptions.From, nil, - "notifyUndercollateralizedLiquidation", + "notifyRedemptionSignatureTimedOut", ) } dLogger.Infof( - "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1471,7 +1728,7 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyUndercollateralizedLiquidation( +func (d *Deposit) CallNotifyRedemptionSignatureTimedOut( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1483,20 +1740,20 @@ func (d *Deposit) CallNotifyUndercollateralizedLiquidation( d.caller, d.errorResolver, d.contractAddress, - "notifyUndercollateralizedLiquidation", + "notifyRedemptionSignatureTimedOut", &result, ) return err } -func (d *Deposit) NotifyUndercollateralizedLiquidationGasEstimate() (uint64, error) { +func (d *Deposit) NotifyRedemptionSignatureTimedOutGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyUndercollateralizedLiquidation", + "notifyRedemptionSignatureTimedOut", d.contractABI, d.transactor, ) @@ -1505,30 +1762,20 @@ func (d *Deposit) NotifyUndercollateralizedLiquidationGasEstimate() (uint64, err } // Transaction submission. -func (d *Deposit) ProvideBTCFundingProof( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _fundingOutputIndex uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) ProvideRedemptionSignature( + _v uint8, + _r [32]uint8, + _s [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideBTCFundingProof", + "submitting transaction provideRedemptionSignature", "params: ", fmt.Sprint( - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _v, + _r, + _s, ), ) @@ -1554,36 +1801,26 @@ func (d *Deposit) ProvideBTCFundingProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideBTCFundingProof( + transaction, err := d.contract.ProvideRedemptionSignature( transactorOptions, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _v, + _r, + _s, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideBTCFundingProof", - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + "provideRedemptionSignature", + _v, + _r, + _s, ) } dLogger.Infof( - "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1594,36 +1831,26 @@ func (d *Deposit) ProvideBTCFundingProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideBTCFundingProof( + transaction, err := d.contract.ProvideRedemptionSignature( transactorOptions, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _v, + _r, + _s, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideBTCFundingProof", - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + "provideRedemptionSignature", + _v, + _r, + _s, ) } dLogger.Infof( - "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1638,15 +1865,10 @@ func (d *Deposit) ProvideBTCFundingProof( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideBTCFundingProof( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _fundingOutputIndex uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) CallProvideRedemptionSignature( + _v uint8, + _r [32]uint8, + _s [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1658,66 +1880,44 @@ func (d *Deposit) CallProvideBTCFundingProof( d.caller, d.errorResolver, d.contractAddress, - "provideBTCFundingProof", + "provideRedemptionSignature", &result, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _v, + _r, + _s, ) return err } -func (d *Deposit) ProvideBTCFundingProofGasEstimate( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _fundingOutputIndex uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) ProvideRedemptionSignatureGasEstimate( + _v uint8, + _r [32]uint8, + _s [32]uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideBTCFundingProof", + "provideRedemptionSignature", d.contractABI, d.transactor, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _v, + _r, + _s, ) return result, err } // Transaction submission. -func (d *Deposit) RequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, +func (d *Deposit) NotifyFundingTimedOut( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction requestRedemption", - "params: ", - fmt.Sprint( - _outputValueBytes, - _redeemerOutputScript, - ), + "submitting transaction notifyFundingTimedOut", ) d.transactionMutex.Lock() @@ -1742,24 +1942,20 @@ func (d *Deposit) RequestRedemption( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.RequestRedemption( + transaction, err := d.contract.NotifyFundingTimedOut( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "requestRedemption", - _outputValueBytes, - _redeemerOutputScript, + "notifyFundingTimedOut", ) } dLogger.Infof( - "submitted transaction requestRedemption with id: [%v] and nonce [%v]", + "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1770,24 +1966,20 @@ func (d *Deposit) RequestRedemption( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.RequestRedemption( + transaction, err := d.contract.NotifyFundingTimedOut( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "requestRedemption", - _outputValueBytes, - _redeemerOutputScript, + "notifyFundingTimedOut", ) } dLogger.Infof( - "submitted transaction requestRedemption with id: [%v] and nonce [%v]", + "submitted transaction notifyFundingTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1802,9 +1994,7 @@ func (d *Deposit) RequestRedemption( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallRequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, +func (d *Deposit) CallNotifyFundingTimedOut( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1816,41 +2006,34 @@ func (d *Deposit) CallRequestRedemption( d.caller, d.errorResolver, d.contractAddress, - "requestRedemption", + "notifyFundingTimedOut", &result, - _outputValueBytes, - _redeemerOutputScript, ) return err } -func (d *Deposit) RequestRedemptionGasEstimate( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, -) (uint64, error) { +func (d *Deposit) NotifyFundingTimedOutGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "requestRedemption", + "notifyFundingTimedOut", d.contractABI, d.transactor, - _outputValueBytes, - _redeemerOutputScript, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyRedemptionSignatureTimedOut( +func (d *Deposit) ExitCourtesyCall( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyRedemptionSignatureTimedOut", + "submitting transaction exitCourtesyCall", ) d.transactionMutex.Lock() @@ -1875,7 +2058,7 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( + transaction, err := d.contract.ExitCourtesyCall( transactorOptions, ) if err != nil { @@ -1883,12 +2066,12 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( err, d.transactorOptions.From, nil, - "notifyRedemptionSignatureTimedOut", + "exitCourtesyCall", ) } dLogger.Infof( - "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", + "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1899,7 +2082,7 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( + transaction, err := d.contract.ExitCourtesyCall( transactorOptions, ) if err != nil { @@ -1907,12 +2090,12 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( err, d.transactorOptions.From, nil, - "notifyRedemptionSignatureTimedOut", + "exitCourtesyCall", ) } dLogger.Infof( - "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", + "submitted transaction exitCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1927,7 +2110,7 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyRedemptionSignatureTimedOut( +func (d *Deposit) CallExitCourtesyCall( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1939,20 +2122,20 @@ func (d *Deposit) CallNotifyRedemptionSignatureTimedOut( d.caller, d.errorResolver, d.contractAddress, - "notifyRedemptionSignatureTimedOut", + "exitCourtesyCall", &result, ) return err } -func (d *Deposit) NotifyRedemptionSignatureTimedOutGasEstimate() (uint64, error) { +func (d *Deposit) ExitCourtesyCallGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyRedemptionSignatureTimedOut", + "exitCourtesyCall", d.contractABI, d.transactor, ) @@ -1961,24 +2144,16 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOutGasEstimate() (uint64, error) } // Transaction submission. -func (d *Deposit) ProvideFundingECDSAFraudProof( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) Initialize( + _factory common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideFundingECDSAFraudProof", + "submitting transaction initialize", "params: ", fmt.Sprint( - _v, - _r, - _s, - _signedDigest, - _preimage, + _factory, ), ) @@ -2004,30 +2179,22 @@ func (d *Deposit) ProvideFundingECDSAFraudProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideFundingECDSAFraudProof( + transaction, err := d.contract.Initialize( transactorOptions, - _v, - _r, - _s, - _signedDigest, - _preimage, + _factory, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideFundingECDSAFraudProof", - _v, - _r, - _s, - _signedDigest, - _preimage, + "initialize", + _factory, ) } dLogger.Infof( - "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", + "submitted transaction initialize with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2038,30 +2205,22 @@ func (d *Deposit) ProvideFundingECDSAFraudProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideFundingECDSAFraudProof( + transaction, err := d.contract.Initialize( transactorOptions, - _v, - _r, - _s, - _signedDigest, - _preimage, + _factory, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideFundingECDSAFraudProof", - _v, - _r, - _s, - _signedDigest, - _preimage, + "initialize", + _factory, ) } dLogger.Infof( - "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", + "submitted transaction initialize with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2076,12 +2235,8 @@ func (d *Deposit) ProvideFundingECDSAFraudProof( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideFundingECDSAFraudProof( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) CallInitialize( + _factory common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2093,59 +2248,38 @@ func (d *Deposit) CallProvideFundingECDSAFraudProof( d.caller, d.errorResolver, d.contractAddress, - "provideFundingECDSAFraudProof", + "initialize", &result, - _v, - _r, - _s, - _signedDigest, - _preimage, + _factory, ) return err } -func (d *Deposit) ProvideFundingECDSAFraudProofGasEstimate( - _v uint8, - _r [32]uint8, - _s [32]uint8, - _signedDigest [32]uint8, - _preimage []uint8, +func (d *Deposit) InitializeGasEstimate( + _factory common.Address, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideFundingECDSAFraudProof", + "initialize", d.contractABI, d.transactor, - _v, - _r, - _s, - _signedDigest, - _preimage, + _factory, ) return result, err } // Transaction submission. -func (d *Deposit) ProvideRedemptionSignature( - _v uint8, - _r [32]uint8, - _s [32]uint8, +func (d *Deposit) WithdrawFunds( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideRedemptionSignature", - "params: ", - fmt.Sprint( - _v, - _r, - _s, - ), + "submitting transaction withdrawFunds", ) d.transactionMutex.Lock() @@ -2170,26 +2304,20 @@ func (d *Deposit) ProvideRedemptionSignature( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideRedemptionSignature( + transaction, err := d.contract.WithdrawFunds( transactorOptions, - _v, - _r, - _s, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideRedemptionSignature", - _v, - _r, - _s, + "withdrawFunds", ) } dLogger.Infof( - "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", + "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2200,26 +2328,20 @@ func (d *Deposit) ProvideRedemptionSignature( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideRedemptionSignature( + transaction, err := d.contract.WithdrawFunds( transactorOptions, - _v, - _r, - _s, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "provideRedemptionSignature", - _v, - _r, - _s, + "withdrawFunds", ) } dLogger.Infof( - "submitted transaction provideRedemptionSignature with id: [%v] and nonce [%v]", + "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2234,10 +2356,7 @@ func (d *Deposit) ProvideRedemptionSignature( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideRedemptionSignature( - _v uint8, - _r [32]uint8, - _s [32]uint8, +func (d *Deposit) CallWithdrawFunds( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2249,49 +2368,34 @@ func (d *Deposit) CallProvideRedemptionSignature( d.caller, d.errorResolver, d.contractAddress, - "provideRedemptionSignature", + "withdrawFunds", &result, - _v, - _r, - _s, ) return err } -func (d *Deposit) ProvideRedemptionSignatureGasEstimate( - _v uint8, - _r [32]uint8, - _s [32]uint8, -) (uint64, error) { +func (d *Deposit) WithdrawFundsGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideRedemptionSignature", + "withdrawFunds", d.contractABI, d.transactor, - _v, - _r, - _s, ) return result, err } // Transaction submission. -func (d *Deposit) Initialize( - _factory common.Address, +func (d *Deposit) PurchaseSignerBondsAtAuction( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction initialize", - "params: ", - fmt.Sprint( - _factory, - ), + "submitting transaction purchaseSignerBondsAtAuction", ) d.transactionMutex.Lock() @@ -2316,22 +2420,20 @@ func (d *Deposit) Initialize( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.Initialize( + transaction, err := d.contract.PurchaseSignerBondsAtAuction( transactorOptions, - _factory, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "initialize", - _factory, + "purchaseSignerBondsAtAuction", ) } dLogger.Infof( - "submitted transaction initialize with id: [%v] and nonce [%v]", + "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2342,22 +2444,20 @@ func (d *Deposit) Initialize( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.Initialize( + transaction, err := d.contract.PurchaseSignerBondsAtAuction( transactorOptions, - _factory, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "initialize", - _factory, + "purchaseSignerBondsAtAuction", ) } dLogger.Infof( - "submitted transaction initialize with id: [%v] and nonce [%v]", + "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2372,8 +2472,7 @@ func (d *Deposit) Initialize( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallInitialize( - _factory common.Address, +func (d *Deposit) CallPurchaseSignerBondsAtAuction( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2385,38 +2484,34 @@ func (d *Deposit) CallInitialize( d.caller, d.errorResolver, d.contractAddress, - "initialize", + "purchaseSignerBondsAtAuction", &result, - _factory, ) return err } -func (d *Deposit) InitializeGasEstimate( - _factory common.Address, -) (uint64, error) { +func (d *Deposit) PurchaseSignerBondsAtAuctionGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "initialize", + "purchaseSignerBondsAtAuction", d.contractABI, d.transactor, - _factory, ) return result, err } // Transaction submission. -func (d *Deposit) NotifySignerSetupFailed( +func (d *Deposit) RetrieveSignerPubkey( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifySignerSetupFailed", + "submitting transaction retrieveSignerPubkey", ) d.transactionMutex.Lock() @@ -2441,7 +2536,7 @@ func (d *Deposit) NotifySignerSetupFailed( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifySignerSetupFailed( + transaction, err := d.contract.RetrieveSignerPubkey( transactorOptions, ) if err != nil { @@ -2449,12 +2544,12 @@ func (d *Deposit) NotifySignerSetupFailed( err, d.transactorOptions.From, nil, - "notifySignerSetupFailed", + "retrieveSignerPubkey", ) } dLogger.Infof( - "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", + "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2465,7 +2560,7 @@ func (d *Deposit) NotifySignerSetupFailed( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifySignerSetupFailed( + transaction, err := d.contract.RetrieveSignerPubkey( transactorOptions, ) if err != nil { @@ -2473,12 +2568,12 @@ func (d *Deposit) NotifySignerSetupFailed( err, d.transactorOptions.From, nil, - "notifySignerSetupFailed", + "retrieveSignerPubkey", ) } dLogger.Infof( - "submitted transaction notifySignerSetupFailed with id: [%v] and nonce [%v]", + "submitted transaction retrieveSignerPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2493,7 +2588,7 @@ func (d *Deposit) NotifySignerSetupFailed( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifySignerSetupFailed( +func (d *Deposit) CallRetrieveSignerPubkey( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2505,20 +2600,20 @@ func (d *Deposit) CallNotifySignerSetupFailed( d.caller, d.errorResolver, d.contractAddress, - "notifySignerSetupFailed", + "retrieveSignerPubkey", &result, ) return err } -func (d *Deposit) NotifySignerSetupFailedGasEstimate() (uint64, error) { +func (d *Deposit) RetrieveSignerPubkeyGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifySignerSetupFailed", + "retrieveSignerPubkey", d.contractABI, d.transactor, ) @@ -2527,29 +2622,29 @@ func (d *Deposit) NotifySignerSetupFailedGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) ProvideRedemptionProof( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) InitializeDeposit( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, + value *big.Int, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideRedemptionProof", + "submitting transaction initializeDeposit", "params: ", fmt.Sprint( - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ), + "value: ", value, ) d.transactionMutex.Lock() @@ -2559,6 +2654,8 @@ func (d *Deposit) ProvideRedemptionProof( transactorOptions := new(bind.TransactOpts) *transactorOptions = *d.transactorOptions + transactorOptions.Value = value + if len(transactionOptions) > 1 { return nil, fmt.Errorf( "could not process multiple transaction options sets", @@ -2574,34 +2671,32 @@ func (d *Deposit) ProvideRedemptionProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideRedemptionProof( + transaction, err := d.contract.InitializeDeposit( transactorOptions, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, - nil, - "provideRedemptionProof", - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + value, + "initializeDeposit", + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) } dLogger.Infof( - "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", + "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2612,34 +2707,32 @@ func (d *Deposit) ProvideRedemptionProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideRedemptionProof( + transaction, err := d.contract.InitializeDeposit( transactorOptions, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, - nil, - "provideRedemptionProof", - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + value, + "initializeDeposit", + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) } dLogger.Infof( - "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", + "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2654,82 +2747,72 @@ func (d *Deposit) ProvideRedemptionProof( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallProvideRedemptionProof( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) CallInitializeDeposit( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, + value *big.Int, blockNumber *big.Int, ) error { var result interface{} = nil err := ethutil.CallAtBlock( d.transactorOptions.From, - blockNumber, nil, + blockNumber, value, d.contractABI, d.caller, d.errorResolver, d.contractAddress, - "provideRedemptionProof", + "initializeDeposit", &result, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) return err } -func (d *Deposit) ProvideRedemptionProofGasEstimate( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) InitializeDepositGasEstimate( + _tbtcSystem common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachineAddress common.Address, + _lotSizeSatoshis uint64, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideRedemptionProof", + "initializeDeposit", d.contractABI, d.transactor, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) return result, err } // Transaction submission. -func (d *Deposit) IncreaseRedemptionFee( - _previousOutputValueBytes [8]uint8, - _newOutputValueBytes [8]uint8, +func (d *Deposit) NotifyCourtesyCall( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction increaseRedemptionFee", - "params: ", - fmt.Sprint( - _previousOutputValueBytes, - _newOutputValueBytes, - ), + "submitting transaction notifyCourtesyCall", ) d.transactionMutex.Lock() @@ -2754,24 +2837,20 @@ func (d *Deposit) IncreaseRedemptionFee( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.IncreaseRedemptionFee( + transaction, err := d.contract.NotifyCourtesyCall( transactorOptions, - _previousOutputValueBytes, - _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "increaseRedemptionFee", - _previousOutputValueBytes, - _newOutputValueBytes, + "notifyCourtesyCall", ) } dLogger.Infof( - "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2782,24 +2861,20 @@ func (d *Deposit) IncreaseRedemptionFee( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.IncreaseRedemptionFee( + transaction, err := d.contract.NotifyCourtesyCall( transactorOptions, - _previousOutputValueBytes, - _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "increaseRedemptionFee", - _previousOutputValueBytes, - _newOutputValueBytes, + "notifyCourtesyCall", ) } dLogger.Infof( - "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2814,9 +2889,7 @@ func (d *Deposit) IncreaseRedemptionFee( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallIncreaseRedemptionFee( - _previousOutputValueBytes [8]uint8, - _newOutputValueBytes [8]uint8, +func (d *Deposit) CallNotifyCourtesyCall( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2828,49 +2901,52 @@ func (d *Deposit) CallIncreaseRedemptionFee( d.caller, d.errorResolver, d.contractAddress, - "increaseRedemptionFee", + "notifyCourtesyCall", &result, - _previousOutputValueBytes, - _newOutputValueBytes, ) return err } -func (d *Deposit) IncreaseRedemptionFeeGasEstimate( - _previousOutputValueBytes [8]uint8, - _newOutputValueBytes [8]uint8, -) (uint64, error) { +func (d *Deposit) NotifyCourtesyCallGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "increaseRedemptionFee", + "notifyCourtesyCall", d.contractABI, d.transactor, - _previousOutputValueBytes, - _newOutputValueBytes, ) return result, err } // Transaction submission. -func (d *Deposit) TransferAndRequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, - _finalRecipient common.Address, +func (d *Deposit) ProvideBTCFundingProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _fundingOutputIndex uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction transferAndRequestRedemption", + "submitting transaction provideBTCFundingProof", "params: ", fmt.Sprint( - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ), ) @@ -2896,26 +2972,36 @@ func (d *Deposit) TransferAndRequestRedemption( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.TransferAndRequestRedemption( + transaction, err := d.contract.ProvideBTCFundingProof( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "transferAndRequestRedemption", - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + "provideBTCFundingProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) } dLogger.Infof( - "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", + "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2926,26 +3012,36 @@ func (d *Deposit) TransferAndRequestRedemption( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.TransferAndRequestRedemption( + transaction, err := d.contract.ProvideBTCFundingProof( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "transferAndRequestRedemption", - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + "provideBTCFundingProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) } dLogger.Infof( - "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", + "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2960,10 +3056,15 @@ func (d *Deposit) TransferAndRequestRedemption( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallTransferAndRequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, - _finalRecipient common.Address, +func (d *Deposit) CallProvideBTCFundingProof( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _fundingOutputIndex uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2975,148 +3076,47 @@ func (d *Deposit) CallTransferAndRequestRedemption( d.caller, d.errorResolver, d.contractAddress, - "transferAndRequestRedemption", + "provideBTCFundingProof", &result, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) return err } -func (d *Deposit) TransferAndRequestRedemptionGasEstimate( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, - _finalRecipient common.Address, +func (d *Deposit) ProvideBTCFundingProofGasEstimate( + _txVersion [4]uint8, + _txInputVector []uint8, + _txOutputVector []uint8, + _txLocktime [4]uint8, + _fundingOutputIndex uint8, + _merkleProof []uint8, + _txIndexInBlock *big.Int, + _bitcoinHeaders []uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "transferAndRequestRedemption", - d.contractABI, - d.transactor, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, - ) - - return result, err -} - -// Transaction submission. -func (d *Deposit) WithdrawFunds( - - transactionOptions ...ethutil.TransactionOptions, -) (*types.Transaction, error) { - dLogger.Debug( - "submitting transaction withdrawFunds", - ) - - d.transactionMutex.Lock() - defer d.transactionMutex.Unlock() - - // create a copy - transactorOptions := new(bind.TransactOpts) - *transactorOptions = *d.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 := d.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 := d.contract.WithdrawFunds( - transactorOptions, - ) - if err != nil { - return transaction, d.errorResolver.ResolveError( - err, - d.transactorOptions.From, - nil, - "withdrawFunds", - ) - } - - dLogger.Infof( - "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - go d.miningWaiter.ForceMining( - transaction, - func(newGasPrice *big.Int) (*types.Transaction, error) { - transactorOptions.GasLimit = transaction.Gas() - transactorOptions.GasPrice = newGasPrice - - transaction, err := d.contract.WithdrawFunds( - transactorOptions, - ) - if err != nil { - return transaction, d.errorResolver.ResolveError( - err, - d.transactorOptions.From, - nil, - "withdrawFunds", - ) - } - - dLogger.Infof( - "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", - transaction.Hash().Hex(), - transaction.Nonce(), - ) - - return transaction, nil - }, - ) - - d.nonceManager.IncrementNonce() - - return transaction, err -} - -// Non-mutating call, not a transaction submission. -func (d *Deposit) CallWithdrawFunds( - blockNumber *big.Int, -) error { - var result interface{} = nil - - err := ethutil.CallAtBlock( - d.transactorOptions.From, - blockNumber, nil, - d.contractABI, - d.caller, - d.errorResolver, - d.contractAddress, - "withdrawFunds", - &result, - ) - - return err -} - -func (d *Deposit) WithdrawFundsGasEstimate() (uint64, error) { - var result uint64 - - result, err := ethutil.EstimateGas( - d.callerOptions.From, - d.contractAddress, - "withdrawFunds", + "provideBTCFundingProof", d.contractABI, d.transactor, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) return result, err @@ -3124,9 +3124,9 @@ func (d *Deposit) WithdrawFundsGasEstimate() (uint64, error) { // ----- Const Methods ------ -func (d *Deposit) RemainingTerm() (*big.Int, error) { +func (d *Deposit) LotSizeTbtc() (*big.Int, error) { var result *big.Int - result, err := d.contract.RemainingTerm( + result, err := d.contract.LotSizeTbtc( d.callerOptions, ) @@ -3135,14 +3135,14 @@ func (d *Deposit) RemainingTerm() (*big.Int, error) { err, d.callerOptions.From, nil, - "remainingTerm", + "lotSizeTbtc", ) } return result, err } -func (d *Deposit) RemainingTermAtBlock( +func (d *Deposit) LotSizeTbtcAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3155,17 +3155,20 @@ func (d *Deposit) RemainingTermAtBlock( d.caller, d.errorResolver, d.contractAddress, - "remainingTerm", + "lotSizeTbtc", &result, ) return result, err } -func (d *Deposit) LotSizeSatoshis() (uint64, error) { - var result uint64 - result, err := d.contract.LotSizeSatoshis( +func (d *Deposit) GetOwnerRedemptionTbtcRequirement( + _redeemer common.Address, +) (*big.Int, error) { + var result *big.Int + result, err := d.contract.GetOwnerRedemptionTbtcRequirement( d.callerOptions, + _redeemer, ) if err != nil { @@ -3173,17 +3176,19 @@ func (d *Deposit) LotSizeSatoshis() (uint64, error) { err, d.callerOptions.From, nil, - "lotSizeSatoshis", + "getOwnerRedemptionTbtcRequirement", + _redeemer, ) } return result, err } -func (d *Deposit) LotSizeSatoshisAtBlock( +func (d *Deposit) GetOwnerRedemptionTbtcRequirementAtBlock( + _redeemer common.Address, blockNumber *big.Int, -) (uint64, error) { - var result uint64 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3193,16 +3198,17 @@ func (d *Deposit) LotSizeSatoshisAtBlock( d.caller, d.errorResolver, d.contractAddress, - "lotSizeSatoshis", + "getOwnerRedemptionTbtcRequirement", &result, + _redeemer, ) return result, err } -func (d *Deposit) InActive() (bool, error) { - var result bool - result, err := d.contract.InActive( +func (d *Deposit) CurrentState() (*big.Int, error) { + var result *big.Int + result, err := d.contract.CurrentState( d.callerOptions, ) @@ -3211,17 +3217,17 @@ func (d *Deposit) InActive() (bool, error) { err, d.callerOptions.From, nil, - "inActive", + "currentState", ) } return result, err } -func (d *Deposit) InActiveAtBlock( +func (d *Deposit) CurrentStateAtBlock( blockNumber *big.Int, -) (bool, error) { - var result bool +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3231,22 +3237,16 @@ func (d *Deposit) InActiveAtBlock( d.caller, d.errorResolver, d.contractAddress, - "inActive", + "currentState", &result, ) return result, err } -type fundingInfo struct { - UtxoValueBytes [8]uint8 - FundedAt *big.Int - UtxoOutpoint []uint8 -} - -func (d *Deposit) FundingInfo() (fundingInfo, error) { - var result fundingInfo - result, err := d.contract.FundingInfo( +func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { + var result uint16 + result, err := d.contract.InitialCollateralizedPercent( d.callerOptions, ) @@ -3255,17 +3255,17 @@ func (d *Deposit) FundingInfo() (fundingInfo, error) { err, d.callerOptions.From, nil, - "fundingInfo", + "initialCollateralizedPercent", ) } return result, err } -func (d *Deposit) FundingInfoAtBlock( +func (d *Deposit) InitialCollateralizedPercentAtBlock( blockNumber *big.Int, -) (fundingInfo, error) { - var result fundingInfo +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3275,16 +3275,16 @@ func (d *Deposit) FundingInfoAtBlock( d.caller, d.errorResolver, d.contractAddress, - "fundingInfo", + "initialCollateralizedPercent", &result, ) return result, err } -func (d *Deposit) AuctionValue() (*big.Int, error) { +func (d *Deposit) CollateralizationPercentage() (*big.Int, error) { var result *big.Int - result, err := d.contract.AuctionValue( + result, err := d.contract.CollateralizationPercentage( d.callerOptions, ) @@ -3293,14 +3293,14 @@ func (d *Deposit) AuctionValue() (*big.Int, error) { err, d.callerOptions.From, nil, - "auctionValue", + "collateralizationPercentage", ) } return result, err } -func (d *Deposit) AuctionValueAtBlock( +func (d *Deposit) CollateralizationPercentageAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3313,16 +3313,22 @@ func (d *Deposit) AuctionValueAtBlock( d.caller, d.errorResolver, d.contractAddress, - "auctionValue", + "collateralizationPercentage", &result, ) return result, err } -func (d *Deposit) LotSizeTbtc() (*big.Int, error) { - var result *big.Int - result, err := d.contract.LotSizeTbtc( +type fundingInfo struct { + UtxoValueBytes [8]uint8 + FundedAt *big.Int + UtxoOutpoint []uint8 +} + +func (d *Deposit) FundingInfo() (fundingInfo, error) { + var result fundingInfo + result, err := d.contract.FundingInfo( d.callerOptions, ) @@ -3331,17 +3337,17 @@ func (d *Deposit) LotSizeTbtc() (*big.Int, error) { err, d.callerOptions.From, nil, - "lotSizeTbtc", + "fundingInfo", ) } return result, err } -func (d *Deposit) LotSizeTbtcAtBlock( +func (d *Deposit) FundingInfoAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (fundingInfo, error) { + var result fundingInfo err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3351,16 +3357,16 @@ func (d *Deposit) LotSizeTbtcAtBlock( d.caller, d.errorResolver, d.contractAddress, - "lotSizeTbtc", + "fundingInfo", &result, ) return result, err } -func (d *Deposit) SeverelyUndercollateralizedThresholdPercent() (uint16, error) { - var result uint16 - result, err := d.contract.SeverelyUndercollateralizedThresholdPercent( +func (d *Deposit) InActive() (bool, error) { + var result bool + result, err := d.contract.InActive( d.callerOptions, ) @@ -3369,17 +3375,17 @@ func (d *Deposit) SeverelyUndercollateralizedThresholdPercent() (uint16, error) err, d.callerOptions.From, nil, - "severelyUndercollateralizedThresholdPercent", + "inActive", ) } return result, err } -func (d *Deposit) SeverelyUndercollateralizedThresholdPercentAtBlock( +func (d *Deposit) InActiveAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (bool, error) { + var result bool err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3389,16 +3395,16 @@ func (d *Deposit) SeverelyUndercollateralizedThresholdPercentAtBlock( d.caller, d.errorResolver, d.contractAddress, - "severelyUndercollateralizedThresholdPercent", + "inActive", &result, ) return result, err } -func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { - var result uint16 - result, err := d.contract.InitialCollateralizedPercent( +func (d *Deposit) WithdrawableAmount() (*big.Int, error) { + var result *big.Int + result, err := d.contract.WithdrawableAmount( d.callerOptions, ) @@ -3407,17 +3413,17 @@ func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { err, d.callerOptions.From, nil, - "initialCollateralizedPercent", + "withdrawableAmount", ) } return result, err } -func (d *Deposit) InitialCollateralizedPercentAtBlock( +func (d *Deposit) WithdrawableAmountAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3427,16 +3433,16 @@ func (d *Deposit) InitialCollateralizedPercentAtBlock( d.caller, d.errorResolver, d.contractAddress, - "initialCollateralizedPercent", + "withdrawableAmount", &result, ) return result, err } -func (d *Deposit) KeepAddress() (common.Address, error) { - var result common.Address - result, err := d.contract.KeepAddress( +func (d *Deposit) SeverelyUndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := d.contract.SeverelyUndercollateralizedThresholdPercent( d.callerOptions, ) @@ -3445,17 +3451,17 @@ func (d *Deposit) KeepAddress() (common.Address, error) { err, d.callerOptions.From, nil, - "keepAddress", + "severelyUndercollateralizedThresholdPercent", ) } return result, err } -func (d *Deposit) KeepAddressAtBlock( +func (d *Deposit) SeverelyUndercollateralizedThresholdPercentAtBlock( blockNumber *big.Int, -) (common.Address, error) { - var result common.Address +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3465,16 +3471,16 @@ func (d *Deposit) KeepAddressAtBlock( d.caller, d.errorResolver, d.contractAddress, - "keepAddress", + "severelyUndercollateralizedThresholdPercent", &result, ) return result, err } -func (d *Deposit) CollateralizationPercentage() (*big.Int, error) { +func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { var result *big.Int - result, err := d.contract.CollateralizationPercentage( + result, err := d.contract.SignerFeeTbtc( d.callerOptions, ) @@ -3483,14 +3489,14 @@ func (d *Deposit) CollateralizationPercentage() (*big.Int, error) { err, d.callerOptions.From, nil, - "collateralizationPercentage", + "signerFeeTbtc", ) } return result, err } -func (d *Deposit) CollateralizationPercentageAtBlock( +func (d *Deposit) SignerFeeTbtcAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3503,16 +3509,16 @@ func (d *Deposit) CollateralizationPercentageAtBlock( d.caller, d.errorResolver, d.contractAddress, - "collateralizationPercentage", + "signerFeeTbtc", &result, ) return result, err } -func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { +func (d *Deposit) AuctionValue() (*big.Int, error) { var result *big.Int - result, err := d.contract.SignerFeeTbtc( + result, err := d.contract.AuctionValue( d.callerOptions, ) @@ -3521,14 +3527,14 @@ func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { err, d.callerOptions.From, nil, - "signerFeeTbtc", + "auctionValue", ) } return result, err } -func (d *Deposit) SignerFeeTbtcAtBlock( +func (d *Deposit) AuctionValueAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3541,17 +3547,20 @@ func (d *Deposit) SignerFeeTbtcAtBlock( d.caller, d.errorResolver, d.contractAddress, - "signerFeeTbtc", + "auctionValue", &result, ) return result, err } -func (d *Deposit) UndercollateralizedThresholdPercent() (uint16, error) { - var result uint16 - result, err := d.contract.UndercollateralizedThresholdPercent( +func (d *Deposit) GetRedemptionTbtcRequirement( + _redeemer common.Address, +) (*big.Int, error) { + var result *big.Int + result, err := d.contract.GetRedemptionTbtcRequirement( d.callerOptions, + _redeemer, ) if err != nil { @@ -3559,17 +3568,19 @@ func (d *Deposit) UndercollateralizedThresholdPercent() (uint16, error) { err, d.callerOptions.From, nil, - "undercollateralizedThresholdPercent", + "getRedemptionTbtcRequirement", + _redeemer, ) } return result, err } -func (d *Deposit) UndercollateralizedThresholdPercentAtBlock( +func (d *Deposit) GetRedemptionTbtcRequirementAtBlock( + _redeemer common.Address, blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3579,16 +3590,17 @@ func (d *Deposit) UndercollateralizedThresholdPercentAtBlock( d.caller, d.errorResolver, d.contractAddress, - "undercollateralizedThresholdPercent", + "getRedemptionTbtcRequirement", &result, + _redeemer, ) return result, err } -func (d *Deposit) WithdrawableAmount() (*big.Int, error) { - var result *big.Int - result, err := d.contract.WithdrawableAmount( +func (d *Deposit) LotSizeSatoshis() (uint64, error) { + var result uint64 + result, err := d.contract.LotSizeSatoshis( d.callerOptions, ) @@ -3597,17 +3609,17 @@ func (d *Deposit) WithdrawableAmount() (*big.Int, error) { err, d.callerOptions.From, nil, - "withdrawableAmount", + "lotSizeSatoshis", ) } return result, err } -func (d *Deposit) WithdrawableAmountAtBlock( +func (d *Deposit) LotSizeSatoshisAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (uint64, error) { + var result uint64 err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3617,20 +3629,17 @@ func (d *Deposit) WithdrawableAmountAtBlock( d.caller, d.errorResolver, d.contractAddress, - "withdrawableAmount", + "lotSizeSatoshis", &result, ) return result, err } -func (d *Deposit) GetRedemptionTbtcRequirement( - _redeemer common.Address, -) (*big.Int, error) { +func (d *Deposit) UtxoValue() (*big.Int, error) { var result *big.Int - result, err := d.contract.GetRedemptionTbtcRequirement( + result, err := d.contract.UtxoValue( d.callerOptions, - _redeemer, ) if err != nil { @@ -3638,16 +3647,14 @@ func (d *Deposit) GetRedemptionTbtcRequirement( err, d.callerOptions.From, nil, - "getRedemptionTbtcRequirement", - _redeemer, + "utxoValue", ) } return result, err } -func (d *Deposit) GetRedemptionTbtcRequirementAtBlock( - _redeemer common.Address, +func (d *Deposit) UtxoValueAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3660,17 +3667,16 @@ func (d *Deposit) GetRedemptionTbtcRequirementAtBlock( d.caller, d.errorResolver, d.contractAddress, - "getRedemptionTbtcRequirement", + "utxoValue", &result, - _redeemer, ) return result, err } -func (d *Deposit) UtxoValue() (*big.Int, error) { +func (d *Deposit) RemainingTerm() (*big.Int, error) { var result *big.Int - result, err := d.contract.UtxoValue( + result, err := d.contract.RemainingTerm( d.callerOptions, ) @@ -3679,14 +3685,14 @@ func (d *Deposit) UtxoValue() (*big.Int, error) { err, d.callerOptions.From, nil, - "utxoValue", + "remainingTerm", ) } return result, err } -func (d *Deposit) UtxoValueAtBlock( +func (d *Deposit) RemainingTermAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3699,16 +3705,16 @@ func (d *Deposit) UtxoValueAtBlock( d.caller, d.errorResolver, d.contractAddress, - "utxoValue", + "remainingTerm", &result, ) return result, err } -func (d *Deposit) CurrentState() (*big.Int, error) { - var result *big.Int - result, err := d.contract.CurrentState( +func (d *Deposit) UndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := d.contract.UndercollateralizedThresholdPercent( d.callerOptions, ) @@ -3717,17 +3723,17 @@ func (d *Deposit) CurrentState() (*big.Int, error) { err, d.callerOptions.From, nil, - "currentState", + "undercollateralizedThresholdPercent", ) } return result, err } -func (d *Deposit) CurrentStateAtBlock( +func (d *Deposit) UndercollateralizedThresholdPercentAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3737,20 +3743,17 @@ func (d *Deposit) CurrentStateAtBlock( d.caller, d.errorResolver, d.contractAddress, - "currentState", + "undercollateralizedThresholdPercent", &result, ) return result, err } -func (d *Deposit) GetOwnerRedemptionTbtcRequirement( - _redeemer common.Address, -) (*big.Int, error) { - var result *big.Int - result, err := d.contract.GetOwnerRedemptionTbtcRequirement( +func (d *Deposit) KeepAddress() (common.Address, error) { + var result common.Address + result, err := d.contract.KeepAddress( d.callerOptions, - _redeemer, ) if err != nil { @@ -3758,19 +3761,17 @@ func (d *Deposit) GetOwnerRedemptionTbtcRequirement( err, d.callerOptions.From, nil, - "getOwnerRedemptionTbtcRequirement", - _redeemer, + "keepAddress", ) } return result, err } -func (d *Deposit) GetOwnerRedemptionTbtcRequirementAtBlock( - _redeemer common.Address, +func (d *Deposit) KeepAddressAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (common.Address, error) { + var result common.Address err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3780,9 +3781,8 @@ func (d *Deposit) GetOwnerRedemptionTbtcRequirementAtBlock( d.caller, d.errorResolver, d.contractAddress, - "getOwnerRedemptionTbtcRequirement", + "keepAddress", &result, - _redeemer, ) return result, err diff --git a/pkg/chain/ethereum/gen/contract/TBTCSystem.go b/pkg/chain/ethereum/gen/contract/TBTCSystem.go index caaa707ed..9b5d42d45 100644 --- a/pkg/chain/ethereum/gen/contract/TBTCSystem.go +++ b/pkg/chain/ethereum/gen/contract/TBTCSystem.go @@ -94,12 +94,12 @@ func NewTBTCSystem( // ----- Non-const Methods ------ // Transaction submission. -func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( +func (tbtcs *TBTCSystem) LogLiquidated( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction finalizeKeepFactoriesUpdate", + "submitting transaction logLiquidated", ) tbtcs.transactionMutex.Lock() @@ -124,7 +124,7 @@ func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.FinalizeKeepFactoriesUpdate( + transaction, err := tbtcs.contract.LogLiquidated( transactorOptions, ) if err != nil { @@ -132,12 +132,12 @@ func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( err, tbtcs.transactorOptions.From, nil, - "finalizeKeepFactoriesUpdate", + "logLiquidated", ) } tbtcsLogger.Infof( - "submitted transaction finalizeKeepFactoriesUpdate with id: [%v] and nonce [%v]", + "submitted transaction logLiquidated with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -148,7 +148,7 @@ func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.FinalizeKeepFactoriesUpdate( + transaction, err := tbtcs.contract.LogLiquidated( transactorOptions, ) if err != nil { @@ -156,12 +156,12 @@ func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( err, tbtcs.transactorOptions.From, nil, - "finalizeKeepFactoriesUpdate", + "logLiquidated", ) } tbtcsLogger.Infof( - "submitted transaction finalizeKeepFactoriesUpdate with id: [%v] and nonce [%v]", + "submitted transaction logLiquidated with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -176,7 +176,7 @@ func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallFinalizeKeepFactoriesUpdate( +func (tbtcs *TBTCSystem) CallLogLiquidated( blockNumber *big.Int, ) error { var result interface{} = nil @@ -188,20 +188,20 @@ func (tbtcs *TBTCSystem) CallFinalizeKeepFactoriesUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "finalizeKeepFactoriesUpdate", + "logLiquidated", &result, ) return err } -func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdateGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogLiquidatedGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "finalizeKeepFactoriesUpdate", + "logLiquidated", tbtcs.contractABI, tbtcs.transactor, ) @@ -210,21 +210,12 @@ func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdateGasEstimate() (uint64, error } // Transaction submission. -func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdate( - _keepStakedFactory common.Address, - _fullyBackedFactory common.Address, - _factorySelector common.Address, +func (tbtcs *TBTCSystem) LogExitedCourtesyCall( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction beginKeepFactoriesUpdate", - "params: ", - fmt.Sprint( - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, - ), + "submitting transaction logExitedCourtesyCall", ) tbtcs.transactionMutex.Lock() @@ -249,26 +240,20 @@ func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.BeginKeepFactoriesUpdate( + transaction, err := tbtcs.contract.LogExitedCourtesyCall( transactorOptions, - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginKeepFactoriesUpdate", - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + "logExitedCourtesyCall", ) } tbtcsLogger.Infof( - "submitted transaction beginKeepFactoriesUpdate with id: [%v] and nonce [%v]", + "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -279,26 +264,20 @@ func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.BeginKeepFactoriesUpdate( + transaction, err := tbtcs.contract.LogExitedCourtesyCall( transactorOptions, - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginKeepFactoriesUpdate", - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + "logExitedCourtesyCall", ) } tbtcsLogger.Infof( - "submitted transaction beginKeepFactoriesUpdate with id: [%v] and nonce [%v]", + "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -313,10 +292,7 @@ func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallBeginKeepFactoriesUpdate( - _keepStakedFactory common.Address, - _fullyBackedFactory common.Address, - _factorySelector common.Address, +func (tbtcs *TBTCSystem) CallLogExitedCourtesyCall( blockNumber *big.Int, ) error { var result interface{} = nil @@ -328,44 +304,34 @@ func (tbtcs *TBTCSystem) CallBeginKeepFactoriesUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "beginKeepFactoriesUpdate", + "logExitedCourtesyCall", &result, - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, ) return err } -func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdateGasEstimate( - _keepStakedFactory common.Address, - _fullyBackedFactory common.Address, - _factorySelector common.Address, -) (uint64, error) { +func (tbtcs *TBTCSystem) LogExitedCourtesyCallGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "beginKeepFactoriesUpdate", + "logExitedCourtesyCall", tbtcs.contractABI, tbtcs.transactor, - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) EmergencyPauseNewDeposits( +func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction emergencyPauseNewDeposits", + "submitting transaction refreshMinimumBondableValue", ) tbtcs.transactionMutex.Lock() @@ -390,7 +356,7 @@ func (tbtcs *TBTCSystem) EmergencyPauseNewDeposits( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.EmergencyPauseNewDeposits( + transaction, err := tbtcs.contract.RefreshMinimumBondableValue( transactorOptions, ) if err != nil { @@ -398,12 +364,12 @@ func (tbtcs *TBTCSystem) EmergencyPauseNewDeposits( err, tbtcs.transactorOptions.From, nil, - "emergencyPauseNewDeposits", + "refreshMinimumBondableValue", ) } tbtcsLogger.Infof( - "submitted transaction emergencyPauseNewDeposits with id: [%v] and nonce [%v]", + "submitted transaction refreshMinimumBondableValue with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -414,7 +380,7 @@ func (tbtcs *TBTCSystem) EmergencyPauseNewDeposits( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.EmergencyPauseNewDeposits( + transaction, err := tbtcs.contract.RefreshMinimumBondableValue( transactorOptions, ) if err != nil { @@ -422,12 +388,12 @@ func (tbtcs *TBTCSystem) EmergencyPauseNewDeposits( err, tbtcs.transactorOptions.From, nil, - "emergencyPauseNewDeposits", + "refreshMinimumBondableValue", ) } tbtcsLogger.Infof( - "submitted transaction emergencyPauseNewDeposits with id: [%v] and nonce [%v]", + "submitted transaction refreshMinimumBondableValue with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -442,7 +408,7 @@ func (tbtcs *TBTCSystem) EmergencyPauseNewDeposits( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallEmergencyPauseNewDeposits( +func (tbtcs *TBTCSystem) CallRefreshMinimumBondableValue( blockNumber *big.Int, ) error { var result interface{} = nil @@ -454,20 +420,20 @@ func (tbtcs *TBTCSystem) CallEmergencyPauseNewDeposits( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "emergencyPauseNewDeposits", + "refreshMinimumBondableValue", &result, ) return err } -func (tbtcs *TBTCSystem) EmergencyPauseNewDepositsGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) RefreshMinimumBondableValueGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "emergencyPauseNewDeposits", + "refreshMinimumBondableValue", tbtcs.contractABI, tbtcs.transactor, ) @@ -476,26 +442,16 @@ func (tbtcs *TBTCSystem) EmergencyPauseNewDepositsGasEstimate() (uint64, error) } // Transaction submission. -func (tbtcs *TBTCSystem) LogRedemptionRequested( - _requester common.Address, - _digest [32]uint8, - _utxoValue *big.Int, - _redeemerOutputScript []uint8, - _requestedFee *big.Int, - _outpoint []uint8, +func (tbtcs *TBTCSystem) TransferOwnership( + newOwner common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logRedemptionRequested", + "submitting transaction transferOwnership", "params: ", fmt.Sprint( - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, + newOwner, ), ) @@ -521,32 +477,22 @@ func (tbtcs *TBTCSystem) LogRedemptionRequested( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogRedemptionRequested( + transaction, err := tbtcs.contract.TransferOwnership( transactorOptions, - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, + newOwner, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logRedemptionRequested", - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, + "transferOwnership", + newOwner, ) } tbtcsLogger.Infof( - "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", + "submitted transaction transferOwnership with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -557,32 +503,22 @@ func (tbtcs *TBTCSystem) LogRedemptionRequested( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogRedemptionRequested( + transaction, err := tbtcs.contract.TransferOwnership( transactorOptions, - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, + newOwner, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logRedemptionRequested", - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, + "transferOwnership", + newOwner, ) } tbtcsLogger.Infof( - "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", + "submitted transaction transferOwnership with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -597,13 +533,8 @@ func (tbtcs *TBTCSystem) LogRedemptionRequested( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogRedemptionRequested( - _requester common.Address, - _digest [32]uint8, - _utxoValue *big.Int, - _redeemerOutputScript []uint8, - _requestedFee *big.Int, - _outpoint []uint8, +func (tbtcs *TBTCSystem) CallTransferOwnership( + newOwner common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -615,57 +546,46 @@ func (tbtcs *TBTCSystem) CallLogRedemptionRequested( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logRedemptionRequested", + "transferOwnership", &result, - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, + newOwner, ) return err } -func (tbtcs *TBTCSystem) LogRedemptionRequestedGasEstimate( - _requester common.Address, - _digest [32]uint8, - _utxoValue *big.Int, - _redeemerOutputScript []uint8, - _requestedFee *big.Int, - _outpoint []uint8, +func (tbtcs *TBTCSystem) TransferOwnershipGasEstimate( + newOwner common.Address, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logRedemptionRequested", + "transferOwnership", tbtcs.contractABI, tbtcs.transactor, - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, + newOwner, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogStartedLiquidation( - _wasFraud bool, +func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdate( + _keepStakedFactory common.Address, + _fullyBackedFactory common.Address, + _factorySelector common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logStartedLiquidation", + "submitting transaction beginKeepFactoriesUpdate", "params: ", fmt.Sprint( - _wasFraud, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ), ) @@ -691,22 +611,26 @@ func (tbtcs *TBTCSystem) LogStartedLiquidation( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogStartedLiquidation( + transaction, err := tbtcs.contract.BeginKeepFactoriesUpdate( transactorOptions, - _wasFraud, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logStartedLiquidation", - _wasFraud, + "beginKeepFactoriesUpdate", + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) } tbtcsLogger.Infof( - "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction beginKeepFactoriesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -717,22 +641,26 @@ func (tbtcs *TBTCSystem) LogStartedLiquidation( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogStartedLiquidation( + transaction, err := tbtcs.contract.BeginKeepFactoriesUpdate( transactorOptions, - _wasFraud, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logStartedLiquidation", - _wasFraud, + "beginKeepFactoriesUpdate", + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) } tbtcsLogger.Infof( - "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction beginKeepFactoriesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -747,8 +675,10 @@ func (tbtcs *TBTCSystem) LogStartedLiquidation( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogStartedLiquidation( - _wasFraud bool, +func (tbtcs *TBTCSystem) CallBeginKeepFactoriesUpdate( + _keepStakedFactory common.Address, + _fullyBackedFactory common.Address, + _factorySelector common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -760,43 +690,44 @@ func (tbtcs *TBTCSystem) CallLogStartedLiquidation( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logStartedLiquidation", + "beginKeepFactoriesUpdate", &result, - _wasFraud, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) return err } -func (tbtcs *TBTCSystem) LogStartedLiquidationGasEstimate( - _wasFraud bool, -) (uint64, error) { - var result uint64 +func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdateGasEstimate( + _keepStakedFactory common.Address, + _fullyBackedFactory common.Address, + _factorySelector common.Address, +) (uint64, error) { + var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logStartedLiquidation", + "beginKeepFactoriesUpdate", tbtcs.contractABI, tbtcs.transactor, - _wasFraud, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAddition( - _ethBtcPriceFeed common.Address, +func (tbtcs *TBTCSystem) LogCourtesyCalled( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction beginEthBtcPriceFeedAddition", - "params: ", - fmt.Sprint( - _ethBtcPriceFeed, - ), + "submitting transaction logCourtesyCalled", ) tbtcs.transactionMutex.Lock() @@ -821,22 +752,20 @@ func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAddition( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.BeginEthBtcPriceFeedAddition( + transaction, err := tbtcs.contract.LogCourtesyCalled( transactorOptions, - _ethBtcPriceFeed, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginEthBtcPriceFeedAddition", - _ethBtcPriceFeed, + "logCourtesyCalled", ) } tbtcsLogger.Infof( - "submitted transaction beginEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -847,22 +776,20 @@ func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAddition( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.BeginEthBtcPriceFeedAddition( + transaction, err := tbtcs.contract.LogCourtesyCalled( transactorOptions, - _ethBtcPriceFeed, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginEthBtcPriceFeedAddition", - _ethBtcPriceFeed, + "logCourtesyCalled", ) } tbtcsLogger.Infof( - "submitted transaction beginEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -877,8 +804,7 @@ func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAddition( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallBeginEthBtcPriceFeedAddition( - _ethBtcPriceFeed common.Address, +func (tbtcs *TBTCSystem) CallLogCourtesyCalled( blockNumber *big.Int, ) error { var result interface{} = nil @@ -890,43 +816,34 @@ func (tbtcs *TBTCSystem) CallBeginEthBtcPriceFeedAddition( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "beginEthBtcPriceFeedAddition", + "logCourtesyCalled", &result, - _ethBtcPriceFeed, ) return err } -func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAdditionGasEstimate( - _ethBtcPriceFeed common.Address, -) (uint64, error) { +func (tbtcs *TBTCSystem) LogCourtesyCalledGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "beginEthBtcPriceFeedAddition", + "logCourtesyCalled", tbtcs.contractABI, tbtcs.transactor, - _ethBtcPriceFeed, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) TransferOwnership( - newOwner common.Address, +func (tbtcs *TBTCSystem) RenounceOwnership( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction transferOwnership", - "params: ", - fmt.Sprint( - newOwner, - ), + "submitting transaction renounceOwnership", ) tbtcs.transactionMutex.Lock() @@ -951,22 +868,20 @@ func (tbtcs *TBTCSystem) TransferOwnership( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.TransferOwnership( + transaction, err := tbtcs.contract.RenounceOwnership( transactorOptions, - newOwner, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "transferOwnership", - newOwner, + "renounceOwnership", ) } tbtcsLogger.Infof( - "submitted transaction transferOwnership with id: [%v] and nonce [%v]", + "submitted transaction renounceOwnership with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -977,22 +892,20 @@ func (tbtcs *TBTCSystem) TransferOwnership( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.TransferOwnership( + transaction, err := tbtcs.contract.RenounceOwnership( transactorOptions, - newOwner, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "transferOwnership", - newOwner, + "renounceOwnership", ) } tbtcsLogger.Infof( - "submitted transaction transferOwnership with id: [%v] and nonce [%v]", + "submitted transaction renounceOwnership with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1007,8 +920,7 @@ func (tbtcs *TBTCSystem) TransferOwnership( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallTransferOwnership( - newOwner common.Address, +func (tbtcs *TBTCSystem) CallRenounceOwnership( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1020,42 +932,38 @@ func (tbtcs *TBTCSystem) CallTransferOwnership( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "transferOwnership", + "renounceOwnership", &result, - newOwner, ) return err } -func (tbtcs *TBTCSystem) TransferOwnershipGasEstimate( - newOwner common.Address, -) (uint64, error) { +func (tbtcs *TBTCSystem) RenounceOwnershipGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "transferOwnership", + "renounceOwnership", tbtcs.contractABI, tbtcs.transactor, - newOwner, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogRedeemed( - _txid [32]uint8, +func (tbtcs *TBTCSystem) LogCreated( + _keepAddress common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logRedeemed", + "submitting transaction logCreated", "params: ", fmt.Sprint( - _txid, + _keepAddress, ), ) @@ -1081,22 +989,22 @@ func (tbtcs *TBTCSystem) LogRedeemed( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogRedeemed( + transaction, err := tbtcs.contract.LogCreated( transactorOptions, - _txid, + _keepAddress, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logRedeemed", - _txid, + "logCreated", + _keepAddress, ) } tbtcsLogger.Infof( - "submitted transaction logRedeemed with id: [%v] and nonce [%v]", + "submitted transaction logCreated with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1107,22 +1015,22 @@ func (tbtcs *TBTCSystem) LogRedeemed( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogRedeemed( + transaction, err := tbtcs.contract.LogCreated( transactorOptions, - _txid, + _keepAddress, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logRedeemed", - _txid, + "logCreated", + _keepAddress, ) } tbtcsLogger.Infof( - "submitted transaction logRedeemed with id: [%v] and nonce [%v]", + "submitted transaction logCreated with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1137,8 +1045,8 @@ func (tbtcs *TBTCSystem) LogRedeemed( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogRedeemed( - _txid [32]uint8, +func (tbtcs *TBTCSystem) CallLogCreated( + _keepAddress common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1150,38 +1058,53 @@ func (tbtcs *TBTCSystem) CallLogRedeemed( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logRedeemed", + "logCreated", &result, - _txid, + _keepAddress, ) return err } -func (tbtcs *TBTCSystem) LogRedeemedGasEstimate( - _txid [32]uint8, +func (tbtcs *TBTCSystem) LogCreatedGasEstimate( + _keepAddress common.Address, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logRedeemed", + "logCreated", tbtcs.contractABI, tbtcs.transactor, - _txid, + _keepAddress, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdate( +func (tbtcs *TBTCSystem) LogRedemptionRequested( + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction finalizeSignerFeeDivisorUpdate", + "submitting transaction logRedemptionRequested", + "params: ", + fmt.Sprint( + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ), ) tbtcs.transactionMutex.Lock() @@ -1206,20 +1129,32 @@ func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.FinalizeSignerFeeDivisorUpdate( + transaction, err := tbtcs.contract.LogRedemptionRequested( transactorOptions, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeSignerFeeDivisorUpdate", + "logRedemptionRequested", + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) } tbtcsLogger.Infof( - "submitted transaction finalizeSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1230,20 +1165,32 @@ func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.FinalizeSignerFeeDivisorUpdate( + transaction, err := tbtcs.contract.LogRedemptionRequested( transactorOptions, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeSignerFeeDivisorUpdate", + "logRedemptionRequested", + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) } tbtcsLogger.Infof( - "submitted transaction finalizeSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1258,7 +1205,13 @@ func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallFinalizeSignerFeeDivisorUpdate( +func (tbtcs *TBTCSystem) CallLogRedemptionRequested( + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1270,34 +1223,60 @@ func (tbtcs *TBTCSystem) CallFinalizeSignerFeeDivisorUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "finalizeSignerFeeDivisorUpdate", + "logRedemptionRequested", &result, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) return err } -func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdateGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogRedemptionRequestedGasEstimate( + _requester common.Address, + _digest [32]uint8, + _utxoValue *big.Int, + _redeemerOutputScript []uint8, + _requestedFee *big.Int, + _outpoint []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "finalizeSignerFeeDivisorUpdate", + "logRedemptionRequested", tbtcs.contractABI, tbtcs.transactor, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) ResumeNewDeposits( +func (tbtcs *TBTCSystem) LogRegisteredPubkey( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction resumeNewDeposits", + "submitting transaction logRegisteredPubkey", + "params: ", + fmt.Sprint( + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ), ) tbtcs.transactionMutex.Lock() @@ -1322,20 +1301,24 @@ func (tbtcs *TBTCSystem) ResumeNewDeposits( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.ResumeNewDeposits( + transaction, err := tbtcs.contract.LogRegisteredPubkey( transactorOptions, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "resumeNewDeposits", + "logRegisteredPubkey", + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) } tbtcsLogger.Infof( - "submitted transaction resumeNewDeposits with id: [%v] and nonce [%v]", + "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1346,20 +1329,24 @@ func (tbtcs *TBTCSystem) ResumeNewDeposits( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.ResumeNewDeposits( + transaction, err := tbtcs.contract.LogRegisteredPubkey( transactorOptions, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "resumeNewDeposits", + "logRegisteredPubkey", + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) } tbtcsLogger.Infof( - "submitted transaction resumeNewDeposits with id: [%v] and nonce [%v]", + "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1374,7 +1361,9 @@ func (tbtcs *TBTCSystem) ResumeNewDeposits( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallResumeNewDeposits( +func (tbtcs *TBTCSystem) CallLogRegisteredPubkey( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1386,34 +1375,50 @@ func (tbtcs *TBTCSystem) CallResumeNewDeposits( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "resumeNewDeposits", + "logRegisteredPubkey", &result, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) return err } -func (tbtcs *TBTCSystem) ResumeNewDepositsGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogRegisteredPubkeyGasEstimate( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "resumeNewDeposits", + "logRegisteredPubkey", tbtcs.contractABI, tbtcs.transactor, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( +func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdate( + _initialCollateralizedPercent uint16, + _undercollateralizedThresholdPercent uint16, + _severelyUndercollateralizedThresholdPercent uint16, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction refreshMinimumBondableValue", + "submitting transaction beginCollateralizationThresholdsUpdate", + "params: ", + fmt.Sprint( + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, + ), ) tbtcs.transactionMutex.Lock() @@ -1438,20 +1443,26 @@ func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.RefreshMinimumBondableValue( + transaction, err := tbtcs.contract.BeginCollateralizationThresholdsUpdate( transactorOptions, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "refreshMinimumBondableValue", + "beginCollateralizationThresholdsUpdate", + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) } tbtcsLogger.Infof( - "submitted transaction refreshMinimumBondableValue with id: [%v] and nonce [%v]", + "submitted transaction beginCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1462,20 +1473,26 @@ func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.RefreshMinimumBondableValue( + transaction, err := tbtcs.contract.BeginCollateralizationThresholdsUpdate( transactorOptions, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "refreshMinimumBondableValue", + "beginCollateralizationThresholdsUpdate", + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) } tbtcsLogger.Infof( - "submitted transaction refreshMinimumBondableValue with id: [%v] and nonce [%v]", + "submitted transaction beginCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1490,7 +1507,10 @@ func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallRefreshMinimumBondableValue( +func (tbtcs *TBTCSystem) CallBeginCollateralizationThresholdsUpdate( + _initialCollateralizedPercent uint16, + _undercollateralizedThresholdPercent uint16, + _severelyUndercollateralizedThresholdPercent uint16, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1502,34 +1522,44 @@ func (tbtcs *TBTCSystem) CallRefreshMinimumBondableValue( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "refreshMinimumBondableValue", + "beginCollateralizationThresholdsUpdate", &result, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) return err } -func (tbtcs *TBTCSystem) RefreshMinimumBondableValueGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdateGasEstimate( + _initialCollateralizedPercent uint16, + _undercollateralizedThresholdPercent uint16, + _severelyUndercollateralizedThresholdPercent uint16, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "refreshMinimumBondableValue", + "beginCollateralizationThresholdsUpdate", tbtcs.contractABI, tbtcs.transactor, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) RenounceOwnership( +func (tbtcs *TBTCSystem) EmergencyPauseNewDeposits( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction renounceOwnership", + "submitting transaction emergencyPauseNewDeposits", ) tbtcs.transactionMutex.Lock() @@ -1554,7 +1584,7 @@ func (tbtcs *TBTCSystem) RenounceOwnership( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.RenounceOwnership( + transaction, err := tbtcs.contract.EmergencyPauseNewDeposits( transactorOptions, ) if err != nil { @@ -1562,12 +1592,12 @@ func (tbtcs *TBTCSystem) RenounceOwnership( err, tbtcs.transactorOptions.From, nil, - "renounceOwnership", + "emergencyPauseNewDeposits", ) } tbtcsLogger.Infof( - "submitted transaction renounceOwnership with id: [%v] and nonce [%v]", + "submitted transaction emergencyPauseNewDeposits with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1578,7 +1608,7 @@ func (tbtcs *TBTCSystem) RenounceOwnership( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.RenounceOwnership( + transaction, err := tbtcs.contract.EmergencyPauseNewDeposits( transactorOptions, ) if err != nil { @@ -1586,12 +1616,12 @@ func (tbtcs *TBTCSystem) RenounceOwnership( err, tbtcs.transactorOptions.From, nil, - "renounceOwnership", + "emergencyPauseNewDeposits", ) } tbtcsLogger.Infof( - "submitted transaction renounceOwnership with id: [%v] and nonce [%v]", + "submitted transaction emergencyPauseNewDeposits with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1606,7 +1636,7 @@ func (tbtcs *TBTCSystem) RenounceOwnership( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallRenounceOwnership( +func (tbtcs *TBTCSystem) CallEmergencyPauseNewDeposits( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1618,20 +1648,20 @@ func (tbtcs *TBTCSystem) CallRenounceOwnership( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "renounceOwnership", + "emergencyPauseNewDeposits", &result, ) return err } -func (tbtcs *TBTCSystem) RenounceOwnershipGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) EmergencyPauseNewDepositsGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "renounceOwnership", + "emergencyPauseNewDeposits", tbtcs.contractABI, tbtcs.transactor, ) @@ -1640,12 +1670,17 @@ func (tbtcs *TBTCSystem) RenounceOwnershipGasEstimate() (uint64, error) { } // Transaction submission. -func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdate( +func (tbtcs *TBTCSystem) LogRedeemed( + _txid [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction finalizeCollateralizationThresholdsUpdate", + "submitting transaction logRedeemed", + "params: ", + fmt.Sprint( + _txid, + ), ) tbtcs.transactionMutex.Lock() @@ -1670,20 +1705,22 @@ func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.FinalizeCollateralizationThresholdsUpdate( + transaction, err := tbtcs.contract.LogRedeemed( transactorOptions, + _txid, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeCollateralizationThresholdsUpdate", + "logRedeemed", + _txid, ) } tbtcsLogger.Infof( - "submitted transaction finalizeCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", + "submitted transaction logRedeemed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1694,20 +1731,22 @@ func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.FinalizeCollateralizationThresholdsUpdate( + transaction, err := tbtcs.contract.LogRedeemed( transactorOptions, + _txid, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeCollateralizationThresholdsUpdate", + "logRedeemed", + _txid, ) } tbtcsLogger.Infof( - "submitted transaction finalizeCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", + "submitted transaction logRedeemed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1722,7 +1761,8 @@ func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallFinalizeCollateralizationThresholdsUpdate( +func (tbtcs *TBTCSystem) CallLogRedeemed( + _txid [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1734,55 +1774,38 @@ func (tbtcs *TBTCSystem) CallFinalizeCollateralizationThresholdsUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "finalizeCollateralizationThresholdsUpdate", + "logRedeemed", &result, + _txid, ) return err } -func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdateGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogRedeemedGasEstimate( + _txid [32]uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "finalizeCollateralizationThresholdsUpdate", + "logRedeemed", tbtcs.contractABI, tbtcs.transactor, + _txid, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) Initialize( - _defaultKeepFactory common.Address, - _depositFactory common.Address, - _masterDepositAddress common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachine common.Address, - _keepThreshold uint16, - _keepSize uint16, +func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdate( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction initialize", - "params: ", - fmt.Sprint( - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, - ), + "submitting transaction finalizeCollateralizationThresholdsUpdate", ) tbtcs.transactionMutex.Lock() @@ -1807,38 +1830,20 @@ func (tbtcs *TBTCSystem) Initialize( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.Initialize( + transaction, err := tbtcs.contract.FinalizeCollateralizationThresholdsUpdate( transactorOptions, - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "initialize", - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, + "finalizeCollateralizationThresholdsUpdate", ) } tbtcsLogger.Infof( - "submitted transaction initialize with id: [%v] and nonce [%v]", + "submitted transaction finalizeCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1849,38 +1854,20 @@ func (tbtcs *TBTCSystem) Initialize( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.Initialize( + transaction, err := tbtcs.contract.FinalizeCollateralizationThresholdsUpdate( transactorOptions, - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "initialize", - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, + "finalizeCollateralizationThresholdsUpdate", ) } tbtcsLogger.Infof( - "submitted transaction initialize with id: [%v] and nonce [%v]", + "submitted transaction finalizeCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1895,16 +1882,7 @@ func (tbtcs *TBTCSystem) Initialize( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallInitialize( - _defaultKeepFactory common.Address, - _depositFactory common.Address, - _masterDepositAddress common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachine common.Address, - _keepThreshold uint16, - _keepSize uint16, +func (tbtcs *TBTCSystem) CallFinalizeCollateralizationThresholdsUpdate( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1916,50 +1894,22 @@ func (tbtcs *TBTCSystem) CallInitialize( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "initialize", + "finalizeCollateralizationThresholdsUpdate", &result, - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, ) return err } -func (tbtcs *TBTCSystem) InitializeGasEstimate( - _defaultKeepFactory common.Address, - _depositFactory common.Address, - _masterDepositAddress common.Address, - _tbtcToken common.Address, - _tbtcDepositToken common.Address, - _feeRebateToken common.Address, - _vendingMachine common.Address, - _keepThreshold uint16, - _keepSize uint16, -) (uint64, error) { +func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdateGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "initialize", + "finalizeCollateralizationThresholdsUpdate", tbtcs.contractABI, tbtcs.transactor, - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, ) return result, err @@ -2111,12 +2061,17 @@ func (tbtcs *TBTCSystem) RequestNewKeepGasEstimate( } // Transaction submission. -func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( +func (tbtcs *TBTCSystem) LogFunderRequestedAbort( + _abortOutputScript []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction finalizeLotSizesUpdate", + "submitting transaction logFunderRequestedAbort", + "params: ", + fmt.Sprint( + _abortOutputScript, + ), ) tbtcs.transactionMutex.Lock() @@ -2141,20 +2096,22 @@ func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.FinalizeLotSizesUpdate( + transaction, err := tbtcs.contract.LogFunderRequestedAbort( transactorOptions, + _abortOutputScript, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeLotSizesUpdate", + "logFunderRequestedAbort", + _abortOutputScript, ) } tbtcsLogger.Infof( - "submitted transaction finalizeLotSizesUpdate with id: [%v] and nonce [%v]", + "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2165,20 +2122,22 @@ func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.FinalizeLotSizesUpdate( + transaction, err := tbtcs.contract.LogFunderRequestedAbort( transactorOptions, + _abortOutputScript, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeLotSizesUpdate", + "logFunderRequestedAbort", + _abortOutputScript, ) } tbtcsLogger.Infof( - "submitted transaction finalizeLotSizesUpdate with id: [%v] and nonce [%v]", + "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2193,7 +2152,8 @@ func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallFinalizeLotSizesUpdate( +func (tbtcs *TBTCSystem) CallLogFunderRequestedAbort( + _abortOutputScript []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2205,40 +2165,42 @@ func (tbtcs *TBTCSystem) CallFinalizeLotSizesUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "finalizeLotSizesUpdate", + "logFunderRequestedAbort", &result, + _abortOutputScript, ) return err } -func (tbtcs *TBTCSystem) FinalizeLotSizesUpdateGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogFunderRequestedAbortGasEstimate( + _abortOutputScript []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "finalizeLotSizesUpdate", + "logFunderRequestedAbort", tbtcs.contractABI, tbtcs.transactor, + _abortOutputScript, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogRegisteredPubkey( - _signingGroupPubkeyX [32]uint8, - _signingGroupPubkeyY [32]uint8, +func (tbtcs *TBTCSystem) LogStartedLiquidation( + _wasFraud bool, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logRegisteredPubkey", + "submitting transaction logStartedLiquidation", "params: ", fmt.Sprint( - _signingGroupPubkeyX, - _signingGroupPubkeyY, + _wasFraud, ), ) @@ -2264,24 +2226,22 @@ func (tbtcs *TBTCSystem) LogRegisteredPubkey( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogRegisteredPubkey( + transaction, err := tbtcs.contract.LogStartedLiquidation( transactorOptions, - _signingGroupPubkeyX, - _signingGroupPubkeyY, + _wasFraud, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logRegisteredPubkey", - _signingGroupPubkeyX, - _signingGroupPubkeyY, + "logStartedLiquidation", + _wasFraud, ) } tbtcsLogger.Infof( - "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", + "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2292,24 +2252,22 @@ func (tbtcs *TBTCSystem) LogRegisteredPubkey( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogRegisteredPubkey( + transaction, err := tbtcs.contract.LogStartedLiquidation( transactorOptions, - _signingGroupPubkeyX, - _signingGroupPubkeyY, + _wasFraud, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logRegisteredPubkey", - _signingGroupPubkeyX, - _signingGroupPubkeyY, + "logStartedLiquidation", + _wasFraud, ) } tbtcsLogger.Infof( - "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", + "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2324,9 +2282,8 @@ func (tbtcs *TBTCSystem) LogRegisteredPubkey( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogRegisteredPubkey( - _signingGroupPubkeyX [32]uint8, - _signingGroupPubkeyY [32]uint8, +func (tbtcs *TBTCSystem) CallLogStartedLiquidation( + _wasFraud bool, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2338,46 +2295,38 @@ func (tbtcs *TBTCSystem) CallLogRegisteredPubkey( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logRegisteredPubkey", + "logStartedLiquidation", &result, - _signingGroupPubkeyX, - _signingGroupPubkeyY, + _wasFraud, ) return err } -func (tbtcs *TBTCSystem) LogRegisteredPubkeyGasEstimate( - _signingGroupPubkeyX [32]uint8, - _signingGroupPubkeyY [32]uint8, +func (tbtcs *TBTCSystem) LogStartedLiquidationGasEstimate( + _wasFraud bool, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logRegisteredPubkey", + "logStartedLiquidation", tbtcs.contractABI, tbtcs.transactor, - _signingGroupPubkeyX, - _signingGroupPubkeyY, + _wasFraud, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdate( - _signerFeeDivisor uint16, +func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAddition( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction beginSignerFeeDivisorUpdate", - "params: ", - fmt.Sprint( - _signerFeeDivisor, - ), + "submitting transaction finalizeEthBtcPriceFeedAddition", ) tbtcs.transactionMutex.Lock() @@ -2402,22 +2351,20 @@ func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.BeginSignerFeeDivisorUpdate( + transaction, err := tbtcs.contract.FinalizeEthBtcPriceFeedAddition( transactorOptions, - _signerFeeDivisor, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginSignerFeeDivisorUpdate", - _signerFeeDivisor, + "finalizeEthBtcPriceFeedAddition", ) } tbtcsLogger.Infof( - "submitted transaction beginSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + "submitted transaction finalizeEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2428,22 +2375,20 @@ func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.BeginSignerFeeDivisorUpdate( + transaction, err := tbtcs.contract.FinalizeEthBtcPriceFeedAddition( transactorOptions, - _signerFeeDivisor, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginSignerFeeDivisorUpdate", - _signerFeeDivisor, + "finalizeEthBtcPriceFeedAddition", ) } tbtcsLogger.Infof( - "submitted transaction beginSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + "submitted transaction finalizeEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2458,8 +2403,7 @@ func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallBeginSignerFeeDivisorUpdate( - _signerFeeDivisor uint16, +func (tbtcs *TBTCSystem) CallFinalizeEthBtcPriceFeedAddition( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2471,38 +2415,34 @@ func (tbtcs *TBTCSystem) CallBeginSignerFeeDivisorUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "beginSignerFeeDivisorUpdate", + "finalizeEthBtcPriceFeedAddition", &result, - _signerFeeDivisor, ) return err } -func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdateGasEstimate( - _signerFeeDivisor uint16, -) (uint64, error) { +func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAdditionGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "beginSignerFeeDivisorUpdate", + "finalizeEthBtcPriceFeedAddition", tbtcs.contractABI, tbtcs.transactor, - _signerFeeDivisor, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogCourtesyCalled( +func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logCourtesyCalled", + "submitting transaction finalizeLotSizesUpdate", ) tbtcs.transactionMutex.Lock() @@ -2527,7 +2467,7 @@ func (tbtcs *TBTCSystem) LogCourtesyCalled( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogCourtesyCalled( + transaction, err := tbtcs.contract.FinalizeLotSizesUpdate( transactorOptions, ) if err != nil { @@ -2535,12 +2475,12 @@ func (tbtcs *TBTCSystem) LogCourtesyCalled( err, tbtcs.transactorOptions.From, nil, - "logCourtesyCalled", + "finalizeLotSizesUpdate", ) } tbtcsLogger.Infof( - "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", + "submitted transaction finalizeLotSizesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2551,7 +2491,7 @@ func (tbtcs *TBTCSystem) LogCourtesyCalled( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogCourtesyCalled( + transaction, err := tbtcs.contract.FinalizeLotSizesUpdate( transactorOptions, ) if err != nil { @@ -2559,12 +2499,12 @@ func (tbtcs *TBTCSystem) LogCourtesyCalled( err, tbtcs.transactorOptions.From, nil, - "logCourtesyCalled", + "finalizeLotSizesUpdate", ) } tbtcsLogger.Infof( - "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", + "submitted transaction finalizeLotSizesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2579,7 +2519,7 @@ func (tbtcs *TBTCSystem) LogCourtesyCalled( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogCourtesyCalled( +func (tbtcs *TBTCSystem) CallFinalizeLotSizesUpdate( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2591,20 +2531,20 @@ func (tbtcs *TBTCSystem) CallLogCourtesyCalled( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logCourtesyCalled", + "finalizeLotSizesUpdate", &result, ) return err } -func (tbtcs *TBTCSystem) LogCourtesyCalledGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) FinalizeLotSizesUpdateGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logCourtesyCalled", + "finalizeLotSizesUpdate", tbtcs.contractABI, tbtcs.transactor, ) @@ -2613,17 +2553,12 @@ func (tbtcs *TBTCSystem) LogCourtesyCalledGasEstimate() (uint64, error) { } // Transaction submission. -func (tbtcs *TBTCSystem) LogFunderRequestedAbort( - _abortOutputScript []uint8, +func (tbtcs *TBTCSystem) ResumeNewDeposits( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logFunderRequestedAbort", - "params: ", - fmt.Sprint( - _abortOutputScript, - ), + "submitting transaction resumeNewDeposits", ) tbtcs.transactionMutex.Lock() @@ -2648,22 +2583,20 @@ func (tbtcs *TBTCSystem) LogFunderRequestedAbort( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogFunderRequestedAbort( + transaction, err := tbtcs.contract.ResumeNewDeposits( transactorOptions, - _abortOutputScript, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logFunderRequestedAbort", - _abortOutputScript, + "resumeNewDeposits", ) } tbtcsLogger.Infof( - "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", + "submitted transaction resumeNewDeposits with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2674,22 +2607,20 @@ func (tbtcs *TBTCSystem) LogFunderRequestedAbort( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogFunderRequestedAbort( + transaction, err := tbtcs.contract.ResumeNewDeposits( transactorOptions, - _abortOutputScript, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logFunderRequestedAbort", - _abortOutputScript, + "resumeNewDeposits", ) } tbtcsLogger.Infof( - "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", + "submitted transaction resumeNewDeposits with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2704,8 +2635,7 @@ func (tbtcs *TBTCSystem) LogFunderRequestedAbort( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogFunderRequestedAbort( - _abortOutputScript []uint8, +func (tbtcs *TBTCSystem) CallResumeNewDeposits( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2717,26 +2647,22 @@ func (tbtcs *TBTCSystem) CallLogFunderRequestedAbort( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logFunderRequestedAbort", + "resumeNewDeposits", &result, - _abortOutputScript, ) return err } -func (tbtcs *TBTCSystem) LogFunderRequestedAbortGasEstimate( - _abortOutputScript []uint8, -) (uint64, error) { +func (tbtcs *TBTCSystem) ResumeNewDepositsGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logFunderRequestedAbort", + "resumeNewDeposits", tbtcs.contractABI, tbtcs.transactor, - _abortOutputScript, ) return result, err @@ -2859,16 +2785,32 @@ func (tbtcs *TBTCSystem) LogSetupFailedGasEstimate() (uint64, error) { } // Transaction submission. -func (tbtcs *TBTCSystem) BeginLotSizesUpdate( - _lotSizes []uint64, +func (tbtcs *TBTCSystem) Initialize( + _defaultKeepFactory common.Address, + _depositFactory common.Address, + _masterDepositAddress common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachine common.Address, + _keepThreshold uint16, + _keepSize uint16, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction beginLotSizesUpdate", + "submitting transaction initialize", "params: ", fmt.Sprint( - _lotSizes, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ), ) @@ -2894,22 +2836,38 @@ func (tbtcs *TBTCSystem) BeginLotSizesUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.BeginLotSizesUpdate( + transaction, err := tbtcs.contract.Initialize( transactorOptions, - _lotSizes, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginLotSizesUpdate", - _lotSizes, + "initialize", + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ) } tbtcsLogger.Infof( - "submitted transaction beginLotSizesUpdate with id: [%v] and nonce [%v]", + "submitted transaction initialize with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2920,22 +2878,38 @@ func (tbtcs *TBTCSystem) BeginLotSizesUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.BeginLotSizesUpdate( + transaction, err := tbtcs.contract.Initialize( transactorOptions, - _lotSizes, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginLotSizesUpdate", - _lotSizes, + "initialize", + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ) } tbtcsLogger.Infof( - "submitted transaction beginLotSizesUpdate with id: [%v] and nonce [%v]", + "submitted transaction initialize with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2950,8 +2924,16 @@ func (tbtcs *TBTCSystem) BeginLotSizesUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallBeginLotSizesUpdate( - _lotSizes []uint64, +func (tbtcs *TBTCSystem) CallInitialize( + _defaultKeepFactory common.Address, + _depositFactory common.Address, + _masterDepositAddress common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachine common.Address, + _keepThreshold uint16, + _keepSize uint16, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2963,26 +2945,50 @@ func (tbtcs *TBTCSystem) CallBeginLotSizesUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "beginLotSizesUpdate", + "initialize", &result, - _lotSizes, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ) return err } -func (tbtcs *TBTCSystem) BeginLotSizesUpdateGasEstimate( - _lotSizes []uint64, +func (tbtcs *TBTCSystem) InitializeGasEstimate( + _defaultKeepFactory common.Address, + _depositFactory common.Address, + _masterDepositAddress common.Address, + _tbtcToken common.Address, + _tbtcDepositToken common.Address, + _feeRebateToken common.Address, + _vendingMachine common.Address, + _keepThreshold uint16, + _keepSize uint16, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "beginLotSizesUpdate", + "initialize", tbtcs.contractABI, tbtcs.transactor, - _lotSizes, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ) return result, err @@ -3105,16 +3111,16 @@ func (tbtcs *TBTCSystem) LogFraudDuringSetupGasEstimate() (uint64, error) { } // Transaction submission. -func (tbtcs *TBTCSystem) LogFunded( - _txid [32]uint8, +func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAddition( + _ethBtcPriceFeed common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logFunded", + "submitting transaction beginEthBtcPriceFeedAddition", "params: ", fmt.Sprint( - _txid, + _ethBtcPriceFeed, ), ) @@ -3140,22 +3146,22 @@ func (tbtcs *TBTCSystem) LogFunded( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogFunded( + transaction, err := tbtcs.contract.BeginEthBtcPriceFeedAddition( transactorOptions, - _txid, + _ethBtcPriceFeed, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logFunded", - _txid, + "beginEthBtcPriceFeedAddition", + _ethBtcPriceFeed, ) } tbtcsLogger.Infof( - "submitted transaction logFunded with id: [%v] and nonce [%v]", + "submitted transaction beginEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3166,22 +3172,22 @@ func (tbtcs *TBTCSystem) LogFunded( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogFunded( + transaction, err := tbtcs.contract.BeginEthBtcPriceFeedAddition( transactorOptions, - _txid, + _ethBtcPriceFeed, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logFunded", - _txid, + "beginEthBtcPriceFeedAddition", + _ethBtcPriceFeed, ) } tbtcsLogger.Infof( - "submitted transaction logFunded with id: [%v] and nonce [%v]", + "submitted transaction beginEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3196,8 +3202,8 @@ func (tbtcs *TBTCSystem) LogFunded( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogFunded( - _txid [32]uint8, +func (tbtcs *TBTCSystem) CallBeginEthBtcPriceFeedAddition( + _ethBtcPriceFeed common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -3209,47 +3215,38 @@ func (tbtcs *TBTCSystem) CallLogFunded( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logFunded", + "beginEthBtcPriceFeedAddition", &result, - _txid, + _ethBtcPriceFeed, ) return err } -func (tbtcs *TBTCSystem) LogFundedGasEstimate( - _txid [32]uint8, +func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAdditionGasEstimate( + _ethBtcPriceFeed common.Address, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logFunded", + "beginEthBtcPriceFeedAddition", tbtcs.contractABI, tbtcs.transactor, - _txid, + _ethBtcPriceFeed, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdate( - _initialCollateralizedPercent uint16, - _undercollateralizedThresholdPercent uint16, - _severelyUndercollateralizedThresholdPercent uint16, +func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdate( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction beginCollateralizationThresholdsUpdate", - "params: ", - fmt.Sprint( - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, - ), + "submitting transaction finalizeSignerFeeDivisorUpdate", ) tbtcs.transactionMutex.Lock() @@ -3274,26 +3271,20 @@ func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.BeginCollateralizationThresholdsUpdate( + transaction, err := tbtcs.contract.FinalizeSignerFeeDivisorUpdate( transactorOptions, - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginCollateralizationThresholdsUpdate", - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, + "finalizeSignerFeeDivisorUpdate", ) } tbtcsLogger.Infof( - "submitted transaction beginCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", + "submitted transaction finalizeSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3304,26 +3295,20 @@ func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.BeginCollateralizationThresholdsUpdate( + transaction, err := tbtcs.contract.FinalizeSignerFeeDivisorUpdate( transactorOptions, - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginCollateralizationThresholdsUpdate", - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, + "finalizeSignerFeeDivisorUpdate", ) } tbtcsLogger.Infof( - "submitted transaction beginCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", + "submitted transaction finalizeSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3338,10 +3323,7 @@ func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallBeginCollateralizationThresholdsUpdate( - _initialCollateralizedPercent uint16, - _undercollateralizedThresholdPercent uint16, - _severelyUndercollateralizedThresholdPercent uint16, +func (tbtcs *TBTCSystem) CallFinalizeSignerFeeDivisorUpdate( blockNumber *big.Int, ) error { var result interface{} = nil @@ -3353,44 +3335,39 @@ func (tbtcs *TBTCSystem) CallBeginCollateralizationThresholdsUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "beginCollateralizationThresholdsUpdate", + "finalizeSignerFeeDivisorUpdate", &result, - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, ) return err } -func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdateGasEstimate( - _initialCollateralizedPercent uint16, - _undercollateralizedThresholdPercent uint16, - _severelyUndercollateralizedThresholdPercent uint16, -) (uint64, error) { +func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdateGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "beginCollateralizationThresholdsUpdate", + "finalizeSignerFeeDivisorUpdate", tbtcs.contractABI, tbtcs.transactor, - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogLiquidated( +func (tbtcs *TBTCSystem) BeginLotSizesUpdate( + _lotSizes []uint64, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logLiquidated", + "submitting transaction beginLotSizesUpdate", + "params: ", + fmt.Sprint( + _lotSizes, + ), ) tbtcs.transactionMutex.Lock() @@ -3415,20 +3392,22 @@ func (tbtcs *TBTCSystem) LogLiquidated( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogLiquidated( + transaction, err := tbtcs.contract.BeginLotSizesUpdate( transactorOptions, + _lotSizes, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logLiquidated", + "beginLotSizesUpdate", + _lotSizes, ) } tbtcsLogger.Infof( - "submitted transaction logLiquidated with id: [%v] and nonce [%v]", + "submitted transaction beginLotSizesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3439,20 +3418,22 @@ func (tbtcs *TBTCSystem) LogLiquidated( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogLiquidated( + transaction, err := tbtcs.contract.BeginLotSizesUpdate( transactorOptions, + _lotSizes, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logLiquidated", + "beginLotSizesUpdate", + _lotSizes, ) } tbtcsLogger.Infof( - "submitted transaction logLiquidated with id: [%v] and nonce [%v]", + "submitted transaction beginLotSizesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3467,7 +3448,8 @@ func (tbtcs *TBTCSystem) LogLiquidated( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogLiquidated( +func (tbtcs *TBTCSystem) CallBeginLotSizesUpdate( + _lotSizes []uint64, blockNumber *big.Int, ) error { var result interface{} = nil @@ -3479,34 +3461,38 @@ func (tbtcs *TBTCSystem) CallLogLiquidated( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logLiquidated", + "beginLotSizesUpdate", &result, + _lotSizes, ) return err } -func (tbtcs *TBTCSystem) LogLiquidatedGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) BeginLotSizesUpdateGasEstimate( + _lotSizes []uint64, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logLiquidated", + "beginLotSizesUpdate", tbtcs.contractABI, tbtcs.transactor, + _lotSizes, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogExitedCourtesyCall( +func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logExitedCourtesyCall", + "submitting transaction finalizeKeepFactoriesUpdate", ) tbtcs.transactionMutex.Lock() @@ -3531,7 +3517,7 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCall( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogExitedCourtesyCall( + transaction, err := tbtcs.contract.FinalizeKeepFactoriesUpdate( transactorOptions, ) if err != nil { @@ -3539,12 +3525,12 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCall( err, tbtcs.transactorOptions.From, nil, - "logExitedCourtesyCall", + "finalizeKeepFactoriesUpdate", ) } tbtcsLogger.Infof( - "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction finalizeKeepFactoriesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3555,7 +3541,7 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCall( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogExitedCourtesyCall( + transaction, err := tbtcs.contract.FinalizeKeepFactoriesUpdate( transactorOptions, ) if err != nil { @@ -3563,12 +3549,12 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCall( err, tbtcs.transactorOptions.From, nil, - "logExitedCourtesyCall", + "finalizeKeepFactoriesUpdate", ) } tbtcsLogger.Infof( - "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction finalizeKeepFactoriesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3583,7 +3569,7 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCall( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogExitedCourtesyCall( +func (tbtcs *TBTCSystem) CallFinalizeKeepFactoriesUpdate( blockNumber *big.Int, ) error { var result interface{} = nil @@ -3595,20 +3581,20 @@ func (tbtcs *TBTCSystem) CallLogExitedCourtesyCall( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logExitedCourtesyCall", + "finalizeKeepFactoriesUpdate", &result, ) return err } -func (tbtcs *TBTCSystem) LogExitedCourtesyCallGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdateGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logExitedCourtesyCall", + "finalizeKeepFactoriesUpdate", tbtcs.contractABI, tbtcs.transactor, ) @@ -3617,12 +3603,17 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCallGasEstimate() (uint64, error) { } // Transaction submission. -func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAddition( +func (tbtcs *TBTCSystem) LogFunded( + _txid [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction finalizeEthBtcPriceFeedAddition", + "submitting transaction logFunded", + "params: ", + fmt.Sprint( + _txid, + ), ) tbtcs.transactionMutex.Lock() @@ -3647,20 +3638,22 @@ func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAddition( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.FinalizeEthBtcPriceFeedAddition( + transaction, err := tbtcs.contract.LogFunded( transactorOptions, + _txid, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeEthBtcPriceFeedAddition", + "logFunded", + _txid, ) } tbtcsLogger.Infof( - "submitted transaction finalizeEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + "submitted transaction logFunded with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3671,20 +3664,22 @@ func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAddition( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.FinalizeEthBtcPriceFeedAddition( + transaction, err := tbtcs.contract.LogFunded( transactorOptions, + _txid, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeEthBtcPriceFeedAddition", + "logFunded", + _txid, ) } tbtcsLogger.Infof( - "submitted transaction finalizeEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + "submitted transaction logFunded with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3699,7 +3694,8 @@ func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAddition( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallFinalizeEthBtcPriceFeedAddition( +func (tbtcs *TBTCSystem) CallLogFunded( + _txid [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -3711,38 +3707,42 @@ func (tbtcs *TBTCSystem) CallFinalizeEthBtcPriceFeedAddition( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "finalizeEthBtcPriceFeedAddition", + "logFunded", &result, + _txid, ) return err } -func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAdditionGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogFundedGasEstimate( + _txid [32]uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "finalizeEthBtcPriceFeedAddition", + "logFunded", tbtcs.contractABI, tbtcs.transactor, + _txid, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogCreated( - _keepAddress common.Address, +func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdate( + _signerFeeDivisor uint16, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logCreated", + "submitting transaction beginSignerFeeDivisorUpdate", "params: ", fmt.Sprint( - _keepAddress, + _signerFeeDivisor, ), ) @@ -3768,22 +3768,22 @@ func (tbtcs *TBTCSystem) LogCreated( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogCreated( + transaction, err := tbtcs.contract.BeginSignerFeeDivisorUpdate( transactorOptions, - _keepAddress, + _signerFeeDivisor, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logCreated", - _keepAddress, + "beginSignerFeeDivisorUpdate", + _signerFeeDivisor, ) } tbtcsLogger.Infof( - "submitted transaction logCreated with id: [%v] and nonce [%v]", + "submitted transaction beginSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3794,22 +3794,22 @@ func (tbtcs *TBTCSystem) LogCreated( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogCreated( + transaction, err := tbtcs.contract.BeginSignerFeeDivisorUpdate( transactorOptions, - _keepAddress, + _signerFeeDivisor, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logCreated", - _keepAddress, + "beginSignerFeeDivisorUpdate", + _signerFeeDivisor, ) } tbtcsLogger.Infof( - "submitted transaction logCreated with id: [%v] and nonce [%v]", + "submitted transaction beginSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3824,8 +3824,8 @@ func (tbtcs *TBTCSystem) LogCreated( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogCreated( - _keepAddress common.Address, +func (tbtcs *TBTCSystem) CallBeginSignerFeeDivisorUpdate( + _signerFeeDivisor uint16, blockNumber *big.Int, ) error { var result interface{} = nil @@ -3837,26 +3837,26 @@ func (tbtcs *TBTCSystem) CallLogCreated( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logCreated", + "beginSignerFeeDivisorUpdate", &result, - _keepAddress, + _signerFeeDivisor, ) return err } -func (tbtcs *TBTCSystem) LogCreatedGasEstimate( - _keepAddress common.Address, +func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdateGasEstimate( + _signerFeeDivisor uint16, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logCreated", + "beginSignerFeeDivisorUpdate", tbtcs.contractABI, tbtcs.transactor, - _keepAddress, + _signerFeeDivisor, ) return result, err @@ -4014,9 +4014,9 @@ func (tbtcs *TBTCSystem) LogGotRedemptionSignatureGasEstimate( // ----- Const Methods ------ -func (tbtcs *TBTCSystem) PriceFeed() (common.Address, error) { - var result common.Address - result, err := tbtcs.contract.PriceFeed( +func (tbtcs *TBTCSystem) GetSignerFeeDivisor() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.GetSignerFeeDivisor( tbtcs.callerOptions, ) @@ -4025,17 +4025,17 @@ func (tbtcs *TBTCSystem) PriceFeed() (common.Address, error) { err, tbtcs.callerOptions.From, nil, - "priceFeed", + "getSignerFeeDivisor", ) } return result, err } -func (tbtcs *TBTCSystem) PriceFeedAtBlock( +func (tbtcs *TBTCSystem) GetSignerFeeDivisorAtBlock( blockNumber *big.Int, -) (common.Address, error) { - var result common.Address +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4045,16 +4045,16 @@ func (tbtcs *TBTCSystem) PriceFeedAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "priceFeed", + "getSignerFeeDivisor", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingPauseTerm() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetRemainingPauseTerm( +func (tbtcs *TBTCSystem) PriceFeed() (common.Address, error) { + var result common.Address + result, err := tbtcs.contract.PriceFeed( tbtcs.callerOptions, ) @@ -4063,17 +4063,17 @@ func (tbtcs *TBTCSystem) GetRemainingPauseTerm() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getRemainingPauseTerm", + "priceFeed", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingPauseTermAtBlock( +func (tbtcs *TBTCSystem) PriceFeedAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (common.Address, error) { + var result common.Address err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4083,16 +4083,16 @@ func (tbtcs *TBTCSystem) GetRemainingPauseTermAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingPauseTerm", + "priceFeed", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTime() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetRemainingSignerFeeDivisorUpdateTime( +func (tbtcs *TBTCSystem) Relay() (common.Address, error) { + var result common.Address + result, err := tbtcs.contract.Relay( tbtcs.callerOptions, ) @@ -4101,17 +4101,17 @@ func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTime() (*big.Int, err err, tbtcs.callerOptions.From, nil, - "getRemainingSignerFeeDivisorUpdateTime", + "relay", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTimeAtBlock( +func (tbtcs *TBTCSystem) RelayAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (common.Address, error) { + var result common.Address err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4121,20 +4121,17 @@ func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTimeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingSignerFeeDivisorUpdateTime", + "relay", &result, ) return result, err } -func (tbtcs *TBTCSystem) IsAllowedLotSize( - _requestedLotSizeSatoshis uint64, -) (bool, error) { - var result bool - result, err := tbtcs.contract.IsAllowedLotSize( +func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTime() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingCollateralizationThresholdsUpdateTime( tbtcs.callerOptions, - _requestedLotSizeSatoshis, ) if err != nil { @@ -4142,19 +4139,17 @@ func (tbtcs *TBTCSystem) IsAllowedLotSize( err, tbtcs.callerOptions.From, nil, - "isAllowedLotSize", - _requestedLotSizeSatoshis, + "getRemainingCollateralizationThresholdsUpdateTime", ) } return result, err } -func (tbtcs *TBTCSystem) IsAllowedLotSizeAtBlock( - _requestedLotSizeSatoshis uint64, +func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTimeAtBlock( blockNumber *big.Int, -) (bool, error) { - var result bool +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4164,17 +4159,16 @@ func (tbtcs *TBTCSystem) IsAllowedLotSizeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "isAllowedLotSize", + "getRemainingCollateralizationThresholdsUpdateTime", &result, - _requestedLotSizeSatoshis, ) return result, err } -func (tbtcs *TBTCSystem) Relay() (common.Address, error) { - var result common.Address - result, err := tbtcs.contract.Relay( +func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTime() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingSignerFeeDivisorUpdateTime( tbtcs.callerOptions, ) @@ -4183,17 +4177,17 @@ func (tbtcs *TBTCSystem) Relay() (common.Address, error) { err, tbtcs.callerOptions.From, nil, - "relay", + "getRemainingSignerFeeDivisorUpdateTime", ) } return result, err } -func (tbtcs *TBTCSystem) RelayAtBlock( +func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTimeAtBlock( blockNumber *big.Int, -) (common.Address, error) { - var result common.Address +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4203,16 +4197,16 @@ func (tbtcs *TBTCSystem) RelayAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "relay", + "getRemainingSignerFeeDivisorUpdateTime", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetMaximumLotSize() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetMaximumLotSize( +func (tbtcs *TBTCSystem) Owner() (common.Address, error) { + var result common.Address + result, err := tbtcs.contract.Owner( tbtcs.callerOptions, ) @@ -4221,17 +4215,17 @@ func (tbtcs *TBTCSystem) GetMaximumLotSize() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getMaximumLotSize", + "owner", ) } return result, err } -func (tbtcs *TBTCSystem) GetMaximumLotSizeAtBlock( +func (tbtcs *TBTCSystem) OwnerAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (common.Address, error) { + var result common.Address err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4241,17 +4235,20 @@ func (tbtcs *TBTCSystem) GetMaximumLotSizeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getMaximumLotSize", + "owner", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetMinimumLotSize() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetMinimumLotSize( +func (tbtcs *TBTCSystem) ApprovedToLog( + _caller common.Address, +) (bool, error) { + var result bool + result, err := tbtcs.contract.ApprovedToLog( tbtcs.callerOptions, + _caller, ) if err != nil { @@ -4259,17 +4256,19 @@ func (tbtcs *TBTCSystem) GetMinimumLotSize() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getMinimumLotSize", + "approvedToLog", + _caller, ) } return result, err } -func (tbtcs *TBTCSystem) GetMinimumLotSizeAtBlock( +func (tbtcs *TBTCSystem) ApprovedToLogAtBlock( + _caller common.Address, blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (bool, error) { + var result bool err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4279,17 +4278,21 @@ func (tbtcs *TBTCSystem) GetMinimumLotSizeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getMinimumLotSize", + "approvedToLog", &result, + _caller, ) return result, err } -func (tbtcs *TBTCSystem) IsOwner() (bool, error) { +func (tbtcs *TBTCSystem) IsAllowedLotSize( + _requestedLotSizeSatoshis uint64, +) (bool, error) { var result bool - result, err := tbtcs.contract.IsOwner( + result, err := tbtcs.contract.IsAllowedLotSize( tbtcs.callerOptions, + _requestedLotSizeSatoshis, ) if err != nil { @@ -4297,14 +4300,16 @@ func (tbtcs *TBTCSystem) IsOwner() (bool, error) { err, tbtcs.callerOptions.From, nil, - "isOwner", + "isAllowedLotSize", + _requestedLotSizeSatoshis, ) } return result, err } -func (tbtcs *TBTCSystem) IsOwnerAtBlock( +func (tbtcs *TBTCSystem) IsAllowedLotSizeAtBlock( + _requestedLotSizeSatoshis uint64, blockNumber *big.Int, ) (bool, error) { var result bool @@ -4317,16 +4322,17 @@ func (tbtcs *TBTCSystem) IsOwnerAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "isOwner", + "isAllowedLotSize", &result, + _requestedLotSizeSatoshis, ) return result, err } -func (tbtcs *TBTCSystem) Owner() (common.Address, error) { - var result common.Address - result, err := tbtcs.contract.Owner( +func (tbtcs *TBTCSystem) GetMinimumLotSize() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetMinimumLotSize( tbtcs.callerOptions, ) @@ -4335,17 +4341,17 @@ func (tbtcs *TBTCSystem) Owner() (common.Address, error) { err, tbtcs.callerOptions.From, nil, - "owner", + "getMinimumLotSize", ) } return result, err } -func (tbtcs *TBTCSystem) OwnerAtBlock( +func (tbtcs *TBTCSystem) GetMinimumLotSizeAtBlock( blockNumber *big.Int, -) (common.Address, error) { - var result common.Address +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4355,16 +4361,16 @@ func (tbtcs *TBTCSystem) OwnerAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "owner", + "getMinimumLotSize", &result, ) return result, err } -func (tbtcs *TBTCSystem) FetchRelayPreviousDifficulty() (*big.Int, error) { +func (tbtcs *TBTCSystem) FetchBitcoinPrice() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.FetchRelayPreviousDifficulty( + result, err := tbtcs.contract.FetchBitcoinPrice( tbtcs.callerOptions, ) @@ -4373,14 +4379,14 @@ func (tbtcs *TBTCSystem) FetchRelayPreviousDifficulty() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "fetchRelayPreviousDifficulty", + "fetchBitcoinPrice", ) } return result, err } -func (tbtcs *TBTCSystem) FetchRelayPreviousDifficultyAtBlock( +func (tbtcs *TBTCSystem) FetchBitcoinPriceAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -4393,16 +4399,16 @@ func (tbtcs *TBTCSystem) FetchRelayPreviousDifficultyAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "fetchRelayPreviousDifficulty", + "fetchBitcoinPrice", &result, ) return result, err } -func (tbtcs *TBTCSystem) FetchBitcoinPrice() (*big.Int, error) { +func (tbtcs *TBTCSystem) FetchRelayPreviousDifficulty() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.FetchBitcoinPrice( + result, err := tbtcs.contract.FetchRelayPreviousDifficulty( tbtcs.callerOptions, ) @@ -4411,14 +4417,14 @@ func (tbtcs *TBTCSystem) FetchBitcoinPrice() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "fetchBitcoinPrice", + "fetchRelayPreviousDifficulty", ) } return result, err } -func (tbtcs *TBTCSystem) FetchBitcoinPriceAtBlock( +func (tbtcs *TBTCSystem) FetchRelayPreviousDifficultyAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -4431,16 +4437,16 @@ func (tbtcs *TBTCSystem) FetchBitcoinPriceAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "fetchBitcoinPrice", + "fetchRelayPreviousDifficulty", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTime() (*big.Int, error) { +func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTime() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.GetRemainingLotSizesUpdateTime( + result, err := tbtcs.contract.GetRemainingEthBtcPriceFeedAdditionTime( tbtcs.callerOptions, ) @@ -4449,14 +4455,14 @@ func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTime() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getRemainingLotSizesUpdateTime", + "getRemainingEthBtcPriceFeedAdditionTime", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTimeAtBlock( +func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTimeAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -4469,37 +4475,32 @@ func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTimeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingLotSizesUpdateTime", + "getRemainingEthBtcPriceFeedAdditionTime", &result, ) return result, err } -func (tbtcs *TBTCSystem) ApprovedToLog( - _caller common.Address, -) (bool, error) { +func (tbtcs *TBTCSystem) IsOwner() (bool, error) { var result bool - result, err := tbtcs.contract.ApprovedToLog( + result, err := tbtcs.contract.IsOwner( tbtcs.callerOptions, - _caller, ) if err != nil { return result, tbtcs.errorResolver.ResolveError( err, tbtcs.callerOptions.From, - nil, - "approvedToLog", - _caller, + nil, + "isOwner", ) } return result, err } -func (tbtcs *TBTCSystem) ApprovedToLogAtBlock( - _caller common.Address, +func (tbtcs *TBTCSystem) IsOwnerAtBlock( blockNumber *big.Int, ) (bool, error) { var result bool @@ -4512,17 +4513,16 @@ func (tbtcs *TBTCSystem) ApprovedToLogAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "approvedToLog", + "isOwner", &result, - _caller, ) return result, err } -func (tbtcs *TBTCSystem) GetAllowNewDeposits() (bool, error) { - var result bool - result, err := tbtcs.contract.GetAllowNewDeposits( +func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTime() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingKeepFactoriesUpgradeabilityTime( tbtcs.callerOptions, ) @@ -4531,17 +4531,17 @@ func (tbtcs *TBTCSystem) GetAllowNewDeposits() (bool, error) { err, tbtcs.callerOptions.From, nil, - "getAllowNewDeposits", + "getRemainingKeepFactoriesUpgradeabilityTime", ) } return result, err } -func (tbtcs *TBTCSystem) GetAllowNewDepositsAtBlock( +func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTimeAtBlock( blockNumber *big.Int, -) (bool, error) { - var result bool +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4551,16 +4551,16 @@ func (tbtcs *TBTCSystem) GetAllowNewDepositsAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getAllowNewDeposits", + "getRemainingKeepFactoriesUpgradeabilityTime", &result, ) return result, err } -func (tbtcs *TBTCSystem) KeepThreshold() (uint16, error) { - var result uint16 - result, err := tbtcs.contract.KeepThreshold( +func (tbtcs *TBTCSystem) GetAllowNewDeposits() (bool, error) { + var result bool + result, err := tbtcs.contract.GetAllowNewDeposits( tbtcs.callerOptions, ) @@ -4569,17 +4569,17 @@ func (tbtcs *TBTCSystem) KeepThreshold() (uint16, error) { err, tbtcs.callerOptions.From, nil, - "keepThreshold", + "getAllowNewDeposits", ) } return result, err } -func (tbtcs *TBTCSystem) KeepThresholdAtBlock( +func (tbtcs *TBTCSystem) GetAllowNewDepositsAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (bool, error) { + var result bool err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4589,16 +4589,16 @@ func (tbtcs *TBTCSystem) KeepThresholdAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "keepThreshold", + "getAllowNewDeposits", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercent() (uint16, error) { - var result uint16 - result, err := tbtcs.contract.GetUndercollateralizedThresholdPercent( +func (tbtcs *TBTCSystem) GetAllowedLotSizes() ([]uint64, error) { + var result []uint64 + result, err := tbtcs.contract.GetAllowedLotSizes( tbtcs.callerOptions, ) @@ -4607,17 +4607,17 @@ func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercent() (uint16, error err, tbtcs.callerOptions.From, nil, - "getUndercollateralizedThresholdPercent", + "getAllowedLotSizes", ) } return result, err } -func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercentAtBlock( +func (tbtcs *TBTCSystem) GetAllowedLotSizesAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) ([]uint64, error) { + var result []uint64 err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4627,16 +4627,16 @@ func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercentAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getUndercollateralizedThresholdPercent", + "getAllowedLotSizes", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTime() (*big.Int, error) { +func (tbtcs *TBTCSystem) GetNewDepositFeeEstimate() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.GetRemainingKeepFactoriesUpgradeabilityTime( + result, err := tbtcs.contract.GetNewDepositFeeEstimate( tbtcs.callerOptions, ) @@ -4645,14 +4645,14 @@ func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTime() (*big.Int err, tbtcs.callerOptions.From, nil, - "getRemainingKeepFactoriesUpgradeabilityTime", + "getNewDepositFeeEstimate", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTimeAtBlock( +func (tbtcs *TBTCSystem) GetNewDepositFeeEstimateAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -4665,16 +4665,16 @@ func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTimeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingKeepFactoriesUpgradeabilityTime", + "getNewDepositFeeEstimate", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriod() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetKeepFactoriesUpgradeabilityPeriod( +func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.GetUndercollateralizedThresholdPercent( tbtcs.callerOptions, ) @@ -4683,17 +4683,17 @@ func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriod() (*big.Int, error err, tbtcs.callerOptions.From, nil, - "getKeepFactoriesUpgradeabilityPeriod", + "getUndercollateralizedThresholdPercent", ) } return result, err } -func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriodAtBlock( +func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercentAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4703,16 +4703,16 @@ func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriodAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getKeepFactoriesUpgradeabilityPeriod", + "getUndercollateralizedThresholdPercent", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetInitialCollateralizedPercent() (uint16, error) { - var result uint16 - result, err := tbtcs.contract.GetInitialCollateralizedPercent( +func (tbtcs *TBTCSystem) GetGovernanceTimeDelay() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetGovernanceTimeDelay( tbtcs.callerOptions, ) @@ -4721,17 +4721,17 @@ func (tbtcs *TBTCSystem) GetInitialCollateralizedPercent() (uint16, error) { err, tbtcs.callerOptions.From, nil, - "getInitialCollateralizedPercent", + "getGovernanceTimeDelay", ) } return result, err } -func (tbtcs *TBTCSystem) GetInitialCollateralizedPercentAtBlock( +func (tbtcs *TBTCSystem) GetGovernanceTimeDelayAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4741,7 +4741,7 @@ func (tbtcs *TBTCSystem) GetInitialCollateralizedPercentAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getInitialCollateralizedPercent", + "getGovernanceTimeDelay", &result, ) @@ -4786,9 +4786,9 @@ func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTimeAtBlock( return result, err } -func (tbtcs *TBTCSystem) GetGovernanceTimeDelay() (*big.Int, error) { +func (tbtcs *TBTCSystem) GetRemainingPauseTerm() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.GetGovernanceTimeDelay( + result, err := tbtcs.contract.GetRemainingPauseTerm( tbtcs.callerOptions, ) @@ -4797,14 +4797,14 @@ func (tbtcs *TBTCSystem) GetGovernanceTimeDelay() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getGovernanceTimeDelay", + "getRemainingPauseTerm", ) } return result, err } -func (tbtcs *TBTCSystem) GetGovernanceTimeDelayAtBlock( +func (tbtcs *TBTCSystem) GetRemainingPauseTermAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -4817,16 +4817,16 @@ func (tbtcs *TBTCSystem) GetGovernanceTimeDelayAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getGovernanceTimeDelay", + "getRemainingPauseTerm", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetNewDepositFeeEstimate() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetNewDepositFeeEstimate( +func (tbtcs *TBTCSystem) KeepSize() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.KeepSize( tbtcs.callerOptions, ) @@ -4835,17 +4835,17 @@ func (tbtcs *TBTCSystem) GetNewDepositFeeEstimate() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getNewDepositFeeEstimate", + "keepSize", ) } return result, err } -func (tbtcs *TBTCSystem) GetNewDepositFeeEstimateAtBlock( +func (tbtcs *TBTCSystem) KeepSizeAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4855,16 +4855,16 @@ func (tbtcs *TBTCSystem) GetNewDepositFeeEstimateAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getNewDepositFeeEstimate", + "keepSize", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTime() (*big.Int, error) { +func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelay() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.GetRemainingCollateralizationThresholdsUpdateTime( + result, err := tbtcs.contract.GetPriceFeedGovernanceTimeDelay( tbtcs.callerOptions, ) @@ -4873,14 +4873,14 @@ func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTime() (*b err, tbtcs.callerOptions.From, nil, - "getRemainingCollateralizationThresholdsUpdateTime", + "getPriceFeedGovernanceTimeDelay", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTimeAtBlock( +func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelayAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -4893,16 +4893,16 @@ func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTimeAtBloc tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingCollateralizationThresholdsUpdateTime", + "getPriceFeedGovernanceTimeDelay", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelay() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetPriceFeedGovernanceTimeDelay( +func (tbtcs *TBTCSystem) KeepThreshold() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.KeepThreshold( tbtcs.callerOptions, ) @@ -4911,17 +4911,17 @@ func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelay() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getPriceFeedGovernanceTimeDelay", + "keepThreshold", ) } return result, err } -func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelayAtBlock( +func (tbtcs *TBTCSystem) KeepThresholdAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4931,16 +4931,16 @@ func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelayAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getPriceFeedGovernanceTimeDelay", + "keepThreshold", &result, ) return result, err } -func (tbtcs *TBTCSystem) FetchRelayCurrentDifficulty() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.FetchRelayCurrentDifficulty( +func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.GetSeverelyUndercollateralizedThresholdPercent( tbtcs.callerOptions, ) @@ -4949,17 +4949,17 @@ func (tbtcs *TBTCSystem) FetchRelayCurrentDifficulty() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "fetchRelayCurrentDifficulty", + "getSeverelyUndercollateralizedThresholdPercent", ) } return result, err } -func (tbtcs *TBTCSystem) FetchRelayCurrentDifficultyAtBlock( +func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercentAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4969,16 +4969,16 @@ func (tbtcs *TBTCSystem) FetchRelayCurrentDifficultyAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "fetchRelayCurrentDifficulty", + "getSeverelyUndercollateralizedThresholdPercent", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetAllowedLotSizes() ([]uint64, error) { - var result []uint64 - result, err := tbtcs.contract.GetAllowedLotSizes( +func (tbtcs *TBTCSystem) FetchRelayCurrentDifficulty() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.FetchRelayCurrentDifficulty( tbtcs.callerOptions, ) @@ -4987,17 +4987,17 @@ func (tbtcs *TBTCSystem) GetAllowedLotSizes() ([]uint64, error) { err, tbtcs.callerOptions.From, nil, - "getAllowedLotSizes", + "fetchRelayCurrentDifficulty", ) } return result, err } -func (tbtcs *TBTCSystem) GetAllowedLotSizesAtBlock( +func (tbtcs *TBTCSystem) FetchRelayCurrentDifficultyAtBlock( blockNumber *big.Int, -) ([]uint64, error) { - var result []uint64 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -5007,16 +5007,16 @@ func (tbtcs *TBTCSystem) GetAllowedLotSizesAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getAllowedLotSizes", + "fetchRelayCurrentDifficulty", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercent() (uint16, error) { - var result uint16 - result, err := tbtcs.contract.GetSeverelyUndercollateralizedThresholdPercent( +func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriod() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetKeepFactoriesUpgradeabilityPeriod( tbtcs.callerOptions, ) @@ -5025,17 +5025,17 @@ func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercent() (uint1 err, tbtcs.callerOptions.From, nil, - "getSeverelyUndercollateralizedThresholdPercent", + "getKeepFactoriesUpgradeabilityPeriod", ) } return result, err } -func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercentAtBlock( +func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriodAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -5045,16 +5045,16 @@ func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercentAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getSeverelyUndercollateralizedThresholdPercent", + "getKeepFactoriesUpgradeabilityPeriod", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetSignerFeeDivisor() (uint16, error) { - var result uint16 - result, err := tbtcs.contract.GetSignerFeeDivisor( +func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTime() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingLotSizesUpdateTime( tbtcs.callerOptions, ) @@ -5063,17 +5063,17 @@ func (tbtcs *TBTCSystem) GetSignerFeeDivisor() (uint16, error) { err, tbtcs.callerOptions.From, nil, - "getSignerFeeDivisor", + "getRemainingLotSizesUpdateTime", ) } return result, err } -func (tbtcs *TBTCSystem) GetSignerFeeDivisorAtBlock( +func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTimeAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -5083,16 +5083,16 @@ func (tbtcs *TBTCSystem) GetSignerFeeDivisorAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getSignerFeeDivisor", + "getRemainingLotSizesUpdateTime", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTime() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetRemainingEthBtcPriceFeedAdditionTime( +func (tbtcs *TBTCSystem) GetInitialCollateralizedPercent() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.GetInitialCollateralizedPercent( tbtcs.callerOptions, ) @@ -5101,17 +5101,17 @@ func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTime() (*big.Int, er err, tbtcs.callerOptions.From, nil, - "getRemainingEthBtcPriceFeedAdditionTime", + "getInitialCollateralizedPercent", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTimeAtBlock( +func (tbtcs *TBTCSystem) GetInitialCollateralizedPercentAtBlock( blockNumber *big.Int, -) (*big.Int, error) { - var result *big.Int +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -5121,16 +5121,16 @@ func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTimeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingEthBtcPriceFeedAdditionTime", + "getInitialCollateralizedPercent", &result, ) return result, err } -func (tbtcs *TBTCSystem) KeepSize() (uint16, error) { - var result uint16 - result, err := tbtcs.contract.KeepSize( +func (tbtcs *TBTCSystem) GetMaximumLotSize() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetMaximumLotSize( tbtcs.callerOptions, ) @@ -5139,17 +5139,17 @@ func (tbtcs *TBTCSystem) KeepSize() (uint16, error) { err, tbtcs.callerOptions.From, nil, - "keepSize", + "getMaximumLotSize", ) } return result, err } -func (tbtcs *TBTCSystem) KeepSizeAtBlock( +func (tbtcs *TBTCSystem) GetMaximumLotSizeAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -5159,7 +5159,7 @@ func (tbtcs *TBTCSystem) KeepSizeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "keepSize", + "getMaximumLotSize", &result, ) @@ -5168,14 +5168,15 @@ func (tbtcs *TBTCSystem) KeepSizeAtBlock( // ------ Events ------- -type tBTCSystemFunderAbortRequestedFunc func( +type tBTCSystemStartedLiquidationFunc func( DepositContractAddress common.Address, - AbortOutputScript []uint8, + WasFraud bool, + Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchFunderAbortRequested( - success tBTCSystemFunderAbortRequestedFunc, +func (tbtcs *TBTCSystem) WatchStartedLiquidation( + success tBTCSystemStartedLiquidationFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { @@ -5194,7 +5195,7 @@ func (tbtcs *TBTCSystem) WatchFunderAbortRequested( return err } - subscription, err := tbtcs.subscribeFunderAbortRequested( + subscription, err := tbtcs.subscribeStartedLiquidation( success, failCallback, _depositContractAddressFilter, @@ -5217,7 +5218,7 @@ func (tbtcs *TBTCSystem) WatchFunderAbortRequested( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event FunderAbortRequested terminated with error; " + + "subscription to event StartedLiquidation terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5238,13 +5239,13 @@ func (tbtcs *TBTCSystem) WatchFunderAbortRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeFunderAbortRequested( - success tBTCSystemFunderAbortRequestedFunc, +func (tbtcs *TBTCSystem) subscribeStartedLiquidation( + success tBTCSystemStartedLiquidationFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemFunderAbortRequested) - eventSubscription, err := tbtcs.contract.WatchFunderAbortRequested( + eventChan := make(chan *abi.TBTCSystemStartedLiquidation) + eventSubscription, err := tbtcs.contract.WatchStartedLiquidation( nil, eventChan, _depositContractAddressFilter, @@ -5252,7 +5253,7 @@ func (tbtcs *TBTCSystem) subscribeFunderAbortRequested( if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for FunderAbortRequested events: [%v]", + "error creating watch for StartedLiquidation events: [%v]", err, ) } @@ -5271,7 +5272,8 @@ func (tbtcs *TBTCSystem) subscribeFunderAbortRequested( } success( event.DepositContractAddress, - event.AbortOutputScript, + event.WasFraud, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -5293,20 +5295,14 @@ func (tbtcs *TBTCSystem) subscribeFunderAbortRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemGotRedemptionSignatureFunc func( - DepositContractAddress common.Address, - Digest [32]uint8, - R [32]uint8, - S [32]uint8, - Timestamp *big.Int, +type tBTCSystemAllowNewDepositsUpdatedFunc func( + AllowNewDeposits bool, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchGotRedemptionSignature( - success tBTCSystemGotRedemptionSignatureFunc, +func (tbtcs *TBTCSystem) WatchAllowNewDepositsUpdated( + success tBTCSystemAllowNewDepositsUpdatedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, - _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -5323,11 +5319,9 @@ func (tbtcs *TBTCSystem) WatchGotRedemptionSignature( return err } - subscription, err := tbtcs.subscribeGotRedemptionSignature( + subscription, err := tbtcs.subscribeAllowNewDepositsUpdated( success, failCallback, - _depositContractAddressFilter, - _digestFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -5347,7 +5341,7 @@ func (tbtcs *TBTCSystem) WatchGotRedemptionSignature( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event GotRedemptionSignature terminated with error; " + + "subscription to event AllowNewDepositsUpdated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5368,23 +5362,19 @@ func (tbtcs *TBTCSystem) WatchGotRedemptionSignature( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeGotRedemptionSignature( - success tBTCSystemGotRedemptionSignatureFunc, +func (tbtcs *TBTCSystem) subscribeAllowNewDepositsUpdated( + success tBTCSystemAllowNewDepositsUpdatedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, - _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemGotRedemptionSignature) - eventSubscription, err := tbtcs.contract.WatchGotRedemptionSignature( + eventChan := make(chan *abi.TBTCSystemAllowNewDepositsUpdated) + eventSubscription, err := tbtcs.contract.WatchAllowNewDepositsUpdated( nil, eventChan, - _depositContractAddressFilter, - _digestFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for GotRedemptionSignature events: [%v]", + "error creating watch for AllowNewDepositsUpdated events: [%v]", err, ) } @@ -5402,11 +5392,7 @@ func (tbtcs *TBTCSystem) subscribeGotRedemptionSignature( return } success( - event.DepositContractAddress, - event.Digest, - event.R, - event.S, - event.Timestamp, + event.AllowNewDeposits, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -5428,16 +5414,18 @@ func (tbtcs *TBTCSystem) subscribeGotRedemptionSignature( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemLiquidatedFunc func( +type tBTCSystemCreatedFunc func( DepositContractAddress common.Address, + KeepAddress common.Address, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchLiquidated( - success tBTCSystemLiquidatedFunc, +func (tbtcs *TBTCSystem) WatchCreated( + success tBTCSystemCreatedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _keepAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -5454,10 +5442,11 @@ func (tbtcs *TBTCSystem) WatchLiquidated( return err } - subscription, err := tbtcs.subscribeLiquidated( + subscription, err := tbtcs.subscribeCreated( success, failCallback, _depositContractAddressFilter, + _keepAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -5477,7 +5466,7 @@ func (tbtcs *TBTCSystem) WatchLiquidated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event Liquidated terminated with error; " + + "subscription to event Created terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5498,21 +5487,23 @@ func (tbtcs *TBTCSystem) WatchLiquidated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeLiquidated( - success tBTCSystemLiquidatedFunc, +func (tbtcs *TBTCSystem) subscribeCreated( + success tBTCSystemCreatedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _keepAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemLiquidated) - eventSubscription, err := tbtcs.contract.WatchLiquidated( + eventChan := make(chan *abi.TBTCSystemCreated) + eventSubscription, err := tbtcs.contract.WatchCreated( nil, eventChan, _depositContractAddressFilter, + _keepAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for Liquidated events: [%v]", + "error creating watch for Created events: [%v]", err, ) } @@ -5531,6 +5522,7 @@ func (tbtcs *TBTCSystem) subscribeLiquidated( } success( event.DepositContractAddress, + event.KeepAddress, event.Timestamp, event.Raw.BlockNumber, ) @@ -5553,13 +5545,16 @@ func (tbtcs *TBTCSystem) subscribeLiquidated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemAllowNewDepositsUpdatedFunc func( - AllowNewDeposits bool, +type tBTCSystemKeepFactoriesUpdateStartedFunc func( + KeepStakedFactory common.Address, + FullyBackedFactory common.Address, + FactorySelector common.Address, + Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchAllowNewDepositsUpdated( - success tBTCSystemAllowNewDepositsUpdatedFunc, +func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdateStarted( + success tBTCSystemKeepFactoriesUpdateStartedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { errorChan := make(chan error) @@ -5577,7 +5572,7 @@ func (tbtcs *TBTCSystem) WatchAllowNewDepositsUpdated( return err } - subscription, err := tbtcs.subscribeAllowNewDepositsUpdated( + subscription, err := tbtcs.subscribeKeepFactoriesUpdateStarted( success, failCallback, ) @@ -5599,7 +5594,7 @@ func (tbtcs *TBTCSystem) WatchAllowNewDepositsUpdated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event AllowNewDepositsUpdated terminated with error; " + + "subscription to event KeepFactoriesUpdateStarted terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5620,19 +5615,19 @@ func (tbtcs *TBTCSystem) WatchAllowNewDepositsUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeAllowNewDepositsUpdated( - success tBTCSystemAllowNewDepositsUpdatedFunc, +func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdateStarted( + success tBTCSystemKeepFactoriesUpdateStartedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemAllowNewDepositsUpdated) - eventSubscription, err := tbtcs.contract.WatchAllowNewDepositsUpdated( + eventChan := make(chan *abi.TBTCSystemKeepFactoriesUpdateStarted) + eventSubscription, err := tbtcs.contract.WatchKeepFactoriesUpdateStarted( nil, eventChan, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for AllowNewDepositsUpdated events: [%v]", + "error creating watch for KeepFactoriesUpdateStarted events: [%v]", err, ) } @@ -5650,7 +5645,10 @@ func (tbtcs *TBTCSystem) subscribeAllowNewDepositsUpdated( return } success( - event.AllowNewDeposits, + event.KeepStakedFactory, + event.FullyBackedFactory, + event.FactorySelector, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -5672,16 +5670,17 @@ func (tbtcs *TBTCSystem) subscribeAllowNewDepositsUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemCollateralizationThresholdsUpdatedFunc func( - InitialCollateralizedPercent uint16, - UndercollateralizedThresholdPercent uint16, - SeverelyUndercollateralizedThresholdPercent uint16, +type tBTCSystemOwnershipTransferredFunc func( + PreviousOwner common.Address, + NewOwner common.Address, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdated( - success tBTCSystemCollateralizationThresholdsUpdatedFunc, +func (tbtcs *TBTCSystem) WatchOwnershipTransferred( + success tBTCSystemOwnershipTransferredFunc, fail func(err error) error, + previousOwnerFilter []common.Address, + newOwnerFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -5698,9 +5697,11 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdated( return err } - subscription, err := tbtcs.subscribeCollateralizationThresholdsUpdated( + subscription, err := tbtcs.subscribeOwnershipTransferred( success, failCallback, + previousOwnerFilter, + newOwnerFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -5720,7 +5721,7 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event CollateralizationThresholdsUpdated terminated with error; " + + "subscription to event OwnershipTransferred terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5741,19 +5742,23 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdated( - success tBTCSystemCollateralizationThresholdsUpdatedFunc, +func (tbtcs *TBTCSystem) subscribeOwnershipTransferred( + success tBTCSystemOwnershipTransferredFunc, fail func(err error) error, + previousOwnerFilter []common.Address, + newOwnerFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemCollateralizationThresholdsUpdated) - eventSubscription, err := tbtcs.contract.WatchCollateralizationThresholdsUpdated( + eventChan := make(chan *abi.TBTCSystemOwnershipTransferred) + eventSubscription, err := tbtcs.contract.WatchOwnershipTransferred( nil, eventChan, + previousOwnerFilter, + newOwnerFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for CollateralizationThresholdsUpdated events: [%v]", + "error creating watch for OwnershipTransferred events: [%v]", err, ) } @@ -5771,9 +5776,8 @@ func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdated( return } success( - event.InitialCollateralizedPercent, - event.UndercollateralizedThresholdPercent, - event.SeverelyUndercollateralizedThresholdPercent, + event.PreviousOwner, + event.NewOwner, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -5795,14 +5799,14 @@ func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemCourtesyCalledFunc func( +type tBTCSystemSetupFailedFunc func( DepositContractAddress common.Address, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchCourtesyCalled( - success tBTCSystemCourtesyCalledFunc, +func (tbtcs *TBTCSystem) WatchSetupFailed( + success tBTCSystemSetupFailedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { @@ -5821,7 +5825,7 @@ func (tbtcs *TBTCSystem) WatchCourtesyCalled( return err } - subscription, err := tbtcs.subscribeCourtesyCalled( + subscription, err := tbtcs.subscribeSetupFailed( success, failCallback, _depositContractAddressFilter, @@ -5844,7 +5848,7 @@ func (tbtcs *TBTCSystem) WatchCourtesyCalled( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event CourtesyCalled terminated with error; " + + "subscription to event SetupFailed terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5865,13 +5869,13 @@ func (tbtcs *TBTCSystem) WatchCourtesyCalled( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeCourtesyCalled( - success tBTCSystemCourtesyCalledFunc, +func (tbtcs *TBTCSystem) subscribeSetupFailed( + success tBTCSystemSetupFailedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemCourtesyCalled) - eventSubscription, err := tbtcs.contract.WatchCourtesyCalled( + eventChan := make(chan *abi.TBTCSystemSetupFailed) + eventSubscription, err := tbtcs.contract.WatchSetupFailed( nil, eventChan, _depositContractAddressFilter, @@ -5879,7 +5883,7 @@ func (tbtcs *TBTCSystem) subscribeCourtesyCalled( if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for CourtesyCalled events: [%v]", + "error creating watch for SetupFailed events: [%v]", err, ) } @@ -5920,16 +5924,17 @@ func (tbtcs *TBTCSystem) subscribeCourtesyCalled( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemFraudDuringSetupFunc func( - DepositContractAddress common.Address, +type tBTCSystemCollateralizationThresholdsUpdateStartedFunc func( + InitialCollateralizedPercent uint16, + UndercollateralizedThresholdPercent uint16, + SeverelyUndercollateralizedThresholdPercent uint16, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchFraudDuringSetup( - success tBTCSystemFraudDuringSetupFunc, +func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdateStarted( + success tBTCSystemCollateralizationThresholdsUpdateStartedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -5946,10 +5951,9 @@ func (tbtcs *TBTCSystem) WatchFraudDuringSetup( return err } - subscription, err := tbtcs.subscribeFraudDuringSetup( + subscription, err := tbtcs.subscribeCollateralizationThresholdsUpdateStarted( success, failCallback, - _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -5969,7 +5973,7 @@ func (tbtcs *TBTCSystem) WatchFraudDuringSetup( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event FraudDuringSetup terminated with error; " + + "subscription to event CollateralizationThresholdsUpdateStarted terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5990,21 +5994,19 @@ func (tbtcs *TBTCSystem) WatchFraudDuringSetup( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeFraudDuringSetup( - success tBTCSystemFraudDuringSetupFunc, +func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdateStarted( + success tBTCSystemCollateralizationThresholdsUpdateStartedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemFraudDuringSetup) - eventSubscription, err := tbtcs.contract.WatchFraudDuringSetup( + eventChan := make(chan *abi.TBTCSystemCollateralizationThresholdsUpdateStarted) + eventSubscription, err := tbtcs.contract.WatchCollateralizationThresholdsUpdateStarted( nil, eventChan, - _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for FraudDuringSetup events: [%v]", + "error creating watch for CollateralizationThresholdsUpdateStarted events: [%v]", err, ) } @@ -6022,7 +6024,9 @@ func (tbtcs *TBTCSystem) subscribeFraudDuringSetup( return } success( - event.DepositContractAddress, + event.InitialCollateralizedPercent, + event.UndercollateralizedThresholdPercent, + event.SeverelyUndercollateralizedThresholdPercent, event.Timestamp, event.Raw.BlockNumber, ) @@ -6045,18 +6049,16 @@ func (tbtcs *TBTCSystem) subscribeFraudDuringSetup( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemFundedFunc func( +type tBTCSystemExitedCourtesyCallFunc func( DepositContractAddress common.Address, - Txid [32]uint8, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchFunded( - success tBTCSystemFundedFunc, +func (tbtcs *TBTCSystem) WatchExitedCourtesyCall( + success tBTCSystemExitedCourtesyCallFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -6073,11 +6075,10 @@ func (tbtcs *TBTCSystem) WatchFunded( return err } - subscription, err := tbtcs.subscribeFunded( + subscription, err := tbtcs.subscribeExitedCourtesyCall( success, failCallback, _depositContractAddressFilter, - _txidFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -6097,7 +6098,7 @@ func (tbtcs *TBTCSystem) WatchFunded( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event Funded terminated with error; " + + "subscription to event ExitedCourtesyCall terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6118,23 +6119,21 @@ func (tbtcs *TBTCSystem) WatchFunded( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeFunded( - success tBTCSystemFundedFunc, +func (tbtcs *TBTCSystem) subscribeExitedCourtesyCall( + success tBTCSystemExitedCourtesyCallFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemFunded) - eventSubscription, err := tbtcs.contract.WatchFunded( + eventChan := make(chan *abi.TBTCSystemExitedCourtesyCall) + eventSubscription, err := tbtcs.contract.WatchExitedCourtesyCall( nil, eventChan, _depositContractAddressFilter, - _txidFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for Funded events: [%v]", + "error creating watch for ExitedCourtesyCall events: [%v]", err, ) } @@ -6153,7 +6152,6 @@ func (tbtcs *TBTCSystem) subscribeFunded( } success( event.DepositContractAddress, - event.Txid, event.Timestamp, event.Raw.BlockNumber, ) @@ -6176,15 +6174,15 @@ func (tbtcs *TBTCSystem) subscribeFunded( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemRedeemedFunc func( +type tBTCSystemFundedFunc func( DepositContractAddress common.Address, Txid [32]uint8, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchRedeemed( - success tBTCSystemRedeemedFunc, +func (tbtcs *TBTCSystem) WatchFunded( + success tBTCSystemFundedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, _txidFilter [][32]uint8, @@ -6204,7 +6202,7 @@ func (tbtcs *TBTCSystem) WatchRedeemed( return err } - subscription, err := tbtcs.subscribeRedeemed( + subscription, err := tbtcs.subscribeFunded( success, failCallback, _depositContractAddressFilter, @@ -6228,7 +6226,7 @@ func (tbtcs *TBTCSystem) WatchRedeemed( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event Redeemed terminated with error; " + + "subscription to event Funded terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6249,14 +6247,14 @@ func (tbtcs *TBTCSystem) WatchRedeemed( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeRedeemed( - success tBTCSystemRedeemedFunc, +func (tbtcs *TBTCSystem) subscribeFunded( + success tBTCSystemFundedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemRedeemed) - eventSubscription, err := tbtcs.contract.WatchRedeemed( + eventChan := make(chan *abi.TBTCSystemFunded) + eventSubscription, err := tbtcs.contract.WatchFunded( nil, eventChan, _depositContractAddressFilter, @@ -6265,7 +6263,7 @@ func (tbtcs *TBTCSystem) subscribeRedeemed( if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for Redeemed events: [%v]", + "error creating watch for Funded events: [%v]", err, ) } @@ -6307,23 +6305,14 @@ func (tbtcs *TBTCSystem) subscribeRedeemed( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemRedemptionRequestedFunc func( - DepositContractAddress common.Address, - Requester common.Address, - Digest [32]uint8, - UtxoValue *big.Int, - RedeemerOutputScript []uint8, - RequestedFee *big.Int, - Outpoint []uint8, +type tBTCSystemSignerFeeDivisorUpdatedFunc func( + SignerFeeDivisor uint16, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchRedemptionRequested( - success tBTCSystemRedemptionRequestedFunc, +func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdated( + success tBTCSystemSignerFeeDivisorUpdatedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, - _requesterFilter []common.Address, - _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -6340,12 +6329,9 @@ func (tbtcs *TBTCSystem) WatchRedemptionRequested( return err } - subscription, err := tbtcs.subscribeRedemptionRequested( + subscription, err := tbtcs.subscribeSignerFeeDivisorUpdated( success, failCallback, - _depositContractAddressFilter, - _requesterFilter, - _digestFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -6365,7 +6351,7 @@ func (tbtcs *TBTCSystem) WatchRedemptionRequested( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event RedemptionRequested terminated with error; " + + "subscription to event SignerFeeDivisorUpdated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6386,25 +6372,19 @@ func (tbtcs *TBTCSystem) WatchRedemptionRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeRedemptionRequested( - success tBTCSystemRedemptionRequestedFunc, +func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdated( + success tBTCSystemSignerFeeDivisorUpdatedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, - _requesterFilter []common.Address, - _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemRedemptionRequested) - eventSubscription, err := tbtcs.contract.WatchRedemptionRequested( + eventChan := make(chan *abi.TBTCSystemSignerFeeDivisorUpdated) + eventSubscription, err := tbtcs.contract.WatchSignerFeeDivisorUpdated( nil, eventChan, - _depositContractAddressFilter, - _requesterFilter, - _digestFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for RedemptionRequested events: [%v]", + "error creating watch for SignerFeeDivisorUpdated events: [%v]", err, ) } @@ -6422,13 +6402,7 @@ func (tbtcs *TBTCSystem) subscribeRedemptionRequested( return } success( - event.DepositContractAddress, - event.Requester, - event.Digest, - event.UtxoValue, - event.RedeemerOutputScript, - event.RequestedFee, - event.Outpoint, + event.SignerFeeDivisor, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -6450,18 +6424,16 @@ func (tbtcs *TBTCSystem) subscribeRedemptionRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemRegisteredPubkeyFunc func( - DepositContractAddress common.Address, - SigningGroupPubkeyX [32]uint8, - SigningGroupPubkeyY [32]uint8, - Timestamp *big.Int, +type tBTCSystemCollateralizationThresholdsUpdatedFunc func( + InitialCollateralizedPercent uint16, + UndercollateralizedThresholdPercent uint16, + SeverelyUndercollateralizedThresholdPercent uint16, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchRegisteredPubkey( - success tBTCSystemRegisteredPubkeyFunc, +func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdated( + success tBTCSystemCollateralizationThresholdsUpdatedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -6478,10 +6450,9 @@ func (tbtcs *TBTCSystem) WatchRegisteredPubkey( return err } - subscription, err := tbtcs.subscribeRegisteredPubkey( + subscription, err := tbtcs.subscribeCollateralizationThresholdsUpdated( success, failCallback, - _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -6501,7 +6472,7 @@ func (tbtcs *TBTCSystem) WatchRegisteredPubkey( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event RegisteredPubkey terminated with error; " + + "subscription to event CollateralizationThresholdsUpdated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6522,21 +6493,19 @@ func (tbtcs *TBTCSystem) WatchRegisteredPubkey( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeRegisteredPubkey( - success tBTCSystemRegisteredPubkeyFunc, +func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdated( + success tBTCSystemCollateralizationThresholdsUpdatedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemRegisteredPubkey) - eventSubscription, err := tbtcs.contract.WatchRegisteredPubkey( + eventChan := make(chan *abi.TBTCSystemCollateralizationThresholdsUpdated) + eventSubscription, err := tbtcs.contract.WatchCollateralizationThresholdsUpdated( nil, eventChan, - _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for RegisteredPubkey events: [%v]", + "error creating watch for CollateralizationThresholdsUpdated events: [%v]", err, ) } @@ -6554,10 +6523,9 @@ func (tbtcs *TBTCSystem) subscribeRegisteredPubkey( return } success( - event.DepositContractAddress, - event.SigningGroupPubkeyX, - event.SigningGroupPubkeyY, - event.Timestamp, + event.InitialCollateralizedPercent, + event.UndercollateralizedThresholdPercent, + event.SeverelyUndercollateralizedThresholdPercent, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -6579,15 +6547,14 @@ func (tbtcs *TBTCSystem) subscribeRegisteredPubkey( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemStartedLiquidationFunc func( +type tBTCSystemCourtesyCalledFunc func( DepositContractAddress common.Address, - WasFraud bool, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchStartedLiquidation( - success tBTCSystemStartedLiquidationFunc, +func (tbtcs *TBTCSystem) WatchCourtesyCalled( + success tBTCSystemCourtesyCalledFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { @@ -6606,7 +6573,7 @@ func (tbtcs *TBTCSystem) WatchStartedLiquidation( return err } - subscription, err := tbtcs.subscribeStartedLiquidation( + subscription, err := tbtcs.subscribeCourtesyCalled( success, failCallback, _depositContractAddressFilter, @@ -6629,7 +6596,7 @@ func (tbtcs *TBTCSystem) WatchStartedLiquidation( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event StartedLiquidation terminated with error; " + + "subscription to event CourtesyCalled terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6650,13 +6617,13 @@ func (tbtcs *TBTCSystem) WatchStartedLiquidation( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeStartedLiquidation( - success tBTCSystemStartedLiquidationFunc, +func (tbtcs *TBTCSystem) subscribeCourtesyCalled( + success tBTCSystemCourtesyCalledFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemStartedLiquidation) - eventSubscription, err := tbtcs.contract.WatchStartedLiquidation( + eventChan := make(chan *abi.TBTCSystemCourtesyCalled) + eventSubscription, err := tbtcs.contract.WatchCourtesyCalled( nil, eventChan, _depositContractAddressFilter, @@ -6664,7 +6631,7 @@ func (tbtcs *TBTCSystem) subscribeStartedLiquidation( if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for StartedLiquidation events: [%v]", + "error creating watch for CourtesyCalled events: [%v]", err, ) } @@ -6683,7 +6650,6 @@ func (tbtcs *TBTCSystem) subscribeStartedLiquidation( } success( event.DepositContractAddress, - event.WasFraud, event.Timestamp, event.Raw.BlockNumber, ) @@ -6706,18 +6672,15 @@ func (tbtcs *TBTCSystem) subscribeStartedLiquidation( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemCreatedFunc func( - DepositContractAddress common.Address, - KeepAddress common.Address, +type tBTCSystemLotSizesUpdateStartedFunc func( + LotSizes []uint64, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchCreated( - success tBTCSystemCreatedFunc, +func (tbtcs *TBTCSystem) WatchLotSizesUpdateStarted( + success tBTCSystemLotSizesUpdateStartedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, - _keepAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -6734,11 +6697,9 @@ func (tbtcs *TBTCSystem) WatchCreated( return err } - subscription, err := tbtcs.subscribeCreated( + subscription, err := tbtcs.subscribeLotSizesUpdateStarted( success, failCallback, - _depositContractAddressFilter, - _keepAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -6758,7 +6719,7 @@ func (tbtcs *TBTCSystem) WatchCreated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event Created terminated with error; " + + "subscription to event LotSizesUpdateStarted terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6779,23 +6740,19 @@ func (tbtcs *TBTCSystem) WatchCreated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeCreated( - success tBTCSystemCreatedFunc, +func (tbtcs *TBTCSystem) subscribeLotSizesUpdateStarted( + success tBTCSystemLotSizesUpdateStartedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, - _keepAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemCreated) - eventSubscription, err := tbtcs.contract.WatchCreated( + eventChan := make(chan *abi.TBTCSystemLotSizesUpdateStarted) + eventSubscription, err := tbtcs.contract.WatchLotSizesUpdateStarted( nil, eventChan, - _depositContractAddressFilter, - _keepAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for Created events: [%v]", + "error creating watch for LotSizesUpdateStarted events: [%v]", err, ) } @@ -6813,8 +6770,7 @@ func (tbtcs *TBTCSystem) subscribeCreated( return } success( - event.DepositContractAddress, - event.KeepAddress, + event.LotSizes, event.Timestamp, event.Raw.BlockNumber, ) @@ -6837,14 +6793,16 @@ func (tbtcs *TBTCSystem) subscribeCreated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemEthBtcPriceFeedAddedFunc func( - PriceFeed common.Address, +type tBTCSystemFunderAbortRequestedFunc func( + DepositContractAddress common.Address, + AbortOutputScript []uint8, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdded( - success tBTCSystemEthBtcPriceFeedAddedFunc, +func (tbtcs *TBTCSystem) WatchFunderAbortRequested( + success tBTCSystemFunderAbortRequestedFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -6861,9 +6819,10 @@ func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdded( return err } - subscription, err := tbtcs.subscribeEthBtcPriceFeedAdded( + subscription, err := tbtcs.subscribeFunderAbortRequested( success, failCallback, + _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -6883,7 +6842,7 @@ func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdded( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event EthBtcPriceFeedAdded terminated with error; " + + "subscription to event FunderAbortRequested terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6904,19 +6863,21 @@ func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdded( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdded( - success tBTCSystemEthBtcPriceFeedAddedFunc, +func (tbtcs *TBTCSystem) subscribeFunderAbortRequested( + success tBTCSystemFunderAbortRequestedFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemEthBtcPriceFeedAdded) - eventSubscription, err := tbtcs.contract.WatchEthBtcPriceFeedAdded( + eventChan := make(chan *abi.TBTCSystemFunderAbortRequested) + eventSubscription, err := tbtcs.contract.WatchFunderAbortRequested( nil, eventChan, + _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for EthBtcPriceFeedAdded events: [%v]", + "error creating watch for FunderAbortRequested events: [%v]", err, ) } @@ -6934,7 +6895,8 @@ func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdded( return } success( - event.PriceFeed, + event.DepositContractAddress, + event.AbortOutputScript, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -6956,16 +6918,20 @@ func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdded( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemExitedCourtesyCallFunc func( +type tBTCSystemGotRedemptionSignatureFunc func( DepositContractAddress common.Address, + Digest [32]uint8, + R [32]uint8, + S [32]uint8, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchExitedCourtesyCall( - success tBTCSystemExitedCourtesyCallFunc, +func (tbtcs *TBTCSystem) WatchGotRedemptionSignature( + success tBTCSystemGotRedemptionSignatureFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -6982,10 +6948,11 @@ func (tbtcs *TBTCSystem) WatchExitedCourtesyCall( return err } - subscription, err := tbtcs.subscribeExitedCourtesyCall( + subscription, err := tbtcs.subscribeGotRedemptionSignature( success, failCallback, _depositContractAddressFilter, + _digestFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -7005,7 +6972,7 @@ func (tbtcs *TBTCSystem) WatchExitedCourtesyCall( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event ExitedCourtesyCall terminated with error; " + + "subscription to event GotRedemptionSignature terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7026,21 +6993,23 @@ func (tbtcs *TBTCSystem) WatchExitedCourtesyCall( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeExitedCourtesyCall( - success tBTCSystemExitedCourtesyCallFunc, +func (tbtcs *TBTCSystem) subscribeGotRedemptionSignature( + success tBTCSystemGotRedemptionSignatureFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemExitedCourtesyCall) - eventSubscription, err := tbtcs.contract.WatchExitedCourtesyCall( + eventChan := make(chan *abi.TBTCSystemGotRedemptionSignature) + eventSubscription, err := tbtcs.contract.WatchGotRedemptionSignature( nil, eventChan, _depositContractAddressFilter, + _digestFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for ExitedCourtesyCall events: [%v]", + "error creating watch for GotRedemptionSignature events: [%v]", err, ) } @@ -7059,6 +7028,9 @@ func (tbtcs *TBTCSystem) subscribeExitedCourtesyCall( } success( event.DepositContractAddress, + event.Digest, + event.R, + event.S, event.Timestamp, event.Raw.BlockNumber, ) @@ -7081,13 +7053,15 @@ func (tbtcs *TBTCSystem) subscribeExitedCourtesyCall( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemLotSizesUpdatedFunc func( - LotSizes []uint64, +type tBTCSystemKeepFactoriesUpdatedFunc func( + KeepStakedFactory common.Address, + FullyBackedFactory common.Address, + FactorySelector common.Address, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchLotSizesUpdated( - success tBTCSystemLotSizesUpdatedFunc, +func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdated( + success tBTCSystemKeepFactoriesUpdatedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { errorChan := make(chan error) @@ -7105,7 +7079,7 @@ func (tbtcs *TBTCSystem) WatchLotSizesUpdated( return err } - subscription, err := tbtcs.subscribeLotSizesUpdated( + subscription, err := tbtcs.subscribeKeepFactoriesUpdated( success, failCallback, ) @@ -7127,7 +7101,7 @@ func (tbtcs *TBTCSystem) WatchLotSizesUpdated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event LotSizesUpdated terminated with error; " + + "subscription to event KeepFactoriesUpdated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7148,19 +7122,19 @@ func (tbtcs *TBTCSystem) WatchLotSizesUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeLotSizesUpdated( - success tBTCSystemLotSizesUpdatedFunc, +func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdated( + success tBTCSystemKeepFactoriesUpdatedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemLotSizesUpdated) - eventSubscription, err := tbtcs.contract.WatchLotSizesUpdated( + eventChan := make(chan *abi.TBTCSystemKeepFactoriesUpdated) + eventSubscription, err := tbtcs.contract.WatchKeepFactoriesUpdated( nil, eventChan, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for LotSizesUpdated events: [%v]", + "error creating watch for KeepFactoriesUpdated events: [%v]", err, ) } @@ -7178,7 +7152,9 @@ func (tbtcs *TBTCSystem) subscribeLotSizesUpdated( return } success( - event.LotSizes, + event.KeepStakedFactory, + event.FullyBackedFactory, + event.FactorySelector, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -7200,17 +7176,16 @@ func (tbtcs *TBTCSystem) subscribeLotSizesUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemOwnershipTransferredFunc func( - PreviousOwner common.Address, - NewOwner common.Address, +type tBTCSystemLiquidatedFunc func( + DepositContractAddress common.Address, + Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchOwnershipTransferred( - success tBTCSystemOwnershipTransferredFunc, +func (tbtcs *TBTCSystem) WatchLiquidated( + success tBTCSystemLiquidatedFunc, fail func(err error) error, - previousOwnerFilter []common.Address, - newOwnerFilter []common.Address, + _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -7227,11 +7202,10 @@ func (tbtcs *TBTCSystem) WatchOwnershipTransferred( return err } - subscription, err := tbtcs.subscribeOwnershipTransferred( + subscription, err := tbtcs.subscribeLiquidated( success, failCallback, - previousOwnerFilter, - newOwnerFilter, + _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -7251,7 +7225,7 @@ func (tbtcs *TBTCSystem) WatchOwnershipTransferred( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event OwnershipTransferred terminated with error; " + + "subscription to event Liquidated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7272,23 +7246,21 @@ func (tbtcs *TBTCSystem) WatchOwnershipTransferred( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeOwnershipTransferred( - success tBTCSystemOwnershipTransferredFunc, +func (tbtcs *TBTCSystem) subscribeLiquidated( + success tBTCSystemLiquidatedFunc, fail func(err error) error, - previousOwnerFilter []common.Address, - newOwnerFilter []common.Address, + _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemOwnershipTransferred) - eventSubscription, err := tbtcs.contract.WatchOwnershipTransferred( + eventChan := make(chan *abi.TBTCSystemLiquidated) + eventSubscription, err := tbtcs.contract.WatchLiquidated( nil, - eventChan, - previousOwnerFilter, - newOwnerFilter, + eventChan, + _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for OwnershipTransferred events: [%v]", + "error creating watch for Liquidated events: [%v]", err, ) } @@ -7306,8 +7278,8 @@ func (tbtcs *TBTCSystem) subscribeOwnershipTransferred( return } success( - event.PreviousOwner, - event.NewOwner, + event.DepositContractAddress, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -7329,16 +7301,13 @@ func (tbtcs *TBTCSystem) subscribeOwnershipTransferred( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemCollateralizationThresholdsUpdateStartedFunc func( - InitialCollateralizedPercent uint16, - UndercollateralizedThresholdPercent uint16, - SeverelyUndercollateralizedThresholdPercent uint16, - Timestamp *big.Int, +type tBTCSystemLotSizesUpdatedFunc func( + LotSizes []uint64, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdateStarted( - success tBTCSystemCollateralizationThresholdsUpdateStartedFunc, +func (tbtcs *TBTCSystem) WatchLotSizesUpdated( + success tBTCSystemLotSizesUpdatedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { errorChan := make(chan error) @@ -7356,7 +7325,7 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdateStarted( return err } - subscription, err := tbtcs.subscribeCollateralizationThresholdsUpdateStarted( + subscription, err := tbtcs.subscribeLotSizesUpdated( success, failCallback, ) @@ -7378,7 +7347,7 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdateStarted( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event CollateralizationThresholdsUpdateStarted terminated with error; " + + "subscription to event LotSizesUpdated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7399,19 +7368,19 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdateStarted( - success tBTCSystemCollateralizationThresholdsUpdateStartedFunc, +func (tbtcs *TBTCSystem) subscribeLotSizesUpdated( + success tBTCSystemLotSizesUpdatedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemCollateralizationThresholdsUpdateStarted) - eventSubscription, err := tbtcs.contract.WatchCollateralizationThresholdsUpdateStarted( + eventChan := make(chan *abi.TBTCSystemLotSizesUpdated) + eventSubscription, err := tbtcs.contract.WatchLotSizesUpdated( nil, eventChan, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for CollateralizationThresholdsUpdateStarted events: [%v]", + "error creating watch for LotSizesUpdated events: [%v]", err, ) } @@ -7429,10 +7398,7 @@ func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdateStarted( return } success( - event.InitialCollateralizedPercent, - event.UndercollateralizedThresholdPercent, - event.SeverelyUndercollateralizedThresholdPercent, - event.Timestamp, + event.LotSizes, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -7454,14 +7420,13 @@ func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemEthBtcPriceFeedAdditionStartedFunc func( +type tBTCSystemEthBtcPriceFeedAddedFunc func( PriceFeed common.Address, - Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdditionStarted( - success tBTCSystemEthBtcPriceFeedAdditionStartedFunc, +func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdded( + success tBTCSystemEthBtcPriceFeedAddedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { errorChan := make(chan error) @@ -7479,7 +7444,7 @@ func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdditionStarted( return err } - subscription, err := tbtcs.subscribeEthBtcPriceFeedAdditionStarted( + subscription, err := tbtcs.subscribeEthBtcPriceFeedAdded( success, failCallback, ) @@ -7501,7 +7466,7 @@ func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdditionStarted( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event EthBtcPriceFeedAdditionStarted terminated with error; " + + "subscription to event EthBtcPriceFeedAdded terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7522,19 +7487,19 @@ func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdditionStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdditionStarted( - success tBTCSystemEthBtcPriceFeedAdditionStartedFunc, +func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdded( + success tBTCSystemEthBtcPriceFeedAddedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemEthBtcPriceFeedAdditionStarted) - eventSubscription, err := tbtcs.contract.WatchEthBtcPriceFeedAdditionStarted( + eventChan := make(chan *abi.TBTCSystemEthBtcPriceFeedAdded) + eventSubscription, err := tbtcs.contract.WatchEthBtcPriceFeedAdded( nil, eventChan, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for EthBtcPriceFeedAdditionStarted events: [%v]", + "error creating watch for EthBtcPriceFeedAdded events: [%v]", err, ) } @@ -7553,7 +7518,6 @@ func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdditionStarted( } success( event.PriceFeed, - event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -7575,13 +7539,14 @@ func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdditionStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemSignerFeeDivisorUpdatedFunc func( - SignerFeeDivisor uint16, +type tBTCSystemEthBtcPriceFeedAdditionStartedFunc func( + PriceFeed common.Address, + Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdated( - success tBTCSystemSignerFeeDivisorUpdatedFunc, +func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdditionStarted( + success tBTCSystemEthBtcPriceFeedAdditionStartedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { errorChan := make(chan error) @@ -7599,7 +7564,7 @@ func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdated( return err } - subscription, err := tbtcs.subscribeSignerFeeDivisorUpdated( + subscription, err := tbtcs.subscribeEthBtcPriceFeedAdditionStarted( success, failCallback, ) @@ -7621,7 +7586,7 @@ func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event SignerFeeDivisorUpdated terminated with error; " + + "subscription to event EthBtcPriceFeedAdditionStarted terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7642,19 +7607,19 @@ func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdated( - success tBTCSystemSignerFeeDivisorUpdatedFunc, +func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdditionStarted( + success tBTCSystemEthBtcPriceFeedAdditionStartedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemSignerFeeDivisorUpdated) - eventSubscription, err := tbtcs.contract.WatchSignerFeeDivisorUpdated( + eventChan := make(chan *abi.TBTCSystemEthBtcPriceFeedAdditionStarted) + eventSubscription, err := tbtcs.contract.WatchEthBtcPriceFeedAdditionStarted( nil, eventChan, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for SignerFeeDivisorUpdated events: [%v]", + "error creating watch for EthBtcPriceFeedAdditionStarted events: [%v]", err, ) } @@ -7672,7 +7637,8 @@ func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdated( return } success( - event.SignerFeeDivisor, + event.PriceFeed, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -7694,17 +7660,16 @@ func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemKeepFactoriesUpdateStartedFunc func( - KeepStakedFactory common.Address, - FullyBackedFactory common.Address, - FactorySelector common.Address, +type tBTCSystemFraudDuringSetupFunc func( + DepositContractAddress common.Address, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdateStarted( - success tBTCSystemKeepFactoriesUpdateStartedFunc, +func (tbtcs *TBTCSystem) WatchFraudDuringSetup( + success tBTCSystemFraudDuringSetupFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -7721,9 +7686,10 @@ func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdateStarted( return err } - subscription, err := tbtcs.subscribeKeepFactoriesUpdateStarted( + subscription, err := tbtcs.subscribeFraudDuringSetup( success, failCallback, + _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -7743,7 +7709,7 @@ func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdateStarted( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event KeepFactoriesUpdateStarted terminated with error; " + + "subscription to event FraudDuringSetup terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7764,19 +7730,21 @@ func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdateStarted( - success tBTCSystemKeepFactoriesUpdateStartedFunc, +func (tbtcs *TBTCSystem) subscribeFraudDuringSetup( + success tBTCSystemFraudDuringSetupFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemKeepFactoriesUpdateStarted) - eventSubscription, err := tbtcs.contract.WatchKeepFactoriesUpdateStarted( + eventChan := make(chan *abi.TBTCSystemFraudDuringSetup) + eventSubscription, err := tbtcs.contract.WatchFraudDuringSetup( nil, eventChan, + _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for KeepFactoriesUpdateStarted events: [%v]", + "error creating watch for FraudDuringSetup events: [%v]", err, ) } @@ -7794,9 +7762,7 @@ func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdateStarted( return } success( - event.KeepStakedFactory, - event.FullyBackedFactory, - event.FactorySelector, + event.DepositContractAddress, event.Timestamp, event.Raw.BlockNumber, ) @@ -7819,15 +7785,14 @@ func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemKeepFactoriesUpdatedFunc func( - KeepStakedFactory common.Address, - FullyBackedFactory common.Address, - FactorySelector common.Address, +type tBTCSystemSignerFeeDivisorUpdateStartedFunc func( + SignerFeeDivisor uint16, + Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdated( - success tBTCSystemKeepFactoriesUpdatedFunc, +func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdateStarted( + success tBTCSystemSignerFeeDivisorUpdateStartedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { errorChan := make(chan error) @@ -7845,7 +7810,7 @@ func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdated( return err } - subscription, err := tbtcs.subscribeKeepFactoriesUpdated( + subscription, err := tbtcs.subscribeSignerFeeDivisorUpdateStarted( success, failCallback, ) @@ -7867,7 +7832,7 @@ func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event KeepFactoriesUpdated terminated with error; " + + "subscription to event SignerFeeDivisorUpdateStarted terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7888,19 +7853,19 @@ func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdated( - success tBTCSystemKeepFactoriesUpdatedFunc, +func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdateStarted( + success tBTCSystemSignerFeeDivisorUpdateStartedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemKeepFactoriesUpdated) - eventSubscription, err := tbtcs.contract.WatchKeepFactoriesUpdated( + eventChan := make(chan *abi.TBTCSystemSignerFeeDivisorUpdateStarted) + eventSubscription, err := tbtcs.contract.WatchSignerFeeDivisorUpdateStarted( nil, eventChan, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for KeepFactoriesUpdated events: [%v]", + "error creating watch for SignerFeeDivisorUpdateStarted events: [%v]", err, ) } @@ -7918,9 +7883,8 @@ func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdated( return } success( - event.KeepStakedFactory, - event.FullyBackedFactory, - event.FactorySelector, + event.SignerFeeDivisor, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -7942,15 +7906,18 @@ func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemLotSizesUpdateStartedFunc func( - LotSizes []uint64, +type tBTCSystemRedeemedFunc func( + DepositContractAddress common.Address, + Txid [32]uint8, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchLotSizesUpdateStarted( - success tBTCSystemLotSizesUpdateStartedFunc, +func (tbtcs *TBTCSystem) WatchRedeemed( + success tBTCSystemRedeemedFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -7967,9 +7934,11 @@ func (tbtcs *TBTCSystem) WatchLotSizesUpdateStarted( return err } - subscription, err := tbtcs.subscribeLotSizesUpdateStarted( + subscription, err := tbtcs.subscribeRedeemed( success, failCallback, + _depositContractAddressFilter, + _txidFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -7989,7 +7958,7 @@ func (tbtcs *TBTCSystem) WatchLotSizesUpdateStarted( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event LotSizesUpdateStarted terminated with error; " + + "subscription to event Redeemed terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -8010,19 +7979,23 @@ func (tbtcs *TBTCSystem) WatchLotSizesUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeLotSizesUpdateStarted( - success tBTCSystemLotSizesUpdateStartedFunc, +func (tbtcs *TBTCSystem) subscribeRedeemed( + success tBTCSystemRedeemedFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemLotSizesUpdateStarted) - eventSubscription, err := tbtcs.contract.WatchLotSizesUpdateStarted( + eventChan := make(chan *abi.TBTCSystemRedeemed) + eventSubscription, err := tbtcs.contract.WatchRedeemed( nil, eventChan, + _depositContractAddressFilter, + _txidFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for LotSizesUpdateStarted events: [%v]", + "error creating watch for Redeemed events: [%v]", err, ) } @@ -8040,7 +8013,8 @@ func (tbtcs *TBTCSystem) subscribeLotSizesUpdateStarted( return } success( - event.LotSizes, + event.DepositContractAddress, + event.Txid, event.Timestamp, event.Raw.BlockNumber, ) @@ -8063,16 +8037,23 @@ func (tbtcs *TBTCSystem) subscribeLotSizesUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemSetupFailedFunc func( +type tBTCSystemRedemptionRequestedFunc func( DepositContractAddress common.Address, - Timestamp *big.Int, + Requester common.Address, + Digest [32]uint8, + UtxoValue *big.Int, + RedeemerOutputScript []uint8, + RequestedFee *big.Int, + Outpoint []uint8, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchSetupFailed( - success tBTCSystemSetupFailedFunc, +func (tbtcs *TBTCSystem) WatchRedemptionRequested( + success tBTCSystemRedemptionRequestedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _requesterFilter []common.Address, + _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -8089,10 +8070,12 @@ func (tbtcs *TBTCSystem) WatchSetupFailed( return err } - subscription, err := tbtcs.subscribeSetupFailed( + subscription, err := tbtcs.subscribeRedemptionRequested( success, failCallback, _depositContractAddressFilter, + _requesterFilter, + _digestFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -8112,7 +8095,7 @@ func (tbtcs *TBTCSystem) WatchSetupFailed( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event SetupFailed terminated with error; " + + "subscription to event RedemptionRequested terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -8133,21 +8116,25 @@ func (tbtcs *TBTCSystem) WatchSetupFailed( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeSetupFailed( - success tBTCSystemSetupFailedFunc, +func (tbtcs *TBTCSystem) subscribeRedemptionRequested( + success tBTCSystemRedemptionRequestedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _requesterFilter []common.Address, + _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemSetupFailed) - eventSubscription, err := tbtcs.contract.WatchSetupFailed( + eventChan := make(chan *abi.TBTCSystemRedemptionRequested) + eventSubscription, err := tbtcs.contract.WatchRedemptionRequested( nil, eventChan, _depositContractAddressFilter, + _requesterFilter, + _digestFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for SetupFailed events: [%v]", + "error creating watch for RedemptionRequested events: [%v]", err, ) } @@ -8166,7 +8153,12 @@ func (tbtcs *TBTCSystem) subscribeSetupFailed( } success( event.DepositContractAddress, - event.Timestamp, + event.Requester, + event.Digest, + event.UtxoValue, + event.RedeemerOutputScript, + event.RequestedFee, + event.Outpoint, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -8188,15 +8180,18 @@ func (tbtcs *TBTCSystem) subscribeSetupFailed( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemSignerFeeDivisorUpdateStartedFunc func( - SignerFeeDivisor uint16, +type tBTCSystemRegisteredPubkeyFunc func( + DepositContractAddress common.Address, + SigningGroupPubkeyX [32]uint8, + SigningGroupPubkeyY [32]uint8, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdateStarted( - success tBTCSystemSignerFeeDivisorUpdateStartedFunc, +func (tbtcs *TBTCSystem) WatchRegisteredPubkey( + success tBTCSystemRegisteredPubkeyFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -8213,9 +8208,10 @@ func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdateStarted( return err } - subscription, err := tbtcs.subscribeSignerFeeDivisorUpdateStarted( + subscription, err := tbtcs.subscribeRegisteredPubkey( success, failCallback, + _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -8235,7 +8231,7 @@ func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdateStarted( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event SignerFeeDivisorUpdateStarted terminated with error; " + + "subscription to event RegisteredPubkey terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -8256,19 +8252,21 @@ func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdateStarted( - success tBTCSystemSignerFeeDivisorUpdateStartedFunc, +func (tbtcs *TBTCSystem) subscribeRegisteredPubkey( + success tBTCSystemRegisteredPubkeyFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemSignerFeeDivisorUpdateStarted) - eventSubscription, err := tbtcs.contract.WatchSignerFeeDivisorUpdateStarted( + eventChan := make(chan *abi.TBTCSystemRegisteredPubkey) + eventSubscription, err := tbtcs.contract.WatchRegisteredPubkey( nil, eventChan, + _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for SignerFeeDivisorUpdateStarted events: [%v]", + "error creating watch for RegisteredPubkey events: [%v]", err, ) } @@ -8286,7 +8284,9 @@ func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdateStarted( return } success( - event.SignerFeeDivisor, + event.DepositContractAddress, + event.SigningGroupPubkeyX, + event.SigningGroupPubkeyY, event.Timestamp, event.Raw.BlockNumber, ) From 5f9077c7482657738e1a6aef3968b1d7dc7dad21 Mon Sep 17 00:00:00 2001 From: Lukasz Zimnoch Date: Tue, 20 Oct 2020 13:55:51 +0200 Subject: [PATCH 14/14] Tidy the go.mod --- go.sum | 710 ++------------------------------------------------------- 1 file changed, 22 insertions(+), 688 deletions(-) diff --git a/go.sum b/go.sum index 73ac54d61..e361e33fb 100644 --- a/go.sum +++ b/go.sum @@ -1,14 +1,4 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.37.0/go.mod h1:TS1dMSSfndXH133OKGwekG838Om/cQT0BUHV3HcBgoo= -dmitri.shuralyov.com/app/changes v0.0.0-20180602232624-0a106ad413e3/go.mod h1:Yl+fi1br7+Rr3LqpNJf1/uxUdtRUV+Tnj0o93V2B9MU= -dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBrvjyP0v+ecvNYvCpyZgu5/xkfAUhi6wJj28eUfSU= -dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= -dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= -git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= -github.com/AndreasBriese/bbloom v0.0.0-20180913140656-343706a395b7/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= @@ -24,9 +14,7 @@ github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6L github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/zstd v1.3.6-0.20190409195224-796139022798/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/Kubuxu/go-os-helper v0.0.1/go.mod h1:N8B+I7vPCT80IcP58r50u4+gEEcsZETFUpAzWW2ep1Y= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= github.com/Shopify/sarama v1.23.1/go.mod h1:XLH1GYJnLVE0XCr6KdJGVJRTwY30moWNJ4sERjXX6fs= @@ -34,92 +22,56 @@ github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMx github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/VictoriaMetrics/fastcache v1.5.3 h1:2odJnXLbFZcoV9KYtQ+7TH1UOq3dn3AssMgieaezkR4= github.com/VictoriaMetrics/fastcache v1.5.3/go.mod h1:+jv9Ckb+za/P1ZRg/sulP5Ni1v49daAVERr0H3CuscE= -github.com/VictoriaMetrics/fastcache v1.5.7 h1:4y6y0G8PRzszQUYIQHHssv/jgPHAb5qQuuDNdCbyAgw= -github.com/VictoriaMetrics/fastcache v1.5.7/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= +github.com/allegro/bigcache v1.2.1 h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKSc= github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/aristanetworks/fsnotify v1.4.2/go.mod h1:D/rtu7LpjYM8tRJphJ0hUBYpjai8SfX+aSNsWDTq/Ks= github.com/aristanetworks/glog v0.0.0-20180419172825-c15b03b3054f/go.mod h1:KASm+qXFKs/xjSoWn30NrWBBvdTTQq+UjkhjEJHfSFA= github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847 h1:rtI0fD4oG/8eVokGVPYJEW1F88p1ZNgXiEIs9thEE4A= github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ= github.com/aristanetworks/goarista v0.0.0-20190924011532-60b7b74727fd h1:2gXWYquahfk3RfmyLuMk47NCaf+1FFQ95FNM+HZN3Oo= github.com/aristanetworks/goarista v0.0.0-20190924011532-60b7b74727fd/go.mod h1:Z4RTxGAuYhPzcq8+EdRM+R8M48Ssle2TsWtwRKa+vns= -github.com/aristanetworks/goarista v0.0.0-20200206021550-59c4040ef2d3 h1:y1poWrL93oTYqikei1Sf8eBE6cJxNPr5wJcfxdgbuXQ= -github.com/aristanetworks/goarista v0.0.0-20200206021550-59c4040ef2d3/go.mod h1:Z4RTxGAuYhPzcq8+EdRM+R8M48Ssle2TsWtwRKa+vns= github.com/aristanetworks/splunk-hec-go v0.3.3/go.mod h1:1VHO9r17b0K7WmOlLb9nTk/2YanvOEnLMUgsFrxBROc= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/benbjohnson/clock v1.0.2/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= -github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnCiweXmzRIAiUWCInVmPgjkzgv5k4tVyXiQ= -github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= -github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= -github.com/btcsuite/btcd v0.0.0-20190824003749-130ea5bddde3/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.20.1-beta h1:Ik4hyJqN8Jfyv3S4AGBOmyouMsYE3EdYODkMbQjwPGw= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20190207003914-4c204d697803/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= +github.com/cespare/cp v1.1.1 h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU= github.com/cespare/cp v1.1.1/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.0.1-0.20190104013014-3767db7a7e18/go.mod h1:HD5P3vAIAh+Y2GAxg0PrPN1P8WkepXGpjbUPDHJqqKM= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= -github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davidlazar/go-crypto v0.0.0-20170701192655-dcfb0a7ac018/go.mod h1:rQYf4tfk5sSwFsnDg3qYaBxSjsD9S8+59vW0dKUgme4= -github.com/davidlazar/go-crypto v0.0.0-20190912175916-7055855a373f h1:BOaYiTvg8p9vBUXpklC22XSK/mifLF7lG9jtmYYi3Tc= -github.com/davidlazar/go-crypto v0.0.0-20190912175916-7055855a373f/go.mod h1:rQYf4tfk5sSwFsnDg3qYaBxSjsD9S8+59vW0dKUgme4= github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea h1:j4317fAZh7X6GqbFowYdYdI0L9bwxL07jyPZIdepyZ0= github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= github.com/deckarep/golang-set v1.7.1 h1:SCQV0S6gTtp6itiFrTqI+pfmJ4LN85S1YzhDf9rTHJQ= github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= -github.com/dgraph-io/badger v1.5.5-0.20190226225317-8115aed38f8f/go.mod h1:VZxzAIRPHRVNRKRo6AXrX9BJegn6il06VMTZVJYCIjQ= -github.com/dgraph-io/badger v1.6.0-rc1/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= -github.com/dgraph-io/badger v1.6.1/go.mod h1:FRmFw3uxvcpa8zG3Rxs0th+hCLIuaQg8HlNV5bjgnuU= -github.com/dgraph-io/ristretto v0.0.2/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= -github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dvyukov/go-fuzz v0.0.0-20200318091601-be3528f3a813/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= @@ -132,213 +84,90 @@ github.com/elastic/gosigar v0.10.5 h1:GzPQ+78RaAb4J63unidA/JavQRKrB6s8IOzN6Ib59j github.com/elastic/gosigar v0.10.5/go.mod h1:cdorVVzy1fhmEqmtgqkoE3bYtCfSCkVyjTyCIo22xvs= github.com/ethereum/go-ethereum v1.9.10 h1:jooX7tWcscpC7ytufk73t9JMCeJQ7aJF2YmZJQEuvFo= github.com/ethereum/go-ethereum v1.9.10/go.mod h1:lXHkVo/MTvsEXfYsmNzelZ8R1e0DTvdk/wMZJIRpaRw= -github.com/ethereum/go-ethereum v1.9.22 h1:/Fea9n2EWJuNJ9oahMq9luqjRBcbW7QWdThbcJl13ek= -github.com/ethereum/go-ethereum v1.9.22/go.mod h1:FQjK3ZwD8C5DYn7ukTmFee36rq1dOMESiUfXr5RUc1w= -github.com/facebookgo/atomicfile v0.0.0-20151019160806-2de1f203e7d5/go.mod h1:JpoxHjuQauoxiFMl1ie8Xc/7TfLuMZ5eOCONd1sUBHg= github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc h1:jtW8jbpkO4YirRSyepBOH8E+2HEw6/hKkBvFPwhUN8c= github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= -github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/garyburd/redigo v1.6.0/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8xV8uYKlyuj8XIruxlh9WjVjdh1gIicAS7ays= github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= -github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-kit/kit v0.8.0 h1:Wz+5lgoB0kkuqLEc6NVmwRknTKP6dTGbSqvhZtBI/j0= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= -github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2-0.20190517061210-b285ee9cfc6c/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0 h1:oOuy+ugB+P/kBdUnG5QaMXSIyJ1q38wWSojYCb3z5VQ= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.2-0.20200707131729-196ae77b8a26 h1:lMm2hD9Fy0ynom5+85/pbdkiYcBqM1JWmhpAXLmy0fw= -github.com/golang/snappy v0.0.2-0.20200707131729-196ae77b8a26/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gopacket v1.1.17/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= -github.com/google/gopacket v1.1.18 h1:lum7VRA9kdlvBi7/v2p7/zcbkduHaCH/SVVyurs7OpY= -github.com/google/gopacket v1.1.18/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0 h1:b4Gk+7WdP/d3HZH8EJsZpvV7EtDOgaZLtnaNGIu1adA= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= -github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989 h1:giknQ4mEuDFmmHSrGcbargOuLHQGtywqo4mheITex54= github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277 h1:E0whKxgp2ojts0FDgUA8dl62bmH0LxKanMoBr6MDTDM= github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= -github.com/gxed/hashland/keccakpg v0.0.1/go.mod h1:kRzw3HkwxFU1mpmPP8v1WyQzwdGfmKFJ6tItnhQ67kU= -github.com/gxed/hashland/murmur3 v0.0.1/go.mod h1:KjXop02n4/ckmZSnY2+HKcLud/tcmvhST0bie/0lS48= -github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= -github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/golang-lru v0.0.0-20160813221303-0a025b7e63ad/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/holiman/uint256 v1.1.1 h1:4JywC80b+/hSfljFlEBLHrrh+CIONLDz9NuFl0af4Mw= -github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huin/goupnp v0.0.0-20161224104101-679507af18f3/go.mod h1:MZ2ZmwcBpvOoJ22IJsc7va19ZwoheaBk43rKg12SKag= github.com/huin/goupnp v1.0.0 h1:wg75sLpL6DZqwHQN6E1Cfk6mtfzS45z8OV+ic+DtHRo= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883 h1:FSeK4fZCo8u40n2JMnyAsd6x7+SbvoOMHvQOU/n10P4= github.com/influxdata/influxdb v1.2.3-0.20180221223340-01288bdb0883/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY= github.com/influxdata/influxdb1-client v0.0.0-20190809212627-fc22c7df067e/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/ipfs/go-cid v0.0.1/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= -github.com/ipfs/go-cid v0.0.2/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= -github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= -github.com/ipfs/go-cid v0.0.4/go.mod h1:4LLaPOQwmk5z9LBgQnpkivrx8BJjUyGwTXCd5Xfj6+M= -github.com/ipfs/go-cid v0.0.5/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog= -github.com/ipfs/go-cid v0.0.6/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= -github.com/ipfs/go-cid v0.0.7 h1:ysQJVJA3fNDF1qigJbsSQOdjhVLsOEoPdh0+R97k3jY= -github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= -github.com/ipfs/go-datastore v0.0.1/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= -github.com/ipfs/go-datastore v0.1.0/go.mod h1:d4KVXhMt913cLBEI/PXAy6ko+W7e9AhyAKBGh803qeE= -github.com/ipfs/go-datastore v0.1.1/go.mod h1:w38XXW9kVFNp57Zj5knbKWM2T+KOZCGDRVNdgPHtbHw= -github.com/ipfs/go-datastore v0.4.0/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= -github.com/ipfs/go-datastore v0.4.1/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= -github.com/ipfs/go-datastore v0.4.4 h1:rjvQ9+muFaJ+QZ7dN5B1MSDNQ0JVZKkkES/rMZmA8X8= -github.com/ipfs/go-datastore v0.4.4/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= -github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= -github.com/ipfs/go-ds-badger v0.0.2/go.mod h1:Y3QpeSFWQf6MopLTiZD+VT6IC1yZqaGmjvRcKeSGij8= -github.com/ipfs/go-ds-badger v0.0.5/go.mod h1:g5AuuCGmr7efyzQhLL8MzwqcauPojGPUaHzfGTzuE3s= -github.com/ipfs/go-ds-badger v0.0.7/go.mod h1:qt0/fWzZDoPW6jpQeqUjR5kBfhDNB65jd9YlmAvpQBk= -github.com/ipfs/go-ds-badger v0.2.1/go.mod h1:Tx7l3aTph3FMFrRS838dcSJh+jjA7cX9DrGVwx/NOwE= -github.com/ipfs/go-ds-badger v0.2.3/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBRn4FS6UHUk= -github.com/ipfs/go-ds-leveldb v0.0.1/go.mod h1:feO8V3kubwsEF22n0YRQCffeb79OOYIykR4L04tMOYc= -github.com/ipfs/go-ds-leveldb v0.1.0/go.mod h1:hqAW8y4bwX5LWcCtku2rFNX3vjDZCy5LZCg+cSZvYb8= -github.com/ipfs/go-ds-leveldb v0.4.1/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= -github.com/ipfs/go-ds-leveldb v0.4.2/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= -github.com/ipfs/go-ipfs-addr v0.0.1 h1:DpDFybnho9v3/a1dzJ5KnWdThWD1HrFLpQ+tWIyBaFI= -github.com/ipfs/go-ipfs-addr v0.0.1/go.mod h1:uKTDljHT3Q3SUWzDLp3aYUi8MrY32fgNgogsIa0npjg= -github.com/ipfs/go-ipfs-config v0.0.4 h1:zOWk1gGvIOptjHvvu0qSC8psB2IBKO/FbQArFnmm0LM= -github.com/ipfs/go-ipfs-config v0.0.4/go.mod h1:KDbHjNyg4e6LLQSQpkgQMBz6Jf4LXiWAcmnkcwmH0DU= -github.com/ipfs/go-ipfs-delay v0.0.0-20181109222059-70721b86a9a8/go.mod h1:8SP1YXK1M1kXuc4KJZINY3TQQ03J2rwBG9QfXmbRPrw= -github.com/ipfs/go-ipfs-util v0.0.1/go.mod h1:spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc= -github.com/ipfs/go-ipfs-util v0.0.2 h1:59Sswnk1MFaiq+VcaknX7aYEyGyGDAA73ilhEK2POp8= -github.com/ipfs/go-ipfs-util v0.0.2/go.mod h1:CbPtkWJzjLdEcezDns2XYaehFVNXG9zrdrtMecczcsQ= -github.com/ipfs/go-ipns v0.0.2 h1:oq4ErrV4hNQ2Eim257RTYRgfOSV/s8BDaf9iIl4NwFs= -github.com/ipfs/go-ipns v0.0.2/go.mod h1:WChil4e0/m9cIINWLxZe1Jtf77oz5L05rO2ei/uKJ5U= github.com/ipfs/go-log v0.0.1 h1:9XTUN/rW64BCG1YhPK9Hoy3q8nr4gOmHHBpgFdfw6Lc= github.com/ipfs/go-log v0.0.1/go.mod h1:kL1d2/hzSpI0thNYjiKfjanbVNU+IIGA/WnNESY9leM= -github.com/ipfs/go-log v1.0.2/go.mod h1:1MNjMxe0u6xvJZgeqbJ8vdo2TKaGwZ1a0Bpza+sr2Sk= -github.com/ipfs/go-log v1.0.3/go.mod h1:OsLySYkwIbiSUR/yBTdv1qPtcE4FW3WPWk/ewz9Ru+A= github.com/ipfs/go-log v1.0.4 h1:6nLQdX4W8P9yZZFH7mO+X/PzjN8Laozm/lMJ6esdgzY= github.com/ipfs/go-log v1.0.4/go.mod h1:oDCg2FkjogeFOhqqb+N39l2RpTNPL6F/StPkB3kPgcs= -github.com/ipfs/go-log/v2 v2.0.2/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBWFaa9+0= -github.com/ipfs/go-log/v2 v2.0.3/go.mod h1:O7P1lJt27vWHhOwQmcFEvlmo49ry2VY2+JfBWFaa9+0= github.com/ipfs/go-log/v2 v2.0.5 h1:fL4YI+1g5V/b1Yxr1qAiXTMg1H8z9vx/VmJxBuQMHvU= github.com/ipfs/go-log/v2 v2.0.5/go.mod h1:eZs4Xt4ZUJQFM3DlanGhy7TkwwawCZcSByscwkWG+dw= -github.com/ipfs/go-log/v2 v2.1.1 h1:G4TtqN+V9y9HY9TA6BwbCVyyBZ2B9MbCjR2MtGx8FR0= -github.com/ipfs/go-log/v2 v2.1.1/go.mod h1:2v2nsGfZsvvAJz13SyFzf9ObaqwHiHxsPLEHntrv9KM= -github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA= -github.com/jackpal/go-nat-pmp v1.0.1/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458 h1:6OvNmYgJyexcZ3pYbTI9jWx5tHo1Dee/tWbLMfPe2TA= github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jbenet/go-cienv v0.0.0-20150120210510-1bb1476777ec/go.mod h1:rGaEvXB4uRSZMmzKNLoXvTu1sfx+1kv/DojUlPrSZGs= -github.com/jbenet/go-cienv v0.1.0/go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA= -github.com/jbenet/go-temp-err-catcher v0.0.0-20150120210811-aac704a3f4f2/go.mod h1:8GXXJV31xl8whumTzdZsTt3RnUIiPqzkyf7mxToRCMs= -github.com/jbenet/go-temp-err-catcher v0.1.0 h1:zpb3ZH6wIE8Shj2sKS+khgRvf7T7RABoLk/+KKHggpk= -github.com/jbenet/go-temp-err-catcher v0.1.0/go.mod h1:0kJRvmDZXNMIiJirNPEYfhpPwbGVtZVWC34vc5WLsDk= -github.com/jbenet/goprocess v0.0.0-20160826012719-b497e2f366b8/go.mod h1:Ly/wlsjFq/qrU3Rar62tu1gASgGw6chQbSh/XgIIXCY= -github.com/jbenet/goprocess v0.1.3/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= -github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0o= -github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= -github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d/go.mod h1:P2viExyCEfeWGU259JnaQ34Inuec4R38JCyBx2edgD0= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 h1:I/yrLt2WilKxlQKCM52clh5rGzTKpVctGT1lH4Dc8Jw= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= github.com/karalabe/usb v0.0.0-20191104083709-911d15fe12a9 h1:ZHuwnjpP8LsVsUYqTqeVAI+GfDfJ6UNPrExZF+vX/DQ= github.com/karalabe/usb v0.0.0-20191104083709-911d15fe12a9/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/keep-network/go-libp2p-bootstrap v0.0.0-20200423153828-ed815bc50aec h1:2pXAsi4OUUjZKr5ds5UOF2IxXN+jVW0WetVO+czkf+A= -github.com/keep-network/go-libp2p-bootstrap v0.0.0-20200423153828-ed815bc50aec/go.mod h1:xR8jf3/VJAjh3nWu5tFe8Yxnt2HvWsqZHfGef1P5oDk= -github.com/keep-network/keep-common v1.2.0 h1:hVd2tTd7vL+9CQP5Ntk5kjs+GYvkgrRNBcNvTuhHhVk= -github.com/keep-network/keep-common v1.2.0/go.mod h1:emxogTbBdey7M3jOzfxZOdfn139kN2mI2b2wA6AHKKo= -github.com/keep-network/keep-common v1.2.1-0.20201015091820-496b0c87d6f5 h1:HCQv0+3IhaH1zvRQ2cAinKK+HJCASI41EpZuUMKD278= -github.com/keep-network/keep-common v1.2.1-0.20201015091820-496b0c87d6f5/go.mod h1:emxogTbBdey7M3jOzfxZOdfn139kN2mI2b2wA6AHKKo= github.com/keep-network/keep-common v1.2.1-0.20201020114759-19c123cbd4f4 h1:CivupPSFswHACua5xZGKdeYxsCQ2cmRomTIBh8kfk70= github.com/keep-network/keep-common v1.2.1-0.20201020114759-19c123cbd4f4/go.mod h1:emxogTbBdey7M3jOzfxZOdfn139kN2mI2b2wA6AHKKo= -github.com/keep-network/keep-core v1.3.0 h1:7Tb33EmO/ntHOEbOiYciRlBhqu5Ln6KemWCaYK0Z6LA= -github.com/keep-network/keep-core v1.3.0/go.mod h1:1KsSSTQoN754TrFLW7kLy50pOG2CQ4BOfnJqdvEG7FA= -github.com/keep-network/tbtc v1.1.0 h1:9ZCuBsrJYN1L1V7bAC98ZAtxv+ZIHcMhz6RJLAizLvY= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -346,314 +175,35 @@ github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6 github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/reedsolomon v1.9.2/go.mod h1:CwCi+NUr9pqSVktrkN+Ondf06rkhYZ/pcNv7fu+8Un4= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/koron/go-ssdp v0.0.0-20191105050749-2e1c40ed0b5d h1:68u9r4wEvL3gYg2jvAOgROwZ3H+Y3hIDk4tbbmIjcYQ= -github.com/koron/go-ssdp v0.0.0-20191105050749-2e1c40ed0b5d/go.mod h1:5Ky9EC2xfoUKUor0Hjgi2BJhCSXJfMOFlmyYrVKGQMk= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/libp2p/go-addr-util v0.0.1/go.mod h1:4ac6O7n9rIAKB1dnd+s8IbbMXkt+oBpzX4/+RACcnlQ= -github.com/libp2p/go-addr-util v0.0.2 h1:7cWK5cdA5x72jX0g8iLrQWm5TRJZ6CzGdPEhWj7plWU= -github.com/libp2p/go-addr-util v0.0.2/go.mod h1:Ecd6Fb3yIuLzq4bD7VcywcVSBtefcAwnUISBM3WG15E= -github.com/libp2p/go-buffer-pool v0.0.1/go.mod h1:xtyIz9PMobb13WaxR6Zo1Pd1zXJKYg0a8KiIvDp3TzQ= -github.com/libp2p/go-buffer-pool v0.0.2 h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs= -github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= -github.com/libp2p/go-conn-security-multistream v0.1.0/go.mod h1:aw6eD7LOsHEX7+2hJkDxw1MteijaVcI+/eP2/x3J1xc= -github.com/libp2p/go-conn-security-multistream v0.2.0 h1:uNiDjS58vrvJTg9jO6bySd1rMKejieG7v45ekqHbZ1M= -github.com/libp2p/go-conn-security-multistream v0.2.0/go.mod h1:hZN4MjlNetKD3Rq5Jb/P5ohUnFLNzEAR4DLSzpn2QLU= -github.com/libp2p/go-eventbus v0.1.0/go.mod h1:vROgu5cs5T7cv7POWlWxBaVLxfSegC5UGQf8A2eEmx4= -github.com/libp2p/go-eventbus v0.2.1 h1:VanAdErQnpTioN2TowqNcOijf6YwhuODe4pPKSDpxGc= -github.com/libp2p/go-eventbus v0.2.1/go.mod h1:jc2S4SoEVPP48H9Wpzm5aiGwUCBMfGhVhhBjyhhCJs8= -github.com/libp2p/go-flow-metrics v0.0.1/go.mod h1:Iv1GH0sG8DtYN3SVJ2eG221wMiNpZxBdp967ls1g+k8= -github.com/libp2p/go-flow-metrics v0.0.2/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs= -github.com/libp2p/go-flow-metrics v0.0.3 h1:8tAs/hSdNvUiLgtlSy3mxwxWP4I9y/jlkPFT7epKdeM= -github.com/libp2p/go-flow-metrics v0.0.3/go.mod h1:HeoSNUrOJVK1jEpDqVEiUOIXqhbnS27omG0uWU5slZs= -github.com/libp2p/go-libp2p v0.6.1/go.mod h1:CTFnWXogryAHjXAKEbOf1OWY+VeAP3lDMZkfEI5sT54= -github.com/libp2p/go-libp2p v0.7.0/go.mod h1:hZJf8txWeCduQRDC/WSqBGMxaTHCOYHt2xSU1ivxn0k= -github.com/libp2p/go-libp2p v0.7.4/go.mod h1:oXsBlTLF1q7pxr+9w6lqzS1ILpyHsaBPniVO7zIHGMw= -github.com/libp2p/go-libp2p v0.8.3/go.mod h1:EsH1A+8yoWK+L4iKcbPYu6MPluZ+CHWI9El8cTaefiM= -github.com/libp2p/go-libp2p v0.10.0/go.mod h1:yBJNpb+mGJdgrwbKAKrhPU0u3ogyNFTfjJ6bdM+Q/G8= -github.com/libp2p/go-libp2p v0.10.3 h1:Bc8/VjmC+pICtK6xG8YgVutZvCdK0MsroWCHP+6AdFQ= -github.com/libp2p/go-libp2p v0.10.3/go.mod h1:0ER6iPSaPeQjryNgOnm9bLNpMJCYmuw54xJXsVR17eE= -github.com/libp2p/go-libp2p-autonat v0.1.1/go.mod h1:OXqkeGOY2xJVWKAGV2inNF5aKN/djNA3fdpCWloIudE= -github.com/libp2p/go-libp2p-autonat v0.2.0/go.mod h1:DX+9teU4pEEoZUqR1PiMlqliONQdNbfzE1C718tcViI= -github.com/libp2p/go-libp2p-autonat v0.2.1/go.mod h1:MWtAhV5Ko1l6QBsHQNSuM6b1sRkXrpk0/LqCr+vCVxI= -github.com/libp2p/go-libp2p-autonat v0.2.2/go.mod h1:HsM62HkqZmHR2k1xgX34WuWDzk/nBwNHoeyyT4IWV6A= -github.com/libp2p/go-libp2p-autonat v0.2.3/go.mod h1:2U6bNWCNsAG9LEbwccBDQbjzQ8Krdjge1jLTE9rdoMM= -github.com/libp2p/go-libp2p-autonat v0.3.2 h1:OhDSwVVaq7liTaRIsFFYvsaPp0pn2yi0WazejZ4DUmo= -github.com/libp2p/go-libp2p-autonat v0.3.2/go.mod h1:0OzOi1/cVc7UcxfOddemYD5vzEqi4fwRbnZcJGLi68U= -github.com/libp2p/go-libp2p-blankhost v0.1.1/go.mod h1:pf2fvdLJPsC1FsVrNP3DUUvMzUts2dsLLBEpo1vW1ro= -github.com/libp2p/go-libp2p-blankhost v0.1.4/go.mod h1:oJF0saYsAXQCSfDq254GMNmLNz6ZTHTOvtF4ZydUvwU= -github.com/libp2p/go-libp2p-blankhost v0.1.6/go.mod h1:jONCAJqEP+Z8T6EQviGL4JsQcLx1LgTGtVqFNY8EMfQ= -github.com/libp2p/go-libp2p-blankhost v0.2.0 h1:3EsGAi0CBGcZ33GwRuXEYJLLPoVWyXJ1bcJzAJjINkk= -github.com/libp2p/go-libp2p-blankhost v0.2.0/go.mod h1:eduNKXGTioTuQAUcZ5epXi9vMl+t4d8ugUBRQ4SqaNQ= -github.com/libp2p/go-libp2p-circuit v0.1.4/go.mod h1:CY67BrEjKNDhdTk8UgBX1Y/H5c3xkAcs3gnksxY7osU= -github.com/libp2p/go-libp2p-circuit v0.2.1/go.mod h1:BXPwYDN5A8z4OEY9sOfr2DUQMLQvKt/6oku45YUmjIo= -github.com/libp2p/go-libp2p-circuit v0.2.2/go.mod h1:nkG3iE01tR3FoQ2nMm06IUrCpCyJp1Eo4A1xYdpjfs4= -github.com/libp2p/go-libp2p-circuit v0.2.3/go.mod h1:nkG3iE01tR3FoQ2nMm06IUrCpCyJp1Eo4A1xYdpjfs4= -github.com/libp2p/go-libp2p-circuit v0.3.1 h1:69ENDoGnNN45BNDnBd+8SXSetDuw0eJFcGmOvvtOgBw= -github.com/libp2p/go-libp2p-circuit v0.3.1/go.mod h1:8RMIlivu1+RxhebipJwFDA45DasLx+kkrp4IlJj53F4= -github.com/libp2p/go-libp2p-connmgr v0.2.4 h1:TMS0vc0TCBomtQJyWr7fYxcVYYhx+q/2gF++G5Jkl/w= -github.com/libp2p/go-libp2p-connmgr v0.2.4/go.mod h1:YV0b/RIm8NGPnnNWM7hG9Q38OeQiQfKhHCCs1++ufn0= -github.com/libp2p/go-libp2p-core v0.0.1/go.mod h1:g/VxnTZ/1ygHxH3dKok7Vno1VfpvGcGip57wjTU4fco= -github.com/libp2p/go-libp2p-core v0.0.4/go.mod h1:jyuCQP356gzfCFtRKyvAbNkyeuxb7OlyhWZ3nls5d2I= -github.com/libp2p/go-libp2p-core v0.2.0/go.mod h1:X0eyB0Gy93v0DZtSYbEM7RnMChm9Uv3j7yRXjO77xSI= -github.com/libp2p/go-libp2p-core v0.2.2/go.mod h1:8fcwTbsG2B+lTgRJ1ICZtiM5GWCWZVoVrLaDRvIRng0= -github.com/libp2p/go-libp2p-core v0.2.4/go.mod h1:STh4fdfa5vDYr0/SzYYeqnt+E6KfEV5VxfIrm0bcI0g= -github.com/libp2p/go-libp2p-core v0.2.5/go.mod h1:6+5zJmKhsf7yHn1RbmYDu08qDUpIUxGdqHuEZckmZOA= -github.com/libp2p/go-libp2p-core v0.3.0/go.mod h1:ACp3DmS3/N64c2jDzcV429ukDpicbL6+TrrxANBjPGw= -github.com/libp2p/go-libp2p-core v0.3.1/go.mod h1:thvWy0hvaSBhnVBaW37BvzgVV68OUhgJJLAa6almrII= -github.com/libp2p/go-libp2p-core v0.4.0/go.mod h1:49XGI+kc38oGVwqSBhDEwytaAxgZasHhFfQKibzTls0= -github.com/libp2p/go-libp2p-core v0.5.0/go.mod h1:49XGI+kc38oGVwqSBhDEwytaAxgZasHhFfQKibzTls0= -github.com/libp2p/go-libp2p-core v0.5.1/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= -github.com/libp2p/go-libp2p-core v0.5.2/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= -github.com/libp2p/go-libp2p-core v0.5.3/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= -github.com/libp2p/go-libp2p-core v0.5.4/go.mod h1:uN7L2D4EvPCvzSH5SrhR72UWbnSGpt5/a35Sm4upn4Y= -github.com/libp2p/go-libp2p-core v0.5.5/go.mod h1:vj3awlOr9+GMZJFH9s4mpt9RHHgGqeHCopzbYKZdRjM= -github.com/libp2p/go-libp2p-core v0.5.6/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= -github.com/libp2p/go-libp2p-core v0.5.7/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= -github.com/libp2p/go-libp2p-core v0.6.0/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX0bJvM49Ykaswo= -github.com/libp2p/go-libp2p-core v0.6.1 h1:XS+Goh+QegCDojUZp00CaPMfiEADCrLjNZskWE7pvqs= -github.com/libp2p/go-libp2p-core v0.6.1/go.mod h1:FfewUH/YpvWbEB+ZY9AQRQ4TAD8sJBt/G1rVvhz5XT8= -github.com/libp2p/go-libp2p-crypto v0.0.1/go.mod h1:yJkNyDmO341d5wwXxDUGO0LykUVT72ImHNUqh5D/dBE= -github.com/libp2p/go-libp2p-crypto v0.1.0 h1:k9MFy+o2zGDNGsaoZl0MA3iZ75qXxr9OOoAZF+sD5OQ= -github.com/libp2p/go-libp2p-crypto v0.1.0/go.mod h1:sPUokVISZiy+nNuTTH/TY+leRSxnFj/2GLjtOTW90hI= -github.com/libp2p/go-libp2p-discovery v0.2.0/go.mod h1:s4VGaxYMbw4+4+tsoQTqh7wfxg97AEdo4GYBt6BadWg= -github.com/libp2p/go-libp2p-discovery v0.3.0/go.mod h1:o03drFnz9BVAZdzC/QUQ+NeQOu38Fu7LJGEOK2gQltw= -github.com/libp2p/go-libp2p-discovery v0.4.0/go.mod h1:bZ0aJSrFc/eX2llP0ryhb1kpgkPyTo23SJ5b7UQCMh4= -github.com/libp2p/go-libp2p-discovery v0.5.0 h1:Qfl+e5+lfDgwdrXdu4YNCWyEo3fWuP+WgN9mN0iWviQ= -github.com/libp2p/go-libp2p-discovery v0.5.0/go.mod h1:+srtPIU9gDaBNu//UHvcdliKBIcr4SfDcm0/PfPJLug= -github.com/libp2p/go-libp2p-host v0.1.0 h1:OZwENiFm6JOK3YR5PZJxkXlJE8a5u8g4YvAUrEV2MjM= -github.com/libp2p/go-libp2p-host v0.1.0/go.mod h1:5+fWuLbDn8OxoxPN3CV0vsLe1hAKScSMbT84qRfxum8= -github.com/libp2p/go-libp2p-kad-dht v0.8.3 h1:ceK5ML6s/I8UAcw6veoNsuEHdHvfo88leU/5uWOIFWs= -github.com/libp2p/go-libp2p-kad-dht v0.8.3/go.mod h1:HnYYy8taJWESkqiESd1ngb9XX/XGGsMA5G0Vj2HoSh4= -github.com/libp2p/go-libp2p-kbucket v0.4.2 h1:wg+VPpCtY61bCasGRexCuXOmEmdKjN+k1w+JtTwu9gA= -github.com/libp2p/go-libp2p-kbucket v0.4.2/go.mod h1:7sCeZx2GkNK1S6lQnGUW5JYZCFPnXzAZCCBBS70lytY= -github.com/libp2p/go-libp2p-loggables v0.1.0 h1:h3w8QFfCt2UJl/0/NW4K829HX/0S4KD31PQ7m8UXXO8= -github.com/libp2p/go-libp2p-loggables v0.1.0/go.mod h1:EyumB2Y6PrYjr55Q3/tiJ/o3xoDasoRYM7nOzEpoa90= -github.com/libp2p/go-libp2p-mplex v0.2.0/go.mod h1:Ejl9IyjvXJ0T9iqUTE1jpYATQ9NM3g+OtR+EMMODbKo= -github.com/libp2p/go-libp2p-mplex v0.2.1/go.mod h1:SC99Rxs8Vuzrf/6WhmH41kNn13TiYdAWNYHrwImKLnE= -github.com/libp2p/go-libp2p-mplex v0.2.2/go.mod h1:74S9eum0tVQdAfFiKxAyKzNdSuLqw5oadDq7+L/FELo= -github.com/libp2p/go-libp2p-mplex v0.2.3/go.mod h1:CK3p2+9qH9x+7ER/gWWDYJ3QW5ZxWDkm+dVvjfuG3ek= -github.com/libp2p/go-libp2p-mplex v0.2.4 h1:XFFXaN4jhqnIuJVjYOR3k6bnRj0mFfJOlIuDVww+4Zo= -github.com/libp2p/go-libp2p-mplex v0.2.4/go.mod h1:mI7iOezdWFOisvUwaYd3IDrJ4oVmgoXK8H331ui39CE= -github.com/libp2p/go-libp2p-nat v0.0.5/go.mod h1:1qubaE5bTZMJE+E/uu2URroMbzdubFz1ChgiN79yKPE= -github.com/libp2p/go-libp2p-nat v0.0.6 h1:wMWis3kYynCbHoyKLPBEMu4YRLltbm8Mk08HGSfvTkU= -github.com/libp2p/go-libp2p-nat v0.0.6/go.mod h1:iV59LVhB3IkFvS6S6sauVTSOrNEANnINbI/fkaLimiw= -github.com/libp2p/go-libp2p-net v0.1.0 h1:3t23V5cR4GXcNoFriNoZKFdUZEUDZgUkvfwkD2INvQE= -github.com/libp2p/go-libp2p-net v0.1.0/go.mod h1:R5VZbutk75tkC5YJJS61OCO1NWoajxYjCEV2RoHh3FY= -github.com/libp2p/go-libp2p-netutil v0.1.0/go.mod h1:3Qv/aDqtMLTUyQeundkKsA+YCThNdbQD54k3TqjpbFU= -github.com/libp2p/go-libp2p-peer v0.0.1/go.mod h1:nXQvOBbwVqoP+T5Y5nCjeH4sP9IX/J0AMzcDUVruVoo= -github.com/libp2p/go-libp2p-peer v0.2.0 h1:EQ8kMjaCUwt/Y5uLgjT8iY2qg0mGUT0N1zUjer50DsY= -github.com/libp2p/go-libp2p-peer v0.2.0/go.mod h1:RCffaCvUyW2CJmG2gAWVqwePwW7JMgxjsHm7+J5kjWY= -github.com/libp2p/go-libp2p-peerstore v0.0.1/go.mod h1:RabLyPVJLuNQ+GFyoEkfi8H4Ti6k/HtZJ7YKgtSq+20= -github.com/libp2p/go-libp2p-peerstore v0.1.0/go.mod h1:2CeHkQsr8svp4fZ+Oi9ykN1HBb6u0MOvdJ7YIsmcwtY= -github.com/libp2p/go-libp2p-peerstore v0.1.3/go.mod h1:BJ9sHlm59/80oSkpWgr1MyY1ciXAXV397W6h1GH/uKI= -github.com/libp2p/go-libp2p-peerstore v0.1.4/go.mod h1:+4BDbDiiKf4PzpANZDAT+knVdLxvqh7hXOujessqdzs= -github.com/libp2p/go-libp2p-peerstore v0.2.0/go.mod h1:N2l3eVIeAitSg3Pi2ipSrJYnqhVnMNQZo9nkSCuAbnQ= -github.com/libp2p/go-libp2p-peerstore v0.2.1/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRjwRLBr4TYKfNgrUkOPA= -github.com/libp2p/go-libp2p-peerstore v0.2.2/go.mod h1:NQxhNjWxf1d4w6PihR8btWIRjwRLBr4TYKfNgrUkOPA= -github.com/libp2p/go-libp2p-peerstore v0.2.3/go.mod h1:K8ljLdFn590GMttg/luh4caB/3g0vKuY01psze0upRw= -github.com/libp2p/go-libp2p-peerstore v0.2.4/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= -github.com/libp2p/go-libp2p-peerstore v0.2.6 h1:2ACefBX23iMdJU9Ke+dcXt3w86MIryes9v7In4+Qq3U= -github.com/libp2p/go-libp2p-peerstore v0.2.6/go.mod h1:ss/TWTgHZTMpsU/oKVVPQCGuDHItOpf2W8RxAi50P2s= -github.com/libp2p/go-libp2p-pnet v0.2.0 h1:J6htxttBipJujEjz1y0a5+eYoiPcFHhSYHH6na5f0/k= -github.com/libp2p/go-libp2p-pnet v0.2.0/go.mod h1:Qqvq6JH/oMZGwqs3N1Fqhv8NVhrdYcO0BW4wssv21LA= -github.com/libp2p/go-libp2p-pubsub v0.3.3 h1:/AzOAmjDc+IJWybEzhYj1UaV1HErqmo4v3pQVepbgi8= -github.com/libp2p/go-libp2p-pubsub v0.3.3/go.mod h1:DTMSVmZZfXodB/pvdTGrY2eHPZ9W2ev7hzTH83OKHrI= -github.com/libp2p/go-libp2p-quic-transport v0.5.0/go.mod h1:IEcuC5MLxvZ5KuHKjRu+dr3LjCT1Be3rcD/4d8JrX8M= -github.com/libp2p/go-libp2p-record v0.1.2/go.mod h1:pal0eNcT5nqZaTV7UGhqeGqxFgGdsU/9W//C8dqjQDk= -github.com/libp2p/go-libp2p-record v0.1.3 h1:R27hoScIhQf/A8XJZ8lYpnqh9LatJ5YbHs28kCIfql0= -github.com/libp2p/go-libp2p-record v0.1.3/go.mod h1:yNUff/adKIfPnYQXgp6FQmNu3gLJ6EMg7+/vv2+9pY4= -github.com/libp2p/go-libp2p-routing v0.0.1/go.mod h1:N51q3yTr4Zdr7V8Jt2JIktVU+3xBBylx1MZeVA6t1Ys= -github.com/libp2p/go-libp2p-routing v0.1.0 h1:hFnj3WR3E2tOcKaGpyzfP4gvFZ3t8JkQmbapN0Ct+oU= -github.com/libp2p/go-libp2p-routing v0.1.0/go.mod h1:zfLhI1RI8RLEzmEaaPwzonRvXeeSHddONWkcTcB54nE= -github.com/libp2p/go-libp2p-routing-helpers v0.2.3/go.mod h1:795bh+9YeoFl99rMASoiVgHdi5bjack0N1+AFAdbvBw= -github.com/libp2p/go-libp2p-secio v0.1.0/go.mod h1:tMJo2w7h3+wN4pgU2LSYeiKPrfqBgkOsdiKK77hE7c8= -github.com/libp2p/go-libp2p-secio v0.2.0/go.mod h1:2JdZepB8J5V9mBp79BmwsaPQhRPNN2NrnB2lKQcdy6g= -github.com/libp2p/go-libp2p-secio v0.2.1/go.mod h1:cWtZpILJqkqrSkiYcDBh5lA3wbT2Q+hz3rJQq3iftD8= -github.com/libp2p/go-libp2p-secio v0.2.2 h1:rLLPvShPQAcY6eNurKNZq3eZjPWfU9kXF2eI9jIYdrg= -github.com/libp2p/go-libp2p-secio v0.2.2/go.mod h1:wP3bS+m5AUnFA+OFO7Er03uO1mncHG0uVwGrwvjYlNY= -github.com/libp2p/go-libp2p-swarm v0.1.0/go.mod h1:wQVsCdjsuZoc730CgOvh5ox6K8evllckjebkdiY5ta4= -github.com/libp2p/go-libp2p-swarm v0.2.2/go.mod h1:fvmtQ0T1nErXym1/aa1uJEyN7JzaTNyBcHImCxRpPKU= -github.com/libp2p/go-libp2p-swarm v0.2.3/go.mod h1:P2VO/EpxRyDxtChXz/VPVXyTnszHvokHKRhfkEgFKNM= -github.com/libp2p/go-libp2p-swarm v0.2.7/go.mod h1:ZSJ0Q+oq/B1JgfPHJAT2HTall+xYRNYp1xs4S2FBWKA= -github.com/libp2p/go-libp2p-swarm v0.2.8 h1:cIUUvytBzNQmGSjnXFlI6UpoBGsaud82mJPIJVfkDlg= -github.com/libp2p/go-libp2p-swarm v0.2.8/go.mod h1:JQKMGSth4SMqonruY0a8yjlPVIkb0mdNSwckW7OYziM= -github.com/libp2p/go-libp2p-testing v0.0.2/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= -github.com/libp2p/go-libp2p-testing v0.0.3/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= -github.com/libp2p/go-libp2p-testing v0.0.4/go.mod h1:gvchhf3FQOtBdr+eFUABet5a4MBLK8jM3V4Zghvmi+E= -github.com/libp2p/go-libp2p-testing v0.1.0/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0= -github.com/libp2p/go-libp2p-testing v0.1.1/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0= -github.com/libp2p/go-libp2p-testing v0.1.2-0.20200422005655-8775583591d8/go.mod h1:Qy8sAncLKpwXtS2dSnDOP8ktexIAHKu+J+pnZOFZLTc= -github.com/libp2p/go-libp2p-tls v0.1.3 h1:twKMhMu44jQO+HgQK9X8NHO5HkeJu2QbhLzLJpa8oNM= -github.com/libp2p/go-libp2p-tls v0.1.3/go.mod h1:wZfuewxOndz5RTnCAxFliGjvYSDA40sKitV4c50uI1M= -github.com/libp2p/go-libp2p-transport-upgrader v0.1.1/go.mod h1:IEtA6or8JUbsV07qPW4r01GnTenLW4oi3lOPbUMGJJA= -github.com/libp2p/go-libp2p-transport-upgrader v0.2.0/go.mod h1:mQcrHj4asu6ArfSoMuyojOdjx73Q47cYD7s5+gZOlns= -github.com/libp2p/go-libp2p-transport-upgrader v0.3.0 h1:q3ULhsknEQ34eVDhv4YwKS8iet69ffs9+Fir6a7weN4= -github.com/libp2p/go-libp2p-transport-upgrader v0.3.0/go.mod h1:i+SKzbRnvXdVbU3D1dwydnTmKRPXiAR/fyvi1dXuL4o= -github.com/libp2p/go-libp2p-yamux v0.2.0/go.mod h1:Db2gU+XfLpm6E4rG5uGCFX6uXA8MEXOxFcRoXUODaK8= -github.com/libp2p/go-libp2p-yamux v0.2.2/go.mod h1:lIohaR0pT6mOt0AZ0L2dFze9hds9Req3OfS+B+dv4qw= -github.com/libp2p/go-libp2p-yamux v0.2.5/go.mod h1:Zpgj6arbyQrmZ3wxSZxfBmbdnWtbZ48OpsfmQVTErwA= -github.com/libp2p/go-libp2p-yamux v0.2.7/go.mod h1:X28ENrBMU/nm4I3Nx4sZ4dgjZ6VhLEn0XhIoZ5viCwU= -github.com/libp2p/go-libp2p-yamux v0.2.8 h1:0s3ELSLu2O7hWKfX1YjzudBKCP0kZ+m9e2+0veXzkn4= -github.com/libp2p/go-libp2p-yamux v0.2.8/go.mod h1:/t6tDqeuZf0INZMTgd0WxIRbtK2EzI2h7HbFm9eAKI4= -github.com/libp2p/go-maddr-filter v0.0.4/go.mod h1:6eT12kSQMA9x2pvFQa+xesMKUBlj9VImZbj3B9FBH/Q= -github.com/libp2p/go-maddr-filter v0.0.5/go.mod h1:Jk+36PMfIqCJhAnaASRH83bdAvfDRp/w6ENFaC9bG+M= -github.com/libp2p/go-mplex v0.0.3/go.mod h1:pK5yMLmOoBR1pNCqDlA2GQrdAVTMkqFalaTWe7l4Yd0= -github.com/libp2p/go-mplex v0.1.0/go.mod h1:SXgmdki2kwCUlCCbfGLEgHjC4pFqhTp0ZoV6aiKgxDU= -github.com/libp2p/go-mplex v0.1.1/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3SFXI1lk= -github.com/libp2p/go-mplex v0.1.2 h1:qOg1s+WdGLlpkrczDqmhYzyk3vCfsQ8+RxRTQjOZWwI= -github.com/libp2p/go-mplex v0.1.2/go.mod h1:Xgz2RDCi3co0LeZfgjm4OgUF15+sVR8SRcu3SFXI1lk= -github.com/libp2p/go-msgio v0.0.2/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= -github.com/libp2p/go-msgio v0.0.4/go.mod h1:63lBBgOTDKQL6EWazRMCwXsEeEeK9O2Cd+0+6OOuipQ= -github.com/libp2p/go-msgio v0.0.6 h1:lQ7Uc0kS1wb1EfRxO2Eir/RJoHkHn7t6o+EiwsYIKJA= -github.com/libp2p/go-msgio v0.0.6/go.mod h1:4ecVB6d9f4BDSL5fqvPiC4A3KivjWn+Venn/1ALLMWA= -github.com/libp2p/go-nat v0.0.4/go.mod h1:Nmw50VAvKuk38jUBcmNh6p9lUJLoODbJRvYAa/+KSDo= -github.com/libp2p/go-nat v0.0.5 h1:qxnwkco8RLKqVh1NmjQ+tJ8p8khNLFxuElYG/TwqW4Q= -github.com/libp2p/go-nat v0.0.5/go.mod h1:B7NxsVNPZmRLvMOwiEO1scOSyjA56zxYAGv1yQgRkEU= -github.com/libp2p/go-netroute v0.1.2/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= -github.com/libp2p/go-netroute v0.1.3 h1:1ngWRx61us/EpaKkdqkMjKk/ufr/JlIFYQAxV2XX8Ig= -github.com/libp2p/go-netroute v0.1.3/go.mod h1:jZLDV+1PE8y5XxBySEBgbuVAXbhtuHSdmLPL2n9MKbk= -github.com/libp2p/go-openssl v0.0.2/go.mod h1:v8Zw2ijCSWBQi8Pq5GAixw6DbFfa9u6VIYDXnvOXkc0= -github.com/libp2p/go-openssl v0.0.3/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= -github.com/libp2p/go-openssl v0.0.4/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= -github.com/libp2p/go-openssl v0.0.5/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= -github.com/libp2p/go-openssl v0.0.7/go.mod h1:unDrJpgy3oFr+rqXsarWifmJuNnJR4chtO1HmaZjggc= -github.com/libp2p/go-reuseport v0.0.1 h1:7PhkfH73VXfPJYKQ6JwS5I/eVcoyYi9IMNGc6FWpFLw= -github.com/libp2p/go-reuseport v0.0.1/go.mod h1:jn6RmB1ufnQwl0Q1f+YxAj8isJgDCQzaaxIFYDhcYEA= -github.com/libp2p/go-reuseport-transport v0.0.2/go.mod h1:YkbSDrvjUVDL6b8XqriyA20obEtsW9BLkuOUyQAOCbs= -github.com/libp2p/go-reuseport-transport v0.0.3 h1:zzOeXnTooCkRvoH+bSXEfXhn76+LAiwoneM0gnXjF2M= -github.com/libp2p/go-reuseport-transport v0.0.3/go.mod h1:Spv+MPft1exxARzP2Sruj2Wb5JSyHNncjf1Oi2dEbzM= -github.com/libp2p/go-sockaddr v0.0.2/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k= -github.com/libp2p/go-sockaddr v0.1.0/go.mod h1:syPvOmNs24S3dFVGJA1/mrqdeijPxLV2Le3BRLKd68k= -github.com/libp2p/go-stream-muxer v0.0.1/go.mod h1:bAo8x7YkSpadMTbtTaxGVHWUQsR/l5MEaHbKaliuT14= -github.com/libp2p/go-stream-muxer-multistream v0.2.0/go.mod h1:j9eyPol/LLRqT+GPLSxvimPhNph4sfYfMoDPd7HkzIc= -github.com/libp2p/go-stream-muxer-multistream v0.3.0 h1:TqnSHPJEIqDEO7h1wZZ0p3DXdvDSiLHQidKKUGZtiOY= -github.com/libp2p/go-stream-muxer-multistream v0.3.0/go.mod h1:yDh8abSIzmZtqtOt64gFJUXEryejzNb0lisTt+fAMJA= -github.com/libp2p/go-tcp-transport v0.1.0/go.mod h1:oJ8I5VXryj493DEJ7OsBieu8fcg2nHGctwtInJVpipc= -github.com/libp2p/go-tcp-transport v0.1.1/go.mod h1:3HzGvLbx6etZjnFlERyakbaYPdfjg2pWP97dFZworkY= -github.com/libp2p/go-tcp-transport v0.2.0 h1:YoThc549fzmNJIh7XjHVtMIFaEDRtIrtWciG5LyYAPo= -github.com/libp2p/go-tcp-transport v0.2.0/go.mod h1:vX2U0CnWimU4h0SGSEsg++AzvBcroCGYw28kh94oLe0= -github.com/libp2p/go-testutil v0.1.0/go.mod h1:81b2n5HypcVyrCg/MJx4Wgfp/VHojytjVe/gLzZ2Ehc= -github.com/libp2p/go-ws-transport v0.2.0/go.mod h1:9BHJz/4Q5A9ludYWKoGCFC5gUElzlHoKzu0yY9p/klM= -github.com/libp2p/go-ws-transport v0.3.0/go.mod h1:bpgTJmRZAvVHrgHybCVyqoBmyLQ1fiZuEaBYusP5zsk= -github.com/libp2p/go-ws-transport v0.3.1 h1:ZX5rWB8nhRRJVaPO6tmkGI/Xx8XNboYX20PW5hXIscw= -github.com/libp2p/go-ws-transport v0.3.1/go.mod h1:bpgTJmRZAvVHrgHybCVyqoBmyLQ1fiZuEaBYusP5zsk= -github.com/libp2p/go-yamux v1.2.2/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= -github.com/libp2p/go-yamux v1.3.0/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= -github.com/libp2p/go-yamux v1.3.3/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= -github.com/libp2p/go-yamux v1.3.5/go.mod h1:FGTiPvoV/3DVdgWpX+tM0OW3tsM+W5bSE3gZwqQTcow= -github.com/libp2p/go-yamux v1.3.7 h1:v40A1eSPJDIZwz2AvrV3cxpTZEGDP11QJbukmEhYyQI= -github.com/libp2p/go-yamux v1.3.7/go.mod h1:fr7aVgmdNGJK+N1g+b6DW6VxzbRCjCOejR/hkmpooHE= -github.com/lucas-clemente/quic-go v0.16.0/go.mod h1:I0+fcNTdb9eS1ZcjQZbDVPGchJ86chcIxPALn9lEJqE= -github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI= -github.com/marten-seemann/qtls v0.9.1/go.mod h1:T1MmAdDPyISzxlK6kjRr0pcZFBVd1OZbBb/j3cvzHhk= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.0 h1:v2XXALHHh6zHfYTJ+cSkwtyffnaOyR1MXaA91mTrb8o= github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-ieproxy v0.0.0-20190610004146-91bb50d98149/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= github.com/mattn/go-ieproxy v0.0.0-20190702010315-6dee0af9227d/go.mod h1:31jz6HNzdxOmlERGGEc4v/dMssOfmp2p5bT/okiKFFc= -github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035 h1:USWjF42jDCSEeikX/G1g40ZWnsPXN5WkZ4jMHZWyBK4= github.com/mattn/go-isatty v0.0.5-0.20180830101745-3fb116b82035/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5 h1:tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.7 h1:UvyT9uN+3r7yLEYSlJsbQGdsaB/a0DlgWP3pql6iwOc= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= -github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= -github.com/miekg/dns v1.1.12/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.28/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= -github.com/miekg/dns v1.1.30/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= -github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g= -github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= -github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= -github.com/minio/sha256-simd v0.0.0-20190328051042-05b4dd3047e5/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= -github.com/minio/sha256-simd v0.1.0/go.mod h1:2FMWW+8GMoPweT6+pI63m9YE3Lmw4J71hV56Chs1E/U= -github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= -github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU= -github.com/minio/sha256-simd v0.1.1/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= -github.com/mr-tron/base58 v1.1.1/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= -github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= -github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/multiformats/go-base32 v0.0.3 h1:tw5+NhuwaOjJCC5Pp82QuXbrmLzWg7uxlMFp8Nq/kkI= -github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= -github.com/multiformats/go-base36 v0.1.0 h1:JR6TyF7JjGd3m6FbLU2cOxhC0Li8z8dLNGQ89tUg4F4= -github.com/multiformats/go-base36 v0.1.0/go.mod h1:kFGE83c6s80PklsHO9sRn2NCoffoRdUUOENyW/Vv6sM= -github.com/multiformats/go-multiaddr v0.0.1/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= -github.com/multiformats/go-multiaddr v0.0.2/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= -github.com/multiformats/go-multiaddr v0.0.4/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= -github.com/multiformats/go-multiaddr v0.1.0/go.mod h1:xKVEak1K9cS1VdmPZW3LSIb6lgmoS58qz/pzqmAxV44= -github.com/multiformats/go-multiaddr v0.1.1/go.mod h1:aMKBKNEYmzmDmxfX88/vz+J5IU55txyt0p4aiWVohjo= -github.com/multiformats/go-multiaddr v0.2.0/go.mod h1:0nO36NvPpyV4QzvTLi/lafl2y95ncPj0vFwVF6k6wJ4= -github.com/multiformats/go-multiaddr v0.2.1/go.mod h1:s/Apk6IyxfvMjDafnhJgJ3/46z7tZ04iMk5wP4QMGGE= -github.com/multiformats/go-multiaddr v0.2.2 h1:XZLDTszBIJe6m0zF6ITBrEcZR73OPUhCBBS9rYAuUzI= -github.com/multiformats/go-multiaddr v0.2.2/go.mod h1:NtfXiOtHvghW9KojvtySjH5y0u0xW5UouOmQQrn6a3Y= -github.com/multiformats/go-multiaddr-dns v0.0.1/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= -github.com/multiformats/go-multiaddr-dns v0.0.2/go.mod h1:9kWcqw/Pj6FwxAwW38n/9403szc57zJPs45fmnznu3Q= -github.com/multiformats/go-multiaddr-dns v0.2.0 h1:YWJoIDwLePniH7OU5hBnDZV6SWuvJqJ0YtN6pLeH9zA= -github.com/multiformats/go-multiaddr-dns v0.2.0/go.mod h1:TJ5pr5bBO7Y1B18djPuRsVkduhQH2YqYSbxWJzYGdK0= -github.com/multiformats/go-multiaddr-fmt v0.0.1/go.mod h1:aBYjqL4T/7j4Qx+R73XSv/8JsgnRFlf0w2KGLCmXl3Q= -github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E= -github.com/multiformats/go-multiaddr-fmt v0.1.0/go.mod h1:hGtDIW4PU4BqJ50gW2quDuPVjyWNZxToGUh/HwTZYJo= -github.com/multiformats/go-multiaddr-net v0.0.1/go.mod h1:nw6HSxNmCIQH27XPGBuX+d1tnvM7ihcFwHMSstNAVUU= -github.com/multiformats/go-multiaddr-net v0.1.0/go.mod h1:5JNbcfBOP4dnhoZOv10JJVkJO0pCCEf8mTnipAo2UZQ= -github.com/multiformats/go-multiaddr-net v0.1.1/go.mod h1:5JNbcfBOP4dnhoZOv10JJVkJO0pCCEf8mTnipAo2UZQ= -github.com/multiformats/go-multiaddr-net v0.1.2/go.mod h1:QsWt3XK/3hwvNxZJp92iMQKME1qHfpYmyIjFVsSOY6Y= -github.com/multiformats/go-multiaddr-net v0.1.3/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= -github.com/multiformats/go-multiaddr-net v0.1.4/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= -github.com/multiformats/go-multiaddr-net v0.1.5 h1:QoRKvu0xHN1FCFJcMQLbG/yQE2z441L5urvG3+qyz7g= -github.com/multiformats/go-multiaddr-net v0.1.5/go.mod h1:ilNnaM9HbmVFqsb/qcNysjCu4PVONlrBZpHIrw/qQuA= -github.com/multiformats/go-multibase v0.0.1/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= -github.com/multiformats/go-multibase v0.0.3 h1:l/B6bJDQjvQ5G52jw4QGSYeOTZoAwIO77RblWplfIqk= -github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= -github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U= -github.com/multiformats/go-multihash v0.0.5/go.mod h1:lt/HCbqlQwlPBz7lv0sQCdtfcMtlJvakRUn/0Ual8po= -github.com/multiformats/go-multihash v0.0.8/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= -github.com/multiformats/go-multihash v0.0.9/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= -github.com/multiformats/go-multihash v0.0.10/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= -github.com/multiformats/go-multihash v0.0.13/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= -github.com/multiformats/go-multihash v0.0.14 h1:QoBceQYQQtNUuf6s7wHxnE2c8bhbMqhfGzNI032se/I= -github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= -github.com/multiformats/go-multistream v0.1.0/go.mod h1:fJTiDfXJVmItycydCnNx4+wSzZ5NwG2FEVAI30fiovg= -github.com/multiformats/go-multistream v0.1.1/go.mod h1:KmHZ40hzVxiaiwlj3MEbYgK9JFk2/9UktWZAF54Du38= -github.com/multiformats/go-multistream v0.1.2 h1:knyamLYMPFPngQjGQ0lhnlys3jtVR/3xV6TREUJr+fE= -github.com/multiformats/go-multistream v0.1.2/go.mod h1:5GZPQZbkWOLOn3J2y4Y99vVW7vOfsAflxARk3x14o6k= -github.com/multiformats/go-varint v0.0.1/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= -github.com/multiformats/go-varint v0.0.2/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= -github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= -github.com/multiformats/go-varint v0.0.6 h1:gk85QWKxh3TazbLxED/NlDVv8+q+ReFJk7Y2W/KhfNY= -github.com/multiformats/go-varint v0.0.6/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= -github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= -github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= -github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c h1:1RHs3tNxjXGHeul8z2t6H2N2TlAqpKe5yryJztRx4Jk= @@ -662,53 +212,37 @@ github.com/olekukonko/tablewriter v0.0.2 h1:sq53g+DWf0J6/ceFUHpQ0nAEb6WgM++fq16M github.com/olekukonko/tablewriter v0.0.2/go.mod h1:rSAaSIOAGT9odnlyGlUfAJaoc5w2fSBUmeGDbRWPxyQ= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.1 h1:q/mM8GF/n0shIN8SaAZ0V+jnLPzen6WIVZdiwrRlMlo= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= -github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= -github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= -github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/openconfig/gnmi v0.0.0-20190823184014-89b2bf29312c/go.mod h1:t+O9It+LKzfOAhKTT5O0ehDix+MTqbtT0T9t+7zzOvc= github.com/openconfig/reference v0.0.0-20190727015836-8dfd928c9696/go.mod h1:ym2A+zigScwkSEb/cVQB0/ZMpU3rqiH6X7WRRsxgOGw= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= -github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222 h1:goeTyGkArOZIVOMA0dQbyuPWGNQJZGPwPu/QS9GlpnA= github.com/pborman/uuid v0.0.0-20170112150404-1b00554d8222/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34= github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7 h1:oYW+YCJ1pachXTQmzR3rNLYGGz4g/UgFcjb28p/viDM= github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/pierrec/lz4 v0.0.0-20190327172049-315a67e90e41/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= -github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= @@ -729,55 +263,14 @@ github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521 h1:3hxavr+IHMsQBrYUPQM5v0CgENFktkkbg1sfpgM3h20= github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= -github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shirou/gopsutil v2.20.5+incompatible h1:tYH07UPoQt0OCQdgWWMgYHy3/a9bcxNpBIysykNIP7I= -github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY= -github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM= -github.com/shurcooL/github_flavored_markdown v0.0.0-20181002035957-2122de532470/go.mod h1:2dOwnU2uBioM+SGy2aZoq1f/Sd1l9OkAeAUvjSyvgU0= -github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= -github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= -github.com/shurcooL/gofontwoff v0.0.0-20180329035133-29b52fc0a18d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw= -github.com/shurcooL/gopherjslib v0.0.0-20160914041154-feb6d3990c2c/go.mod h1:8d3azKNyqcHP1GaQE/c6dDgjkgSx2BZ4IoEi4F1reUI= -github.com/shurcooL/highlight_diff v0.0.0-20170515013008-09bb4053de1b/go.mod h1:ZpfEhSmds4ytuByIcDnOLkTHGUI6KNqRNPDLHDk+mUU= -github.com/shurcooL/highlight_go v0.0.0-20181028180052-98c3abbbae20/go.mod h1:UDKB5a1T23gOMUJrI+uSuH0VRDStOiUVSjBTRDVBVag= -github.com/shurcooL/home v0.0.0-20181020052607-80b7ffcb30f9/go.mod h1:+rgNQw2P9ARFAs37qieuu7ohDNQ3gds9msbT2yn85sg= -github.com/shurcooL/htmlg v0.0.0-20170918183704-d01228ac9e50/go.mod h1:zPn1wHpTIePGnXSHpsVPWEktKXHr6+SS6x/IKRb7cpw= -github.com/shurcooL/httperror v0.0.0-20170206035902-86b7830d14cc/go.mod h1:aYMfkZ6DWSJPJ6c4Wwz3QtW22G7mf/PEgaB9k/ik5+Y= -github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= -github.com/shurcooL/httpgzip v0.0.0-20180522190206-b1c53ac65af9/go.mod h1:919LwcH0M7/W4fcZ0/jy0qGght1GIhqyS/EgWGH2j5Q= -github.com/shurcooL/issues v0.0.0-20181008053335-6292fdc1e191/go.mod h1:e2qWDig5bLteJ4fwvDAc2NHzqFEthkqn7aOZAOpj+PQ= -github.com/shurcooL/issuesapp v0.0.0-20180602232740-048589ce2241/go.mod h1:NPpHK2TI7iSaM0buivtFUc9offApnI0Alt/K8hcHy0I= -github.com/shurcooL/notifications v0.0.0-20181007000457-627ab5aea122/go.mod h1:b5uSkrEVM1jQUspwbixRBhaIjIzL2xazXp6kntxYle0= -github.com/shurcooL/octicon v0.0.0-20181028054416-fa4f57f9efb2/go.mod h1:eWdoE5JD4R5UVWDucdOPg1g2fqQRq78IQa9zlOV1vpQ= -github.com/shurcooL/reactions v0.0.0-20181006231557-f2e0b4ca5b82/go.mod h1:TCR1lToEk4d2s07G3XGfz2QrgHXg4RJBvjrOozvoWfk= -github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4= -github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/smola/gocompat v0.2.0/go.mod h1:1B0MlxbmoZNo3h8guHp8HztB3BSYR5itql9qtVc0ypY= -github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= -github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= -github.com/spacemonkeygo/openssl v0.0.0-20181017203307-c2dcc5cca94a/go.mod h1:7AyxJNCJ7SBZ1MfVQCWD6Uqo2oubI2Eq2y2eqf+A5r0= -github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572/go.mod h1:w0SWMsp6j9O/dk4/ZpIhL+3CkG8ofA2vuv7k+ltqUMc= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= -github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/src-d/envconfig v1.0.0/go.mod h1:Q9YQZ7BKITldTBnoxsE5gOeB5y66RyPXeue/R4aaNBc= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 h1:Gb2Tyox57NRNuZ2d3rmvB3pcmbu7O1RS3m8WRx7ilrg= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= github.com/status-im/keycard-go v0.0.0-20191119114148-6dd40a46baa0 h1:5UdlDkkBoPrJfh7zkfoR3X5utJhNs/MCQysK3x0ycgg= @@ -790,16 +283,10 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d h1:gZZadD8H+fF+n9CmNhYL1Y0dJB+kLOmKd7FbPJLeGHs= github.com/syndtr/goleveldb v1.0.1-0.20190923125748-758128399b1d/go.mod h1:9OrXJhf154huy1nPWmuSrkgjPUtUNhA+Zmy+6AESzuA= -github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca h1:Ld/zXl5t4+D69SiV4JoN7kkfvJdOWlPpfxrzxpLMoUk= -github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= -github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= github.com/templexxx/cpufeat v0.0.0-20180724012125-cef66df7f161/go.mod h1:wM7WEvslTq+iOEAMDLSzhVuOt5BRZ05WirO+b09GHQU= github.com/templexxx/xor v0.0.0-20181023030647-4e92f724b73b/go.mod h1:5XA7W9S6mni3h5uvOC75dA3m9CCCaS83lltmc0ukdi4= github.com/tjfoc/gmsm v1.0.1/go.mod h1:XxO4hdhhrzAd+G4CjDqaOkd0hUzmtPR/d3EiBBMn/wc= @@ -807,269 +294,116 @@ github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef h1:wHSqTBrZ github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/tyler-smith/go-bip39 v1.0.2 h1:+t3w+KwLXO6154GNJY+qUtIxLTmFjfUmpguQT1OlOT8= github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49uaYMPRU= -github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= -github.com/wangjia184/sortedset v0.0.0-20160527075905-f5d03557ba30/go.mod h1:YkocrP2K2tcw938x9gCOmT5G5eCD6jsTz0SZuyAqwIE= -github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 h1:EKhdznlJHPMoKr0XTrX+IlJs1LH3lyx2nfr1dOlZ79k= -github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1/go.mod h1:8UvriyWtv5Q5EOgjHaSseUEdkQfvwFv1I/In/O2M9gc= github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc h1:9lDbC6Rz4bwmou+oE6Dt4Cb2BGMur5eR/GYptkKUVHo= github.com/whyrusleeping/go-logging v0.0.0-20170515211332-0457bb6b88fc/go.mod h1:bopw91TMyo8J3tvftk8xmU2kPmlrt4nScJQZU2hE5EM= -github.com/whyrusleeping/go-logging v0.0.1/go.mod h1:lDPYj54zutzG1XYfHAhcc7oNXEburHQBn+Iqd4yS4vE= -github.com/whyrusleeping/mafmt v1.2.8/go.mod h1:faQJFPbLSxzD9xpA02ttW/tS9vZykNvXwGvqIpk20FA= -github.com/whyrusleeping/mdns v0.0.0-20190826153040-b9b60ed33aa9/go.mod h1:j4l84WPFclQPj320J9gp0XwNKBb3U0zt5CBqjPp22G4= -github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 h1:E9S12nwJwEOXe2d6gT6qxdvqMnNq+VnSsKPgm2ZZNds= -github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7/go.mod h1:X2c0RVCI1eSUFI8eLcY3c0423ykwiUdxLJtkDvruhjI= -github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee h1:lYbXeSvJi5zk5GLKVuid9TVjS9a0OmLIDKTfoZBL6Ow= -github.com/whyrusleeping/timecache v0.0.0-20160911033111-cfcb2f1abfee/go.mod h1:m2aV4LZI4Aez7dP5PMyVKEHhUyEJ/RjmPEDOpDvudHg= github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208 h1:1cngl9mPEoITZG8s8cVcUy5CeIBYhEESkOB7m6Gmkrk= github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees= -github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/xtaci/kcp-go v5.4.5+incompatible/go.mod h1:bN6vIwHQbfHaHtFpEssmWsN45a+AZwO7eyRCmEIbtvE= github.com/xtaci/lossyconn v0.0.0-20190602105132-8df528c0c9ae/go.mod h1:gXtu8J62kEgmN++bm9BVICuT/e8yiLI2KFobd/TRFsE= -go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= -go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.14.1 h1:nYDKopTbvAPq/NrUVZwT15y2lpROBiLLyoRTbXOYWOo= go.uber.org/zap v1.14.1/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= -go.uber.org/zap v1.15.0 h1:ZZCA22JRF2gQE5FoNmhmrf7jeJJ2uhqDUNRYKm8dvmM= -go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= -go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= -golang.org/x/build v0.0.0-20190111050920-041ab4dc3f9d/go.mod h1:OWs+y06UdEOHN4y+MfF/py+xQ/tYqIWW03b70/CG9Rw= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190225124518-7f87c0fbb88b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= -golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190618222545-ea8f1a30c443/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190926114937-fa1a29108794 h1:4Yo9XtTfxfBCecLiBW8TYsFIdN7TkDhjGLWetFo4JSo= golang.org/x/crypto v0.0.0-20190926114937-fa1a29108794/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5 h1:Q7tZBpemrlsc2I7IyODzhtallWRSm4Q0d09pL6XbQtU= -golang.org/x/crypto v0.0.0-20200423211502-4bdfaf469ed5/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= -golang.org/x/mobile v0.0.0-20200801112145-973feb4309de/go.mod h1:skQtrUTUwhdJvXM/2KKJzY8pDgNr9I/FOMqDVRPBUS4= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190227160552-c95aed5357e7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190228165749-92fc7df08ae7/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190912160710-24e19bdeb0f2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190926025831-c00fd9afed17 h1:qPnAdmjNA41t3QBTx2mFGf/SD1IoslhYu7AmdsVzCcs= golang.org/x/net v0.0.0-20190926025831-c00fd9afed17/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a h1:WXEvlFVvvGxCJLG6REjsT03iWnKLEWinaScsxF2Vm2o= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180926160741-c2ed4eda69e7/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181029174526-d69651ed3497/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190219092855-153ac476189d/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190405154228-4b34438f7a67/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190526052359-791d8a0f4d09/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190912141932-bc967efca4b8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69 h1:rOhMmluY6kLMhdnrivzec6lLgaVbMHMn2ISQXJeJ5EM= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8 h1:AvbQYmiaaaza3cW3QXRyPo5kYgpFIzOAfeAAN7m3qQ4= -golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181130052023-1c3d964395ce/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190912185636-87d9f09c5d89/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190925230517-ea99b82c7b93 h1:Ejrp5SZ9rwPbsIk7rakjfOLd9H06/JNTx+5mO81yBz4= golang.org/x/tools v0.0.0-20190925230517-ea99b82c7b93/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64bikrLBkAgPir1TNCj3Zs= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216052735-49a3e744a425 h1:VvQyQJN0tSuecqgcIxMWnnfG5kSmgy9KZR9sW3W5QeA= -golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69 h1:yBHHx+XZqXJBm6Exke3N7V9gnlsyXxoCPEb1yVenjfk= -golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= -google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= -google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a/go.mod h1:KF9sEfUPAXdG8Oev9e99iLGnl2uJMjc5B+4y3O7x610= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q= gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4= gopkg.in/jcmturner/gokrb5.v7 v7.2.3/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8= +gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20190213234257-ec84240a7772/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20190709231704-1e4459ed25ff h1:uuol9OUzSvZntY1v963NAbVd7A+PHLMz1FlCe3Lorcs= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20190709231704-1e4459ed25ff/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= -gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6 h1:a6cXbcDDUkSBlpnkWV1bJ+vv3mOgQEltEJ2rPxroVu0= -gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/redis.v4 v4.2.4/go.mod h1:8KREHdypkCEojGKQcjMqAODMICIVwZAONWq8RowTITA= gopkg.in/sourcemap.v1 v1.0.5/go.mod h1:2RlvNNSMglmRrcvhfuzp4hQHwOtjxlbjX7UPY/GXb78= -gopkg.in/src-d/go-cli.v0 v0.0.0-20181105080154-d492247bbc0d/go.mod h1:z+K8VcOYVYcSwSjGebuDL6176A1XskgbtNl64NSg+n8= -gopkg.in/src-d/go-log.v1 v1.0.1/go.mod h1:GN34hKP0g305ysm2/hctJ0Y8nWP3zxXXJ8GFabTyABE= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/urfave/cli.v1 v1.20.0 h1:NdAVW6RYxDif9DhDHaAortIu956m2c0v+09AZBPTbE0= gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= -honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sourcegraph.com/sourcegraph/go-diff v0.5.0/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= -sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0=