diff --git a/bindings/.githead b/bindings/.githead index 3add7c140..869ce4fc1 100644 --- a/bindings/.githead +++ b/bindings/.githead @@ -1 +1 @@ -55be84a00af93ff248059a86546f215a8702e95b +437763a729bbf02cbf588559a20cc354f19b1677 diff --git a/bindings/encoding/input.go b/bindings/encoding/input.go index 69f27fcc5..bce39d85b 100644 --- a/bindings/encoding/input.go +++ b/bindings/encoding/input.go @@ -79,10 +79,6 @@ var ( Name: "beneficiary", Type: "address", }, - { - Name: "treasury", - Type: "address", - }, { Name: "depositsProcessed", Type: "tuple[]", @@ -128,18 +124,40 @@ var ( Type: "address", }, { - Name: "parentGasUsed", - Type: "uint32", + Name: "proofs", + Type: "bytes", }, + } + proverAssignmentComponents = []abi.ArgumentMarshaling{ { - Name: "gasUsed", - Type: "uint32", + Name: "prover", + Type: "address", + }, + { + Name: "expiry", + Type: "uint64", }, { - Name: "proof", + Name: "data", Type: "bytes", }, } + proposeBlockDataComponents = []abi.ArgumentMarshaling{ + { + Name: "input", + Type: "tuple", + Components: blockMetadataInputComponents, + }, + { + Name: "fee", + Type: "uint256", + }, + + { + Name: "expiry", + Type: "uint64", + }, + } ) var ( @@ -152,6 +170,12 @@ var ( // Evidence EvidenceType, _ = abi.NewType("tuple", "TaikoData.BlockEvidence", evidenceComponents) EvidenceArgs = abi.Arguments{{Name: "Evidence", Type: EvidenceType}} + // ProverAssignment + proverAssignmentType, _ = abi.NewType("tuple", "ProverAssignment", proverAssignmentComponents) + proverAssignmentArgs = abi.Arguments{{Name: "ProverAssignment", Type: proverAssignmentType}} + // ProposeBlockData + proposeBlockDataType, _ = abi.NewType("tuple", "ProposeBlockData", proposeBlockDataComponents) + proposeBlockDataArgs = abi.Arguments{{Name: "ProposeBlockData", Type: proposeBlockDataType}} ) // Contract ABIs. @@ -190,6 +214,24 @@ func EncodeBlockMetadata(meta *bindings.TaikoDataBlockMetadata) ([]byte, error) return b, nil } +// EncodeProverAssignment performs the solidity `abi.encode` for the given proverAssignment. +func EncodeProverAssignment(assignment *ProverAssignment) ([]byte, error) { + b, err := proverAssignmentArgs.Pack(assignment) + if err != nil { + return nil, fmt.Errorf("failed to abi.encode prover assignment, %w", err) + } + return b, nil +} + +// EncodeProposeBlockData performs the solidity `abi.encode` for the given proposeBlockData. +func EncodeProposeBlockData(data *ProposeBlockData) ([]byte, error) { + b, err := proposeBlockDataArgs.Pack(data) + if err != nil { + return nil, fmt.Errorf("failed to abi.encode proposeBlock data, %w", err) + } + return b, nil +} + // EncodeEvidence performs the solidity `abi.encode` for the given evidence. func EncodeEvidence(e *TaikoL1Evidence) ([]byte, error) { b, err := EvidenceArgs.Pack(e) diff --git a/bindings/encoding/input_test.go b/bindings/encoding/input_test.go index 5a24c7020..fc92098db 100644 --- a/bindings/encoding/input_test.go +++ b/bindings/encoding/input_test.go @@ -9,19 +9,18 @@ import ( "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/core/types" "github.com/stretchr/testify/require" + "github.com/taikoxyz/taiko-client/bindings" ) func TestEncodeEvidence(t *testing.T) { evidence := &TaikoL1Evidence{ - MetaHash: randomHash(), - BlockHash: randomHash(), - ParentHash: randomHash(), - SignalRoot: randomHash(), - Graffiti: randomHash(), - Prover: common.BigToAddress(new(big.Int).SetUint64(rand.Uint64())), - ParentGasUsed: 1024, - GasUsed: 1024, - Proof: randomHash().Big().Bytes(), + MetaHash: randomHash(), + BlockHash: randomHash(), + ParentHash: randomHash(), + SignalRoot: randomHash(), + Graffiti: randomHash(), + Prover: common.BigToAddress(new(big.Int).SetUint64(rand.Uint64())), + Proofs: randomHash().Big().Bytes(), } b, err := EncodeEvidence(evidence) @@ -44,15 +43,26 @@ func TestEncodeProposeBlockInput(t *testing.T) { func TestEncodeProveBlockInput(t *testing.T) { encoded, err := EncodeProveBlockInput( &TaikoL1Evidence{ - MetaHash: randomHash(), - BlockHash: randomHash(), - ParentHash: randomHash(), - SignalRoot: randomHash(), - Graffiti: randomHash(), - Prover: common.BigToAddress(new(big.Int).SetUint64(rand.Uint64())), - ParentGasUsed: 1024, - GasUsed: 1024, - Proof: randomHash().Big().Bytes(), + MetaHash: randomHash(), + BlockHash: randomHash(), + ParentHash: randomHash(), + SignalRoot: randomHash(), + Graffiti: randomHash(), + Prover: common.BigToAddress(new(big.Int).SetUint64(rand.Uint64())), + Proofs: randomHash().Big().Bytes(), + }, + ) + + require.Nil(t, err) + require.NotNil(t, encoded) +} + +func TestEncodeProverAssignment(t *testing.T) { + encoded, err := EncodeProverAssignment( + &ProverAssignment{ + Prover: common.BigToAddress(new(big.Int).SetUint64(rand.Uint64())), + Data: randomHash().Big().Bytes(), + Expiry: 1024, }, ) @@ -63,15 +73,13 @@ func TestEncodeProveBlockInput(t *testing.T) { func TestEncodeProveBlockInvalidInput(t *testing.T) { encoded, err := EncodeProveBlockInvalidInput( &TaikoL1Evidence{ - MetaHash: randomHash(), - BlockHash: randomHash(), - ParentHash: randomHash(), - SignalRoot: randomHash(), - Graffiti: randomHash(), - Prover: common.BigToAddress(new(big.Int).SetUint64(rand.Uint64())), - ParentGasUsed: 1024, - GasUsed: 1024, - Proof: randomHash().Big().Bytes(), + MetaHash: randomHash(), + BlockHash: randomHash(), + ParentHash: randomHash(), + SignalRoot: randomHash(), + Graffiti: randomHash(), + Prover: common.BigToAddress(new(big.Int).SetUint64(rand.Uint64())), + Proofs: randomHash().Big().Bytes(), }, &testMeta, types.NewReceipt(randomHash().Bytes(), false, 1024), @@ -81,84 +89,80 @@ func TestEncodeProveBlockInvalidInput(t *testing.T) { require.NotNil(t, encoded) } -// TODO(Roger): fix this test -// func TestEncodeBlockMetadata(t *testing.T) { -// // since strings are right padded in solidity https://github.com/ethereum/solidity/issues/1340 -// var abcdBytes [32]byte -// copy(abcdBytes[:], common.RightPadBytes([]byte("abcd"), 32)) - -// // Encode block metadata using EncodeBlockMetadata function -// encoded, err := EncodeBlockMetadata(&bindings.TaikoDataBlockMetadata{ -// Id: uint64(1), -// L1Height: uint64(1), -// L1Hash: abcdBytes, -// Beneficiary: common.HexToAddress("0x10020FCb72e27650651B05eD2CEcA493bC807Ba4"), -// Treasury: common.HexToAddress("0x50081b12838240B1bA02b3177153Bca678a86078"), -// TxListHash: abcdBytes, -// TxListByteStart: big.NewInt(0), -// TxListByteEnd: big.NewInt(1000), -// GasLimit: 1, -// MixHash: abcdBytes, -// Timestamp: uint64(1), -// DepositsProcessed: []bindings.TaikoDataEthDeposit{}, -// }) - -// require.Nil(t, err) -// require.NotNil(t, encoded) - -// kgv, err := hexutil.Decode("0x0000000000000000000000000000000000000000000000000" + -// "000000000000020000000000000000000000000000000000000000000000000000000000000000" + -// "100000000000000000000000000000000000000000000000000000000000000010000000000000" + -// "000000000000000000000000000000000000000000000000001616263640000000000000000000" + -// "000000000000000000000000000000000000061626364000000000000000000000000000000000" + -// "000000000000000000000006162636400000000000000000000000000000000000000000000000" + -// "000000000000000000000000000000000000000000000000000000000000000000000000000000" + -// "000000000000000000000000000000000000000000000000000000003e80000000000000000000" + -// "00000000000000000000000000000000000000000000100000000000000000000000010020fcb7" + -// "2e27650651b05ed2ceca493bc807ba400000000000000000000000050081b12838240b1ba02b31" + -// "77153bca678a860780000000000000000000000000000000000000000000000000000000000000" + -// "1800000000000000000000000000000000000000000000000000000000000000000") - -// require.Nil(t, err) -// require.Equal(t, kgv, encoded) - -// encoded2, err := EncodeBlockMetadata(&bindings.TaikoDataBlockMetadata{ -// Id: uint64(1), -// L1Height: uint64(1), -// L1Hash: abcdBytes, -// Beneficiary: common.HexToAddress("0x10020FCb72e27650651B05eD2CEcA493bC807Ba4"), -// Treasury: common.HexToAddress("0x50081b12838240B1bA02b3177153Bca678a86078"), -// TxListHash: abcdBytes, -// TxListByteStart: big.NewInt(0), -// TxListByteEnd: big.NewInt(1000), -// GasLimit: 1, -// MixHash: abcdBytes, -// Timestamp: uint64(1), -// DepositsProcessed: []bindings.TaikoDataEthDeposit{ -// {Recipient: common.HexToAddress("0x10020FCb72e27650651B05eD2CEcA493bC807Ba4"), Amount: big.NewInt(2)}, -// }, -// }) - -// require.Nil(t, err) -// require.NotNil(t, encoded2) - -// kgv2, err := hexutil.Decode("0x0000000000000000000000000000000000000000000000000" + -// "0000000000000200000000000000000000000000000000000000000000000000000000000000001000" + -// "0000000000000000000000000000000000000000000000000000000000001000000000000000000000" + -// "0000000000000000000000000000000000000000001616263640000000000000000000000000000000" + -// "0000000000000000000000000616263640000000000000000000000000000000000000000000000000" + -// "0000000616263640000000000000000000000000000000000000000000000000000000000000000000" + -// "0000000000000000000000000000000000000000000000000000000000000000000000000000000000" + -// "000000000000000000000000000000003e800000000000000000000000000000000000000000000000" + -// "0000000000000000100000000000000000000000010020fcb72e27650651b05ed2ceca493bc807ba40" + -// "0000000000000000000000050081b12838240b1ba02b3177153bca678a860780000000000000000000" + -// "0000000000000000000000000000000000000000001800000000000000000000000000000000000000" + -// "00000000000000000000000000100000000000000000000000010020fcb72e27650651b05ed2ceca49" + -// "3bc807ba40000000000000000000000000000000000000000000000000000000000000002") - -// require.Nil(t, err) -// require.Equal(t, kgv2, encoded2) -// } +func TestEncodeBlockMetadata(t *testing.T) { + // since strings are right padded in solidity https://github.com/ethereum/solidity/issues/1340 + var abcdBytes [32]byte + copy(abcdBytes[:], common.RightPadBytes([]byte("abcd"), 32)) + + // Encode block metadata using EncodeBlockMetadata function + encoded, err := EncodeBlockMetadata(&bindings.TaikoDataBlockMetadata{ + Id: uint64(1), + L1Height: uint64(1), + L1Hash: abcdBytes, + Beneficiary: common.HexToAddress("0x10020FCb72e27650651B05eD2CEcA493bC807Ba4"), + TxListHash: abcdBytes, + TxListByteStart: big.NewInt(0), + TxListByteEnd: big.NewInt(1000), + GasLimit: 1, + MixHash: abcdBytes, + Timestamp: uint64(1), + DepositsProcessed: []bindings.TaikoDataEthDeposit{}, + }) + + require.Nil(t, err) + require.NotNil(t, encoded) + + kgv, err := hexutil.Decode("0x00000000000000000000000000000000000000000000000000000000" + + "0000002000000000000000000000000000000000000000000000000000000000000000010000000000000" + + "0000000000000000000000000000000000000000000000000010000000000000000000000000000000000" + + "0000000000000000000000000000016162636400000000000000000000000000000000000000000000000" + + "0000000006162636400000000000000000000000000000000000000000000000000000000616263640000" + + "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + + "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + + "00000003e8000000000000000000000000000000000000000000000000000000000000000100000000000" + + "000000000000010020fcb72e27650651b05ed2ceca493bc807ba400000000000000000000000000000000" + + "0000000000000000000000000000016000000000000000000000000000000000000000000000000000000" + + "00000000000") + + require.Nil(t, err) + require.Equal(t, kgv, encoded) + + encoded2, err := EncodeBlockMetadata(&bindings.TaikoDataBlockMetadata{ + Id: uint64(1), + L1Height: uint64(1), + L1Hash: abcdBytes, + Beneficiary: common.HexToAddress("0x10020FCb72e27650651B05eD2CEcA493bC807Ba4"), + TxListHash: abcdBytes, + TxListByteStart: big.NewInt(0), + TxListByteEnd: big.NewInt(1000), + GasLimit: 1, + MixHash: abcdBytes, + Timestamp: uint64(1), + DepositsProcessed: []bindings.TaikoDataEthDeposit{ + {Recipient: common.HexToAddress("0x10020FCb72e27650651B05eD2CEcA493bC807Ba4"), Amount: big.NewInt(2), Id: uint64(1)}, + }, + }) + + require.Nil(t, err) + require.NotNil(t, encoded2) + + kgv2, err := hexutil.Decode("0x0000000000000000000000000000000000000000000000000000000" + + "0000000200000000000000000000000000000000000000000000000000000000000000001000000000000" + + "0000000000000000000000000000000000000000000000000001000000000000000000000000000000000" + + "0000000000000000000000000000001616263640000000000000000000000000000000000000000000000" + + "0000000000616263640000000000000000000000000000000000000000000000000000000061626364000" + + "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + + "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + + "000000003e800000000000000000000000000000000000000000000000000000000000000010000000000" + + "0000000000000010020fcb72e27650651b05ed2ceca493bc807ba40000000000000000000000000000000" + + "0000000000000000000000000000001600000000000000000000000000000000000000000000000000000" + + "00000000000100000000000000000000000010020fcb72e27650651b05ed2ceca493bc807ba4000000000" + + "0000000000000000000000000000000000000000000000000000002000000000000000000000000000000" + + "0000000000000000000000000000000001") + + require.Nil(t, err) + require.Equal(t, kgv2, encoded2) +} func TestUnpackTxListBytes(t *testing.T) { _, err := UnpackTxListBytes(randomBytes(1024)) diff --git a/bindings/encoding/struct.go b/bindings/encoding/struct.go index 301b78158..bd2f6bc85 100644 --- a/bindings/encoding/struct.go +++ b/bindings/encoding/struct.go @@ -32,15 +32,13 @@ type BlockHeader struct { } type TaikoL1Evidence struct { - MetaHash [32]byte - BlockHash [32]byte - ParentHash [32]byte - SignalRoot [32]byte - Graffiti [32]byte - Prover common.Address - ParentGasUsed uint32 - GasUsed uint32 - Proof []byte + MetaHash [32]byte + BlockHash [32]byte + ParentHash [32]byte + SignalRoot [32]byte + Graffiti [32]byte + Prover common.Address + Proofs []byte } type TaikoL1BlockMetadataInput struct { @@ -51,6 +49,18 @@ type TaikoL1BlockMetadataInput struct { CacheTxListInfo bool } +type ProverAssignment struct { + Prover common.Address + Expiry uint64 + Data []byte +} + +type ProposeBlockData struct { + Input TaikoL1BlockMetadataInput `json:"input"` + Fee *big.Int `json:"fee"` + Expiry uint64 `json:"expiry"` +} + // FromGethHeader converts a GETH *types.Header to *BlockHeader. func FromGethHeader(header *types.Header) *BlockHeader { baseFeePerGas := header.BaseFee diff --git a/bindings/encoding/struct_test.go b/bindings/encoding/struct_test.go index 22c40e53e..a817ad751 100644 --- a/bindings/encoding/struct_test.go +++ b/bindings/encoding/struct_test.go @@ -50,7 +50,6 @@ var ( TxListByteEnd: common.Big256, GasLimit: rand.Uint32(), Beneficiary: common.BytesToAddress(randomHash().Bytes()), - Treasury: common.BytesToAddress(randomHash().Bytes()), DepositsProcessed: []bindings.TaikoDataEthDeposit{}, } ) diff --git a/bindings/gen_taiko_l1.go b/bindings/gen_taiko_l1.go index a25acb36f..5bf035263 100644 --- a/bindings/gen_taiko_l1.go +++ b/bindings/gen_taiko_l1.go @@ -29,6 +29,18 @@ var ( _ = abi.ConvertType ) +// TaikoDataBlock is an auto generated low-level Go binding around an user-defined struct. +type TaikoDataBlock struct { + MetaHash [32]byte + Prover common.Address + ProposedAt uint64 + NextForkChoiceId uint16 + VerifiedForkChoiceId uint16 + BlockId uint64 + ProofBond *big.Int + ProofWindow uint16 +} + // TaikoDataBlockMetadata is an auto generated low-level Go binding around an user-defined struct. type TaikoDataBlockMetadata struct { Id uint64 @@ -41,37 +53,34 @@ type TaikoDataBlockMetadata struct { TxListByteEnd *big.Int GasLimit uint32 Beneficiary common.Address - Treasury common.Address DepositsProcessed []TaikoDataEthDeposit } // TaikoDataConfig is an auto generated low-level Go binding around an user-defined struct. type TaikoDataConfig struct { - ChainId *big.Int - RelaySignalRoot bool - BlockMaxProposals *big.Int - BlockRingBufferSize *big.Int - BlockMaxVerificationsPerTx *big.Int - BlockMaxGasLimit uint32 - BlockFeeBaseGas uint32 - BlockMaxTransactions uint64 - BlockMaxTxListBytes uint64 - BlockTxListExpiry *big.Int - ProofRegularCooldown *big.Int - ProofOracleCooldown *big.Int - ProofMinWindow uint16 - ProofMaxWindow uint16 - ProofWindowMultiplier uint16 - EthDepositRingBufferSize *big.Int - EthDepositMinCountPerBlock uint64 - EthDepositMaxCountPerBlock uint64 - EthDepositMinAmount *big.Int - EthDepositMaxAmount *big.Int - EthDepositGas *big.Int - EthDepositMaxFee *big.Int - RewardOpenMultipler uint8 - RewardOpenMaxCount uint32 - RewardMaxDelayPenalty uint32 + ChainId *big.Int + RelaySignalRoot bool + BlockMaxProposals uint64 + BlockRingBufferSize uint64 + BlockMaxVerificationsPerTx uint64 + BlockMaxGasLimit uint32 + BlockFeeBaseGas uint32 + BlockMaxTxListBytes *big.Int + BlockTxListExpiry *big.Int + ProposerRewardPerSecond *big.Int + ProposerRewardMax *big.Int + ProofRegularCooldown *big.Int + ProofOracleCooldown *big.Int + ProofWindow uint16 + ProofBond *big.Int + SkipProverAssignmentVerificaiton bool + EthDepositRingBufferSize *big.Int + EthDepositMinCountPerBlock uint64 + EthDepositMaxCountPerBlock uint64 + EthDepositMinAmount *big.Int + EthDepositMaxAmount *big.Int + EthDepositGas *big.Int + EthDepositMaxFee *big.Int } // TaikoDataEthDeposit is an auto generated low-level Go binding around an user-defined struct. @@ -88,12 +97,26 @@ type TaikoDataForkChoice struct { SignalRoot [32]byte Prover common.Address ProvenAt uint64 - GasUsed uint32 +} + +// TaikoDataSlotA is an auto generated low-level Go binding around an user-defined struct. +type TaikoDataSlotA struct { + GenesisHeight uint64 + GenesisTimestamp uint64 + NumEthDeposits uint64 + NextEthDepositToProcess uint64 +} + +// TaikoDataSlotB is an auto generated low-level Go binding around an user-defined struct. +type TaikoDataSlotB struct { + NumBlocks uint64 + NextEthDepositToProcess uint64 + LastVerifiedAt uint64 + LastVerifiedBlockId uint64 } // TaikoDataStateVariables is an auto generated low-level Go binding around an user-defined struct. type TaikoDataStateVariables struct { - FeePerGas uint32 GenesisHeight uint64 GenesisTimestamp uint64 NumBlocks uint64 @@ -104,7 +127,7 @@ type TaikoDataStateVariables struct { // TaikoL1ClientMetaData contains all meta data concerning the TaikoL1Client contract. var TaikoL1ClientMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"L1_ALREADY_PROVEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BATCH_NOT_AUCTIONABLE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"L1_EVIDENCE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"L1_EVIDENCE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_FORK_CHOICE_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_FORK_CHOICE_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_BETTER_BID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_PROVEABLE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_PROVEABLE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_SPECIAL_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_PERMISSION_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_PERMISSION_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_SAME_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_SAME_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_OPEN_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_OPEN_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_HASH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_HASH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_NOT_EXIST\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_NOT_EXIST\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNAUTHORIZED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"rewardPerGas\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"feePerGas\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint24\",\"name\":\"txListByteStart\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"txListByteEnd\",\"type\":\"uint24\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"treasury\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"assignedProver\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"rewardPerGas\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"feePerGas\",\"type\":\"uint64\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint24\",\"name\":\"txListByteStart\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"txListByteEnd\",\"type\":\"uint24\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"treasury\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"BlockProven\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"BlockProven\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"blockFee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"proofReward\",\"type\":\"uint64\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"blockFee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"proofReward\",\"type\":\"uint64\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"canDepositEthToL2\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"depositEtherToL2\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"depositTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"}],\"name\":\"getBlock\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"_metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"_gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"_nextForkChoiceId\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"_verifiedForkChoiceId\",\"type\":\"uint24\"},{\"internalType\":\"bool\",\"name\":\"_proverReleased\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"_proposer\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_feePerGas\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"_proposedAt\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"_assignedProver\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_rewardPerGas\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"_proofWindow\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"}],\"name\":\"getBlockFee\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"relaySignalRoot\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"blockMaxProposals\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockRingBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockMaxVerificationsPerTx\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockFeeBaseGas\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxTransactions\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxTxListBytes\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"blockTxListExpiry\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofRegularCooldown\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofOracleCooldown\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"proofMinWindow\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"proofMaxWindow\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"proofWindowMultiplier\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositRingBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMinCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMaxCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMinAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMaxAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositMaxFee\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"rewardOpenMultipler\",\"type\":\"uint8\"},{\"internalType\":\"uint32\",\"name\":\"rewardOpenMaxCount\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"rewardMaxDelayPenalty\",\"type\":\"uint32\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"getForkChoice\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasUsed\",\"type\":\"uint32\"}],\"internalType\":\"structTaikoData.ForkChoice\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"feePerGas\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"getTaikoTokenBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"id\",\"type\":\"uint16\"}],\"name\":\"getVerifierName\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"_initFeePerGas\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"_initAvgProofDelay\",\"type\":\"uint16\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"}],\"name\":\"proposeBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint24\",\"name\":\"txListByteStart\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"txListByteEnd\",\"type\":\"uint24\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"treasury\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reserved70\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reserved71\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numOpenBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reserved90\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"feePerGas\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"avgProofDelay\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxBlocks\",\"type\":\"uint256\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", + ABI: "[{\"inputs\":[],\"name\":\"L1_ALREADY_PROVEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_ALREADY_PROVEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_ID_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_ID_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_BLOCK_ID_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_EVIDENCE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_EVIDENCE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_FORK_CHOICE_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_FORK_CHOICE_NOT_FOUND\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INSUFFICIENT_TOKEN\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ASSIGNMENT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ASSIGNMENT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_BLOCK_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_CONFIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ETH_DEPOSIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_EVIDENCE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_METADATA\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ORACLE_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_ORACLE_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PARAM\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROPOSER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROPOSER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_INVALID_PROVER_SIG\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_PROVEABLE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_NOT_PROVEABLE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_SAME_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_SAME_PROOF\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TOO_MANY_BLOCKS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_HASH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_HASH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_NOT_EXIST\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_NOT_EXIST\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_TX_LIST_RANGE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_FORK_CHOICE_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L1_UNEXPECTED_FORK_CHOICE_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint24\",\"name\":\"txListByteStart\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"txListByteEnd\",\"type\":\"uint24\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint24\",\"name\":\"txListByteStart\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"txListByteEnd\",\"type\":\"uint24\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"name\":\"BlockProven\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"name\":\"BlockProven\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.EthDeposit\",\"name\":\"deposit\",\"type\":\"tuple\"}],\"name\":\"EthDeposited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"canDepositEthToL2\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"depositEtherToL2\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"depositTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint16\",\"name\":\"nextForkChoiceId\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"verifiedForkChoiceId\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"proofBond\",\"type\":\"uint96\"},{\"internalType\":\"uint16\",\"name\":\"proofWindow\",\"type\":\"uint16\"}],\"internalType\":\"structTaikoData.Block\",\"name\":\"blk\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"relaySignalRoot\",\"type\":\"bool\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxProposals\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockRingBufferSize\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockMaxVerificationsPerTx\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"blockFeeBaseGas\",\"type\":\"uint32\"},{\"internalType\":\"uint24\",\"name\":\"blockMaxTxListBytes\",\"type\":\"uint24\"},{\"internalType\":\"uint256\",\"name\":\"blockTxListExpiry\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proposerRewardPerSecond\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proposerRewardMax\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofRegularCooldown\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofOracleCooldown\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"proofWindow\",\"type\":\"uint16\"},{\"internalType\":\"uint96\",\"name\":\"proofBond\",\"type\":\"uint96\"},{\"internalType\":\"bool\",\"name\":\"skipProverAssignmentVerificaiton\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositRingBufferSize\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMinCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ethDepositMaxCountPerBlock\",\"type\":\"uint64\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMinAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint96\",\"name\":\"ethDepositMaxAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositGas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ethDepositMaxFee\",\"type\":\"uint256\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getForkChoice\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"key\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.ForkChoice\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.StateVariables\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"getTaikoTokenBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"id\",\"type\":\"uint16\"}],\"name\":\"getVerifierName\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"assignment\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"}],\"name\":\"proposeBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint24\",\"name\":\"txListByteStart\",\"type\":\"uint24\"},{\"internalType\":\"uint24\",\"name\":\"txListByteEnd\",\"type\":\"uint24\"},{\"internalType\":\"uint32\",\"name\":\"gasLimit\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"amount\",\"type\":\"uint96\"},{\"internalType\":\"uint64\",\"name\":\"id\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.EthDeposit[]\",\"name\":\"depositsProcessed\",\"type\":\"tuple[]\"}],\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"input\",\"type\":\"bytes\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"numEthDeposits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotA\",\"name\":\"slotA\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"numBlocks\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextEthDepositToProcess\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastVerifiedBlockId\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.SlotB\",\"name\":\"slotB\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"maxBlocks\",\"type\":\"uint64\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTaikoToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", } // TaikoL1ClientABI is the input ABI used to generate the binding from. @@ -315,130 +338,40 @@ func (_TaikoL1Client *TaikoL1ClientCallerSession) CanDepositEthToL2(amount *big. return _TaikoL1Client.Contract.CanDepositEthToL2(&_TaikoL1Client.CallOpts, amount) } -// GetBlock is a free data retrieval call binding the contract method 0x04c07569. +// GetBlock is a free data retrieval call binding the contract method 0x5fa15e79. // -// Solidity: function getBlock(uint256 blockId) view returns(bytes32 _metaHash, uint32 _gasLimit, uint24 _nextForkChoiceId, uint24 _verifiedForkChoiceId, bool _proverReleased, address _proposer, uint32 _feePerGas, uint64 _proposedAt, address _assignedProver, uint32 _rewardPerGas, uint64 _proofWindow) -func (_TaikoL1Client *TaikoL1ClientCaller) GetBlock(opts *bind.CallOpts, blockId *big.Int) (struct { - MetaHash [32]byte - GasLimit uint32 - NextForkChoiceId *big.Int - VerifiedForkChoiceId *big.Int - ProverReleased bool - Proposer common.Address - FeePerGas uint32 - ProposedAt uint64 - AssignedProver common.Address - RewardPerGas uint32 - ProofWindow uint64 -}, error) { +// Solidity: function getBlock(uint64 blockId) view returns((bytes32,address,uint64,uint16,uint16,uint64,uint96,uint16) blk) +func (_TaikoL1Client *TaikoL1ClientCaller) GetBlock(opts *bind.CallOpts, blockId uint64) (TaikoDataBlock, error) { var out []interface{} err := _TaikoL1Client.contract.Call(opts, &out, "getBlock", blockId) - outstruct := new(struct { - MetaHash [32]byte - GasLimit uint32 - NextForkChoiceId *big.Int - VerifiedForkChoiceId *big.Int - ProverReleased bool - Proposer common.Address - FeePerGas uint32 - ProposedAt uint64 - AssignedProver common.Address - RewardPerGas uint32 - ProofWindow uint64 - }) if err != nil { - return *outstruct, err + return *new(TaikoDataBlock), err } - outstruct.MetaHash = *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - outstruct.GasLimit = *abi.ConvertType(out[1], new(uint32)).(*uint32) - outstruct.NextForkChoiceId = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) - outstruct.VerifiedForkChoiceId = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) - outstruct.ProverReleased = *abi.ConvertType(out[4], new(bool)).(*bool) - outstruct.Proposer = *abi.ConvertType(out[5], new(common.Address)).(*common.Address) - outstruct.FeePerGas = *abi.ConvertType(out[6], new(uint32)).(*uint32) - outstruct.ProposedAt = *abi.ConvertType(out[7], new(uint64)).(*uint64) - outstruct.AssignedProver = *abi.ConvertType(out[8], new(common.Address)).(*common.Address) - outstruct.RewardPerGas = *abi.ConvertType(out[9], new(uint32)).(*uint32) - outstruct.ProofWindow = *abi.ConvertType(out[10], new(uint64)).(*uint64) + out0 := *abi.ConvertType(out[0], new(TaikoDataBlock)).(*TaikoDataBlock) - return *outstruct, err + return out0, err } -// GetBlock is a free data retrieval call binding the contract method 0x04c07569. +// GetBlock is a free data retrieval call binding the contract method 0x5fa15e79. // -// Solidity: function getBlock(uint256 blockId) view returns(bytes32 _metaHash, uint32 _gasLimit, uint24 _nextForkChoiceId, uint24 _verifiedForkChoiceId, bool _proverReleased, address _proposer, uint32 _feePerGas, uint64 _proposedAt, address _assignedProver, uint32 _rewardPerGas, uint64 _proofWindow) -func (_TaikoL1Client *TaikoL1ClientSession) GetBlock(blockId *big.Int) (struct { - MetaHash [32]byte - GasLimit uint32 - NextForkChoiceId *big.Int - VerifiedForkChoiceId *big.Int - ProverReleased bool - Proposer common.Address - FeePerGas uint32 - ProposedAt uint64 - AssignedProver common.Address - RewardPerGas uint32 - ProofWindow uint64 -}, error) { +// Solidity: function getBlock(uint64 blockId) view returns((bytes32,address,uint64,uint16,uint16,uint64,uint96,uint16) blk) +func (_TaikoL1Client *TaikoL1ClientSession) GetBlock(blockId uint64) (TaikoDataBlock, error) { return _TaikoL1Client.Contract.GetBlock(&_TaikoL1Client.CallOpts, blockId) } -// GetBlock is a free data retrieval call binding the contract method 0x04c07569. +// GetBlock is a free data retrieval call binding the contract method 0x5fa15e79. // -// Solidity: function getBlock(uint256 blockId) view returns(bytes32 _metaHash, uint32 _gasLimit, uint24 _nextForkChoiceId, uint24 _verifiedForkChoiceId, bool _proverReleased, address _proposer, uint32 _feePerGas, uint64 _proposedAt, address _assignedProver, uint32 _rewardPerGas, uint64 _proofWindow) -func (_TaikoL1Client *TaikoL1ClientCallerSession) GetBlock(blockId *big.Int) (struct { - MetaHash [32]byte - GasLimit uint32 - NextForkChoiceId *big.Int - VerifiedForkChoiceId *big.Int - ProverReleased bool - Proposer common.Address - FeePerGas uint32 - ProposedAt uint64 - AssignedProver common.Address - RewardPerGas uint32 - ProofWindow uint64 -}, error) { +// Solidity: function getBlock(uint64 blockId) view returns((bytes32,address,uint64,uint16,uint16,uint64,uint96,uint16) blk) +func (_TaikoL1Client *TaikoL1ClientCallerSession) GetBlock(blockId uint64) (TaikoDataBlock, error) { return _TaikoL1Client.Contract.GetBlock(&_TaikoL1Client.CallOpts, blockId) } -// GetBlockFee is a free data retrieval call binding the contract method 0xffb2784f. -// -// Solidity: function getBlockFee(uint32 gasLimit) view returns(uint64) -func (_TaikoL1Client *TaikoL1ClientCaller) GetBlockFee(opts *bind.CallOpts, gasLimit uint32) (uint64, error) { - var out []interface{} - err := _TaikoL1Client.contract.Call(opts, &out, "getBlockFee", gasLimit) - - if err != nil { - return *new(uint64), err - } - - out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) - - return out0, err - -} - -// GetBlockFee is a free data retrieval call binding the contract method 0xffb2784f. -// -// Solidity: function getBlockFee(uint32 gasLimit) view returns(uint64) -func (_TaikoL1Client *TaikoL1ClientSession) GetBlockFee(gasLimit uint32) (uint64, error) { - return _TaikoL1Client.Contract.GetBlockFee(&_TaikoL1Client.CallOpts, gasLimit) -} - -// GetBlockFee is a free data retrieval call binding the contract method 0xffb2784f. -// -// Solidity: function getBlockFee(uint32 gasLimit) view returns(uint64) -func (_TaikoL1Client *TaikoL1ClientCallerSession) GetBlockFee(gasLimit uint32) (uint64, error) { - return _TaikoL1Client.Contract.GetBlockFee(&_TaikoL1Client.CallOpts, gasLimit) -} - // GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. // -// Solidity: function getConfig() pure returns((uint256,bool,uint256,uint256,uint256,uint32,uint32,uint64,uint64,uint256,uint256,uint256,uint16,uint16,uint16,uint256,uint64,uint64,uint96,uint96,uint256,uint256,uint8,uint32,uint32)) +// Solidity: function getConfig() pure returns((uint256,bool,uint64,uint64,uint64,uint32,uint32,uint24,uint256,uint256,uint256,uint256,uint256,uint16,uint96,bool,uint256,uint64,uint64,uint96,uint96,uint256,uint256)) func (_TaikoL1Client *TaikoL1ClientCaller) GetConfig(opts *bind.CallOpts) (TaikoDataConfig, error) { var out []interface{} err := _TaikoL1Client.contract.Call(opts, &out, "getConfig") @@ -455,22 +388,22 @@ func (_TaikoL1Client *TaikoL1ClientCaller) GetConfig(opts *bind.CallOpts) (Taiko // GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. // -// Solidity: function getConfig() pure returns((uint256,bool,uint256,uint256,uint256,uint32,uint32,uint64,uint64,uint256,uint256,uint256,uint16,uint16,uint16,uint256,uint64,uint64,uint96,uint96,uint256,uint256,uint8,uint32,uint32)) +// Solidity: function getConfig() pure returns((uint256,bool,uint64,uint64,uint64,uint32,uint32,uint24,uint256,uint256,uint256,uint256,uint256,uint16,uint96,bool,uint256,uint64,uint64,uint96,uint96,uint256,uint256)) func (_TaikoL1Client *TaikoL1ClientSession) GetConfig() (TaikoDataConfig, error) { return _TaikoL1Client.Contract.GetConfig(&_TaikoL1Client.CallOpts) } // GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. // -// Solidity: function getConfig() pure returns((uint256,bool,uint256,uint256,uint256,uint32,uint32,uint64,uint64,uint256,uint256,uint256,uint16,uint16,uint16,uint256,uint64,uint64,uint96,uint96,uint256,uint256,uint8,uint32,uint32)) +// Solidity: function getConfig() pure returns((uint256,bool,uint64,uint64,uint64,uint32,uint32,uint24,uint256,uint256,uint256,uint256,uint256,uint16,uint96,bool,uint256,uint64,uint64,uint96,uint96,uint256,uint256)) func (_TaikoL1Client *TaikoL1ClientCallerSession) GetConfig() (TaikoDataConfig, error) { return _TaikoL1Client.Contract.GetConfig(&_TaikoL1Client.CallOpts) } -// GetCrossChainBlockHash is a free data retrieval call binding the contract method 0xbacb386d. +// GetCrossChainBlockHash is a free data retrieval call binding the contract method 0xbdd6bc36. // -// Solidity: function getCrossChainBlockHash(uint256 blockId) view returns(bytes32) -func (_TaikoL1Client *TaikoL1ClientCaller) GetCrossChainBlockHash(opts *bind.CallOpts, blockId *big.Int) ([32]byte, error) { +// Solidity: function getCrossChainBlockHash(uint64 blockId) view returns(bytes32) +func (_TaikoL1Client *TaikoL1ClientCaller) GetCrossChainBlockHash(opts *bind.CallOpts, blockId uint64) ([32]byte, error) { var out []interface{} err := _TaikoL1Client.contract.Call(opts, &out, "getCrossChainBlockHash", blockId) @@ -484,24 +417,24 @@ func (_TaikoL1Client *TaikoL1ClientCaller) GetCrossChainBlockHash(opts *bind.Cal } -// GetCrossChainBlockHash is a free data retrieval call binding the contract method 0xbacb386d. +// GetCrossChainBlockHash is a free data retrieval call binding the contract method 0xbdd6bc36. // -// Solidity: function getCrossChainBlockHash(uint256 blockId) view returns(bytes32) -func (_TaikoL1Client *TaikoL1ClientSession) GetCrossChainBlockHash(blockId *big.Int) ([32]byte, error) { +// Solidity: function getCrossChainBlockHash(uint64 blockId) view returns(bytes32) +func (_TaikoL1Client *TaikoL1ClientSession) GetCrossChainBlockHash(blockId uint64) ([32]byte, error) { return _TaikoL1Client.Contract.GetCrossChainBlockHash(&_TaikoL1Client.CallOpts, blockId) } -// GetCrossChainBlockHash is a free data retrieval call binding the contract method 0xbacb386d. +// GetCrossChainBlockHash is a free data retrieval call binding the contract method 0xbdd6bc36. // -// Solidity: function getCrossChainBlockHash(uint256 blockId) view returns(bytes32) -func (_TaikoL1Client *TaikoL1ClientCallerSession) GetCrossChainBlockHash(blockId *big.Int) ([32]byte, error) { +// Solidity: function getCrossChainBlockHash(uint64 blockId) view returns(bytes32) +func (_TaikoL1Client *TaikoL1ClientCallerSession) GetCrossChainBlockHash(blockId uint64) ([32]byte, error) { return _TaikoL1Client.Contract.GetCrossChainBlockHash(&_TaikoL1Client.CallOpts, blockId) } -// GetCrossChainSignalRoot is a free data retrieval call binding the contract method 0xb8914ce4. +// GetCrossChainSignalRoot is a free data retrieval call binding the contract method 0x0599d294. // -// Solidity: function getCrossChainSignalRoot(uint256 blockId) view returns(bytes32) -func (_TaikoL1Client *TaikoL1ClientCaller) GetCrossChainSignalRoot(opts *bind.CallOpts, blockId *big.Int) ([32]byte, error) { +// Solidity: function getCrossChainSignalRoot(uint64 blockId) view returns(bytes32) +func (_TaikoL1Client *TaikoL1ClientCaller) GetCrossChainSignalRoot(opts *bind.CallOpts, blockId uint64) ([32]byte, error) { var out []interface{} err := _TaikoL1Client.contract.Call(opts, &out, "getCrossChainSignalRoot", blockId) @@ -515,26 +448,26 @@ func (_TaikoL1Client *TaikoL1ClientCaller) GetCrossChainSignalRoot(opts *bind.Ca } -// GetCrossChainSignalRoot is a free data retrieval call binding the contract method 0xb8914ce4. +// GetCrossChainSignalRoot is a free data retrieval call binding the contract method 0x0599d294. // -// Solidity: function getCrossChainSignalRoot(uint256 blockId) view returns(bytes32) -func (_TaikoL1Client *TaikoL1ClientSession) GetCrossChainSignalRoot(blockId *big.Int) ([32]byte, error) { +// Solidity: function getCrossChainSignalRoot(uint64 blockId) view returns(bytes32) +func (_TaikoL1Client *TaikoL1ClientSession) GetCrossChainSignalRoot(blockId uint64) ([32]byte, error) { return _TaikoL1Client.Contract.GetCrossChainSignalRoot(&_TaikoL1Client.CallOpts, blockId) } -// GetCrossChainSignalRoot is a free data retrieval call binding the contract method 0xb8914ce4. +// GetCrossChainSignalRoot is a free data retrieval call binding the contract method 0x0599d294. // -// Solidity: function getCrossChainSignalRoot(uint256 blockId) view returns(bytes32) -func (_TaikoL1Client *TaikoL1ClientCallerSession) GetCrossChainSignalRoot(blockId *big.Int) ([32]byte, error) { +// Solidity: function getCrossChainSignalRoot(uint64 blockId) view returns(bytes32) +func (_TaikoL1Client *TaikoL1ClientCallerSession) GetCrossChainSignalRoot(blockId uint64) ([32]byte, error) { return _TaikoL1Client.Contract.GetCrossChainSignalRoot(&_TaikoL1Client.CallOpts, blockId) } -// GetForkChoice is a free data retrieval call binding the contract method 0x7163e0ed. +// GetForkChoice is a free data retrieval call binding the contract method 0xc24c235c. // -// Solidity: function getForkChoice(uint256 blockId, bytes32 parentHash, uint32 parentGasUsed) view returns((bytes32,bytes32,bytes32,address,uint64,uint32)) -func (_TaikoL1Client *TaikoL1ClientCaller) GetForkChoice(opts *bind.CallOpts, blockId *big.Int, parentHash [32]byte, parentGasUsed uint32) (TaikoDataForkChoice, error) { +// Solidity: function getForkChoice(uint64 blockId, bytes32 parentHash) view returns((bytes32,bytes32,bytes32,address,uint64)) +func (_TaikoL1Client *TaikoL1ClientCaller) GetForkChoice(opts *bind.CallOpts, blockId uint64, parentHash [32]byte) (TaikoDataForkChoice, error) { var out []interface{} - err := _TaikoL1Client.contract.Call(opts, &out, "getForkChoice", blockId, parentHash, parentGasUsed) + err := _TaikoL1Client.contract.Call(opts, &out, "getForkChoice", blockId, parentHash) if err != nil { return *new(TaikoDataForkChoice), err @@ -546,23 +479,23 @@ func (_TaikoL1Client *TaikoL1ClientCaller) GetForkChoice(opts *bind.CallOpts, bl } -// GetForkChoice is a free data retrieval call binding the contract method 0x7163e0ed. +// GetForkChoice is a free data retrieval call binding the contract method 0xc24c235c. // -// Solidity: function getForkChoice(uint256 blockId, bytes32 parentHash, uint32 parentGasUsed) view returns((bytes32,bytes32,bytes32,address,uint64,uint32)) -func (_TaikoL1Client *TaikoL1ClientSession) GetForkChoice(blockId *big.Int, parentHash [32]byte, parentGasUsed uint32) (TaikoDataForkChoice, error) { - return _TaikoL1Client.Contract.GetForkChoice(&_TaikoL1Client.CallOpts, blockId, parentHash, parentGasUsed) +// Solidity: function getForkChoice(uint64 blockId, bytes32 parentHash) view returns((bytes32,bytes32,bytes32,address,uint64)) +func (_TaikoL1Client *TaikoL1ClientSession) GetForkChoice(blockId uint64, parentHash [32]byte) (TaikoDataForkChoice, error) { + return _TaikoL1Client.Contract.GetForkChoice(&_TaikoL1Client.CallOpts, blockId, parentHash) } -// GetForkChoice is a free data retrieval call binding the contract method 0x7163e0ed. +// GetForkChoice is a free data retrieval call binding the contract method 0xc24c235c. // -// Solidity: function getForkChoice(uint256 blockId, bytes32 parentHash, uint32 parentGasUsed) view returns((bytes32,bytes32,bytes32,address,uint64,uint32)) -func (_TaikoL1Client *TaikoL1ClientCallerSession) GetForkChoice(blockId *big.Int, parentHash [32]byte, parentGasUsed uint32) (TaikoDataForkChoice, error) { - return _TaikoL1Client.Contract.GetForkChoice(&_TaikoL1Client.CallOpts, blockId, parentHash, parentGasUsed) +// Solidity: function getForkChoice(uint64 blockId, bytes32 parentHash) view returns((bytes32,bytes32,bytes32,address,uint64)) +func (_TaikoL1Client *TaikoL1ClientCallerSession) GetForkChoice(blockId uint64, parentHash [32]byte) (TaikoDataForkChoice, error) { + return _TaikoL1Client.Contract.GetForkChoice(&_TaikoL1Client.CallOpts, blockId, parentHash) } // GetStateVariables is a free data retrieval call binding the contract method 0xdde89cf5. // -// Solidity: function getStateVariables() view returns((uint32,uint64,uint64,uint64,uint64,uint64,uint64)) +// Solidity: function getStateVariables() view returns((uint64,uint64,uint64,uint64,uint64,uint64)) func (_TaikoL1Client *TaikoL1ClientCaller) GetStateVariables(opts *bind.CallOpts) (TaikoDataStateVariables, error) { var out []interface{} err := _TaikoL1Client.contract.Call(opts, &out, "getStateVariables") @@ -579,14 +512,14 @@ func (_TaikoL1Client *TaikoL1ClientCaller) GetStateVariables(opts *bind.CallOpts // GetStateVariables is a free data retrieval call binding the contract method 0xdde89cf5. // -// Solidity: function getStateVariables() view returns((uint32,uint64,uint64,uint64,uint64,uint64,uint64)) +// Solidity: function getStateVariables() view returns((uint64,uint64,uint64,uint64,uint64,uint64)) func (_TaikoL1Client *TaikoL1ClientSession) GetStateVariables() (TaikoDataStateVariables, error) { return _TaikoL1Client.Contract.GetStateVariables(&_TaikoL1Client.CallOpts) } // GetStateVariables is a free data retrieval call binding the contract method 0xdde89cf5. // -// Solidity: function getStateVariables() view returns((uint32,uint64,uint64,uint64,uint64,uint64,uint64)) +// Solidity: function getStateVariables() view returns((uint64,uint64,uint64,uint64,uint64,uint64)) func (_TaikoL1Client *TaikoL1ClientCallerSession) GetStateVariables() (TaikoDataStateVariables, error) { return _TaikoL1Client.Contract.GetStateVariables(&_TaikoL1Client.CallOpts) } @@ -748,57 +681,24 @@ func (_TaikoL1Client *TaikoL1ClientCallerSession) Resolve0(name [32]byte, allowZ // State is a free data retrieval call binding the contract method 0xc19d93fb. // -// Solidity: function state() view returns(uint64 genesisHeight, uint64 genesisTimestamp, uint64 __reserved70, uint64 __reserved71, uint64 numOpenBlocks, uint64 numEthDeposits, uint64 numBlocks, uint64 nextEthDepositToProcess, uint64 lastVerifiedAt, uint64 lastVerifiedBlockId, uint64 __reserved90, uint32 feePerGas, uint16 avgProofDelay) +// Solidity: function state() view returns((uint64,uint64,uint64,uint64) slotA, (uint64,uint64,uint64,uint64) slotB) func (_TaikoL1Client *TaikoL1ClientCaller) State(opts *bind.CallOpts) (struct { - GenesisHeight uint64 - GenesisTimestamp uint64 - Reserved70 uint64 - Reserved71 uint64 - NumOpenBlocks uint64 - NumEthDeposits uint64 - NumBlocks uint64 - NextEthDepositToProcess uint64 - LastVerifiedAt uint64 - LastVerifiedBlockId uint64 - Reserved90 uint64 - FeePerGas uint32 - AvgProofDelay uint16 + SlotA TaikoDataSlotA + SlotB TaikoDataSlotB }, error) { var out []interface{} err := _TaikoL1Client.contract.Call(opts, &out, "state") outstruct := new(struct { - GenesisHeight uint64 - GenesisTimestamp uint64 - Reserved70 uint64 - Reserved71 uint64 - NumOpenBlocks uint64 - NumEthDeposits uint64 - NumBlocks uint64 - NextEthDepositToProcess uint64 - LastVerifiedAt uint64 - LastVerifiedBlockId uint64 - Reserved90 uint64 - FeePerGas uint32 - AvgProofDelay uint16 + SlotA TaikoDataSlotA + SlotB TaikoDataSlotB }) if err != nil { return *outstruct, err } - outstruct.GenesisHeight = *abi.ConvertType(out[0], new(uint64)).(*uint64) - outstruct.GenesisTimestamp = *abi.ConvertType(out[1], new(uint64)).(*uint64) - outstruct.Reserved70 = *abi.ConvertType(out[2], new(uint64)).(*uint64) - outstruct.Reserved71 = *abi.ConvertType(out[3], new(uint64)).(*uint64) - outstruct.NumOpenBlocks = *abi.ConvertType(out[4], new(uint64)).(*uint64) - outstruct.NumEthDeposits = *abi.ConvertType(out[5], new(uint64)).(*uint64) - outstruct.NumBlocks = *abi.ConvertType(out[6], new(uint64)).(*uint64) - outstruct.NextEthDepositToProcess = *abi.ConvertType(out[7], new(uint64)).(*uint64) - outstruct.LastVerifiedAt = *abi.ConvertType(out[8], new(uint64)).(*uint64) - outstruct.LastVerifiedBlockId = *abi.ConvertType(out[9], new(uint64)).(*uint64) - outstruct.Reserved90 = *abi.ConvertType(out[10], new(uint64)).(*uint64) - outstruct.FeePerGas = *abi.ConvertType(out[11], new(uint32)).(*uint32) - outstruct.AvgProofDelay = *abi.ConvertType(out[12], new(uint16)).(*uint16) + outstruct.SlotA = *abi.ConvertType(out[0], new(TaikoDataSlotA)).(*TaikoDataSlotA) + outstruct.SlotB = *abi.ConvertType(out[1], new(TaikoDataSlotB)).(*TaikoDataSlotB) return *outstruct, err @@ -806,42 +706,20 @@ func (_TaikoL1Client *TaikoL1ClientCaller) State(opts *bind.CallOpts) (struct { // State is a free data retrieval call binding the contract method 0xc19d93fb. // -// Solidity: function state() view returns(uint64 genesisHeight, uint64 genesisTimestamp, uint64 __reserved70, uint64 __reserved71, uint64 numOpenBlocks, uint64 numEthDeposits, uint64 numBlocks, uint64 nextEthDepositToProcess, uint64 lastVerifiedAt, uint64 lastVerifiedBlockId, uint64 __reserved90, uint32 feePerGas, uint16 avgProofDelay) +// Solidity: function state() view returns((uint64,uint64,uint64,uint64) slotA, (uint64,uint64,uint64,uint64) slotB) func (_TaikoL1Client *TaikoL1ClientSession) State() (struct { - GenesisHeight uint64 - GenesisTimestamp uint64 - Reserved70 uint64 - Reserved71 uint64 - NumOpenBlocks uint64 - NumEthDeposits uint64 - NumBlocks uint64 - NextEthDepositToProcess uint64 - LastVerifiedAt uint64 - LastVerifiedBlockId uint64 - Reserved90 uint64 - FeePerGas uint32 - AvgProofDelay uint16 + SlotA TaikoDataSlotA + SlotB TaikoDataSlotB }, error) { return _TaikoL1Client.Contract.State(&_TaikoL1Client.CallOpts) } // State is a free data retrieval call binding the contract method 0xc19d93fb. // -// Solidity: function state() view returns(uint64 genesisHeight, uint64 genesisTimestamp, uint64 __reserved70, uint64 __reserved71, uint64 numOpenBlocks, uint64 numEthDeposits, uint64 numBlocks, uint64 nextEthDepositToProcess, uint64 lastVerifiedAt, uint64 lastVerifiedBlockId, uint64 __reserved90, uint32 feePerGas, uint16 avgProofDelay) +// Solidity: function state() view returns((uint64,uint64,uint64,uint64) slotA, (uint64,uint64,uint64,uint64) slotB) func (_TaikoL1Client *TaikoL1ClientCallerSession) State() (struct { - GenesisHeight uint64 - GenesisTimestamp uint64 - Reserved70 uint64 - Reserved71 uint64 - NumOpenBlocks uint64 - NumEthDeposits uint64 - NumBlocks uint64 - NextEthDepositToProcess uint64 - LastVerifiedAt uint64 - LastVerifiedBlockId uint64 - Reserved90 uint64 - FeePerGas uint32 - AvgProofDelay uint16 + SlotA TaikoDataSlotA + SlotB TaikoDataSlotB }, error) { return _TaikoL1Client.Contract.State(&_TaikoL1Client.CallOpts) } @@ -888,66 +766,66 @@ func (_TaikoL1Client *TaikoL1ClientTransactorSession) DepositTaikoToken(amount * return _TaikoL1Client.Contract.DepositTaikoToken(&_TaikoL1Client.TransactOpts, amount) } -// Init is a paid mutator transaction binding the contract method 0xa72111dc. +// Init is a paid mutator transaction binding the contract method 0x2cc0b254. // -// Solidity: function init(address _addressManager, bytes32 _genesisBlockHash, uint32 _initFeePerGas, uint16 _initAvgProofDelay) returns() -func (_TaikoL1Client *TaikoL1ClientTransactor) Init(opts *bind.TransactOpts, _addressManager common.Address, _genesisBlockHash [32]byte, _initFeePerGas uint32, _initAvgProofDelay uint16) (*types.Transaction, error) { - return _TaikoL1Client.contract.Transact(opts, "init", _addressManager, _genesisBlockHash, _initFeePerGas, _initAvgProofDelay) +// Solidity: function init(address _addressManager, bytes32 _genesisBlockHash) returns() +func (_TaikoL1Client *TaikoL1ClientTransactor) Init(opts *bind.TransactOpts, _addressManager common.Address, _genesisBlockHash [32]byte) (*types.Transaction, error) { + return _TaikoL1Client.contract.Transact(opts, "init", _addressManager, _genesisBlockHash) } -// Init is a paid mutator transaction binding the contract method 0xa72111dc. +// Init is a paid mutator transaction binding the contract method 0x2cc0b254. // -// Solidity: function init(address _addressManager, bytes32 _genesisBlockHash, uint32 _initFeePerGas, uint16 _initAvgProofDelay) returns() -func (_TaikoL1Client *TaikoL1ClientSession) Init(_addressManager common.Address, _genesisBlockHash [32]byte, _initFeePerGas uint32, _initAvgProofDelay uint16) (*types.Transaction, error) { - return _TaikoL1Client.Contract.Init(&_TaikoL1Client.TransactOpts, _addressManager, _genesisBlockHash, _initFeePerGas, _initAvgProofDelay) +// Solidity: function init(address _addressManager, bytes32 _genesisBlockHash) returns() +func (_TaikoL1Client *TaikoL1ClientSession) Init(_addressManager common.Address, _genesisBlockHash [32]byte) (*types.Transaction, error) { + return _TaikoL1Client.Contract.Init(&_TaikoL1Client.TransactOpts, _addressManager, _genesisBlockHash) } -// Init is a paid mutator transaction binding the contract method 0xa72111dc. +// Init is a paid mutator transaction binding the contract method 0x2cc0b254. // -// Solidity: function init(address _addressManager, bytes32 _genesisBlockHash, uint32 _initFeePerGas, uint16 _initAvgProofDelay) returns() -func (_TaikoL1Client *TaikoL1ClientTransactorSession) Init(_addressManager common.Address, _genesisBlockHash [32]byte, _initFeePerGas uint32, _initAvgProofDelay uint16) (*types.Transaction, error) { - return _TaikoL1Client.Contract.Init(&_TaikoL1Client.TransactOpts, _addressManager, _genesisBlockHash, _initFeePerGas, _initAvgProofDelay) +// Solidity: function init(address _addressManager, bytes32 _genesisBlockHash) returns() +func (_TaikoL1Client *TaikoL1ClientTransactorSession) Init(_addressManager common.Address, _genesisBlockHash [32]byte) (*types.Transaction, error) { + return _TaikoL1Client.Contract.Init(&_TaikoL1Client.TransactOpts, _addressManager, _genesisBlockHash) } -// ProposeBlock is a paid mutator transaction binding the contract method 0xef16e845. +// ProposeBlock is a paid mutator transaction binding the contract method 0xb6d5a397. // -// Solidity: function proposeBlock(bytes input, bytes txList) returns((uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,address,(address,uint96,uint64)[]) meta) -func (_TaikoL1Client *TaikoL1ClientTransactor) ProposeBlock(opts *bind.TransactOpts, input []byte, txList []byte) (*types.Transaction, error) { - return _TaikoL1Client.contract.Transact(opts, "proposeBlock", input, txList) +// Solidity: function proposeBlock(bytes input, bytes assignment, bytes txList) payable returns((uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,(address,uint96,uint64)[]) meta) +func (_TaikoL1Client *TaikoL1ClientTransactor) ProposeBlock(opts *bind.TransactOpts, input []byte, assignment []byte, txList []byte) (*types.Transaction, error) { + return _TaikoL1Client.contract.Transact(opts, "proposeBlock", input, assignment, txList) } -// ProposeBlock is a paid mutator transaction binding the contract method 0xef16e845. +// ProposeBlock is a paid mutator transaction binding the contract method 0xb6d5a397. // -// Solidity: function proposeBlock(bytes input, bytes txList) returns((uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,address,(address,uint96,uint64)[]) meta) -func (_TaikoL1Client *TaikoL1ClientSession) ProposeBlock(input []byte, txList []byte) (*types.Transaction, error) { - return _TaikoL1Client.Contract.ProposeBlock(&_TaikoL1Client.TransactOpts, input, txList) +// Solidity: function proposeBlock(bytes input, bytes assignment, bytes txList) payable returns((uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,(address,uint96,uint64)[]) meta) +func (_TaikoL1Client *TaikoL1ClientSession) ProposeBlock(input []byte, assignment []byte, txList []byte) (*types.Transaction, error) { + return _TaikoL1Client.Contract.ProposeBlock(&_TaikoL1Client.TransactOpts, input, assignment, txList) } -// ProposeBlock is a paid mutator transaction binding the contract method 0xef16e845. +// ProposeBlock is a paid mutator transaction binding the contract method 0xb6d5a397. // -// Solidity: function proposeBlock(bytes input, bytes txList) returns((uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,address,(address,uint96,uint64)[]) meta) -func (_TaikoL1Client *TaikoL1ClientTransactorSession) ProposeBlock(input []byte, txList []byte) (*types.Transaction, error) { - return _TaikoL1Client.Contract.ProposeBlock(&_TaikoL1Client.TransactOpts, input, txList) +// Solidity: function proposeBlock(bytes input, bytes assignment, bytes txList) payable returns((uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,(address,uint96,uint64)[]) meta) +func (_TaikoL1Client *TaikoL1ClientTransactorSession) ProposeBlock(input []byte, assignment []byte, txList []byte) (*types.Transaction, error) { + return _TaikoL1Client.Contract.ProposeBlock(&_TaikoL1Client.TransactOpts, input, assignment, txList) } -// ProveBlock is a paid mutator transaction binding the contract method 0xf3840f60. +// ProveBlock is a paid mutator transaction binding the contract method 0x10d008bd. // -// Solidity: function proveBlock(uint256 blockId, bytes input) returns() -func (_TaikoL1Client *TaikoL1ClientTransactor) ProveBlock(opts *bind.TransactOpts, blockId *big.Int, input []byte) (*types.Transaction, error) { +// Solidity: function proveBlock(uint64 blockId, bytes input) returns() +func (_TaikoL1Client *TaikoL1ClientTransactor) ProveBlock(opts *bind.TransactOpts, blockId uint64, input []byte) (*types.Transaction, error) { return _TaikoL1Client.contract.Transact(opts, "proveBlock", blockId, input) } -// ProveBlock is a paid mutator transaction binding the contract method 0xf3840f60. +// ProveBlock is a paid mutator transaction binding the contract method 0x10d008bd. // -// Solidity: function proveBlock(uint256 blockId, bytes input) returns() -func (_TaikoL1Client *TaikoL1ClientSession) ProveBlock(blockId *big.Int, input []byte) (*types.Transaction, error) { +// Solidity: function proveBlock(uint64 blockId, bytes input) returns() +func (_TaikoL1Client *TaikoL1ClientSession) ProveBlock(blockId uint64, input []byte) (*types.Transaction, error) { return _TaikoL1Client.Contract.ProveBlock(&_TaikoL1Client.TransactOpts, blockId, input) } -// ProveBlock is a paid mutator transaction binding the contract method 0xf3840f60. +// ProveBlock is a paid mutator transaction binding the contract method 0x10d008bd. // -// Solidity: function proveBlock(uint256 blockId, bytes input) returns() -func (_TaikoL1Client *TaikoL1ClientTransactorSession) ProveBlock(blockId *big.Int, input []byte) (*types.Transaction, error) { +// Solidity: function proveBlock(uint64 blockId, bytes input) returns() +func (_TaikoL1Client *TaikoL1ClientTransactorSession) ProveBlock(blockId uint64, input []byte) (*types.Transaction, error) { return _TaikoL1Client.Contract.ProveBlock(&_TaikoL1Client.TransactOpts, blockId, input) } @@ -1014,24 +892,24 @@ func (_TaikoL1Client *TaikoL1ClientTransactorSession) TransferOwnership(newOwner return _TaikoL1Client.Contract.TransferOwnership(&_TaikoL1Client.TransactOpts, newOwner) } -// VerifyBlocks is a paid mutator transaction binding the contract method 0x2fb5ae0a. +// VerifyBlocks is a paid mutator transaction binding the contract method 0x8778209d. // -// Solidity: function verifyBlocks(uint256 maxBlocks) returns() -func (_TaikoL1Client *TaikoL1ClientTransactor) VerifyBlocks(opts *bind.TransactOpts, maxBlocks *big.Int) (*types.Transaction, error) { +// Solidity: function verifyBlocks(uint64 maxBlocks) returns() +func (_TaikoL1Client *TaikoL1ClientTransactor) VerifyBlocks(opts *bind.TransactOpts, maxBlocks uint64) (*types.Transaction, error) { return _TaikoL1Client.contract.Transact(opts, "verifyBlocks", maxBlocks) } -// VerifyBlocks is a paid mutator transaction binding the contract method 0x2fb5ae0a. +// VerifyBlocks is a paid mutator transaction binding the contract method 0x8778209d. // -// Solidity: function verifyBlocks(uint256 maxBlocks) returns() -func (_TaikoL1Client *TaikoL1ClientSession) VerifyBlocks(maxBlocks *big.Int) (*types.Transaction, error) { +// Solidity: function verifyBlocks(uint64 maxBlocks) returns() +func (_TaikoL1Client *TaikoL1ClientSession) VerifyBlocks(maxBlocks uint64) (*types.Transaction, error) { return _TaikoL1Client.Contract.VerifyBlocks(&_TaikoL1Client.TransactOpts, maxBlocks) } -// VerifyBlocks is a paid mutator transaction binding the contract method 0x2fb5ae0a. +// VerifyBlocks is a paid mutator transaction binding the contract method 0x8778209d. // -// Solidity: function verifyBlocks(uint256 maxBlocks) returns() -func (_TaikoL1Client *TaikoL1ClientTransactorSession) VerifyBlocks(maxBlocks *big.Int) (*types.Transaction, error) { +// Solidity: function verifyBlocks(uint64 maxBlocks) returns() +func (_TaikoL1Client *TaikoL1ClientTransactorSession) VerifyBlocks(maxBlocks uint64) (*types.Transaction, error) { return _TaikoL1Client.Contract.VerifyBlocks(&_TaikoL1Client.TransactOpts, maxBlocks) } @@ -1290,50 +1168,49 @@ func (it *TaikoL1ClientBlockProposedIterator) Close() error { // TaikoL1ClientBlockProposed represents a BlockProposed event raised by the TaikoL1Client contract. type TaikoL1ClientBlockProposed struct { - BlockId *big.Int - AssignedProver common.Address - RewardPerGas uint32 - FeePerGas uint64 - Meta TaikoDataBlockMetadata - Raw types.Log // Blockchain specific contextual infos + BlockId *big.Int + Prover common.Address + Reward *big.Int + Meta TaikoDataBlockMetadata + Raw types.Log // Blockchain specific contextual infos } -// FilterBlockProposed is a free log retrieval operation binding the contract event 0xeff8292b096b6478c20f0047b60a36bbc7d7c8ec6465769a628fbad6b151170d. +// FilterBlockProposed is a free log retrieval operation binding the contract event 0xe3713939242e9072c6fbb16f90e98d4b583d66b9fae9208ba2148aa8d6e82af6. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint32 rewardPerGas, uint64 feePerGas, (uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,address,(address,uint96,uint64)[]) meta) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProposed(opts *bind.FilterOpts, blockId []*big.Int, assignedProver []common.Address) (*TaikoL1ClientBlockProposedIterator, error) { +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed prover, uint256 reward, (uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,(address,uint96,uint64)[]) meta) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProposed(opts *bind.FilterOpts, blockId []*big.Int, prover []common.Address) (*TaikoL1ClientBlockProposedIterator, error) { var blockIdRule []interface{} for _, blockIdItem := range blockId { blockIdRule = append(blockIdRule, blockIdItem) } - var assignedProverRule []interface{} - for _, assignedProverItem := range assignedProver { - assignedProverRule = append(assignedProverRule, assignedProverItem) + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) } - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BlockProposed", blockIdRule, assignedProverRule) + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BlockProposed", blockIdRule, proverRule) if err != nil { return nil, err } return &TaikoL1ClientBlockProposedIterator{contract: _TaikoL1Client.contract, event: "BlockProposed", logs: logs, sub: sub}, nil } -// WatchBlockProposed is a free log subscription operation binding the contract event 0xeff8292b096b6478c20f0047b60a36bbc7d7c8ec6465769a628fbad6b151170d. +// WatchBlockProposed is a free log subscription operation binding the contract event 0xe3713939242e9072c6fbb16f90e98d4b583d66b9fae9208ba2148aa8d6e82af6. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint32 rewardPerGas, uint64 feePerGas, (uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,address,(address,uint96,uint64)[]) meta) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockProposed, blockId []*big.Int, assignedProver []common.Address) (event.Subscription, error) { +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed prover, uint256 reward, (uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,(address,uint96,uint64)[]) meta) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockProposed, blockId []*big.Int, prover []common.Address) (event.Subscription, error) { var blockIdRule []interface{} for _, blockIdItem := range blockId { blockIdRule = append(blockIdRule, blockIdItem) } - var assignedProverRule []interface{} - for _, assignedProverItem := range assignedProver { - assignedProverRule = append(assignedProverRule, assignedProverItem) + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) } - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BlockProposed", blockIdRule, assignedProverRule) + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BlockProposed", blockIdRule, proverRule) if err != nil { return nil, err } @@ -1365,9 +1242,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed(opts *bind.Watch }), nil } -// ParseBlockProposed is a log parse operation binding the contract event 0xeff8292b096b6478c20f0047b60a36bbc7d7c8ec6465769a628fbad6b151170d. +// ParseBlockProposed is a log parse operation binding the contract event 0xe3713939242e9072c6fbb16f90e98d4b583d66b9fae9208ba2148aa8d6e82af6. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint32 rewardPerGas, uint64 feePerGas, (uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,address,(address,uint96,uint64)[]) meta) +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed prover, uint256 reward, (uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,(address,uint96,uint64)[]) meta) func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBlockProposed(log types.Log) (*TaikoL1ClientBlockProposed, error) { event := new(TaikoL1ClientBlockProposed) if err := _TaikoL1Client.contract.UnpackLog(event, "BlockProposed", log); err != nil { @@ -1446,50 +1323,49 @@ func (it *TaikoL1ClientBlockProposed0Iterator) Close() error { // TaikoL1ClientBlockProposed0 represents a BlockProposed0 event raised by the TaikoL1Client contract. type TaikoL1ClientBlockProposed0 struct { - BlockId *big.Int - AssignedProver common.Address - RewardPerGas uint32 - FeePerGas uint64 - Meta TaikoDataBlockMetadata - Raw types.Log // Blockchain specific contextual infos + BlockId *big.Int + Prover common.Address + Reward *big.Int + Meta TaikoDataBlockMetadata + Raw types.Log // Blockchain specific contextual infos } -// FilterBlockProposed0 is a free log retrieval operation binding the contract event 0xeff8292b096b6478c20f0047b60a36bbc7d7c8ec6465769a628fbad6b151170d. +// FilterBlockProposed0 is a free log retrieval operation binding the contract event 0xe3713939242e9072c6fbb16f90e98d4b583d66b9fae9208ba2148aa8d6e82af6. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint32 rewardPerGas, uint64 feePerGas, (uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,address,(address,uint96,uint64)[]) meta) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProposed0(opts *bind.FilterOpts, blockId []*big.Int, assignedProver []common.Address) (*TaikoL1ClientBlockProposed0Iterator, error) { +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed prover, uint256 reward, (uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,(address,uint96,uint64)[]) meta) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProposed0(opts *bind.FilterOpts, blockId []*big.Int, prover []common.Address) (*TaikoL1ClientBlockProposed0Iterator, error) { var blockIdRule []interface{} for _, blockIdItem := range blockId { blockIdRule = append(blockIdRule, blockIdItem) } - var assignedProverRule []interface{} - for _, assignedProverItem := range assignedProver { - assignedProverRule = append(assignedProverRule, assignedProverItem) + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) } - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BlockProposed0", blockIdRule, assignedProverRule) + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BlockProposed0", blockIdRule, proverRule) if err != nil { return nil, err } return &TaikoL1ClientBlockProposed0Iterator{contract: _TaikoL1Client.contract, event: "BlockProposed0", logs: logs, sub: sub}, nil } -// WatchBlockProposed0 is a free log subscription operation binding the contract event 0xeff8292b096b6478c20f0047b60a36bbc7d7c8ec6465769a628fbad6b151170d. +// WatchBlockProposed0 is a free log subscription operation binding the contract event 0xe3713939242e9072c6fbb16f90e98d4b583d66b9fae9208ba2148aa8d6e82af6. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint32 rewardPerGas, uint64 feePerGas, (uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,address,(address,uint96,uint64)[]) meta) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockProposed0, blockId []*big.Int, assignedProver []common.Address) (event.Subscription, error) { +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed prover, uint256 reward, (uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,(address,uint96,uint64)[]) meta) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockProposed0, blockId []*big.Int, prover []common.Address) (event.Subscription, error) { var blockIdRule []interface{} for _, blockIdItem := range blockId { blockIdRule = append(blockIdRule, blockIdItem) } - var assignedProverRule []interface{} - for _, assignedProverItem := range assignedProver { - assignedProverRule = append(assignedProverRule, assignedProverItem) + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) } - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BlockProposed0", blockIdRule, assignedProverRule) + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BlockProposed0", blockIdRule, proverRule) if err != nil { return nil, err } @@ -1521,9 +1397,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProposed0(opts *bind.Watc }), nil } -// ParseBlockProposed0 is a log parse operation binding the contract event 0xeff8292b096b6478c20f0047b60a36bbc7d7c8ec6465769a628fbad6b151170d. +// ParseBlockProposed0 is a log parse operation binding the contract event 0xe3713939242e9072c6fbb16f90e98d4b583d66b9fae9208ba2148aa8d6e82af6. // -// Solidity: event BlockProposed(uint256 indexed blockId, address indexed assignedProver, uint32 rewardPerGas, uint64 feePerGas, (uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,address,(address,uint96,uint64)[]) meta) +// Solidity: event BlockProposed(uint256 indexed blockId, address indexed prover, uint256 reward, (uint64,uint64,uint64,bytes32,bytes32,bytes32,uint24,uint24,uint32,address,(address,uint96,uint64)[]) meta) func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBlockProposed0(log types.Log) (*TaikoL1ClientBlockProposed0, error) { event := new(TaikoL1ClientBlockProposed0) if err := _TaikoL1Client.contract.UnpackLog(event, "BlockProposed0", log); err != nil { @@ -1602,18 +1478,17 @@ func (it *TaikoL1ClientBlockProvenIterator) Close() error { // TaikoL1ClientBlockProven represents a BlockProven event raised by the TaikoL1Client contract. type TaikoL1ClientBlockProven struct { - BlockId *big.Int - ParentHash [32]byte - BlockHash [32]byte - SignalRoot [32]byte - Prover common.Address - ParentGasUsed uint32 - Raw types.Log // Blockchain specific contextual infos + BlockId *big.Int + ParentHash [32]byte + BlockHash [32]byte + SignalRoot [32]byte + Prover common.Address + Raw types.Log // Blockchain specific contextual infos } -// FilterBlockProven is a free log retrieval operation binding the contract event 0x2295930c498c7b1f60143439a63dd1d24bbb730f08ff6ed383b490ba2c1cafa4. +// FilterBlockProven is a free log retrieval operation binding the contract event 0xd93fde3ea1bb11dcd7a4e66320a05fc5aa63983b6447eff660084c4b1b1b499b. // -// Solidity: event BlockProven(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover, uint32 parentGasUsed) +// Solidity: event BlockProven(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover) func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProven(opts *bind.FilterOpts, blockId []*big.Int) (*TaikoL1ClientBlockProvenIterator, error) { var blockIdRule []interface{} @@ -1628,9 +1503,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProven(opts *bind.Filter return &TaikoL1ClientBlockProvenIterator{contract: _TaikoL1Client.contract, event: "BlockProven", logs: logs, sub: sub}, nil } -// WatchBlockProven is a free log subscription operation binding the contract event 0x2295930c498c7b1f60143439a63dd1d24bbb730f08ff6ed383b490ba2c1cafa4. +// WatchBlockProven is a free log subscription operation binding the contract event 0xd93fde3ea1bb11dcd7a4e66320a05fc5aa63983b6447eff660084c4b1b1b499b. // -// Solidity: event BlockProven(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover, uint32 parentGasUsed) +// Solidity: event BlockProven(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover) func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProven(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockProven, blockId []*big.Int) (event.Subscription, error) { var blockIdRule []interface{} @@ -1670,9 +1545,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProven(opts *bind.WatchOp }), nil } -// ParseBlockProven is a log parse operation binding the contract event 0x2295930c498c7b1f60143439a63dd1d24bbb730f08ff6ed383b490ba2c1cafa4. +// ParseBlockProven is a log parse operation binding the contract event 0xd93fde3ea1bb11dcd7a4e66320a05fc5aa63983b6447eff660084c4b1b1b499b. // -// Solidity: event BlockProven(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover, uint32 parentGasUsed) +// Solidity: event BlockProven(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover) func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBlockProven(log types.Log) (*TaikoL1ClientBlockProven, error) { event := new(TaikoL1ClientBlockProven) if err := _TaikoL1Client.contract.UnpackLog(event, "BlockProven", log); err != nil { @@ -1751,18 +1626,17 @@ func (it *TaikoL1ClientBlockProven0Iterator) Close() error { // TaikoL1ClientBlockProven0 represents a BlockProven0 event raised by the TaikoL1Client contract. type TaikoL1ClientBlockProven0 struct { - BlockId *big.Int - ParentHash [32]byte - BlockHash [32]byte - SignalRoot [32]byte - Prover common.Address - ParentGasUsed uint32 - Raw types.Log // Blockchain specific contextual infos + BlockId *big.Int + ParentHash [32]byte + BlockHash [32]byte + SignalRoot [32]byte + Prover common.Address + Raw types.Log // Blockchain specific contextual infos } -// FilterBlockProven0 is a free log retrieval operation binding the contract event 0x2295930c498c7b1f60143439a63dd1d24bbb730f08ff6ed383b490ba2c1cafa4. +// FilterBlockProven0 is a free log retrieval operation binding the contract event 0xd93fde3ea1bb11dcd7a4e66320a05fc5aa63983b6447eff660084c4b1b1b499b. // -// Solidity: event BlockProven(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover, uint32 parentGasUsed) +// Solidity: event BlockProven(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover) func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProven0(opts *bind.FilterOpts, blockId []*big.Int) (*TaikoL1ClientBlockProven0Iterator, error) { var blockIdRule []interface{} @@ -1777,9 +1651,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockProven0(opts *bind.Filte return &TaikoL1ClientBlockProven0Iterator{contract: _TaikoL1Client.contract, event: "BlockProven0", logs: logs, sub: sub}, nil } -// WatchBlockProven0 is a free log subscription operation binding the contract event 0x2295930c498c7b1f60143439a63dd1d24bbb730f08ff6ed383b490ba2c1cafa4. +// WatchBlockProven0 is a free log subscription operation binding the contract event 0xd93fde3ea1bb11dcd7a4e66320a05fc5aa63983b6447eff660084c4b1b1b499b. // -// Solidity: event BlockProven(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover, uint32 parentGasUsed) +// Solidity: event BlockProven(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover) func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProven0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockProven0, blockId []*big.Int) (event.Subscription, error) { var blockIdRule []interface{} @@ -1819,9 +1693,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockProven0(opts *bind.WatchO }), nil } -// ParseBlockProven0 is a log parse operation binding the contract event 0x2295930c498c7b1f60143439a63dd1d24bbb730f08ff6ed383b490ba2c1cafa4. +// ParseBlockProven0 is a log parse operation binding the contract event 0xd93fde3ea1bb11dcd7a4e66320a05fc5aa63983b6447eff660084c4b1b1b499b. // -// Solidity: event BlockProven(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover, uint32 parentGasUsed) +// Solidity: event BlockProven(uint256 indexed blockId, bytes32 parentHash, bytes32 blockHash, bytes32 signalRoot, address prover) func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBlockProven0(log types.Log) (*TaikoL1ClientBlockProven0, error) { event := new(TaikoL1ClientBlockProven0) if err := _TaikoL1Client.contract.UnpackLog(event, "BlockProven0", log); err != nil { @@ -1900,42 +1774,48 @@ func (it *TaikoL1ClientBlockVerifiedIterator) Close() error { // TaikoL1ClientBlockVerified represents a BlockVerified event raised by the TaikoL1Client contract. type TaikoL1ClientBlockVerified struct { - BlockId *big.Int - BlockHash [32]byte - Prover common.Address - BlockFee uint64 - ProofReward uint64 - Raw types.Log // Blockchain specific contextual infos + BlockId *big.Int + Prover common.Address + BlockHash [32]byte + Raw types.Log // Blockchain specific contextual infos } -// FilterBlockVerified is a free log retrieval operation binding the contract event 0x9b08b6aa43471ed7ec774671665f95855fcc9146b7f461b985aef9d9b66df06e. +// FilterBlockVerified is a free log retrieval operation binding the contract event 0xb2fa36cea736414fca28c5aca50d94c59d740984c4c878c3dd8ba26791309b1a. // -// Solidity: event BlockVerified(uint256 indexed blockId, bytes32 blockHash, address prover, uint64 blockFee, uint64 proofReward) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockVerified(opts *bind.FilterOpts, blockId []*big.Int) (*TaikoL1ClientBlockVerifiedIterator, error) { +// Solidity: event BlockVerified(uint256 indexed blockId, address indexed prover, bytes32 blockHash) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockVerified(opts *bind.FilterOpts, blockId []*big.Int, prover []common.Address) (*TaikoL1ClientBlockVerifiedIterator, error) { var blockIdRule []interface{} for _, blockIdItem := range blockId { blockIdRule = append(blockIdRule, blockIdItem) } + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) + } - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BlockVerified", blockIdRule) + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BlockVerified", blockIdRule, proverRule) if err != nil { return nil, err } return &TaikoL1ClientBlockVerifiedIterator{contract: _TaikoL1Client.contract, event: "BlockVerified", logs: logs, sub: sub}, nil } -// WatchBlockVerified is a free log subscription operation binding the contract event 0x9b08b6aa43471ed7ec774671665f95855fcc9146b7f461b985aef9d9b66df06e. +// WatchBlockVerified is a free log subscription operation binding the contract event 0xb2fa36cea736414fca28c5aca50d94c59d740984c4c878c3dd8ba26791309b1a. // -// Solidity: event BlockVerified(uint256 indexed blockId, bytes32 blockHash, address prover, uint64 blockFee, uint64 proofReward) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockVerified(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockVerified, blockId []*big.Int) (event.Subscription, error) { +// Solidity: event BlockVerified(uint256 indexed blockId, address indexed prover, bytes32 blockHash) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockVerified(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockVerified, blockId []*big.Int, prover []common.Address) (event.Subscription, error) { var blockIdRule []interface{} for _, blockIdItem := range blockId { blockIdRule = append(blockIdRule, blockIdItem) } + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) + } - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BlockVerified", blockIdRule) + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BlockVerified", blockIdRule, proverRule) if err != nil { return nil, err } @@ -1967,9 +1847,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockVerified(opts *bind.Watch }), nil } -// ParseBlockVerified is a log parse operation binding the contract event 0x9b08b6aa43471ed7ec774671665f95855fcc9146b7f461b985aef9d9b66df06e. +// ParseBlockVerified is a log parse operation binding the contract event 0xb2fa36cea736414fca28c5aca50d94c59d740984c4c878c3dd8ba26791309b1a. // -// Solidity: event BlockVerified(uint256 indexed blockId, bytes32 blockHash, address prover, uint64 blockFee, uint64 proofReward) +// Solidity: event BlockVerified(uint256 indexed blockId, address indexed prover, bytes32 blockHash) func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBlockVerified(log types.Log) (*TaikoL1ClientBlockVerified, error) { event := new(TaikoL1ClientBlockVerified) if err := _TaikoL1Client.contract.UnpackLog(event, "BlockVerified", log); err != nil { @@ -2048,42 +1928,48 @@ func (it *TaikoL1ClientBlockVerified0Iterator) Close() error { // TaikoL1ClientBlockVerified0 represents a BlockVerified0 event raised by the TaikoL1Client contract. type TaikoL1ClientBlockVerified0 struct { - BlockId *big.Int - BlockHash [32]byte - Prover common.Address - BlockFee uint64 - ProofReward uint64 - Raw types.Log // Blockchain specific contextual infos + BlockId *big.Int + Prover common.Address + BlockHash [32]byte + Raw types.Log // Blockchain specific contextual infos } -// FilterBlockVerified0 is a free log retrieval operation binding the contract event 0x9b08b6aa43471ed7ec774671665f95855fcc9146b7f461b985aef9d9b66df06e. +// FilterBlockVerified0 is a free log retrieval operation binding the contract event 0xb2fa36cea736414fca28c5aca50d94c59d740984c4c878c3dd8ba26791309b1a. // -// Solidity: event BlockVerified(uint256 indexed blockId, bytes32 blockHash, address prover, uint64 blockFee, uint64 proofReward) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockVerified0(opts *bind.FilterOpts, blockId []*big.Int) (*TaikoL1ClientBlockVerified0Iterator, error) { +// Solidity: event BlockVerified(uint256 indexed blockId, address indexed prover, bytes32 blockHash) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterBlockVerified0(opts *bind.FilterOpts, blockId []*big.Int, prover []common.Address) (*TaikoL1ClientBlockVerified0Iterator, error) { var blockIdRule []interface{} for _, blockIdItem := range blockId { blockIdRule = append(blockIdRule, blockIdItem) } + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) + } - logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BlockVerified0", blockIdRule) + logs, sub, err := _TaikoL1Client.contract.FilterLogs(opts, "BlockVerified0", blockIdRule, proverRule) if err != nil { return nil, err } return &TaikoL1ClientBlockVerified0Iterator{contract: _TaikoL1Client.contract, event: "BlockVerified0", logs: logs, sub: sub}, nil } -// WatchBlockVerified0 is a free log subscription operation binding the contract event 0x9b08b6aa43471ed7ec774671665f95855fcc9146b7f461b985aef9d9b66df06e. +// WatchBlockVerified0 is a free log subscription operation binding the contract event 0xb2fa36cea736414fca28c5aca50d94c59d740984c4c878c3dd8ba26791309b1a. // -// Solidity: event BlockVerified(uint256 indexed blockId, bytes32 blockHash, address prover, uint64 blockFee, uint64 proofReward) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockVerified0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockVerified0, blockId []*big.Int) (event.Subscription, error) { +// Solidity: event BlockVerified(uint256 indexed blockId, address indexed prover, bytes32 blockHash) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockVerified0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientBlockVerified0, blockId []*big.Int, prover []common.Address) (event.Subscription, error) { var blockIdRule []interface{} for _, blockIdItem := range blockId { blockIdRule = append(blockIdRule, blockIdItem) } + var proverRule []interface{} + for _, proverItem := range prover { + proverRule = append(proverRule, proverItem) + } - logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BlockVerified0", blockIdRule) + logs, sub, err := _TaikoL1Client.contract.WatchLogs(opts, "BlockVerified0", blockIdRule, proverRule) if err != nil { return nil, err } @@ -2115,9 +2001,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchBlockVerified0(opts *bind.Watc }), nil } -// ParseBlockVerified0 is a log parse operation binding the contract event 0x9b08b6aa43471ed7ec774671665f95855fcc9146b7f461b985aef9d9b66df06e. +// ParseBlockVerified0 is a log parse operation binding the contract event 0xb2fa36cea736414fca28c5aca50d94c59d740984c4c878c3dd8ba26791309b1a. // -// Solidity: event BlockVerified(uint256 indexed blockId, bytes32 blockHash, address prover, uint64 blockFee, uint64 proofReward) +// Solidity: event BlockVerified(uint256 indexed blockId, address indexed prover, bytes32 blockHash) func (_TaikoL1Client *TaikoL1ClientFilterer) ParseBlockVerified0(log types.Log) (*TaikoL1ClientBlockVerified0, error) { event := new(TaikoL1ClientBlockVerified0) if err := _TaikoL1Client.contract.UnpackLog(event, "BlockVerified0", log); err != nil { @@ -2196,16 +2082,16 @@ func (it *TaikoL1ClientCrossChainSyncedIterator) Close() error { // TaikoL1ClientCrossChainSynced represents a CrossChainSynced event raised by the TaikoL1Client contract. type TaikoL1ClientCrossChainSynced struct { - SrcHeight *big.Int + SrcHeight uint64 BlockHash [32]byte SignalRoot [32]byte Raw types.Log // Blockchain specific contextual infos } -// FilterCrossChainSynced is a free log retrieval operation binding the contract event 0x7528bbd1cef0e5d13408706892a51ee8ef82bbf33d4ec0c37216f8beba71205b. +// FilterCrossChainSynced is a free log retrieval operation binding the contract event 0x004ce985b8852a486571d0545799251fd671adcf33b7854a5f0f6a6a2431a555. // -// Solidity: event CrossChainSynced(uint256 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterCrossChainSynced(opts *bind.FilterOpts, srcHeight []*big.Int) (*TaikoL1ClientCrossChainSyncedIterator, error) { +// Solidity: event CrossChainSynced(uint64 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterCrossChainSynced(opts *bind.FilterOpts, srcHeight []uint64) (*TaikoL1ClientCrossChainSyncedIterator, error) { var srcHeightRule []interface{} for _, srcHeightItem := range srcHeight { @@ -2219,10 +2105,10 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) FilterCrossChainSynced(opts *bind.F return &TaikoL1ClientCrossChainSyncedIterator{contract: _TaikoL1Client.contract, event: "CrossChainSynced", logs: logs, sub: sub}, nil } -// WatchCrossChainSynced is a free log subscription operation binding the contract event 0x7528bbd1cef0e5d13408706892a51ee8ef82bbf33d4ec0c37216f8beba71205b. +// WatchCrossChainSynced is a free log subscription operation binding the contract event 0x004ce985b8852a486571d0545799251fd671adcf33b7854a5f0f6a6a2431a555. // -// Solidity: event CrossChainSynced(uint256 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchCrossChainSynced(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientCrossChainSynced, srcHeight []*big.Int) (event.Subscription, error) { +// Solidity: event CrossChainSynced(uint64 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchCrossChainSynced(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientCrossChainSynced, srcHeight []uint64) (event.Subscription, error) { var srcHeightRule []interface{} for _, srcHeightItem := range srcHeight { @@ -2261,9 +2147,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchCrossChainSynced(opts *bind.Wa }), nil } -// ParseCrossChainSynced is a log parse operation binding the contract event 0x7528bbd1cef0e5d13408706892a51ee8ef82bbf33d4ec0c37216f8beba71205b. +// ParseCrossChainSynced is a log parse operation binding the contract event 0x004ce985b8852a486571d0545799251fd671adcf33b7854a5f0f6a6a2431a555. // -// Solidity: event CrossChainSynced(uint256 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) +// Solidity: event CrossChainSynced(uint64 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) func (_TaikoL1Client *TaikoL1ClientFilterer) ParseCrossChainSynced(log types.Log) (*TaikoL1ClientCrossChainSynced, error) { event := new(TaikoL1ClientCrossChainSynced) if err := _TaikoL1Client.contract.UnpackLog(event, "CrossChainSynced", log); err != nil { @@ -2342,16 +2228,16 @@ func (it *TaikoL1ClientCrossChainSynced0Iterator) Close() error { // TaikoL1ClientCrossChainSynced0 represents a CrossChainSynced0 event raised by the TaikoL1Client contract. type TaikoL1ClientCrossChainSynced0 struct { - SrcHeight *big.Int + SrcHeight uint64 BlockHash [32]byte SignalRoot [32]byte Raw types.Log // Blockchain specific contextual infos } -// FilterCrossChainSynced0 is a free log retrieval operation binding the contract event 0x7528bbd1cef0e5d13408706892a51ee8ef82bbf33d4ec0c37216f8beba71205b. +// FilterCrossChainSynced0 is a free log retrieval operation binding the contract event 0x004ce985b8852a486571d0545799251fd671adcf33b7854a5f0f6a6a2431a555. // -// Solidity: event CrossChainSynced(uint256 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) -func (_TaikoL1Client *TaikoL1ClientFilterer) FilterCrossChainSynced0(opts *bind.FilterOpts, srcHeight []*big.Int) (*TaikoL1ClientCrossChainSynced0Iterator, error) { +// Solidity: event CrossChainSynced(uint64 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) +func (_TaikoL1Client *TaikoL1ClientFilterer) FilterCrossChainSynced0(opts *bind.FilterOpts, srcHeight []uint64) (*TaikoL1ClientCrossChainSynced0Iterator, error) { var srcHeightRule []interface{} for _, srcHeightItem := range srcHeight { @@ -2365,10 +2251,10 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) FilterCrossChainSynced0(opts *bind. return &TaikoL1ClientCrossChainSynced0Iterator{contract: _TaikoL1Client.contract, event: "CrossChainSynced0", logs: logs, sub: sub}, nil } -// WatchCrossChainSynced0 is a free log subscription operation binding the contract event 0x7528bbd1cef0e5d13408706892a51ee8ef82bbf33d4ec0c37216f8beba71205b. +// WatchCrossChainSynced0 is a free log subscription operation binding the contract event 0x004ce985b8852a486571d0545799251fd671adcf33b7854a5f0f6a6a2431a555. // -// Solidity: event CrossChainSynced(uint256 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) -func (_TaikoL1Client *TaikoL1ClientFilterer) WatchCrossChainSynced0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientCrossChainSynced0, srcHeight []*big.Int) (event.Subscription, error) { +// Solidity: event CrossChainSynced(uint64 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) +func (_TaikoL1Client *TaikoL1ClientFilterer) WatchCrossChainSynced0(opts *bind.WatchOpts, sink chan<- *TaikoL1ClientCrossChainSynced0, srcHeight []uint64) (event.Subscription, error) { var srcHeightRule []interface{} for _, srcHeightItem := range srcHeight { @@ -2407,9 +2293,9 @@ func (_TaikoL1Client *TaikoL1ClientFilterer) WatchCrossChainSynced0(opts *bind.W }), nil } -// ParseCrossChainSynced0 is a log parse operation binding the contract event 0x7528bbd1cef0e5d13408706892a51ee8ef82bbf33d4ec0c37216f8beba71205b. +// ParseCrossChainSynced0 is a log parse operation binding the contract event 0x004ce985b8852a486571d0545799251fd671adcf33b7854a5f0f6a6a2431a555. // -// Solidity: event CrossChainSynced(uint256 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) +// Solidity: event CrossChainSynced(uint64 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) func (_TaikoL1Client *TaikoL1ClientFilterer) ParseCrossChainSynced0(log types.Log) (*TaikoL1ClientCrossChainSynced0, error) { event := new(TaikoL1ClientCrossChainSynced0) if err := _TaikoL1Client.contract.UnpackLog(event, "CrossChainSynced0", log); err != nil { diff --git a/bindings/gen_taiko_l2.go b/bindings/gen_taiko_l2.go index 8ee195051..fde0e9c99 100644 --- a/bindings/gen_taiko_l2.go +++ b/bindings/gen_taiko_l2.go @@ -47,7 +47,7 @@ type TaikoL2EIP1559Params struct { // TaikoL2ClientMetaData contains all meta data concerning the TaikoL2Client contract. var TaikoL2ClientMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"L2_1559_OUT_OF_STOCK\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_1559_OUT_OF_STOCK\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"actual\",\"type\":\"uint64\"}],\"name\":\"L2_1559_UNEXPECTED_CHANGE\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"actual\",\"type\":\"uint64\"}],\"name\":\"L2_1559_UNEXPECTED_CHANGE\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"actual\",\"type\":\"uint64\"}],\"name\":\"L2_BASEFEE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_1559_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_CHAIN_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_GOLDEN_TOUCH_K\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_SENDER\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"L2_PUBLIC_INPUT_HASH_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_TOO_LATE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Overflow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"number\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"basefee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gaslimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"prevrandao\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"chainid\",\"type\":\"uint32\"}],\"name\":\"Anchored\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"GOLDEN_TOUCH_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GOLDEN_TOUCH_PRIVATEKEY\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"l1SignalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"anchor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasExcess\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"timeSinceParent\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"getBasefee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_basefee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getEIP1559Config\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"yscale\",\"type\":\"uint128\"},{\"internalType\":\"uint64\",\"name\":\"xscale\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint32\"}],\"internalType\":\"structTaikoL2.EIP1559Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"basefee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasExcessMax\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"gasTarget\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ratio2x1x\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoL2.EIP1559Params\",\"name\":\"_param1559\",\"type\":\"tuple\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSyncedL1Height\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"parentTimestamp\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"publicInputHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"digest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"k\",\"type\":\"uint8\"}],\"name\":\"signAnchor\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"r\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[],\"name\":\"L2_1559_OUT_OF_STOCK\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_1559_OUT_OF_STOCK\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"actual\",\"type\":\"uint64\"}],\"name\":\"L2_1559_UNEXPECTED_CHANGE\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"actual\",\"type\":\"uint64\"}],\"name\":\"L2_1559_UNEXPECTED_CHANGE\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"expected\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"actual\",\"type\":\"uint64\"}],\"name\":\"L2_BASEFEE_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_1559_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_CHAIN_ID\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_GOLDEN_TOUCH_K\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_INVALID_SENDER\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"expected\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"actual\",\"type\":\"bytes32\"}],\"name\":\"L2_PUBLIC_INPUT_HASH_MISMATCH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"L2_TOO_LATE\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"Overflow\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"number\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"basefee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"gaslimit\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"prevrandao\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"coinbase\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"chainid\",\"type\":\"uint32\"}],\"name\":\"Anchored\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"srcHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signalRoot\",\"type\":\"bytes32\"}],\"name\":\"CrossChainSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"GOLDEN_TOUCH_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GOLDEN_TOUCH_PRIVATEKEY\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"l1SignalRoot\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"l1Height\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"anchor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gasExcess\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"timeSinceParent\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"parentGasUsed\",\"type\":\"uint32\"}],\"name\":\"getBasefee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"_basefee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"}],\"name\":\"getCrossChainSignalRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getEIP1559Config\",\"outputs\":[{\"components\":[{\"internalType\":\"uint128\",\"name\":\"yscale\",\"type\":\"uint128\"},{\"internalType\":\"uint64\",\"name\":\"xscale\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint32\"}],\"internalType\":\"structTaikoL2.EIP1559Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"basefee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"gasIssuedPerSecond\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"gasExcessMax\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"gasTarget\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"ratio2x1x\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoL2.EIP1559Params\",\"name\":\"_param1559\",\"type\":\"tuple\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSyncedL1Height\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"parentTimestamp\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"publicInputHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"digest\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"k\",\"type\":\"uint8\"}],\"name\":\"signAnchor\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"r\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // TaikoL2ClientABI is the input ABI used to generate the binding from. @@ -351,12 +351,12 @@ func (_TaikoL2Client *TaikoL2ClientCallerSession) GetBasefee(timeSinceParent uin return _TaikoL2Client.Contract.GetBasefee(&_TaikoL2Client.CallOpts, timeSinceParent, parentGasUsed) } -// GetBlockHash is a free data retrieval call binding the contract method 0xee82ac5e. +// GetBlockHash is a free data retrieval call binding the contract method 0x23ac7136. // -// Solidity: function getBlockHash(uint256 number) view returns(bytes32) -func (_TaikoL2Client *TaikoL2ClientCaller) GetBlockHash(opts *bind.CallOpts, number *big.Int) ([32]byte, error) { +// Solidity: function getBlockHash(uint64 blockId) view returns(bytes32) +func (_TaikoL2Client *TaikoL2ClientCaller) GetBlockHash(opts *bind.CallOpts, blockId uint64) ([32]byte, error) { var out []interface{} - err := _TaikoL2Client.contract.Call(opts, &out, "getBlockHash", number) + err := _TaikoL2Client.contract.Call(opts, &out, "getBlockHash", blockId) if err != nil { return *new([32]byte), err @@ -368,26 +368,26 @@ func (_TaikoL2Client *TaikoL2ClientCaller) GetBlockHash(opts *bind.CallOpts, num } -// GetBlockHash is a free data retrieval call binding the contract method 0xee82ac5e. +// GetBlockHash is a free data retrieval call binding the contract method 0x23ac7136. // -// Solidity: function getBlockHash(uint256 number) view returns(bytes32) -func (_TaikoL2Client *TaikoL2ClientSession) GetBlockHash(number *big.Int) ([32]byte, error) { - return _TaikoL2Client.Contract.GetBlockHash(&_TaikoL2Client.CallOpts, number) +// Solidity: function getBlockHash(uint64 blockId) view returns(bytes32) +func (_TaikoL2Client *TaikoL2ClientSession) GetBlockHash(blockId uint64) ([32]byte, error) { + return _TaikoL2Client.Contract.GetBlockHash(&_TaikoL2Client.CallOpts, blockId) } -// GetBlockHash is a free data retrieval call binding the contract method 0xee82ac5e. +// GetBlockHash is a free data retrieval call binding the contract method 0x23ac7136. // -// Solidity: function getBlockHash(uint256 number) view returns(bytes32) -func (_TaikoL2Client *TaikoL2ClientCallerSession) GetBlockHash(number *big.Int) ([32]byte, error) { - return _TaikoL2Client.Contract.GetBlockHash(&_TaikoL2Client.CallOpts, number) +// Solidity: function getBlockHash(uint64 blockId) view returns(bytes32) +func (_TaikoL2Client *TaikoL2ClientCallerSession) GetBlockHash(blockId uint64) ([32]byte, error) { + return _TaikoL2Client.Contract.GetBlockHash(&_TaikoL2Client.CallOpts, blockId) } -// GetCrossChainBlockHash is a free data retrieval call binding the contract method 0xbacb386d. +// GetCrossChainBlockHash is a free data retrieval call binding the contract method 0xbdd6bc36. // -// Solidity: function getCrossChainBlockHash(uint256 number) view returns(bytes32) -func (_TaikoL2Client *TaikoL2ClientCaller) GetCrossChainBlockHash(opts *bind.CallOpts, number *big.Int) ([32]byte, error) { +// Solidity: function getCrossChainBlockHash(uint64 blockId) view returns(bytes32) +func (_TaikoL2Client *TaikoL2ClientCaller) GetCrossChainBlockHash(opts *bind.CallOpts, blockId uint64) ([32]byte, error) { var out []interface{} - err := _TaikoL2Client.contract.Call(opts, &out, "getCrossChainBlockHash", number) + err := _TaikoL2Client.contract.Call(opts, &out, "getCrossChainBlockHash", blockId) if err != nil { return *new([32]byte), err @@ -399,26 +399,26 @@ func (_TaikoL2Client *TaikoL2ClientCaller) GetCrossChainBlockHash(opts *bind.Cal } -// GetCrossChainBlockHash is a free data retrieval call binding the contract method 0xbacb386d. +// GetCrossChainBlockHash is a free data retrieval call binding the contract method 0xbdd6bc36. // -// Solidity: function getCrossChainBlockHash(uint256 number) view returns(bytes32) -func (_TaikoL2Client *TaikoL2ClientSession) GetCrossChainBlockHash(number *big.Int) ([32]byte, error) { - return _TaikoL2Client.Contract.GetCrossChainBlockHash(&_TaikoL2Client.CallOpts, number) +// Solidity: function getCrossChainBlockHash(uint64 blockId) view returns(bytes32) +func (_TaikoL2Client *TaikoL2ClientSession) GetCrossChainBlockHash(blockId uint64) ([32]byte, error) { + return _TaikoL2Client.Contract.GetCrossChainBlockHash(&_TaikoL2Client.CallOpts, blockId) } -// GetCrossChainBlockHash is a free data retrieval call binding the contract method 0xbacb386d. +// GetCrossChainBlockHash is a free data retrieval call binding the contract method 0xbdd6bc36. // -// Solidity: function getCrossChainBlockHash(uint256 number) view returns(bytes32) -func (_TaikoL2Client *TaikoL2ClientCallerSession) GetCrossChainBlockHash(number *big.Int) ([32]byte, error) { - return _TaikoL2Client.Contract.GetCrossChainBlockHash(&_TaikoL2Client.CallOpts, number) +// Solidity: function getCrossChainBlockHash(uint64 blockId) view returns(bytes32) +func (_TaikoL2Client *TaikoL2ClientCallerSession) GetCrossChainBlockHash(blockId uint64) ([32]byte, error) { + return _TaikoL2Client.Contract.GetCrossChainBlockHash(&_TaikoL2Client.CallOpts, blockId) } -// GetCrossChainSignalRoot is a free data retrieval call binding the contract method 0xb8914ce4. +// GetCrossChainSignalRoot is a free data retrieval call binding the contract method 0x0599d294. // -// Solidity: function getCrossChainSignalRoot(uint256 number) view returns(bytes32) -func (_TaikoL2Client *TaikoL2ClientCaller) GetCrossChainSignalRoot(opts *bind.CallOpts, number *big.Int) ([32]byte, error) { +// Solidity: function getCrossChainSignalRoot(uint64 blockId) view returns(bytes32) +func (_TaikoL2Client *TaikoL2ClientCaller) GetCrossChainSignalRoot(opts *bind.CallOpts, blockId uint64) ([32]byte, error) { var out []interface{} - err := _TaikoL2Client.contract.Call(opts, &out, "getCrossChainSignalRoot", number) + err := _TaikoL2Client.contract.Call(opts, &out, "getCrossChainSignalRoot", blockId) if err != nil { return *new([32]byte), err @@ -430,18 +430,18 @@ func (_TaikoL2Client *TaikoL2ClientCaller) GetCrossChainSignalRoot(opts *bind.Ca } -// GetCrossChainSignalRoot is a free data retrieval call binding the contract method 0xb8914ce4. +// GetCrossChainSignalRoot is a free data retrieval call binding the contract method 0x0599d294. // -// Solidity: function getCrossChainSignalRoot(uint256 number) view returns(bytes32) -func (_TaikoL2Client *TaikoL2ClientSession) GetCrossChainSignalRoot(number *big.Int) ([32]byte, error) { - return _TaikoL2Client.Contract.GetCrossChainSignalRoot(&_TaikoL2Client.CallOpts, number) +// Solidity: function getCrossChainSignalRoot(uint64 blockId) view returns(bytes32) +func (_TaikoL2Client *TaikoL2ClientSession) GetCrossChainSignalRoot(blockId uint64) ([32]byte, error) { + return _TaikoL2Client.Contract.GetCrossChainSignalRoot(&_TaikoL2Client.CallOpts, blockId) } -// GetCrossChainSignalRoot is a free data retrieval call binding the contract method 0xb8914ce4. +// GetCrossChainSignalRoot is a free data retrieval call binding the contract method 0x0599d294. // -// Solidity: function getCrossChainSignalRoot(uint256 number) view returns(bytes32) -func (_TaikoL2Client *TaikoL2ClientCallerSession) GetCrossChainSignalRoot(number *big.Int) ([32]byte, error) { - return _TaikoL2Client.Contract.GetCrossChainSignalRoot(&_TaikoL2Client.CallOpts, number) +// Solidity: function getCrossChainSignalRoot(uint64 blockId) view returns(bytes32) +func (_TaikoL2Client *TaikoL2ClientCallerSession) GetCrossChainSignalRoot(blockId uint64) ([32]byte, error) { + return _TaikoL2Client.Contract.GetCrossChainSignalRoot(&_TaikoL2Client.CallOpts, blockId) } // GetEIP1559Config is a free data retrieval call binding the contract method 0x4e755573. @@ -1170,16 +1170,16 @@ func (it *TaikoL2ClientCrossChainSyncedIterator) Close() error { // TaikoL2ClientCrossChainSynced represents a CrossChainSynced event raised by the TaikoL2Client contract. type TaikoL2ClientCrossChainSynced struct { - SrcHeight *big.Int + SrcHeight uint64 BlockHash [32]byte SignalRoot [32]byte Raw types.Log // Blockchain specific contextual infos } -// FilterCrossChainSynced is a free log retrieval operation binding the contract event 0x7528bbd1cef0e5d13408706892a51ee8ef82bbf33d4ec0c37216f8beba71205b. +// FilterCrossChainSynced is a free log retrieval operation binding the contract event 0x004ce985b8852a486571d0545799251fd671adcf33b7854a5f0f6a6a2431a555. // -// Solidity: event CrossChainSynced(uint256 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) -func (_TaikoL2Client *TaikoL2ClientFilterer) FilterCrossChainSynced(opts *bind.FilterOpts, srcHeight []*big.Int) (*TaikoL2ClientCrossChainSyncedIterator, error) { +// Solidity: event CrossChainSynced(uint64 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) +func (_TaikoL2Client *TaikoL2ClientFilterer) FilterCrossChainSynced(opts *bind.FilterOpts, srcHeight []uint64) (*TaikoL2ClientCrossChainSyncedIterator, error) { var srcHeightRule []interface{} for _, srcHeightItem := range srcHeight { @@ -1193,10 +1193,10 @@ func (_TaikoL2Client *TaikoL2ClientFilterer) FilterCrossChainSynced(opts *bind.F return &TaikoL2ClientCrossChainSyncedIterator{contract: _TaikoL2Client.contract, event: "CrossChainSynced", logs: logs, sub: sub}, nil } -// WatchCrossChainSynced is a free log subscription operation binding the contract event 0x7528bbd1cef0e5d13408706892a51ee8ef82bbf33d4ec0c37216f8beba71205b. +// WatchCrossChainSynced is a free log subscription operation binding the contract event 0x004ce985b8852a486571d0545799251fd671adcf33b7854a5f0f6a6a2431a555. // -// Solidity: event CrossChainSynced(uint256 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) -func (_TaikoL2Client *TaikoL2ClientFilterer) WatchCrossChainSynced(opts *bind.WatchOpts, sink chan<- *TaikoL2ClientCrossChainSynced, srcHeight []*big.Int) (event.Subscription, error) { +// Solidity: event CrossChainSynced(uint64 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) +func (_TaikoL2Client *TaikoL2ClientFilterer) WatchCrossChainSynced(opts *bind.WatchOpts, sink chan<- *TaikoL2ClientCrossChainSynced, srcHeight []uint64) (event.Subscription, error) { var srcHeightRule []interface{} for _, srcHeightItem := range srcHeight { @@ -1235,9 +1235,9 @@ func (_TaikoL2Client *TaikoL2ClientFilterer) WatchCrossChainSynced(opts *bind.Wa }), nil } -// ParseCrossChainSynced is a log parse operation binding the contract event 0x7528bbd1cef0e5d13408706892a51ee8ef82bbf33d4ec0c37216f8beba71205b. +// ParseCrossChainSynced is a log parse operation binding the contract event 0x004ce985b8852a486571d0545799251fd671adcf33b7854a5f0f6a6a2431a555. // -// Solidity: event CrossChainSynced(uint256 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) +// Solidity: event CrossChainSynced(uint64 indexed srcHeight, bytes32 blockHash, bytes32 signalRoot) func (_TaikoL2Client *TaikoL2ClientFilterer) ParseCrossChainSynced(log types.Log) (*TaikoL2ClientCrossChainSynced, error) { event := new(TaikoL2ClientCrossChainSynced) if err := _TaikoL2Client.contract.UnpackLog(event, "CrossChainSynced", log); err != nil { diff --git a/bindings/gen_taiko_prover_pool_l1.go b/bindings/gen_taiko_prover_pool_l1.go deleted file mode 100644 index 8393fba1e..000000000 --- a/bindings/gen_taiko_prover_pool_l1.go +++ /dev/null @@ -1,2071 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package bindings - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// ProverPoolProver is an auto generated low-level Go binding around an user-defined struct. -type ProverPoolProver struct { - StakedAmount uint64 - RewardPerGas uint32 - CurrentCapacity uint32 -} - -// ProverPoolStaker is an auto generated low-level Go binding around an user-defined struct. -type ProverPoolStaker struct { - ExitRequestedAt uint64 - ExitAmount uint64 - MaxCapacity uint32 - ProverId uint32 -} - -// TaikoL1ProverPoolMetaData contains all meta data concerning the TaikoL1ProverPool contract. -var TaikoL1ProverPoolMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"CHANGE_TOO_FREQUENT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"INVALID_PARAMS\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NO_MATURE_EXIT\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"PROVER_NOT_GOOD_ENOUGH\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UNAUTHORIZED\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"amount\",\"type\":\"uint64\"}],\"name\":\"Exited\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"amount\",\"type\":\"uint64\"}],\"name\":\"Slashed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"amount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"rewardPerGas\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"currentCapacity\",\"type\":\"uint32\"}],\"name\":\"Staked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"amount\",\"type\":\"uint64\"}],\"name\":\"Withdrawn\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"EXIT_PERIOD\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MAX_NUM_PROVERS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MIN_CAPACITY\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MIN_CHANGE_DELAY\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MIN_STAKE_PER_CAPACITY\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SLASH_MULTIPLIER\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SLASH_POINTS\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"feePerGas\",\"type\":\"uint32\"}],\"name\":\"assignProver\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"rewardPerGas\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"exit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCapacity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"capacity\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"feePerGas\",\"type\":\"uint32\"}],\"name\":\"getProverWeights\",\"outputs\":[{\"internalType\":\"uint256[32]\",\"name\":\"weights\",\"type\":\"uint256[32]\"},{\"internalType\":\"uint32[32]\",\"name\":\"erpg\",\"type\":\"uint32[32]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getProvers\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"stakedAmount\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"rewardPerGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"currentCapacity\",\"type\":\"uint32\"}],\"internalType\":\"structProverPool.Prover[]\",\"name\":\"_provers\",\"type\":\"tuple[]\"},{\"internalType\":\"address[]\",\"name\":\"_stakers\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"getStaker\",\"outputs\":[{\"components\":[{\"internalType\":\"uint64\",\"name\":\"exitRequestedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"exitAmount\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"maxCapacity\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"proverId\",\"type\":\"uint32\"}],\"internalType\":\"structProverPool.Staker\",\"name\":\"staker\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"stakedAmount\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"rewardPerGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"currentCapacity\",\"type\":\"uint32\"}],\"internalType\":\"structProverPool.Prover\",\"name\":\"prover\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"proverIdToAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"provers\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"stakedAmount\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"rewardPerGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"currentCapacity\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"releaseProver\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"blockId\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"proofReward\",\"type\":\"uint64\"}],\"name\":\"slashProver\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"amount\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"rewardPerGas\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"maxCapacity\",\"type\":\"uint32\"}],\"name\":\"stake\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"staker\",\"type\":\"address\"}],\"name\":\"stakers\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"exitRequestedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"exitAmount\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"maxCapacity\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"proverId\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", -} - -// TaikoL1ProverPoolABI is the input ABI used to generate the binding from. -// Deprecated: Use TaikoL1ProverPoolMetaData.ABI instead. -var TaikoL1ProverPoolABI = TaikoL1ProverPoolMetaData.ABI - -// TaikoL1ProverPool is an auto generated Go binding around an Ethereum contract. -type TaikoL1ProverPool struct { - TaikoL1ProverPoolCaller // Read-only binding to the contract - TaikoL1ProverPoolTransactor // Write-only binding to the contract - TaikoL1ProverPoolFilterer // Log filterer for contract events -} - -// TaikoL1ProverPoolCaller is an auto generated read-only Go binding around an Ethereum contract. -type TaikoL1ProverPoolCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// TaikoL1ProverPoolTransactor is an auto generated write-only Go binding around an Ethereum contract. -type TaikoL1ProverPoolTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// TaikoL1ProverPoolFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type TaikoL1ProverPoolFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// TaikoL1ProverPoolSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type TaikoL1ProverPoolSession struct { - Contract *TaikoL1ProverPool // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// TaikoL1ProverPoolCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type TaikoL1ProverPoolCallerSession struct { - Contract *TaikoL1ProverPoolCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// TaikoL1ProverPoolTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type TaikoL1ProverPoolTransactorSession struct { - Contract *TaikoL1ProverPoolTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// TaikoL1ProverPoolRaw is an auto generated low-level Go binding around an Ethereum contract. -type TaikoL1ProverPoolRaw struct { - Contract *TaikoL1ProverPool // Generic contract binding to access the raw methods on -} - -// TaikoL1ProverPoolCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type TaikoL1ProverPoolCallerRaw struct { - Contract *TaikoL1ProverPoolCaller // Generic read-only contract binding to access the raw methods on -} - -// TaikoL1ProverPoolTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type TaikoL1ProverPoolTransactorRaw struct { - Contract *TaikoL1ProverPoolTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewTaikoL1ProverPool creates a new instance of TaikoL1ProverPool, bound to a specific deployed contract. -func NewTaikoL1ProverPool(address common.Address, backend bind.ContractBackend) (*TaikoL1ProverPool, error) { - contract, err := bindTaikoL1ProverPool(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &TaikoL1ProverPool{TaikoL1ProverPoolCaller: TaikoL1ProverPoolCaller{contract: contract}, TaikoL1ProverPoolTransactor: TaikoL1ProverPoolTransactor{contract: contract}, TaikoL1ProverPoolFilterer: TaikoL1ProverPoolFilterer{contract: contract}}, nil -} - -// NewTaikoL1ProverPoolCaller creates a new read-only instance of TaikoL1ProverPool, bound to a specific deployed contract. -func NewTaikoL1ProverPoolCaller(address common.Address, caller bind.ContractCaller) (*TaikoL1ProverPoolCaller, error) { - contract, err := bindTaikoL1ProverPool(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &TaikoL1ProverPoolCaller{contract: contract}, nil -} - -// NewTaikoL1ProverPoolTransactor creates a new write-only instance of TaikoL1ProverPool, bound to a specific deployed contract. -func NewTaikoL1ProverPoolTransactor(address common.Address, transactor bind.ContractTransactor) (*TaikoL1ProverPoolTransactor, error) { - contract, err := bindTaikoL1ProverPool(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &TaikoL1ProverPoolTransactor{contract: contract}, nil -} - -// NewTaikoL1ProverPoolFilterer creates a new log filterer instance of TaikoL1ProverPool, bound to a specific deployed contract. -func NewTaikoL1ProverPoolFilterer(address common.Address, filterer bind.ContractFilterer) (*TaikoL1ProverPoolFilterer, error) { - contract, err := bindTaikoL1ProverPool(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &TaikoL1ProverPoolFilterer{contract: contract}, nil -} - -// bindTaikoL1ProverPool binds a generic wrapper to an already deployed contract. -func bindTaikoL1ProverPool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := TaikoL1ProverPoolMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_TaikoL1ProverPool *TaikoL1ProverPoolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _TaikoL1ProverPool.Contract.TaikoL1ProverPoolCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_TaikoL1ProverPool *TaikoL1ProverPoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.TaikoL1ProverPoolTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_TaikoL1ProverPool *TaikoL1ProverPoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.TaikoL1ProverPoolTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _TaikoL1ProverPool.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.contract.Transact(opts, method, params...) -} - -// EXITPERIOD is a free data retrieval call binding the contract method 0xc04b5f65. -// -// Solidity: function EXIT_PERIOD() view returns(uint64) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) EXITPERIOD(opts *bind.CallOpts) (uint64, error) { - var out []interface{} - err := _TaikoL1ProverPool.contract.Call(opts, &out, "EXIT_PERIOD") - - if err != nil { - return *new(uint64), err - } - - out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) - - return out0, err - -} - -// EXITPERIOD is a free data retrieval call binding the contract method 0xc04b5f65. -// -// Solidity: function EXIT_PERIOD() view returns(uint64) -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) EXITPERIOD() (uint64, error) { - return _TaikoL1ProverPool.Contract.EXITPERIOD(&_TaikoL1ProverPool.CallOpts) -} - -// EXITPERIOD is a free data retrieval call binding the contract method 0xc04b5f65. -// -// Solidity: function EXIT_PERIOD() view returns(uint64) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) EXITPERIOD() (uint64, error) { - return _TaikoL1ProverPool.Contract.EXITPERIOD(&_TaikoL1ProverPool.CallOpts) -} - -// MAXNUMPROVERS is a free data retrieval call binding the contract method 0x62c0fd98. -// -// Solidity: function MAX_NUM_PROVERS() view returns(uint256) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) MAXNUMPROVERS(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _TaikoL1ProverPool.contract.Call(opts, &out, "MAX_NUM_PROVERS") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// MAXNUMPROVERS is a free data retrieval call binding the contract method 0x62c0fd98. -// -// Solidity: function MAX_NUM_PROVERS() view returns(uint256) -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) MAXNUMPROVERS() (*big.Int, error) { - return _TaikoL1ProverPool.Contract.MAXNUMPROVERS(&_TaikoL1ProverPool.CallOpts) -} - -// MAXNUMPROVERS is a free data retrieval call binding the contract method 0x62c0fd98. -// -// Solidity: function MAX_NUM_PROVERS() view returns(uint256) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) MAXNUMPROVERS() (*big.Int, error) { - return _TaikoL1ProverPool.Contract.MAXNUMPROVERS(&_TaikoL1ProverPool.CallOpts) -} - -// MINCAPACITY is a free data retrieval call binding the contract method 0x4256cae6. -// -// Solidity: function MIN_CAPACITY() view returns(uint32) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) MINCAPACITY(opts *bind.CallOpts) (uint32, error) { - var out []interface{} - err := _TaikoL1ProverPool.contract.Call(opts, &out, "MIN_CAPACITY") - - if err != nil { - return *new(uint32), err - } - - out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) - - return out0, err - -} - -// MINCAPACITY is a free data retrieval call binding the contract method 0x4256cae6. -// -// Solidity: function MIN_CAPACITY() view returns(uint32) -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) MINCAPACITY() (uint32, error) { - return _TaikoL1ProverPool.Contract.MINCAPACITY(&_TaikoL1ProverPool.CallOpts) -} - -// MINCAPACITY is a free data retrieval call binding the contract method 0x4256cae6. -// -// Solidity: function MIN_CAPACITY() view returns(uint32) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) MINCAPACITY() (uint32, error) { - return _TaikoL1ProverPool.Contract.MINCAPACITY(&_TaikoL1ProverPool.CallOpts) -} - -// MINCHANGEDELAY is a free data retrieval call binding the contract method 0x71aff3a6. -// -// Solidity: function MIN_CHANGE_DELAY() view returns(uint256) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) MINCHANGEDELAY(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _TaikoL1ProverPool.contract.Call(opts, &out, "MIN_CHANGE_DELAY") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// MINCHANGEDELAY is a free data retrieval call binding the contract method 0x71aff3a6. -// -// Solidity: function MIN_CHANGE_DELAY() view returns(uint256) -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) MINCHANGEDELAY() (*big.Int, error) { - return _TaikoL1ProverPool.Contract.MINCHANGEDELAY(&_TaikoL1ProverPool.CallOpts) -} - -// MINCHANGEDELAY is a free data retrieval call binding the contract method 0x71aff3a6. -// -// Solidity: function MIN_CHANGE_DELAY() view returns(uint256) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) MINCHANGEDELAY() (*big.Int, error) { - return _TaikoL1ProverPool.Contract.MINCHANGEDELAY(&_TaikoL1ProverPool.CallOpts) -} - -// MINSTAKEPERCAPACITY is a free data retrieval call binding the contract method 0x7d62c057. -// -// Solidity: function MIN_STAKE_PER_CAPACITY() view returns(uint64) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) MINSTAKEPERCAPACITY(opts *bind.CallOpts) (uint64, error) { - var out []interface{} - err := _TaikoL1ProverPool.contract.Call(opts, &out, "MIN_STAKE_PER_CAPACITY") - - if err != nil { - return *new(uint64), err - } - - out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) - - return out0, err - -} - -// MINSTAKEPERCAPACITY is a free data retrieval call binding the contract method 0x7d62c057. -// -// Solidity: function MIN_STAKE_PER_CAPACITY() view returns(uint64) -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) MINSTAKEPERCAPACITY() (uint64, error) { - return _TaikoL1ProverPool.Contract.MINSTAKEPERCAPACITY(&_TaikoL1ProverPool.CallOpts) -} - -// MINSTAKEPERCAPACITY is a free data retrieval call binding the contract method 0x7d62c057. -// -// Solidity: function MIN_STAKE_PER_CAPACITY() view returns(uint64) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) MINSTAKEPERCAPACITY() (uint64, error) { - return _TaikoL1ProverPool.Contract.MINSTAKEPERCAPACITY(&_TaikoL1ProverPool.CallOpts) -} - -// SLASHMULTIPLIER is a free data retrieval call binding the contract method 0x55f1a57c. -// -// Solidity: function SLASH_MULTIPLIER() view returns(uint64) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) SLASHMULTIPLIER(opts *bind.CallOpts) (uint64, error) { - var out []interface{} - err := _TaikoL1ProverPool.contract.Call(opts, &out, "SLASH_MULTIPLIER") - - if err != nil { - return *new(uint64), err - } - - out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) - - return out0, err - -} - -// SLASHMULTIPLIER is a free data retrieval call binding the contract method 0x55f1a57c. -// -// Solidity: function SLASH_MULTIPLIER() view returns(uint64) -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) SLASHMULTIPLIER() (uint64, error) { - return _TaikoL1ProverPool.Contract.SLASHMULTIPLIER(&_TaikoL1ProverPool.CallOpts) -} - -// SLASHMULTIPLIER is a free data retrieval call binding the contract method 0x55f1a57c. -// -// Solidity: function SLASH_MULTIPLIER() view returns(uint64) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) SLASHMULTIPLIER() (uint64, error) { - return _TaikoL1ProverPool.Contract.SLASHMULTIPLIER(&_TaikoL1ProverPool.CallOpts) -} - -// SLASHPOINTS is a free data retrieval call binding the contract method 0xdd9fb65c. -// -// Solidity: function SLASH_POINTS() view returns(uint64) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) SLASHPOINTS(opts *bind.CallOpts) (uint64, error) { - var out []interface{} - err := _TaikoL1ProverPool.contract.Call(opts, &out, "SLASH_POINTS") - - if err != nil { - return *new(uint64), err - } - - out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) - - return out0, err - -} - -// SLASHPOINTS is a free data retrieval call binding the contract method 0xdd9fb65c. -// -// Solidity: function SLASH_POINTS() view returns(uint64) -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) SLASHPOINTS() (uint64, error) { - return _TaikoL1ProverPool.Contract.SLASHPOINTS(&_TaikoL1ProverPool.CallOpts) -} - -// SLASHPOINTS is a free data retrieval call binding the contract method 0xdd9fb65c. -// -// Solidity: function SLASH_POINTS() view returns(uint64) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) SLASHPOINTS() (uint64, error) { - return _TaikoL1ProverPool.Contract.SLASHPOINTS(&_TaikoL1ProverPool.CallOpts) -} - -// AddressManager is a free data retrieval call binding the contract method 0x3ab76e9f. -// -// Solidity: function addressManager() view returns(address) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) AddressManager(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _TaikoL1ProverPool.contract.Call(opts, &out, "addressManager") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// AddressManager is a free data retrieval call binding the contract method 0x3ab76e9f. -// -// Solidity: function addressManager() view returns(address) -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) AddressManager() (common.Address, error) { - return _TaikoL1ProverPool.Contract.AddressManager(&_TaikoL1ProverPool.CallOpts) -} - -// AddressManager is a free data retrieval call binding the contract method 0x3ab76e9f. -// -// Solidity: function addressManager() view returns(address) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) AddressManager() (common.Address, error) { - return _TaikoL1ProverPool.Contract.AddressManager(&_TaikoL1ProverPool.CallOpts) -} - -// GetCapacity is a free data retrieval call binding the contract method 0xc40000d4. -// -// Solidity: function getCapacity() view returns(uint256 capacity) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) GetCapacity(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _TaikoL1ProverPool.contract.Call(opts, &out, "getCapacity") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// GetCapacity is a free data retrieval call binding the contract method 0xc40000d4. -// -// Solidity: function getCapacity() view returns(uint256 capacity) -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) GetCapacity() (*big.Int, error) { - return _TaikoL1ProverPool.Contract.GetCapacity(&_TaikoL1ProverPool.CallOpts) -} - -// GetCapacity is a free data retrieval call binding the contract method 0xc40000d4. -// -// Solidity: function getCapacity() view returns(uint256 capacity) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) GetCapacity() (*big.Int, error) { - return _TaikoL1ProverPool.Contract.GetCapacity(&_TaikoL1ProverPool.CallOpts) -} - -// GetProverWeights is a free data retrieval call binding the contract method 0x3acba718. -// -// Solidity: function getProverWeights(uint32 feePerGas) view returns(uint256[32] weights, uint32[32] erpg) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) GetProverWeights(opts *bind.CallOpts, feePerGas uint32) (struct { - Weights [32]*big.Int - Erpg [32]uint32 -}, error) { - var out []interface{} - err := _TaikoL1ProverPool.contract.Call(opts, &out, "getProverWeights", feePerGas) - - outstruct := new(struct { - Weights [32]*big.Int - Erpg [32]uint32 - }) - if err != nil { - return *outstruct, err - } - - outstruct.Weights = *abi.ConvertType(out[0], new([32]*big.Int)).(*[32]*big.Int) - outstruct.Erpg = *abi.ConvertType(out[1], new([32]uint32)).(*[32]uint32) - - return *outstruct, err - -} - -// GetProverWeights is a free data retrieval call binding the contract method 0x3acba718. -// -// Solidity: function getProverWeights(uint32 feePerGas) view returns(uint256[32] weights, uint32[32] erpg) -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) GetProverWeights(feePerGas uint32) (struct { - Weights [32]*big.Int - Erpg [32]uint32 -}, error) { - return _TaikoL1ProverPool.Contract.GetProverWeights(&_TaikoL1ProverPool.CallOpts, feePerGas) -} - -// GetProverWeights is a free data retrieval call binding the contract method 0x3acba718. -// -// Solidity: function getProverWeights(uint32 feePerGas) view returns(uint256[32] weights, uint32[32] erpg) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) GetProverWeights(feePerGas uint32) (struct { - Weights [32]*big.Int - Erpg [32]uint32 -}, error) { - return _TaikoL1ProverPool.Contract.GetProverWeights(&_TaikoL1ProverPool.CallOpts, feePerGas) -} - -// GetProvers is a free data retrieval call binding the contract method 0xc0bfd036. -// -// Solidity: function getProvers() view returns((uint64,uint32,uint32)[] _provers, address[] _stakers) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) GetProvers(opts *bind.CallOpts) (struct { - Provers []ProverPoolProver - Stakers []common.Address -}, error) { - var out []interface{} - err := _TaikoL1ProverPool.contract.Call(opts, &out, "getProvers") - - outstruct := new(struct { - Provers []ProverPoolProver - Stakers []common.Address - }) - if err != nil { - return *outstruct, err - } - - outstruct.Provers = *abi.ConvertType(out[0], new([]ProverPoolProver)).(*[]ProverPoolProver) - outstruct.Stakers = *abi.ConvertType(out[1], new([]common.Address)).(*[]common.Address) - - return *outstruct, err - -} - -// GetProvers is a free data retrieval call binding the contract method 0xc0bfd036. -// -// Solidity: function getProvers() view returns((uint64,uint32,uint32)[] _provers, address[] _stakers) -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) GetProvers() (struct { - Provers []ProverPoolProver - Stakers []common.Address -}, error) { - return _TaikoL1ProverPool.Contract.GetProvers(&_TaikoL1ProverPool.CallOpts) -} - -// GetProvers is a free data retrieval call binding the contract method 0xc0bfd036. -// -// Solidity: function getProvers() view returns((uint64,uint32,uint32)[] _provers, address[] _stakers) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) GetProvers() (struct { - Provers []ProverPoolProver - Stakers []common.Address -}, error) { - return _TaikoL1ProverPool.Contract.GetProvers(&_TaikoL1ProverPool.CallOpts) -} - -// GetStaker is a free data retrieval call binding the contract method 0xa23c44b1. -// -// Solidity: function getStaker(address addr) view returns((uint64,uint64,uint32,uint32) staker, (uint64,uint32,uint32) prover) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) GetStaker(opts *bind.CallOpts, addr common.Address) (struct { - Staker ProverPoolStaker - Prover ProverPoolProver -}, error) { - var out []interface{} - err := _TaikoL1ProverPool.contract.Call(opts, &out, "getStaker", addr) - - outstruct := new(struct { - Staker ProverPoolStaker - Prover ProverPoolProver - }) - if err != nil { - return *outstruct, err - } - - outstruct.Staker = *abi.ConvertType(out[0], new(ProverPoolStaker)).(*ProverPoolStaker) - outstruct.Prover = *abi.ConvertType(out[1], new(ProverPoolProver)).(*ProverPoolProver) - - return *outstruct, err - -} - -// GetStaker is a free data retrieval call binding the contract method 0xa23c44b1. -// -// Solidity: function getStaker(address addr) view returns((uint64,uint64,uint32,uint32) staker, (uint64,uint32,uint32) prover) -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) GetStaker(addr common.Address) (struct { - Staker ProverPoolStaker - Prover ProverPoolProver -}, error) { - return _TaikoL1ProverPool.Contract.GetStaker(&_TaikoL1ProverPool.CallOpts, addr) -} - -// GetStaker is a free data retrieval call binding the contract method 0xa23c44b1. -// -// Solidity: function getStaker(address addr) view returns((uint64,uint64,uint32,uint32) staker, (uint64,uint32,uint32) prover) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) GetStaker(addr common.Address) (struct { - Staker ProverPoolStaker - Prover ProverPoolProver -}, error) { - return _TaikoL1ProverPool.Contract.GetStaker(&_TaikoL1ProverPool.CallOpts, addr) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _TaikoL1ProverPool.contract.Call(opts, &out, "owner") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) Owner() (common.Address, error) { - return _TaikoL1ProverPool.Contract.Owner(&_TaikoL1ProverPool.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) Owner() (common.Address, error) { - return _TaikoL1ProverPool.Contract.Owner(&_TaikoL1ProverPool.CallOpts) -} - -// ProverIdToAddress is a free data retrieval call binding the contract method 0xf064afa0. -// -// Solidity: function proverIdToAddress(uint256 id) view returns(address prover) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) ProverIdToAddress(opts *bind.CallOpts, id *big.Int) (common.Address, error) { - var out []interface{} - err := _TaikoL1ProverPool.contract.Call(opts, &out, "proverIdToAddress", id) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// ProverIdToAddress is a free data retrieval call binding the contract method 0xf064afa0. -// -// Solidity: function proverIdToAddress(uint256 id) view returns(address prover) -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) ProverIdToAddress(id *big.Int) (common.Address, error) { - return _TaikoL1ProverPool.Contract.ProverIdToAddress(&_TaikoL1ProverPool.CallOpts, id) -} - -// ProverIdToAddress is a free data retrieval call binding the contract method 0xf064afa0. -// -// Solidity: function proverIdToAddress(uint256 id) view returns(address prover) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) ProverIdToAddress(id *big.Int) (common.Address, error) { - return _TaikoL1ProverPool.Contract.ProverIdToAddress(&_TaikoL1ProverPool.CallOpts, id) -} - -// Provers is a free data retrieval call binding the contract method 0xfd1190ea. -// -// Solidity: function provers(uint256 ) view returns(uint64 stakedAmount, uint32 rewardPerGas, uint32 currentCapacity) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) Provers(opts *bind.CallOpts, arg0 *big.Int) (struct { - StakedAmount uint64 - RewardPerGas uint32 - CurrentCapacity uint32 -}, error) { - var out []interface{} - err := _TaikoL1ProverPool.contract.Call(opts, &out, "provers", arg0) - - outstruct := new(struct { - StakedAmount uint64 - RewardPerGas uint32 - CurrentCapacity uint32 - }) - if err != nil { - return *outstruct, err - } - - outstruct.StakedAmount = *abi.ConvertType(out[0], new(uint64)).(*uint64) - outstruct.RewardPerGas = *abi.ConvertType(out[1], new(uint32)).(*uint32) - outstruct.CurrentCapacity = *abi.ConvertType(out[2], new(uint32)).(*uint32) - - return *outstruct, err - -} - -// Provers is a free data retrieval call binding the contract method 0xfd1190ea. -// -// Solidity: function provers(uint256 ) view returns(uint64 stakedAmount, uint32 rewardPerGas, uint32 currentCapacity) -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) Provers(arg0 *big.Int) (struct { - StakedAmount uint64 - RewardPerGas uint32 - CurrentCapacity uint32 -}, error) { - return _TaikoL1ProverPool.Contract.Provers(&_TaikoL1ProverPool.CallOpts, arg0) -} - -// Provers is a free data retrieval call binding the contract method 0xfd1190ea. -// -// Solidity: function provers(uint256 ) view returns(uint64 stakedAmount, uint32 rewardPerGas, uint32 currentCapacity) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) Provers(arg0 *big.Int) (struct { - StakedAmount uint64 - RewardPerGas uint32 - CurrentCapacity uint32 -}, error) { - return _TaikoL1ProverPool.Contract.Provers(&_TaikoL1ProverPool.CallOpts, arg0) -} - -// Resolve is a free data retrieval call binding the contract method 0x6c6563f6. -// -// Solidity: function resolve(uint256 chainId, bytes32 name, bool allowZeroAddress) view returns(address addr) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) Resolve(opts *bind.CallOpts, chainId *big.Int, name [32]byte, allowZeroAddress bool) (common.Address, error) { - var out []interface{} - err := _TaikoL1ProverPool.contract.Call(opts, &out, "resolve", chainId, name, allowZeroAddress) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Resolve is a free data retrieval call binding the contract method 0x6c6563f6. -// -// Solidity: function resolve(uint256 chainId, bytes32 name, bool allowZeroAddress) view returns(address addr) -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) Resolve(chainId *big.Int, name [32]byte, allowZeroAddress bool) (common.Address, error) { - return _TaikoL1ProverPool.Contract.Resolve(&_TaikoL1ProverPool.CallOpts, chainId, name, allowZeroAddress) -} - -// Resolve is a free data retrieval call binding the contract method 0x6c6563f6. -// -// Solidity: function resolve(uint256 chainId, bytes32 name, bool allowZeroAddress) view returns(address addr) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) Resolve(chainId *big.Int, name [32]byte, allowZeroAddress bool) (common.Address, error) { - return _TaikoL1ProverPool.Contract.Resolve(&_TaikoL1ProverPool.CallOpts, chainId, name, allowZeroAddress) -} - -// Resolve0 is a free data retrieval call binding the contract method 0xa86f9d9e. -// -// Solidity: function resolve(bytes32 name, bool allowZeroAddress) view returns(address addr) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) Resolve0(opts *bind.CallOpts, name [32]byte, allowZeroAddress bool) (common.Address, error) { - var out []interface{} - err := _TaikoL1ProverPool.contract.Call(opts, &out, "resolve0", name, allowZeroAddress) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Resolve0 is a free data retrieval call binding the contract method 0xa86f9d9e. -// -// Solidity: function resolve(bytes32 name, bool allowZeroAddress) view returns(address addr) -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) Resolve0(name [32]byte, allowZeroAddress bool) (common.Address, error) { - return _TaikoL1ProverPool.Contract.Resolve0(&_TaikoL1ProverPool.CallOpts, name, allowZeroAddress) -} - -// Resolve0 is a free data retrieval call binding the contract method 0xa86f9d9e. -// -// Solidity: function resolve(bytes32 name, bool allowZeroAddress) view returns(address addr) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) Resolve0(name [32]byte, allowZeroAddress bool) (common.Address, error) { - return _TaikoL1ProverPool.Contract.Resolve0(&_TaikoL1ProverPool.CallOpts, name, allowZeroAddress) -} - -// Stakers is a free data retrieval call binding the contract method 0x9168ae72. -// -// Solidity: function stakers(address staker) view returns(uint64 exitRequestedAt, uint64 exitAmount, uint32 maxCapacity, uint32 proverId) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCaller) Stakers(opts *bind.CallOpts, staker common.Address) (struct { - ExitRequestedAt uint64 - ExitAmount uint64 - MaxCapacity uint32 - ProverId uint32 -}, error) { - var out []interface{} - err := _TaikoL1ProverPool.contract.Call(opts, &out, "stakers", staker) - - outstruct := new(struct { - ExitRequestedAt uint64 - ExitAmount uint64 - MaxCapacity uint32 - ProverId uint32 - }) - if err != nil { - return *outstruct, err - } - - outstruct.ExitRequestedAt = *abi.ConvertType(out[0], new(uint64)).(*uint64) - outstruct.ExitAmount = *abi.ConvertType(out[1], new(uint64)).(*uint64) - outstruct.MaxCapacity = *abi.ConvertType(out[2], new(uint32)).(*uint32) - outstruct.ProverId = *abi.ConvertType(out[3], new(uint32)).(*uint32) - - return *outstruct, err - -} - -// Stakers is a free data retrieval call binding the contract method 0x9168ae72. -// -// Solidity: function stakers(address staker) view returns(uint64 exitRequestedAt, uint64 exitAmount, uint32 maxCapacity, uint32 proverId) -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) Stakers(staker common.Address) (struct { - ExitRequestedAt uint64 - ExitAmount uint64 - MaxCapacity uint32 - ProverId uint32 -}, error) { - return _TaikoL1ProverPool.Contract.Stakers(&_TaikoL1ProverPool.CallOpts, staker) -} - -// Stakers is a free data retrieval call binding the contract method 0x9168ae72. -// -// Solidity: function stakers(address staker) view returns(uint64 exitRequestedAt, uint64 exitAmount, uint32 maxCapacity, uint32 proverId) -func (_TaikoL1ProverPool *TaikoL1ProverPoolCallerSession) Stakers(staker common.Address) (struct { - ExitRequestedAt uint64 - ExitAmount uint64 - MaxCapacity uint32 - ProverId uint32 -}, error) { - return _TaikoL1ProverPool.Contract.Stakers(&_TaikoL1ProverPool.CallOpts, staker) -} - -// AssignProver is a paid mutator transaction binding the contract method 0xbd849fe9. -// -// Solidity: function assignProver(uint64 blockId, uint32 feePerGas) returns(address prover, uint32 rewardPerGas) -func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactor) AssignProver(opts *bind.TransactOpts, blockId uint64, feePerGas uint32) (*types.Transaction, error) { - return _TaikoL1ProverPool.contract.Transact(opts, "assignProver", blockId, feePerGas) -} - -// AssignProver is a paid mutator transaction binding the contract method 0xbd849fe9. -// -// Solidity: function assignProver(uint64 blockId, uint32 feePerGas) returns(address prover, uint32 rewardPerGas) -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) AssignProver(blockId uint64, feePerGas uint32) (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.AssignProver(&_TaikoL1ProverPool.TransactOpts, blockId, feePerGas) -} - -// AssignProver is a paid mutator transaction binding the contract method 0xbd849fe9. -// -// Solidity: function assignProver(uint64 blockId, uint32 feePerGas) returns(address prover, uint32 rewardPerGas) -func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorSession) AssignProver(blockId uint64, feePerGas uint32) (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.AssignProver(&_TaikoL1ProverPool.TransactOpts, blockId, feePerGas) -} - -// Exit is a paid mutator transaction binding the contract method 0xe9fad8ee. -// -// Solidity: function exit() returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactor) Exit(opts *bind.TransactOpts) (*types.Transaction, error) { - return _TaikoL1ProverPool.contract.Transact(opts, "exit") -} - -// Exit is a paid mutator transaction binding the contract method 0xe9fad8ee. -// -// Solidity: function exit() returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) Exit() (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.Exit(&_TaikoL1ProverPool.TransactOpts) -} - -// Exit is a paid mutator transaction binding the contract method 0xe9fad8ee. -// -// Solidity: function exit() returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorSession) Exit() (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.Exit(&_TaikoL1ProverPool.TransactOpts) -} - -// Init is a paid mutator transaction binding the contract method 0x19ab453c. -// -// Solidity: function init(address _addressManager) returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactor) Init(opts *bind.TransactOpts, _addressManager common.Address) (*types.Transaction, error) { - return _TaikoL1ProverPool.contract.Transact(opts, "init", _addressManager) -} - -// Init is a paid mutator transaction binding the contract method 0x19ab453c. -// -// Solidity: function init(address _addressManager) returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) Init(_addressManager common.Address) (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.Init(&_TaikoL1ProverPool.TransactOpts, _addressManager) -} - -// Init is a paid mutator transaction binding the contract method 0x19ab453c. -// -// Solidity: function init(address _addressManager) returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorSession) Init(_addressManager common.Address) (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.Init(&_TaikoL1ProverPool.TransactOpts, _addressManager) -} - -// ReleaseProver is a paid mutator transaction binding the contract method 0xcba0414f. -// -// Solidity: function releaseProver(address addr) returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactor) ReleaseProver(opts *bind.TransactOpts, addr common.Address) (*types.Transaction, error) { - return _TaikoL1ProverPool.contract.Transact(opts, "releaseProver", addr) -} - -// ReleaseProver is a paid mutator transaction binding the contract method 0xcba0414f. -// -// Solidity: function releaseProver(address addr) returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) ReleaseProver(addr common.Address) (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.ReleaseProver(&_TaikoL1ProverPool.TransactOpts, addr) -} - -// ReleaseProver is a paid mutator transaction binding the contract method 0xcba0414f. -// -// Solidity: function releaseProver(address addr) returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorSession) ReleaseProver(addr common.Address) (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.ReleaseProver(&_TaikoL1ProverPool.TransactOpts, addr) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _TaikoL1ProverPool.contract.Transact(opts, "renounceOwnership") -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) RenounceOwnership() (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.RenounceOwnership(&_TaikoL1ProverPool.TransactOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.RenounceOwnership(&_TaikoL1ProverPool.TransactOpts) -} - -// SetAddressManager is a paid mutator transaction binding the contract method 0x0652b57a. -// -// Solidity: function setAddressManager(address newAddressManager) returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactor) SetAddressManager(opts *bind.TransactOpts, newAddressManager common.Address) (*types.Transaction, error) { - return _TaikoL1ProverPool.contract.Transact(opts, "setAddressManager", newAddressManager) -} - -// SetAddressManager is a paid mutator transaction binding the contract method 0x0652b57a. -// -// Solidity: function setAddressManager(address newAddressManager) returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) SetAddressManager(newAddressManager common.Address) (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.SetAddressManager(&_TaikoL1ProverPool.TransactOpts, newAddressManager) -} - -// SetAddressManager is a paid mutator transaction binding the contract method 0x0652b57a. -// -// Solidity: function setAddressManager(address newAddressManager) returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorSession) SetAddressManager(newAddressManager common.Address) (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.SetAddressManager(&_TaikoL1ProverPool.TransactOpts, newAddressManager) -} - -// SlashProver is a paid mutator transaction binding the contract method 0x6615e310. -// -// Solidity: function slashProver(uint64 blockId, address addr, uint64 proofReward) returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactor) SlashProver(opts *bind.TransactOpts, blockId uint64, addr common.Address, proofReward uint64) (*types.Transaction, error) { - return _TaikoL1ProverPool.contract.Transact(opts, "slashProver", blockId, addr, proofReward) -} - -// SlashProver is a paid mutator transaction binding the contract method 0x6615e310. -// -// Solidity: function slashProver(uint64 blockId, address addr, uint64 proofReward) returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) SlashProver(blockId uint64, addr common.Address, proofReward uint64) (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.SlashProver(&_TaikoL1ProverPool.TransactOpts, blockId, addr, proofReward) -} - -// SlashProver is a paid mutator transaction binding the contract method 0x6615e310. -// -// Solidity: function slashProver(uint64 blockId, address addr, uint64 proofReward) returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorSession) SlashProver(blockId uint64, addr common.Address, proofReward uint64) (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.SlashProver(&_TaikoL1ProverPool.TransactOpts, blockId, addr, proofReward) -} - -// Stake is a paid mutator transaction binding the contract method 0xb19ead66. -// -// Solidity: function stake(uint64 amount, uint32 rewardPerGas, uint32 maxCapacity) returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactor) Stake(opts *bind.TransactOpts, amount uint64, rewardPerGas uint32, maxCapacity uint32) (*types.Transaction, error) { - return _TaikoL1ProverPool.contract.Transact(opts, "stake", amount, rewardPerGas, maxCapacity) -} - -// Stake is a paid mutator transaction binding the contract method 0xb19ead66. -// -// Solidity: function stake(uint64 amount, uint32 rewardPerGas, uint32 maxCapacity) returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) Stake(amount uint64, rewardPerGas uint32, maxCapacity uint32) (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.Stake(&_TaikoL1ProverPool.TransactOpts, amount, rewardPerGas, maxCapacity) -} - -// Stake is a paid mutator transaction binding the contract method 0xb19ead66. -// -// Solidity: function stake(uint64 amount, uint32 rewardPerGas, uint32 maxCapacity) returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorSession) Stake(amount uint64, rewardPerGas uint32, maxCapacity uint32) (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.Stake(&_TaikoL1ProverPool.TransactOpts, amount, rewardPerGas, maxCapacity) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _TaikoL1ProverPool.contract.Transact(opts, "transferOwnership", newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.TransferOwnership(&_TaikoL1ProverPool.TransactOpts, newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.TransferOwnership(&_TaikoL1ProverPool.TransactOpts, newOwner) -} - -// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. -// -// Solidity: function withdraw() returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactor) Withdraw(opts *bind.TransactOpts) (*types.Transaction, error) { - return _TaikoL1ProverPool.contract.Transact(opts, "withdraw") -} - -// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. -// -// Solidity: function withdraw() returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolSession) Withdraw() (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.Withdraw(&_TaikoL1ProverPool.TransactOpts) -} - -// Withdraw is a paid mutator transaction binding the contract method 0x3ccfd60b. -// -// Solidity: function withdraw() returns() -func (_TaikoL1ProverPool *TaikoL1ProverPoolTransactorSession) Withdraw() (*types.Transaction, error) { - return _TaikoL1ProverPool.Contract.Withdraw(&_TaikoL1ProverPool.TransactOpts) -} - -// TaikoL1ProverPoolAddressManagerChangedIterator is returned from FilterAddressManagerChanged and is used to iterate over the raw logs and unpacked data for AddressManagerChanged events raised by the TaikoL1ProverPool contract. -type TaikoL1ProverPoolAddressManagerChangedIterator struct { - Event *TaikoL1ProverPoolAddressManagerChanged // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *TaikoL1ProverPoolAddressManagerChangedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(TaikoL1ProverPoolAddressManagerChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(TaikoL1ProverPoolAddressManagerChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ProverPoolAddressManagerChangedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *TaikoL1ProverPoolAddressManagerChangedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// TaikoL1ProverPoolAddressManagerChanged represents a AddressManagerChanged event raised by the TaikoL1ProverPool contract. -type TaikoL1ProverPoolAddressManagerChanged struct { - AddressManager common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterAddressManagerChanged is a free log retrieval operation binding the contract event 0x399ded90cb5ed8d89ef7e76ff4af65c373f06d3bf5d7eef55f4228e7b702a18b. -// -// Solidity: event AddressManagerChanged(address indexed addressManager) -func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) FilterAddressManagerChanged(opts *bind.FilterOpts, addressManager []common.Address) (*TaikoL1ProverPoolAddressManagerChangedIterator, error) { - - var addressManagerRule []interface{} - for _, addressManagerItem := range addressManager { - addressManagerRule = append(addressManagerRule, addressManagerItem) - } - - logs, sub, err := _TaikoL1ProverPool.contract.FilterLogs(opts, "AddressManagerChanged", addressManagerRule) - if err != nil { - return nil, err - } - return &TaikoL1ProverPoolAddressManagerChangedIterator{contract: _TaikoL1ProverPool.contract, event: "AddressManagerChanged", logs: logs, sub: sub}, nil -} - -// WatchAddressManagerChanged is a free log subscription operation binding the contract event 0x399ded90cb5ed8d89ef7e76ff4af65c373f06d3bf5d7eef55f4228e7b702a18b. -// -// Solidity: event AddressManagerChanged(address indexed addressManager) -func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) WatchAddressManagerChanged(opts *bind.WatchOpts, sink chan<- *TaikoL1ProverPoolAddressManagerChanged, addressManager []common.Address) (event.Subscription, error) { - - var addressManagerRule []interface{} - for _, addressManagerItem := range addressManager { - addressManagerRule = append(addressManagerRule, addressManagerItem) - } - - logs, sub, err := _TaikoL1ProverPool.contract.WatchLogs(opts, "AddressManagerChanged", addressManagerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(TaikoL1ProverPoolAddressManagerChanged) - if err := _TaikoL1ProverPool.contract.UnpackLog(event, "AddressManagerChanged", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseAddressManagerChanged is a log parse operation binding the contract event 0x399ded90cb5ed8d89ef7e76ff4af65c373f06d3bf5d7eef55f4228e7b702a18b. -// -// Solidity: event AddressManagerChanged(address indexed addressManager) -func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) ParseAddressManagerChanged(log types.Log) (*TaikoL1ProverPoolAddressManagerChanged, error) { - event := new(TaikoL1ProverPoolAddressManagerChanged) - if err := _TaikoL1ProverPool.contract.UnpackLog(event, "AddressManagerChanged", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// TaikoL1ProverPoolExitedIterator is returned from FilterExited and is used to iterate over the raw logs and unpacked data for Exited events raised by the TaikoL1ProverPool contract. -type TaikoL1ProverPoolExitedIterator struct { - Event *TaikoL1ProverPoolExited // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *TaikoL1ProverPoolExitedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(TaikoL1ProverPoolExited) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(TaikoL1ProverPoolExited) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ProverPoolExitedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *TaikoL1ProverPoolExitedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// TaikoL1ProverPoolExited represents a Exited event raised by the TaikoL1ProverPool contract. -type TaikoL1ProverPoolExited struct { - Addr common.Address - Amount uint64 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterExited is a free log retrieval operation binding the contract event 0x7b870040d0137f84191e3e446a10f48b5ac5d26ec96be3f795fcfc4c954410fe. -// -// Solidity: event Exited(address indexed addr, uint64 amount) -func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) FilterExited(opts *bind.FilterOpts, addr []common.Address) (*TaikoL1ProverPoolExitedIterator, error) { - - var addrRule []interface{} - for _, addrItem := range addr { - addrRule = append(addrRule, addrItem) - } - - logs, sub, err := _TaikoL1ProverPool.contract.FilterLogs(opts, "Exited", addrRule) - if err != nil { - return nil, err - } - return &TaikoL1ProverPoolExitedIterator{contract: _TaikoL1ProverPool.contract, event: "Exited", logs: logs, sub: sub}, nil -} - -// WatchExited is a free log subscription operation binding the contract event 0x7b870040d0137f84191e3e446a10f48b5ac5d26ec96be3f795fcfc4c954410fe. -// -// Solidity: event Exited(address indexed addr, uint64 amount) -func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) WatchExited(opts *bind.WatchOpts, sink chan<- *TaikoL1ProverPoolExited, addr []common.Address) (event.Subscription, error) { - - var addrRule []interface{} - for _, addrItem := range addr { - addrRule = append(addrRule, addrItem) - } - - logs, sub, err := _TaikoL1ProverPool.contract.WatchLogs(opts, "Exited", addrRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(TaikoL1ProverPoolExited) - if err := _TaikoL1ProverPool.contract.UnpackLog(event, "Exited", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseExited is a log parse operation binding the contract event 0x7b870040d0137f84191e3e446a10f48b5ac5d26ec96be3f795fcfc4c954410fe. -// -// Solidity: event Exited(address indexed addr, uint64 amount) -func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) ParseExited(log types.Log) (*TaikoL1ProverPoolExited, error) { - event := new(TaikoL1ProverPoolExited) - if err := _TaikoL1ProverPool.contract.UnpackLog(event, "Exited", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// TaikoL1ProverPoolInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the TaikoL1ProverPool contract. -type TaikoL1ProverPoolInitializedIterator struct { - Event *TaikoL1ProverPoolInitialized // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *TaikoL1ProverPoolInitializedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(TaikoL1ProverPoolInitialized) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(TaikoL1ProverPoolInitialized) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ProverPoolInitializedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *TaikoL1ProverPoolInitializedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// TaikoL1ProverPoolInitialized represents a Initialized event raised by the TaikoL1ProverPool contract. -type TaikoL1ProverPoolInitialized struct { - Version uint8 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. -// -// Solidity: event Initialized(uint8 version) -func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) FilterInitialized(opts *bind.FilterOpts) (*TaikoL1ProverPoolInitializedIterator, error) { - - logs, sub, err := _TaikoL1ProverPool.contract.FilterLogs(opts, "Initialized") - if err != nil { - return nil, err - } - return &TaikoL1ProverPoolInitializedIterator{contract: _TaikoL1ProverPool.contract, event: "Initialized", logs: logs, sub: sub}, nil -} - -// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. -// -// Solidity: event Initialized(uint8 version) -func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *TaikoL1ProverPoolInitialized) (event.Subscription, error) { - - logs, sub, err := _TaikoL1ProverPool.contract.WatchLogs(opts, "Initialized") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(TaikoL1ProverPoolInitialized) - if err := _TaikoL1ProverPool.contract.UnpackLog(event, "Initialized", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. -// -// Solidity: event Initialized(uint8 version) -func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) ParseInitialized(log types.Log) (*TaikoL1ProverPoolInitialized, error) { - event := new(TaikoL1ProverPoolInitialized) - if err := _TaikoL1ProverPool.contract.UnpackLog(event, "Initialized", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// TaikoL1ProverPoolOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the TaikoL1ProverPool contract. -type TaikoL1ProverPoolOwnershipTransferredIterator struct { - Event *TaikoL1ProverPoolOwnershipTransferred // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *TaikoL1ProverPoolOwnershipTransferredIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(TaikoL1ProverPoolOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(TaikoL1ProverPoolOwnershipTransferred) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ProverPoolOwnershipTransferredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *TaikoL1ProverPoolOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// TaikoL1ProverPoolOwnershipTransferred represents a OwnershipTransferred event raised by the TaikoL1ProverPool contract. -type TaikoL1ProverPoolOwnershipTransferred struct { - PreviousOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*TaikoL1ProverPoolOwnershipTransferredIterator, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _TaikoL1ProverPool.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return &TaikoL1ProverPoolOwnershipTransferredIterator{contract: _TaikoL1ProverPool.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *TaikoL1ProverPoolOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _TaikoL1ProverPool.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(TaikoL1ProverPoolOwnershipTransferred) - if err := _TaikoL1ProverPool.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) ParseOwnershipTransferred(log types.Log) (*TaikoL1ProverPoolOwnershipTransferred, error) { - event := new(TaikoL1ProverPoolOwnershipTransferred) - if err := _TaikoL1ProverPool.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// TaikoL1ProverPoolSlashedIterator is returned from FilterSlashed and is used to iterate over the raw logs and unpacked data for Slashed events raised by the TaikoL1ProverPool contract. -type TaikoL1ProverPoolSlashedIterator struct { - Event *TaikoL1ProverPoolSlashed // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *TaikoL1ProverPoolSlashedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(TaikoL1ProverPoolSlashed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(TaikoL1ProverPoolSlashed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ProverPoolSlashedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *TaikoL1ProverPoolSlashedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// TaikoL1ProverPoolSlashed represents a Slashed event raised by the TaikoL1ProverPool contract. -type TaikoL1ProverPoolSlashed struct { - BlockId uint64 - Addr common.Address - Amount uint64 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterSlashed is a free log retrieval operation binding the contract event 0x743ce7cf7b1ba140d9cf7e0e6fd0eaacb92a579aaebaece2e50bc2ec855948d4. -// -// Solidity: event Slashed(uint64 indexed blockId, address indexed addr, uint64 amount) -func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) FilterSlashed(opts *bind.FilterOpts, blockId []uint64, addr []common.Address) (*TaikoL1ProverPoolSlashedIterator, error) { - - var blockIdRule []interface{} - for _, blockIdItem := range blockId { - blockIdRule = append(blockIdRule, blockIdItem) - } - var addrRule []interface{} - for _, addrItem := range addr { - addrRule = append(addrRule, addrItem) - } - - logs, sub, err := _TaikoL1ProverPool.contract.FilterLogs(opts, "Slashed", blockIdRule, addrRule) - if err != nil { - return nil, err - } - return &TaikoL1ProverPoolSlashedIterator{contract: _TaikoL1ProverPool.contract, event: "Slashed", logs: logs, sub: sub}, nil -} - -// WatchSlashed is a free log subscription operation binding the contract event 0x743ce7cf7b1ba140d9cf7e0e6fd0eaacb92a579aaebaece2e50bc2ec855948d4. -// -// Solidity: event Slashed(uint64 indexed blockId, address indexed addr, uint64 amount) -func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) WatchSlashed(opts *bind.WatchOpts, sink chan<- *TaikoL1ProverPoolSlashed, blockId []uint64, addr []common.Address) (event.Subscription, error) { - - var blockIdRule []interface{} - for _, blockIdItem := range blockId { - blockIdRule = append(blockIdRule, blockIdItem) - } - var addrRule []interface{} - for _, addrItem := range addr { - addrRule = append(addrRule, addrItem) - } - - logs, sub, err := _TaikoL1ProverPool.contract.WatchLogs(opts, "Slashed", blockIdRule, addrRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(TaikoL1ProverPoolSlashed) - if err := _TaikoL1ProverPool.contract.UnpackLog(event, "Slashed", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseSlashed is a log parse operation binding the contract event 0x743ce7cf7b1ba140d9cf7e0e6fd0eaacb92a579aaebaece2e50bc2ec855948d4. -// -// Solidity: event Slashed(uint64 indexed blockId, address indexed addr, uint64 amount) -func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) ParseSlashed(log types.Log) (*TaikoL1ProverPoolSlashed, error) { - event := new(TaikoL1ProverPoolSlashed) - if err := _TaikoL1ProverPool.contract.UnpackLog(event, "Slashed", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// TaikoL1ProverPoolStakedIterator is returned from FilterStaked and is used to iterate over the raw logs and unpacked data for Staked events raised by the TaikoL1ProverPool contract. -type TaikoL1ProverPoolStakedIterator struct { - Event *TaikoL1ProverPoolStaked // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *TaikoL1ProverPoolStakedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(TaikoL1ProverPoolStaked) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(TaikoL1ProverPoolStaked) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ProverPoolStakedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *TaikoL1ProverPoolStakedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// TaikoL1ProverPoolStaked represents a Staked event raised by the TaikoL1ProverPool contract. -type TaikoL1ProverPoolStaked struct { - Addr common.Address - Amount uint64 - RewardPerGas uint32 - CurrentCapacity uint32 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterStaked is a free log retrieval operation binding the contract event 0x5ca6ec890c0c084d4fe6c6c49e6aea6fd8dbf1460730c83b5b12bf22811851e3. -// -// Solidity: event Staked(address indexed addr, uint64 amount, uint32 rewardPerGas, uint32 currentCapacity) -func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) FilterStaked(opts *bind.FilterOpts, addr []common.Address) (*TaikoL1ProverPoolStakedIterator, error) { - - var addrRule []interface{} - for _, addrItem := range addr { - addrRule = append(addrRule, addrItem) - } - - logs, sub, err := _TaikoL1ProverPool.contract.FilterLogs(opts, "Staked", addrRule) - if err != nil { - return nil, err - } - return &TaikoL1ProverPoolStakedIterator{contract: _TaikoL1ProverPool.contract, event: "Staked", logs: logs, sub: sub}, nil -} - -// WatchStaked is a free log subscription operation binding the contract event 0x5ca6ec890c0c084d4fe6c6c49e6aea6fd8dbf1460730c83b5b12bf22811851e3. -// -// Solidity: event Staked(address indexed addr, uint64 amount, uint32 rewardPerGas, uint32 currentCapacity) -func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) WatchStaked(opts *bind.WatchOpts, sink chan<- *TaikoL1ProverPoolStaked, addr []common.Address) (event.Subscription, error) { - - var addrRule []interface{} - for _, addrItem := range addr { - addrRule = append(addrRule, addrItem) - } - - logs, sub, err := _TaikoL1ProverPool.contract.WatchLogs(opts, "Staked", addrRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(TaikoL1ProverPoolStaked) - if err := _TaikoL1ProverPool.contract.UnpackLog(event, "Staked", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseStaked is a log parse operation binding the contract event 0x5ca6ec890c0c084d4fe6c6c49e6aea6fd8dbf1460730c83b5b12bf22811851e3. -// -// Solidity: event Staked(address indexed addr, uint64 amount, uint32 rewardPerGas, uint32 currentCapacity) -func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) ParseStaked(log types.Log) (*TaikoL1ProverPoolStaked, error) { - event := new(TaikoL1ProverPoolStaked) - if err := _TaikoL1ProverPool.contract.UnpackLog(event, "Staked", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// TaikoL1ProverPoolWithdrawnIterator is returned from FilterWithdrawn and is used to iterate over the raw logs and unpacked data for Withdrawn events raised by the TaikoL1ProverPool contract. -type TaikoL1ProverPoolWithdrawnIterator struct { - Event *TaikoL1ProverPoolWithdrawn // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *TaikoL1ProverPoolWithdrawnIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(TaikoL1ProverPoolWithdrawn) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(TaikoL1ProverPoolWithdrawn) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ProverPoolWithdrawnIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *TaikoL1ProverPoolWithdrawnIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// TaikoL1ProverPoolWithdrawn represents a Withdrawn event raised by the TaikoL1ProverPool contract. -type TaikoL1ProverPoolWithdrawn struct { - Addr common.Address - Amount uint64 - Raw types.Log // Blockchain specific contextual infos -} - -// FilterWithdrawn is a free log retrieval operation binding the contract event 0xbae95d59332d6e1e8f1ae78e7bebdaeef072d57b731c8790a636667e3a0a87ee. -// -// Solidity: event Withdrawn(address indexed addr, uint64 amount) -func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) FilterWithdrawn(opts *bind.FilterOpts, addr []common.Address) (*TaikoL1ProverPoolWithdrawnIterator, error) { - - var addrRule []interface{} - for _, addrItem := range addr { - addrRule = append(addrRule, addrItem) - } - - logs, sub, err := _TaikoL1ProverPool.contract.FilterLogs(opts, "Withdrawn", addrRule) - if err != nil { - return nil, err - } - return &TaikoL1ProverPoolWithdrawnIterator{contract: _TaikoL1ProverPool.contract, event: "Withdrawn", logs: logs, sub: sub}, nil -} - -// WatchWithdrawn is a free log subscription operation binding the contract event 0xbae95d59332d6e1e8f1ae78e7bebdaeef072d57b731c8790a636667e3a0a87ee. -// -// Solidity: event Withdrawn(address indexed addr, uint64 amount) -func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) WatchWithdrawn(opts *bind.WatchOpts, sink chan<- *TaikoL1ProverPoolWithdrawn, addr []common.Address) (event.Subscription, error) { - - var addrRule []interface{} - for _, addrItem := range addr { - addrRule = append(addrRule, addrItem) - } - - logs, sub, err := _TaikoL1ProverPool.contract.WatchLogs(opts, "Withdrawn", addrRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(TaikoL1ProverPoolWithdrawn) - if err := _TaikoL1ProverPool.contract.UnpackLog(event, "Withdrawn", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseWithdrawn is a log parse operation binding the contract event 0xbae95d59332d6e1e8f1ae78e7bebdaeef072d57b731c8790a636667e3a0a87ee. -// -// Solidity: event Withdrawn(address indexed addr, uint64 amount) -func (_TaikoL1ProverPool *TaikoL1ProverPoolFilterer) ParseWithdrawn(log types.Log) (*TaikoL1ProverPoolWithdrawn, error) { - event := new(TaikoL1ProverPoolWithdrawn) - if err := _TaikoL1ProverPool.contract.UnpackLog(event, "Withdrawn", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/bindings/gen_taiko_token.go b/bindings/gen_taiko_token.go new file mode 100644 index 000000000..d42ddadc5 --- /dev/null +++ b/bindings/gen_taiko_token.go @@ -0,0 +1,2686 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package bindings + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// ERC20VotesUpgradeableCheckpoint is an auto generated low-level Go binding around an user-defined struct. +type ERC20VotesUpgradeableCheckpoint struct { + FromBlock uint32 + Votes *big.Int +} + +// TaikoTokenMetaData contains all meta data concerning the TaikoToken contract. +var TaikoTokenMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"name\":\"RESOLVER_DENIED\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"RESOLVER_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"RESOLVER_ZERO_ADDR\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TKO_INVALID_ADDR\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TKO_INVALID_PREMINT_PARAMS\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"addressManager\",\"type\":\"address\"}],\"name\":\"AddressManagerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromDelegate\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toDelegate\",\"type\":\"address\"}],\"name\":\"DelegateChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\"}],\"name\":\"DelegateVotesChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"Snapshot\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"snapshotId\",\"type\":\"uint256\"}],\"name\":\"balanceOfAt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"burnFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"pos\",\"type\":\"uint32\"}],\"name\":\"checkpoints\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fromBlock\",\"type\":\"uint32\"},{\"internalType\":\"uint224\",\"name\":\"votes\",\"type\":\"uint224\"}],\"internalType\":\"structERC20VotesUpgradeable.Checkpoint\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\"}],\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"delegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"delegateBySig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"delegates\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"getPastTotalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"getPastVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\"}],\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"},{\"internalType\":\"address[]\",\"name\":\"_premintRecipients\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"_premintAmounts\",\"type\":\"uint256[]\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"mint\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"numCheckpoints\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"addr\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddressManager\",\"type\":\"address\"}],\"name\":\"setAddressManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"snapshot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"snapshotId\",\"type\":\"uint256\"}],\"name\":\"totalSupplyAt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +// TaikoTokenABI is the input ABI used to generate the binding from. +// Deprecated: Use TaikoTokenMetaData.ABI instead. +var TaikoTokenABI = TaikoTokenMetaData.ABI + +// TaikoToken is an auto generated Go binding around an Ethereum contract. +type TaikoToken struct { + TaikoTokenCaller // Read-only binding to the contract + TaikoTokenTransactor // Write-only binding to the contract + TaikoTokenFilterer // Log filterer for contract events +} + +// TaikoTokenCaller is an auto generated read-only Go binding around an Ethereum contract. +type TaikoTokenCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TaikoTokenTransactor is an auto generated write-only Go binding around an Ethereum contract. +type TaikoTokenTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TaikoTokenFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type TaikoTokenFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TaikoTokenSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type TaikoTokenSession struct { + Contract *TaikoToken // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// TaikoTokenCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type TaikoTokenCallerSession struct { + Contract *TaikoTokenCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// TaikoTokenTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type TaikoTokenTransactorSession struct { + Contract *TaikoTokenTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// TaikoTokenRaw is an auto generated low-level Go binding around an Ethereum contract. +type TaikoTokenRaw struct { + Contract *TaikoToken // Generic contract binding to access the raw methods on +} + +// TaikoTokenCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type TaikoTokenCallerRaw struct { + Contract *TaikoTokenCaller // Generic read-only contract binding to access the raw methods on +} + +// TaikoTokenTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type TaikoTokenTransactorRaw struct { + Contract *TaikoTokenTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewTaikoToken creates a new instance of TaikoToken, bound to a specific deployed contract. +func NewTaikoToken(address common.Address, backend bind.ContractBackend) (*TaikoToken, error) { + contract, err := bindTaikoToken(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &TaikoToken{TaikoTokenCaller: TaikoTokenCaller{contract: contract}, TaikoTokenTransactor: TaikoTokenTransactor{contract: contract}, TaikoTokenFilterer: TaikoTokenFilterer{contract: contract}}, nil +} + +// NewTaikoTokenCaller creates a new read-only instance of TaikoToken, bound to a specific deployed contract. +func NewTaikoTokenCaller(address common.Address, caller bind.ContractCaller) (*TaikoTokenCaller, error) { + contract, err := bindTaikoToken(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &TaikoTokenCaller{contract: contract}, nil +} + +// NewTaikoTokenTransactor creates a new write-only instance of TaikoToken, bound to a specific deployed contract. +func NewTaikoTokenTransactor(address common.Address, transactor bind.ContractTransactor) (*TaikoTokenTransactor, error) { + contract, err := bindTaikoToken(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &TaikoTokenTransactor{contract: contract}, nil +} + +// NewTaikoTokenFilterer creates a new log filterer instance of TaikoToken, bound to a specific deployed contract. +func NewTaikoTokenFilterer(address common.Address, filterer bind.ContractFilterer) (*TaikoTokenFilterer, error) { + contract, err := bindTaikoToken(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &TaikoTokenFilterer{contract: contract}, nil +} + +// bindTaikoToken binds a generic wrapper to an already deployed contract. +func bindTaikoToken(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := TaikoTokenMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_TaikoToken *TaikoTokenRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _TaikoToken.Contract.TaikoTokenCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_TaikoToken *TaikoTokenRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TaikoToken.Contract.TaikoTokenTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_TaikoToken *TaikoTokenRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TaikoToken.Contract.TaikoTokenTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_TaikoToken *TaikoTokenCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _TaikoToken.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_TaikoToken *TaikoTokenTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TaikoToken.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_TaikoToken *TaikoTokenTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TaikoToken.Contract.contract.Transact(opts, method, params...) +} + +// DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. +// +// Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) +func (_TaikoToken *TaikoTokenCaller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "DOMAIN_SEPARATOR") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. +// +// Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) +func (_TaikoToken *TaikoTokenSession) DOMAINSEPARATOR() ([32]byte, error) { + return _TaikoToken.Contract.DOMAINSEPARATOR(&_TaikoToken.CallOpts) +} + +// DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. +// +// Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) +func (_TaikoToken *TaikoTokenCallerSession) DOMAINSEPARATOR() ([32]byte, error) { + return _TaikoToken.Contract.DOMAINSEPARATOR(&_TaikoToken.CallOpts) +} + +// AddressManager is a free data retrieval call binding the contract method 0x3ab76e9f. +// +// Solidity: function addressManager() view returns(address) +func (_TaikoToken *TaikoTokenCaller) AddressManager(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "addressManager") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// AddressManager is a free data retrieval call binding the contract method 0x3ab76e9f. +// +// Solidity: function addressManager() view returns(address) +func (_TaikoToken *TaikoTokenSession) AddressManager() (common.Address, error) { + return _TaikoToken.Contract.AddressManager(&_TaikoToken.CallOpts) +} + +// AddressManager is a free data retrieval call binding the contract method 0x3ab76e9f. +// +// Solidity: function addressManager() view returns(address) +func (_TaikoToken *TaikoTokenCallerSession) AddressManager() (common.Address, error) { + return _TaikoToken.Contract.AddressManager(&_TaikoToken.CallOpts) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_TaikoToken *TaikoTokenCaller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "allowance", owner, spender) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_TaikoToken *TaikoTokenSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _TaikoToken.Contract.Allowance(&_TaikoToken.CallOpts, owner, spender) +} + +// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. +// +// Solidity: function allowance(address owner, address spender) view returns(uint256) +func (_TaikoToken *TaikoTokenCallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { + return _TaikoToken.Contract.Allowance(&_TaikoToken.CallOpts, owner, spender) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_TaikoToken *TaikoTokenCaller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "balanceOf", account) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_TaikoToken *TaikoTokenSession) BalanceOf(account common.Address) (*big.Int, error) { + return _TaikoToken.Contract.BalanceOf(&_TaikoToken.CallOpts, account) +} + +// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. +// +// Solidity: function balanceOf(address account) view returns(uint256) +func (_TaikoToken *TaikoTokenCallerSession) BalanceOf(account common.Address) (*big.Int, error) { + return _TaikoToken.Contract.BalanceOf(&_TaikoToken.CallOpts, account) +} + +// BalanceOfAt is a free data retrieval call binding the contract method 0x4ee2cd7e. +// +// Solidity: function balanceOfAt(address account, uint256 snapshotId) view returns(uint256) +func (_TaikoToken *TaikoTokenCaller) BalanceOfAt(opts *bind.CallOpts, account common.Address, snapshotId *big.Int) (*big.Int, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "balanceOfAt", account, snapshotId) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// BalanceOfAt is a free data retrieval call binding the contract method 0x4ee2cd7e. +// +// Solidity: function balanceOfAt(address account, uint256 snapshotId) view returns(uint256) +func (_TaikoToken *TaikoTokenSession) BalanceOfAt(account common.Address, snapshotId *big.Int) (*big.Int, error) { + return _TaikoToken.Contract.BalanceOfAt(&_TaikoToken.CallOpts, account, snapshotId) +} + +// BalanceOfAt is a free data retrieval call binding the contract method 0x4ee2cd7e. +// +// Solidity: function balanceOfAt(address account, uint256 snapshotId) view returns(uint256) +func (_TaikoToken *TaikoTokenCallerSession) BalanceOfAt(account common.Address, snapshotId *big.Int) (*big.Int, error) { + return _TaikoToken.Contract.BalanceOfAt(&_TaikoToken.CallOpts, account, snapshotId) +} + +// Checkpoints is a free data retrieval call binding the contract method 0xf1127ed8. +// +// Solidity: function checkpoints(address account, uint32 pos) view returns((uint32,uint224)) +func (_TaikoToken *TaikoTokenCaller) Checkpoints(opts *bind.CallOpts, account common.Address, pos uint32) (ERC20VotesUpgradeableCheckpoint, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "checkpoints", account, pos) + + if err != nil { + return *new(ERC20VotesUpgradeableCheckpoint), err + } + + out0 := *abi.ConvertType(out[0], new(ERC20VotesUpgradeableCheckpoint)).(*ERC20VotesUpgradeableCheckpoint) + + return out0, err + +} + +// Checkpoints is a free data retrieval call binding the contract method 0xf1127ed8. +// +// Solidity: function checkpoints(address account, uint32 pos) view returns((uint32,uint224)) +func (_TaikoToken *TaikoTokenSession) Checkpoints(account common.Address, pos uint32) (ERC20VotesUpgradeableCheckpoint, error) { + return _TaikoToken.Contract.Checkpoints(&_TaikoToken.CallOpts, account, pos) +} + +// Checkpoints is a free data retrieval call binding the contract method 0xf1127ed8. +// +// Solidity: function checkpoints(address account, uint32 pos) view returns((uint32,uint224)) +func (_TaikoToken *TaikoTokenCallerSession) Checkpoints(account common.Address, pos uint32) (ERC20VotesUpgradeableCheckpoint, error) { + return _TaikoToken.Contract.Checkpoints(&_TaikoToken.CallOpts, account, pos) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_TaikoToken *TaikoTokenCaller) Decimals(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "decimals") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_TaikoToken *TaikoTokenSession) Decimals() (uint8, error) { + return _TaikoToken.Contract.Decimals(&_TaikoToken.CallOpts) +} + +// Decimals is a free data retrieval call binding the contract method 0x313ce567. +// +// Solidity: function decimals() view returns(uint8) +func (_TaikoToken *TaikoTokenCallerSession) Decimals() (uint8, error) { + return _TaikoToken.Contract.Decimals(&_TaikoToken.CallOpts) +} + +// Delegates is a free data retrieval call binding the contract method 0x587cde1e. +// +// Solidity: function delegates(address account) view returns(address) +func (_TaikoToken *TaikoTokenCaller) Delegates(opts *bind.CallOpts, account common.Address) (common.Address, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "delegates", account) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Delegates is a free data retrieval call binding the contract method 0x587cde1e. +// +// Solidity: function delegates(address account) view returns(address) +func (_TaikoToken *TaikoTokenSession) Delegates(account common.Address) (common.Address, error) { + return _TaikoToken.Contract.Delegates(&_TaikoToken.CallOpts, account) +} + +// Delegates is a free data retrieval call binding the contract method 0x587cde1e. +// +// Solidity: function delegates(address account) view returns(address) +func (_TaikoToken *TaikoTokenCallerSession) Delegates(account common.Address) (common.Address, error) { + return _TaikoToken.Contract.Delegates(&_TaikoToken.CallOpts, account) +} + +// GetPastTotalSupply is a free data retrieval call binding the contract method 0x8e539e8c. +// +// Solidity: function getPastTotalSupply(uint256 blockNumber) view returns(uint256) +func (_TaikoToken *TaikoTokenCaller) GetPastTotalSupply(opts *bind.CallOpts, blockNumber *big.Int) (*big.Int, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "getPastTotalSupply", blockNumber) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetPastTotalSupply is a free data retrieval call binding the contract method 0x8e539e8c. +// +// Solidity: function getPastTotalSupply(uint256 blockNumber) view returns(uint256) +func (_TaikoToken *TaikoTokenSession) GetPastTotalSupply(blockNumber *big.Int) (*big.Int, error) { + return _TaikoToken.Contract.GetPastTotalSupply(&_TaikoToken.CallOpts, blockNumber) +} + +// GetPastTotalSupply is a free data retrieval call binding the contract method 0x8e539e8c. +// +// Solidity: function getPastTotalSupply(uint256 blockNumber) view returns(uint256) +func (_TaikoToken *TaikoTokenCallerSession) GetPastTotalSupply(blockNumber *big.Int) (*big.Int, error) { + return _TaikoToken.Contract.GetPastTotalSupply(&_TaikoToken.CallOpts, blockNumber) +} + +// GetPastVotes is a free data retrieval call binding the contract method 0x3a46b1a8. +// +// Solidity: function getPastVotes(address account, uint256 blockNumber) view returns(uint256) +func (_TaikoToken *TaikoTokenCaller) GetPastVotes(opts *bind.CallOpts, account common.Address, blockNumber *big.Int) (*big.Int, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "getPastVotes", account, blockNumber) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetPastVotes is a free data retrieval call binding the contract method 0x3a46b1a8. +// +// Solidity: function getPastVotes(address account, uint256 blockNumber) view returns(uint256) +func (_TaikoToken *TaikoTokenSession) GetPastVotes(account common.Address, blockNumber *big.Int) (*big.Int, error) { + return _TaikoToken.Contract.GetPastVotes(&_TaikoToken.CallOpts, account, blockNumber) +} + +// GetPastVotes is a free data retrieval call binding the contract method 0x3a46b1a8. +// +// Solidity: function getPastVotes(address account, uint256 blockNumber) view returns(uint256) +func (_TaikoToken *TaikoTokenCallerSession) GetPastVotes(account common.Address, blockNumber *big.Int) (*big.Int, error) { + return _TaikoToken.Contract.GetPastVotes(&_TaikoToken.CallOpts, account, blockNumber) +} + +// GetVotes is a free data retrieval call binding the contract method 0x9ab24eb0. +// +// Solidity: function getVotes(address account) view returns(uint256) +func (_TaikoToken *TaikoTokenCaller) GetVotes(opts *bind.CallOpts, account common.Address) (*big.Int, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "getVotes", account) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetVotes is a free data retrieval call binding the contract method 0x9ab24eb0. +// +// Solidity: function getVotes(address account) view returns(uint256) +func (_TaikoToken *TaikoTokenSession) GetVotes(account common.Address) (*big.Int, error) { + return _TaikoToken.Contract.GetVotes(&_TaikoToken.CallOpts, account) +} + +// GetVotes is a free data retrieval call binding the contract method 0x9ab24eb0. +// +// Solidity: function getVotes(address account) view returns(uint256) +func (_TaikoToken *TaikoTokenCallerSession) GetVotes(account common.Address) (*big.Int, error) { + return _TaikoToken.Contract.GetVotes(&_TaikoToken.CallOpts, account) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_TaikoToken *TaikoTokenCaller) Name(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "name") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_TaikoToken *TaikoTokenSession) Name() (string, error) { + return _TaikoToken.Contract.Name(&_TaikoToken.CallOpts) +} + +// Name is a free data retrieval call binding the contract method 0x06fdde03. +// +// Solidity: function name() view returns(string) +func (_TaikoToken *TaikoTokenCallerSession) Name() (string, error) { + return _TaikoToken.Contract.Name(&_TaikoToken.CallOpts) +} + +// Nonces is a free data retrieval call binding the contract method 0x7ecebe00. +// +// Solidity: function nonces(address owner) view returns(uint256) +func (_TaikoToken *TaikoTokenCaller) Nonces(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "nonces", owner) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Nonces is a free data retrieval call binding the contract method 0x7ecebe00. +// +// Solidity: function nonces(address owner) view returns(uint256) +func (_TaikoToken *TaikoTokenSession) Nonces(owner common.Address) (*big.Int, error) { + return _TaikoToken.Contract.Nonces(&_TaikoToken.CallOpts, owner) +} + +// Nonces is a free data retrieval call binding the contract method 0x7ecebe00. +// +// Solidity: function nonces(address owner) view returns(uint256) +func (_TaikoToken *TaikoTokenCallerSession) Nonces(owner common.Address) (*big.Int, error) { + return _TaikoToken.Contract.Nonces(&_TaikoToken.CallOpts, owner) +} + +// NumCheckpoints is a free data retrieval call binding the contract method 0x6fcfff45. +// +// Solidity: function numCheckpoints(address account) view returns(uint32) +func (_TaikoToken *TaikoTokenCaller) NumCheckpoints(opts *bind.CallOpts, account common.Address) (uint32, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "numCheckpoints", account) + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// NumCheckpoints is a free data retrieval call binding the contract method 0x6fcfff45. +// +// Solidity: function numCheckpoints(address account) view returns(uint32) +func (_TaikoToken *TaikoTokenSession) NumCheckpoints(account common.Address) (uint32, error) { + return _TaikoToken.Contract.NumCheckpoints(&_TaikoToken.CallOpts, account) +} + +// NumCheckpoints is a free data retrieval call binding the contract method 0x6fcfff45. +// +// Solidity: function numCheckpoints(address account) view returns(uint32) +func (_TaikoToken *TaikoTokenCallerSession) NumCheckpoints(account common.Address) (uint32, error) { + return _TaikoToken.Contract.NumCheckpoints(&_TaikoToken.CallOpts, account) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_TaikoToken *TaikoTokenCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "owner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_TaikoToken *TaikoTokenSession) Owner() (common.Address, error) { + return _TaikoToken.Contract.Owner(&_TaikoToken.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_TaikoToken *TaikoTokenCallerSession) Owner() (common.Address, error) { + return _TaikoToken.Contract.Owner(&_TaikoToken.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_TaikoToken *TaikoTokenCaller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "paused") + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_TaikoToken *TaikoTokenSession) Paused() (bool, error) { + return _TaikoToken.Contract.Paused(&_TaikoToken.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_TaikoToken *TaikoTokenCallerSession) Paused() (bool, error) { + return _TaikoToken.Contract.Paused(&_TaikoToken.CallOpts) +} + +// Resolve is a free data retrieval call binding the contract method 0x6c6563f6. +// +// Solidity: function resolve(uint256 chainId, bytes32 name, bool allowZeroAddress) view returns(address addr) +func (_TaikoToken *TaikoTokenCaller) Resolve(opts *bind.CallOpts, chainId *big.Int, name [32]byte, allowZeroAddress bool) (common.Address, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "resolve", chainId, name, allowZeroAddress) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Resolve is a free data retrieval call binding the contract method 0x6c6563f6. +// +// Solidity: function resolve(uint256 chainId, bytes32 name, bool allowZeroAddress) view returns(address addr) +func (_TaikoToken *TaikoTokenSession) Resolve(chainId *big.Int, name [32]byte, allowZeroAddress bool) (common.Address, error) { + return _TaikoToken.Contract.Resolve(&_TaikoToken.CallOpts, chainId, name, allowZeroAddress) +} + +// Resolve is a free data retrieval call binding the contract method 0x6c6563f6. +// +// Solidity: function resolve(uint256 chainId, bytes32 name, bool allowZeroAddress) view returns(address addr) +func (_TaikoToken *TaikoTokenCallerSession) Resolve(chainId *big.Int, name [32]byte, allowZeroAddress bool) (common.Address, error) { + return _TaikoToken.Contract.Resolve(&_TaikoToken.CallOpts, chainId, name, allowZeroAddress) +} + +// Resolve0 is a free data retrieval call binding the contract method 0xa86f9d9e. +// +// Solidity: function resolve(bytes32 name, bool allowZeroAddress) view returns(address addr) +func (_TaikoToken *TaikoTokenCaller) Resolve0(opts *bind.CallOpts, name [32]byte, allowZeroAddress bool) (common.Address, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "resolve0", name, allowZeroAddress) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Resolve0 is a free data retrieval call binding the contract method 0xa86f9d9e. +// +// Solidity: function resolve(bytes32 name, bool allowZeroAddress) view returns(address addr) +func (_TaikoToken *TaikoTokenSession) Resolve0(name [32]byte, allowZeroAddress bool) (common.Address, error) { + return _TaikoToken.Contract.Resolve0(&_TaikoToken.CallOpts, name, allowZeroAddress) +} + +// Resolve0 is a free data retrieval call binding the contract method 0xa86f9d9e. +// +// Solidity: function resolve(bytes32 name, bool allowZeroAddress) view returns(address addr) +func (_TaikoToken *TaikoTokenCallerSession) Resolve0(name [32]byte, allowZeroAddress bool) (common.Address, error) { + return _TaikoToken.Contract.Resolve0(&_TaikoToken.CallOpts, name, allowZeroAddress) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_TaikoToken *TaikoTokenCaller) Symbol(opts *bind.CallOpts) (string, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "symbol") + + if err != nil { + return *new(string), err + } + + out0 := *abi.ConvertType(out[0], new(string)).(*string) + + return out0, err + +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_TaikoToken *TaikoTokenSession) Symbol() (string, error) { + return _TaikoToken.Contract.Symbol(&_TaikoToken.CallOpts) +} + +// Symbol is a free data retrieval call binding the contract method 0x95d89b41. +// +// Solidity: function symbol() view returns(string) +func (_TaikoToken *TaikoTokenCallerSession) Symbol() (string, error) { + return _TaikoToken.Contract.Symbol(&_TaikoToken.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_TaikoToken *TaikoTokenCaller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "totalSupply") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_TaikoToken *TaikoTokenSession) TotalSupply() (*big.Int, error) { + return _TaikoToken.Contract.TotalSupply(&_TaikoToken.CallOpts) +} + +// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. +// +// Solidity: function totalSupply() view returns(uint256) +func (_TaikoToken *TaikoTokenCallerSession) TotalSupply() (*big.Int, error) { + return _TaikoToken.Contract.TotalSupply(&_TaikoToken.CallOpts) +} + +// TotalSupplyAt is a free data retrieval call binding the contract method 0x981b24d0. +// +// Solidity: function totalSupplyAt(uint256 snapshotId) view returns(uint256) +func (_TaikoToken *TaikoTokenCaller) TotalSupplyAt(opts *bind.CallOpts, snapshotId *big.Int) (*big.Int, error) { + var out []interface{} + err := _TaikoToken.contract.Call(opts, &out, "totalSupplyAt", snapshotId) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TotalSupplyAt is a free data retrieval call binding the contract method 0x981b24d0. +// +// Solidity: function totalSupplyAt(uint256 snapshotId) view returns(uint256) +func (_TaikoToken *TaikoTokenSession) TotalSupplyAt(snapshotId *big.Int) (*big.Int, error) { + return _TaikoToken.Contract.TotalSupplyAt(&_TaikoToken.CallOpts, snapshotId) +} + +// TotalSupplyAt is a free data retrieval call binding the contract method 0x981b24d0. +// +// Solidity: function totalSupplyAt(uint256 snapshotId) view returns(uint256) +func (_TaikoToken *TaikoTokenCallerSession) TotalSupplyAt(snapshotId *big.Int) (*big.Int, error) { + return _TaikoToken.Contract.TotalSupplyAt(&_TaikoToken.CallOpts, snapshotId) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_TaikoToken *TaikoTokenTransactor) Approve(opts *bind.TransactOpts, spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "approve", spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_TaikoToken *TaikoTokenSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.Approve(&_TaikoToken.TransactOpts, spender, amount) +} + +// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. +// +// Solidity: function approve(address spender, uint256 amount) returns(bool) +func (_TaikoToken *TaikoTokenTransactorSession) Approve(spender common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.Approve(&_TaikoToken.TransactOpts, spender, amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x42966c68. +// +// Solidity: function burn(uint256 amount) returns() +func (_TaikoToken *TaikoTokenTransactor) Burn(opts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "burn", amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x42966c68. +// +// Solidity: function burn(uint256 amount) returns() +func (_TaikoToken *TaikoTokenSession) Burn(amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.Burn(&_TaikoToken.TransactOpts, amount) +} + +// Burn is a paid mutator transaction binding the contract method 0x42966c68. +// +// Solidity: function burn(uint256 amount) returns() +func (_TaikoToken *TaikoTokenTransactorSession) Burn(amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.Burn(&_TaikoToken.TransactOpts, amount) +} + +// Burn0 is a paid mutator transaction binding the contract method 0x9dc29fac. +// +// Solidity: function burn(address from, uint256 amount) returns() +func (_TaikoToken *TaikoTokenTransactor) Burn0(opts *bind.TransactOpts, from common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "burn0", from, amount) +} + +// Burn0 is a paid mutator transaction binding the contract method 0x9dc29fac. +// +// Solidity: function burn(address from, uint256 amount) returns() +func (_TaikoToken *TaikoTokenSession) Burn0(from common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.Burn0(&_TaikoToken.TransactOpts, from, amount) +} + +// Burn0 is a paid mutator transaction binding the contract method 0x9dc29fac. +// +// Solidity: function burn(address from, uint256 amount) returns() +func (_TaikoToken *TaikoTokenTransactorSession) Burn0(from common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.Burn0(&_TaikoToken.TransactOpts, from, amount) +} + +// BurnFrom is a paid mutator transaction binding the contract method 0x79cc6790. +// +// Solidity: function burnFrom(address account, uint256 amount) returns() +func (_TaikoToken *TaikoTokenTransactor) BurnFrom(opts *bind.TransactOpts, account common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "burnFrom", account, amount) +} + +// BurnFrom is a paid mutator transaction binding the contract method 0x79cc6790. +// +// Solidity: function burnFrom(address account, uint256 amount) returns() +func (_TaikoToken *TaikoTokenSession) BurnFrom(account common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.BurnFrom(&_TaikoToken.TransactOpts, account, amount) +} + +// BurnFrom is a paid mutator transaction binding the contract method 0x79cc6790. +// +// Solidity: function burnFrom(address account, uint256 amount) returns() +func (_TaikoToken *TaikoTokenTransactorSession) BurnFrom(account common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.BurnFrom(&_TaikoToken.TransactOpts, account, amount) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_TaikoToken *TaikoTokenTransactor) DecreaseAllowance(opts *bind.TransactOpts, spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "decreaseAllowance", spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_TaikoToken *TaikoTokenSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.DecreaseAllowance(&_TaikoToken.TransactOpts, spender, subtractedValue) +} + +// DecreaseAllowance is a paid mutator transaction binding the contract method 0xa457c2d7. +// +// Solidity: function decreaseAllowance(address spender, uint256 subtractedValue) returns(bool) +func (_TaikoToken *TaikoTokenTransactorSession) DecreaseAllowance(spender common.Address, subtractedValue *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.DecreaseAllowance(&_TaikoToken.TransactOpts, spender, subtractedValue) +} + +// Delegate is a paid mutator transaction binding the contract method 0x5c19a95c. +// +// Solidity: function delegate(address delegatee) returns() +func (_TaikoToken *TaikoTokenTransactor) Delegate(opts *bind.TransactOpts, delegatee common.Address) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "delegate", delegatee) +} + +// Delegate is a paid mutator transaction binding the contract method 0x5c19a95c. +// +// Solidity: function delegate(address delegatee) returns() +func (_TaikoToken *TaikoTokenSession) Delegate(delegatee common.Address) (*types.Transaction, error) { + return _TaikoToken.Contract.Delegate(&_TaikoToken.TransactOpts, delegatee) +} + +// Delegate is a paid mutator transaction binding the contract method 0x5c19a95c. +// +// Solidity: function delegate(address delegatee) returns() +func (_TaikoToken *TaikoTokenTransactorSession) Delegate(delegatee common.Address) (*types.Transaction, error) { + return _TaikoToken.Contract.Delegate(&_TaikoToken.TransactOpts, delegatee) +} + +// DelegateBySig is a paid mutator transaction binding the contract method 0xc3cda520. +// +// Solidity: function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) returns() +func (_TaikoToken *TaikoTokenTransactor) DelegateBySig(opts *bind.TransactOpts, delegatee common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "delegateBySig", delegatee, nonce, expiry, v, r, s) +} + +// DelegateBySig is a paid mutator transaction binding the contract method 0xc3cda520. +// +// Solidity: function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) returns() +func (_TaikoToken *TaikoTokenSession) DelegateBySig(delegatee common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _TaikoToken.Contract.DelegateBySig(&_TaikoToken.TransactOpts, delegatee, nonce, expiry, v, r, s) +} + +// DelegateBySig is a paid mutator transaction binding the contract method 0xc3cda520. +// +// Solidity: function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) returns() +func (_TaikoToken *TaikoTokenTransactorSession) DelegateBySig(delegatee common.Address, nonce *big.Int, expiry *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _TaikoToken.Contract.DelegateBySig(&_TaikoToken.TransactOpts, delegatee, nonce, expiry, v, r, s) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_TaikoToken *TaikoTokenTransactor) IncreaseAllowance(opts *bind.TransactOpts, spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "increaseAllowance", spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_TaikoToken *TaikoTokenSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.IncreaseAllowance(&_TaikoToken.TransactOpts, spender, addedValue) +} + +// IncreaseAllowance is a paid mutator transaction binding the contract method 0x39509351. +// +// Solidity: function increaseAllowance(address spender, uint256 addedValue) returns(bool) +func (_TaikoToken *TaikoTokenTransactorSession) IncreaseAllowance(spender common.Address, addedValue *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.IncreaseAllowance(&_TaikoToken.TransactOpts, spender, addedValue) +} + +// Init is a paid mutator transaction binding the contract method 0xc3a57123. +// +// Solidity: function init(address _addressManager, string _name, string _symbol, address[] _premintRecipients, uint256[] _premintAmounts) returns() +func (_TaikoToken *TaikoTokenTransactor) Init(opts *bind.TransactOpts, _addressManager common.Address, _name string, _symbol string, _premintRecipients []common.Address, _premintAmounts []*big.Int) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "init", _addressManager, _name, _symbol, _premintRecipients, _premintAmounts) +} + +// Init is a paid mutator transaction binding the contract method 0xc3a57123. +// +// Solidity: function init(address _addressManager, string _name, string _symbol, address[] _premintRecipients, uint256[] _premintAmounts) returns() +func (_TaikoToken *TaikoTokenSession) Init(_addressManager common.Address, _name string, _symbol string, _premintRecipients []common.Address, _premintAmounts []*big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.Init(&_TaikoToken.TransactOpts, _addressManager, _name, _symbol, _premintRecipients, _premintAmounts) +} + +// Init is a paid mutator transaction binding the contract method 0xc3a57123. +// +// Solidity: function init(address _addressManager, string _name, string _symbol, address[] _premintRecipients, uint256[] _premintAmounts) returns() +func (_TaikoToken *TaikoTokenTransactorSession) Init(_addressManager common.Address, _name string, _symbol string, _premintRecipients []common.Address, _premintAmounts []*big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.Init(&_TaikoToken.TransactOpts, _addressManager, _name, _symbol, _premintRecipients, _premintAmounts) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address to, uint256 amount) returns() +func (_TaikoToken *TaikoTokenTransactor) Mint(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "mint", to, amount) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address to, uint256 amount) returns() +func (_TaikoToken *TaikoTokenSession) Mint(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.Mint(&_TaikoToken.TransactOpts, to, amount) +} + +// Mint is a paid mutator transaction binding the contract method 0x40c10f19. +// +// Solidity: function mint(address to, uint256 amount) returns() +func (_TaikoToken *TaikoTokenTransactorSession) Mint(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.Mint(&_TaikoToken.TransactOpts, to, amount) +} + +// Pause is a paid mutator transaction binding the contract method 0x8456cb59. +// +// Solidity: function pause() returns() +func (_TaikoToken *TaikoTokenTransactor) Pause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "pause") +} + +// Pause is a paid mutator transaction binding the contract method 0x8456cb59. +// +// Solidity: function pause() returns() +func (_TaikoToken *TaikoTokenSession) Pause() (*types.Transaction, error) { + return _TaikoToken.Contract.Pause(&_TaikoToken.TransactOpts) +} + +// Pause is a paid mutator transaction binding the contract method 0x8456cb59. +// +// Solidity: function pause() returns() +func (_TaikoToken *TaikoTokenTransactorSession) Pause() (*types.Transaction, error) { + return _TaikoToken.Contract.Pause(&_TaikoToken.TransactOpts) +} + +// Permit is a paid mutator transaction binding the contract method 0xd505accf. +// +// Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() +func (_TaikoToken *TaikoTokenTransactor) Permit(opts *bind.TransactOpts, owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "permit", owner, spender, value, deadline, v, r, s) +} + +// Permit is a paid mutator transaction binding the contract method 0xd505accf. +// +// Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() +func (_TaikoToken *TaikoTokenSession) Permit(owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _TaikoToken.Contract.Permit(&_TaikoToken.TransactOpts, owner, spender, value, deadline, v, r, s) +} + +// Permit is a paid mutator transaction binding the contract method 0xd505accf. +// +// Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() +func (_TaikoToken *TaikoTokenTransactorSession) Permit(owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { + return _TaikoToken.Contract.Permit(&_TaikoToken.TransactOpts, owner, spender, value, deadline, v, r, s) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_TaikoToken *TaikoTokenTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_TaikoToken *TaikoTokenSession) RenounceOwnership() (*types.Transaction, error) { + return _TaikoToken.Contract.RenounceOwnership(&_TaikoToken.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_TaikoToken *TaikoTokenTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _TaikoToken.Contract.RenounceOwnership(&_TaikoToken.TransactOpts) +} + +// SetAddressManager is a paid mutator transaction binding the contract method 0x0652b57a. +// +// Solidity: function setAddressManager(address newAddressManager) returns() +func (_TaikoToken *TaikoTokenTransactor) SetAddressManager(opts *bind.TransactOpts, newAddressManager common.Address) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "setAddressManager", newAddressManager) +} + +// SetAddressManager is a paid mutator transaction binding the contract method 0x0652b57a. +// +// Solidity: function setAddressManager(address newAddressManager) returns() +func (_TaikoToken *TaikoTokenSession) SetAddressManager(newAddressManager common.Address) (*types.Transaction, error) { + return _TaikoToken.Contract.SetAddressManager(&_TaikoToken.TransactOpts, newAddressManager) +} + +// SetAddressManager is a paid mutator transaction binding the contract method 0x0652b57a. +// +// Solidity: function setAddressManager(address newAddressManager) returns() +func (_TaikoToken *TaikoTokenTransactorSession) SetAddressManager(newAddressManager common.Address) (*types.Transaction, error) { + return _TaikoToken.Contract.SetAddressManager(&_TaikoToken.TransactOpts, newAddressManager) +} + +// Snapshot is a paid mutator transaction binding the contract method 0x9711715a. +// +// Solidity: function snapshot() returns() +func (_TaikoToken *TaikoTokenTransactor) Snapshot(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "snapshot") +} + +// Snapshot is a paid mutator transaction binding the contract method 0x9711715a. +// +// Solidity: function snapshot() returns() +func (_TaikoToken *TaikoTokenSession) Snapshot() (*types.Transaction, error) { + return _TaikoToken.Contract.Snapshot(&_TaikoToken.TransactOpts) +} + +// Snapshot is a paid mutator transaction binding the contract method 0x9711715a. +// +// Solidity: function snapshot() returns() +func (_TaikoToken *TaikoTokenTransactorSession) Snapshot() (*types.Transaction, error) { + return _TaikoToken.Contract.Snapshot(&_TaikoToken.TransactOpts) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_TaikoToken *TaikoTokenTransactor) Transfer(opts *bind.TransactOpts, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "transfer", to, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_TaikoToken *TaikoTokenSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.Transfer(&_TaikoToken.TransactOpts, to, amount) +} + +// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. +// +// Solidity: function transfer(address to, uint256 amount) returns(bool) +func (_TaikoToken *TaikoTokenTransactorSession) Transfer(to common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.Transfer(&_TaikoToken.TransactOpts, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_TaikoToken *TaikoTokenTransactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "transferFrom", from, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_TaikoToken *TaikoTokenSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.TransferFrom(&_TaikoToken.TransactOpts, from, to, amount) +} + +// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. +// +// Solidity: function transferFrom(address from, address to, uint256 amount) returns(bool) +func (_TaikoToken *TaikoTokenTransactorSession) TransferFrom(from common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _TaikoToken.Contract.TransferFrom(&_TaikoToken.TransactOpts, from, to, amount) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_TaikoToken *TaikoTokenTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_TaikoToken *TaikoTokenSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _TaikoToken.Contract.TransferOwnership(&_TaikoToken.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_TaikoToken *TaikoTokenTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _TaikoToken.Contract.TransferOwnership(&_TaikoToken.TransactOpts, newOwner) +} + +// Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. +// +// Solidity: function unpause() returns() +func (_TaikoToken *TaikoTokenTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TaikoToken.contract.Transact(opts, "unpause") +} + +// Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. +// +// Solidity: function unpause() returns() +func (_TaikoToken *TaikoTokenSession) Unpause() (*types.Transaction, error) { + return _TaikoToken.Contract.Unpause(&_TaikoToken.TransactOpts) +} + +// Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. +// +// Solidity: function unpause() returns() +func (_TaikoToken *TaikoTokenTransactorSession) Unpause() (*types.Transaction, error) { + return _TaikoToken.Contract.Unpause(&_TaikoToken.TransactOpts) +} + +// TaikoTokenAddressManagerChangedIterator is returned from FilterAddressManagerChanged and is used to iterate over the raw logs and unpacked data for AddressManagerChanged events raised by the TaikoToken contract. +type TaikoTokenAddressManagerChangedIterator struct { + Event *TaikoTokenAddressManagerChanged // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenAddressManagerChangedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenAddressManagerChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenAddressManagerChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenAddressManagerChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenAddressManagerChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenAddressManagerChanged represents a AddressManagerChanged event raised by the TaikoToken contract. +type TaikoTokenAddressManagerChanged struct { + AddressManager common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAddressManagerChanged is a free log retrieval operation binding the contract event 0x399ded90cb5ed8d89ef7e76ff4af65c373f06d3bf5d7eef55f4228e7b702a18b. +// +// Solidity: event AddressManagerChanged(address indexed addressManager) +func (_TaikoToken *TaikoTokenFilterer) FilterAddressManagerChanged(opts *bind.FilterOpts, addressManager []common.Address) (*TaikoTokenAddressManagerChangedIterator, error) { + + var addressManagerRule []interface{} + for _, addressManagerItem := range addressManager { + addressManagerRule = append(addressManagerRule, addressManagerItem) + } + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "AddressManagerChanged", addressManagerRule) + if err != nil { + return nil, err + } + return &TaikoTokenAddressManagerChangedIterator{contract: _TaikoToken.contract, event: "AddressManagerChanged", logs: logs, sub: sub}, nil +} + +// WatchAddressManagerChanged is a free log subscription operation binding the contract event 0x399ded90cb5ed8d89ef7e76ff4af65c373f06d3bf5d7eef55f4228e7b702a18b. +// +// Solidity: event AddressManagerChanged(address indexed addressManager) +func (_TaikoToken *TaikoTokenFilterer) WatchAddressManagerChanged(opts *bind.WatchOpts, sink chan<- *TaikoTokenAddressManagerChanged, addressManager []common.Address) (event.Subscription, error) { + + var addressManagerRule []interface{} + for _, addressManagerItem := range addressManager { + addressManagerRule = append(addressManagerRule, addressManagerItem) + } + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "AddressManagerChanged", addressManagerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenAddressManagerChanged) + if err := _TaikoToken.contract.UnpackLog(event, "AddressManagerChanged", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseAddressManagerChanged is a log parse operation binding the contract event 0x399ded90cb5ed8d89ef7e76ff4af65c373f06d3bf5d7eef55f4228e7b702a18b. +// +// Solidity: event AddressManagerChanged(address indexed addressManager) +func (_TaikoToken *TaikoTokenFilterer) ParseAddressManagerChanged(log types.Log) (*TaikoTokenAddressManagerChanged, error) { + event := new(TaikoTokenAddressManagerChanged) + if err := _TaikoToken.contract.UnpackLog(event, "AddressManagerChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoTokenApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the TaikoToken contract. +type TaikoTokenApprovalIterator struct { + Event *TaikoTokenApproval // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenApprovalIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenApproval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenApproval) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenApprovalIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenApprovalIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenApproval represents a Approval event raised by the TaikoToken contract. +type TaikoTokenApproval struct { + Owner common.Address + Spender common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_TaikoToken *TaikoTokenFilterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*TaikoTokenApprovalIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return &TaikoTokenApprovalIterator{contract: _TaikoToken.contract, event: "Approval", logs: logs, sub: sub}, nil +} + +// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_TaikoToken *TaikoTokenFilterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *TaikoTokenApproval, owner []common.Address, spender []common.Address) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var spenderRule []interface{} + for _, spenderItem := range spender { + spenderRule = append(spenderRule, spenderItem) + } + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenApproval) + if err := _TaikoToken.contract.UnpackLog(event, "Approval", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. +// +// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) +func (_TaikoToken *TaikoTokenFilterer) ParseApproval(log types.Log) (*TaikoTokenApproval, error) { + event := new(TaikoTokenApproval) + if err := _TaikoToken.contract.UnpackLog(event, "Approval", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoTokenDelegateChangedIterator is returned from FilterDelegateChanged and is used to iterate over the raw logs and unpacked data for DelegateChanged events raised by the TaikoToken contract. +type TaikoTokenDelegateChangedIterator struct { + Event *TaikoTokenDelegateChanged // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenDelegateChangedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenDelegateChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenDelegateChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenDelegateChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenDelegateChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenDelegateChanged represents a DelegateChanged event raised by the TaikoToken contract. +type TaikoTokenDelegateChanged struct { + Delegator common.Address + FromDelegate common.Address + ToDelegate common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDelegateChanged is a free log retrieval operation binding the contract event 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f. +// +// Solidity: event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) +func (_TaikoToken *TaikoTokenFilterer) FilterDelegateChanged(opts *bind.FilterOpts, delegator []common.Address, fromDelegate []common.Address, toDelegate []common.Address) (*TaikoTokenDelegateChangedIterator, error) { + + var delegatorRule []interface{} + for _, delegatorItem := range delegator { + delegatorRule = append(delegatorRule, delegatorItem) + } + var fromDelegateRule []interface{} + for _, fromDelegateItem := range fromDelegate { + fromDelegateRule = append(fromDelegateRule, fromDelegateItem) + } + var toDelegateRule []interface{} + for _, toDelegateItem := range toDelegate { + toDelegateRule = append(toDelegateRule, toDelegateItem) + } + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "DelegateChanged", delegatorRule, fromDelegateRule, toDelegateRule) + if err != nil { + return nil, err + } + return &TaikoTokenDelegateChangedIterator{contract: _TaikoToken.contract, event: "DelegateChanged", logs: logs, sub: sub}, nil +} + +// WatchDelegateChanged is a free log subscription operation binding the contract event 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f. +// +// Solidity: event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) +func (_TaikoToken *TaikoTokenFilterer) WatchDelegateChanged(opts *bind.WatchOpts, sink chan<- *TaikoTokenDelegateChanged, delegator []common.Address, fromDelegate []common.Address, toDelegate []common.Address) (event.Subscription, error) { + + var delegatorRule []interface{} + for _, delegatorItem := range delegator { + delegatorRule = append(delegatorRule, delegatorItem) + } + var fromDelegateRule []interface{} + for _, fromDelegateItem := range fromDelegate { + fromDelegateRule = append(fromDelegateRule, fromDelegateItem) + } + var toDelegateRule []interface{} + for _, toDelegateItem := range toDelegate { + toDelegateRule = append(toDelegateRule, toDelegateItem) + } + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "DelegateChanged", delegatorRule, fromDelegateRule, toDelegateRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenDelegateChanged) + if err := _TaikoToken.contract.UnpackLog(event, "DelegateChanged", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseDelegateChanged is a log parse operation binding the contract event 0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f. +// +// Solidity: event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate) +func (_TaikoToken *TaikoTokenFilterer) ParseDelegateChanged(log types.Log) (*TaikoTokenDelegateChanged, error) { + event := new(TaikoTokenDelegateChanged) + if err := _TaikoToken.contract.UnpackLog(event, "DelegateChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoTokenDelegateVotesChangedIterator is returned from FilterDelegateVotesChanged and is used to iterate over the raw logs and unpacked data for DelegateVotesChanged events raised by the TaikoToken contract. +type TaikoTokenDelegateVotesChangedIterator struct { + Event *TaikoTokenDelegateVotesChanged // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenDelegateVotesChangedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenDelegateVotesChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenDelegateVotesChanged) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenDelegateVotesChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenDelegateVotesChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenDelegateVotesChanged represents a DelegateVotesChanged event raised by the TaikoToken contract. +type TaikoTokenDelegateVotesChanged struct { + Delegate common.Address + PreviousBalance *big.Int + NewBalance *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDelegateVotesChanged is a free log retrieval operation binding the contract event 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724. +// +// Solidity: event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance) +func (_TaikoToken *TaikoTokenFilterer) FilterDelegateVotesChanged(opts *bind.FilterOpts, delegate []common.Address) (*TaikoTokenDelegateVotesChangedIterator, error) { + + var delegateRule []interface{} + for _, delegateItem := range delegate { + delegateRule = append(delegateRule, delegateItem) + } + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "DelegateVotesChanged", delegateRule) + if err != nil { + return nil, err + } + return &TaikoTokenDelegateVotesChangedIterator{contract: _TaikoToken.contract, event: "DelegateVotesChanged", logs: logs, sub: sub}, nil +} + +// WatchDelegateVotesChanged is a free log subscription operation binding the contract event 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724. +// +// Solidity: event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance) +func (_TaikoToken *TaikoTokenFilterer) WatchDelegateVotesChanged(opts *bind.WatchOpts, sink chan<- *TaikoTokenDelegateVotesChanged, delegate []common.Address) (event.Subscription, error) { + + var delegateRule []interface{} + for _, delegateItem := range delegate { + delegateRule = append(delegateRule, delegateItem) + } + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "DelegateVotesChanged", delegateRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenDelegateVotesChanged) + if err := _TaikoToken.contract.UnpackLog(event, "DelegateVotesChanged", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseDelegateVotesChanged is a log parse operation binding the contract event 0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724. +// +// Solidity: event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance) +func (_TaikoToken *TaikoTokenFilterer) ParseDelegateVotesChanged(log types.Log) (*TaikoTokenDelegateVotesChanged, error) { + event := new(TaikoTokenDelegateVotesChanged) + if err := _TaikoToken.contract.UnpackLog(event, "DelegateVotesChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoTokenInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the TaikoToken contract. +type TaikoTokenInitializedIterator struct { + Event *TaikoTokenInitialized // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenInitializedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenInitialized) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenInitialized represents a Initialized event raised by the TaikoToken contract. +type TaikoTokenInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_TaikoToken *TaikoTokenFilterer) FilterInitialized(opts *bind.FilterOpts) (*TaikoTokenInitializedIterator, error) { + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &TaikoTokenInitializedIterator{contract: _TaikoToken.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_TaikoToken *TaikoTokenFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *TaikoTokenInitialized) (event.Subscription, error) { + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenInitialized) + if err := _TaikoToken.contract.UnpackLog(event, "Initialized", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_TaikoToken *TaikoTokenFilterer) ParseInitialized(log types.Log) (*TaikoTokenInitialized, error) { + event := new(TaikoTokenInitialized) + if err := _TaikoToken.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoTokenOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the TaikoToken contract. +type TaikoTokenOwnershipTransferredIterator struct { + Event *TaikoTokenOwnershipTransferred // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenOwnershipTransferredIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenOwnershipTransferred) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenOwnershipTransferred represents a OwnershipTransferred event raised by the TaikoToken contract. +type TaikoTokenOwnershipTransferred struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_TaikoToken *TaikoTokenFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*TaikoTokenOwnershipTransferredIterator, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &TaikoTokenOwnershipTransferredIterator{contract: _TaikoToken.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_TaikoToken *TaikoTokenFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *TaikoTokenOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { + + var previousOwnerRule []interface{} + for _, previousOwnerItem := range previousOwner { + previousOwnerRule = append(previousOwnerRule, previousOwnerItem) + } + var newOwnerRule []interface{} + for _, newOwnerItem := range newOwner { + newOwnerRule = append(newOwnerRule, newOwnerItem) + } + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenOwnershipTransferred) + if err := _TaikoToken.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. +// +// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) +func (_TaikoToken *TaikoTokenFilterer) ParseOwnershipTransferred(log types.Log) (*TaikoTokenOwnershipTransferred, error) { + event := new(TaikoTokenOwnershipTransferred) + if err := _TaikoToken.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoTokenPausedIterator is returned from FilterPaused and is used to iterate over the raw logs and unpacked data for Paused events raised by the TaikoToken contract. +type TaikoTokenPausedIterator struct { + Event *TaikoTokenPaused // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenPausedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenPaused) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenPaused) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenPausedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenPausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenPaused represents a Paused event raised by the TaikoToken contract. +type TaikoTokenPaused struct { + Account common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterPaused is a free log retrieval operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. +// +// Solidity: event Paused(address account) +func (_TaikoToken *TaikoTokenFilterer) FilterPaused(opts *bind.FilterOpts) (*TaikoTokenPausedIterator, error) { + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "Paused") + if err != nil { + return nil, err + } + return &TaikoTokenPausedIterator{contract: _TaikoToken.contract, event: "Paused", logs: logs, sub: sub}, nil +} + +// WatchPaused is a free log subscription operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. +// +// Solidity: event Paused(address account) +func (_TaikoToken *TaikoTokenFilterer) WatchPaused(opts *bind.WatchOpts, sink chan<- *TaikoTokenPaused) (event.Subscription, error) { + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "Paused") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenPaused) + if err := _TaikoToken.contract.UnpackLog(event, "Paused", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParsePaused is a log parse operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. +// +// Solidity: event Paused(address account) +func (_TaikoToken *TaikoTokenFilterer) ParsePaused(log types.Log) (*TaikoTokenPaused, error) { + event := new(TaikoTokenPaused) + if err := _TaikoToken.contract.UnpackLog(event, "Paused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoTokenSnapshotIterator is returned from FilterSnapshot and is used to iterate over the raw logs and unpacked data for Snapshot events raised by the TaikoToken contract. +type TaikoTokenSnapshotIterator struct { + Event *TaikoTokenSnapshot // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenSnapshotIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenSnapshot) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenSnapshot) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenSnapshotIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenSnapshotIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenSnapshot represents a Snapshot event raised by the TaikoToken contract. +type TaikoTokenSnapshot struct { + Id *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSnapshot is a free log retrieval operation binding the contract event 0x8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb67. +// +// Solidity: event Snapshot(uint256 id) +func (_TaikoToken *TaikoTokenFilterer) FilterSnapshot(opts *bind.FilterOpts) (*TaikoTokenSnapshotIterator, error) { + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "Snapshot") + if err != nil { + return nil, err + } + return &TaikoTokenSnapshotIterator{contract: _TaikoToken.contract, event: "Snapshot", logs: logs, sub: sub}, nil +} + +// WatchSnapshot is a free log subscription operation binding the contract event 0x8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb67. +// +// Solidity: event Snapshot(uint256 id) +func (_TaikoToken *TaikoTokenFilterer) WatchSnapshot(opts *bind.WatchOpts, sink chan<- *TaikoTokenSnapshot) (event.Subscription, error) { + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "Snapshot") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenSnapshot) + if err := _TaikoToken.contract.UnpackLog(event, "Snapshot", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseSnapshot is a log parse operation binding the contract event 0x8030e83b04d87bef53480e26263266d6ca66863aa8506aca6f2559d18aa1cb67. +// +// Solidity: event Snapshot(uint256 id) +func (_TaikoToken *TaikoTokenFilterer) ParseSnapshot(log types.Log) (*TaikoTokenSnapshot, error) { + event := new(TaikoTokenSnapshot) + if err := _TaikoToken.contract.UnpackLog(event, "Snapshot", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoTokenTransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the TaikoToken contract. +type TaikoTokenTransferIterator struct { + Event *TaikoTokenTransfer // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenTransferIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenTransfer) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenTransferIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenTransferIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenTransfer represents a Transfer event raised by the TaikoToken contract. +type TaikoTokenTransfer struct { + From common.Address + To common.Address + Value *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_TaikoToken *TaikoTokenFilterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*TaikoTokenTransferIterator, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return &TaikoTokenTransferIterator{contract: _TaikoToken.contract, event: "Transfer", logs: logs, sub: sub}, nil +} + +// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_TaikoToken *TaikoTokenFilterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *TaikoTokenTransfer, from []common.Address, to []common.Address) (event.Subscription, error) { + + var fromRule []interface{} + for _, fromItem := range from { + fromRule = append(fromRule, fromItem) + } + var toRule []interface{} + for _, toItem := range to { + toRule = append(toRule, toItem) + } + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "Transfer", fromRule, toRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenTransfer) + if err := _TaikoToken.contract.UnpackLog(event, "Transfer", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. +// +// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) +func (_TaikoToken *TaikoTokenFilterer) ParseTransfer(log types.Log) (*TaikoTokenTransfer, error) { + event := new(TaikoTokenTransfer) + if err := _TaikoToken.contract.UnpackLog(event, "Transfer", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TaikoTokenUnpausedIterator is returned from FilterUnpaused and is used to iterate over the raw logs and unpacked data for Unpaused events raised by the TaikoToken contract. +type TaikoTokenUnpausedIterator struct { + Event *TaikoTokenUnpaused // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *TaikoTokenUnpausedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(TaikoTokenUnpaused) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(TaikoTokenUnpaused) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *TaikoTokenUnpausedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TaikoTokenUnpausedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TaikoTokenUnpaused represents a Unpaused event raised by the TaikoToken contract. +type TaikoTokenUnpaused struct { + Account common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUnpaused is a free log retrieval operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. +// +// Solidity: event Unpaused(address account) +func (_TaikoToken *TaikoTokenFilterer) FilterUnpaused(opts *bind.FilterOpts) (*TaikoTokenUnpausedIterator, error) { + + logs, sub, err := _TaikoToken.contract.FilterLogs(opts, "Unpaused") + if err != nil { + return nil, err + } + return &TaikoTokenUnpausedIterator{contract: _TaikoToken.contract, event: "Unpaused", logs: logs, sub: sub}, nil +} + +// WatchUnpaused is a free log subscription operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. +// +// Solidity: event Unpaused(address account) +func (_TaikoToken *TaikoTokenFilterer) WatchUnpaused(opts *bind.WatchOpts, sink chan<- *TaikoTokenUnpaused) (event.Subscription, error) { + + logs, sub, err := _TaikoToken.contract.WatchLogs(opts, "Unpaused") + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(TaikoTokenUnpaused) + if err := _TaikoToken.contract.UnpackLog(event, "Unpaused", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseUnpaused is a log parse operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. +// +// Solidity: event Unpaused(address account) +func (_TaikoToken *TaikoTokenFilterer) ParseUnpaused(log types.Log) (*TaikoTokenUnpaused, error) { + event := new(TaikoTokenUnpaused) + if err := _TaikoToken.contract.UnpackLog(event, "Unpaused", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/cmd/flags/proposer.go b/cmd/flags/proposer.go index db3792255..a74235923 100644 --- a/cmd/flags/proposer.go +++ b/cmd/flags/proposer.go @@ -18,6 +18,22 @@ var ( Required: true, Category: proposerCategory, } + ProverEndpoints = &cli.StringFlag{ + Name: "proverEndpoints", + Usage: "Comma-delinated list of prover endpoints proposer should query when attemping to propose a block", + Category: proposerCategory, + } + BlockProposalFee = &cli.StringFlag{ + Name: "blockProposalFee", + Usage: "Initial block proposal fee (in wei) paid on block proposing", + Category: proposerCategory, + } + TaikoTokenAddress = &cli.StringFlag{ + Name: "taikoToken", + Usage: "TaikoToken contract address", + Required: true, + Category: proposerCategory, + } ) // Optional flags used by proposer. @@ -64,6 +80,18 @@ var ( Usage: "Gas tip cap (in wei) for a TaikoL1.proposeBlock transaction when doing the transaction replacement", Category: proposerCategory, } + BlockProposalFeeIncreasePercentage = &cli.Uint64Flag{ + Name: "blockProposalFeeIncreasePercentage", + Usage: "Increase fee by what percentage when no prover wants to accept the block at initial fee", + Category: proposerCategory, + Value: 10, + } + BlockProposalFeeIterations = &cli.Uint64Flag{ + Name: "blockProposalFeeIterations", + Usage: "If nobody accepts block at initial fee, how many iterations to increase fee before giving up", + Category: proposerCategory, + Value: 3, + } ) // All proposer flags. @@ -79,4 +107,9 @@ var ProposerFlags = MergeFlags(CommonFlags, []cli.Flag{ ProposeBlockTxGasLimit, ProposeBlockTxReplacementMultiplier, ProposeBlockTxGasTipCap, + ProverEndpoints, + BlockProposalFee, + BlockProposalFeeIncreasePercentage, + BlockProposalFeeIterations, + TaikoTokenAddress, }) diff --git a/cmd/flags/prover.go b/cmd/flags/prover.go index 6d70e2d01..ac62e7629 100644 --- a/cmd/flags/prover.go +++ b/cmd/flags/prover.go @@ -25,6 +25,12 @@ var ( Required: true, Category: proverCategory, } + MinProofFee = &cli.StringFlag{ + Name: "prover.minProofFee", + Usage: "Minimum accepted fee for accepting proving a block", + Required: true, + Category: proverCategory, + } ) // Optional flags used by prover. @@ -81,12 +87,6 @@ var ( Category: proverCategory, Value: "", } - TaikoProverPoolL1Address = &cli.StringFlag{ - Name: "taikoProverPoolL1", - Usage: "TaikoProverPoolL1 contract address", - Required: true, - Category: proverCategory, - } CheckProofWindowExpiredInterval = &cli.Uint64Flag{ Name: "prover.checkProofWindowExpiredInterval", Usage: "Interval in seconds to check for expired proof windows from other provers", @@ -104,6 +104,17 @@ var ( Usage: "Gas limit will be used for TaikoL1.proveBlock transactions", Category: proverCategory, } + ProverHTTPServerPort = &cli.Uint64Flag{ + Name: "prover.httpServerPort", + Usage: "Port to expose for http server", + Category: proverCategory, + Value: 9876, + } + ProverCapacity = &cli.Uint64Flag{ + Name: "prover.capacity", + Usage: "Capacity of prover, required if oracleProver is false", + Category: proverCategory, + } ) // All prover flags. @@ -123,8 +134,10 @@ var ProverFlags = MergeFlags(CommonFlags, []cli.Flag{ OracleProofSubmissionDelay, ProofSubmissionMaxRetry, Graffiti, - TaikoProverPoolL1Address, CheckProofWindowExpiredInterval, ProveUnassignedBlocks, ProveBlockTxGasLimit, + ProverHTTPServerPort, + ProverCapacity, + MinProofFee, }) diff --git a/cmd/utils/sub_command.go b/cmd/utils/sub_command.go index 5a8722e90..3b35e12d8 100644 --- a/cmd/utils/sub_command.go +++ b/cmd/utils/sub_command.go @@ -16,7 +16,7 @@ type SubcommandApplication interface { InitFromCli(context.Context, *cli.Context) error Name() string Start() error - Close() + Close(context.Context) } func SubcommandAction(app SubcommandApplication) cli.ActionFunc { @@ -44,7 +44,7 @@ func SubcommandAction(app SubcommandApplication) cli.ActionFunc { defer func() { ctxClose() - app.Close() + app.Close(ctx) log.Info("Application stopped", "name", app.Name()) }() diff --git a/driver/chain_syncer/calldata/syncer.go b/driver/chain_syncer/calldata/syncer.go index ff6a1c204..5f618c6b8 100644 --- a/driver/chain_syncer/calldata/syncer.go +++ b/driver/chain_syncer/calldata/syncer.go @@ -25,6 +25,11 @@ import ( txListValidator "github.com/taikoxyz/taiko-client/pkg/tx_list_validator" ) +var ( + // Brecht recommends to hardcore 79, may be unrequired as proof system changes + defaultMaxTxPerBlock = uint64(79) +) + // Syncer responsible for letting the L2 execution engine catching up with protocol's latest // pending block through deriving L1 calldata. type Syncer struct { @@ -65,8 +70,8 @@ func NewSyncer( anchorConstructor: constructor, txListValidator: txListValidator.NewTxListValidator( uint64(configs.BlockMaxGasLimit), - configs.BlockMaxTransactions, - configs.BlockMaxTxListBytes, + defaultMaxTxPerBlock, + configs.BlockMaxTxListBytes.Uint64(), rpc.L2ChainID, ), }, nil @@ -426,7 +431,6 @@ func (s *Syncer) createExecutionPayloads( Timestamp: event.Meta.Timestamp, TxList: txListBytes, MixHash: event.Meta.MixHash, - Treasury: event.Meta.Treasury, }, BaseFeePerGas: baseFee, L1Origin: l1Origin, diff --git a/driver/chain_syncer/calldata/syncer_test.go b/driver/chain_syncer/calldata/syncer_test.go index 6eb3793d4..fb6ac7ace 100644 --- a/driver/chain_syncer/calldata/syncer_test.go +++ b/driver/chain_syncer/calldata/syncer_test.go @@ -2,6 +2,7 @@ package calldata import ( "context" + "fmt" "math/big" "math/rand" "os" @@ -16,18 +17,23 @@ import ( "github.com/taikoxyz/taiko-client/driver/chain_syncer/beaconsync" "github.com/taikoxyz/taiko-client/driver/state" "github.com/taikoxyz/taiko-client/proposer" + "github.com/taikoxyz/taiko-client/prover/http" "github.com/taikoxyz/taiko-client/testutils" ) type CalldataSyncerTestSuite struct { testutils.ClientTestSuite - s *Syncer - p testutils.Proposer + s *Syncer + p testutils.Proposer + srv *http.Server + cancel context.CancelFunc } func (s *CalldataSyncerTestSuite) SetupTest() { s.ClientTestSuite.SetupTest() + port := testutils.RandomPort() + state, err := state.New(context.Background(), s.RpcClient) s.Nil(err) @@ -50,16 +56,27 @@ func (s *CalldataSyncerTestSuite) SetupTest() { L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), + TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), L1ProposerPrivKey: l1ProposerPrivKey, L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), ProposeInterval: &proposeInterval, MaxProposedTxListsPerEpoch: 1, WaitReceiptTimeout: 10 * time.Second, + ProverEndpoints: []string{fmt.Sprintf("http://localhost:%v", port)}, + BlockProposalFee: big.NewInt(1000), + BlockProposalFeeIterations: 3, }))) + srv, cancel, err := testutils.HTTPServer(&s.ClientTestSuite, port) + s.Nil(err) + + s.srv = srv + s.cancel = cancel + s.p = prop } func (s *CalldataSyncerTestSuite) TestCancelNewSyncer() { + defer s.cancel() ctx, cancel := context.WithCancel(context.Background()) cancel() syncer, err := NewSyncer( @@ -74,12 +91,14 @@ func (s *CalldataSyncerTestSuite) TestCancelNewSyncer() { } func (s *CalldataSyncerTestSuite) TestProcessL1Blocks() { + defer s.cancel() head, err := s.s.rpc.L1.HeaderByNumber(context.Background(), nil) s.Nil(err) s.Nil(s.s.ProcessL1Blocks(context.Background(), head)) } func (s *CalldataSyncerTestSuite) TestProcessL1BlocksReorg() { + defer s.cancel() head, err := s.s.rpc.L1.HeaderByNumber(context.Background(), nil) testutils.ProposeAndInsertEmptyBlocks(&s.ClientTestSuite, s.p, s.s) s.Nil(err) @@ -87,6 +106,7 @@ func (s *CalldataSyncerTestSuite) TestProcessL1BlocksReorg() { } func (s *CalldataSyncerTestSuite) TestOnBlockProposed() { + defer s.cancel() s.Nil(s.s.onBlockProposed( context.Background(), &bindings.TaikoL1ClientBlockProposed{BlockId: common.Big0}, @@ -100,6 +120,7 @@ func (s *CalldataSyncerTestSuite) TestOnBlockProposed() { } func (s *CalldataSyncerTestSuite) TestInsertNewHead() { + defer s.cancel() parent, err := s.s.rpc.L2.HeaderByNumber(context.Background(), nil) s.Nil(err) l1Head, err := s.s.rpc.L1.BlockByNumber(context.Background(), nil) @@ -117,7 +138,6 @@ func (s *CalldataSyncerTestSuite) TestInsertNewHead() { MixHash: testutils.RandomHash(), GasLimit: rand.Uint32(), Timestamp: uint64(time.Now().Unix()), - Treasury: s.TestAddr, }, }, parent, @@ -133,6 +153,7 @@ func (s *CalldataSyncerTestSuite) TestInsertNewHead() { } func (s *CalldataSyncerTestSuite) TestTreasuryIncomeAllAnchors() { + defer s.cancel() treasury := common.HexToAddress(os.Getenv("TREASURY")) s.NotZero(treasury.Big().Uint64()) @@ -155,6 +176,7 @@ func (s *CalldataSyncerTestSuite) TestTreasuryIncomeAllAnchors() { } func (s *CalldataSyncerTestSuite) TestTreasuryIncome() { + defer s.cancel() treasury := common.HexToAddress(os.Getenv("TREASURY")) s.NotZero(treasury.Big().Uint64()) diff --git a/driver/chain_syncer/chain_syncer_test.go b/driver/chain_syncer/chain_syncer_test.go index 31395ad70..39cd092cc 100644 --- a/driver/chain_syncer/chain_syncer_test.go +++ b/driver/chain_syncer/chain_syncer_test.go @@ -2,6 +2,8 @@ package chainSyncer import ( "context" + "fmt" + "math/big" "os" "testing" @@ -15,6 +17,7 @@ import ( "github.com/taikoxyz/taiko-client/driver/state" "github.com/taikoxyz/taiko-client/pkg/rpc" "github.com/taikoxyz/taiko-client/proposer" + "github.com/taikoxyz/taiko-client/prover/http" "github.com/taikoxyz/taiko-client/testutils" ) @@ -23,11 +26,15 @@ type ChainSyncerTestSuite struct { s *L2ChainSyncer snapshotID string p testutils.Proposer + srv *http.Server + cancel func() } func (s *ChainSyncerTestSuite) SetupTest() { s.ClientTestSuite.SetupTest() + port := testutils.RandomPort() + state, err := state.New(context.Background(), s.RpcClient) s.Nil(err) @@ -51,13 +58,23 @@ func (s *ChainSyncerTestSuite) SetupTest() { L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), + TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), L1ProposerPrivKey: l1ProposerPrivKey, L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), ProposeInterval: &proposeInterval, MaxProposedTxListsPerEpoch: 1, WaitReceiptTimeout: 10 * time.Second, + ProverEndpoints: []string{fmt.Sprintf("http://localhost:%v", port)}, + BlockProposalFee: big.NewInt(1000), + BlockProposalFeeIterations: 3, }))) + srv, srvCancel, err := testutils.HTTPServer(&s.ClientTestSuite, port) + s.Nil(err) + + s.srv = srv + s.cancel = srvCancel + s.p = prop } @@ -110,7 +127,7 @@ func (s *ChainSyncerTestSuite) TestAheadOfProtocolVerifiedHead2() { log.Info("evm time increase:", "number", result) // interact with TaikoL1 contract to allow for verification of L2 blocks - tx, err := s.s.rpc.TaikoL1.VerifyBlocks(opts, common.Big3) + tx, err := s.s.rpc.TaikoL1.VerifyBlocks(opts, uint64(3)) s.Nil(err) s.NotNil(tx) diff --git a/driver/driver.go b/driver/driver.go index b85f4db5d..1a720ac47 100644 --- a/driver/driver.go +++ b/driver/driver.go @@ -121,7 +121,7 @@ func (d *Driver) Start() error { } // Close closes the driver instance. -func (d *Driver) Close() { +func (d *Driver) Close(ctx context.Context) { d.state.Close() d.wg.Wait() } @@ -205,7 +205,7 @@ func (d *Driver) reportProtocolStatus() { return err } - maxNumBlocks = configs.BlockMaxProposals.Uint64() + maxNumBlocks = configs.BlockMaxProposals return nil }, backoff.NewConstantBackOff(d.backOffRetryInterval), diff --git a/driver/driver_test.go b/driver/driver_test.go index 536b8580d..925f32702 100644 --- a/driver/driver_test.go +++ b/driver/driver_test.go @@ -2,6 +2,7 @@ package driver import ( "context" + "fmt" "math/big" "os" "testing" @@ -14,6 +15,7 @@ import ( "github.com/taikoxyz/taiko-client/driver/state" "github.com/taikoxyz/taiko-client/pkg/jwt" "github.com/taikoxyz/taiko-client/proposer" + "github.com/taikoxyz/taiko-client/prover/http" "github.com/taikoxyz/taiko-client/testutils" ) @@ -22,11 +24,14 @@ type DriverTestSuite struct { cancel context.CancelFunc p *proposer.Proposer d *Driver + srv *http.Server } func (s *DriverTestSuite) SetupTest() { s.ClientTestSuite.SetupTest() + port := testutils.RandomPort() + // Init driver jwtSecret, err := jwt.ParseSecretFromFile(os.Getenv("JWT_SECRET")) s.Nil(err) @@ -34,7 +39,6 @@ func (s *DriverTestSuite) SetupTest() { d := new(Driver) ctx, cancel := context.WithCancel(context.Background()) - s.cancel = cancel s.Nil(InitFromConfig(ctx, d, &Config{ L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), @@ -57,13 +61,26 @@ func (s *DriverTestSuite) SetupTest() { L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), + TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), L1ProposerPrivKey: l1ProposerPrivKey, L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), ProposeInterval: &proposeInterval, // No need to periodically propose transactions list in unit tests MaxProposedTxListsPerEpoch: 1, WaitReceiptTimeout: 10 * time.Second, + ProverEndpoints: []string{fmt.Sprintf("http://localhost:%v", port)}, + BlockProposalFee: big.NewInt(1000), + BlockProposalFeeIterations: 3, }))) s.p = p + + srv, srvCancel, err := testutils.HTTPServer(&s.ClientTestSuite, port) + s.Nil(err) + + s.srv = srv + s.cancel = func() { + cancel() + srvCancel() + } } func (s *DriverTestSuite) TestName() { @@ -293,7 +310,7 @@ func (s *DriverTestSuite) TestDoSyncNoNewL2Blocks() { func (s *DriverTestSuite) TestStartClose() { s.Nil(s.d.Start()) s.cancel() - s.d.Close() + s.d.Close(context.Background()) } func (s *DriverTestSuite) TestL1Current() { diff --git a/driver/state/state.go b/driver/state/state.go index 8642a776d..91e3745d8 100644 --- a/driver/state/state.go +++ b/driver/state/state.go @@ -135,7 +135,7 @@ func (s *State) init(ctx context.Context) error { latestVerifiedBlockHash, err := s.rpc.TaikoL1.GetCrossChainBlockHash( &bind.CallOpts{Context: ctx}, - new(big.Int).SetUint64(stateVars.LastVerifiedBlockId), + stateVars.LastVerifiedBlockId, ) if err != nil { return err @@ -172,12 +172,12 @@ func (s *State) startSubscriptions(ctx context.Context) { log.Info("✅ Block proven", "blockID", e.BlockId, "hash", common.Hash(e.BlockHash), "prover", e.Prover) } case e := <-s.blockVerifiedCh: - log.Info("📈 Block verified", "blockID", e.BlockId, "hash", common.Hash(e.BlockHash), "reward", e.ProofReward) + log.Info("📈 Block verified", "blockID", e.BlockId, "hash", common.Hash(e.BlockHash), "prover", e.Prover) case e := <-s.crossChainSynced: // Verify the protocol synced block, check if it exists in // L2 execution engine. - if s.GetL2Head().Number.Cmp(e.SrcHeight) >= 0 { - if err := s.VerifyL2Block(ctx, e.SrcHeight, e.BlockHash); err != nil { + if s.GetL2Head().Number.Uint64() >= e.SrcHeight { + if err := s.VerifyL2Block(ctx, new(big.Int).SetUint64(e.SrcHeight), e.BlockHash); err != nil { log.Error("Check new verified L2 block error", "error", err) continue } @@ -187,7 +187,7 @@ func (s *State) startSubscriptions(ctx context.Context) { log.Error("Get synced header block ID error", "error", err) continue } - s.setLatestVerifiedBlockHash(id, e.SrcHeight, e.BlockHash) + s.setLatestVerifiedBlockHash(id, new(big.Int).SetUint64(e.SrcHeight), e.BlockHash) case newHead := <-s.l1HeadCh: s.setL1Head(newHead) s.l1HeadsFeed.Send(newHead) @@ -294,7 +294,7 @@ func (s *State) getSyncedHeaderID(ctx context.Context, l1Height uint64, hash com Start: l1Height, End: &l1Height, Context: ctx, - }, nil) + }, nil, nil) if err != nil { return nil, fmt.Errorf("failed to filter BlockVerified event: %w", err) } diff --git a/go.mod b/go.mod index 073c7a98b..5b32e6115 100644 --- a/go.mod +++ b/go.mod @@ -5,8 +5,12 @@ go 1.18 require ( github.com/btcsuite/btcd/btcec/v2 v2.3.2 github.com/cenkalti/backoff/v4 v4.1.3 + github.com/cyberhorsey/webutils v0.0.0-20230314183728-56890c6ddbe7 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 github.com/ethereum/go-ethereum v1.12.2 + github.com/labstack/echo/v4 v4.11.1 + github.com/labstack/gommon v0.4.0 + github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5 github.com/prysmaticlabs/prysm/v4 v4.0.1 github.com/stretchr/testify v1.8.1 github.com/urfave/cli/v2 v2.24.1 @@ -16,6 +20,7 @@ require ( require ( github.com/DataDog/zstd v1.5.2 // indirect github.com/VictoriaMetrics/fastcache v1.12.0 // indirect + github.com/aymerick/douceur v0.2.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bits-and-blooms/bitset v1.7.0 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 // indirect @@ -28,19 +33,25 @@ require ( github.com/consensys/gnark-crypto v0.10.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/crate-crypto/go-kzg-4844 v0.3.0 // indirect + github.com/cyberhorsey/errors v0.0.0-20220929234051-087d6d8bb841 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/deckarep/golang-set/v2 v2.1.0 // indirect github.com/ethereum/c-kzg-4844 v0.3.1 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/getsentry/sentry-go v0.18.0 // indirect github.com/go-ole/go-ole v1.2.6 // indirect + github.com/go-playground/locales v0.14.0 // indirect + github.com/go-playground/universal-translator v0.18.0 // indirect + github.com/go-playground/validator/v10 v10.11.1 // indirect github.com/go-stack/stack v1.8.1 // indirect github.com/gofrs/flock v0.8.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt/v4 v4.3.0 // indirect + github.com/golang-jwt/jwt v3.2.2+incompatible // indirect + github.com/golang-jwt/jwt/v4 v4.4.3 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/uuid v1.3.0 // indirect + github.com/gorilla/css v1.0.0 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/holiman/uint256 v1.2.3 // indirect @@ -50,12 +61,17 @@ require ( github.com/klauspost/cpuid/v2 v2.2.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect + github.com/leodido/go-urn v1.2.1 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect github.com/mattn/go-runewidth v0.0.14 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect + github.com/microcosm-cc/bluemonday v1.0.21 // indirect github.com/minio/sha256-simd v1.0.0 // indirect github.com/mitchellh/mapstructure v1.4.1 // indirect github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect + github.com/neko-neko/echo-logrus/v2 v2.0.1 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect @@ -75,12 +91,17 @@ require ( github.com/thomaso-mirodin/intmath v0.0.0-20160323211736-5dc6d854e46e // indirect github.com/tklauser/go-sysconf v0.3.11 // indirect github.com/tklauser/numcpus v0.6.0 // indirect + github.com/valyala/bytebufferpool v1.0.0 // indirect + github.com/valyala/fasttemplate v1.2.2 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect - golang.org/x/crypto v0.9.0 // indirect + golang.org/x/crypto v0.11.0 // indirect golang.org/x/exp v0.0.0-20230810033253-352e893a4cad // indirect - golang.org/x/sys v0.9.0 // indirect - golang.org/x/text v0.9.0 // indirect + golang.org/x/net v0.12.0 // indirect + golang.org/x/sys v0.10.0 // indirect + golang.org/x/text v0.11.0 // indirect + golang.org/x/time v0.3.0 // indirect + google.golang.org/grpc v1.40.0 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index 16bea8d6b..5c5ff3d39 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,5 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= @@ -6,13 +7,17 @@ github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMd github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0= github.com/VictoriaMetrics/fastcache v1.12.0 h1:vnVi/y9yKDcD9akmc4NqAoqgQhJrOwUF+j9LTgn4QDE= github.com/VictoriaMetrics/fastcache v1.12.0/go.mod h1:tjiYeEfYXCqacuvYw/7UoDIeJaNxq6132xHICNP77w8= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= +github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/bazelbuild/rules_go v0.23.2 h1:Wxu7JjqnF78cKZbsBsARLSXx/jlGaSLCnUV3mTlyHvM= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -27,14 +32,18 @@ github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8 github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/cp v1.1.1 h1:nCb6ZLdB7NRaqsm91JtQTAme2SKJzXVsdPIPkyJr1MU= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chris-ramon/douceur v0.2.0/go.mod h1:wDW5xjJdeoMm1mRt4sD4c/LbF/mWdEpRXQKjTR8nIBE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v1.0.2 h1:H9MtNqVoVhvd9nCBwOyDjUEdZCREqbIdCJD93PBm/jA= github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.9.1 h1:yFVvsI0VxmRShfawbt/laCIDy/mtTqqnvoNgiy5bEV8= @@ -60,6 +69,10 @@ github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t github.com/crate-crypto/go-kzg-4844 v0.3.0 h1:UBlWE0CgyFqqzTI+IFyCzA7A3Zw4iip6uzRv5NIXG0A= github.com/crate-crypto/go-kzg-4844 v0.3.0/go.mod h1:SBP7ikXEgDnUPONgm33HtuDZEDtWa3L4QtN1ocJSEQ4= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/cyberhorsey/errors v0.0.0-20220929234051-087d6d8bb841 h1:FaPua89k9KmkkiptlTAmYzcTsn1IFdQsqneuFO6IAu8= +github.com/cyberhorsey/errors v0.0.0-20220929234051-087d6d8bb841/go.mod h1:qSH/IvpdArCjfny4ODMko/7U0z4JoNIWctgCnUrapnI= +github.com/cyberhorsey/webutils v0.0.0-20230314183728-56890c6ddbe7 h1:KYOh2RfWAltxYsfD/Ar5D3zB4+AuNQejXW5BvMlGor4= +github.com/cyberhorsey/webutils v0.0.0-20230314183728-56890c6ddbe7/go.mod h1:bNNUHadsCy1HleNUToQ/t11vmKI9/+9Taw8K6GyxERo= github.com/d4l3k/messagediff v1.2.1 h1:ZcAIMYsUg0EAp9X+tt8/enBE/Q8Yd5kzPynLyKptt9U= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -70,12 +83,16 @@ github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/ethereum/c-kzg-4844 v0.3.1 h1:sR65+68+WdnMKxseNWxSJuAv2tsUrihTpVBTfM/U5Zg= @@ -93,6 +110,7 @@ github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08 h1:f6D9Hr8x github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c= github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0= github.com/getsentry/sentry-go v0.18.0/go.mod h1:Kgon4Mby+FJ7ZWHFUAZgVaIa8sxHtnRJRLTXZr51aKQ= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= @@ -101,6 +119,17 @@ github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxI github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= +github.com/go-playground/validator/v10 v10.4.0/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= +github.com/go-playground/validator/v10 v10.11.1/go.mod h1:i+3WkQ1FvaUjjxh1kSvIA4dMGDBiPU55YFDl0WbKdWU= github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= @@ -115,14 +144,16 @@ github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= +github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= -github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-jwt/jwt/v4 v4.4.3 h1:Hxl6lhQFj4AnOX6MLrsCb/+7tCj7DxP7VA+2rDIq5AU= +github.com/golang-jwt/jwt/v4 v4.4.3/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -131,6 +162,7 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= @@ -153,9 +185,12 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= +github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= @@ -198,7 +233,9 @@ github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgo github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= @@ -207,20 +244,36 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/labstack/echo/v4 v4.0.0/go.mod h1:tZv7nai5buKSg5h/8E6zz4LsD/Dqh9/91Mvs7Z5Zyno= +github.com/labstack/echo/v4 v4.1.15/go.mod h1:GWO5IBVzI371K8XJe50CSvHjQCafK6cw8R/moLhEU6o= github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y= +github.com/labstack/echo/v4 v4.11.1 h1:dEpLU2FLg4UVmvCGPuk/APjlH6GDpbEPti61srUUUs4= +github.com/labstack/echo/v4 v4.11.1/go.mod h1:YuYRTSM3CHs2ybfrL8Px48bO6BAnYIN4l8wSTMP6BDQ= +github.com/labstack/gommon v0.2.8/go.mod h1:/tj9csK2iPSBvn+3NLM9e52usepMtrd5ilFYA+wQNJ4= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= +github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8= +github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= @@ -229,6 +282,9 @@ github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zk github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= +github.com/microcosm-cc/bluemonday v1.0.4/go.mod h1:8iwZnFn2CDDNZ0r6UXhF4xawGvzaqzCRa1n3/lO3W2w= +github.com/microcosm-cc/bluemonday v1.0.21 h1:dNH3e4PSyE4vNX+KlRGHT5KrSvjeUkoNPwEORjffHJg= +github.com/microcosm-cc/bluemonday v1.0.21/go.mod h1:ytNkv4RrDrLJ2pqlsSI46O6IVXmZOBBD4SaJyDwwTkM= github.com/minio/sha256-simd v1.0.0 h1:v1ta+49hkWZyvaKwrQB8elexRqm6Y0aMLjCNsrYxo6g= github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -250,6 +306,8 @@ github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5Vgl github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/neko-neko/echo-logrus/v2 v2.0.1 h1:BX2U6uv2N3UiUY75y+SntQak5S1AJIel9j+5Y6h4Nb4= +github.com/neko-neko/echo-logrus/v2 v2.0.1/go.mod h1:GDYWo9CY4VXk/vn5ac5reoutYEkZEexlFI01MzHXVG0= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= @@ -268,6 +326,8 @@ github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAl github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/onsi/gomega v1.24.0 h1:+0glovB9Jd6z3VR+ScSwQqXVTIfJcGA9UBM8yzQxhqg= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5 h1:Ii+DKncOVM8Cu1Hc+ETb5K+23HdAMvESYE3ZJ5b5cMI= +github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -294,7 +354,9 @@ github.com/prysmaticlabs/prysm/v4 v4.0.1/go.mod h1:EQ8hYKry3NYHGirqLiQh8gXJ/O12d github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw= github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= @@ -308,10 +370,13 @@ github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAm github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= @@ -320,12 +385,14 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= @@ -352,10 +419,15 @@ github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLY github.com/urfave/cli/v2 v2.24.1 h1:/QYYr7g0EhwXEML8jO+8OYt5trPnLHS0p3mrgExJ5NU= github.com/urfave/cli/v2 v2.24.1/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= +github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4/go.mod h1:50wTf68f99/Zt14pr046Tgt3Lp2vLyFZKzbFXTOabXw= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= +github.com/valyala/fasttemplate v1.1.0/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= +github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= @@ -372,16 +444,21 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yusufpapurcu/wmi v1.2.2 h1:KBNDSne4vP5mbSWnJbO+51IMOXJB67QiYCSBrubbPRg= github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190130090550-b01c7a725664/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA= +golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20230810033253-352e893a4cad h1:g0bG7Z4uG+OgH2QDODnjp6ggkk1bJDsINcuWmJN1iJU= golang.org/x/exp v0.0.0-20230810033253-352e893a4cad/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= @@ -397,6 +474,7 @@ golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -407,15 +485,19 @@ golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50= +golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -427,8 +509,10 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -437,6 +521,7 @@ golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -451,8 +536,10 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220405052023-b1e9470b6e64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -460,10 +547,12 @@ golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.9.0 h1:KS/R3tvhPqvJvwcKfnBHJwwthS11LRhmM5D59eEXa0s= -golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= +golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -472,10 +561,11 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= +golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -500,14 +590,21 @@ google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84 h1:R1r5J0u6Cx+RNl/6mezTw6oA14cmKC96FeUwL6A9bd4= google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.40.0 h1:AGJ0Ih4mHjSeibYkFGh1dD9KJ/eOtZ93I6hoHhukQ5Q= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -525,6 +622,7 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= @@ -537,6 +635,7 @@ gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHN gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= diff --git a/integration_test/entrypoint.sh b/integration_test/entrypoint.sh index 65c02abc0..1cff94c06 100755 --- a/integration_test/entrypoint.sh +++ b/integration_test/entrypoint.sh @@ -19,17 +19,18 @@ fi TESTNET_CONFIG=$DIR/nodes/docker-compose.yml COMPILE_PROTOCOL=${COMPILE_PROTOCOL:-false} +PREMINT_TOKEN_AMOUNT=92233720368547758070000000000000 TESTNET_CONFIG=$TESTNET_CONFIG \ COMPILE_PROTOCOL=$COMPILE_PROTOCOL \ TAIKO_MONO_DIR=$TAIKO_MONO_DIR \ -$DIR/nodes/init.sh +PREMINT_TOKEN_AMOUNT=$PREMINT_TOKEN_AMOUNT \ + $DIR/nodes/init.sh DEPLOYMENT_JSON=$(cat $TAIKO_MONO_DIR/packages/protocol/deployments/deploy_l1.json) TAIKO_L1_CONTRACT_ADDRESS=$(echo $DEPLOYMENT_JSON | jq '.taiko' | sed 's/\"//g') -TAIKO_PROVER_POOL_L1_CONTRACT_ADDRESS=$(echo $DEPLOYMENT_JSON | jq '.prover_pool' | sed 's/\"//g') -TAIKO_TOKEN_L1_CONTRACT_ADDRESS=$(echo $DEPLOYMENT_JSON | jq '.taiko_token' | sed 's/\"//g') L1_SIGNAL_SERVICE_CONTRACT_ADDRESS=$(echo $DEPLOYMENT_JSON | jq '.signal_service' | sed 's/\"//g') +TAIKO_TOKEN_CONTRACT_ADDRESS=$(echo $DEPLOYMENT_JSON | jq '.taiko_token' | sed 's/\"//g') trap "docker compose -f $TESTNET_CONFIG down -v" EXIT INT KILL ERR @@ -37,6 +38,7 @@ RUN_TESTS=${RUN_TESTS:-false} PACKAGE=${PACKAGE:-...} echo "TAIKO_L1_CONTRACT_ADDRESS: $TAIKO_L1_CONTRACT_ADDRESS" +echo "TAIKO_TOKEN_CONTRACT_ADDRESS: $TAIKO_TOKEN_CONTRACT_ADDRESS" echo "L1_SIGNAL_SERVICE_CONTRACT_ADDRESS: $L1_SIGNAL_SERVICE_CONTRACT_ADDRESS" if [ "$RUN_TESTS" == "true" ]; then @@ -46,15 +48,15 @@ if [ "$RUN_TESTS" == "true" ]; then L2_EXECUTION_ENGINE_WS_ENDPOINT=ws://localhost:28546 \ L2_EXECUTION_ENGINE_AUTH_ENDPOINT=http://localhost:28551 \ TAIKO_L1_ADDRESS=$TAIKO_L1_CONTRACT_ADDRESS \ - TAIKO_PROVER_POOL_L1_ADDRESS=$TAIKO_PROVER_POOL_L1_CONTRACT_ADDRESS \ - TAIKO_TOKEN_L1_ADDRESS=$TAIKO_TOKEN_L1_CONTRACT_ADDRESS \ TAIKO_L2_ADDRESS=0x1000777700000000000000000000000000000001 \ + TAIKO_TOKEN_ADDRESS=$TAIKO_TOKEN_CONTRACT_ADDRESS \ L1_SIGNAL_SERVICE_CONTRACT_ADDRESS=$L1_SIGNAL_SERVICE_CONTRACT_ADDRESS \ L1_CONTRACT_OWNER_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ L1_PROPOSER_PRIVATE_KEY=ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ L2_SUGGESTED_FEE_RECIPIENT=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 \ L1_PROVER_PRIVATE_KEY=59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d \ TREASURY=0xdf09A0afD09a63fb04ab3573922437e1e637dE8b \ + PREMINT_TOKEN_AMOUNT=$PREMINT_TOKEN_AMOUNT \ JWT_SECRET=$DIR/nodes/jwt.hex \ go test -v -p=1 ./$PACKAGE -coverprofile=coverage.out -covermode=atomic -timeout=300s else diff --git a/integration_test/nodes/init.sh b/integration_test/nodes/init.sh index c9f903b4c..d5748ce5a 100755 --- a/integration_test/nodes/init.sh +++ b/integration_test/nodes/init.sh @@ -44,7 +44,7 @@ cd $TAIKO_MONO_DIR/packages/protocol && L2_SIGNAL_SERVICE=0x1000777700000000000000000000000000000007 \ SHARED_SIGNAL_SERVICE=0x0000000000000000000000000000000000000000 \ TAIKO_TOKEN_PREMINT_RECIPIENTS=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266,0x70997970C51812dc3A010C7d01b50e0d17dc79C8 \ - TAIKO_TOKEN_PREMINT_AMOUNTS=9223372036854775807,9223372036854775807 \ + TAIKO_TOKEN_PREMINT_AMOUNTS=$PREMINT_TOKEN_AMOUNT,$PREMINT_TOKEN_AMOUNT \ L2_GENESIS_HASH=$L2_GENESIS_HASH \ L2_CHAIN_ID=167001 \ forge script script/DeployOnL1.s.sol:DeployOnL1 \ diff --git a/metrics/metrics.go b/metrics/metrics.go index 7583afa4b..1ee8a68b3 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -41,12 +41,8 @@ var ( ProverSentValidProofCounter = metrics.NewRegisteredCounter("prover/proof/valid/sent", nil) ProverSentInvalidProofCounter = metrics.NewRegisteredCounter("prover/proof/invalid/sent", nil) ProverProofsAssigned = metrics.NewRegisteredCounter("prover/proof/assigned", nil) - ProverSlashedCounter = metrics.NewRegisteredCounter("prover/slashed", nil) - ProverSlashedAmount = metrics.NewRegisteredCounter("prover/slashed/amount", nil) ProverReceivedProposedBlockGauge = metrics.NewRegisteredGauge("prover/proposed/received", nil) ProverReceivedProvenBlockGauge = metrics.NewRegisteredGauge("prover/proven/received", nil) - ProverProofRewardGauge = metrics.NewRegisteredGauge("prover/proofReward", nil) - ProverAllProofRewardGauge = metrics.NewRegisteredGauge("prover/allProofReward", nil) ) // Serve starts the metrics server on the given address, will be closed when the given diff --git a/pkg/rpc/client.go b/pkg/rpc/client.go index 75a640f62..f7e6f8844 100644 --- a/pkg/rpc/client.go +++ b/pkg/rpc/client.go @@ -32,9 +32,9 @@ type Client struct { // Geth Engine API clients L2Engine *EngineClient // Protocol contracts clients - TaikoL1 *bindings.TaikoL1Client - TaikoL2 *bindings.TaikoL2Client - TaikoProverPoolL1 *bindings.TaikoL1ProverPool + TaikoL1 *bindings.TaikoL1Client + TaikoL2 *bindings.TaikoL2Client + TaikoToken *bindings.TaikoToken // Chain IDs L1ChainID *big.Int L2ChainID *big.Int @@ -44,17 +44,17 @@ type Client struct { // RPC client. If not providing L2EngineEndpoint or JwtSecret, then the L2Engine client // won't be initialized. type ClientConfig struct { - L1Endpoint string - L2Endpoint string - L2CheckPoint string - TaikoL1Address common.Address - TaikoProverPoolL1Address common.Address - TaikoL2Address common.Address - L2EngineEndpoint string - JwtSecret string - RetryInterval time.Duration - Timeout *time.Duration - BackOffMaxRetrys *big.Int + L1Endpoint string + L2Endpoint string + L2CheckPoint string + TaikoL1Address common.Address + TaikoL2Address common.Address + TaikoTokenAddress common.Address + L2EngineEndpoint string + JwtSecret string + RetryInterval time.Duration + Timeout *time.Duration + BackOffMaxRetrys *big.Int } // NewClient initializes all RPC clients used by Taiko client softwares. @@ -94,19 +94,19 @@ func NewClient(ctx context.Context, cfg *ClientConfig) (*Client, error) { return nil, err } - var taikoProverPoolL1 *bindings.TaikoL1ProverPool - if cfg.TaikoProverPoolL1Address.Hex() != "" { - taikoProverPoolL1, err = bindings.NewTaikoL1ProverPool(cfg.TaikoProverPoolL1Address, l1RPC) - if err != nil { - return nil, err - } - } - taikoL2, err := bindings.NewTaikoL2Client(cfg.TaikoL2Address, l2RPC) if err != nil { return nil, err } + var taikoToken *bindings.TaikoToken + if cfg.TaikoTokenAddress.Hex() != zeroAddress.Hex() { + taikoToken, err = bindings.NewTaikoToken(cfg.TaikoTokenAddress, l1RPC) + if err != nil { + return nil, err + } + } + stateVars, err := taikoL1.GetStateVariables(&bind.CallOpts{Context: ctxWithTimeout}) if err != nil { return nil, err @@ -175,19 +175,19 @@ func NewClient(ctx context.Context, cfg *ClientConfig) (*Client, error) { } client := &Client{ - L1: l1RPC, - L2: l2RPC, - L2CheckPoint: l2CheckPoint, - L1RawRPC: l1RawRPC, - L2RawRPC: l2RawRPC, - L1GethClient: gethclient.New(l1RawRPC), - L2GethClient: gethclient.New(l2RawRPC), - L2Engine: l2AuthRPC, - TaikoL1: taikoL1, - TaikoL2: taikoL2, - TaikoProverPoolL1: taikoProverPoolL1, - L1ChainID: l1ChainID, - L2ChainID: l2ChainID, + L1: l1RPC, + L2: l2RPC, + L2CheckPoint: l2CheckPoint, + L1RawRPC: l1RawRPC, + L2RawRPC: l2RawRPC, + L1GethClient: gethclient.New(l1RawRPC), + L2GethClient: gethclient.New(l2RawRPC), + L2Engine: l2AuthRPC, + TaikoL1: taikoL1, + TaikoL2: taikoL2, + TaikoToken: taikoToken, + L1ChainID: l1ChainID, + L2ChainID: l2ChainID, } if err := client.ensureGenesisMatched(ctxWithTimeout); err != nil { diff --git a/pkg/rpc/client_test.go b/pkg/rpc/client_test.go index 6ab63bd14..bcb810820 100644 --- a/pkg/rpc/client_test.go +++ b/pkg/rpc/client_test.go @@ -13,14 +13,14 @@ import ( func newTestClient(t *testing.T) *Client { client, err := NewClient(context.Background(), &ClientConfig{ - L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), - L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), - TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), - TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), - TaikoProverPoolL1Address: common.HexToAddress(os.Getenv("TAIKO_PROVER_POOL_L1_ADDRESS")), - L2EngineEndpoint: os.Getenv("L2_EXECUTION_ENGINE_AUTH_ENDPOINT"), - JwtSecret: os.Getenv("JWT_SECRET"), - RetryInterval: backoff.DefaultMaxInterval, + L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), + L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), + TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), + TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), + TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), + L2EngineEndpoint: os.Getenv("L2_EXECUTION_ENGINE_AUTH_ENDPOINT"), + JwtSecret: os.Getenv("JWT_SECRET"), + RetryInterval: backoff.DefaultMaxInterval, }) require.Nil(t, err) @@ -32,15 +32,15 @@ func newTestClient(t *testing.T) *Client { func newTestClientWithTimeout(t *testing.T) *Client { timeout := 5 * time.Second client, err := NewClient(context.Background(), &ClientConfig{ - L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), - L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), - TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), - TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), - TaikoProverPoolL1Address: common.HexToAddress(os.Getenv("TAIKO_PROVER_POOL_L1_ADDRESS")), - L2EngineEndpoint: os.Getenv("L2_EXECUTION_ENGINE_AUTH_ENDPOINT"), - JwtSecret: os.Getenv("JWT_SECRET"), - RetryInterval: backoff.DefaultMaxInterval, - Timeout: &timeout, + L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), + L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), + TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), + TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), + TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), + L2EngineEndpoint: os.Getenv("L2_EXECUTION_ENGINE_AUTH_ENDPOINT"), + JwtSecret: os.Getenv("JWT_SECRET"), + RetryInterval: backoff.DefaultMaxInterval, + Timeout: &timeout, }) require.Nil(t, err) diff --git a/pkg/rpc/methods.go b/pkg/rpc/methods.go index c02ec2155..9e40dc68e 100644 --- a/pkg/rpc/methods.go +++ b/pkg/rpc/methods.go @@ -28,7 +28,7 @@ var ( syncProgressRecheckDelay = 12 * time.Second waitL1OriginPollingInterval = 3 * time.Second defaultWaitL1OriginTimeout = 3 * time.Minute - defaultMaxTransactionsPerBlock = uint64(79) + defaultMaxTransactionsPerBlock = uint64(79) // hardcoded to 79, will need changing when circuits change ) // ensureGenesisMatched fetches the L2 genesis block from TaikoL1 contract, @@ -46,6 +46,7 @@ func (c *Client) ensureGenesisMatched(ctx context.Context) error { iter, err := c.TaikoL1.FilterBlockVerified( &bind.FilterOpts{Start: stateVars.GenesisHeight, End: &stateVars.GenesisHeight, Context: ctxWithTimeout}, []*big.Int{common.Big0}, + nil, ) if err != nil { return err diff --git a/pkg/rpc/methods_test.go b/pkg/rpc/methods_test.go index 58a673181..cb4214ac6 100644 --- a/pkg/rpc/methods_test.go +++ b/pkg/rpc/methods_test.go @@ -124,7 +124,6 @@ func TestGetPoolContentValid(t *testing.T) { require.Nil(t, err) baseFee, err := client.TaikoL2.GetBasefee(nil, 1, uint32(parent.GasUsed())) require.Nil(t, err) - maxTransactions := configs.BlockMaxTransactions gasLimit := configs.BlockMaxGasLimit maxBytes := configs.BlockMaxTxListBytes @@ -135,9 +134,9 @@ func TestGetPoolContentValid(t *testing.T) { goldenTouchAddress, baseFee, gasLimit, - maxBytes, + maxBytes.Uint64(), txPools, - maxTransactions, + defaultMaxTransactionsPerBlock, ) require.Nil(t, err2) } diff --git a/pkg/rpc/subscription.go b/pkg/rpc/subscription.go index 7e2672735..4a8ff8eb2 100644 --- a/pkg/rpc/subscription.go +++ b/pkg/rpc/subscription.go @@ -33,7 +33,7 @@ func SubscribeBlockVerified( ch chan *bindings.TaikoL1ClientBlockVerified, ) event.Subscription { return SubscribeEvent("BlockVerified", func(ctx context.Context) (event.Subscription, error) { - sub, err := taikoL1.WatchBlockVerified(nil, ch, nil) + sub, err := taikoL1.WatchBlockVerified(nil, ch, nil, nil) if err != nil { log.Error("Create TaikoL1.BlockVerified subscription error", "error", err) return nil, err @@ -99,24 +99,6 @@ func SubscribeBlockProven( }) } -// SubscribeSlashed subscribes the prover pool's Slashed events. -func SubscribeSlashed( - taikoProverPool *bindings.TaikoL1ProverPool, - ch chan *bindings.TaikoL1ProverPoolSlashed, -) event.Subscription { - return SubscribeEvent("Slashed", func(ctx context.Context) (event.Subscription, error) { - sub, err := taikoProverPool.WatchSlashed(nil, ch, nil, nil) - if err != nil { - log.Error("Create taikoProverPool.WatchSlashed subscription error", "error", err) - return nil, err - } - - defer sub.Unsubscribe() - - return waitSubErr(ctx, sub) - }) -} - // SubscribeChainHead subscribes the new chain heads. func SubscribeChainHead( client *EthClient, diff --git a/pkg/rpc/subscription_test.go b/pkg/rpc/subscription_test.go index 21f7bfe06..b19483f94 100644 --- a/pkg/rpc/subscription_test.go +++ b/pkg/rpc/subscription_test.go @@ -44,13 +44,6 @@ func TestSubscribeBlockProven(t *testing.T) { ) } -func TestSubscribeSlashed(t *testing.T) { - require.NotNil(t, SubscribeSlashed( - newTestClient(t).TaikoProverPoolL1, - make(chan *bindings.TaikoL1ProverPoolSlashed, 1024)), - ) -} - func TestSubscribeChainHead(t *testing.T) { require.NotNil(t, SubscribeChainHead( newTestClient(t).L1, diff --git a/pkg/rpc/utils.go b/pkg/rpc/utils.go index c1ba7ab4f..dd3b0fb23 100644 --- a/pkg/rpc/utils.go +++ b/pkg/rpc/utils.go @@ -101,9 +101,8 @@ func NeedNewProof( fc, err := cli.TaikoL1.GetForkChoice( &bind.CallOpts{Context: ctxWithTimeout}, - id, + id.Uint64(), parent.Hash(), - uint32(parent.GasUsed), ) if err != nil { if !strings.Contains(encoding.TryParsingCustomError(err).Error(), "L1_FORK_CHOICE_NOT_FOUND") { diff --git a/pkg/tx_list_validator/tx_list_validator.go b/pkg/tx_list_validator/tx_list_validator.go index d5365c0c4..639117535 100644 --- a/pkg/tx_list_validator/tx_list_validator.go +++ b/pkg/tx_list_validator/tx_list_validator.go @@ -33,8 +33,8 @@ func NewTxListValidator( chainID *big.Int, ) *TxListValidator { return &TxListValidator{ - blockMaxGasLimit: blockMaxGasLimit, maxTransactionsPerBlock: maxTransactionsPerBlock, + blockMaxGasLimit: blockMaxGasLimit, maxBytesPerTxList: maxBytesPerTxList, chainID: chainID, } diff --git a/proposer/config.go b/proposer/config.go index 799c90077..7da3c0276 100644 --- a/proposer/config.go +++ b/proposer/config.go @@ -19,6 +19,7 @@ type Config struct { L2Endpoint string TaikoL1Address common.Address TaikoL2Address common.Address + TaikoTokenAddress common.Address L1ProposerPrivKey *ecdsa.PrivateKey L2SuggestedFeeRecipient common.Address ProposeInterval *time.Duration @@ -32,6 +33,10 @@ type Config struct { RPCTimeout *time.Duration WaitReceiptTimeout time.Duration ProposeBlockTxGasTipCap *big.Int + ProverEndpoints []string + BlockProposalFee *big.Int + BlockProposalFeeIncreasePercentage uint64 + BlockProposalFeeIterations uint64 } // NewConfigFromCliContext initializes a Config instance from @@ -103,11 +108,21 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { proposeBlockTxGasTipCap = new(big.Int).SetUint64(c.Uint64(flags.ProposeBlockTxGasTipCap.Name)) } + var proverEndpoints []string + + proverEndpoints = append(proverEndpoints, strings.Split(c.String(flags.ProverEndpoints.Name), ",")...) + + blockProposalFee, ok := new(big.Int).SetString(c.String(flags.BlockProposalFee.Name), 10) + if !ok { + return nil, fmt.Errorf("invalid blockProposalFee: %v", c.String(flags.BlockProposalFee.Name)) + } + return &Config{ L1Endpoint: c.String(flags.L1WSEndpoint.Name), L2Endpoint: c.String(flags.L2HTTPEndpoint.Name), TaikoL1Address: common.HexToAddress(c.String(flags.TaikoL1Address.Name)), TaikoL2Address: common.HexToAddress(c.String(flags.TaikoL2Address.Name)), + TaikoTokenAddress: common.HexToAddress(c.String(flags.TaikoTokenAddress.Name)), L1ProposerPrivKey: l1ProposerPrivKey, L2SuggestedFeeRecipient: common.HexToAddress(l2SuggestedFeeRecipient), ProposeInterval: proposingInterval, @@ -121,5 +136,9 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { RPCTimeout: timeout, WaitReceiptTimeout: time.Duration(c.Uint64(flags.WaitReceiptTimeout.Name)) * time.Second, ProposeBlockTxGasTipCap: proposeBlockTxGasTipCap, + ProverEndpoints: proverEndpoints, + BlockProposalFee: blockProposalFee, + BlockProposalFeeIncreasePercentage: c.Uint64(flags.BlockProposalFeeIncreasePercentage.Name), + BlockProposalFeeIterations: c.Uint64(flags.BlockProposalFeeIterations.Name), }, nil } diff --git a/proposer/config_test.go b/proposer/config_test.go index a54d3e6ef..9747ef0f4 100644 --- a/proposer/config_test.go +++ b/proposer/config_test.go @@ -2,7 +2,9 @@ package proposer import ( "context" + "math/big" "os" + "strings" "time" "github.com/ethereum/go-ethereum/common" @@ -12,12 +14,15 @@ import ( ) var ( - l1Endpoint = os.Getenv("L1_NODE_WS_ENDPOINT") - l2Endpoint = os.Getenv("L2_EXECUTION_ENGINE_HTTP_ENDPOINT") - taikoL1 = os.Getenv("TAIKO_L1_ADDRESS") - taikoL2 = os.Getenv("TAIKO_L2_ADDRESS") - proposeInterval = "10s" - rpcTimeout = 5 * time.Second + l1Endpoint = os.Getenv("L1_NODE_WS_ENDPOINT") + l2Endpoint = os.Getenv("L2_EXECUTION_ENGINE_HTTP_ENDPOINT") + proverEndpoints = "http://localhost:9876,http://localhost:1234" + taikoL1 = os.Getenv("TAIKO_L1_ADDRESS") + taikoL2 = os.Getenv("TAIKO_L2_ADDRESS") + taikoToken = os.Getenv("TAIKO_TOKEN_ADDRESS") + blockProposalFee = "10000000000" + proposeInterval = "10s" + rpcTimeout = 5 * time.Second ) func (s *ProposerTestSuite) TestNewConfigFromCliContext() { @@ -36,6 +41,7 @@ func (s *ProposerTestSuite) TestNewConfigFromCliContext() { s.Equal(l2Endpoint, c.L2Endpoint) s.Equal(taikoL1, c.TaikoL1Address.String()) s.Equal(taikoL2, c.TaikoL2Address.String()) + s.Equal(taikoToken, c.TaikoTokenAddress.String()) s.Equal(goldenTouchAddress, crypto.PubkeyToAddress(c.L1ProposerPrivKey.PublicKey)) s.Equal(goldenTouchAddress, c.L2SuggestedFeeRecipient) s.Equal(float64(10), c.ProposeInterval.Seconds()) @@ -44,6 +50,13 @@ func (s *ProposerTestSuite) TestNewConfigFromCliContext() { s.Equal(uint64(5), c.ProposeBlockTxReplacementMultiplier) s.Equal(rpcTimeout, *c.RPCTimeout) s.Equal(10*time.Second, c.WaitReceiptTimeout) + s.Equal(strings.Split(proverEndpoints, ","), c.ProverEndpoints) + + fee, _ := new(big.Int).SetString(blockProposalFee, 10) + s.Equal(fee, c.BlockProposalFee) + + s.Equal(uint64(15), c.BlockProposalFeeIncreasePercentage) + s.Equal(uint64(5), c.BlockProposalFeeIterations) s.Nil(new(Proposer).InitFromCli(context.Background(), ctx)) return err @@ -55,6 +68,7 @@ func (s *ProposerTestSuite) TestNewConfigFromCliContext() { "-" + flags.L2HTTPEndpoint.Name, l2Endpoint, "-" + flags.TaikoL1Address.Name, taikoL1, "-" + flags.TaikoL2Address.Name, taikoL2, + "-" + flags.TaikoTokenAddress.Name, taikoToken, "-" + flags.L1ProposerPrivKey.Name, common.Bytes2Hex(goldenTouchPrivKey.Bytes()), "-" + flags.L2SuggestedFeeRecipient.Name, goldenTouchAddress.Hex(), "-" + flags.ProposeInterval.Name, proposeInterval, @@ -64,6 +78,10 @@ func (s *ProposerTestSuite) TestNewConfigFromCliContext() { "-" + flags.WaitReceiptTimeout.Name, "10", "-" + flags.ProposeBlockTxGasTipCap.Name, "100000", "-" + flags.ProposeBlockTxGasLimit.Name, "100000", + "-" + flags.ProverEndpoints.Name, proverEndpoints, + "-" + flags.BlockProposalFee.Name, blockProposalFee, + "-" + flags.BlockProposalFeeIncreasePercentage.Name, "15", + "-" + flags.BlockProposalFeeIterations.Name, "5", })) } @@ -164,16 +182,21 @@ func (s *ProposerTestSuite) SetupApp() *cli.App { &cli.StringFlag{Name: flags.L2HTTPEndpoint.Name}, &cli.StringFlag{Name: flags.TaikoL1Address.Name}, &cli.StringFlag{Name: flags.TaikoL2Address.Name}, + &cli.StringFlag{Name: flags.TaikoTokenAddress.Name}, &cli.StringFlag{Name: flags.L1ProposerPrivKey.Name}, &cli.StringFlag{Name: flags.L2SuggestedFeeRecipient.Name}, &cli.StringFlag{Name: flags.ProposeEmptyBlocksInterval.Name}, &cli.StringFlag{Name: flags.ProposeInterval.Name}, &cli.StringFlag{Name: flags.TxPoolLocals.Name}, + &cli.StringFlag{Name: flags.ProverEndpoints.Name}, + &cli.Uint64Flag{Name: flags.BlockProposalFee.Name}, &cli.Uint64Flag{Name: flags.ProposeBlockTxReplacementMultiplier.Name}, &cli.Uint64Flag{Name: flags.RPCTimeout.Name}, &cli.Uint64Flag{Name: flags.WaitReceiptTimeout.Name}, &cli.Uint64Flag{Name: flags.ProposeBlockTxGasTipCap.Name}, &cli.Uint64Flag{Name: flags.ProposeBlockTxGasLimit.Name}, + &cli.Uint64Flag{Name: flags.BlockProposalFeeIncreasePercentage.Name}, + &cli.Uint64Flag{Name: flags.BlockProposalFeeIterations.Name}, } app.Action = func(ctx *cli.Context) error { _, err := NewConfigFromCliContext(ctx) diff --git a/proposer/proposer.go b/proposer/proposer.go index 24e2515cb..f3b147767 100644 --- a/proposer/proposer.go +++ b/proposer/proposer.go @@ -1,13 +1,16 @@ package proposer import ( + "bytes" "context" "crypto/ecdsa" + "encoding/json" "errors" "fmt" - "math" + "io" "math/big" "math/rand" + "net/http" "strings" "sync" "time" @@ -30,10 +33,17 @@ import ( var ( errNoNewTxs = errors.New("no new transactions") + errUnableToFindProver = errors.New("unable to find prover") maxSendProposeBlockTxRetry = 10 retryInterval = 12 * time.Second + requestProverServerTimeout = 12 * time.Second ) +type proposeBlockResponse struct { + SignedPayload []byte `json:"signedPayload"` + Prover common.Address `json:"prover"` +} + // Proposer keep proposing new transactions from L2 execution engine's tx pool at a fixed interval. type Proposer struct { // RPC clients @@ -54,10 +64,15 @@ type Proposer struct { proposeBlockTxGasLimit *uint64 txReplacementTipMultiplier uint64 proposeBlockTxGasTipCap *big.Int + proverEndpoints []string // Protocol configurations protocolConfigs *bindings.TaikoDataConfig + // Block proposal fee configurations + blockProposalFee *big.Int + blockProposalFeeIncreasePercentage uint64 + // Only for testing purposes CustomProposeOpHook func() error AfterCommitHook func() error @@ -66,6 +81,8 @@ type Proposer struct { wg sync.WaitGroup waitReceiptTimeout time.Duration + + cfg *Config } // New initializes the given proposer instance based on the command line flags. @@ -94,15 +111,20 @@ func InitFromConfig(ctx context.Context, p *Proposer, cfg *Config) (err error) { p.proposeBlockTxGasTipCap = cfg.ProposeBlockTxGasTipCap p.ctx = ctx p.waitReceiptTimeout = cfg.WaitReceiptTimeout + p.proverEndpoints = cfg.ProverEndpoints + p.blockProposalFee = cfg.BlockProposalFee + p.blockProposalFeeIncreasePercentage = cfg.BlockProposalFeeIncreasePercentage + p.cfg = cfg // RPC clients if p.rpc, err = rpc.NewClient(p.ctx, &rpc.ClientConfig{ - L1Endpoint: cfg.L1Endpoint, - L2Endpoint: cfg.L2Endpoint, - TaikoL1Address: cfg.TaikoL1Address, - TaikoL2Address: cfg.TaikoL2Address, - RetryInterval: cfg.BackOffRetryInterval, - Timeout: cfg.RPCTimeout, + L1Endpoint: cfg.L1Endpoint, + L2Endpoint: cfg.L2Endpoint, + TaikoL1Address: cfg.TaikoL1Address, + TaikoL2Address: cfg.TaikoL2Address, + TaikoTokenAddress: cfg.TaikoTokenAddress, + RetryInterval: cfg.BackOffRetryInterval, + Timeout: cfg.RPCTimeout, }); err != nil { return fmt.Errorf("initialize rpc clients error: %w", err) } @@ -171,7 +193,7 @@ func (p *Proposer) eventLoop() { } // Close closes the proposer instance. -func (p *Proposer) Close() { +func (p *Proposer) Close(ctx context.Context) { p.wg.Wait() } @@ -183,11 +205,6 @@ func (p *Proposer) ProposeOp(ctx context.Context) error { return p.CustomProposeOpHook() } - log.Info("Comparing proposer TKO balance to block fee", "proposer", p.l1ProposerAddress.Hex()) - if err := p.CheckTaikoTokenBalance(); err != nil { - return fmt.Errorf("failed to check token balance: %w", err) - } - // Wait until L2 execution engine is synced at first. if err := p.rpc.WaitTillL2ExecutionEngineSynced(ctx); err != nil { return fmt.Errorf("failed to wait until L2 execution engine synced: %w", err) @@ -216,7 +233,7 @@ func (p *Proposer) ProposeOp(ctx context.Context) error { p.L2SuggestedFeeRecipient(), baseFee, p.protocolConfigs.BlockMaxGasLimit, - p.protocolConfigs.BlockMaxTxListBytes, + p.protocolConfigs.BlockMaxTxListBytes.Uint64(), p.locals, p.maxProposedTxListsPerEpoch, ) @@ -320,6 +337,8 @@ func (p *Proposer) sendProposeBlockTx( meta *encoding.TaikoL1BlockMetadataInput, txListBytes []byte, nonce *uint64, + assignment []byte, + fee *big.Int, isReplacement bool, ) (*types.Transaction, error) { // Propose the transactions list @@ -327,7 +346,7 @@ func (p *Proposer) sendProposeBlockTx( if err != nil { return nil, err } - opts, err := getTxOpts(ctx, p.rpc.L1, p.l1ProposerPrivKey, p.rpc.L1ChainID) + opts, err := getTxOpts(ctx, p.rpc.L1, p.l1ProposerPrivKey, p.rpc.L1ChainID, fee) if err != nil { return nil, err } @@ -375,7 +394,7 @@ func (p *Proposer) sendProposeBlockTx( } } - proposeTx, err := p.rpc.TaikoL1.ProposeBlock(opts, inputs, txListBytes) + proposeTx, err := p.rpc.TaikoL1.ProposeBlock(opts, inputs, assignment, txListBytes) if err != nil { return nil, encoding.TryParsingCustomError(err) } @@ -391,17 +410,21 @@ func (p *Proposer) ProposeTxList( txNum uint, nonce *uint64, ) error { + assignment, fee, err := p.assignProver(ctx, meta) + if err != nil { + return err + } + var ( isReplacement bool tx *types.Transaction - err error ) if err := backoff.Retry( func() error { if ctx.Err() != nil { return nil } - if tx, err = p.sendProposeBlockTx(ctx, meta, txListBytes, nonce, isReplacement); err != nil { + if tx, err = p.sendProposeBlockTx(ctx, meta, txListBytes, nonce, assignment, fee, isReplacement); err != nil { log.Warn("Failed to send propose block transaction, retrying", "error", encoding.TryParsingCustomError(err)) if strings.Contains(err.Error(), txpool.ErrReplaceUnderpriced.Error()) { isReplacement = true @@ -471,6 +494,185 @@ func (p *Proposer) updateProposingTicker() { p.proposingTimer = time.NewTimer(duration) } +// assignProver attempts to find a prover who wants to win the block. +// if no provers want to do it for the price we set, we increase the price, and try again. +func (p *Proposer) assignProver( + ctx context.Context, + meta *encoding.TaikoL1BlockMetadataInput, +) ([]byte, *big.Int, error) { + initialFee := p.blockProposalFee + + percentBig := big.NewInt(int64(p.blockProposalFeeIncreasePercentage)) + + // iterate over each configured endpoint, and see if someone wants to accept your block. + // if it is denied, we continue on to the next endpoint. + // if we do not find a prover, we can increase the fee up to a point, or give up. + // TODO(jeff): we loop 3 times, this should be a config var + for i := 0; i < int(p.cfg.BlockProposalFeeIterations); i++ { + fee := new(big.Int).Set(initialFee) + + // increase fee on each failed loop + if i > 0 { + cumulativePercent := new(big.Int).Mul(percentBig, big.NewInt(int64(i))) + increase := new(big.Int).Mul(fee, cumulativePercent) + increase.Div(increase, big.NewInt(100)) + fee.Add(fee, increase) + } + + expiry := uint64(time.Now().Add(90 * time.Minute).Unix()) + + proposeBlockReq := &encoding.ProposeBlockData{ + Expiry: expiry, + Input: *meta, + Fee: fee, + } + + jsonBody, err := json.Marshal(proposeBlockReq) + if err != nil { + return nil, nil, err + } + + r := bytes.NewReader(jsonBody) + + for _, endpoint := range p.proverEndpoints { + log.Info( + "Attempting to assign prover", + "endpoint", endpoint, + "fee", fee.String(), + "expiry", expiry, + ) + client := &http.Client{Timeout: requestProverServerTimeout} + + req, err := http.NewRequestWithContext( + ctx, + "POST", + fmt.Sprintf("%v/%v", endpoint, "proposeBlock"), + r, + ) + if err != nil { + log.Error("Init http request error", "endpoint", endpoint, "err", err) + continue + } + req.Header.Add("Content-Type", "application/json") + + res, err := client.Do(req) + if err != nil { + log.Error("Request prover server error", "endpoint", endpoint, "err", err) + continue + } + + if res.StatusCode != http.StatusOK { + log.Info( + "Prover rejected request to assign block", + "endpoint", endpoint, + "fee", fee.String(), + "expiry", expiry, + ) + continue + } + + resBody, err := io.ReadAll(res.Body) + if err != nil { + log.Error("Read response body error", "endpoint", endpoint, "err", err) + continue + } + + resp := &proposeBlockResponse{} + if err := json.Unmarshal(resBody, resp); err != nil { + log.Error("Unmarshal response body error", "endpoint", endpoint, "err", err) + continue + } + + // ensure prover in response is the same as the one recovered + // from the signature + encodedBlockData, err := encoding.EncodeProposeBlockData(proposeBlockReq) + if err != nil { + log.Error("Encode block data error", "endpoint", endpoint, "error", err) + continue + } + + pubKey, err := crypto.SigToPub(crypto.Keccak256Hash(encodedBlockData).Bytes(), resp.SignedPayload) + if err != nil { + log.Error("Failed to get public key from signature", "endpoint", endpoint, "error", err) + continue + } + + if crypto.PubkeyToAddress(*pubKey).Hex() != resp.Prover.Hex() { + log.Info( + "Assigned prover signature did not recover to provided prover address", + "endpoint", endpoint, + "recoveredAddress", crypto.PubkeyToAddress(*pubKey).Hex(), + "providedProver", resp.Prover.Hex(), + ) + continue + } + + // make sure the prover has the necessary balance either in TaikoL1 token balances + // or, if not, check allowance, as contract will attempt to burn directly after + // if it doesnt have the available tokenbalance in-contract. + taikoTokenBalance, err := p.rpc.TaikoL1.GetTaikoTokenBalance(&bind.CallOpts{Context: ctx}, resp.Prover) + if err != nil { + log.Error( + "Get taiko token balance error", + "endpoint", endpoint, + "providedProver", resp.Prover.Hex(), + "error", err, + ) + continue + } + + if p.protocolConfigs.ProofBond.Cmp(taikoTokenBalance) > 0 { + // check allowance on taikotoken contract + allowance, err := p.rpc.TaikoToken.Allowance(&bind.CallOpts{Context: ctx}, resp.Prover, p.cfg.TaikoL1Address) + if err != nil { + log.Error( + "Get taiko token allowance error", + "endpoint", endpoint, + "providedProver", resp.Prover.Hex(), + "error", err, + ) + continue + } + + if p.protocolConfigs.ProofBond.Cmp(allowance) > 0 { + log.Info( + "Assigned prover does not have required on-chain token balance or allowance", + "endpoint", endpoint, + "providedProver", resp.Prover.Hex(), + "taikoTokenBalance", taikoTokenBalance.String(), + "allowance", allowance.String(), + "proofBond", p.protocolConfigs.ProofBond, + "requiredFee", fee.String(), + ) + continue + } + } + + // convert signature to one solidity can recover by adding 27 to 65th byte + resp.SignedPayload[64] = uint8(uint(resp.SignedPayload[64])) + 27 + + encoded, err := encoding.EncodeProverAssignment(&encoding.ProverAssignment{ + Prover: resp.Prover, + Expiry: proposeBlockReq.Expiry, + Data: resp.SignedPayload, + }) + if err != nil { + return nil, nil, err + } + + log.Info( + "Prover assigned for block", + "prover", resp.Prover.Hex(), + "signedPayload", common.Bytes2Hex(resp.SignedPayload), + ) + + return encoded, fee, nil + } + } + + return nil, nil, errUnableToFindProver +} + // Name returns the application name. func (p *Proposer) Name() string { return "proposer" @@ -487,6 +689,7 @@ func getTxOpts( cli *rpc.EthClient, privKey *ecdsa.PrivateKey, chainID *big.Int, + fee *big.Int, ) (*bind.TransactOpts, error) { opts, err := bind.NewKeyedTransactorWithChainID(privKey, chainID) if err != nil { @@ -504,33 +707,7 @@ func getTxOpts( opts.GasTipCap = gasTipCap - return opts, nil -} - -// CheckTaikoTokenBalance checks if the current proposer has enough balance to pay -// the current block fee. -func (p *Proposer) CheckTaikoTokenBalance() error { - fee, err := p.rpc.TaikoL1.GetBlockFee(&bind.CallOpts{Context: p.ctx}, p.protocolConfigs.BlockMaxGasLimit) - if err != nil { - return fmt.Errorf("failed to get block fee: %w", err) - } - - log.Info("GetBlockFee", "fee", fee) + opts.Value = fee - if fee > math.MaxInt64 { - metrics.ProposerBlockFeeGauge.Update(math.MaxInt64) - } else { - metrics.ProposerBlockFeeGauge.Update(int64(fee)) - } - - balance, err := p.rpc.TaikoL1.GetTaikoTokenBalance(&bind.CallOpts{Context: p.ctx}, p.l1ProposerAddress) - if err != nil { - return fmt.Errorf("failed to get tko balance: %w", err) - } - - if balance.Cmp(new(big.Int).SetUint64(fee)) == -1 { - return fmt.Errorf("proposer does not have enough tko balance to propose, balance: %d, fee: %d", balance, fee) - } - - return nil + return opts, nil } diff --git a/proposer/proposer_test.go b/proposer/proposer_test.go index ee8bc5bc2..3b162dbbf 100644 --- a/proposer/proposer_test.go +++ b/proposer/proposer_test.go @@ -2,6 +2,7 @@ package proposer import ( "context" + "fmt" "math/big" "os" "testing" @@ -10,10 +11,12 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rlp" "github.com/stretchr/testify/suite" "github.com/taikoxyz/taiko-client/bindings" "github.com/taikoxyz/taiko-client/bindings/encoding" + "github.com/taikoxyz/taiko-client/prover/http" "github.com/taikoxyz/taiko-client/testutils" ) @@ -21,11 +24,14 @@ type ProposerTestSuite struct { testutils.ClientTestSuite p *Proposer cancel context.CancelFunc + srv *http.Server } func (s *ProposerTestSuite) SetupTest() { s.ClientTestSuite.SetupTest() + port := testutils.RandomPort() + l1ProposerPrivKey, err := crypto.ToECDSA(common.Hex2Bytes(os.Getenv("L1_PROPOSER_PRIVATE_KEY"))) s.Nil(err) @@ -38,14 +44,51 @@ func (s *ProposerTestSuite) SetupTest() { L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_HTTP_ENDPOINT"), TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), + TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), L1ProposerPrivKey: l1ProposerPrivKey, L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), ProposeInterval: &proposeInterval, MaxProposedTxListsPerEpoch: 1, ProposeBlockTxReplacementMultiplier: 2, WaitReceiptTimeout: 10 * time.Second, + ProverEndpoints: []string{fmt.Sprintf("http://localhost:%v", port)}, + BlockProposalFee: big.NewInt(100000), + BlockProposalFeeIncreasePercentage: 10, + BlockProposalFeeIterations: 3, }))) + // Init prover + l1ProverPrivKey, err := crypto.ToECDSA(common.Hex2Bytes(os.Getenv("L1_PROVER_PRIVATE_KEY"))) + s.Nil(err) + + serverOpts := http.NewServerOpts{ + ProverPrivateKey: l1ProverPrivKey, + MinProofFee: big.NewInt(1), + MaxCapacity: 10, + RequestCurrentCapacityCh: make(chan struct{}), + ReceiveCurrentCapacityCh: make(chan uint64), + } + + s.srv, err = http.NewServer(serverOpts) + s.Nil(err) + + go func() { + for { + select { + case <-serverOpts.RequestCurrentCapacityCh: + serverOpts.ReceiveCurrentCapacityCh <- 100 + case <-ctx.Done(): + return + } + } + }() + + go func() { + if err := s.srv.Start(fmt.Sprintf(":%v", port)); err != nil { + log.Crit("error starting prover http server", "error", err) + } + }() + s.p = p s.cancel = cancel } @@ -122,11 +165,13 @@ func (s *ProposerTestSuite) TestCustomProposeOpHook() { } func (s *ProposerTestSuite) TestSendProposeBlockTx() { + fee := big.NewInt(10000) opts, err := getTxOpts( context.Background(), s.p.rpc.L1, s.p.l1ProposerPrivKey, s.RpcClient.L1ChainID, + fee, ) s.Nil(err) s.Greater(opts.GasTipCap.Uint64(), uint64(0)) @@ -154,23 +199,67 @@ func (s *ProposerTestSuite) TestSendProposeBlockTx() { encoded, err := rlp.EncodeToBytes(emptyTxs) s.Nil(err) + meta := &encoding.TaikoL1BlockMetadataInput{ + Beneficiary: s.p.L2SuggestedFeeRecipient(), + TxListHash: crypto.Keccak256Hash(encoded), + TxListByteStart: common.Big0, + TxListByteEnd: new(big.Int).SetUint64(uint64(len(encoded))), + CacheTxListInfo: false, + } + + assignment, fee, err := s.p.assignProver(context.Background(), meta) + s.Nil(err) + newTx, err := s.p.sendProposeBlockTx( context.Background(), - &encoding.TaikoL1BlockMetadataInput{ - Beneficiary: s.p.L2SuggestedFeeRecipient(), - TxListHash: crypto.Keccak256Hash(encoded), - TxListByteStart: common.Big0, - TxListByteEnd: new(big.Int).SetUint64(uint64(len(encoded))), - CacheTxListInfo: false, - }, + meta, encoded, &nonce, + assignment, + fee, true, ) s.Nil(err) s.Greater(newTx.GasTipCap().Uint64(), tx.GasTipCap().Uint64()) } +func (s *ProposerTestSuite) TestAssignProver_NoProvers() { + meta := &encoding.TaikoL1BlockMetadataInput{ + Beneficiary: s.p.L2SuggestedFeeRecipient(), + TxListHash: testutils.RandomHash(), + TxListByteStart: common.Big0, + TxListByteEnd: common.Big0, + CacheTxListInfo: false, + } + + s.SetL1Automine(false) + defer s.SetL1Automine(true) + + s.p.proverEndpoints = []string{} + + _, _, err := s.p.assignProver(context.Background(), meta) + + s.Equal(err, errUnableToFindProver) +} + +func (s *ProposerTestSuite) TestAssignProver_SuccessFirstRound() { + meta := &encoding.TaikoL1BlockMetadataInput{ + Beneficiary: s.p.L2SuggestedFeeRecipient(), + TxListHash: testutils.RandomHash(), + TxListByteStart: common.Big0, + TxListByteEnd: common.Big0, + CacheTxListInfo: false, + } + + s.SetL1Automine(false) + defer s.SetL1Automine(true) + + _, fee, err := s.p.assignProver(context.Background(), meta) + + s.Nil(err) + s.Equal(fee.Uint64(), s.p.blockProposalFee.Uint64()) +} + func (s *ProposerTestSuite) TestUpdateProposingTicker() { oneHour := 1 * time.Hour s.p.proposingInterval = &oneHour @@ -183,7 +272,7 @@ func (s *ProposerTestSuite) TestUpdateProposingTicker() { func (s *ProposerTestSuite) TestStartClose() { s.Nil(s.p.Start()) s.cancel() - s.NotPanics(s.p.Close) + s.NotPanics(func() { s.p.Close(context.Background()) }) } // TODO: not working diff --git a/prover/config.go b/prover/config.go index 0b7f15777..7c2e27c46 100644 --- a/prover/config.go +++ b/prover/config.go @@ -20,7 +20,6 @@ type Config struct { L2WsEndpoint string L2HttpEndpoint string TaikoL1Address common.Address - TaikoProverPoolL1Address common.Address TaikoL2Address common.Address L1ProverPrivKey *ecdsa.PrivateKey ZKEvmRpcdEndpoint string @@ -42,6 +41,9 @@ type Config struct { RPCTimeout *time.Duration WaitReceiptTimeout time.Duration ProveBlockGasLimit *uint64 + HTTPServerPort uint64 + Capacity uint64 + MinProofFee *big.Int } // NewConfigFromCliContext creates a new config instance from command line flags. @@ -67,6 +69,10 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { if err != nil { return nil, fmt.Errorf("invalid oracle private key: %w", err) } + } else { + if !c.IsSet(flags.ProverCapacity.Name) { + return nil, fmt.Errorf("capacity is required if oracleProver is not set to true") + } } var ( @@ -104,7 +110,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { } var timeout *time.Duration - if c.IsSet(flags.RPCTimeout.Name) { duration := time.Duration(c.Uint64(flags.RPCTimeout.Name)) * time.Second timeout = &duration @@ -116,6 +121,11 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { proveBlockTxGasLimit = &gasLimit } + minProofFee, ok := new(big.Int).SetString(c.String(flags.MinProofFee.Name), 10) + if !ok { + return nil, fmt.Errorf("invalid minProofFee: %v", minProofFee) + } + return &Config{ L1WsEndpoint: c.String(flags.L1WSEndpoint.Name), L1HttpEndpoint: c.String(flags.L1HTTPEndpoint.Name), @@ -123,7 +133,6 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { L2HttpEndpoint: c.String(flags.L2HTTPEndpoint.Name), TaikoL1Address: common.HexToAddress(c.String(flags.TaikoL1Address.Name)), TaikoL2Address: common.HexToAddress(c.String(flags.TaikoL2Address.Name)), - TaikoProverPoolL1Address: common.HexToAddress(c.String(flags.TaikoProverPoolL1Address.Name)), L1ProverPrivKey: l1ProverPrivKey, ZKEvmRpcdEndpoint: c.String(flags.ZkEvmRpcdEndpoint.Name), ZkEvmRpcdParamsPath: c.String(flags.ZkEvmRpcdParamsPath.Name), @@ -146,5 +155,8 @@ func NewConfigFromCliContext(c *cli.Context) (*Config, error) { RPCTimeout: timeout, WaitReceiptTimeout: time.Duration(c.Uint64(flags.WaitReceiptTimeout.Name)) * time.Second, ProveBlockGasLimit: proveBlockTxGasLimit, + Capacity: c.Uint64(flags.ProverCapacity.Name), + HTTPServerPort: c.Uint64(flags.ProverHTTPServerPort.Name), + MinProofFee: minProofFee, }, nil } diff --git a/prover/config_test.go b/prover/config_test.go index 30795572a..31bad348e 100644 --- a/prover/config_test.go +++ b/prover/config_test.go @@ -6,24 +6,27 @@ import ( "time" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/log" "github.com/taikoxyz/taiko-client/cmd/flags" "github.com/urfave/cli/v2" ) var ( - l1WsEndpoint = os.Getenv("L1_NODE_WS_ENDPOINT") - l1HttpEndpoint = os.Getenv("L1_NODE_HTTP_ENDPOINT") - l2WsEndpoint = os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT") - l2HttpEndpoint = os.Getenv("L2_EXECUTION_ENGINE_HTTP_ENDPOINT") - taikoL1 = os.Getenv("TAIKO_L1_ADDRESS") - taikoL2 = os.Getenv("TAIKO_L2_ADDRESS") - taikoProverPoolL1 = os.Getenv("TAIKO_PROVER_POOL_L1_ADDRESS") - rpcTimeout = 5 * time.Second + l1WsEndpoint = os.Getenv("L1_NODE_WS_ENDPOINT") + l1HttpEndpoint = os.Getenv("L1_NODE_HTTP_ENDPOINT") + l2WsEndpoint = os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT") + l2HttpEndpoint = os.Getenv("L2_EXECUTION_ENGINE_HTTP_ENDPOINT") + taikoL1 = os.Getenv("TAIKO_L1_ADDRESS") + taikoL2 = os.Getenv("TAIKO_L2_ADDRESS") + rpcTimeout = 5 * time.Second + minProofFee = "1024" ) +// TODO: fix this test func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProver() { app := s.SetupApp() app.Action = func(ctx *cli.Context) error { + log.Info("ctx", "ctx", ctx.FlagNames(), "v", ctx.Args()) c, err := NewConfigFromCliContext(ctx) s.Nil(err) s.Equal(l1WsEndpoint, c.L1WsEndpoint) @@ -32,7 +35,6 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProver() { s.Equal(l2HttpEndpoint, c.L2HttpEndpoint) s.Equal(taikoL1, c.TaikoL1Address.String()) s.Equal(taikoL2, c.TaikoL2Address.String()) - s.Equal(taikoProverPoolL1, c.TaikoProverPoolL1Address.String()) s.Equal( crypto.PubkeyToAddress(s.p.cfg.L1ProverPrivKey.PublicKey), crypto.PubkeyToAddress(c.L1ProverPrivKey.PublicKey), @@ -49,26 +51,29 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProver() { s.Equal(30*time.Second, c.CheckProofWindowExpiredInterval) s.Equal(true, c.ProveUnassignedBlocks) s.Equal(rpcTimeout, *c.RPCTimeout) + s.Equal(uint64(8), c.Capacity) + s.Equal(minProofFee, c.MinProofFee.String()) s.Nil(new(Prover).InitFromCli(context.Background(), ctx)) return err } s.Nil(app.Run([]string{ - "TestNewConfigFromCliContext", + "TestNewConfigFromCliContext_OracleProver", "-" + flags.L1WSEndpoint.Name, l1WsEndpoint, "-" + flags.L1HTTPEndpoint.Name, l1HttpEndpoint, "-" + flags.L2WSEndpoint.Name, l2WsEndpoint, "-" + flags.L2HTTPEndpoint.Name, l2HttpEndpoint, "-" + flags.TaikoL1Address.Name, taikoL1, "-" + flags.TaikoL2Address.Name, taikoL2, - "-" + flags.TaikoProverPoolL1Address.Name, taikoProverPoolL1, "-" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "-" + flags.StartingBlockID.Name, "0", "-" + flags.RPCTimeout.Name, "5", "-" + flags.ProveBlockTxGasLimit.Name, "100000", "-" + flags.Dummy.Name, "-" + flags.RandomDummyProofDelay.Name, "30m-1h", + "-" + flags.MinProofFee.Name, minProofFee, + "-" + flags.ProverCapacity.Name, "8", "-" + flags.OracleProver.Name, "-" + flags.OracleProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "-" + flags.Graffiti.Name, "", @@ -88,13 +93,13 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_OracleProverError() { "-" + flags.L2HTTPEndpoint.Name, l2HttpEndpoint, "-" + flags.TaikoL1Address.Name, taikoL1, "-" + flags.TaikoL2Address.Name, taikoL2, - "-" + flags.TaikoProverPoolL1Address.Name, taikoProverPoolL1, "-" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "-" + flags.Dummy.Name, "-" + flags.RandomDummyProofDelay.Name, "30m-1h", "-" + flags.OracleProver.Name, "-" + flags.Graffiti.Name, "", "-" + flags.RPCTimeout.Name, "5", + "-" + flags.MinProofFee.Name, minProofFee, }), "oracleProver flag set without oracleProverPrivateKey set") } @@ -125,7 +130,9 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_RandomDelayError() { "TestNewConfigFromCliContext", "-" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "-" + flags.OracleProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), + "-" + flags.OracleProver.Name, "-" + flags.RandomDummyProofDelay.Name, "130m", + "-" + flags.MinProofFee.Name, minProofFee, }), "invalid random dummy proof delay value") } @@ -136,7 +143,9 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_RandomDelayErrorLower() { "TestNewConfigFromCliContext", "-" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "-" + flags.OracleProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), + "-" + flags.OracleProver.Name, "-" + flags.RandomDummyProofDelay.Name, "30x-1h", + "-" + flags.MinProofFee.Name, minProofFee, }), "invalid random dummy proof delay value") } @@ -147,7 +156,9 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_RandomDelayErrorUpper() { "TestNewConfigFromCliContext", "-" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "-" + flags.OracleProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), + "-" + flags.OracleProver.Name, "-" + flags.RandomDummyProofDelay.Name, "30m-1x", + "-" + flags.MinProofFee.Name, minProofFee, }), "invalid random dummy proof delay value") } @@ -158,7 +169,9 @@ func (s *ProverTestSuite) TestNewConfigFromCliContext_RandomDelayErrorOrder() { "TestNewConfigFromCliContext", "-" + flags.L1ProverPrivKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), "-" + flags.OracleProverPrivateKey.Name, os.Getenv("L1_PROVER_PRIVATE_KEY"), + "-" + flags.OracleProver.Name, "-" + flags.RandomDummyProofDelay.Name, "1h-30m", + "-" + flags.MinProofFee.Name, minProofFee, }), "invalid random dummy proof delay value (lower > upper)") } @@ -178,10 +191,11 @@ func (s *ProverTestSuite) SetupApp() *cli.App { &cli.BoolFlag{Name: flags.OracleProver.Name}, &cli.StringFlag{Name: flags.OracleProverPrivateKey.Name}, &cli.StringFlag{Name: flags.Graffiti.Name}, - &cli.StringFlag{Name: flags.TaikoProverPoolL1Address.Name}, &cli.Uint64Flag{Name: flags.CheckProofWindowExpiredInterval.Name}, &cli.BoolFlag{Name: flags.ProveUnassignedBlocks.Name}, &cli.Uint64Flag{Name: flags.RPCTimeout.Name}, + &cli.Uint64Flag{Name: flags.ProverCapacity.Name}, + &cli.Uint64Flag{Name: flags.MinProofFee.Name}, &cli.Uint64Flag{Name: flags.ProveBlockTxGasLimit.Name}, } app.Action = func(ctx *cli.Context) error { diff --git a/prover/http/propose_block.go b/prover/http/propose_block.go new file mode 100644 index 000000000..f1adad314 --- /dev/null +++ b/prover/http/propose_block.go @@ -0,0 +1,68 @@ +package http + +import ( + "context" + "net/http" + "time" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/labstack/echo/v4" + "github.com/labstack/gommon/log" + "github.com/taikoxyz/taiko-client/bindings/encoding" +) + +type proposeBlockResp struct { + SignedPayload []byte `json:"signedPayload"` + Prover common.Address `json:"prover"` +} + +// ProposeBlock handles a propose block request, decides if this prover wants to +// handle this block, and if so, returns a signed payload the proposer +// can submit onchain. +func (srv *Server) ProposeBlock(c echo.Context) error { + r := &encoding.ProposeBlockData{} + if err := c.Bind(r); err != nil { + return c.JSON(http.StatusUnprocessableEntity, err) + } + + if r.Fee.Cmp(srv.minProofFee) < 0 { + return echo.NewHTTPError(http.StatusUnprocessableEntity, "proof fee too low") + } + + srv.requestCurrentCapacityCh <- struct{}{} + + ctx, cancel := context.WithTimeout(c.Request().Context(), 8*time.Second) + defer cancel() + + for { + select { + case capacity := <-srv.receiveCurrentCapacityCh: + if capacity == 0 { + return echo.NewHTTPError(http.StatusUnprocessableEntity, "prover does not have capacity") + } + + encoded, err := encoding.EncodeProposeBlockData(r) + if err != nil { + return echo.NewHTTPError(http.StatusUnprocessableEntity, err) + } + + hashed := crypto.Keccak256Hash(encoded) + + signed, err := crypto.Sign(hashed.Bytes(), srv.proverPrivateKey) + if err != nil { + return echo.NewHTTPError(http.StatusInternalServerError, err) + } + + resp := &proposeBlockResp{ + SignedPayload: signed, + Prover: srv.proverAddress, + } + + return c.JSON(http.StatusOK, resp) + case <-ctx.Done(): + log.Info("timed out trying to get capacity") + return echo.NewHTTPError(http.StatusUnprocessableEntity, "timed out trying to get capacity") + } + } +} diff --git a/prover/http/propose_block_test.go b/prover/http/propose_block_test.go new file mode 100644 index 000000000..5acd7a4a2 --- /dev/null +++ b/prover/http/propose_block_test.go @@ -0,0 +1,92 @@ +package http + +import ( + "crypto/rand" + "math/big" + "net/http" + "net/http/httptest" + "testing" + "time" + + "github.com/cyberhorsey/webutils/testutils" + "github.com/ethereum/go-ethereum/common" + "github.com/labstack/echo/v4" + "github.com/taikoxyz/taiko-client/bindings/encoding" +) + +// randomHash generates a random blob of data and returns it as a hash. +func randomHash() common.Hash { + var hash common.Hash + if n, err := rand.Read(hash[:]); n != common.HashLength || err != nil { + panic(err) + } + return hash +} +func Test_ProposeBlock(t *testing.T) { + srv := newTestServer("") + + tests := []struct { + name string + req *encoding.ProposeBlockData + chResponseFunc func() + wantStatus int + wantBodyRegexpMatches []string + }{ + { + "success", + &encoding.ProposeBlockData{ + Fee: big.NewInt(1000), + Expiry: uint64(time.Now().Unix()), + Input: encoding.TaikoL1BlockMetadataInput{ + Beneficiary: common.BytesToAddress(randomHash().Bytes()), + TxListHash: randomHash(), + TxListByteStart: common.Big0, + TxListByteEnd: common.Big0, + CacheTxListInfo: false, + }, + }, + func() { + srv.receiveCurrentCapacityCh <- 100 + }, + http.StatusOK, + []string{`"signedPayload"`}, + }, + { + "contextTimeout", + &encoding.ProposeBlockData{ + Fee: big.NewInt(1000), + Expiry: uint64(time.Now().Unix()), + Input: encoding.TaikoL1BlockMetadataInput{ + Beneficiary: common.BytesToAddress(randomHash().Bytes()), + TxListHash: randomHash(), + TxListByteStart: common.Big0, + TxListByteEnd: common.Big0, + CacheTxListInfo: false, + }, + }, + nil, + http.StatusUnprocessableEntity, + []string{`{"message":"timed out trying to get capacity"}`}, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if tt.chResponseFunc != nil { + go tt.chResponseFunc() + } + + req := testutils.NewUnauthenticatedRequest( + echo.POST, + "/proposeBlock", + tt.req, + ) + + rec := httptest.NewRecorder() + + srv.ServeHTTP(rec, req) + + testutils.AssertStatusAndBody(t, rec, tt.wantStatus, tt.wantBodyRegexpMatches) + }) + } +} diff --git a/prover/http/routes.go b/prover/http/routes.go new file mode 100644 index 000000000..c7195ac42 --- /dev/null +++ b/prover/http/routes.go @@ -0,0 +1,8 @@ +package http + +func (srv *Server) configureRoutes() { + srv.echo.GET("/healthz", srv.Health) + srv.echo.GET("/", srv.Health) + + srv.echo.POST("/proposeBlock", srv.ProposeBlock) +} diff --git a/prover/http/server.go b/prover/http/server.go new file mode 100644 index 000000000..0afb3acaf --- /dev/null +++ b/prover/http/server.go @@ -0,0 +1,97 @@ +package http + +import ( + "context" + "crypto/ecdsa" + "math/big" + "net/http" + "os" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + "github.com/labstack/echo/v4/middleware" + + echo "github.com/labstack/echo/v4" +) + +type Server struct { + echo *echo.Echo + proverPrivateKey *ecdsa.PrivateKey + proverAddress common.Address + + // capacity related configs + maxCapacity uint64 + requestCurrentCapacityCh chan struct{} + receiveCurrentCapacityCh chan uint64 + minProofFee *big.Int +} + +type NewServerOpts struct { + ProverPrivateKey *ecdsa.PrivateKey + MaxCapacity uint64 + MinProofFee *big.Int + RequestCurrentCapacityCh chan struct{} + ReceiveCurrentCapacityCh chan uint64 +} + +func NewServer(opts NewServerOpts) (*Server, error) { + address := crypto.PubkeyToAddress(opts.ProverPrivateKey.PublicKey) + srv := &Server{ + proverPrivateKey: opts.ProverPrivateKey, + proverAddress: address, + echo: echo.New(), + maxCapacity: opts.MaxCapacity, + minProofFee: opts.MinProofFee, + requestCurrentCapacityCh: opts.RequestCurrentCapacityCh, + receiveCurrentCapacityCh: opts.ReceiveCurrentCapacityCh, + } + + srv.configureMiddleware() + srv.configureRoutes() + + return srv, nil +} + +// Start starts the HTTP server +func (srv *Server) Start(address string) error { + return srv.echo.Start(address) +} + +// Shutdown shuts down the HTTP server +func (srv *Server) Shutdown(ctx context.Context) error { + return srv.echo.Shutdown(ctx) +} + +// ServeHTTP implements the `http.Handler` interface which serves HTTP requests +func (srv *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { + srv.echo.ServeHTTP(w, r) +} + +// Health endpoints for probes +func (srv *Server) Health(c echo.Context) error { + return c.NoContent(http.StatusOK) +} + +func LogSkipper(c echo.Context) bool { + switch c.Request().URL.Path { + case "/healthz": + return true + case "/metrics": + return true + default: + return true + } +} + +func (srv *Server) configureMiddleware() { + srv.echo.Use(middleware.RequestID()) + + srv.echo.Use(middleware.LoggerWithConfig(middleware.LoggerConfig{ + Skipper: LogSkipper, + Format: `{"time":"${time_rfc3339_nano}","level":"INFO","message":{"id":"${id}","remote_ip":"${remote_ip}",` + //nolint:lll + `"host":"${host}","method":"${method}","uri":"${uri}","user_agent":"${user_agent}",` + //nolint:lll + `"response_status":${status},"error":"${error}","latency":${latency},"latency_human":"${latency_human}",` + + `"bytes_in":${bytes_in},"bytes_out":${bytes_out}}}` + "\n", + Output: os.Stdout, + })) +} diff --git a/prover/http/server_test.go b/prover/http/server_test.go new file mode 100644 index 000000000..f89c266b5 --- /dev/null +++ b/prover/http/server_test.go @@ -0,0 +1,68 @@ +package http + +import ( + "context" + "math/big" + "net/http" + "net/http/httptest" + "os" + "testing" + + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/crypto" + echo "github.com/labstack/echo/v4" + "github.com/stretchr/testify/assert" +) + +func newTestServer(url string) *Server { + l1ProverPrivKey, _ := crypto.ToECDSA(common.Hex2Bytes(os.Getenv("L1_PROVER_PRIVATE_KEY"))) + + srv := &Server{ + echo: echo.New(), + proverPrivateKey: l1ProverPrivKey, + maxCapacity: 8, + minProofFee: big.NewInt(1), + requestCurrentCapacityCh: make(chan struct{}, 1024), + receiveCurrentCapacityCh: make(chan uint64, 1024), + } + + srv.configureMiddleware() + srv.configureRoutes() + + return srv +} + +func Test_Health(t *testing.T) { + srv := newTestServer("") + + req, _ := http.NewRequest(echo.GET, "/healthz", nil) + rec := httptest.NewRecorder() + + srv.ServeHTTP(rec, req) + + if rec.Code != http.StatusOK { + t.Fatalf("Test_Health expected code %v, got %v", http.StatusOK, rec.Code) + } +} + +func Test_Root(t *testing.T) { + srv := newTestServer("") + + req, _ := http.NewRequest(echo.GET, "/", nil) + rec := httptest.NewRecorder() + + srv.ServeHTTP(rec, req) + + if rec.Code != http.StatusOK { + t.Fatalf("Test_Root expected code %v, got %v", http.StatusOK, rec.Code) + } +} + +func Test_StartShutdown(t *testing.T) { + srv := newTestServer("") + + go func() { + _ = srv.Start(":3928") + }() + assert.Nil(t, srv.Shutdown(context.Background())) +} diff --git a/prover/proof_producer/zkevm_rpcd_producer.go b/prover/proof_producer/zkevm_rpcd_producer.go index ecb695250..4a9b7aaac 100644 --- a/prover/proof_producer/zkevm_rpcd_producer.go +++ b/prover/proof_producer/zkevm_rpcd_producer.go @@ -219,20 +219,19 @@ func (p *ZkevmRpcdProducer) requestProof(opts *ProofRequestOptions) (*RpcdOutput MockFeedback: false, Aggregate: true, ProtocolInstance: &ProtocolInstance{ - Prover: opts.ProverAddress.Hex()[2:], - L1SignalService: opts.L1SignalService.Hex()[2:], - L2SignalService: opts.L2SignalService.Hex()[2:], - TaikoL2: opts.TaikoL2.Hex()[2:], - MetaHash: opts.MetaHash.Hex()[2:], - BlockHash: opts.BlockHash.Hex()[2:], - ParentHash: opts.ParentHash.Hex()[2:], - SignalRoot: opts.SignalRoot.Hex()[2:], - Graffiti: opts.Graffiti, - GasUsed: opts.GasUsed, - ParentGasUsed: opts.ParentGasUsed, - BlockMaxGasLimit: uint64(p.ProtocolConfig.BlockMaxGasLimit), - MaxTransactionsPerBlock: p.ProtocolConfig.BlockMaxTransactions, - MaxBytesPerTxList: p.ProtocolConfig.BlockMaxTxListBytes, + Prover: opts.ProverAddress.Hex()[2:], + L1SignalService: opts.L1SignalService.Hex()[2:], + L2SignalService: opts.L2SignalService.Hex()[2:], + TaikoL2: opts.TaikoL2.Hex()[2:], + MetaHash: opts.MetaHash.Hex()[2:], + BlockHash: opts.BlockHash.Hex()[2:], + ParentHash: opts.ParentHash.Hex()[2:], + SignalRoot: opts.SignalRoot.Hex()[2:], + Graffiti: opts.Graffiti, + GasUsed: opts.GasUsed, + ParentGasUsed: opts.ParentGasUsed, + BlockMaxGasLimit: uint64(p.ProtocolConfig.BlockMaxGasLimit), + MaxBytesPerTxList: p.ProtocolConfig.BlockMaxTxListBytes.Uint64(), }, }}, } diff --git a/prover/proof_submitter/util_test.go b/prover/proof_submitter/util_test.go index 73d586aef..a0f851144 100644 --- a/prover/proof_submitter/util_test.go +++ b/prover/proof_submitter/util_test.go @@ -40,11 +40,7 @@ func (s *ProofSubmitterTestSuite) TestSendTxWithBackoff() { s.Nil(err) l1HeadChild, err := s.RpcClient.L1.HeaderByNumber(context.Background(), new(big.Int).Sub(l1Head.Number, common.Big1)) s.Nil(err) - meta := &bindings.TaikoDataBlockMetadata{ - L1Height: l1HeadChild.Number.Uint64(), - L1Hash: l1HeadChild.Hash(), - Treasury: s.TestAddr, - } + meta := &bindings.TaikoDataBlockMetadata{L1Height: l1HeadChild.Number.Uint64(), L1Hash: l1HeadChild.Hash()} s.NotNil(sendTxWithBackoff( context.Background(), s.RpcClient, diff --git a/prover/proof_submitter/valid_proof_submitter.go b/prover/proof_submitter/valid_proof_submitter.go index d99f592aa..0bca978d7 100644 --- a/prover/proof_submitter/valid_proof_submitter.go +++ b/prover/proof_submitter/valid_proof_submitter.go @@ -114,7 +114,7 @@ func (s *ValidProofSubmitter) RequestProof(ctx context.Context, event *bindings. return fmt.Errorf("failed to get the L2 parent block by hash (%s): %w", block.ParentHash(), err) } - blockInfo, err := s.rpc.TaikoL1.GetBlock(&bind.CallOpts{Context: ctx}, event.BlockId) + blockInfo, err := s.rpc.TaikoL1.GetBlock(&bind.CallOpts{Context: ctx}, event.BlockId.Uint64()) if err != nil { return err } @@ -216,14 +216,12 @@ func (s *ValidProofSubmitter) SubmitProof( } evidence := &encoding.TaikoL1Evidence{ - MetaHash: proofWithHeader.Opts.MetaHash, - ParentHash: proofWithHeader.Opts.ParentHash, - BlockHash: proofWithHeader.Opts.BlockHash, - SignalRoot: proofWithHeader.Opts.SignalRoot, - Graffiti: s.graffiti, - ParentGasUsed: uint32(proofWithHeader.Opts.ParentGasUsed), - GasUsed: uint32(proofWithHeader.Opts.GasUsed), - Proof: zkProof, + MetaHash: proofWithHeader.Opts.MetaHash, + ParentHash: proofWithHeader.Opts.ParentHash, + BlockHash: proofWithHeader.Opts.BlockHash, + SignalRoot: proofWithHeader.Opts.SignalRoot, + Graffiti: s.graffiti, + Proofs: zkProof, } var circuitsIdx uint16 @@ -241,7 +239,7 @@ func (s *ValidProofSubmitter) SubmitProof( return err } } - evidence.Proof = append(uint16ToBytes(circuitsIdx), evidence.Proof...) + evidence.Proofs = append(uint16ToBytes(circuitsIdx), evidence.Proofs...) evidence.Prover = prover input, err := encoding.EncodeProveBlockInput(evidence) @@ -263,7 +261,7 @@ func (s *ValidProofSubmitter) SubmitProof( s.mutex.Lock() defer s.mutex.Unlock() - return s.rpc.TaikoL1.ProveBlock(txOpts, blockID, input) + return s.rpc.TaikoL1.ProveBlock(txOpts, blockID.Uint64(), input) } var maxRetry = &s.submissionMaxRetry diff --git a/prover/proof_submitter/valid_proof_submitter_test.go b/prover/proof_submitter/valid_proof_submitter_test.go index 36c919a78..0cd36ada1 100644 --- a/prover/proof_submitter/valid_proof_submitter_test.go +++ b/prover/proof_submitter/valid_proof_submitter_test.go @@ -3,6 +3,8 @@ package submitter import ( "bytes" "context" + "fmt" + "math/big" "os" "sync" "testing" @@ -17,6 +19,7 @@ import ( "github.com/taikoxyz/taiko-client/driver/chain_syncer/calldata" "github.com/taikoxyz/taiko-client/driver/state" "github.com/taikoxyz/taiko-client/proposer" + "github.com/taikoxyz/taiko-client/prover/http" proofProducer "github.com/taikoxyz/taiko-client/prover/proof_producer" "github.com/taikoxyz/taiko-client/testutils" ) @@ -28,11 +31,15 @@ type ProofSubmitterTestSuite struct { proposer *proposer.Proposer validProofCh chan *proofProducer.ProofWithHeader invalidProofCh chan *proofProducer.ProofWithHeader + srv *http.Server + cancel context.CancelFunc } func (s *ProofSubmitterTestSuite) SetupTest() { s.ClientTestSuite.SetupTest() + port := testutils.RandomPort() + l1ProverPrivKey, err := crypto.ToECDSA(common.Hex2Bytes(os.Getenv("L1_PROVER_PRIVATE_KEY"))) s.Nil(err) @@ -80,17 +87,27 @@ func (s *ProofSubmitterTestSuite) SetupTest() { L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), + TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), L1ProposerPrivKey: l1ProposerPrivKey, L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), ProposeInterval: &proposeInterval, // No need to periodically propose transactions list in unit tests MaxProposedTxListsPerEpoch: 1, WaitReceiptTimeout: 10 * time.Second, + ProverEndpoints: []string{fmt.Sprintf("http://localhost:%v", port)}, + BlockProposalFee: big.NewInt(1000), + BlockProposalFeeIterations: 3, }))) + srv, cancel, err := testutils.HTTPServer(&s.ClientTestSuite, port) + s.Nil(err) + + s.srv = srv + s.cancel = cancel s.proposer = prop } func (s *ProofSubmitterTestSuite) TestValidProofSubmitterRequestProofDeadlineExceeded() { + defer s.cancel() ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) defer cancel() @@ -101,11 +118,12 @@ func (s *ProofSubmitterTestSuite) TestValidProofSubmitterRequestProofDeadlineExc } func (s *ProofSubmitterTestSuite) TestValidProofSubmitterSubmitProofMetadataNotFound() { + defer s.cancel() s.Error( s.validProofSubmitter.SubmitProof( context.Background(), &proofProducer.ProofWithHeader{ BlockID: common.Big256, - Meta: &bindings.TaikoDataBlockMetadata{Treasury: s.TestAddr}, + Meta: &bindings.TaikoDataBlockMetadata{}, Header: &types.Header{}, ZkProof: bytes.Repeat([]byte{0xff}, 100), }, @@ -114,6 +132,7 @@ func (s *ProofSubmitterTestSuite) TestValidProofSubmitterSubmitProofMetadataNotF } func (s *ProofSubmitterTestSuite) TestValidSubmitProofs() { + defer s.cancel() events := testutils.ProposeAndInsertEmptyBlocks(&s.ClientTestSuite, s.proposer, s.calldataSyncer) for _, e := range events { @@ -124,6 +143,7 @@ func (s *ProofSubmitterTestSuite) TestValidSubmitProofs() { } func (s *ProofSubmitterTestSuite) TestValidProofSubmitterRequestProofCancelled() { + defer s.cancel() ctx, cancel := context.WithCancel(context.Background()) go func() { time.AfterFunc(2*time.Second, func() { diff --git a/prover/prover.go b/prover/prover.go index cd4cd9129..dd864df3c 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -2,9 +2,10 @@ package prover import ( "context" + "errors" "fmt" - "math" "math/big" + netHttp "net/http" "strings" "sync" "time" @@ -22,13 +23,15 @@ import ( "github.com/taikoxyz/taiko-client/metrics" eventIterator "github.com/taikoxyz/taiko-client/pkg/chain_iterator/event_iterator" "github.com/taikoxyz/taiko-client/pkg/rpc" + "github.com/taikoxyz/taiko-client/prover/http" proofProducer "github.com/taikoxyz/taiko-client/prover/proof_producer" proofSubmitter "github.com/taikoxyz/taiko-client/prover/proof_submitter" "github.com/urfave/cli/v2" ) var ( - zeroAddress = common.HexToAddress("0x0000000000000000000000000000000000000000") + errNoCapacity = errors.New("no prover capacity available") + zeroAddress = common.HexToAddress("0x0000000000000000000000000000000000000000") ) type cancelFunc func() @@ -43,6 +46,9 @@ type Prover struct { // Clients rpc *rpc.Client + // HTTP Server + srv *http.Server + // Contract configurations protocolConfigs *bindings.TaikoDataConfig @@ -63,8 +69,6 @@ type Prover struct { blockProvenSub event.Subscription blockVerifiedCh chan *bindings.TaikoL1ClientBlockVerified blockVerifiedSub event.Subscription - proverSlashedCh chan *bindings.TaikoL1ProverPoolSlashed - proverSlashedSub event.Subscription proveNotify chan struct{} // Proof related @@ -83,6 +87,12 @@ type Prover struct { // interval settings checkProofWindowExpiredInterval time.Duration + // capacity-related configs + maxCapacity uint64 + currentCapacity uint64 + requestCurrentCapacityCh chan struct{} + receiveCurrentCapacityCh chan uint64 + ctx context.Context wg sync.WaitGroup } @@ -105,17 +115,33 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { p.currentBlocksBeingProvenMutex = &sync.Mutex{} p.currentBlocksWaitingForProofWindow = make(map[uint64]uint64, 0) p.currentBlocksWaitingForProofWindowMutex = &sync.Mutex{} + p.maxCapacity = cfg.Capacity + p.currentCapacity = cfg.Capacity + p.requestCurrentCapacityCh = make(chan struct{}, 1024) + p.receiveCurrentCapacityCh = make(chan uint64, 1024) + + if !p.cfg.OracleProver { + p.srv, err = http.NewServer(http.NewServerOpts{ + ProverPrivateKey: p.cfg.L1ProverPrivKey, + MaxCapacity: p.cfg.Capacity, + MinProofFee: p.cfg.MinProofFee, + RequestCurrentCapacityCh: p.requestCurrentCapacityCh, + ReceiveCurrentCapacityCh: p.receiveCurrentCapacityCh, + }) + if err != nil { + return err + } + } // Clients if p.rpc, err = rpc.NewClient(p.ctx, &rpc.ClientConfig{ - L1Endpoint: cfg.L1WsEndpoint, - L2Endpoint: cfg.L2WsEndpoint, - TaikoL1Address: cfg.TaikoL1Address, - TaikoL2Address: cfg.TaikoL2Address, - TaikoProverPoolL1Address: cfg.TaikoProverPoolL1Address, - RetryInterval: cfg.BackOffRetryInterval, - Timeout: cfg.RPCTimeout, - BackOffMaxRetrys: new(big.Int).SetUint64(p.cfg.BackOffMaxRetrys), + L1Endpoint: cfg.L1WsEndpoint, + L2Endpoint: cfg.L2WsEndpoint, + TaikoL1Address: cfg.TaikoL1Address, + TaikoL2Address: cfg.TaikoL2Address, + RetryInterval: cfg.BackOffRetryInterval, + Timeout: cfg.RPCTimeout, + BackOffMaxRetrys: new(big.Int).SetUint64(p.cfg.BackOffMaxRetrys), }); err != nil { return err } @@ -132,12 +158,11 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { p.submitProofTxMutex = &sync.Mutex{} p.proverAddress = crypto.PubkeyToAddress(p.cfg.L1ProverPrivKey.PublicKey) - chBufferSize := p.protocolConfigs.BlockMaxProposals.Uint64() + chBufferSize := p.protocolConfigs.BlockMaxProposals p.blockProposedCh = make(chan *bindings.TaikoL1ClientBlockProposed, chBufferSize) p.blockVerifiedCh = make(chan *bindings.TaikoL1ClientBlockVerified, chBufferSize) p.blockProvenCh = make(chan *bindings.TaikoL1ClientBlockProven, chBufferSize) p.proofGenerationCh = make(chan *proofProducer.ProofWithHeader, chBufferSize) - p.proverSlashedCh = make(chan *bindings.TaikoL1ProverPoolSlashed, chBufferSize) p.proveNotify = make(chan struct{}, 1) if err := p.initL1Current(cfg.StartingBlockID); err != nil { return fmt.Errorf("initialize L1 current cursor error: %w", err) @@ -206,11 +231,31 @@ func InitFromConfig(ctx context.Context, p *Prover, cfg *Config) (err error) { func (p *Prover) Start() error { p.wg.Add(1) p.initSubscription() + if !p.cfg.OracleProver { + go func() { + if err := p.srv.Start(fmt.Sprintf(":%v", p.cfg.HTTPServerPort)); !errors.Is(err, netHttp.ErrServerClosed) { + log.Crit("Failed to start http server", "error", err) + } + }() + } go p.eventLoop() + go p.watchCurrentCapacity() return nil } +func (p *Prover) watchCurrentCapacity() { + for { + select { + case <-p.ctx.Done(): + return + case <-p.requestCurrentCapacityCh: + log.Info("Received request for current capacity", "currentCapacity", p.currentCapacity) + p.receiveCurrentCapacityCh <- p.currentCapacity + } + } +} + // eventLoop starts the main loop of Taiko prover. func (p *Prover) eventLoop() { defer func() { @@ -261,7 +306,7 @@ func (p *Prover) eventLoop() { func() { defer func() { checkProofWindowExpiredTicker = time.After(p.checkProofWindowExpiredInterval) }() if err := p.checkProofWindowsExpired(p.ctx); err != nil { - log.Error("error checking proof window expired", "error", err) + log.Error("Failed to check if proof window is expired", "error", err) } }() case proofWithHeader := <-p.proofGenerationCh: @@ -280,12 +325,6 @@ func (p *Prover) eventLoop() { if err := p.onBlockProven(p.ctx, e); err != nil { log.Error("Handle BlockProven event error", "error", err) } - case e := <-p.proverSlashedCh: - if e.Addr.Hex() == p.proverAddress.Hex() { - log.Info("Prover slashed", "blockID", e.BlockId, "address", e.Addr.Hex(), "amount", e.Amount) - metrics.ProverSlashedCounter.Inc(1) - metrics.ProverSlashedAmount.Inc(int64(e.Amount)) - } case <-forceProvingTicker.C: reqProving() } @@ -293,8 +332,11 @@ func (p *Prover) eventLoop() { } // Close closes the prover instance. -func (p *Prover) Close() { +func (p *Prover) Close(ctx context.Context) { p.closeSubscription() + if err := p.srv.Shutdown(ctx); err != nil { + log.Error("Error shutting down http server", "error", err) + } p.wg.Wait() } @@ -454,7 +496,7 @@ func (p *Prover) onBlockProposed( p.cancelProof(ctx, event.Meta.Id) } - block, err := p.rpc.TaikoL1.GetBlock(&bind.CallOpts{Context: ctx}, event.BlockId) + block, err := p.rpc.TaikoL1.GetBlock(&bind.CallOpts{Context: ctx}, event.BlockId.Uint64()) if err != nil { return err } @@ -462,9 +504,8 @@ func (p *Prover) onBlockProposed( log.Info( "Proposed block information", "blockID", event.BlockId, - "prover", block.AssignedProver.Hex(), + "prover", block.Prover, "proposedAt", block.ProposedAt, - "proofWindow", block.ProofWindow, ) var skipProofWindowExpiredCheck bool @@ -479,9 +520,8 @@ func (p *Prover) onBlockProposed( // and always submit proof. otherwise, oracleProver follows same proof logic as regular. forkChoice, err := p.rpc.TaikoL1.GetForkChoice( &bind.CallOpts{Context: ctx}, - event.BlockId, + event.BlockId.Uint64(), parent.Hash(), - uint32(parent.GasUsed), ) if err != nil { if strings.Contains(encoding.TryParsingCustomError(err).Error(), "L1_FORK_CHOICE_NOT_FOUND") { @@ -519,16 +559,16 @@ func (p *Prover) onBlockProposed( } if !skipProofWindowExpiredCheck { - proofWindowExpiresAt := block.ProposedAt + block.ProofWindow + proofWindowExpiresAt := block.ProposedAt + uint64(p.protocolConfigs.ProofWindow) proofWindowExpired := uint64(time.Now().Unix()) > proofWindowExpiresAt // zero address means anyone can prove, proofWindowExpired means anyone can prove even if not zero address - if block.AssignedProver != p.proverAddress && block.AssignedProver != zeroAddress && !proofWindowExpired { + if block.Prover != p.proverAddress && !proofWindowExpired { log.Info( "Proposed block not proveable", "blockID", event.BlockId, "prover", - block.AssignedProver.Hex(), + block.Prover.Hex(), "proofWindowExpiresAt", proofWindowExpiresAt, "timeToExpire", @@ -542,7 +582,7 @@ func (p *Prover) onBlockProposed( "blockID", event.BlockId, "prover", - block.AssignedProver.Hex(), + block.Prover.Hex(), "proofWindowExpiresAt", proofWindowExpiresAt, ) @@ -557,9 +597,9 @@ func (p *Prover) onBlockProposed( // if set not to prove unassigned blocks, this block is still not provable // by us even though its open proving. - if (block.AssignedProver == zeroAddress || proofWindowExpired) && !p.cfg.ProveUnassignedBlocks { + if proofWindowExpired && !p.cfg.ProveUnassignedBlocks { log.Info( - "Skipping proposed open proving block, not assigned to us", + "Skipping proofWindowExpired block", "blockID", event.BlockId, ) return nil @@ -568,7 +608,7 @@ func (p *Prover) onBlockProposed( log.Info( "Proposed block is proveable", "blockID", event.BlockId, - "prover", block.AssignedProver.Hex(), + "prover", block.Prover.Hex(), "proofWindowExpired", proofWindowExpired, ) @@ -585,6 +625,14 @@ func (p *Prover) onBlockProposed( }) p.currentBlocksBeingProvenMutex.Unlock() + if !p.cfg.OracleProver { + if p.currentCapacity == 0 { + return errNoCapacity + } + + p.currentCapacity-- + } + return p.validProofSubmitter.RequestProof(ctx, event) } @@ -625,6 +673,10 @@ func (p *Prover) submitProofOp(ctx context.Context, proofWithHeader *proofProduc if err := backoff.Retry( func() error { + if !p.cfg.OracleProver { + p.currentCapacity++ + } + err := p.validProofSubmitter.SubmitProof(p.ctx, proofWithHeader) if err != nil { log.Error("Submit proof error", "error", err) @@ -645,24 +697,13 @@ func (p *Prover) submitProofOp(ctx context.Context, proofWithHeader *proofProduc func (p *Prover) onBlockVerified(ctx context.Context, event *bindings.TaikoL1ClientBlockVerified) error { metrics.ProverLatestVerifiedIDGauge.Update(event.BlockId.Int64()) - var reward int64 - if event.ProofReward > math.MaxInt64 { - reward = math.MaxInt64 - } else { - reward = int64(event.ProofReward) - } - metrics.ProverAllProofRewardGauge.Update(reward) - if event.Prover == p.proverAddress { - metrics.ProverProofRewardGauge.Update(reward) - } - p.latestVerifiedL1Height = event.Raw.BlockNumber log.Info( "New verified block", "blockID", event.BlockId, "hash", common.BytesToHash(event.BlockHash[:]), - "reward", event.ProofReward, + "prover", event.Prover, ) // cancel any proofs being generated for this block @@ -685,7 +726,6 @@ func (p *Prover) onBlockProven(ctx context.Context, event *bindings.TaikoL1Clien isValidProof, err := p.isValidProof( ctx, event.BlockId.Uint64(), - uint64(event.ParentGasUsed), event.ParentHash, event.BlockHash, ) @@ -776,7 +816,6 @@ func (p *Prover) initSubscription() { p.blockProposedSub = rpc.SubscribeBlockProposed(p.rpc.TaikoL1, p.blockProposedCh) p.blockVerifiedSub = rpc.SubscribeBlockVerified(p.rpc.TaikoL1, p.blockVerifiedCh) p.blockProvenSub = rpc.SubscribeBlockProven(p.rpc.TaikoL1, p.blockProvenCh) - p.proverSlashedSub = rpc.SubscribeSlashed(p.rpc.TaikoProverPoolL1, p.proverSlashedCh) } // closeSubscription closes all subscriptions. @@ -817,7 +856,6 @@ func (p *Prover) checkChainVerification(lastLatestVerifiedL1Height uint64) error func (p *Prover) isValidProof( ctx context.Context, blockID uint64, - parentGasUsed uint64, parentHash common.Hash, blockHash common.Hash, ) (bool, error) { @@ -831,7 +869,7 @@ func (p *Prover) isValidProof( return false, err } - if parent.GasUsed == parentGasUsed && parent.Hash() == parentHash && blockHash == block.Hash() { + if parent.Hash() == parentHash && blockHash == block.Hash() { return true, nil } @@ -868,12 +906,12 @@ func (p *Prover) checkProofWindowsExpired(ctx context.Context) error { // checkProofWindowExpired checks a single instance of a block to see if its proof winodw has expired // and the proof is now able to be submitted by anyone, not just the blocks assigned prover. func (p *Prover) checkProofWindowExpired(ctx context.Context, l1Height, blockId uint64) error { - block, err := p.rpc.TaikoL1.GetBlock(&bind.CallOpts{Context: ctx}, new(big.Int).SetUint64(blockId)) + block, err := p.rpc.TaikoL1.GetBlock(&bind.CallOpts{Context: ctx}, blockId) if err != nil { return encoding.TryParsingCustomError(err) } - isExpired := time.Now().Unix() > int64(block.ProposedAt)+int64(block.ProofWindow) + isExpired := time.Now().Unix() > int64(block.ProposedAt)+int64(p.protocolConfigs.ProofWindow) if isExpired { log.Debug( @@ -892,9 +930,8 @@ func (p *Prover) checkProofWindowExpired(ctx context.Context, l1Height, blockId forkChoice, err := p.rpc.TaikoL1.GetForkChoice( &bind.CallOpts{Context: ctx}, - new(big.Int).SetUint64(blockId), + blockId, parent.Hash(), - uint32(parent.GasUsed), ) if err != nil && !strings.Contains(encoding.TryParsingCustomError(err).Error(), "L1_FORK_CHOICE_NOT_FOUND") { @@ -988,6 +1025,10 @@ func (p *Prover) requestProofForBlockId(blockId *big.Int, l1Height *big.Int) err return err } + if !p.cfg.OracleProver { + p.currentCapacity-- + } + return nil } diff --git a/prover/prover_test.go b/prover/prover_test.go index 8913b52c4..1e1c74e7c 100644 --- a/prover/prover_test.go +++ b/prover/prover_test.go @@ -2,6 +2,8 @@ package prover import ( "context" + "fmt" + "math/big" "os" "testing" "time" @@ -14,6 +16,7 @@ import ( "github.com/taikoxyz/taiko-client/driver" "github.com/taikoxyz/taiko-client/pkg/jwt" "github.com/taikoxyz/taiko-client/proposer" + "github.com/taikoxyz/taiko-client/prover/http" producer "github.com/taikoxyz/taiko-client/prover/proof_producer" "github.com/taikoxyz/taiko-client/testutils" ) @@ -26,6 +29,10 @@ type ProverTestSuite struct { proposer *proposer.Proposer } +var ( + port = testutils.RandomPort() +) + func (s *ProverTestSuite) SetupTest() { s.ClientTestSuite.SetupTest() @@ -42,17 +49,23 @@ func (s *ProverTestSuite) SetupTest() { L2HttpEndpoint: os.Getenv("L2_EXECUTION_ENGINE_HTTP_ENDPOINT"), TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), - TaikoProverPoolL1Address: common.HexToAddress(os.Getenv("TAIKO_PROVER_POOL_L1_ADDRESS")), L1ProverPrivKey: l1ProverPrivKey, OracleProverPrivateKey: l1ProverPrivKey, + OracleProver: false, Dummy: true, MaxConcurrentProvingJobs: 1, CheckProofWindowExpiredInterval: 5 * time.Second, ProveUnassignedBlocks: true, + Capacity: 100, + MinProofFee: big.NewInt(1), }))) s.p = p s.cancel = cancel + go func() { + _ = s.p.srv.Start(fmt.Sprintf(":%v", port)) + }() + // Init driver jwtSecret, err := jwt.ParseSecretFromFile(os.Getenv("JWT_SECRET")) s.Nil(err) @@ -81,14 +94,20 @@ func (s *ProverTestSuite) SetupTest() { L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), + TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), L1ProposerPrivKey: l1ProposerPrivKey, L2SuggestedFeeRecipient: common.HexToAddress(os.Getenv("L2_SUGGESTED_FEE_RECIPIENT")), ProposeInterval: &proposeInterval, // No need to periodically propose transactions list in unit tests MaxProposedTxListsPerEpoch: 1, WaitReceiptTimeout: 10 * time.Second, + ProverEndpoints: []string{fmt.Sprintf("http://localhost:%v", port)}, + BlockProposalFee: big.NewInt(1000), + BlockProposalFeeIterations: 3, }))) s.proposer = prop + + go s.p.watchCurrentCapacity() } func (s *ProverTestSuite) TestName() { @@ -110,7 +129,6 @@ func (s *ProverTestSuite) TestInitError() { L2HttpEndpoint: os.Getenv("L2_EXECUTION_ENGINE_HTTP_ENDPOINT"), TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), - TaikoProverPoolL1Address: common.HexToAddress(os.Getenv("TAIKO_PROVER_POOL_L1_ADDRESS")), L1ProverPrivKey: l1ProverPrivKey, OracleProverPrivateKey: l1ProverPrivKey, Dummy: true, @@ -154,7 +172,7 @@ func (s *ProverTestSuite) TestSubmitProofOp() { s.NotPanics(func() { s.p.submitProofOp(context.Background(), &producer.ProofWithHeader{ BlockID: common.Big1, - Meta: &bindings.TaikoDataBlockMetadata{Treasury: s.TestAddr}, + Meta: &bindings.TaikoDataBlockMetadata{}, Header: &types.Header{}, ZkProof: []byte{}, }) @@ -162,7 +180,7 @@ func (s *ProverTestSuite) TestSubmitProofOp() { s.NotPanics(func() { s.p.submitProofOp(context.Background(), &producer.ProofWithHeader{ BlockID: common.Big1, - Meta: &bindings.TaikoDataBlockMetadata{Treasury: s.TestAddr}, + Meta: &bindings.TaikoDataBlockMetadata{}, Header: &types.Header{}, ZkProof: []byte{}, }) @@ -181,9 +199,15 @@ func (s *ProverTestSuite) TestCheckChainVerification() { } func (s *ProverTestSuite) TestStartClose() { + l1ProverPrivKey, err := crypto.ToECDSA(common.Hex2Bytes(os.Getenv("L1_PROVER_PRIVATE_KEY"))) + s.Nil(err) + + s.p.srv, _ = http.NewServer(http.NewServerOpts{ + ProverPrivateKey: l1ProverPrivKey, + }) s.Nil(s.p.Start()) s.cancel() - s.NotPanics(s.p.Close) + s.NotPanics(func() { s.p.Close(context.Background()) }) } func TestProverTestSuite(t *testing.T) { diff --git a/scripts/gen_bindings.sh b/scripts/gen_bindings.sh index 94528ea34..75bd002e4 100755 --- a/scripts/gen_bindings.sh +++ b/scripts/gen_bindings.sh @@ -35,10 +35,10 @@ cat ${TAIKO_MONO_DIR}/packages/protocol/out/TaikoL2.sol/TaikoL2.json | jq .abi | ${ABIGEN_BIN} --abi - --type TaikoL2Client --pkg bindings --out $DIR/../bindings/gen_taiko_l2.go -cat ${TAIKO_MONO_DIR}/packages/protocol/out/ProverPool.sol/ProverPool.json | +cat ${TAIKO_MONO_DIR}/packages/protocol/out/TaikoToken.sol/TaikoToken.json | jq .abi | - ${ABIGEN_BIN} --abi - --type TaikoL1ProverPool --pkg bindings --out $DIR/../bindings/gen_taiko_prover_pool_l1.go - + ${ABIGEN_BIN} --abi - --type TaikoToken --pkg bindings --out $DIR/../bindings/gen_taiko_token.go + git -C ${TAIKO_MONO_DIR} log --format="%H" -n 1 >./bindings/.githead echo "🍻 Go contract bindings generated!" diff --git a/testutils/helper.go b/testutils/helper.go index e9afd3e40..928d651b2 100644 --- a/testutils/helper.go +++ b/testutils/helper.go @@ -3,8 +3,10 @@ package testutils import ( "context" "crypto/ecdsa" + "fmt" "math/big" "math/rand" + "os" "time" "github.com/ethereum/go-ethereum/accounts/abi/bind" @@ -14,8 +16,10 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rlp" + "github.com/phayes/freeport" "github.com/taikoxyz/taiko-client/bindings" "github.com/taikoxyz/taiko-client/bindings/encoding" + "github.com/taikoxyz/taiko-client/prover/http" ) func ProposeInvalidTxListBytes(s *ClientTestSuite, proposer Proposer) { @@ -175,6 +179,45 @@ func DepositEtherToL2(s *ClientTestSuite, depositerPrivKey *ecdsa.PrivateKey, re } } +// HTTPServer starts a new prover server that has channel listeners to respond and react +// to requests for capacity, which provers can call. +func HTTPServer(s *ClientTestSuite, port int) (*http.Server, func(), error) { + l1ProverPrivKey, err := crypto.ToECDSA(common.Hex2Bytes(os.Getenv("L1_PROVER_PRIVATE_KEY"))) + s.Nil(err) + + serverOpts := http.NewServerOpts{ + ProverPrivateKey: l1ProverPrivKey, + MinProofFee: big.NewInt(1), + MaxCapacity: 10, + RequestCurrentCapacityCh: make(chan struct{}), + ReceiveCurrentCapacityCh: make(chan uint64), + } + + srv, err := http.NewServer(serverOpts) + s.Nil(err) + + ctx, cancel := context.WithCancel(context.Background()) + go func() { + for { + select { + case <-serverOpts.RequestCurrentCapacityCh: + serverOpts.ReceiveCurrentCapacityCh <- 100 + case <-ctx.Done(): + return + } + } + }() + + go func() { + _ = srv.Start(fmt.Sprintf(":%v", port)) + }() + + return srv, func() { + cancel() + _ = srv.Shutdown(ctx) + }, err +} + // RandomHash generates a random blob of data and returns it as a hash. func RandomHash() common.Hash { var hash common.Hash @@ -193,6 +236,15 @@ func RandomBytes(size int) (b []byte) { return } +// RandomPort returns a local free random port. +func RandomPort() int { + port, err := freeport.GetFreePort() + if err != nil { + log.Crit("Failed to get local free random port", "err", err) + } + return port +} + // SignatureFromRSV creates the signature bytes from r,s,v. func SignatureFromRSV(r, s string, v byte) []byte { return append(append(hexutil.MustDecode(r), hexutil.MustDecode(s)...), v) diff --git a/testutils/suite.go b/testutils/suite.go index edac74126..83bf62fb4 100644 --- a/testutils/suite.go +++ b/testutils/suite.go @@ -3,7 +3,6 @@ package testutils import ( "context" "crypto/ecdsa" - "math" "math/big" "os" @@ -54,56 +53,38 @@ func (s *ClientTestSuite) SetupTest() { s.NotEmpty(jwtSecret) rpcCli, err := rpc.NewClient(context.Background(), &rpc.ClientConfig{ - L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), - L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), - TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), - TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), - TaikoProverPoolL1Address: common.HexToAddress(os.Getenv("TAIKO_PROVER_POOL_L1_ADDRESS")), - L2EngineEndpoint: os.Getenv("L2_EXECUTION_ENGINE_AUTH_ENDPOINT"), - JwtSecret: string(jwtSecret), - RetryInterval: backoff.DefaultMaxInterval, + L1Endpoint: os.Getenv("L1_NODE_WS_ENDPOINT"), + L2Endpoint: os.Getenv("L2_EXECUTION_ENGINE_WS_ENDPOINT"), + TaikoL1Address: common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), + TaikoL2Address: common.HexToAddress(os.Getenv("TAIKO_L2_ADDRESS")), + TaikoTokenAddress: common.HexToAddress(os.Getenv("TAIKO_TOKEN_ADDRESS")), + L2EngineEndpoint: os.Getenv("L2_EXECUTION_ENGINE_AUTH_ENDPOINT"), + JwtSecret: string(jwtSecret), + RetryInterval: backoff.DefaultMaxInterval, }) s.Nil(err) s.RpcClient = rpcCli - // set allowance - l1ProposerPrivKey, err := crypto.ToECDSA(common.Hex2Bytes(os.Getenv("L1_PROPOSER_PRIVATE_KEY"))) - s.Nil(err) - - proposerOpts, err := bind.NewKeyedTransactorWithChainID(l1ProposerPrivKey, rpcCli.L1ChainID) - s.Nil(err) - - // register prover as a staker/eligible prover - l1ProverPrivKey, err := crypto.ToECDSA(common.Hex2Bytes(os.Getenv("L1_PROVER_PRIVATE_KEY"))) s.Nil(err) - proverOpts, err := bind.NewKeyedTransactorWithChainID(l1ProverPrivKey, rpcCli.L1ChainID) + tokenBalance, err := rpcCli.TaikoL1.GetTaikoTokenBalance(nil, crypto.PubkeyToAddress(l1ProverPrivKey.PublicKey)) s.Nil(err) - proverInfo, err := s.RpcClient.TaikoProverPoolL1.GetStaker(nil, crypto.PubkeyToAddress(l1ProverPrivKey.PublicKey)) - s.Nil(err) - - if proverInfo.Staker.ProverId == 0 { - _, err = s.RpcClient.TaikoL1.DepositTaikoToken(proposerOpts, new(big.Int).SetUint64(uint64(math.Pow(2, 32)))) + if tokenBalance.Cmp(common.Big0) == 0 { + opts, err := bind.NewKeyedTransactorWithChainID(l1ProverPrivKey, rpcCli.L1ChainID) s.Nil(err) - minStakePerCapacity, err := s.RpcClient.TaikoProverPoolL1.MINSTAKEPERCAPACITY(nil) - s.Nil(err) + premintAmount, ok := new(big.Int).SetString(os.Getenv("PREMINT_TOKEN_AMOUNT"), 10) + s.True(ok) + s.True(premintAmount.Cmp(common.Big0) > 0) - capacity, err := s.RpcClient.TaikoProverPoolL1.MINCAPACITY(nil) + _, err = rpcCli.TaikoToken.Approve(opts, common.HexToAddress(os.Getenv("TAIKO_L1_ADDRESS")), premintAmount) s.Nil(err) - amt := new(big.Int).Mul(big.NewInt(int64(minStakePerCapacity)), big.NewInt(int64(capacity))) - - rewardPerGas := 1 + tx, err := rpcCli.TaikoL1.DepositTaikoToken(opts, premintAmount) s.Nil(err) - _, err = s.RpcClient.TaikoProverPoolL1.Stake( - proverOpts, - amt.Uint64(), - uint32(rewardPerGas), - capacity, - ) + _, err = rpc.WaitReceipt(context.Background(), rpcCli.L1, tx) s.Nil(err) }