From 970ee36aaadb3192d8aaa9481648caf589b7b274 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Mon, 16 Nov 2020 11:47:17 +0100 Subject: [PATCH 1/5] Removing event log file This event log will be replaced by generated functions from keep-commons --- .../gen/eventlog/TBTCSystemEventLog.go | 81 ------------------- 1 file changed, 81 deletions(-) delete mode 100644 pkg/chain/ethereum/gen/eventlog/TBTCSystemEventLog.go diff --git a/pkg/chain/ethereum/gen/eventlog/TBTCSystemEventLog.go b/pkg/chain/ethereum/gen/eventlog/TBTCSystemEventLog.go deleted file mode 100644 index 684856b10..000000000 --- a/pkg/chain/ethereum/gen/eventlog/TBTCSystemEventLog.go +++ /dev/null @@ -1,81 +0,0 @@ -package eventlog - -import ( - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - abi "github.com/keep-network/tbtc/pkg/chain/ethereum/gen/abi/system" - "math/big" -) - -// FIXME: This is a temporary structure allowing to access past events -// emitted by the `TBTCSystem` contract. This structure is here because -// the generated contract wrappers from `gen/contract` don't support -// `Filter*` methods yet. When the contract generator will support -// those methods, the below structure can be removed. -type TBTCSystemEventLog struct { - contract *abi.TBTCSystem -} - -func NewTBTCSystemEventLog( - contractAddress common.Address, - backend bind.ContractBackend, -) (*TBTCSystemEventLog, error) { - contract, err := abi.NewTBTCSystem(contractAddress, backend) - if err != nil { - return nil, err - } - - return &TBTCSystemEventLog{contract}, nil -} - -type TBTCSystemRedemptionRequested struct { - DepositContractAddress common.Address - Requester common.Address - Digest [32]byte - UtxoValue *big.Int - RedeemerOutputScript []byte - RequestedFee *big.Int - Outpoint []byte - BlockNumber uint64 -} - -func (tsel *TBTCSystemEventLog) PastRedemptionRequestedEvents( - depositsAddresses []common.Address, - startBlock uint64, - endBlock *uint64, -) ([]*TBTCSystemRedemptionRequested, error) { - iterator, err := tsel.contract.FilterRedemptionRequested( - &bind.FilterOpts{ - Start: startBlock, - End: endBlock, - }, - depositsAddresses, - nil, - nil, - ) - if err != nil { - return nil, err - } - - events := make([]*TBTCSystemRedemptionRequested, 0) - - for { - if !iterator.Next() { - break - } - - event := iterator.Event - events = append(events, &TBTCSystemRedemptionRequested{ - DepositContractAddress: event.DepositContractAddress, - Requester: event.Requester, - Digest: event.Digest, - UtxoValue: event.UtxoValue, - RedeemerOutputScript: event.RedeemerOutputScript, - RequestedFee: event.RequestedFee, - Outpoint: event.Outpoint, - BlockNumber: event.Raw.BlockNumber, - }) - } - - return events, nil -} From ab9a2ce6c4c994beffca3219acb5923184bb3689 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Mon, 16 Nov 2020 13:20:27 +0100 Subject: [PATCH 2/5] Adding temp version for keep-commons --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 60d84fcb9..eb02660d2 100644 --- a/go.mod +++ b/go.mod @@ -5,5 +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.20201020114759-19c123cbd4f4 + github.com/keep-network/keep-common v1.2.1-0.20201116121154-016d77aacdce ) diff --git a/go.sum b/go.sum index e361e33fb..584ee8d10 100644 --- a/go.sum +++ b/go.sum @@ -168,6 +168,8 @@ github.com/karalabe/usb v0.0.0-20191104083709-911d15fe12a9 h1:ZHuwnjpP8LsVsUYqTq github.com/karalabe/usb v0.0.0-20191104083709-911d15fe12a9/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= 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-common v1.2.1-0.20201116121154-016d77aacdce h1:B+kei2KjTdLS7JeK6YeDFU6suzPbkCn8WiAX1VDqtA0= +github.com/keep-network/keep-common v1.2.1-0.20201116121154-016d77aacdce/go.mod h1:emxogTbBdey7M3jOzfxZOdfn139kN2mI2b2wA6AHKKo= 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 da7a6ce1cf6f94369e89fbc2470b6a52f4b30af1 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Mon, 16 Nov 2020 13:20:54 +0100 Subject: [PATCH 3/5] Adding generated contracts --- pkg/chain/ethereum/gen/contract/Deposit.go | 1692 ++++---- pkg/chain/ethereum/gen/contract/TBTCSystem.go | 3541 ++++++++++------- 2 files changed, 2975 insertions(+), 2258 deletions(-) diff --git a/pkg/chain/ethereum/gen/contract/Deposit.go b/pkg/chain/ethereum/gen/contract/Deposit.go index ebba81f54..1b99a75bb 100644 --- a/pkg/chain/ethereum/gen/contract/Deposit.go +++ b/pkg/chain/ethereum/gen/contract/Deposit.go @@ -92,28 +92,18 @@ 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, +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, ), ) @@ -139,34 +129,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(), ) @@ -177,34 +157,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(), ) @@ -219,14 +189,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 @@ -238,56 +203,58 @@ 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) NotifyRedemptionProofTimedOut( +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 notifyRedemptionProofTimedOut", + "submitting transaction initializeDeposit", + "params: ", + fmt.Sprint( + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, + ), + "value: ", value, ) d.transactionMutex.Lock() @@ -297,6 +264,8 @@ func (d *Deposit) NotifyRedemptionProofTimedOut( 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", @@ -312,20 +281,32 @@ func (d *Deposit) NotifyRedemptionProofTimedOut( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyRedemptionProofTimedOut( + 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, - "notifyRedemptionProofTimedOut", + value, + "initializeDeposit", + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) } dLogger.Infof( - "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", + "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -336,20 +317,32 @@ func (d *Deposit) NotifyRedemptionProofTimedOut( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyRedemptionProofTimedOut( + 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, - "notifyRedemptionProofTimedOut", + value, + "initializeDeposit", + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) } dLogger.Infof( - "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", + "submitted transaction initializeDeposit with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -364,34 +357,60 @@ func (d *Deposit) NotifyRedemptionProofTimedOut( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyRedemptionProofTimedOut( +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, - "notifyRedemptionProofTimedOut", + "initializeDeposit", &result, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) return err } -func (d *Deposit) NotifyRedemptionProofTimedOutGasEstimate() (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, - "notifyRedemptionProofTimedOut", + "initializeDeposit", d.contractABI, d.transactor, + _tbtcSystem, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachineAddress, + _lotSizeSatoshis, ) return result, err @@ -514,25 +533,12 @@ func (d *Deposit) NotifySignerSetupFailedGasEstimate() (uint64, error) { } // 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() @@ -557,30 +563,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(), ) @@ -591,30 +587,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(), ) @@ -629,12 +615,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 @@ -646,56 +627,46 @@ 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) IncreaseRedemptionFee( - _previousOutputValueBytes [8]uint8, - _newOutputValueBytes [8]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 increaseRedemptionFee", + "submitting transaction provideECDSAFraudProof", "params: ", fmt.Sprint( - _previousOutputValueBytes, - _newOutputValueBytes, + _v, + _r, + _s, + _signedDigest, + _preimage, ), ) @@ -721,24 +692,30 @@ func (d *Deposit) IncreaseRedemptionFee( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.IncreaseRedemptionFee( + transaction, err := d.contract.ProvideECDSAFraudProof( transactorOptions, - _previousOutputValueBytes, - _newOutputValueBytes, + _v, + _r, + _s, + _signedDigest, + _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "increaseRedemptionFee", - _previousOutputValueBytes, - _newOutputValueBytes, + "provideECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, ) } dLogger.Infof( - "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", + "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -749,24 +726,30 @@ func (d *Deposit) IncreaseRedemptionFee( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.IncreaseRedemptionFee( + transaction, err := d.contract.ProvideECDSAFraudProof( transactorOptions, - _previousOutputValueBytes, - _newOutputValueBytes, + _v, + _r, + _s, + _signedDigest, + _preimage, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "increaseRedemptionFee", - _previousOutputValueBytes, - _newOutputValueBytes, + "provideECDSAFraudProof", + _v, + _r, + _s, + _signedDigest, + _preimage, ) } dLogger.Infof( - "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", + "submitted transaction provideECDSAFraudProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -781,9 +764,12 @@ func (d *Deposit) IncreaseRedemptionFee( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallIncreaseRedemptionFee( - _previousOutputValueBytes [8]uint8, - _newOutputValueBytes [8]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 @@ -795,41 +781,55 @@ func (d *Deposit) CallIncreaseRedemptionFee( d.caller, d.errorResolver, d.contractAddress, - "increaseRedemptionFee", + "provideECDSAFraudProof", &result, - _previousOutputValueBytes, - _newOutputValueBytes, + _v, + _r, + _s, + _signedDigest, + _preimage, ) return err } -func (d *Deposit) IncreaseRedemptionFeeGasEstimate( - _previousOutputValueBytes [8]uint8, - _newOutputValueBytes [8]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, - "increaseRedemptionFee", + "provideECDSAFraudProof", d.contractABI, d.transactor, - _previousOutputValueBytes, - _newOutputValueBytes, + _v, + _r, + _s, + _signedDigest, + _preimage, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyCourtesyCallExpired( +func (d *Deposit) RequestFunderAbort( + _abortOutputScript []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyCourtesyCallExpired", + "submitting transaction requestFunderAbort", + "params: ", + fmt.Sprint( + _abortOutputScript, + ), ) d.transactionMutex.Lock() @@ -854,20 +854,22 @@ func (d *Deposit) NotifyCourtesyCallExpired( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyCourtesyCallExpired( + transaction, err := d.contract.RequestFunderAbort( transactorOptions, + _abortOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyCourtesyCallExpired", + "requestFunderAbort", + _abortOutputScript, ) } dLogger.Infof( - "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", + "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -878,20 +880,22 @@ func (d *Deposit) NotifyCourtesyCallExpired( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyCourtesyCallExpired( + transaction, err := d.contract.RequestFunderAbort( transactorOptions, + _abortOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyCourtesyCallExpired", + "requestFunderAbort", + _abortOutputScript, ) } dLogger.Infof( - "submitted transaction notifyCourtesyCallExpired with id: [%v] and nonce [%v]", + "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -906,7 +910,8 @@ func (d *Deposit) NotifyCourtesyCallExpired( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyCourtesyCallExpired( +func (d *Deposit) CallRequestFunderAbort( + _abortOutputScript []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -918,34 +923,45 @@ func (d *Deposit) CallNotifyCourtesyCallExpired( d.caller, d.errorResolver, d.contractAddress, - "notifyCourtesyCallExpired", + "requestFunderAbort", &result, + _abortOutputScript, ) return err } -func (d *Deposit) NotifyCourtesyCallExpiredGasEstimate() (uint64, error) { +func (d *Deposit) RequestFunderAbortGasEstimate( + _abortOutputScript []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyCourtesyCallExpired", + "requestFunderAbort", d.contractABI, d.transactor, + _abortOutputScript, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyUndercollateralizedLiquidation( +func (d *Deposit) IncreaseRedemptionFee( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyUndercollateralizedLiquidation", + "submitting transaction increaseRedemptionFee", + "params: ", + fmt.Sprint( + _previousOutputValueBytes, + _newOutputValueBytes, + ), ) d.transactionMutex.Lock() @@ -970,20 +986,24 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyUndercollateralizedLiquidation( + transaction, err := d.contract.IncreaseRedemptionFee( transactorOptions, + _previousOutputValueBytes, + _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyUndercollateralizedLiquidation", + "increaseRedemptionFee", + _previousOutputValueBytes, + _newOutputValueBytes, ) } dLogger.Infof( - "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -994,20 +1014,24 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyUndercollateralizedLiquidation( + transaction, err := d.contract.IncreaseRedemptionFee( transactorOptions, + _previousOutputValueBytes, + _newOutputValueBytes, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyUndercollateralizedLiquidation", + "increaseRedemptionFee", + _previousOutputValueBytes, + _newOutputValueBytes, ) } dLogger.Infof( - "submitted transaction notifyUndercollateralizedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction increaseRedemptionFee with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1022,7 +1046,9 @@ func (d *Deposit) NotifyUndercollateralizedLiquidation( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyUndercollateralizedLiquidation( +func (d *Deposit) CallIncreaseRedemptionFee( + _previousOutputValueBytes [8]uint8, + _newOutputValueBytes [8]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1034,39 +1060,41 @@ func (d *Deposit) CallNotifyUndercollateralizedLiquidation( d.caller, d.errorResolver, d.contractAddress, - "notifyUndercollateralizedLiquidation", + "increaseRedemptionFee", &result, + _previousOutputValueBytes, + _newOutputValueBytes, ) return err } -func (d *Deposit) NotifyUndercollateralizedLiquidationGasEstimate() (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, - "notifyUndercollateralizedLiquidation", + "increaseRedemptionFee", d.contractABI, d.transactor, + _previousOutputValueBytes, + _newOutputValueBytes, ) return result, err } // Transaction submission. -func (d *Deposit) RequestFunderAbort( - _abortOutputScript []uint8, +func (d *Deposit) NotifyRedemptionProofTimedOut( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction requestFunderAbort", - "params: ", - fmt.Sprint( - _abortOutputScript, - ), + "submitting transaction notifyRedemptionProofTimedOut", ) d.transactionMutex.Lock() @@ -1091,22 +1119,20 @@ func (d *Deposit) RequestFunderAbort( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.RequestFunderAbort( + transaction, err := d.contract.NotifyRedemptionProofTimedOut( transactorOptions, - _abortOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "requestFunderAbort", - _abortOutputScript, + "notifyRedemptionProofTimedOut", ) } dLogger.Infof( - "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", + "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1117,22 +1143,20 @@ func (d *Deposit) RequestFunderAbort( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.RequestFunderAbort( + transaction, err := d.contract.NotifyRedemptionProofTimedOut( transactorOptions, - _abortOutputScript, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "requestFunderAbort", - _abortOutputScript, + "notifyRedemptionProofTimedOut", ) } dLogger.Infof( - "submitted transaction requestFunderAbort with id: [%v] and nonce [%v]", + "submitted transaction notifyRedemptionProofTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1147,8 +1171,7 @@ func (d *Deposit) RequestFunderAbort( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallRequestFunderAbort( - _abortOutputScript []uint8, +func (d *Deposit) CallNotifyRedemptionProofTimedOut( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1160,51 +1183,34 @@ func (d *Deposit) CallRequestFunderAbort( d.caller, d.errorResolver, d.contractAddress, - "requestFunderAbort", + "notifyRedemptionProofTimedOut", &result, - _abortOutputScript, ) return err } -func (d *Deposit) RequestFunderAbortGasEstimate( - _abortOutputScript []uint8, -) (uint64, error) { +func (d *Deposit) NotifyRedemptionProofTimedOutGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "requestFunderAbort", + "notifyRedemptionProofTimedOut", d.contractABI, d.transactor, - _abortOutputScript, ) 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) NotifyRedemptionSignatureTimedOut( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideFundingECDSAFraudProof", - "params: ", - fmt.Sprint( - _v, - _r, - _s, - _signedDigest, - _preimage, - ), + "submitting transaction notifyRedemptionSignatureTimedOut", ) d.transactionMutex.Lock() @@ -1229,30 +1235,20 @@ func (d *Deposit) ProvideFundingECDSAFraudProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideFundingECDSAFraudProof( + transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( 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, + "notifyRedemptionSignatureTimedOut", ) } dLogger.Infof( - "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", + "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1263,30 +1259,20 @@ func (d *Deposit) ProvideFundingECDSAFraudProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideFundingECDSAFraudProof( + transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( 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, + "notifyRedemptionSignatureTimedOut", ) } dLogger.Infof( - "submitted transaction provideFundingECDSAFraudProof with id: [%v] and nonce [%v]", + "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1301,12 +1287,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) CallNotifyRedemptionSignatureTimedOut( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1318,56 +1299,50 @@ func (d *Deposit) CallProvideFundingECDSAFraudProof( d.caller, d.errorResolver, d.contractAddress, - "provideFundingECDSAFraudProof", + "notifyRedemptionSignatureTimedOut", &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) NotifyRedemptionSignatureTimedOutGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideFundingECDSAFraudProof", + "notifyRedemptionSignatureTimedOut", 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) 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 requestRedemption", + "submitting transaction provideRedemptionProof", "params: ", fmt.Sprint( - _outputValueBytes, - _redeemerOutputScript, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ), ) @@ -1393,24 +1368,34 @@ func (d *Deposit) RequestRedemption( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.RequestRedemption( + transaction, err := d.contract.ProvideRedemptionProof( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "requestRedemption", - _outputValueBytes, - _redeemerOutputScript, + "provideRedemptionProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) } dLogger.Infof( - "submitted transaction requestRedemption with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1421,24 +1406,34 @@ func (d *Deposit) RequestRedemption( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.RequestRedemption( + transaction, err := d.contract.ProvideRedemptionProof( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "requestRedemption", - _outputValueBytes, - _redeemerOutputScript, + "provideRedemptionProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) } dLogger.Infof( - "submitted transaction requestRedemption with id: [%v] and nonce [%v]", + "submitted transaction provideRedemptionProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1453,9 +1448,14 @@ func (d *Deposit) RequestRedemption( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallRequestRedemption( - _outputValueBytes [8]uint8, - _redeemerOutputScript []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 @@ -1467,50 +1467,56 @@ func (d *Deposit) CallRequestRedemption( d.caller, d.errorResolver, d.contractAddress, - "requestRedemption", + "provideRedemptionProof", &result, - _outputValueBytes, - _redeemerOutputScript, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) return err } -func (d *Deposit) RequestRedemptionGasEstimate( - _outputValueBytes [8]uint8, - _redeemerOutputScript []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, - "requestRedemption", + "provideRedemptionProof", d.contractABI, d.transactor, - _outputValueBytes, - _redeemerOutputScript, + _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) WithdrawFunds( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction transferAndRequestRedemption", - "params: ", - fmt.Sprint( - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, - ), + "submitting transaction withdrawFunds", ) d.transactionMutex.Lock() @@ -1535,26 +1541,20 @@ func (d *Deposit) TransferAndRequestRedemption( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.TransferAndRequestRedemption( + transaction, err := d.contract.WithdrawFunds( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "transferAndRequestRedemption", - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + "withdrawFunds", ) } dLogger.Infof( - "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", + "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1565,26 +1565,20 @@ func (d *Deposit) TransferAndRequestRedemption( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.TransferAndRequestRedemption( + transaction, err := d.contract.WithdrawFunds( transactorOptions, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "transferAndRequestRedemption", - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, + "withdrawFunds", ) } dLogger.Infof( - "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", + "submitted transaction withdrawFunds with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1599,10 +1593,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) CallWithdrawFunds( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1614,44 +1605,39 @@ func (d *Deposit) CallTransferAndRequestRedemption( d.caller, d.errorResolver, d.contractAddress, - "transferAndRequestRedemption", + "withdrawFunds", &result, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, ) return err } -func (d *Deposit) TransferAndRequestRedemptionGasEstimate( - _outputValueBytes [8]uint8, - _redeemerOutputScript []uint8, - _finalRecipient common.Address, -) (uint64, error) { +func (d *Deposit) WithdrawFundsGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "transferAndRequestRedemption", + "withdrawFunds", d.contractABI, d.transactor, - _outputValueBytes, - _redeemerOutputScript, - _finalRecipient, ) return result, err } // Transaction submission. -func (d *Deposit) NotifyRedemptionSignatureTimedOut( +func (d *Deposit) Initialize( + _factory common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyRedemptionSignatureTimedOut", + "submitting transaction initialize", + "params: ", + fmt.Sprint( + _factory, + ), ) d.transactionMutex.Lock() @@ -1676,20 +1662,22 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( + transaction, err := d.contract.Initialize( transactorOptions, + _factory, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyRedemptionSignatureTimedOut", + "initialize", + _factory, ) } dLogger.Infof( - "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", + "submitted transaction initialize with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1700,20 +1688,22 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.NotifyRedemptionSignatureTimedOut( + transaction, err := d.contract.Initialize( transactorOptions, + _factory, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "notifyRedemptionSignatureTimedOut", + "initialize", + _factory, ) } dLogger.Infof( - "submitted transaction notifyRedemptionSignatureTimedOut with id: [%v] and nonce [%v]", + "submitted transaction initialize with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1728,7 +1718,8 @@ func (d *Deposit) NotifyRedemptionSignatureTimedOut( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallNotifyRedemptionSignatureTimedOut( +func (d *Deposit) CallInitialize( + _factory common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1740,43 +1731,38 @@ func (d *Deposit) CallNotifyRedemptionSignatureTimedOut( d.caller, d.errorResolver, d.contractAddress, - "notifyRedemptionSignatureTimedOut", + "initialize", &result, + _factory, ) return err } -func (d *Deposit) NotifyRedemptionSignatureTimedOutGasEstimate() (uint64, error) { +func (d *Deposit) InitializeGasEstimate( + _factory common.Address, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "notifyRedemptionSignatureTimedOut", + "initialize", d.contractABI, d.transactor, + _factory, ) 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() @@ -1801,26 +1787,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(), ) @@ -1831,26 +1811,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(), ) @@ -1865,10 +1839,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 @@ -1880,44 +1851,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) NotifyFundingTimedOut( +func (d *Deposit) PurchaseSignerBondsAtAuction( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction notifyFundingTimedOut", + "submitting transaction purchaseSignerBondsAtAuction", ) d.transactionMutex.Lock() @@ -1942,7 +1903,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 { @@ -1950,12 +1911,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(), ) @@ -1966,7 +1927,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 { @@ -1974,12 +1935,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(), ) @@ -1994,7 +1955,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 @@ -2006,20 +1967,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, ) @@ -2028,12 +1989,12 @@ func (d *Deposit) NotifyFundingTimedOutGasEstimate() (uint64, error) { } // 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() @@ -2058,7 +2019,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 { @@ -2066,12 +2027,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(), ) @@ -2082,7 +2043,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 { @@ -2090,12 +2051,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(), ) @@ -2110,7 +2071,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 @@ -2122,20 +2083,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, ) @@ -2144,16 +2105,20 @@ func (d *Deposit) ExitCourtesyCallGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) Initialize( - _factory common.Address, +func (d *Deposit) TransferAndRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction initialize", + "submitting transaction transferAndRequestRedemption", "params: ", fmt.Sprint( - _factory, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ), ) @@ -2179,22 +2144,26 @@ func (d *Deposit) Initialize( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.Initialize( + transaction, err := d.contract.TransferAndRequestRedemption( transactorOptions, - _factory, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "initialize", - _factory, + "transferAndRequestRedemption", + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) } dLogger.Infof( - "submitted transaction initialize with id: [%v] and nonce [%v]", + "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2205,22 +2174,26 @@ func (d *Deposit) Initialize( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.Initialize( + transaction, err := d.contract.TransferAndRequestRedemption( transactorOptions, - _factory, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) if err != nil { return transaction, d.errorResolver.ResolveError( err, d.transactorOptions.From, nil, - "initialize", - _factory, + "transferAndRequestRedemption", + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) } dLogger.Infof( - "submitted transaction initialize with id: [%v] and nonce [%v]", + "submitted transaction transferAndRequestRedemption with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2235,8 +2208,10 @@ func (d *Deposit) Initialize( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallInitialize( - _factory common.Address, +func (d *Deposit) CallTransferAndRequestRedemption( + _outputValueBytes [8]uint8, + _redeemerOutputScript []uint8, + _finalRecipient common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2248,38 +2223,44 @@ func (d *Deposit) CallInitialize( d.caller, d.errorResolver, d.contractAddress, - "initialize", + "transferAndRequestRedemption", &result, - _factory, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) return err } -func (d *Deposit) InitializeGasEstimate( - _factory common.Address, +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, - "initialize", + "transferAndRequestRedemption", d.contractABI, d.transactor, - _factory, + _outputValueBytes, + _redeemerOutputScript, + _finalRecipient, ) 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() @@ -2304,7 +2285,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 { @@ -2312,12 +2293,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(), ) @@ -2328,7 +2309,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 { @@ -2336,12 +2317,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(), ) @@ -2356,7 +2337,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 @@ -2368,20 +2349,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, ) @@ -2390,12 +2371,31 @@ func (d *Deposit) WithdrawFundsGasEstimate() (uint64, error) { } // Transaction submission. -func (d *Deposit) PurchaseSignerBondsAtAuction( +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 purchaseSignerBondsAtAuction", + "submitting transaction provideBTCFundingProof", + "params: ", + fmt.Sprint( + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, + ), ) d.transactionMutex.Lock() @@ -2420,20 +2420,36 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.PurchaseSignerBondsAtAuction( + 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, - "purchaseSignerBondsAtAuction", + "provideBTCFundingProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) } dLogger.Infof( - "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", + "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2444,20 +2460,36 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.PurchaseSignerBondsAtAuction( + 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, - "purchaseSignerBondsAtAuction", + "provideBTCFundingProof", + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) } dLogger.Infof( - "submitted transaction purchaseSignerBondsAtAuction with id: [%v] and nonce [%v]", + "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2472,7 +2504,15 @@ func (d *Deposit) PurchaseSignerBondsAtAuction( } // Non-mutating call, not a transaction submission. -func (d *Deposit) CallPurchaseSignerBondsAtAuction( +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 @@ -2484,34 +2524,72 @@ func (d *Deposit) CallPurchaseSignerBondsAtAuction( d.caller, d.errorResolver, d.contractAddress, - "purchaseSignerBondsAtAuction", + "provideBTCFundingProof", &result, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) return err } -func (d *Deposit) PurchaseSignerBondsAtAuctionGasEstimate() (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, - "purchaseSignerBondsAtAuction", + "provideBTCFundingProof", d.contractABI, d.transactor, + _txVersion, + _txInputVector, + _txOutputVector, + _txLocktime, + _fundingOutputIndex, + _merkleProof, + _txIndexInBlock, + _bitcoinHeaders, ) return result, err } // 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() @@ -2536,20 +2614,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(), ) @@ -2560,20 +2648,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(), ) @@ -2588,7 +2686,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 @@ -2600,51 +2703,50 @@ 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 } // 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() @@ -2654,8 +2756,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", @@ -2671,32 +2771,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(), ) @@ -2707,32 +2795,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(), ) @@ -2747,72 +2823,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) 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() @@ -2837,20 +2896,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(), ) @@ -2861,20 +2926,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(), ) @@ -2889,7 +2960,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 @@ -2901,53 +2975,44 @@ 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) ProvideBTCFundingProof( - _txVersion [4]uint8, - _txInputVector []uint8, - _txOutputVector []uint8, - _txLocktime [4]uint8, - _fundingOutputIndex uint8, - _merkleProof []uint8, - _txIndexInBlock *big.Int, - _bitcoinHeaders []uint8, +func (d *Deposit) NotifyCourtesyCall( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { dLogger.Debug( - "submitting transaction provideBTCFundingProof", - "params: ", - fmt.Sprint( - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, - ), + "submitting transaction notifyCourtesyCall", ) d.transactionMutex.Lock() @@ -2972,36 +3037,20 @@ func (d *Deposit) ProvideBTCFundingProof( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := d.contract.ProvideBTCFundingProof( + transaction, err := d.contract.NotifyCourtesyCall( 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, + "notifyCourtesyCall", ) } dLogger.Infof( - "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3012,36 +3061,20 @@ func (d *Deposit) ProvideBTCFundingProof( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := d.contract.ProvideBTCFundingProof( + transaction, err := d.contract.NotifyCourtesyCall( 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, + "notifyCourtesyCall", ) } dLogger.Infof( - "submitted transaction provideBTCFundingProof with id: [%v] and nonce [%v]", + "submitted transaction notifyCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3056,15 +3089,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) CallNotifyCourtesyCall( blockNumber *big.Int, ) error { var result interface{} = nil @@ -3076,47 +3101,22 @@ func (d *Deposit) CallProvideBTCFundingProof( 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) { + "notifyCourtesyCall", + &result, + ) + + return err +} + +func (d *Deposit) NotifyCourtesyCallGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( d.callerOptions.From, d.contractAddress, - "provideBTCFundingProof", + "notifyCourtesyCall", d.contractABI, d.transactor, - _txVersion, - _txInputVector, - _txOutputVector, - _txLocktime, - _fundingOutputIndex, - _merkleProof, - _txIndexInBlock, - _bitcoinHeaders, ) return result, err @@ -3124,9 +3124,9 @@ func (d *Deposit) ProvideBTCFundingProofGasEstimate( // ----- Const Methods ------ -func (d *Deposit) LotSizeTbtc() (*big.Int, error) { +func (d *Deposit) AuctionValue() (*big.Int, error) { var result *big.Int - result, err := d.contract.LotSizeTbtc( + result, err := d.contract.AuctionValue( d.callerOptions, ) @@ -3135,14 +3135,14 @@ func (d *Deposit) LotSizeTbtc() (*big.Int, error) { err, d.callerOptions.From, nil, - "lotSizeTbtc", + "auctionValue", ) } return result, err } -func (d *Deposit) LotSizeTbtcAtBlock( +func (d *Deposit) AuctionValueAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3155,20 +3155,17 @@ func (d *Deposit) LotSizeTbtcAtBlock( d.caller, d.errorResolver, d.contractAddress, - "lotSizeTbtc", + "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 { @@ -3176,16 +3173,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 @@ -3198,18 +3193,20 @@ func (d *Deposit) GetOwnerRedemptionTbtcRequirementAtBlock( d.caller, d.errorResolver, d.contractAddress, - "getOwnerRedemptionTbtcRequirement", + "collateralizationPercentage", &result, - _redeemer, ) 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 { @@ -3217,14 +3214,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 @@ -3237,16 +3236,17 @@ func (d *Deposit) CurrentStateAtBlock( d.caller, d.errorResolver, d.contractAddress, - "currentState", + "getRedemptionTbtcRequirement", &result, + _redeemer, ) return result, err } -func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { - var result uint16 - result, err := d.contract.InitialCollateralizedPercent( +func (d *Deposit) InActive() (bool, error) { + var result bool + result, err := d.contract.InActive( d.callerOptions, ) @@ -3255,17 +3255,17 @@ func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { err, d.callerOptions.From, nil, - "initialCollateralizedPercent", + "inActive", ) } return result, err } -func (d *Deposit) InitialCollateralizedPercentAtBlock( +func (d *Deposit) InActiveAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (bool, error) { + var result bool err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3275,16 +3275,16 @@ func (d *Deposit) InitialCollateralizedPercentAtBlock( d.caller, d.errorResolver, d.contractAddress, - "initialCollateralizedPercent", + "inActive", &result, ) return result, err } -func (d *Deposit) CollateralizationPercentage() (*big.Int, error) { - var result *big.Int - result, err := d.contract.CollateralizationPercentage( +func (d *Deposit) KeepAddress() (common.Address, error) { + var result common.Address + result, err := d.contract.KeepAddress( d.callerOptions, ) @@ -3293,17 +3293,17 @@ func (d *Deposit) CollateralizationPercentage() (*big.Int, error) { err, d.callerOptions.From, nil, - "collateralizationPercentage", + "keepAddress", ) } return result, err } -func (d *Deposit) CollateralizationPercentageAtBlock( +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, @@ -3313,22 +3313,16 @@ func (d *Deposit) CollateralizationPercentageAtBlock( d.caller, d.errorResolver, d.contractAddress, - "collateralizationPercentage", + "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) LotSizeTbtc() (*big.Int, error) { + var result *big.Int + result, err := d.contract.LotSizeTbtc( d.callerOptions, ) @@ -3337,17 +3331,17 @@ func (d *Deposit) FundingInfo() (fundingInfo, error) { err, d.callerOptions.From, nil, - "fundingInfo", + "lotSizeTbtc", ) } return result, err } -func (d *Deposit) FundingInfoAtBlock( +func (d *Deposit) LotSizeTbtcAtBlock( blockNumber *big.Int, -) (fundingInfo, error) { - var result fundingInfo +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3357,16 +3351,16 @@ func (d *Deposit) FundingInfoAtBlock( d.caller, d.errorResolver, d.contractAddress, - "fundingInfo", + "lotSizeTbtc", &result, ) return result, err } -func (d *Deposit) InActive() (bool, error) { - var result bool - result, err := d.contract.InActive( +func (d *Deposit) SeverelyUndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := d.contract.SeverelyUndercollateralizedThresholdPercent( d.callerOptions, ) @@ -3375,17 +3369,17 @@ func (d *Deposit) InActive() (bool, error) { err, d.callerOptions.From, nil, - "inActive", + "severelyUndercollateralizedThresholdPercent", ) } return result, err } -func (d *Deposit) InActiveAtBlock( +func (d *Deposit) SeverelyUndercollateralizedThresholdPercentAtBlock( blockNumber *big.Int, -) (bool, error) { - var result bool +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3395,16 +3389,16 @@ func (d *Deposit) InActiveAtBlock( d.caller, d.errorResolver, d.contractAddress, - "inActive", + "severelyUndercollateralizedThresholdPercent", &result, ) return result, err } -func (d *Deposit) WithdrawableAmount() (*big.Int, error) { +func (d *Deposit) RemainingTerm() (*big.Int, error) { var result *big.Int - result, err := d.contract.WithdrawableAmount( + result, err := d.contract.RemainingTerm( d.callerOptions, ) @@ -3413,14 +3407,14 @@ func (d *Deposit) WithdrawableAmount() (*big.Int, error) { err, d.callerOptions.From, nil, - "withdrawableAmount", + "remainingTerm", ) } return result, err } -func (d *Deposit) WithdrawableAmountAtBlock( +func (d *Deposit) RemainingTermAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3433,16 +3427,22 @@ func (d *Deposit) WithdrawableAmountAtBlock( d.caller, d.errorResolver, d.contractAddress, - "withdrawableAmount", + "remainingTerm", &result, ) return result, err } -func (d *Deposit) SeverelyUndercollateralizedThresholdPercent() (uint16, error) { - var result uint16 - result, err := d.contract.SeverelyUndercollateralizedThresholdPercent( +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, ) @@ -3451,17 +3451,17 @@ func (d *Deposit) SeverelyUndercollateralizedThresholdPercent() (uint16, error) err, d.callerOptions.From, nil, - "severelyUndercollateralizedThresholdPercent", + "fundingInfo", ) } return result, err } -func (d *Deposit) SeverelyUndercollateralizedThresholdPercentAtBlock( +func (d *Deposit) FundingInfoAtBlock( blockNumber *big.Int, -) (uint16, error) { - var result uint16 +) (fundingInfo, error) { + var result fundingInfo err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3471,16 +3471,16 @@ func (d *Deposit) SeverelyUndercollateralizedThresholdPercentAtBlock( d.caller, d.errorResolver, d.contractAddress, - "severelyUndercollateralizedThresholdPercent", + "fundingInfo", &result, ) return result, err } -func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { - var result *big.Int - result, err := d.contract.SignerFeeTbtc( +func (d *Deposit) InitialCollateralizedPercent() (uint16, error) { + var result uint16 + result, err := d.contract.InitialCollateralizedPercent( d.callerOptions, ) @@ -3489,17 +3489,17 @@ func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { err, d.callerOptions.From, nil, - "signerFeeTbtc", + "initialCollateralizedPercent", ) } return result, err } -func (d *Deposit) SignerFeeTbtcAtBlock( +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, @@ -3509,16 +3509,16 @@ func (d *Deposit) SignerFeeTbtcAtBlock( d.caller, d.errorResolver, d.contractAddress, - "signerFeeTbtc", + "initialCollateralizedPercent", &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, ) @@ -3527,14 +3527,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 @@ -3547,18 +3547,18 @@ func (d *Deposit) AuctionValueAtBlock( d.caller, d.errorResolver, d.contractAddress, - "auctionValue", + "withdrawableAmount", &result, ) return result, err } -func (d *Deposit) GetRedemptionTbtcRequirement( +func (d *Deposit) GetOwnerRedemptionTbtcRequirement( _redeemer common.Address, ) (*big.Int, error) { var result *big.Int - result, err := d.contract.GetRedemptionTbtcRequirement( + result, err := d.contract.GetOwnerRedemptionTbtcRequirement( d.callerOptions, _redeemer, ) @@ -3568,7 +3568,7 @@ func (d *Deposit) GetRedemptionTbtcRequirement( err, d.callerOptions.From, nil, - "getRedemptionTbtcRequirement", + "getOwnerRedemptionTbtcRequirement", _redeemer, ) } @@ -3576,7 +3576,7 @@ func (d *Deposit) GetRedemptionTbtcRequirement( return result, err } -func (d *Deposit) GetRedemptionTbtcRequirementAtBlock( +func (d *Deposit) GetOwnerRedemptionTbtcRequirementAtBlock( _redeemer common.Address, blockNumber *big.Int, ) (*big.Int, error) { @@ -3590,7 +3590,7 @@ func (d *Deposit) GetRedemptionTbtcRequirementAtBlock( d.caller, d.errorResolver, d.contractAddress, - "getRedemptionTbtcRequirement", + "getOwnerRedemptionTbtcRequirement", &result, _redeemer, ) @@ -3598,9 +3598,9 @@ func (d *Deposit) GetRedemptionTbtcRequirementAtBlock( return result, err } -func (d *Deposit) LotSizeSatoshis() (uint64, error) { - var result uint64 - result, err := d.contract.LotSizeSatoshis( +func (d *Deposit) UtxoValue() (*big.Int, error) { + var result *big.Int + result, err := d.contract.UtxoValue( d.callerOptions, ) @@ -3609,17 +3609,17 @@ func (d *Deposit) LotSizeSatoshis() (uint64, error) { err, d.callerOptions.From, nil, - "lotSizeSatoshis", + "utxoValue", ) } return result, err } -func (d *Deposit) LotSizeSatoshisAtBlock( +func (d *Deposit) UtxoValueAtBlock( blockNumber *big.Int, -) (uint64, error) { - var result uint64 +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( d.callerOptions.From, @@ -3629,16 +3629,16 @@ func (d *Deposit) LotSizeSatoshisAtBlock( d.caller, d.errorResolver, d.contractAddress, - "lotSizeSatoshis", + "utxoValue", &result, ) return result, err } -func (d *Deposit) UtxoValue() (*big.Int, error) { - var result *big.Int - result, err := d.contract.UtxoValue( +func (d *Deposit) LotSizeSatoshis() (uint64, error) { + var result uint64 + result, err := d.contract.LotSizeSatoshis( d.callerOptions, ) @@ -3647,17 +3647,17 @@ func (d *Deposit) UtxoValue() (*big.Int, error) { err, d.callerOptions.From, nil, - "utxoValue", + "lotSizeSatoshis", ) } return result, err } -func (d *Deposit) UtxoValueAtBlock( +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, @@ -3667,16 +3667,16 @@ func (d *Deposit) UtxoValueAtBlock( d.caller, d.errorResolver, d.contractAddress, - "utxoValue", + "lotSizeSatoshis", &result, ) return result, err } -func (d *Deposit) RemainingTerm() (*big.Int, error) { +func (d *Deposit) SignerFeeTbtc() (*big.Int, error) { var result *big.Int - result, err := d.contract.RemainingTerm( + result, err := d.contract.SignerFeeTbtc( d.callerOptions, ) @@ -3685,14 +3685,14 @@ func (d *Deposit) RemainingTerm() (*big.Int, error) { err, d.callerOptions.From, nil, - "remainingTerm", + "signerFeeTbtc", ) } return result, err } -func (d *Deposit) RemainingTermAtBlock( +func (d *Deposit) SignerFeeTbtcAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -3705,7 +3705,7 @@ func (d *Deposit) RemainingTermAtBlock( d.caller, d.errorResolver, d.contractAddress, - "remainingTerm", + "signerFeeTbtc", &result, ) @@ -3750,9 +3750,9 @@ func (d *Deposit) UndercollateralizedThresholdPercentAtBlock( 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, ) @@ -3761,17 +3761,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, @@ -3781,7 +3781,7 @@ func (d *Deposit) KeepAddressAtBlock( d.caller, d.errorResolver, d.contractAddress, - "keepAddress", + "currentState", &result, ) diff --git a/pkg/chain/ethereum/gen/contract/TBTCSystem.go b/pkg/chain/ethereum/gen/contract/TBTCSystem.go index 9b5d42d45..9580fe963 100644 --- a/pkg/chain/ethereum/gen/contract/TBTCSystem.go +++ b/pkg/chain/ethereum/gen/contract/TBTCSystem.go @@ -94,12 +94,21 @@ func NewTBTCSystem( // ----- Non-const Methods ------ // Transaction submission. -func (tbtcs *TBTCSystem) LogLiquidated( +func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdate( + _keepStakedFactory common.Address, + _fullyBackedFactory common.Address, + _factorySelector common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logLiquidated", + "submitting transaction beginKeepFactoriesUpdate", + "params: ", + fmt.Sprint( + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, + ), ) tbtcs.transactionMutex.Lock() @@ -124,20 +133,26 @@ func (tbtcs *TBTCSystem) LogLiquidated( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogLiquidated( + transaction, err := tbtcs.contract.BeginKeepFactoriesUpdate( transactorOptions, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logLiquidated", + "beginKeepFactoriesUpdate", + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) } tbtcsLogger.Infof( - "submitted transaction logLiquidated with id: [%v] and nonce [%v]", + "submitted transaction beginKeepFactoriesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -148,20 +163,26 @@ func (tbtcs *TBTCSystem) LogLiquidated( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogLiquidated( + transaction, err := tbtcs.contract.BeginKeepFactoriesUpdate( transactorOptions, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logLiquidated", + "beginKeepFactoriesUpdate", + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) } tbtcsLogger.Infof( - "submitted transaction logLiquidated with id: [%v] and nonce [%v]", + "submitted transaction beginKeepFactoriesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -176,7 +197,10 @@ func (tbtcs *TBTCSystem) LogLiquidated( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogLiquidated( +func (tbtcs *TBTCSystem) CallBeginKeepFactoriesUpdate( + _keepStakedFactory common.Address, + _fullyBackedFactory common.Address, + _factorySelector common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -188,34 +212,44 @@ func (tbtcs *TBTCSystem) CallLogLiquidated( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logLiquidated", + "beginKeepFactoriesUpdate", &result, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) return err } -func (tbtcs *TBTCSystem) LogLiquidatedGasEstimate() (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, - "logLiquidated", + "beginKeepFactoriesUpdate", tbtcs.contractABI, tbtcs.transactor, + _keepStakedFactory, + _fullyBackedFactory, + _factorySelector, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogExitedCourtesyCall( +func (tbtcs *TBTCSystem) RenounceOwnership( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logExitedCourtesyCall", + "submitting transaction renounceOwnership", ) tbtcs.transactionMutex.Lock() @@ -240,7 +274,7 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCall( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogExitedCourtesyCall( + transaction, err := tbtcs.contract.RenounceOwnership( transactorOptions, ) if err != nil { @@ -248,12 +282,12 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCall( err, tbtcs.transactorOptions.From, nil, - "logExitedCourtesyCall", + "renounceOwnership", ) } tbtcsLogger.Infof( - "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction renounceOwnership with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -264,7 +298,7 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCall( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogExitedCourtesyCall( + transaction, err := tbtcs.contract.RenounceOwnership( transactorOptions, ) if err != nil { @@ -272,12 +306,12 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCall( err, tbtcs.transactorOptions.From, nil, - "logExitedCourtesyCall", + "renounceOwnership", ) } tbtcsLogger.Infof( - "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", + "submitted transaction renounceOwnership with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -292,7 +326,7 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCall( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogExitedCourtesyCall( +func (tbtcs *TBTCSystem) CallRenounceOwnership( blockNumber *big.Int, ) error { var result interface{} = nil @@ -304,20 +338,20 @@ func (tbtcs *TBTCSystem) CallLogExitedCourtesyCall( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logExitedCourtesyCall", + "renounceOwnership", &result, ) return err } -func (tbtcs *TBTCSystem) LogExitedCourtesyCallGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) RenounceOwnershipGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logExitedCourtesyCall", + "renounceOwnership", tbtcs.contractABI, tbtcs.transactor, ) @@ -326,12 +360,12 @@ func (tbtcs *TBTCSystem) LogExitedCourtesyCallGasEstimate() (uint64, error) { } // Transaction submission. -func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( +func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAddition( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction refreshMinimumBondableValue", + "submitting transaction finalizeEthBtcPriceFeedAddition", ) tbtcs.transactionMutex.Lock() @@ -356,7 +390,7 @@ func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.RefreshMinimumBondableValue( + transaction, err := tbtcs.contract.FinalizeEthBtcPriceFeedAddition( transactorOptions, ) if err != nil { @@ -364,12 +398,12 @@ func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( err, tbtcs.transactorOptions.From, nil, - "refreshMinimumBondableValue", + "finalizeEthBtcPriceFeedAddition", ) } tbtcsLogger.Infof( - "submitted transaction refreshMinimumBondableValue with id: [%v] and nonce [%v]", + "submitted transaction finalizeEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -380,7 +414,7 @@ func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.RefreshMinimumBondableValue( + transaction, err := tbtcs.contract.FinalizeEthBtcPriceFeedAddition( transactorOptions, ) if err != nil { @@ -388,12 +422,12 @@ func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( err, tbtcs.transactorOptions.From, nil, - "refreshMinimumBondableValue", + "finalizeEthBtcPriceFeedAddition", ) } tbtcsLogger.Infof( - "submitted transaction refreshMinimumBondableValue with id: [%v] and nonce [%v]", + "submitted transaction finalizeEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -408,7 +442,7 @@ func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallRefreshMinimumBondableValue( +func (tbtcs *TBTCSystem) CallFinalizeEthBtcPriceFeedAddition( blockNumber *big.Int, ) error { var result interface{} = nil @@ -420,20 +454,20 @@ func (tbtcs *TBTCSystem) CallRefreshMinimumBondableValue( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "refreshMinimumBondableValue", + "finalizeEthBtcPriceFeedAddition", &result, ) return err } -func (tbtcs *TBTCSystem) RefreshMinimumBondableValueGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAdditionGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "refreshMinimumBondableValue", + "finalizeEthBtcPriceFeedAddition", tbtcs.contractABI, tbtcs.transactor, ) @@ -442,17 +476,12 @@ func (tbtcs *TBTCSystem) RefreshMinimumBondableValueGasEstimate() (uint64, error } // Transaction submission. -func (tbtcs *TBTCSystem) TransferOwnership( - newOwner common.Address, +func (tbtcs *TBTCSystem) LogExitedCourtesyCall( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction transferOwnership", - "params: ", - fmt.Sprint( - newOwner, - ), + "submitting transaction logExitedCourtesyCall", ) tbtcs.transactionMutex.Lock() @@ -477,22 +506,20 @@ func (tbtcs *TBTCSystem) TransferOwnership( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.TransferOwnership( + transaction, err := tbtcs.contract.LogExitedCourtesyCall( transactorOptions, - newOwner, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "transferOwnership", - newOwner, + "logExitedCourtesyCall", ) } tbtcsLogger.Infof( - "submitted transaction transferOwnership with id: [%v] and nonce [%v]", + "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -503,22 +530,20 @@ func (tbtcs *TBTCSystem) TransferOwnership( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.TransferOwnership( + transaction, err := tbtcs.contract.LogExitedCourtesyCall( transactorOptions, - newOwner, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "transferOwnership", - newOwner, + "logExitedCourtesyCall", ) } tbtcsLogger.Infof( - "submitted transaction transferOwnership with id: [%v] and nonce [%v]", + "submitted transaction logExitedCourtesyCall with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -533,8 +558,7 @@ func (tbtcs *TBTCSystem) TransferOwnership( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallTransferOwnership( - newOwner common.Address, +func (tbtcs *TBTCSystem) CallLogExitedCourtesyCall( blockNumber *big.Int, ) error { var result interface{} = nil @@ -546,46 +570,38 @@ func (tbtcs *TBTCSystem) CallTransferOwnership( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "transferOwnership", + "logExitedCourtesyCall", &result, - newOwner, ) return err } -func (tbtcs *TBTCSystem) TransferOwnershipGasEstimate( - newOwner common.Address, -) (uint64, error) { +func (tbtcs *TBTCSystem) LogExitedCourtesyCallGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "transferOwnership", + "logExitedCourtesyCall", tbtcs.contractABI, tbtcs.transactor, - newOwner, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdate( - _keepStakedFactory common.Address, - _fullyBackedFactory common.Address, - _factorySelector common.Address, +func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdate( + _signerFeeDivisor uint16, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction beginKeepFactoriesUpdate", + "submitting transaction beginSignerFeeDivisorUpdate", "params: ", fmt.Sprint( - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + _signerFeeDivisor, ), ) @@ -611,26 +627,22 @@ func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.BeginKeepFactoriesUpdate( + transaction, err := tbtcs.contract.BeginSignerFeeDivisorUpdate( transactorOptions, - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + _signerFeeDivisor, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginKeepFactoriesUpdate", - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + "beginSignerFeeDivisorUpdate", + _signerFeeDivisor, ) } tbtcsLogger.Infof( - "submitted transaction beginKeepFactoriesUpdate with id: [%v] and nonce [%v]", + "submitted transaction beginSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -641,26 +653,22 @@ func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.BeginKeepFactoriesUpdate( + transaction, err := tbtcs.contract.BeginSignerFeeDivisorUpdate( transactorOptions, - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + _signerFeeDivisor, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginKeepFactoriesUpdate", - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + "beginSignerFeeDivisorUpdate", + _signerFeeDivisor, ) } tbtcsLogger.Infof( - "submitted transaction beginKeepFactoriesUpdate with id: [%v] and nonce [%v]", + "submitted transaction beginSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -675,10 +683,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) CallBeginSignerFeeDivisorUpdate( + _signerFeeDivisor uint16, blockNumber *big.Int, ) error { var result interface{} = nil @@ -690,44 +696,43 @@ func (tbtcs *TBTCSystem) CallBeginKeepFactoriesUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "beginKeepFactoriesUpdate", + "beginSignerFeeDivisorUpdate", &result, - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + _signerFeeDivisor, ) return err } -func (tbtcs *TBTCSystem) BeginKeepFactoriesUpdateGasEstimate( - _keepStakedFactory common.Address, - _fullyBackedFactory common.Address, - _factorySelector common.Address, +func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdateGasEstimate( + _signerFeeDivisor uint16, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "beginKeepFactoriesUpdate", + "beginSignerFeeDivisorUpdate", tbtcs.contractABI, tbtcs.transactor, - _keepStakedFactory, - _fullyBackedFactory, - _factorySelector, + _signerFeeDivisor, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogCourtesyCalled( +func (tbtcs *TBTCSystem) LogFunderRequestedAbort( + _abortOutputScript []uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logCourtesyCalled", + "submitting transaction logFunderRequestedAbort", + "params: ", + fmt.Sprint( + _abortOutputScript, + ), ) tbtcs.transactionMutex.Lock() @@ -752,20 +757,22 @@ func (tbtcs *TBTCSystem) LogCourtesyCalled( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogCourtesyCalled( + transaction, err := tbtcs.contract.LogFunderRequestedAbort( transactorOptions, + _abortOutputScript, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logCourtesyCalled", + "logFunderRequestedAbort", + _abortOutputScript, ) } tbtcsLogger.Infof( - "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", + "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -776,20 +783,22 @@ func (tbtcs *TBTCSystem) LogCourtesyCalled( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogCourtesyCalled( + transaction, err := tbtcs.contract.LogFunderRequestedAbort( transactorOptions, + _abortOutputScript, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logCourtesyCalled", + "logFunderRequestedAbort", + _abortOutputScript, ) } tbtcsLogger.Infof( - "submitted transaction logCourtesyCalled with id: [%v] and nonce [%v]", + "submitted transaction logFunderRequestedAbort with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -804,7 +813,8 @@ func (tbtcs *TBTCSystem) LogCourtesyCalled( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogCourtesyCalled( +func (tbtcs *TBTCSystem) CallLogFunderRequestedAbort( + _abortOutputScript []uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -816,38 +826,51 @@ func (tbtcs *TBTCSystem) CallLogCourtesyCalled( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logCourtesyCalled", + "logFunderRequestedAbort", &result, + _abortOutputScript, ) return err } -func (tbtcs *TBTCSystem) LogCourtesyCalledGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogFunderRequestedAbortGasEstimate( + _abortOutputScript []uint8, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logCourtesyCalled", + "logFunderRequestedAbort", tbtcs.contractABI, tbtcs.transactor, + _abortOutputScript, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) RenounceOwnership( +func (tbtcs *TBTCSystem) LogGotRedemptionSignature( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction renounceOwnership", - ) - - tbtcs.transactionMutex.Lock() - defer tbtcs.transactionMutex.Unlock() + "submitting transaction logGotRedemptionSignature", + "params: ", + fmt.Sprint( + _digest, + _r, + _s, + ), + ) + + tbtcs.transactionMutex.Lock() + defer tbtcs.transactionMutex.Unlock() // create a copy transactorOptions := new(bind.TransactOpts) @@ -868,20 +891,26 @@ func (tbtcs *TBTCSystem) RenounceOwnership( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.RenounceOwnership( + transaction, err := tbtcs.contract.LogGotRedemptionSignature( transactorOptions, + _digest, + _r, + _s, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "renounceOwnership", + "logGotRedemptionSignature", + _digest, + _r, + _s, ) } tbtcsLogger.Infof( - "submitted transaction renounceOwnership with id: [%v] and nonce [%v]", + "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -892,20 +921,26 @@ func (tbtcs *TBTCSystem) RenounceOwnership( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.RenounceOwnership( + transaction, err := tbtcs.contract.LogGotRedemptionSignature( transactorOptions, + _digest, + _r, + _s, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "renounceOwnership", + "logGotRedemptionSignature", + _digest, + _r, + _s, ) } tbtcsLogger.Infof( - "submitted transaction renounceOwnership with id: [%v] and nonce [%v]", + "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -920,7 +955,10 @@ func (tbtcs *TBTCSystem) RenounceOwnership( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallRenounceOwnership( +func (tbtcs *TBTCSystem) CallLogGotRedemptionSignature( + _digest [32]uint8, + _r [32]uint8, + _s [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -932,39 +970,44 @@ func (tbtcs *TBTCSystem) CallRenounceOwnership( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "renounceOwnership", + "logGotRedemptionSignature", &result, + _digest, + _r, + _s, ) return err } -func (tbtcs *TBTCSystem) RenounceOwnershipGasEstimate() (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, - "renounceOwnership", + "logGotRedemptionSignature", tbtcs.contractABI, tbtcs.transactor, + _digest, + _r, + _s, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogCreated( - _keepAddress common.Address, +func (tbtcs *TBTCSystem) EmergencyPauseNewDeposits( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logCreated", - "params: ", - fmt.Sprint( - _keepAddress, - ), + "submitting transaction emergencyPauseNewDeposits", ) tbtcs.transactionMutex.Lock() @@ -989,22 +1032,20 @@ func (tbtcs *TBTCSystem) LogCreated( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogCreated( + transaction, err := tbtcs.contract.EmergencyPauseNewDeposits( transactorOptions, - _keepAddress, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logCreated", - _keepAddress, + "emergencyPauseNewDeposits", ) } tbtcsLogger.Infof( - "submitted transaction logCreated with id: [%v] and nonce [%v]", + "submitted transaction emergencyPauseNewDeposits with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1015,22 +1056,20 @@ func (tbtcs *TBTCSystem) LogCreated( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogCreated( + transaction, err := tbtcs.contract.EmergencyPauseNewDeposits( transactorOptions, - _keepAddress, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logCreated", - _keepAddress, + "emergencyPauseNewDeposits", ) } tbtcsLogger.Infof( - "submitted transaction logCreated with id: [%v] and nonce [%v]", + "submitted transaction emergencyPauseNewDeposits with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1045,8 +1084,7 @@ func (tbtcs *TBTCSystem) LogCreated( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogCreated( - _keepAddress common.Address, +func (tbtcs *TBTCSystem) CallEmergencyPauseNewDeposits( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1058,53 +1096,34 @@ func (tbtcs *TBTCSystem) CallLogCreated( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logCreated", + "emergencyPauseNewDeposits", &result, - _keepAddress, ) return err } -func (tbtcs *TBTCSystem) LogCreatedGasEstimate( - _keepAddress common.Address, -) (uint64, error) { +func (tbtcs *TBTCSystem) EmergencyPauseNewDepositsGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logCreated", + "emergencyPauseNewDeposits", tbtcs.contractABI, tbtcs.transactor, - _keepAddress, ) return result, err } // 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) FinalizeKeepFactoriesUpdate( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logRedemptionRequested", - "params: ", - fmt.Sprint( - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, - ), + "submitting transaction finalizeKeepFactoriesUpdate", ) tbtcs.transactionMutex.Lock() @@ -1129,32 +1148,20 @@ func (tbtcs *TBTCSystem) LogRedemptionRequested( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogRedemptionRequested( + transaction, err := tbtcs.contract.FinalizeKeepFactoriesUpdate( 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, + "finalizeKeepFactoriesUpdate", ) } tbtcsLogger.Infof( - "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", + "submitted transaction finalizeKeepFactoriesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1165,32 +1172,20 @@ func (tbtcs *TBTCSystem) LogRedemptionRequested( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogRedemptionRequested( + transaction, err := tbtcs.contract.FinalizeKeepFactoriesUpdate( 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, + "finalizeKeepFactoriesUpdate", ) } tbtcsLogger.Infof( - "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", + "submitted transaction finalizeKeepFactoriesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1205,13 +1200,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) CallFinalizeKeepFactoriesUpdate( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1223,59 +1212,38 @@ func (tbtcs *TBTCSystem) CallLogRedemptionRequested( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logRedemptionRequested", + "finalizeKeepFactoriesUpdate", &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) FinalizeKeepFactoriesUpdateGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logRedemptionRequested", + "finalizeKeepFactoriesUpdate", tbtcs.contractABI, tbtcs.transactor, - _requester, - _digest, - _utxoValue, - _redeemerOutputScript, - _requestedFee, - _outpoint, ) 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, ), ) @@ -1301,24 +1269,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(), ) @@ -1329,24 +1295,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(), ) @@ -1361,9 +1325,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 @@ -1375,49 +1338,42 @@ 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) BeginCollateralizationThresholdsUpdate( - _initialCollateralizedPercent uint16, - _undercollateralizedThresholdPercent uint16, - _severelyUndercollateralizedThresholdPercent uint16, +func (tbtcs *TBTCSystem) LogFunded( + _txid [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction beginCollateralizationThresholdsUpdate", + "submitting transaction logFunded", "params: ", fmt.Sprint( - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, + _txid, ), ) @@ -1443,26 +1399,22 @@ func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.BeginCollateralizationThresholdsUpdate( + transaction, err := tbtcs.contract.LogFunded( transactorOptions, - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, + _txid, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginCollateralizationThresholdsUpdate", - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, + "logFunded", + _txid, ) } tbtcsLogger.Infof( - "submitted transaction beginCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", + "submitted transaction logFunded with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1473,26 +1425,22 @@ func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.BeginCollateralizationThresholdsUpdate( + transaction, err := tbtcs.contract.LogFunded( transactorOptions, - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, + _txid, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginCollateralizationThresholdsUpdate", - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, + "logFunded", + _txid, ) } tbtcsLogger.Infof( - "submitted transaction beginCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", + "submitted transaction logFunded with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1507,10 +1455,8 @@ func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallBeginCollateralizationThresholdsUpdate( - _initialCollateralizedPercent uint16, - _undercollateralizedThresholdPercent uint16, - _severelyUndercollateralizedThresholdPercent uint16, +func (tbtcs *TBTCSystem) CallLogFunded( + _txid [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -1522,44 +1468,38 @@ func (tbtcs *TBTCSystem) CallBeginCollateralizationThresholdsUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "beginCollateralizationThresholdsUpdate", + "logFunded", &result, - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, + _txid, ) return err } -func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdateGasEstimate( - _initialCollateralizedPercent uint16, - _undercollateralizedThresholdPercent uint16, - _severelyUndercollateralizedThresholdPercent uint16, +func (tbtcs *TBTCSystem) LogFundedGasEstimate( + _txid [32]uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "beginCollateralizationThresholdsUpdate", + "logFunded", tbtcs.contractABI, tbtcs.transactor, - _initialCollateralizedPercent, - _undercollateralizedThresholdPercent, - _severelyUndercollateralizedThresholdPercent, + _txid, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) EmergencyPauseNewDeposits( +func (tbtcs *TBTCSystem) LogSetupFailed( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction emergencyPauseNewDeposits", + "submitting transaction logSetupFailed", ) tbtcs.transactionMutex.Lock() @@ -1584,7 +1524,7 @@ func (tbtcs *TBTCSystem) EmergencyPauseNewDeposits( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.EmergencyPauseNewDeposits( + transaction, err := tbtcs.contract.LogSetupFailed( transactorOptions, ) if err != nil { @@ -1592,12 +1532,12 @@ func (tbtcs *TBTCSystem) EmergencyPauseNewDeposits( err, tbtcs.transactorOptions.From, nil, - "emergencyPauseNewDeposits", + "logSetupFailed", ) } tbtcsLogger.Infof( - "submitted transaction emergencyPauseNewDeposits with id: [%v] and nonce [%v]", + "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1608,7 +1548,7 @@ func (tbtcs *TBTCSystem) EmergencyPauseNewDeposits( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.EmergencyPauseNewDeposits( + transaction, err := tbtcs.contract.LogSetupFailed( transactorOptions, ) if err != nil { @@ -1616,12 +1556,12 @@ func (tbtcs *TBTCSystem) EmergencyPauseNewDeposits( err, tbtcs.transactorOptions.From, nil, - "emergencyPauseNewDeposits", + "logSetupFailed", ) } tbtcsLogger.Infof( - "submitted transaction emergencyPauseNewDeposits with id: [%v] and nonce [%v]", + "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1636,7 +1576,7 @@ func (tbtcs *TBTCSystem) EmergencyPauseNewDeposits( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallEmergencyPauseNewDeposits( +func (tbtcs *TBTCSystem) CallLogSetupFailed( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1648,20 +1588,20 @@ func (tbtcs *TBTCSystem) CallEmergencyPauseNewDeposits( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "emergencyPauseNewDeposits", + "logSetupFailed", &result, ) return err } -func (tbtcs *TBTCSystem) EmergencyPauseNewDepositsGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogSetupFailedGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "emergencyPauseNewDeposits", + "logSetupFailed", tbtcs.contractABI, tbtcs.transactor, ) @@ -1670,17 +1610,12 @@ func (tbtcs *TBTCSystem) EmergencyPauseNewDepositsGasEstimate() (uint64, error) } // Transaction submission. -func (tbtcs *TBTCSystem) LogRedeemed( - _txid [32]uint8, +func (tbtcs *TBTCSystem) LogFraudDuringSetup( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logRedeemed", - "params: ", - fmt.Sprint( - _txid, - ), + "submitting transaction logFraudDuringSetup", ) tbtcs.transactionMutex.Lock() @@ -1705,22 +1640,20 @@ func (tbtcs *TBTCSystem) LogRedeemed( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogRedeemed( + transaction, err := tbtcs.contract.LogFraudDuringSetup( transactorOptions, - _txid, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logRedeemed", - _txid, + "logFraudDuringSetup", ) } tbtcsLogger.Infof( - "submitted transaction logRedeemed with id: [%v] and nonce [%v]", + "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1731,22 +1664,20 @@ func (tbtcs *TBTCSystem) LogRedeemed( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogRedeemed( + transaction, err := tbtcs.contract.LogFraudDuringSetup( transactorOptions, - _txid, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logRedeemed", - _txid, + "logFraudDuringSetup", ) } tbtcsLogger.Infof( - "submitted transaction logRedeemed with id: [%v] and nonce [%v]", + "submitted transaction logFraudDuringSetup with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1761,8 +1692,7 @@ func (tbtcs *TBTCSystem) LogRedeemed( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogRedeemed( - _txid [32]uint8, +func (tbtcs *TBTCSystem) CallLogFraudDuringSetup( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1774,38 +1704,34 @@ func (tbtcs *TBTCSystem) CallLogRedeemed( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logRedeemed", + "logFraudDuringSetup", &result, - _txid, ) return err } -func (tbtcs *TBTCSystem) LogRedeemedGasEstimate( - _txid [32]uint8, -) (uint64, error) { +func (tbtcs *TBTCSystem) LogFraudDuringSetupGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logRedeemed", + "logFraudDuringSetup", tbtcs.contractABI, tbtcs.transactor, - _txid, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdate( +func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction finalizeCollateralizationThresholdsUpdate", + "submitting transaction finalizeLotSizesUpdate", ) tbtcs.transactionMutex.Lock() @@ -1830,7 +1756,7 @@ func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.FinalizeCollateralizationThresholdsUpdate( + transaction, err := tbtcs.contract.FinalizeLotSizesUpdate( transactorOptions, ) if err != nil { @@ -1838,12 +1764,12 @@ func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdate( err, tbtcs.transactorOptions.From, nil, - "finalizeCollateralizationThresholdsUpdate", + "finalizeLotSizesUpdate", ) } tbtcsLogger.Infof( - "submitted transaction finalizeCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", + "submitted transaction finalizeLotSizesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1854,7 +1780,7 @@ func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.FinalizeCollateralizationThresholdsUpdate( + transaction, err := tbtcs.contract.FinalizeLotSizesUpdate( transactorOptions, ) if err != nil { @@ -1862,12 +1788,12 @@ func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdate( err, tbtcs.transactorOptions.From, nil, - "finalizeCollateralizationThresholdsUpdate", + "finalizeLotSizesUpdate", ) } tbtcsLogger.Infof( - "submitted transaction finalizeCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", + "submitted transaction finalizeLotSizesUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -1882,7 +1808,7 @@ func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallFinalizeCollateralizationThresholdsUpdate( +func (tbtcs *TBTCSystem) CallFinalizeLotSizesUpdate( blockNumber *big.Int, ) error { var result interface{} = nil @@ -1894,20 +1820,20 @@ func (tbtcs *TBTCSystem) CallFinalizeCollateralizationThresholdsUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "finalizeCollateralizationThresholdsUpdate", + "finalizeLotSizesUpdate", &result, ) return err } -func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdateGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) FinalizeLotSizesUpdateGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "finalizeCollateralizationThresholdsUpdate", + "finalizeLotSizesUpdate", tbtcs.contractABI, tbtcs.transactor, ) @@ -1916,21 +1842,17 @@ func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdateGasEstimate() } // 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() @@ -1940,8 +1862,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", @@ -1957,24 +1877,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(), ) @@ -1985,24 +1903,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(), ) @@ -2017,61 +1933,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) 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() @@ -2096,22 +2002,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(), ) @@ -2122,22 +2026,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(), ) @@ -2152,8 +2054,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 @@ -2165,43 +2066,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) LogStartedLiquidation( - _wasFraud bool, +func (tbtcs *TBTCSystem) ResumeNewDeposits( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logStartedLiquidation", - "params: ", - fmt.Sprint( - _wasFraud, - ), + "submitting transaction resumeNewDeposits", ) tbtcs.transactionMutex.Lock() @@ -2226,22 +2118,20 @@ func (tbtcs *TBTCSystem) LogStartedLiquidation( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogStartedLiquidation( + transaction, err := tbtcs.contract.ResumeNewDeposits( transactorOptions, - _wasFraud, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logStartedLiquidation", - _wasFraud, + "resumeNewDeposits", ) } tbtcsLogger.Infof( - "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction resumeNewDeposits with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2252,22 +2142,20 @@ func (tbtcs *TBTCSystem) LogStartedLiquidation( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogStartedLiquidation( + transaction, err := tbtcs.contract.ResumeNewDeposits( transactorOptions, - _wasFraud, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logStartedLiquidation", - _wasFraud, + "resumeNewDeposits", ) } tbtcsLogger.Infof( - "submitted transaction logStartedLiquidation with id: [%v] and nonce [%v]", + "submitted transaction resumeNewDeposits with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2282,8 +2170,7 @@ func (tbtcs *TBTCSystem) LogStartedLiquidation( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogStartedLiquidation( - _wasFraud bool, +func (tbtcs *TBTCSystem) CallResumeNewDeposits( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2295,38 +2182,41 @@ func (tbtcs *TBTCSystem) CallLogStartedLiquidation( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logStartedLiquidation", + "resumeNewDeposits", &result, - _wasFraud, ) return err } -func (tbtcs *TBTCSystem) LogStartedLiquidationGasEstimate( - _wasFraud bool, -) (uint64, error) { +func (tbtcs *TBTCSystem) ResumeNewDepositsGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logStartedLiquidation", + "resumeNewDeposits", tbtcs.contractABI, tbtcs.transactor, - _wasFraud, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAddition( +func (tbtcs *TBTCSystem) LogRegisteredPubkey( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction finalizeEthBtcPriceFeedAddition", + "submitting transaction logRegisteredPubkey", + "params: ", + fmt.Sprint( + _signingGroupPubkeyX, + _signingGroupPubkeyY, + ), ) tbtcs.transactionMutex.Lock() @@ -2351,20 +2241,24 @@ func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAddition( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.FinalizeEthBtcPriceFeedAddition( + transaction, err := tbtcs.contract.LogRegisteredPubkey( transactorOptions, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeEthBtcPriceFeedAddition", + "logRegisteredPubkey", + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) } tbtcsLogger.Infof( - "submitted transaction finalizeEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2375,20 +2269,24 @@ func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAddition( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.FinalizeEthBtcPriceFeedAddition( + transaction, err := tbtcs.contract.LogRegisteredPubkey( transactorOptions, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeEthBtcPriceFeedAddition", + "logRegisteredPubkey", + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) } tbtcsLogger.Infof( - "submitted transaction finalizeEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + "submitted transaction logRegisteredPubkey with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2403,7 +2301,9 @@ func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAddition( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallFinalizeEthBtcPriceFeedAddition( +func (tbtcs *TBTCSystem) CallLogRegisteredPubkey( + _signingGroupPubkeyX [32]uint8, + _signingGroupPubkeyY [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2415,34 +2315,41 @@ func (tbtcs *TBTCSystem) CallFinalizeEthBtcPriceFeedAddition( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "finalizeEthBtcPriceFeedAddition", + "logRegisteredPubkey", &result, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) return err } -func (tbtcs *TBTCSystem) FinalizeEthBtcPriceFeedAdditionGasEstimate() (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, - "finalizeEthBtcPriceFeedAddition", + "logRegisteredPubkey", tbtcs.contractABI, tbtcs.transactor, + _signingGroupPubkeyX, + _signingGroupPubkeyY, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( +func (tbtcs *TBTCSystem) RefreshMinimumBondableValue( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction finalizeLotSizesUpdate", + "submitting transaction refreshMinimumBondableValue", ) tbtcs.transactionMutex.Lock() @@ -2467,7 +2374,7 @@ func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.FinalizeLotSizesUpdate( + transaction, err := tbtcs.contract.RefreshMinimumBondableValue( transactorOptions, ) if err != nil { @@ -2475,12 +2382,12 @@ func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( err, tbtcs.transactorOptions.From, nil, - "finalizeLotSizesUpdate", + "refreshMinimumBondableValue", ) } tbtcsLogger.Infof( - "submitted transaction finalizeLotSizesUpdate with id: [%v] and nonce [%v]", + "submitted transaction refreshMinimumBondableValue with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2491,7 +2398,7 @@ func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.FinalizeLotSizesUpdate( + transaction, err := tbtcs.contract.RefreshMinimumBondableValue( transactorOptions, ) if err != nil { @@ -2499,12 +2406,12 @@ func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( err, tbtcs.transactorOptions.From, nil, - "finalizeLotSizesUpdate", + "refreshMinimumBondableValue", ) } tbtcsLogger.Infof( - "submitted transaction finalizeLotSizesUpdate with id: [%v] and nonce [%v]", + "submitted transaction refreshMinimumBondableValue with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2519,7 +2426,7 @@ func (tbtcs *TBTCSystem) FinalizeLotSizesUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallFinalizeLotSizesUpdate( +func (tbtcs *TBTCSystem) CallRefreshMinimumBondableValue( blockNumber *big.Int, ) error { var result interface{} = nil @@ -2531,20 +2438,20 @@ func (tbtcs *TBTCSystem) CallFinalizeLotSizesUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "finalizeLotSizesUpdate", + "refreshMinimumBondableValue", &result, ) return err } -func (tbtcs *TBTCSystem) FinalizeLotSizesUpdateGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) RefreshMinimumBondableValueGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "finalizeLotSizesUpdate", + "refreshMinimumBondableValue", tbtcs.contractABI, tbtcs.transactor, ) @@ -2553,12 +2460,33 @@ func (tbtcs *TBTCSystem) FinalizeLotSizesUpdateGasEstimate() (uint64, error) { } // Transaction submission. -func (tbtcs *TBTCSystem) ResumeNewDeposits( +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 resumeNewDeposits", + "submitting transaction initialize", + "params: ", + fmt.Sprint( + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, + ), ) tbtcs.transactionMutex.Lock() @@ -2583,20 +2511,38 @@ func (tbtcs *TBTCSystem) ResumeNewDeposits( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.ResumeNewDeposits( + 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, - "resumeNewDeposits", + "initialize", + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ) } tbtcsLogger.Infof( - "submitted transaction resumeNewDeposits with id: [%v] and nonce [%v]", + "submitted transaction initialize with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2607,20 +2553,38 @@ func (tbtcs *TBTCSystem) ResumeNewDeposits( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.ResumeNewDeposits( + 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, - "resumeNewDeposits", + "initialize", + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ) } tbtcsLogger.Infof( - "submitted transaction resumeNewDeposits with id: [%v] and nonce [%v]", + "submitted transaction initialize with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2635,7 +2599,16 @@ func (tbtcs *TBTCSystem) ResumeNewDeposits( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallResumeNewDeposits( +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 @@ -2647,34 +2620,77 @@ func (tbtcs *TBTCSystem) CallResumeNewDeposits( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "resumeNewDeposits", + "initialize", &result, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ) return err } -func (tbtcs *TBTCSystem) ResumeNewDepositsGasEstimate() (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, - "resumeNewDeposits", + "initialize", tbtcs.contractABI, tbtcs.transactor, + _defaultKeepFactory, + _depositFactory, + _masterDepositAddress, + _tbtcToken, + _tbtcDepositToken, + _feeRebateToken, + _vendingMachine, + _keepThreshold, + _keepSize, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogSetupFailed( +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 logSetupFailed", + "submitting transaction logRedemptionRequested", + "params: ", + fmt.Sprint( + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, + ), ) tbtcs.transactionMutex.Lock() @@ -2699,20 +2715,32 @@ func (tbtcs *TBTCSystem) LogSetupFailed( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogSetupFailed( + 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, - "logSetupFailed", + "logRedemptionRequested", + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) } tbtcsLogger.Infof( - "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", + "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2723,20 +2751,32 @@ func (tbtcs *TBTCSystem) LogSetupFailed( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogSetupFailed( + 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, - "logSetupFailed", + "logRedemptionRequested", + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) } tbtcsLogger.Infof( - "submitted transaction logSetupFailed with id: [%v] and nonce [%v]", + "submitted transaction logRedemptionRequested with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2751,7 +2791,13 @@ func (tbtcs *TBTCSystem) LogSetupFailed( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogSetupFailed( +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 @@ -2763,54 +2809,57 @@ func (tbtcs *TBTCSystem) CallLogSetupFailed( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logSetupFailed", + "logRedemptionRequested", &result, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) return err } -func (tbtcs *TBTCSystem) LogSetupFailedGasEstimate() (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, - "logSetupFailed", + "logRedemptionRequested", tbtcs.contractABI, tbtcs.transactor, + _requester, + _digest, + _utxoValue, + _redeemerOutputScript, + _requestedFee, + _outpoint, ) 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) TransferOwnership( + newOwner common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction initialize", + "submitting transaction transferOwnership", "params: ", fmt.Sprint( - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, + newOwner, ), ) @@ -2836,38 +2885,22 @@ func (tbtcs *TBTCSystem) Initialize( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.Initialize( + transaction, err := tbtcs.contract.TransferOwnership( transactorOptions, - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, + newOwner, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "initialize", - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, + "transferOwnership", + newOwner, ) } tbtcsLogger.Infof( - "submitted transaction initialize with id: [%v] and nonce [%v]", + "submitted transaction transferOwnership with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2878,38 +2911,22 @@ func (tbtcs *TBTCSystem) Initialize( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.Initialize( + transaction, err := tbtcs.contract.TransferOwnership( transactorOptions, - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, + newOwner, ) if err != nil { - return transaction, tbtcs.errorResolver.ResolveError( - err, - tbtcs.transactorOptions.From, - nil, - "initialize", - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, + return transaction, tbtcs.errorResolver.ResolveError( + err, + tbtcs.transactorOptions.From, + nil, + "transferOwnership", + newOwner, ) } tbtcsLogger.Infof( - "submitted transaction initialize with id: [%v] and nonce [%v]", + "submitted transaction transferOwnership with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -2924,16 +2941,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) CallTransferOwnership( + newOwner common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -2945,62 +2954,38 @@ func (tbtcs *TBTCSystem) CallInitialize( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "initialize", + "transferOwnership", &result, - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, + newOwner, ) 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) TransferOwnershipGasEstimate( + newOwner common.Address, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "initialize", + "transferOwnership", tbtcs.contractABI, tbtcs.transactor, - _defaultKeepFactory, - _depositFactory, - _masterDepositAddress, - _tbtcToken, - _tbtcDepositToken, - _feeRebateToken, - _vendingMachine, - _keepThreshold, - _keepSize, + newOwner, ) 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() @@ -3025,7 +3010,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 { @@ -3033,12 +3018,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(), ) @@ -3049,7 +3034,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 { @@ -3057,12 +3042,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(), ) @@ -3077,7 +3062,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 @@ -3089,20 +3074,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, ) @@ -3111,16 +3096,20 @@ func (tbtcs *TBTCSystem) LogFraudDuringSetupGasEstimate() (uint64, error) { } // Transaction submission. -func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAddition( - _ethBtcPriceFeed common.Address, +func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdate( + _initialCollateralizedPercent uint16, + _undercollateralizedThresholdPercent uint16, + _severelyUndercollateralizedThresholdPercent uint16, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction beginEthBtcPriceFeedAddition", + "submitting transaction beginCollateralizationThresholdsUpdate", "params: ", fmt.Sprint( - _ethBtcPriceFeed, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ), ) @@ -3146,22 +3135,26 @@ func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAddition( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.BeginEthBtcPriceFeedAddition( + transaction, err := tbtcs.contract.BeginCollateralizationThresholdsUpdate( transactorOptions, - _ethBtcPriceFeed, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginEthBtcPriceFeedAddition", - _ethBtcPriceFeed, + "beginCollateralizationThresholdsUpdate", + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) } tbtcsLogger.Infof( - "submitted transaction beginEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + "submitted transaction beginCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3172,22 +3165,26 @@ func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAddition( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.BeginEthBtcPriceFeedAddition( + transaction, err := tbtcs.contract.BeginCollateralizationThresholdsUpdate( transactorOptions, - _ethBtcPriceFeed, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginEthBtcPriceFeedAddition", - _ethBtcPriceFeed, + "beginCollateralizationThresholdsUpdate", + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) } tbtcsLogger.Infof( - "submitted transaction beginEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", + "submitted transaction beginCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3202,8 +3199,10 @@ func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAddition( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallBeginEthBtcPriceFeedAddition( - _ethBtcPriceFeed common.Address, +func (tbtcs *TBTCSystem) CallBeginCollateralizationThresholdsUpdate( + _initialCollateralizedPercent uint16, + _undercollateralizedThresholdPercent uint16, + _severelyUndercollateralizedThresholdPercent uint16, blockNumber *big.Int, ) error { var result interface{} = nil @@ -3215,38 +3214,49 @@ func (tbtcs *TBTCSystem) CallBeginEthBtcPriceFeedAddition( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "beginEthBtcPriceFeedAddition", + "beginCollateralizationThresholdsUpdate", &result, - _ethBtcPriceFeed, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) return err } -func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAdditionGasEstimate( - _ethBtcPriceFeed common.Address, +func (tbtcs *TBTCSystem) BeginCollateralizationThresholdsUpdateGasEstimate( + _initialCollateralizedPercent uint16, + _undercollateralizedThresholdPercent uint16, + _severelyUndercollateralizedThresholdPercent uint16, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "beginEthBtcPriceFeedAddition", + "beginCollateralizationThresholdsUpdate", tbtcs.contractABI, tbtcs.transactor, - _ethBtcPriceFeed, + _initialCollateralizedPercent, + _undercollateralizedThresholdPercent, + _severelyUndercollateralizedThresholdPercent, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdate( +func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAddition( + _ethBtcPriceFeed common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction finalizeSignerFeeDivisorUpdate", + "submitting transaction beginEthBtcPriceFeedAddition", + "params: ", + fmt.Sprint( + _ethBtcPriceFeed, + ), ) tbtcs.transactionMutex.Lock() @@ -3271,20 +3281,22 @@ func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.FinalizeSignerFeeDivisorUpdate( + transaction, err := tbtcs.contract.BeginEthBtcPriceFeedAddition( transactorOptions, + _ethBtcPriceFeed, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeSignerFeeDivisorUpdate", + "beginEthBtcPriceFeedAddition", + _ethBtcPriceFeed, ) } tbtcsLogger.Infof( - "submitted transaction finalizeSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + "submitted transaction beginEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3295,20 +3307,22 @@ func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.FinalizeSignerFeeDivisorUpdate( + transaction, err := tbtcs.contract.BeginEthBtcPriceFeedAddition( transactorOptions, + _ethBtcPriceFeed, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeSignerFeeDivisorUpdate", + "beginEthBtcPriceFeedAddition", + _ethBtcPriceFeed, ) } tbtcsLogger.Infof( - "submitted transaction finalizeSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + "submitted transaction beginEthBtcPriceFeedAddition with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3323,7 +3337,8 @@ func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallFinalizeSignerFeeDivisorUpdate( +func (tbtcs *TBTCSystem) CallBeginEthBtcPriceFeedAddition( + _ethBtcPriceFeed common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -3335,39 +3350,38 @@ func (tbtcs *TBTCSystem) CallFinalizeSignerFeeDivisorUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "finalizeSignerFeeDivisorUpdate", + "beginEthBtcPriceFeedAddition", &result, + _ethBtcPriceFeed, ) return err } -func (tbtcs *TBTCSystem) FinalizeSignerFeeDivisorUpdateGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) BeginEthBtcPriceFeedAdditionGasEstimate( + _ethBtcPriceFeed common.Address, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "finalizeSignerFeeDivisorUpdate", + "beginEthBtcPriceFeedAddition", tbtcs.contractABI, tbtcs.transactor, + _ethBtcPriceFeed, ) 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() @@ -3392,22 +3406,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(), ) @@ -3418,22 +3430,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(), ) @@ -3448,8 +3458,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 @@ -3461,38 +3470,39 @@ 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) FinalizeKeepFactoriesUpdate( +func (tbtcs *TBTCSystem) LogCreated( + _keepAddress common.Address, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction finalizeKeepFactoriesUpdate", + "submitting transaction logCreated", + "params: ", + fmt.Sprint( + _keepAddress, + ), ) tbtcs.transactionMutex.Lock() @@ -3517,20 +3527,22 @@ func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.FinalizeKeepFactoriesUpdate( + transaction, err := tbtcs.contract.LogCreated( transactorOptions, + _keepAddress, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeKeepFactoriesUpdate", + "logCreated", + _keepAddress, ) } tbtcsLogger.Infof( - "submitted transaction finalizeKeepFactoriesUpdate with id: [%v] and nonce [%v]", + "submitted transaction logCreated with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3541,20 +3553,22 @@ func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.FinalizeKeepFactoriesUpdate( + transaction, err := tbtcs.contract.LogCreated( transactorOptions, + _keepAddress, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "finalizeKeepFactoriesUpdate", + "logCreated", + _keepAddress, ) } tbtcsLogger.Infof( - "submitted transaction finalizeKeepFactoriesUpdate with id: [%v] and nonce [%v]", + "submitted transaction logCreated with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3569,7 +3583,8 @@ func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallFinalizeKeepFactoriesUpdate( +func (tbtcs *TBTCSystem) CallLogCreated( + _keepAddress common.Address, blockNumber *big.Int, ) error { var result interface{} = nil @@ -3581,39 +3596,38 @@ func (tbtcs *TBTCSystem) CallFinalizeKeepFactoriesUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "finalizeKeepFactoriesUpdate", + "logCreated", &result, + _keepAddress, ) return err } -func (tbtcs *TBTCSystem) FinalizeKeepFactoriesUpdateGasEstimate() (uint64, error) { +func (tbtcs *TBTCSystem) LogCreatedGasEstimate( + _keepAddress common.Address, +) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "finalizeKeepFactoriesUpdate", + "logCreated", tbtcs.contractABI, tbtcs.transactor, + _keepAddress, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogFunded( - _txid [32]uint8, +func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdate( transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logFunded", - "params: ", - fmt.Sprint( - _txid, - ), + "submitting transaction finalizeCollateralizationThresholdsUpdate", ) tbtcs.transactionMutex.Lock() @@ -3638,22 +3652,20 @@ func (tbtcs *TBTCSystem) LogFunded( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogFunded( + transaction, err := tbtcs.contract.FinalizeCollateralizationThresholdsUpdate( transactorOptions, - _txid, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logFunded", - _txid, + "finalizeCollateralizationThresholdsUpdate", ) } tbtcsLogger.Infof( - "submitted transaction logFunded with id: [%v] and nonce [%v]", + "submitted transaction finalizeCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3664,22 +3676,20 @@ func (tbtcs *TBTCSystem) LogFunded( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogFunded( + transaction, err := tbtcs.contract.FinalizeCollateralizationThresholdsUpdate( transactorOptions, - _txid, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "logFunded", - _txid, + "finalizeCollateralizationThresholdsUpdate", ) } tbtcsLogger.Infof( - "submitted transaction logFunded with id: [%v] and nonce [%v]", + "submitted transaction finalizeCollateralizationThresholdsUpdate with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3694,8 +3704,7 @@ func (tbtcs *TBTCSystem) LogFunded( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallLogFunded( - _txid [32]uint8, +func (tbtcs *TBTCSystem) CallFinalizeCollateralizationThresholdsUpdate( blockNumber *big.Int, ) error { var result interface{} = nil @@ -3707,42 +3716,38 @@ func (tbtcs *TBTCSystem) CallLogFunded( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "logFunded", + "finalizeCollateralizationThresholdsUpdate", &result, - _txid, ) return err } -func (tbtcs *TBTCSystem) LogFundedGasEstimate( - _txid [32]uint8, -) (uint64, error) { +func (tbtcs *TBTCSystem) FinalizeCollateralizationThresholdsUpdateGasEstimate() (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logFunded", + "finalizeCollateralizationThresholdsUpdate", tbtcs.contractABI, tbtcs.transactor, - _txid, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdate( - _signerFeeDivisor uint16, +func (tbtcs *TBTCSystem) LogRedeemed( + _txid [32]uint8, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction beginSignerFeeDivisorUpdate", + "submitting transaction logRedeemed", "params: ", fmt.Sprint( - _signerFeeDivisor, + _txid, ), ) @@ -3768,22 +3773,22 @@ func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdate( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.BeginSignerFeeDivisorUpdate( + transaction, err := tbtcs.contract.LogRedeemed( transactorOptions, - _signerFeeDivisor, + _txid, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginSignerFeeDivisorUpdate", - _signerFeeDivisor, + "logRedeemed", + _txid, ) } tbtcsLogger.Infof( - "submitted transaction beginSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + "submitted transaction logRedeemed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3794,22 +3799,22 @@ func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdate( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.BeginSignerFeeDivisorUpdate( + transaction, err := tbtcs.contract.LogRedeemed( transactorOptions, - _signerFeeDivisor, + _txid, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, nil, - "beginSignerFeeDivisorUpdate", - _signerFeeDivisor, + "logRedeemed", + _txid, ) } tbtcsLogger.Infof( - "submitted transaction beginSignerFeeDivisorUpdate with id: [%v] and nonce [%v]", + "submitted transaction logRedeemed with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3824,8 +3829,8 @@ func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdate( } // Non-mutating call, not a transaction submission. -func (tbtcs *TBTCSystem) CallBeginSignerFeeDivisorUpdate( - _signerFeeDivisor uint16, +func (tbtcs *TBTCSystem) CallLogRedeemed( + _txid [32]uint8, blockNumber *big.Int, ) error { var result interface{} = nil @@ -3837,47 +3842,47 @@ func (tbtcs *TBTCSystem) CallBeginSignerFeeDivisorUpdate( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "beginSignerFeeDivisorUpdate", + "logRedeemed", &result, - _signerFeeDivisor, + _txid, ) return err } -func (tbtcs *TBTCSystem) BeginSignerFeeDivisorUpdateGasEstimate( - _signerFeeDivisor uint16, +func (tbtcs *TBTCSystem) LogRedeemedGasEstimate( + _txid [32]uint8, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "beginSignerFeeDivisorUpdate", + "logRedeemed", tbtcs.contractABI, tbtcs.transactor, - _signerFeeDivisor, + _txid, ) return result, err } // Transaction submission. -func (tbtcs *TBTCSystem) LogGotRedemptionSignature( - _digest [32]uint8, - _r [32]uint8, - _s [32]uint8, +func (tbtcs *TBTCSystem) RequestNewKeep( + _requestedLotSizeSatoshis uint64, + _maxSecuredLifetime *big.Int, + value *big.Int, transactionOptions ...ethutil.TransactionOptions, ) (*types.Transaction, error) { tbtcsLogger.Debug( - "submitting transaction logGotRedemptionSignature", + "submitting transaction requestNewKeep", "params: ", fmt.Sprint( - _digest, - _r, - _s, + _requestedLotSizeSatoshis, + _maxSecuredLifetime, ), + "value: ", value, ) tbtcs.transactionMutex.Lock() @@ -3887,6 +3892,8 @@ func (tbtcs *TBTCSystem) LogGotRedemptionSignature( 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", @@ -3902,26 +3909,24 @@ func (tbtcs *TBTCSystem) LogGotRedemptionSignature( transactorOptions.Nonce = new(big.Int).SetUint64(nonce) - transaction, err := tbtcs.contract.LogGotRedemptionSignature( + transaction, err := tbtcs.contract.RequestNewKeep( transactorOptions, - _digest, - _r, - _s, + _requestedLotSizeSatoshis, + _maxSecuredLifetime, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, - nil, - "logGotRedemptionSignature", - _digest, - _r, - _s, + value, + "requestNewKeep", + _requestedLotSizeSatoshis, + _maxSecuredLifetime, ) } tbtcsLogger.Infof( - "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", + "submitted transaction requestNewKeep with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3932,26 +3937,24 @@ func (tbtcs *TBTCSystem) LogGotRedemptionSignature( transactorOptions.GasLimit = transaction.Gas() transactorOptions.GasPrice = newGasPrice - transaction, err := tbtcs.contract.LogGotRedemptionSignature( + transaction, err := tbtcs.contract.RequestNewKeep( transactorOptions, - _digest, - _r, - _s, + _requestedLotSizeSatoshis, + _maxSecuredLifetime, ) if err != nil { return transaction, tbtcs.errorResolver.ResolveError( err, tbtcs.transactorOptions.From, - nil, - "logGotRedemptionSignature", - _digest, - _r, - _s, + value, + "requestNewKeep", + _requestedLotSizeSatoshis, + _maxSecuredLifetime, ) } tbtcsLogger.Infof( - "submitted transaction logGotRedemptionSignature with id: [%v] and nonce [%v]", + "submitted transaction requestNewKeep with id: [%v] and nonce [%v]", transaction.Hash().Hex(), transaction.Nonce(), ) @@ -3966,47 +3969,44 @@ 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) 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, - "logGotRedemptionSignature", + "requestNewKeep", &result, - _digest, - _r, - _s, + _requestedLotSizeSatoshis, + _maxSecuredLifetime, ) - return err + return result, err } -func (tbtcs *TBTCSystem) LogGotRedemptionSignatureGasEstimate( - _digest [32]uint8, - _r [32]uint8, - _s [32]uint8, +func (tbtcs *TBTCSystem) RequestNewKeepGasEstimate( + _requestedLotSizeSatoshis uint64, + _maxSecuredLifetime *big.Int, ) (uint64, error) { var result uint64 result, err := ethutil.EstimateGas( tbtcs.callerOptions.From, tbtcs.contractAddress, - "logGotRedemptionSignature", + "requestNewKeep", tbtcs.contractABI, tbtcs.transactor, - _digest, - _r, - _s, + _requestedLotSizeSatoshis, + _maxSecuredLifetime, ) return result, err @@ -4014,9 +4014,9 @@ func (tbtcs *TBTCSystem) LogGotRedemptionSignatureGasEstimate( // ----- Const Methods ------ -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, ) @@ -4025,14 +4025,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 @@ -4045,16 +4045,16 @@ func (tbtcs *TBTCSystem) GetSignerFeeDivisorAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getSignerFeeDivisor", + "keepThreshold", &result, ) return result, err } -func (tbtcs *TBTCSystem) PriceFeed() (common.Address, error) { - var result common.Address - result, err := tbtcs.contract.PriceFeed( +func (tbtcs *TBTCSystem) FetchRelayPreviousDifficulty() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.FetchRelayPreviousDifficulty( tbtcs.callerOptions, ) @@ -4063,17 +4063,17 @@ func (tbtcs *TBTCSystem) PriceFeed() (common.Address, error) { err, tbtcs.callerOptions.From, nil, - "priceFeed", + "fetchRelayPreviousDifficulty", ) } return result, err } -func (tbtcs *TBTCSystem) PriceFeedAtBlock( +func (tbtcs *TBTCSystem) FetchRelayPreviousDifficultyAtBlock( blockNumber *big.Int, -) (common.Address, error) { - var result common.Address +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4083,16 +4083,16 @@ func (tbtcs *TBTCSystem) PriceFeedAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "priceFeed", + "fetchRelayPreviousDifficulty", &result, ) return result, err } -func (tbtcs *TBTCSystem) Relay() (common.Address, error) { - var result common.Address - result, err := tbtcs.contract.Relay( +func (tbtcs *TBTCSystem) GetRemainingPauseTerm() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingPauseTerm( tbtcs.callerOptions, ) @@ -4101,17 +4101,17 @@ func (tbtcs *TBTCSystem) Relay() (common.Address, error) { err, tbtcs.callerOptions.From, nil, - "relay", + "getRemainingPauseTerm", ) } return result, err } -func (tbtcs *TBTCSystem) RelayAtBlock( +func (tbtcs *TBTCSystem) GetRemainingPauseTermAtBlock( blockNumber *big.Int, -) (common.Address, error) { - var result common.Address +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4121,16 +4121,16 @@ func (tbtcs *TBTCSystem) RelayAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "relay", + "getRemainingPauseTerm", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTime() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetRemainingCollateralizationThresholdsUpdateTime( +func (tbtcs *TBTCSystem) KeepSize() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.KeepSize( tbtcs.callerOptions, ) @@ -4139,17 +4139,17 @@ func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTime() (*b err, tbtcs.callerOptions.From, nil, - "getRemainingCollateralizationThresholdsUpdateTime", + "keepSize", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTimeAtBlock( +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, @@ -4159,16 +4159,16 @@ func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTimeAtBloc tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingCollateralizationThresholdsUpdateTime", + "keepSize", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTime() (*big.Int, error) { +func (tbtcs *TBTCSystem) FetchRelayCurrentDifficulty() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.GetRemainingSignerFeeDivisorUpdateTime( + result, err := tbtcs.contract.FetchRelayCurrentDifficulty( tbtcs.callerOptions, ) @@ -4177,14 +4177,14 @@ func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTime() (*big.Int, err err, tbtcs.callerOptions.From, nil, - "getRemainingSignerFeeDivisorUpdateTime", + "fetchRelayCurrentDifficulty", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTimeAtBlock( +func (tbtcs *TBTCSystem) FetchRelayCurrentDifficultyAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -4197,16 +4197,16 @@ func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTimeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingSignerFeeDivisorUpdateTime", + "fetchRelayCurrentDifficulty", &result, ) return result, err } -func (tbtcs *TBTCSystem) Owner() (common.Address, error) { - var result common.Address - result, err := tbtcs.contract.Owner( +func (tbtcs *TBTCSystem) GetGovernanceTimeDelay() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetGovernanceTimeDelay( tbtcs.callerOptions, ) @@ -4215,17 +4215,17 @@ func (tbtcs *TBTCSystem) Owner() (common.Address, error) { err, tbtcs.callerOptions.From, nil, - "owner", + "getGovernanceTimeDelay", ) } return result, err } -func (tbtcs *TBTCSystem) OwnerAtBlock( +func (tbtcs *TBTCSystem) GetGovernanceTimeDelayAtBlock( blockNumber *big.Int, -) (common.Address, error) { - var result common.Address +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4235,20 +4235,17 @@ func (tbtcs *TBTCSystem) OwnerAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "owner", + "getGovernanceTimeDelay", &result, ) return result, err } -func (tbtcs *TBTCSystem) ApprovedToLog( - _caller common.Address, -) (bool, error) { - var result bool - result, err := tbtcs.contract.ApprovedToLog( +func (tbtcs *TBTCSystem) GetInitialCollateralizedPercent() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.GetInitialCollateralizedPercent( tbtcs.callerOptions, - _caller, ) if err != nil { @@ -4256,19 +4253,17 @@ func (tbtcs *TBTCSystem) ApprovedToLog( err, tbtcs.callerOptions.From, nil, - "approvedToLog", - _caller, + "getInitialCollateralizedPercent", ) } return result, err } -func (tbtcs *TBTCSystem) ApprovedToLogAtBlock( - _caller common.Address, +func (tbtcs *TBTCSystem) GetInitialCollateralizedPercentAtBlock( blockNumber *big.Int, -) (bool, error) { - var result bool +) (uint16, error) { + var result uint16 err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4278,21 +4273,17 @@ func (tbtcs *TBTCSystem) ApprovedToLogAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "approvedToLog", + "getInitialCollateralizedPercent", &result, - _caller, ) return result, err } -func (tbtcs *TBTCSystem) IsAllowedLotSize( - _requestedLotSizeSatoshis uint64, -) (bool, error) { - var result bool - result, err := tbtcs.contract.IsAllowedLotSize( +func (tbtcs *TBTCSystem) GetMinimumLotSize() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetMinimumLotSize( tbtcs.callerOptions, - _requestedLotSizeSatoshis, ) if err != nil { @@ -4300,19 +4291,17 @@ func (tbtcs *TBTCSystem) IsAllowedLotSize( err, tbtcs.callerOptions.From, nil, - "isAllowedLotSize", - _requestedLotSizeSatoshis, + "getMinimumLotSize", ) } return result, err } -func (tbtcs *TBTCSystem) IsAllowedLotSizeAtBlock( - _requestedLotSizeSatoshis uint64, +func (tbtcs *TBTCSystem) GetMinimumLotSizeAtBlock( blockNumber *big.Int, -) (bool, error) { - var result bool +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4322,18 +4311,20 @@ func (tbtcs *TBTCSystem) IsAllowedLotSizeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "isAllowedLotSize", + "getMinimumLotSize", &result, - _requestedLotSizeSatoshis, ) 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 { @@ -4341,17 +4332,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, @@ -4361,16 +4354,17 @@ func (tbtcs *TBTCSystem) GetMinimumLotSizeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getMinimumLotSize", + "approvedToLog", &result, + _caller, ) return result, err } -func (tbtcs *TBTCSystem) FetchBitcoinPrice() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.FetchBitcoinPrice( +func (tbtcs *TBTCSystem) GetAllowNewDeposits() (bool, error) { + var result bool + result, err := tbtcs.contract.GetAllowNewDeposits( tbtcs.callerOptions, ) @@ -4379,17 +4373,17 @@ func (tbtcs *TBTCSystem) FetchBitcoinPrice() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "fetchBitcoinPrice", + "getAllowNewDeposits", ) } return result, err } -func (tbtcs *TBTCSystem) FetchBitcoinPriceAtBlock( +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, @@ -4399,16 +4393,16 @@ func (tbtcs *TBTCSystem) FetchBitcoinPriceAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "fetchBitcoinPrice", + "getAllowNewDeposits", &result, ) return result, err } -func (tbtcs *TBTCSystem) FetchRelayPreviousDifficulty() (*big.Int, error) { +func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTime() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.FetchRelayPreviousDifficulty( + result, err := tbtcs.contract.GetRemainingEthBtcPriceFeedAdditionTime( tbtcs.callerOptions, ) @@ -4417,14 +4411,14 @@ func (tbtcs *TBTCSystem) FetchRelayPreviousDifficulty() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "fetchRelayPreviousDifficulty", + "getRemainingEthBtcPriceFeedAdditionTime", ) } return result, err } -func (tbtcs *TBTCSystem) FetchRelayPreviousDifficultyAtBlock( +func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTimeAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -4437,16 +4431,16 @@ func (tbtcs *TBTCSystem) FetchRelayPreviousDifficultyAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "fetchRelayPreviousDifficulty", + "getRemainingEthBtcPriceFeedAdditionTime", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTime() (*big.Int, error) { +func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTime() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.GetRemainingEthBtcPriceFeedAdditionTime( + result, err := tbtcs.contract.GetRemainingCollateralizationThresholdsUpdateTime( tbtcs.callerOptions, ) @@ -4455,14 +4449,14 @@ func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTime() (*big.Int, er err, tbtcs.callerOptions.From, nil, - "getRemainingEthBtcPriceFeedAdditionTime", + "getRemainingCollateralizationThresholdsUpdateTime", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTimeAtBlock( +func (tbtcs *TBTCSystem) GetRemainingCollateralizationThresholdsUpdateTimeAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -4475,17 +4469,20 @@ func (tbtcs *TBTCSystem) GetRemainingEthBtcPriceFeedAdditionTimeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingEthBtcPriceFeedAdditionTime", + "getRemainingCollateralizationThresholdsUpdateTime", &result, ) 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 { @@ -4493,14 +4490,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 @@ -4513,16 +4512,17 @@ func (tbtcs *TBTCSystem) IsOwnerAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "isOwner", + "isAllowedLotSize", &result, + _requestedLotSizeSatoshis, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTime() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetRemainingKeepFactoriesUpgradeabilityTime( +func (tbtcs *TBTCSystem) PriceFeed() (common.Address, error) { + var result common.Address + result, err := tbtcs.contract.PriceFeed( tbtcs.callerOptions, ) @@ -4531,17 +4531,17 @@ func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTime() (*big.Int err, tbtcs.callerOptions.From, nil, - "getRemainingKeepFactoriesUpgradeabilityTime", + "priceFeed", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTimeAtBlock( +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, @@ -4551,16 +4551,16 @@ func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTimeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingKeepFactoriesUpgradeabilityTime", + "priceFeed", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetAllowNewDeposits() (bool, error) { - var result bool - result, err := tbtcs.contract.GetAllowNewDeposits( +func (tbtcs *TBTCSystem) GetNewDepositFeeEstimate() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetNewDepositFeeEstimate( tbtcs.callerOptions, ) @@ -4569,17 +4569,17 @@ func (tbtcs *TBTCSystem) GetAllowNewDeposits() (bool, error) { err, tbtcs.callerOptions.From, nil, - "getAllowNewDeposits", + "getNewDepositFeeEstimate", ) } return result, err } -func (tbtcs *TBTCSystem) GetAllowNewDepositsAtBlock( +func (tbtcs *TBTCSystem) GetNewDepositFeeEstimateAtBlock( blockNumber *big.Int, -) (bool, error) { - var result bool +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4589,16 +4589,16 @@ func (tbtcs *TBTCSystem) GetAllowNewDepositsAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getAllowNewDeposits", + "getNewDepositFeeEstimate", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetAllowedLotSizes() ([]uint64, error) { - var result []uint64 - result, err := tbtcs.contract.GetAllowedLotSizes( +func (tbtcs *TBTCSystem) IsOwner() (bool, error) { + var result bool + result, err := tbtcs.contract.IsOwner( tbtcs.callerOptions, ) @@ -4607,17 +4607,17 @@ func (tbtcs *TBTCSystem) GetAllowedLotSizes() ([]uint64, error) { err, tbtcs.callerOptions.From, nil, - "getAllowedLotSizes", + "isOwner", ) } return result, err } -func (tbtcs *TBTCSystem) GetAllowedLotSizesAtBlock( +func (tbtcs *TBTCSystem) IsOwnerAtBlock( blockNumber *big.Int, -) ([]uint64, error) { - var result []uint64 +) (bool, error) { + var result bool err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4627,16 +4627,16 @@ func (tbtcs *TBTCSystem) GetAllowedLotSizesAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getAllowedLotSizes", + "isOwner", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetNewDepositFeeEstimate() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetNewDepositFeeEstimate( +func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercent() (uint16, error) { + var result uint16 + result, err := tbtcs.contract.GetSeverelyUndercollateralizedThresholdPercent( tbtcs.callerOptions, ) @@ -4645,17 +4645,17 @@ func (tbtcs *TBTCSystem) GetNewDepositFeeEstimate() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getNewDepositFeeEstimate", + "getSeverelyUndercollateralizedThresholdPercent", ) } return result, err } -func (tbtcs *TBTCSystem) GetNewDepositFeeEstimateAtBlock( +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, @@ -4665,16 +4665,16 @@ func (tbtcs *TBTCSystem) GetNewDepositFeeEstimateAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getNewDepositFeeEstimate", + "getSeverelyUndercollateralizedThresholdPercent", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercent() (uint16, error) { +func (tbtcs *TBTCSystem) GetSignerFeeDivisor() (uint16, error) { var result uint16 - result, err := tbtcs.contract.GetUndercollateralizedThresholdPercent( + result, err := tbtcs.contract.GetSignerFeeDivisor( tbtcs.callerOptions, ) @@ -4683,14 +4683,14 @@ func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercent() (uint16, error err, tbtcs.callerOptions.From, nil, - "getUndercollateralizedThresholdPercent", + "getSignerFeeDivisor", ) } return result, err } -func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercentAtBlock( +func (tbtcs *TBTCSystem) GetSignerFeeDivisorAtBlock( blockNumber *big.Int, ) (uint16, error) { var result uint16 @@ -4703,16 +4703,16 @@ func (tbtcs *TBTCSystem) GetUndercollateralizedThresholdPercentAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getUndercollateralizedThresholdPercent", + "getSignerFeeDivisor", &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, ) @@ -4721,17 +4721,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, @@ -4741,16 +4741,16 @@ func (tbtcs *TBTCSystem) GetGovernanceTimeDelayAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getGovernanceTimeDelay", + "getUndercollateralizedThresholdPercent", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTime() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetRemainingKeepFactoriesUpdateTime( +func (tbtcs *TBTCSystem) Relay() (common.Address, error) { + var result common.Address + result, err := tbtcs.contract.Relay( tbtcs.callerOptions, ) @@ -4759,17 +4759,17 @@ func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTime() (*big.Int, error) err, tbtcs.callerOptions.From, nil, - "getRemainingKeepFactoriesUpdateTime", + "relay", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTimeAtBlock( +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, @@ -4779,16 +4779,16 @@ func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTimeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingKeepFactoriesUpdateTime", + "relay", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingPauseTerm() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetRemainingPauseTerm( +func (tbtcs *TBTCSystem) GetAllowedLotSizes() ([]uint64, error) { + var result []uint64 + result, err := tbtcs.contract.GetAllowedLotSizes( tbtcs.callerOptions, ) @@ -4797,17 +4797,17 @@ func (tbtcs *TBTCSystem) GetRemainingPauseTerm() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getRemainingPauseTerm", + "getAllowedLotSizes", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingPauseTermAtBlock( +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, @@ -4817,16 +4817,16 @@ func (tbtcs *TBTCSystem) GetRemainingPauseTermAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingPauseTerm", + "getAllowedLotSizes", &result, ) return result, err } -func (tbtcs *TBTCSystem) KeepSize() (uint16, error) { - var result uint16 - result, err := tbtcs.contract.KeepSize( +func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelay() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetPriceFeedGovernanceTimeDelay( tbtcs.callerOptions, ) @@ -4835,17 +4835,17 @@ func (tbtcs *TBTCSystem) KeepSize() (uint16, error) { err, tbtcs.callerOptions.From, nil, - "keepSize", + "getPriceFeedGovernanceTimeDelay", ) } return result, err } -func (tbtcs *TBTCSystem) KeepSizeAtBlock( - blockNumber *big.Int, -) (uint16, error) { - var result uint16 +func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelayAtBlock( + blockNumber *big.Int, +) (*big.Int, error) { + var result *big.Int err := ethutil.CallAtBlock( tbtcs.callerOptions.From, @@ -4855,16 +4855,16 @@ func (tbtcs *TBTCSystem) KeepSizeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "keepSize", + "getPriceFeedGovernanceTimeDelay", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelay() (*big.Int, error) { +func (tbtcs *TBTCSystem) FetchBitcoinPrice() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.GetPriceFeedGovernanceTimeDelay( + result, err := tbtcs.contract.FetchBitcoinPrice( tbtcs.callerOptions, ) @@ -4873,14 +4873,14 @@ func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelay() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getPriceFeedGovernanceTimeDelay", + "fetchBitcoinPrice", ) } return result, err } -func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelayAtBlock( +func (tbtcs *TBTCSystem) FetchBitcoinPriceAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -4893,16 +4893,16 @@ func (tbtcs *TBTCSystem) GetPriceFeedGovernanceTimeDelayAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getPriceFeedGovernanceTimeDelay", + "fetchBitcoinPrice", &result, ) return result, err } -func (tbtcs *TBTCSystem) KeepThreshold() (uint16, error) { - var result uint16 - result, err := tbtcs.contract.KeepThreshold( +func (tbtcs *TBTCSystem) GetMaximumLotSize() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetMaximumLotSize( tbtcs.callerOptions, ) @@ -4911,17 +4911,17 @@ func (tbtcs *TBTCSystem) KeepThreshold() (uint16, error) { err, tbtcs.callerOptions.From, nil, - "keepThreshold", + "getMaximumLotSize", ) } return result, err } -func (tbtcs *TBTCSystem) KeepThresholdAtBlock( +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, @@ -4931,16 +4931,16 @@ func (tbtcs *TBTCSystem) KeepThresholdAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "keepThreshold", + "getMaximumLotSize", &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, ) @@ -4949,17 +4949,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, @@ -4969,16 +4969,16 @@ func (tbtcs *TBTCSystem) GetSeverelyUndercollateralizedThresholdPercentAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getSeverelyUndercollateralizedThresholdPercent", + "getKeepFactoriesUpgradeabilityPeriod", &result, ) return result, err } -func (tbtcs *TBTCSystem) FetchRelayCurrentDifficulty() (*big.Int, error) { +func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTime() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.FetchRelayCurrentDifficulty( + result, err := tbtcs.contract.GetRemainingLotSizesUpdateTime( tbtcs.callerOptions, ) @@ -4987,14 +4987,14 @@ func (tbtcs *TBTCSystem) FetchRelayCurrentDifficulty() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "fetchRelayCurrentDifficulty", + "getRemainingLotSizesUpdateTime", ) } return result, err } -func (tbtcs *TBTCSystem) FetchRelayCurrentDifficultyAtBlock( +func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTimeAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -5007,16 +5007,16 @@ func (tbtcs *TBTCSystem) FetchRelayCurrentDifficultyAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "fetchRelayCurrentDifficulty", + "getRemainingLotSizesUpdateTime", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriod() (*big.Int, error) { +func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTime() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.GetKeepFactoriesUpgradeabilityPeriod( + result, err := tbtcs.contract.GetRemainingSignerFeeDivisorUpdateTime( tbtcs.callerOptions, ) @@ -5025,14 +5025,14 @@ func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriod() (*big.Int, error err, tbtcs.callerOptions.From, nil, - "getKeepFactoriesUpgradeabilityPeriod", + "getRemainingSignerFeeDivisorUpdateTime", ) } return result, err } -func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriodAtBlock( +func (tbtcs *TBTCSystem) GetRemainingSignerFeeDivisorUpdateTimeAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -5045,16 +5045,16 @@ func (tbtcs *TBTCSystem) GetKeepFactoriesUpgradeabilityPeriodAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getKeepFactoriesUpgradeabilityPeriod", + "getRemainingSignerFeeDivisorUpdateTime", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTime() (*big.Int, error) { - var result *big.Int - result, err := tbtcs.contract.GetRemainingLotSizesUpdateTime( +func (tbtcs *TBTCSystem) Owner() (common.Address, error) { + var result common.Address + result, err := tbtcs.contract.Owner( tbtcs.callerOptions, ) @@ -5063,17 +5063,17 @@ func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTime() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getRemainingLotSizesUpdateTime", + "owner", ) } return result, err } -func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTimeAtBlock( +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, @@ -5083,16 +5083,16 @@ func (tbtcs *TBTCSystem) GetRemainingLotSizesUpdateTimeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getRemainingLotSizesUpdateTime", + "owner", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetInitialCollateralizedPercent() (uint16, error) { - var result uint16 - result, err := tbtcs.contract.GetInitialCollateralizedPercent( +func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTime() (*big.Int, error) { + var result *big.Int + result, err := tbtcs.contract.GetRemainingKeepFactoriesUpdateTime( tbtcs.callerOptions, ) @@ -5101,17 +5101,17 @@ func (tbtcs *TBTCSystem) GetInitialCollateralizedPercent() (uint16, error) { err, tbtcs.callerOptions.From, nil, - "getInitialCollateralizedPercent", + "getRemainingKeepFactoriesUpdateTime", ) } return result, err } -func (tbtcs *TBTCSystem) GetInitialCollateralizedPercentAtBlock( +func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpdateTimeAtBlock( 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) GetInitialCollateralizedPercentAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getInitialCollateralizedPercent", + "getRemainingKeepFactoriesUpdateTime", &result, ) return result, err } -func (tbtcs *TBTCSystem) GetMaximumLotSize() (*big.Int, error) { +func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTime() (*big.Int, error) { var result *big.Int - result, err := tbtcs.contract.GetMaximumLotSize( + result, err := tbtcs.contract.GetRemainingKeepFactoriesUpgradeabilityTime( tbtcs.callerOptions, ) @@ -5139,14 +5139,14 @@ func (tbtcs *TBTCSystem) GetMaximumLotSize() (*big.Int, error) { err, tbtcs.callerOptions.From, nil, - "getMaximumLotSize", + "getRemainingKeepFactoriesUpgradeabilityTime", ) } return result, err } -func (tbtcs *TBTCSystem) GetMaximumLotSizeAtBlock( +func (tbtcs *TBTCSystem) GetRemainingKeepFactoriesUpgradeabilityTimeAtBlock( blockNumber *big.Int, ) (*big.Int, error) { var result *big.Int @@ -5159,7 +5159,7 @@ func (tbtcs *TBTCSystem) GetMaximumLotSizeAtBlock( tbtcs.caller, tbtcs.errorResolver, tbtcs.contractAddress, - "getMaximumLotSize", + "getRemainingKeepFactoriesUpgradeabilityTime", &result, ) @@ -5168,17 +5168,44 @@ func (tbtcs *TBTCSystem) GetMaximumLotSizeAtBlock( // ------ Events ------- -type tBTCSystemStartedLiquidationFunc func( - DepositContractAddress common.Address, - WasFraud bool, +type tBTCSystemKeepFactoriesUpdateStartedFunc func( + KeepStakedFactory common.Address, + FullyBackedFactory common.Address, + FactorySelector common.Address, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchStartedLiquidation( - success tBTCSystemStartedLiquidationFunc, +func (tbtcs *TBTCSystem) PastKeepFactoriesUpdateStartedEvents( + startBlock uint64, + endBlock *uint64, +) ([]*abi.TBTCSystemKeepFactoriesUpdateStarted, error) { + iterator, err := tbtcs.contract.FilterKeepFactoriesUpdateStarted( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past KeepFactoriesUpdateStarted events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemKeepFactoriesUpdateStarted, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdateStarted( + success tBTCSystemKeepFactoriesUpdateStartedFunc, fail func(err error) error, - _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -5195,10 +5222,9 @@ func (tbtcs *TBTCSystem) WatchStartedLiquidation( return err } - subscription, err := tbtcs.subscribeStartedLiquidation( + subscription, err := tbtcs.subscribeKeepFactoriesUpdateStarted( success, failCallback, - _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -5218,7 +5244,7 @@ func (tbtcs *TBTCSystem) WatchStartedLiquidation( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event StartedLiquidation terminated with error; " + + "subscription to event KeepFactoriesUpdateStarted terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5239,21 +5265,19 @@ func (tbtcs *TBTCSystem) WatchStartedLiquidation( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeStartedLiquidation( - success tBTCSystemStartedLiquidationFunc, +func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdateStarted( + success tBTCSystemKeepFactoriesUpdateStartedFunc, 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.TBTCSystemKeepFactoriesUpdateStarted) + eventSubscription, err := tbtcs.contract.WatchKeepFactoriesUpdateStarted( nil, eventChan, - _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for StartedLiquidation events: [%v]", + "error creating watch for KeepFactoriesUpdateStarted events: [%v]", err, ) } @@ -5271,8 +5295,9 @@ func (tbtcs *TBTCSystem) subscribeStartedLiquidation( return } success( - event.DepositContractAddress, - event.WasFraud, + event.KeepStakedFactory, + event.FullyBackedFactory, + event.FactorySelector, event.Timestamp, event.Raw.BlockNumber, ) @@ -5295,13 +5320,42 @@ func (tbtcs *TBTCSystem) subscribeStartedLiquidation( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemAllowNewDepositsUpdatedFunc func( - AllowNewDeposits bool, +type tBTCSystemKeepFactoriesUpdatedFunc func( + KeepStakedFactory common.Address, + FullyBackedFactory common.Address, + FactorySelector common.Address, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchAllowNewDepositsUpdated( - success tBTCSystemAllowNewDepositsUpdatedFunc, +func (tbtcs *TBTCSystem) PastKeepFactoriesUpdatedEvents( + startBlock uint64, + endBlock *uint64, +) ([]*abi.TBTCSystemKeepFactoriesUpdated, error) { + iterator, err := tbtcs.contract.FilterKeepFactoriesUpdated( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past KeepFactoriesUpdated events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemKeepFactoriesUpdated, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdated( + success tBTCSystemKeepFactoriesUpdatedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { errorChan := make(chan error) @@ -5319,7 +5373,7 @@ func (tbtcs *TBTCSystem) WatchAllowNewDepositsUpdated( return err } - subscription, err := tbtcs.subscribeAllowNewDepositsUpdated( + subscription, err := tbtcs.subscribeKeepFactoriesUpdated( success, failCallback, ) @@ -5341,7 +5395,7 @@ func (tbtcs *TBTCSystem) WatchAllowNewDepositsUpdated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event AllowNewDepositsUpdated terminated with error; " + + "subscription to event KeepFactoriesUpdated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5362,19 +5416,19 @@ func (tbtcs *TBTCSystem) WatchAllowNewDepositsUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeAllowNewDepositsUpdated( - success tBTCSystemAllowNewDepositsUpdatedFunc, +func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdated( + success tBTCSystemKeepFactoriesUpdatedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemAllowNewDepositsUpdated) - eventSubscription, err := tbtcs.contract.WatchAllowNewDepositsUpdated( + 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 AllowNewDepositsUpdated events: [%v]", + "error creating watch for KeepFactoriesUpdated events: [%v]", err, ) } @@ -5392,7 +5446,9 @@ func (tbtcs *TBTCSystem) subscribeAllowNewDepositsUpdated( return } success( - event.AllowNewDeposits, + event.KeepStakedFactory, + event.FullyBackedFactory, + event.FactorySelector, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -5414,18 +5470,45 @@ func (tbtcs *TBTCSystem) subscribeAllowNewDepositsUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemCreatedFunc func( +type tBTCSystemSetupFailedFunc func( DepositContractAddress common.Address, - KeepAddress common.Address, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchCreated( - success tBTCSystemCreatedFunc, +func (tbtcs *TBTCSystem) PastSetupFailedEvents( + startBlock uint64, + endBlock *uint64, + _depositContractAddressFilter []common.Address, +) ([]*abi.TBTCSystemSetupFailed, error) { + iterator, err := tbtcs.contract.FilterSetupFailed( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + _depositContractAddressFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past SetupFailed events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemSetupFailed, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (tbtcs *TBTCSystem) WatchSetupFailed( + success tBTCSystemSetupFailedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _keepAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -5442,11 +5525,10 @@ func (tbtcs *TBTCSystem) WatchCreated( return err } - subscription, err := tbtcs.subscribeCreated( + subscription, err := tbtcs.subscribeSetupFailed( success, failCallback, _depositContractAddressFilter, - _keepAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -5466,7 +5548,7 @@ func (tbtcs *TBTCSystem) WatchCreated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event Created terminated with error; " + + "subscription to event SetupFailed terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5487,23 +5569,21 @@ func (tbtcs *TBTCSystem) WatchCreated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeCreated( - success tBTCSystemCreatedFunc, +func (tbtcs *TBTCSystem) subscribeSetupFailed( + success tBTCSystemSetupFailedFunc, 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.TBTCSystemSetupFailed) + eventSubscription, err := tbtcs.contract.WatchSetupFailed( nil, eventChan, _depositContractAddressFilter, - _keepAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for Created events: [%v]", + "error creating watch for SetupFailed events: [%v]", err, ) } @@ -5522,7 +5602,6 @@ func (tbtcs *TBTCSystem) subscribeCreated( } success( event.DepositContractAddress, - event.KeepAddress, event.Timestamp, event.Raw.BlockNumber, ) @@ -5545,17 +5624,45 @@ func (tbtcs *TBTCSystem) subscribeCreated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemKeepFactoriesUpdateStartedFunc func( - KeepStakedFactory common.Address, - FullyBackedFactory common.Address, - FactorySelector common.Address, - Timestamp *big.Int, +type tBTCSystemFunderAbortRequestedFunc func( + DepositContractAddress common.Address, + AbortOutputScript []uint8, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdateStarted( - success tBTCSystemKeepFactoriesUpdateStartedFunc, +func (tbtcs *TBTCSystem) PastFunderAbortRequestedEvents( + startBlock uint64, + endBlock *uint64, + _depositContractAddressFilter []common.Address, +) ([]*abi.TBTCSystemFunderAbortRequested, error) { + iterator, err := tbtcs.contract.FilterFunderAbortRequested( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + _depositContractAddressFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past FunderAbortRequested events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemFunderAbortRequested, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +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{}) @@ -5572,9 +5679,10 @@ func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdateStarted( return err } - subscription, err := tbtcs.subscribeKeepFactoriesUpdateStarted( + subscription, err := tbtcs.subscribeFunderAbortRequested( success, failCallback, + _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -5594,7 +5702,7 @@ func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdateStarted( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event KeepFactoriesUpdateStarted terminated with error; " + + "subscription to event FunderAbortRequested terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5615,19 +5723,21 @@ func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdateStarted( - success tBTCSystemKeepFactoriesUpdateStartedFunc, +func (tbtcs *TBTCSystem) subscribeFunderAbortRequested( + success tBTCSystemFunderAbortRequestedFunc, 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.TBTCSystemFunderAbortRequested) + eventSubscription, err := tbtcs.contract.WatchFunderAbortRequested( nil, eventChan, + _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for KeepFactoriesUpdateStarted events: [%v]", + "error creating watch for FunderAbortRequested events: [%v]", err, ) } @@ -5645,10 +5755,8 @@ func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdateStarted( return } success( - event.KeepStakedFactory, - event.FullyBackedFactory, - event.FactorySelector, - event.Timestamp, + event.DepositContractAddress, + event.AbortOutputScript, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -5670,17 +5778,41 @@ func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemOwnershipTransferredFunc func( - PreviousOwner common.Address, - NewOwner common.Address, +type tBTCSystemLotSizesUpdatedFunc func( + LotSizes []uint64, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchOwnershipTransferred( - success tBTCSystemOwnershipTransferredFunc, +func (tbtcs *TBTCSystem) PastLotSizesUpdatedEvents( + startBlock uint64, + endBlock *uint64, +) ([]*abi.TBTCSystemLotSizesUpdated, error) { + iterator, err := tbtcs.contract.FilterLotSizesUpdated( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past LotSizesUpdated events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemLotSizesUpdated, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (tbtcs *TBTCSystem) WatchLotSizesUpdated( + success tBTCSystemLotSizesUpdatedFunc, fail func(err error) error, - previousOwnerFilter []common.Address, - newOwnerFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -5697,11 +5829,9 @@ func (tbtcs *TBTCSystem) WatchOwnershipTransferred( return err } - subscription, err := tbtcs.subscribeOwnershipTransferred( + subscription, err := tbtcs.subscribeLotSizesUpdated( success, failCallback, - previousOwnerFilter, - newOwnerFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -5721,7 +5851,7 @@ func (tbtcs *TBTCSystem) WatchOwnershipTransferred( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event OwnershipTransferred terminated with error; " + + "subscription to event LotSizesUpdated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5742,23 +5872,19 @@ func (tbtcs *TBTCSystem) WatchOwnershipTransferred( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeOwnershipTransferred( - success tBTCSystemOwnershipTransferredFunc, +func (tbtcs *TBTCSystem) subscribeLotSizesUpdated( + success tBTCSystemLotSizesUpdatedFunc, 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.TBTCSystemLotSizesUpdated) + eventSubscription, err := tbtcs.contract.WatchLotSizesUpdated( nil, eventChan, - previousOwnerFilter, - newOwnerFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for OwnershipTransferred events: [%v]", + "error creating watch for LotSizesUpdated events: [%v]", err, ) } @@ -5776,8 +5902,7 @@ func (tbtcs *TBTCSystem) subscribeOwnershipTransferred( return } success( - event.PreviousOwner, - event.NewOwner, + event.LotSizes, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -5799,16 +5924,56 @@ func (tbtcs *TBTCSystem) subscribeOwnershipTransferred( 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) PastRedemptionRequestedEvents( + startBlock uint64, + endBlock *uint64, + _depositContractAddressFilter []common.Address, + _requesterFilter []common.Address, + _digestFilter [][32]uint8, +) ([]*abi.TBTCSystemRedemptionRequested, error) { + iterator, err := tbtcs.contract.FilterRedemptionRequested( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + _depositContractAddressFilter, + _requesterFilter, + _digestFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past RedemptionRequested events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemRedemptionRequested, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +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{}) @@ -5825,10 +5990,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 @@ -5848,7 +6015,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) @@ -5869,21 +6036,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, ) } @@ -5902,7 +6073,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() @@ -5924,17 +6100,47 @@ func (tbtcs *TBTCSystem) subscribeSetupFailed( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemCollateralizationThresholdsUpdateStartedFunc func( - InitialCollateralizedPercent uint16, - UndercollateralizedThresholdPercent uint16, - SeverelyUndercollateralizedThresholdPercent uint16, +type tBTCSystemRegisteredPubkeyFunc func( + DepositContractAddress common.Address, + SigningGroupPubkeyX [32]uint8, + SigningGroupPubkeyY [32]uint8, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdateStarted( - success tBTCSystemCollateralizationThresholdsUpdateStartedFunc, +func (tbtcs *TBTCSystem) PastRegisteredPubkeyEvents( + startBlock uint64, + endBlock *uint64, + _depositContractAddressFilter []common.Address, +) ([]*abi.TBTCSystemRegisteredPubkey, error) { + iterator, err := tbtcs.contract.FilterRegisteredPubkey( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + _depositContractAddressFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past RegisteredPubkey events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemRegisteredPubkey, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +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{}) @@ -5951,9 +6157,10 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdateStarted( return err } - subscription, err := tbtcs.subscribeCollateralizationThresholdsUpdateStarted( + subscription, err := tbtcs.subscribeRegisteredPubkey( success, failCallback, + _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -5973,7 +6180,7 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdateStarted( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event CollateralizationThresholdsUpdateStarted terminated with error; " + + "subscription to event RegisteredPubkey terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -5994,19 +6201,21 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdateStarted( - success tBTCSystemCollateralizationThresholdsUpdateStartedFunc, +func (tbtcs *TBTCSystem) subscribeRegisteredPubkey( + success tBTCSystemRegisteredPubkeyFunc, 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.TBTCSystemRegisteredPubkey) + eventSubscription, err := tbtcs.contract.WatchRegisteredPubkey( nil, eventChan, + _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for CollateralizationThresholdsUpdateStarted events: [%v]", + "error creating watch for RegisteredPubkey events: [%v]", err, ) } @@ -6024,9 +6233,9 @@ func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdateStarted( return } success( - event.InitialCollateralizedPercent, - event.UndercollateralizedThresholdPercent, - event.SeverelyUndercollateralizedThresholdPercent, + event.DepositContractAddress, + event.SigningGroupPubkeyX, + event.SigningGroupPubkeyY, event.Timestamp, event.Raw.BlockNumber, ) @@ -6049,14 +6258,43 @@ func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemExitedCourtesyCallFunc func( +type tBTCSystemCourtesyCalledFunc func( DepositContractAddress common.Address, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchExitedCourtesyCall( - success tBTCSystemExitedCourtesyCallFunc, +func (tbtcs *TBTCSystem) PastCourtesyCalledEvents( + startBlock uint64, + endBlock *uint64, + _depositContractAddressFilter []common.Address, +) ([]*abi.TBTCSystemCourtesyCalled, error) { + iterator, err := tbtcs.contract.FilterCourtesyCalled( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + _depositContractAddressFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past CourtesyCalled events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemCourtesyCalled, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (tbtcs *TBTCSystem) WatchCourtesyCalled( + success tBTCSystemCourtesyCalledFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { @@ -6075,7 +6313,7 @@ func (tbtcs *TBTCSystem) WatchExitedCourtesyCall( return err } - subscription, err := tbtcs.subscribeExitedCourtesyCall( + subscription, err := tbtcs.subscribeCourtesyCalled( success, failCallback, _depositContractAddressFilter, @@ -6098,7 +6336,7 @@ func (tbtcs *TBTCSystem) WatchExitedCourtesyCall( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event ExitedCourtesyCall terminated with error; " + + "subscription to event CourtesyCalled terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6119,13 +6357,13 @@ func (tbtcs *TBTCSystem) WatchExitedCourtesyCall( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeExitedCourtesyCall( - success tBTCSystemExitedCourtesyCallFunc, +func (tbtcs *TBTCSystem) subscribeCourtesyCalled( + success tBTCSystemCourtesyCalledFunc, 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.TBTCSystemCourtesyCalled) + eventSubscription, err := tbtcs.contract.WatchCourtesyCalled( nil, eventChan, _depositContractAddressFilter, @@ -6133,7 +6371,7 @@ func (tbtcs *TBTCSystem) subscribeExitedCourtesyCall( if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for ExitedCourtesyCall events: [%v]", + "error creating watch for CourtesyCalled events: [%v]", err, ) } @@ -6174,18 +6412,49 @@ func (tbtcs *TBTCSystem) subscribeExitedCourtesyCall( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemFundedFunc func( +type tBTCSystemCreatedFunc func( DepositContractAddress common.Address, - Txid [32]uint8, + KeepAddress common.Address, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchFunded( - success tBTCSystemFundedFunc, +func (tbtcs *TBTCSystem) PastCreatedEvents( + startBlock uint64, + endBlock *uint64, + _depositContractAddressFilter []common.Address, + _keepAddressFilter []common.Address, +) ([]*abi.TBTCSystemCreated, error) { + iterator, err := tbtcs.contract.FilterCreated( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + _depositContractAddressFilter, + _keepAddressFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past Created events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemCreated, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (tbtcs *TBTCSystem) WatchCreated( + success tBTCSystemCreatedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _txidFilter [][32]uint8, + _keepAddressFilter []common.Address, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -6202,11 +6471,11 @@ func (tbtcs *TBTCSystem) WatchFunded( return err } - subscription, err := tbtcs.subscribeFunded( + subscription, err := tbtcs.subscribeCreated( success, failCallback, _depositContractAddressFilter, - _txidFilter, + _keepAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -6226,7 +6495,7 @@ func (tbtcs *TBTCSystem) WatchFunded( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event Funded terminated with error; " + + "subscription to event Created terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6247,23 +6516,23 @@ func (tbtcs *TBTCSystem) WatchFunded( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeFunded( - success tBTCSystemFundedFunc, +func (tbtcs *TBTCSystem) subscribeCreated( + success tBTCSystemCreatedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _txidFilter [][32]uint8, + _keepAddressFilter []common.Address, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemFunded) - eventSubscription, err := tbtcs.contract.WatchFunded( + eventChan := make(chan *abi.TBTCSystemCreated) + eventSubscription, err := tbtcs.contract.WatchCreated( nil, eventChan, _depositContractAddressFilter, - _txidFilter, + _keepAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for Funded events: [%v]", + "error creating watch for Created events: [%v]", err, ) } @@ -6282,7 +6551,7 @@ func (tbtcs *TBTCSystem) subscribeFunded( } success( event.DepositContractAddress, - event.Txid, + event.KeepAddress, event.Timestamp, event.Raw.BlockNumber, ) @@ -6305,13 +6574,41 @@ func (tbtcs *TBTCSystem) subscribeFunded( 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) PastEthBtcPriceFeedAdditionStartedEvents( + startBlock uint64, + endBlock *uint64, +) ([]*abi.TBTCSystemEthBtcPriceFeedAdditionStarted, error) { + iterator, err := tbtcs.contract.FilterEthBtcPriceFeedAdditionStarted( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past EthBtcPriceFeedAdditionStarted events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemEthBtcPriceFeedAdditionStarted, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdditionStarted( + success tBTCSystemEthBtcPriceFeedAdditionStartedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { errorChan := make(chan error) @@ -6329,7 +6626,7 @@ func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdated( return err } - subscription, err := tbtcs.subscribeSignerFeeDivisorUpdated( + subscription, err := tbtcs.subscribeEthBtcPriceFeedAdditionStarted( success, failCallback, ) @@ -6351,7 +6648,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) @@ -6372,19 +6669,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, ) } @@ -6402,7 +6699,8 @@ func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdated( return } success( - event.SignerFeeDivisor, + event.PriceFeed, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -6424,16 +6722,49 @@ func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemCollateralizationThresholdsUpdatedFunc func( - InitialCollateralizedPercent uint16, - UndercollateralizedThresholdPercent uint16, - SeverelyUndercollateralizedThresholdPercent uint16, +type tBTCSystemFundedFunc func( + DepositContractAddress common.Address, + Txid [32]uint8, + Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdated( - success tBTCSystemCollateralizationThresholdsUpdatedFunc, +func (tbtcs *TBTCSystem) PastFundedEvents( + startBlock uint64, + endBlock *uint64, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, +) ([]*abi.TBTCSystemFunded, error) { + iterator, err := tbtcs.contract.FilterFunded( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + _depositContractAddressFilter, + _txidFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past Funded events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemFunded, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +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{}) @@ -6450,9 +6781,11 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdated( return err } - subscription, err := tbtcs.subscribeCollateralizationThresholdsUpdated( + subscription, err := tbtcs.subscribeFunded( success, failCallback, + _depositContractAddressFilter, + _txidFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -6472,7 +6805,7 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event CollateralizationThresholdsUpdated terminated with error; " + + "subscription to event Funded terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6493,19 +6826,23 @@ func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdated( - success tBTCSystemCollateralizationThresholdsUpdatedFunc, +func (tbtcs *TBTCSystem) subscribeFunded( + success tBTCSystemFundedFunc, fail func(err error) error, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemCollateralizationThresholdsUpdated) - eventSubscription, err := tbtcs.contract.WatchCollateralizationThresholdsUpdated( + 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 CollateralizationThresholdsUpdated events: [%v]", + "error creating watch for Funded events: [%v]", err, ) } @@ -6523,9 +6860,9 @@ func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdated( return } success( - event.InitialCollateralizedPercent, - event.UndercollateralizedThresholdPercent, - event.SeverelyUndercollateralizedThresholdPercent, + event.DepositContractAddress, + event.Txid, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -6547,16 +6884,51 @@ func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemCourtesyCalledFunc func( +type tBTCSystemGotRedemptionSignatureFunc func( DepositContractAddress common.Address, + Digest [32]uint8, + R [32]uint8, + S [32]uint8, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchCourtesyCalled( - success tBTCSystemCourtesyCalledFunc, +func (tbtcs *TBTCSystem) PastGotRedemptionSignatureEvents( + startBlock uint64, + endBlock *uint64, + _depositContractAddressFilter []common.Address, + _digestFilter [][32]uint8, +) ([]*abi.TBTCSystemGotRedemptionSignature, error) { + iterator, err := tbtcs.contract.FilterGotRedemptionSignature( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + _depositContractAddressFilter, + _digestFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past GotRedemptionSignature events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemGotRedemptionSignature, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +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{}) @@ -6573,10 +6945,11 @@ func (tbtcs *TBTCSystem) WatchCourtesyCalled( return err } - subscription, err := tbtcs.subscribeCourtesyCalled( + subscription, err := tbtcs.subscribeGotRedemptionSignature( success, failCallback, _depositContractAddressFilter, + _digestFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -6596,7 +6969,7 @@ func (tbtcs *TBTCSystem) WatchCourtesyCalled( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event CourtesyCalled terminated with error; " + + "subscription to event GotRedemptionSignature terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6617,21 +6990,23 @@ func (tbtcs *TBTCSystem) WatchCourtesyCalled( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeCourtesyCalled( - success tBTCSystemCourtesyCalledFunc, +func (tbtcs *TBTCSystem) subscribeGotRedemptionSignature( + success tBTCSystemGotRedemptionSignatureFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, + _digestFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemCourtesyCalled) - eventSubscription, err := tbtcs.contract.WatchCourtesyCalled( + 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 CourtesyCalled events: [%v]", + "error creating watch for GotRedemptionSignature events: [%v]", err, ) } @@ -6650,6 +7025,9 @@ func (tbtcs *TBTCSystem) subscribeCourtesyCalled( } success( event.DepositContractAddress, + event.Digest, + event.R, + event.S, event.Timestamp, event.Raw.BlockNumber, ) @@ -6672,15 +7050,45 @@ func (tbtcs *TBTCSystem) subscribeCourtesyCalled( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemLotSizesUpdateStartedFunc func( - LotSizes []uint64, +type tBTCSystemLiquidatedFunc func( + DepositContractAddress common.Address, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchLotSizesUpdateStarted( - success tBTCSystemLotSizesUpdateStartedFunc, +func (tbtcs *TBTCSystem) PastLiquidatedEvents( + startBlock uint64, + endBlock *uint64, + _depositContractAddressFilter []common.Address, +) ([]*abi.TBTCSystemLiquidated, error) { + iterator, err := tbtcs.contract.FilterLiquidated( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + _depositContractAddressFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past Liquidated events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemLiquidated, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +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{}) @@ -6697,9 +7105,10 @@ func (tbtcs *TBTCSystem) WatchLotSizesUpdateStarted( return err } - subscription, err := tbtcs.subscribeLotSizesUpdateStarted( + subscription, err := tbtcs.subscribeLiquidated( success, failCallback, + _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -6719,7 +7128,7 @@ func (tbtcs *TBTCSystem) WatchLotSizesUpdateStarted( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event LotSizesUpdateStarted terminated with error; " + + "subscription to event Liquidated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6740,19 +7149,21 @@ func (tbtcs *TBTCSystem) WatchLotSizesUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeLotSizesUpdateStarted( - success tBTCSystemLotSizesUpdateStartedFunc, +func (tbtcs *TBTCSystem) subscribeLiquidated( + success tBTCSystemLiquidatedFunc, 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.TBTCSystemLiquidated) + eventSubscription, err := tbtcs.contract.WatchLiquidated( nil, eventChan, + _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for LotSizesUpdateStarted events: [%v]", + "error creating watch for Liquidated events: [%v]", err, ) } @@ -6770,7 +7181,7 @@ func (tbtcs *TBTCSystem) subscribeLotSizesUpdateStarted( return } success( - event.LotSizes, + event.DepositContractAddress, event.Timestamp, event.Raw.BlockNumber, ) @@ -6793,16 +7204,48 @@ func (tbtcs *TBTCSystem) subscribeLotSizesUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemFunderAbortRequestedFunc func( - DepositContractAddress common.Address, - AbortOutputScript []uint8, +type tBTCSystemOwnershipTransferredFunc func( + PreviousOwner common.Address, + NewOwner common.Address, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchFunderAbortRequested( - success tBTCSystemFunderAbortRequestedFunc, +func (tbtcs *TBTCSystem) PastOwnershipTransferredEvents( + startBlock uint64, + endBlock *uint64, + previousOwnerFilter []common.Address, + newOwnerFilter []common.Address, +) ([]*abi.TBTCSystemOwnershipTransferred, error) { + iterator, err := tbtcs.contract.FilterOwnershipTransferred( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + previousOwnerFilter, + newOwnerFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past OwnershipTransferred events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemOwnershipTransferred, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +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{}) @@ -6819,10 +7262,11 @@ func (tbtcs *TBTCSystem) WatchFunderAbortRequested( return err } - subscription, err := tbtcs.subscribeFunderAbortRequested( + subscription, err := tbtcs.subscribeOwnershipTransferred( success, failCallback, - _depositContractAddressFilter, + previousOwnerFilter, + newOwnerFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -6842,7 +7286,7 @@ func (tbtcs *TBTCSystem) WatchFunderAbortRequested( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event FunderAbortRequested terminated with error; " + + "subscription to event OwnershipTransferred terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6863,21 +7307,23 @@ func (tbtcs *TBTCSystem) WatchFunderAbortRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeFunderAbortRequested( - success tBTCSystemFunderAbortRequestedFunc, +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.TBTCSystemFunderAbortRequested) - eventSubscription, err := tbtcs.contract.WatchFunderAbortRequested( + 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 FunderAbortRequested events: [%v]", + "error creating watch for OwnershipTransferred events: [%v]", err, ) } @@ -6895,8 +7341,8 @@ func (tbtcs *TBTCSystem) subscribeFunderAbortRequested( return } success( - event.DepositContractAddress, - event.AbortOutputScript, + event.PreviousOwner, + event.NewOwner, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -6918,20 +7364,49 @@ func (tbtcs *TBTCSystem) subscribeFunderAbortRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemGotRedemptionSignatureFunc func( +type tBTCSystemRedeemedFunc func( DepositContractAddress common.Address, - Digest [32]uint8, - R [32]uint8, - S [32]uint8, + Txid [32]uint8, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchGotRedemptionSignature( - success tBTCSystemGotRedemptionSignatureFunc, +func (tbtcs *TBTCSystem) PastRedeemedEvents( + startBlock uint64, + endBlock *uint64, + _depositContractAddressFilter []common.Address, + _txidFilter [][32]uint8, +) ([]*abi.TBTCSystemRedeemed, error) { + iterator, err := tbtcs.contract.FilterRedeemed( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + _depositContractAddressFilter, + _txidFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past Redeemed events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemRedeemed, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (tbtcs *TBTCSystem) WatchRedeemed( + success tBTCSystemRedeemedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _digestFilter [][32]uint8, + _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -6948,11 +7423,11 @@ func (tbtcs *TBTCSystem) WatchGotRedemptionSignature( return err } - subscription, err := tbtcs.subscribeGotRedemptionSignature( + subscription, err := tbtcs.subscribeRedeemed( success, failCallback, _depositContractAddressFilter, - _digestFilter, + _txidFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -6972,7 +7447,7 @@ func (tbtcs *TBTCSystem) WatchGotRedemptionSignature( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event GotRedemptionSignature terminated with error; " + + "subscription to event Redeemed terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -6993,23 +7468,23 @@ func (tbtcs *TBTCSystem) WatchGotRedemptionSignature( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeGotRedemptionSignature( - success tBTCSystemGotRedemptionSignatureFunc, +func (tbtcs *TBTCSystem) subscribeRedeemed( + success tBTCSystemRedeemedFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _digestFilter [][32]uint8, + _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemGotRedemptionSignature) - eventSubscription, err := tbtcs.contract.WatchGotRedemptionSignature( + eventChan := make(chan *abi.TBTCSystemRedeemed) + eventSubscription, err := tbtcs.contract.WatchRedeemed( nil, eventChan, _depositContractAddressFilter, - _digestFilter, + _txidFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for GotRedemptionSignature events: [%v]", + "error creating watch for Redeemed events: [%v]", err, ) } @@ -7028,9 +7503,7 @@ func (tbtcs *TBTCSystem) subscribeGotRedemptionSignature( } success( event.DepositContractAddress, - event.Digest, - event.R, - event.S, + event.Txid, event.Timestamp, event.Raw.BlockNumber, ) @@ -7053,15 +7526,43 @@ func (tbtcs *TBTCSystem) subscribeGotRedemptionSignature( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemKeepFactoriesUpdatedFunc 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) WatchKeepFactoriesUpdated( - success tBTCSystemKeepFactoriesUpdatedFunc, +func (tbtcs *TBTCSystem) PastCollateralizationThresholdsUpdateStartedEvents( + startBlock uint64, + endBlock *uint64, +) ([]*abi.TBTCSystemCollateralizationThresholdsUpdateStarted, error) { + iterator, err := tbtcs.contract.FilterCollateralizationThresholdsUpdateStarted( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past CollateralizationThresholdsUpdateStarted events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemCollateralizationThresholdsUpdateStarted, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (tbtcs *TBTCSystem) WatchCollateralizationThresholdsUpdateStarted( + success tBTCSystemCollateralizationThresholdsUpdateStartedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { errorChan := make(chan error) @@ -7079,7 +7580,7 @@ func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdated( return err } - subscription, err := tbtcs.subscribeKeepFactoriesUpdated( + subscription, err := tbtcs.subscribeCollateralizationThresholdsUpdateStarted( success, failCallback, ) @@ -7101,7 +7602,7 @@ func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event KeepFactoriesUpdated terminated with error; " + + "subscription to event CollateralizationThresholdsUpdateStarted terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7122,19 +7623,19 @@ func (tbtcs *TBTCSystem) WatchKeepFactoriesUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdated( - success tBTCSystemKeepFactoriesUpdatedFunc, +func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdateStarted( + success tBTCSystemCollateralizationThresholdsUpdateStartedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemKeepFactoriesUpdated) - eventSubscription, err := tbtcs.contract.WatchKeepFactoriesUpdated( + 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 KeepFactoriesUpdated events: [%v]", + "error creating watch for CollateralizationThresholdsUpdateStarted events: [%v]", err, ) } @@ -7152,9 +7653,10 @@ func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdated( return } success( - event.KeepStakedFactory, - event.FullyBackedFactory, - event.FactorySelector, + event.InitialCollateralizedPercent, + event.UndercollateralizedThresholdPercent, + event.SeverelyUndercollateralizedThresholdPercent, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -7176,16 +7678,43 @@ func (tbtcs *TBTCSystem) subscribeKeepFactoriesUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemLiquidatedFunc func( - DepositContractAddress common.Address, - Timestamp *big.Int, +type tBTCSystemCollateralizationThresholdsUpdatedFunc func( + InitialCollateralizedPercent uint16, + UndercollateralizedThresholdPercent uint16, + SeverelyUndercollateralizedThresholdPercent uint16, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchLiquidated( - success tBTCSystemLiquidatedFunc, +func (tbtcs *TBTCSystem) PastCollateralizationThresholdsUpdatedEvents( + startBlock uint64, + endBlock *uint64, +) ([]*abi.TBTCSystemCollateralizationThresholdsUpdated, error) { + iterator, err := tbtcs.contract.FilterCollateralizationThresholdsUpdated( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past CollateralizationThresholdsUpdated events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemCollateralizationThresholdsUpdated, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +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{}) @@ -7202,10 +7731,9 @@ func (tbtcs *TBTCSystem) WatchLiquidated( return err } - subscription, err := tbtcs.subscribeLiquidated( + subscription, err := tbtcs.subscribeCollateralizationThresholdsUpdated( success, failCallback, - _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -7225,7 +7753,7 @@ func (tbtcs *TBTCSystem) WatchLiquidated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event Liquidated terminated with error; " + + "subscription to event CollateralizationThresholdsUpdated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7246,21 +7774,19 @@ func (tbtcs *TBTCSystem) WatchLiquidated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeLiquidated( - success tBTCSystemLiquidatedFunc, +func (tbtcs *TBTCSystem) subscribeCollateralizationThresholdsUpdated( + success tBTCSystemCollateralizationThresholdsUpdatedFunc, 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.TBTCSystemCollateralizationThresholdsUpdated) + eventSubscription, err := tbtcs.contract.WatchCollateralizationThresholdsUpdated( nil, eventChan, - _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for Liquidated events: [%v]", + "error creating watch for CollateralizationThresholdsUpdated events: [%v]", err, ) } @@ -7278,8 +7804,9 @@ func (tbtcs *TBTCSystem) subscribeLiquidated( return } success( - event.DepositContractAddress, - event.Timestamp, + event.InitialCollateralizedPercent, + event.UndercollateralizedThresholdPercent, + event.SeverelyUndercollateralizedThresholdPercent, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -7301,13 +7828,40 @@ func (tbtcs *TBTCSystem) subscribeLiquidated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemLotSizesUpdatedFunc func( - LotSizes []uint64, +type tBTCSystemEthBtcPriceFeedAddedFunc func( + PriceFeed common.Address, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchLotSizesUpdated( - success tBTCSystemLotSizesUpdatedFunc, +func (tbtcs *TBTCSystem) PastEthBtcPriceFeedAddedEvents( + startBlock uint64, + endBlock *uint64, +) ([]*abi.TBTCSystemEthBtcPriceFeedAdded, error) { + iterator, err := tbtcs.contract.FilterEthBtcPriceFeedAdded( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past EthBtcPriceFeedAdded events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemEthBtcPriceFeedAdded, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdded( + success tBTCSystemEthBtcPriceFeedAddedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { errorChan := make(chan error) @@ -7325,7 +7879,7 @@ func (tbtcs *TBTCSystem) WatchLotSizesUpdated( return err } - subscription, err := tbtcs.subscribeLotSizesUpdated( + subscription, err := tbtcs.subscribeEthBtcPriceFeedAdded( success, failCallback, ) @@ -7347,7 +7901,7 @@ func (tbtcs *TBTCSystem) WatchLotSizesUpdated( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event LotSizesUpdated terminated with error; " + + "subscription to event EthBtcPriceFeedAdded terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7368,19 +7922,19 @@ func (tbtcs *TBTCSystem) WatchLotSizesUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeLotSizesUpdated( - success tBTCSystemLotSizesUpdatedFunc, +func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdded( + success tBTCSystemEthBtcPriceFeedAddedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemLotSizesUpdated) - eventSubscription, err := tbtcs.contract.WatchLotSizesUpdated( + 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 LotSizesUpdated events: [%v]", + "error creating watch for EthBtcPriceFeedAdded events: [%v]", err, ) } @@ -7398,7 +7952,7 @@ func (tbtcs *TBTCSystem) subscribeLotSizesUpdated( return } success( - event.LotSizes, + event.PriceFeed, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -7420,14 +7974,45 @@ func (tbtcs *TBTCSystem) subscribeLotSizesUpdated( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemEthBtcPriceFeedAddedFunc func( - PriceFeed common.Address, +type tBTCSystemExitedCourtesyCallFunc func( + DepositContractAddress common.Address, + Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdded( - success tBTCSystemEthBtcPriceFeedAddedFunc, +func (tbtcs *TBTCSystem) PastExitedCourtesyCallEvents( + startBlock uint64, + endBlock *uint64, + _depositContractAddressFilter []common.Address, +) ([]*abi.TBTCSystemExitedCourtesyCall, error) { + iterator, err := tbtcs.contract.FilterExitedCourtesyCall( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + _depositContractAddressFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past ExitedCourtesyCall events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemExitedCourtesyCall, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +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{}) @@ -7444,9 +8029,10 @@ func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdded( return err } - subscription, err := tbtcs.subscribeEthBtcPriceFeedAdded( + subscription, err := tbtcs.subscribeExitedCourtesyCall( success, failCallback, + _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -7466,7 +8052,7 @@ func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdded( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event EthBtcPriceFeedAdded terminated with error; " + + "subscription to event ExitedCourtesyCall terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7487,19 +8073,21 @@ func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdded( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdded( - success tBTCSystemEthBtcPriceFeedAddedFunc, +func (tbtcs *TBTCSystem) subscribeExitedCourtesyCall( + success tBTCSystemExitedCourtesyCallFunc, 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.TBTCSystemExitedCourtesyCall) + eventSubscription, err := tbtcs.contract.WatchExitedCourtesyCall( nil, eventChan, + _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for EthBtcPriceFeedAdded events: [%v]", + "error creating watch for ExitedCourtesyCall events: [%v]", err, ) } @@ -7517,7 +8105,8 @@ func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdded( return } success( - event.PriceFeed, + event.DepositContractAddress, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -7532,21 +8121,47 @@ func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdded( subscriptionMutex.Lock() defer subscriptionMutex.Unlock() - eventSubscription.Unsubscribe() - close(eventChan) + eventSubscription.Unsubscribe() + close(eventChan) + } + + return subscription.NewEventSubscription(unsubscribeCallback), nil +} + +type tBTCSystemSignerFeeDivisorUpdatedFunc func( + SignerFeeDivisor uint16, + blockNumber uint64, +) + +func (tbtcs *TBTCSystem) PastSignerFeeDivisorUpdatedEvents( + startBlock uint64, + endBlock *uint64, +) ([]*abi.TBTCSystemSignerFeeDivisorUpdated, error) { + iterator, err := tbtcs.contract.FilterSignerFeeDivisorUpdated( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past SignerFeeDivisorUpdated events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemSignerFeeDivisorUpdated, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) } - return subscription.NewEventSubscription(unsubscribeCallback), nil + return events, nil } -type tBTCSystemEthBtcPriceFeedAdditionStartedFunc func( - PriceFeed common.Address, - Timestamp *big.Int, - blockNumber uint64, -) - -func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdditionStarted( - success tBTCSystemEthBtcPriceFeedAdditionStartedFunc, +func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdated( + success tBTCSystemSignerFeeDivisorUpdatedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { errorChan := make(chan error) @@ -7564,7 +8179,7 @@ func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdditionStarted( return err } - subscription, err := tbtcs.subscribeEthBtcPriceFeedAdditionStarted( + subscription, err := tbtcs.subscribeSignerFeeDivisorUpdated( success, failCallback, ) @@ -7586,7 +8201,7 @@ func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdditionStarted( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event EthBtcPriceFeedAdditionStarted terminated with error; " + + "subscription to event SignerFeeDivisorUpdated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7607,19 +8222,19 @@ func (tbtcs *TBTCSystem) WatchEthBtcPriceFeedAdditionStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdditionStarted( - success tBTCSystemEthBtcPriceFeedAdditionStartedFunc, +func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdated( + success tBTCSystemSignerFeeDivisorUpdatedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemEthBtcPriceFeedAdditionStarted) - eventSubscription, err := tbtcs.contract.WatchEthBtcPriceFeedAdditionStarted( + 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 EthBtcPriceFeedAdditionStarted events: [%v]", + "error creating watch for SignerFeeDivisorUpdated events: [%v]", err, ) } @@ -7637,8 +8252,7 @@ func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdditionStarted( return } success( - event.PriceFeed, - event.Timestamp, + event.SignerFeeDivisor, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -7660,14 +8274,44 @@ func (tbtcs *TBTCSystem) subscribeEthBtcPriceFeedAdditionStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemFraudDuringSetupFunc func( +type tBTCSystemStartedLiquidationFunc func( DepositContractAddress common.Address, + WasFraud bool, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchFraudDuringSetup( - success tBTCSystemFraudDuringSetupFunc, +func (tbtcs *TBTCSystem) PastStartedLiquidationEvents( + startBlock uint64, + endBlock *uint64, + _depositContractAddressFilter []common.Address, +) ([]*abi.TBTCSystemStartedLiquidation, error) { + iterator, err := tbtcs.contract.FilterStartedLiquidation( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + _depositContractAddressFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past StartedLiquidation events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemStartedLiquidation, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (tbtcs *TBTCSystem) WatchStartedLiquidation( + success tBTCSystemStartedLiquidationFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, ) (subscription.EventSubscription, error) { @@ -7686,7 +8330,7 @@ func (tbtcs *TBTCSystem) WatchFraudDuringSetup( return err } - subscription, err := tbtcs.subscribeFraudDuringSetup( + subscription, err := tbtcs.subscribeStartedLiquidation( success, failCallback, _depositContractAddressFilter, @@ -7709,7 +8353,7 @@ func (tbtcs *TBTCSystem) WatchFraudDuringSetup( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event FraudDuringSetup terminated with error; " + + "subscription to event StartedLiquidation terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7730,13 +8374,13 @@ func (tbtcs *TBTCSystem) WatchFraudDuringSetup( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeFraudDuringSetup( - success tBTCSystemFraudDuringSetupFunc, +func (tbtcs *TBTCSystem) subscribeStartedLiquidation( + success tBTCSystemStartedLiquidationFunc, 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.TBTCSystemStartedLiquidation) + eventSubscription, err := tbtcs.contract.WatchStartedLiquidation( nil, eventChan, _depositContractAddressFilter, @@ -7744,7 +8388,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 StartedLiquidation events: [%v]", err, ) } @@ -7763,6 +8407,7 @@ func (tbtcs *TBTCSystem) subscribeFraudDuringSetup( } success( event.DepositContractAddress, + event.WasFraud, event.Timestamp, event.Raw.BlockNumber, ) @@ -7785,14 +8430,40 @@ func (tbtcs *TBTCSystem) subscribeFraudDuringSetup( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemSignerFeeDivisorUpdateStartedFunc func( - SignerFeeDivisor uint16, - Timestamp *big.Int, +type tBTCSystemAllowNewDepositsUpdatedFunc func( + AllowNewDeposits bool, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdateStarted( - success tBTCSystemSignerFeeDivisorUpdateStartedFunc, +func (tbtcs *TBTCSystem) PastAllowNewDepositsUpdatedEvents( + startBlock uint64, + endBlock *uint64, +) ([]*abi.TBTCSystemAllowNewDepositsUpdated, error) { + iterator, err := tbtcs.contract.FilterAllowNewDepositsUpdated( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past AllowNewDepositsUpdated events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemAllowNewDepositsUpdated, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (tbtcs *TBTCSystem) WatchAllowNewDepositsUpdated( + success tBTCSystemAllowNewDepositsUpdatedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { errorChan := make(chan error) @@ -7810,7 +8481,7 @@ func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdateStarted( return err } - subscription, err := tbtcs.subscribeSignerFeeDivisorUpdateStarted( + subscription, err := tbtcs.subscribeAllowNewDepositsUpdated( success, failCallback, ) @@ -7832,7 +8503,7 @@ func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdateStarted( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event SignerFeeDivisorUpdateStarted terminated with error; " + + "subscription to event AllowNewDepositsUpdated terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -7853,19 +8524,19 @@ func (tbtcs *TBTCSystem) WatchSignerFeeDivisorUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdateStarted( - success tBTCSystemSignerFeeDivisorUpdateStartedFunc, +func (tbtcs *TBTCSystem) subscribeAllowNewDepositsUpdated( + success tBTCSystemAllowNewDepositsUpdatedFunc, fail func(err error) error, ) (subscription.EventSubscription, error) { - eventChan := make(chan *abi.TBTCSystemSignerFeeDivisorUpdateStarted) - eventSubscription, err := tbtcs.contract.WatchSignerFeeDivisorUpdateStarted( + 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 SignerFeeDivisorUpdateStarted events: [%v]", + "error creating watch for AllowNewDepositsUpdated events: [%v]", err, ) } @@ -7883,8 +8554,7 @@ func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdateStarted( return } success( - event.SignerFeeDivisor, - event.Timestamp, + event.AllowNewDeposits, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -7906,18 +8576,45 @@ func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdateStarted( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemRedeemedFunc func( +type tBTCSystemFraudDuringSetupFunc func( DepositContractAddress common.Address, - Txid [32]uint8, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchRedeemed( - success tBTCSystemRedeemedFunc, +func (tbtcs *TBTCSystem) PastFraudDuringSetupEvents( + startBlock uint64, + endBlock *uint64, + _depositContractAddressFilter []common.Address, +) ([]*abi.TBTCSystemFraudDuringSetup, error) { + iterator, err := tbtcs.contract.FilterFraudDuringSetup( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + _depositContractAddressFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past FraudDuringSetup events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemFraudDuringSetup, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (tbtcs *TBTCSystem) WatchFraudDuringSetup( + success tBTCSystemFraudDuringSetupFunc, fail func(err error) error, _depositContractAddressFilter []common.Address, - _txidFilter [][32]uint8, ) (subscription.EventSubscription, error) { errorChan := make(chan error) unsubscribeChan := make(chan struct{}) @@ -7934,11 +8631,10 @@ func (tbtcs *TBTCSystem) WatchRedeemed( return err } - subscription, err := tbtcs.subscribeRedeemed( + subscription, err := tbtcs.subscribeFraudDuringSetup( success, failCallback, _depositContractAddressFilter, - _txidFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -7958,7 +8654,7 @@ func (tbtcs *TBTCSystem) WatchRedeemed( select { case <-errorChan: tbtcsLogger.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) @@ -7979,23 +8675,21 @@ func (tbtcs *TBTCSystem) WatchRedeemed( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeRedeemed( - success tBTCSystemRedeemedFunc, +func (tbtcs *TBTCSystem) subscribeFraudDuringSetup( + success tBTCSystemFraudDuringSetupFunc, 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.TBTCSystemFraudDuringSetup) + eventSubscription, err := tbtcs.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, ) } @@ -8014,7 +8708,6 @@ func (tbtcs *TBTCSystem) subscribeRedeemed( } success( event.DepositContractAddress, - event.Txid, event.Timestamp, event.Raw.BlockNumber, ) @@ -8037,23 +8730,42 @@ 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 tBTCSystemLotSizesUpdateStartedFunc func( + LotSizes []uint64, + Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchRedemptionRequested( - success tBTCSystemRedemptionRequestedFunc, +func (tbtcs *TBTCSystem) PastLotSizesUpdateStartedEvents( + startBlock uint64, + endBlock *uint64, +) ([]*abi.TBTCSystemLotSizesUpdateStarted, error) { + iterator, err := tbtcs.contract.FilterLotSizesUpdateStarted( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past LotSizesUpdateStarted events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemLotSizesUpdateStarted, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (tbtcs *TBTCSystem) WatchLotSizesUpdateStarted( + success tBTCSystemLotSizesUpdateStartedFunc, 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{}) @@ -8070,12 +8782,9 @@ func (tbtcs *TBTCSystem) WatchRedemptionRequested( return err } - subscription, err := tbtcs.subscribeRedemptionRequested( + subscription, err := tbtcs.subscribeLotSizesUpdateStarted( success, failCallback, - _depositContractAddressFilter, - _requesterFilter, - _digestFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -8095,7 +8804,7 @@ func (tbtcs *TBTCSystem) WatchRedemptionRequested( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event RedemptionRequested terminated with error; " + + "subscription to event LotSizesUpdateStarted terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -8116,25 +8825,19 @@ func (tbtcs *TBTCSystem) WatchRedemptionRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeRedemptionRequested( - success tBTCSystemRedemptionRequestedFunc, +func (tbtcs *TBTCSystem) subscribeLotSizesUpdateStarted( + success tBTCSystemLotSizesUpdateStartedFunc, 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.TBTCSystemLotSizesUpdateStarted) + eventSubscription, err := tbtcs.contract.WatchLotSizesUpdateStarted( 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 LotSizesUpdateStarted events: [%v]", err, ) } @@ -8152,13 +8855,8 @@ func (tbtcs *TBTCSystem) subscribeRedemptionRequested( return } success( - event.DepositContractAddress, - event.Requester, - event.Digest, - event.UtxoValue, - event.RedeemerOutputScript, - event.RequestedFee, - event.Outpoint, + event.LotSizes, + event.Timestamp, event.Raw.BlockNumber, ) subscriptionMutex.Unlock() @@ -8180,18 +8878,42 @@ func (tbtcs *TBTCSystem) subscribeRedemptionRequested( return subscription.NewEventSubscription(unsubscribeCallback), nil } -type tBTCSystemRegisteredPubkeyFunc func( - DepositContractAddress common.Address, - SigningGroupPubkeyX [32]uint8, - SigningGroupPubkeyY [32]uint8, +type tBTCSystemSignerFeeDivisorUpdateStartedFunc func( + SignerFeeDivisor uint16, Timestamp *big.Int, blockNumber uint64, ) -func (tbtcs *TBTCSystem) WatchRegisteredPubkey( - success tBTCSystemRegisteredPubkeyFunc, +func (tbtcs *TBTCSystem) PastSignerFeeDivisorUpdateStartedEvents( + startBlock uint64, + endBlock *uint64, +) ([]*abi.TBTCSystemSignerFeeDivisorUpdateStarted, error) { + iterator, err := tbtcs.contract.FilterSignerFeeDivisorUpdateStarted( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past SignerFeeDivisorUpdateStarted events: [%v]", + err, + ) + } + + events := make([]*abi.TBTCSystemSignerFeeDivisorUpdateStarted, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +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{}) @@ -8208,10 +8930,9 @@ func (tbtcs *TBTCSystem) WatchRegisteredPubkey( return err } - subscription, err := tbtcs.subscribeRegisteredPubkey( + subscription, err := tbtcs.subscribeSignerFeeDivisorUpdateStarted( success, failCallback, - _depositContractAddressFilter, ) if err != nil { errorChan <- err // trigger resubscription signal @@ -8231,7 +8952,7 @@ func (tbtcs *TBTCSystem) WatchRegisteredPubkey( select { case <-errorChan: tbtcsLogger.Warning( - "subscription to event RegisteredPubkey terminated with error; " + + "subscription to event SignerFeeDivisorUpdateStarted terminated with error; " + "resubscription attempt will be performed after the retry delay", ) time.Sleep(retryDelay) @@ -8252,21 +8973,19 @@ func (tbtcs *TBTCSystem) WatchRegisteredPubkey( return subscription.NewEventSubscription(unsubscribeCallback), nil } -func (tbtcs *TBTCSystem) subscribeRegisteredPubkey( - success tBTCSystemRegisteredPubkeyFunc, +func (tbtcs *TBTCSystem) subscribeSignerFeeDivisorUpdateStarted( + success tBTCSystemSignerFeeDivisorUpdateStartedFunc, 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.TBTCSystemSignerFeeDivisorUpdateStarted) + eventSubscription, err := tbtcs.contract.WatchSignerFeeDivisorUpdateStarted( nil, eventChan, - _depositContractAddressFilter, ) if err != nil { close(eventChan) return eventSubscription, fmt.Errorf( - "error creating watch for RegisteredPubkey events: [%v]", + "error creating watch for SignerFeeDivisorUpdateStarted events: [%v]", err, ) } @@ -8284,9 +9003,7 @@ func (tbtcs *TBTCSystem) subscribeRegisteredPubkey( return } success( - event.DepositContractAddress, - event.SigningGroupPubkeyX, - event.SigningGroupPubkeyY, + event.SignerFeeDivisor, event.Timestamp, event.Raw.BlockNumber, ) From ba8c23a70862e7d7beb8af7cecf5de1b5f16fbda Mon Sep 17 00:00:00 2001 From: Dmitry Date: Mon, 16 Nov 2020 15:28:24 +0100 Subject: [PATCH 4/5] Tidying mod --- go.sum | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.sum b/go.sum index 584ee8d10..1535976ae 100644 --- a/go.sum +++ b/go.sum @@ -166,8 +166,6 @@ github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 h1:I/yrLt2WilKxlQKCM5 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/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-common v1.2.1-0.20201116121154-016d77aacdce h1:B+kei2KjTdLS7JeK6YeDFU6suzPbkCn8WiAX1VDqtA0= github.com/keep-network/keep-common v1.2.1-0.20201116121154-016d77aacdce/go.mod h1:emxogTbBdey7M3jOzfxZOdfn139kN2mI2b2wA6AHKKo= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= From b402e4e10cab563fb8b0a14169288edc05190c79 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 17 Nov 2020 09:20:31 +0100 Subject: [PATCH 5/5] Updating to the latest keep-common --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index eb02660d2..2ba2ee7de 100644 --- a/go.mod +++ b/go.mod @@ -5,5 +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.20201116121154-016d77aacdce + github.com/keep-network/keep-common v1.2.1-0.20201116151638-8af057907255 ) diff --git a/go.sum b/go.sum index 1535976ae..c86b8c041 100644 --- a/go.sum +++ b/go.sum @@ -166,8 +166,8 @@ github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 h1:I/yrLt2WilKxlQKCM5 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/keep-common v1.2.1-0.20201116121154-016d77aacdce h1:B+kei2KjTdLS7JeK6YeDFU6suzPbkCn8WiAX1VDqtA0= -github.com/keep-network/keep-common v1.2.1-0.20201116121154-016d77aacdce/go.mod h1:emxogTbBdey7M3jOzfxZOdfn139kN2mI2b2wA6AHKKo= +github.com/keep-network/keep-common v1.2.1-0.20201116151638-8af057907255 h1:SLdv4Mzo9GX0lvg+1r4SHdEbvw57Nofsdb4d3Iq/aoM= +github.com/keep-network/keep-common v1.2.1-0.20201116151638-8af057907255/go.mod h1:emxogTbBdey7M3jOzfxZOdfn139kN2mI2b2wA6AHKKo= 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=