diff --git a/Makefile b/Makefile index 870d4deb..06b8fb36 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,8 @@ CONTRACT_NAMES = channel \ Moon \ OptimisticLightClient \ OptimisticProofVerifier \ + SequencerSoloClient \ + SequencerSignatureVerifier \ UniversalChannelHandler # Create the pattern for each contract diff --git a/bindings/go/sequencersignatureverifier/SequencerSignatureVerifier.go b/bindings/go/sequencersignatureverifier/SequencerSignatureVerifier.go new file mode 100644 index 00000000..6c02b8a7 --- /dev/null +++ b/bindings/go/sequencersignatureverifier/SequencerSignatureVerifier.go @@ -0,0 +1,350 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package sequencersignatureverifier + +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 +) + +// Ics23Proof is an auto generated low-level Go binding around an user-defined struct. +type Ics23Proof struct { + Proof []OpIcs23Proof + Height *big.Int +} + +// OpIcs23Proof is an auto generated low-level Go binding around an user-defined struct. +type OpIcs23Proof struct { + Path []OpIcs23ProofPath + Key []byte + Value []byte + Prefix []byte +} + +// OpIcs23ProofPath is an auto generated low-level Go binding around an user-defined struct. +type OpIcs23ProofPath struct { + Prefix []byte + Suffix []byte +} + +// SequencerSignatureVerifierMetaData contains all meta data concerning the SequencerSignatureVerifier contract. +var SequencerSignatureVerifierMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"sequencer_\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"chainId_\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"CHAIN_ID\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"SEQUENCER\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifyMembership\",\"inputs\":[{\"name\":\"appHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"key\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofs\",\"type\":\"tuple\",\"internalType\":\"structIcs23Proof\",\"components\":[{\"name\":\"proof\",\"type\":\"tuple[]\",\"internalType\":\"structOpIcs23Proof[]\",\"components\":[{\"name\":\"path\",\"type\":\"tuple[]\",\"internalType\":\"structOpIcs23ProofPath[]\",\"components\":[{\"name\":\"prefix\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"suffix\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"key\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"prefix\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"height\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"verifyNonMembership\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIcs23Proof\",\"components\":[{\"name\":\"proof\",\"type\":\"tuple[]\",\"internalType\":\"structOpIcs23Proof[]\",\"components\":[{\"name\":\"path\",\"type\":\"tuple[]\",\"internalType\":\"structOpIcs23ProofPath[]\",\"components\":[{\"name\":\"prefix\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"suffix\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"key\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"prefix\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"height\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"verifyStateUpdate\",\"inputs\":[{\"name\":\"l2BlockNumber\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"appHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"l1BlockHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"view\"},{\"type\":\"error\",\"name\":\"InvalidAppHash\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidIbcStateProof\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidL1BlockHash\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidL1BlockNumber\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidPacketProof\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidProofKey\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidProofValue\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidRLPEncodedL1BlockNumber\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidRLPEncodedL1StateRoot\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidSequencerSignature\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"MethodNotImplemented\",\"inputs\":[]}]", +} + +// SequencerSignatureVerifierABI is the input ABI used to generate the binding from. +// Deprecated: Use SequencerSignatureVerifierMetaData.ABI instead. +var SequencerSignatureVerifierABI = SequencerSignatureVerifierMetaData.ABI + +// SequencerSignatureVerifier is an auto generated Go binding around an Ethereum contract. +type SequencerSignatureVerifier struct { + SequencerSignatureVerifierCaller // Read-only binding to the contract + SequencerSignatureVerifierTransactor // Write-only binding to the contract + SequencerSignatureVerifierFilterer // Log filterer for contract events +} + +// SequencerSignatureVerifierCaller is an auto generated read-only Go binding around an Ethereum contract. +type SequencerSignatureVerifierCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SequencerSignatureVerifierTransactor is an auto generated write-only Go binding around an Ethereum contract. +type SequencerSignatureVerifierTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SequencerSignatureVerifierFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type SequencerSignatureVerifierFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SequencerSignatureVerifierSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type SequencerSignatureVerifierSession struct { + Contract *SequencerSignatureVerifier // 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 +} + +// SequencerSignatureVerifierCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type SequencerSignatureVerifierCallerSession struct { + Contract *SequencerSignatureVerifierCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// SequencerSignatureVerifierTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type SequencerSignatureVerifierTransactorSession struct { + Contract *SequencerSignatureVerifierTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SequencerSignatureVerifierRaw is an auto generated low-level Go binding around an Ethereum contract. +type SequencerSignatureVerifierRaw struct { + Contract *SequencerSignatureVerifier // Generic contract binding to access the raw methods on +} + +// SequencerSignatureVerifierCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type SequencerSignatureVerifierCallerRaw struct { + Contract *SequencerSignatureVerifierCaller // Generic read-only contract binding to access the raw methods on +} + +// SequencerSignatureVerifierTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type SequencerSignatureVerifierTransactorRaw struct { + Contract *SequencerSignatureVerifierTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewSequencerSignatureVerifier creates a new instance of SequencerSignatureVerifier, bound to a specific deployed contract. +func NewSequencerSignatureVerifier(address common.Address, backend bind.ContractBackend) (*SequencerSignatureVerifier, error) { + contract, err := bindSequencerSignatureVerifier(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &SequencerSignatureVerifier{SequencerSignatureVerifierCaller: SequencerSignatureVerifierCaller{contract: contract}, SequencerSignatureVerifierTransactor: SequencerSignatureVerifierTransactor{contract: contract}, SequencerSignatureVerifierFilterer: SequencerSignatureVerifierFilterer{contract: contract}}, nil +} + +// NewSequencerSignatureVerifierCaller creates a new read-only instance of SequencerSignatureVerifier, bound to a specific deployed contract. +func NewSequencerSignatureVerifierCaller(address common.Address, caller bind.ContractCaller) (*SequencerSignatureVerifierCaller, error) { + contract, err := bindSequencerSignatureVerifier(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &SequencerSignatureVerifierCaller{contract: contract}, nil +} + +// NewSequencerSignatureVerifierTransactor creates a new write-only instance of SequencerSignatureVerifier, bound to a specific deployed contract. +func NewSequencerSignatureVerifierTransactor(address common.Address, transactor bind.ContractTransactor) (*SequencerSignatureVerifierTransactor, error) { + contract, err := bindSequencerSignatureVerifier(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &SequencerSignatureVerifierTransactor{contract: contract}, nil +} + +// NewSequencerSignatureVerifierFilterer creates a new log filterer instance of SequencerSignatureVerifier, bound to a specific deployed contract. +func NewSequencerSignatureVerifierFilterer(address common.Address, filterer bind.ContractFilterer) (*SequencerSignatureVerifierFilterer, error) { + contract, err := bindSequencerSignatureVerifier(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &SequencerSignatureVerifierFilterer{contract: contract}, nil +} + +// bindSequencerSignatureVerifier binds a generic wrapper to an already deployed contract. +func bindSequencerSignatureVerifier(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := SequencerSignatureVerifierMetaData.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 (_SequencerSignatureVerifier *SequencerSignatureVerifierRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SequencerSignatureVerifier.Contract.SequencerSignatureVerifierCaller.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 (_SequencerSignatureVerifier *SequencerSignatureVerifierRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SequencerSignatureVerifier.Contract.SequencerSignatureVerifierTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SequencerSignatureVerifier *SequencerSignatureVerifierRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SequencerSignatureVerifier.Contract.SequencerSignatureVerifierTransactor.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 (_SequencerSignatureVerifier *SequencerSignatureVerifierCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SequencerSignatureVerifier.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 (_SequencerSignatureVerifier *SequencerSignatureVerifierTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SequencerSignatureVerifier.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SequencerSignatureVerifier *SequencerSignatureVerifierTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SequencerSignatureVerifier.Contract.contract.Transact(opts, method, params...) +} + +// CHAINID is a free data retrieval call binding the contract method 0x85e1f4d0. +// +// Solidity: function CHAIN_ID() view returns(bytes32) +func (_SequencerSignatureVerifier *SequencerSignatureVerifierCaller) CHAINID(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _SequencerSignatureVerifier.contract.Call(opts, &out, "CHAIN_ID") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// CHAINID is a free data retrieval call binding the contract method 0x85e1f4d0. +// +// Solidity: function CHAIN_ID() view returns(bytes32) +func (_SequencerSignatureVerifier *SequencerSignatureVerifierSession) CHAINID() ([32]byte, error) { + return _SequencerSignatureVerifier.Contract.CHAINID(&_SequencerSignatureVerifier.CallOpts) +} + +// CHAINID is a free data retrieval call binding the contract method 0x85e1f4d0. +// +// Solidity: function CHAIN_ID() view returns(bytes32) +func (_SequencerSignatureVerifier *SequencerSignatureVerifierCallerSession) CHAINID() ([32]byte, error) { + return _SequencerSignatureVerifier.Contract.CHAINID(&_SequencerSignatureVerifier.CallOpts) +} + +// SEQUENCER is a free data retrieval call binding the contract method 0x75fd4ca9. +// +// Solidity: function SEQUENCER() view returns(address) +func (_SequencerSignatureVerifier *SequencerSignatureVerifierCaller) SEQUENCER(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SequencerSignatureVerifier.contract.Call(opts, &out, "SEQUENCER") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// SEQUENCER is a free data retrieval call binding the contract method 0x75fd4ca9. +// +// Solidity: function SEQUENCER() view returns(address) +func (_SequencerSignatureVerifier *SequencerSignatureVerifierSession) SEQUENCER() (common.Address, error) { + return _SequencerSignatureVerifier.Contract.SEQUENCER(&_SequencerSignatureVerifier.CallOpts) +} + +// SEQUENCER is a free data retrieval call binding the contract method 0x75fd4ca9. +// +// Solidity: function SEQUENCER() view returns(address) +func (_SequencerSignatureVerifier *SequencerSignatureVerifierCallerSession) SEQUENCER() (common.Address, error) { + return _SequencerSignatureVerifier.Contract.SEQUENCER(&_SequencerSignatureVerifier.CallOpts) +} + +// VerifyMembership is a free data retrieval call binding the contract method 0xc2f0329f. +// +// Solidity: function verifyMembership(bytes32 appHash, bytes key, bytes value, (((bytes,bytes)[],bytes,bytes,bytes)[],uint256) proofs) pure returns() +func (_SequencerSignatureVerifier *SequencerSignatureVerifierCaller) VerifyMembership(opts *bind.CallOpts, appHash [32]byte, key []byte, value []byte, proofs Ics23Proof) error { + var out []interface{} + err := _SequencerSignatureVerifier.contract.Call(opts, &out, "verifyMembership", appHash, key, value, proofs) + + if err != nil { + return err + } + + return err + +} + +// VerifyMembership is a free data retrieval call binding the contract method 0xc2f0329f. +// +// Solidity: function verifyMembership(bytes32 appHash, bytes key, bytes value, (((bytes,bytes)[],bytes,bytes,bytes)[],uint256) proofs) pure returns() +func (_SequencerSignatureVerifier *SequencerSignatureVerifierSession) VerifyMembership(appHash [32]byte, key []byte, value []byte, proofs Ics23Proof) error { + return _SequencerSignatureVerifier.Contract.VerifyMembership(&_SequencerSignatureVerifier.CallOpts, appHash, key, value, proofs) +} + +// VerifyMembership is a free data retrieval call binding the contract method 0xc2f0329f. +// +// Solidity: function verifyMembership(bytes32 appHash, bytes key, bytes value, (((bytes,bytes)[],bytes,bytes,bytes)[],uint256) proofs) pure returns() +func (_SequencerSignatureVerifier *SequencerSignatureVerifierCallerSession) VerifyMembership(appHash [32]byte, key []byte, value []byte, proofs Ics23Proof) error { + return _SequencerSignatureVerifier.Contract.VerifyMembership(&_SequencerSignatureVerifier.CallOpts, appHash, key, value, proofs) +} + +// VerifyNonMembership is a free data retrieval call binding the contract method 0x2a6ded74. +// +// Solidity: function verifyNonMembership(bytes32 , bytes , (((bytes,bytes)[],bytes,bytes,bytes)[],uint256) ) pure returns() +func (_SequencerSignatureVerifier *SequencerSignatureVerifierCaller) VerifyNonMembership(opts *bind.CallOpts, arg0 [32]byte, arg1 []byte, arg2 Ics23Proof) error { + var out []interface{} + err := _SequencerSignatureVerifier.contract.Call(opts, &out, "verifyNonMembership", arg0, arg1, arg2) + + if err != nil { + return err + } + + return err + +} + +// VerifyNonMembership is a free data retrieval call binding the contract method 0x2a6ded74. +// +// Solidity: function verifyNonMembership(bytes32 , bytes , (((bytes,bytes)[],bytes,bytes,bytes)[],uint256) ) pure returns() +func (_SequencerSignatureVerifier *SequencerSignatureVerifierSession) VerifyNonMembership(arg0 [32]byte, arg1 []byte, arg2 Ics23Proof) error { + return _SequencerSignatureVerifier.Contract.VerifyNonMembership(&_SequencerSignatureVerifier.CallOpts, arg0, arg1, arg2) +} + +// VerifyNonMembership is a free data retrieval call binding the contract method 0x2a6ded74. +// +// Solidity: function verifyNonMembership(bytes32 , bytes , (((bytes,bytes)[],bytes,bytes,bytes)[],uint256) ) pure returns() +func (_SequencerSignatureVerifier *SequencerSignatureVerifierCallerSession) VerifyNonMembership(arg0 [32]byte, arg1 []byte, arg2 Ics23Proof) error { + return _SequencerSignatureVerifier.Contract.VerifyNonMembership(&_SequencerSignatureVerifier.CallOpts, arg0, arg1, arg2) +} + +// VerifyStateUpdate is a free data retrieval call binding the contract method 0xe8d90039. +// +// Solidity: function verifyStateUpdate(uint256 l2BlockNumber, bytes32 appHash, bytes32 l1BlockHash, bytes signature) view returns() +func (_SequencerSignatureVerifier *SequencerSignatureVerifierCaller) VerifyStateUpdate(opts *bind.CallOpts, l2BlockNumber *big.Int, appHash [32]byte, l1BlockHash [32]byte, signature []byte) error { + var out []interface{} + err := _SequencerSignatureVerifier.contract.Call(opts, &out, "verifyStateUpdate", l2BlockNumber, appHash, l1BlockHash, signature) + + if err != nil { + return err + } + + return err + +} + +// VerifyStateUpdate is a free data retrieval call binding the contract method 0xe8d90039. +// +// Solidity: function verifyStateUpdate(uint256 l2BlockNumber, bytes32 appHash, bytes32 l1BlockHash, bytes signature) view returns() +func (_SequencerSignatureVerifier *SequencerSignatureVerifierSession) VerifyStateUpdate(l2BlockNumber *big.Int, appHash [32]byte, l1BlockHash [32]byte, signature []byte) error { + return _SequencerSignatureVerifier.Contract.VerifyStateUpdate(&_SequencerSignatureVerifier.CallOpts, l2BlockNumber, appHash, l1BlockHash, signature) +} + +// VerifyStateUpdate is a free data retrieval call binding the contract method 0xe8d90039. +// +// Solidity: function verifyStateUpdate(uint256 l2BlockNumber, bytes32 appHash, bytes32 l1BlockHash, bytes signature) view returns() +func (_SequencerSignatureVerifier *SequencerSignatureVerifierCallerSession) VerifyStateUpdate(l2BlockNumber *big.Int, appHash [32]byte, l1BlockHash [32]byte, signature []byte) error { + return _SequencerSignatureVerifier.Contract.VerifyStateUpdate(&_SequencerSignatureVerifier.CallOpts, l2BlockNumber, appHash, l1BlockHash, signature) +} diff --git a/bindings/go/sequencersoloclient/SequencerSoloClient.go b/bindings/go/sequencersoloclient/SequencerSoloClient.go new file mode 100644 index 00000000..130262dc --- /dev/null +++ b/bindings/go/sequencersoloclient/SequencerSoloClient.go @@ -0,0 +1,404 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package sequencersoloclient + +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 +) + +// Ics23Proof is an auto generated low-level Go binding around an user-defined struct. +type Ics23Proof struct { + Proof []OpIcs23Proof + Height *big.Int +} + +// OpIcs23Proof is an auto generated low-level Go binding around an user-defined struct. +type OpIcs23Proof struct { + Path []OpIcs23ProofPath + Key []byte + Value []byte + Prefix []byte +} + +// OpIcs23ProofPath is an auto generated low-level Go binding around an user-defined struct. +type OpIcs23ProofPath struct { + Prefix []byte + Suffix []byte +} + +// SequencerSoloClientMetaData contains all meta data concerning the SequencerSoloClient contract. +var SequencerSoloClientMetaData = &bind.MetaData{ + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"verifier_\",\"type\":\"address\",\"internalType\":\"contractISignatureVerifier\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"LIGHT_CLIENT_TYPE\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"enumLightClientType\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"consensusStates\",\"inputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getState\",\"inputs\":[{\"name\":\"height\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"appHash\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"updateClient\",\"inputs\":[{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"peptideHeight\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"peptideAppHash\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifier\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractISignatureVerifier\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifyMembership\",\"inputs\":[{\"name\":\"proof\",\"type\":\"tuple\",\"internalType\":\"structIcs23Proof\",\"components\":[{\"name\":\"proof\",\"type\":\"tuple[]\",\"internalType\":\"structOpIcs23Proof[]\",\"components\":[{\"name\":\"path\",\"type\":\"tuple[]\",\"internalType\":\"structOpIcs23ProofPath[]\",\"components\":[{\"name\":\"prefix\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"suffix\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"key\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"prefix\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"height\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"key\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"expectedValue\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifyNonMembership\",\"inputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structIcs23Proof\",\"components\":[{\"name\":\"proof\",\"type\":\"tuple[]\",\"internalType\":\"structOpIcs23Proof[]\",\"components\":[{\"name\":\"path\",\"type\":\"tuple[]\",\"internalType\":\"structOpIcs23ProofPath[]\",\"components\":[{\"name\":\"prefix\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"suffix\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"key\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"value\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"prefix\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"height\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"pure\"},{\"type\":\"error\",\"name\":\"AppHashHasNotPassedFraudProofWindow\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"CannotUpdatePendingOptimisticConsensusState\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NoConsensusStateAtHeight\",\"inputs\":[{\"name\":\"height\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"type\":\"error\",\"name\":\"NonMembershipProofsNotYetImplemented\",\"inputs\":[]}]", +} + +// SequencerSoloClientABI is the input ABI used to generate the binding from. +// Deprecated: Use SequencerSoloClientMetaData.ABI instead. +var SequencerSoloClientABI = SequencerSoloClientMetaData.ABI + +// SequencerSoloClient is an auto generated Go binding around an Ethereum contract. +type SequencerSoloClient struct { + SequencerSoloClientCaller // Read-only binding to the contract + SequencerSoloClientTransactor // Write-only binding to the contract + SequencerSoloClientFilterer // Log filterer for contract events +} + +// SequencerSoloClientCaller is an auto generated read-only Go binding around an Ethereum contract. +type SequencerSoloClientCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SequencerSoloClientTransactor is an auto generated write-only Go binding around an Ethereum contract. +type SequencerSoloClientTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SequencerSoloClientFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type SequencerSoloClientFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// SequencerSoloClientSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type SequencerSoloClientSession struct { + Contract *SequencerSoloClient // 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 +} + +// SequencerSoloClientCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type SequencerSoloClientCallerSession struct { + Contract *SequencerSoloClientCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// SequencerSoloClientTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type SequencerSoloClientTransactorSession struct { + Contract *SequencerSoloClientTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// SequencerSoloClientRaw is an auto generated low-level Go binding around an Ethereum contract. +type SequencerSoloClientRaw struct { + Contract *SequencerSoloClient // Generic contract binding to access the raw methods on +} + +// SequencerSoloClientCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type SequencerSoloClientCallerRaw struct { + Contract *SequencerSoloClientCaller // Generic read-only contract binding to access the raw methods on +} + +// SequencerSoloClientTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type SequencerSoloClientTransactorRaw struct { + Contract *SequencerSoloClientTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewSequencerSoloClient creates a new instance of SequencerSoloClient, bound to a specific deployed contract. +func NewSequencerSoloClient(address common.Address, backend bind.ContractBackend) (*SequencerSoloClient, error) { + contract, err := bindSequencerSoloClient(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &SequencerSoloClient{SequencerSoloClientCaller: SequencerSoloClientCaller{contract: contract}, SequencerSoloClientTransactor: SequencerSoloClientTransactor{contract: contract}, SequencerSoloClientFilterer: SequencerSoloClientFilterer{contract: contract}}, nil +} + +// NewSequencerSoloClientCaller creates a new read-only instance of SequencerSoloClient, bound to a specific deployed contract. +func NewSequencerSoloClientCaller(address common.Address, caller bind.ContractCaller) (*SequencerSoloClientCaller, error) { + contract, err := bindSequencerSoloClient(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &SequencerSoloClientCaller{contract: contract}, nil +} + +// NewSequencerSoloClientTransactor creates a new write-only instance of SequencerSoloClient, bound to a specific deployed contract. +func NewSequencerSoloClientTransactor(address common.Address, transactor bind.ContractTransactor) (*SequencerSoloClientTransactor, error) { + contract, err := bindSequencerSoloClient(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &SequencerSoloClientTransactor{contract: contract}, nil +} + +// NewSequencerSoloClientFilterer creates a new log filterer instance of SequencerSoloClient, bound to a specific deployed contract. +func NewSequencerSoloClientFilterer(address common.Address, filterer bind.ContractFilterer) (*SequencerSoloClientFilterer, error) { + contract, err := bindSequencerSoloClient(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &SequencerSoloClientFilterer{contract: contract}, nil +} + +// bindSequencerSoloClient binds a generic wrapper to an already deployed contract. +func bindSequencerSoloClient(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := SequencerSoloClientMetaData.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 (_SequencerSoloClient *SequencerSoloClientRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SequencerSoloClient.Contract.SequencerSoloClientCaller.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 (_SequencerSoloClient *SequencerSoloClientRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SequencerSoloClient.Contract.SequencerSoloClientTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SequencerSoloClient *SequencerSoloClientRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SequencerSoloClient.Contract.SequencerSoloClientTransactor.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 (_SequencerSoloClient *SequencerSoloClientCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _SequencerSoloClient.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 (_SequencerSoloClient *SequencerSoloClientTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _SequencerSoloClient.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_SequencerSoloClient *SequencerSoloClientTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _SequencerSoloClient.Contract.contract.Transact(opts, method, params...) +} + +// LIGHTCLIENTTYPE is a free data retrieval call binding the contract method 0x57c1c5f4. +// +// Solidity: function LIGHT_CLIENT_TYPE() view returns(uint8) +func (_SequencerSoloClient *SequencerSoloClientCaller) LIGHTCLIENTTYPE(opts *bind.CallOpts) (uint8, error) { + var out []interface{} + err := _SequencerSoloClient.contract.Call(opts, &out, "LIGHT_CLIENT_TYPE") + + if err != nil { + return *new(uint8), err + } + + out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) + + return out0, err + +} + +// LIGHTCLIENTTYPE is a free data retrieval call binding the contract method 0x57c1c5f4. +// +// Solidity: function LIGHT_CLIENT_TYPE() view returns(uint8) +func (_SequencerSoloClient *SequencerSoloClientSession) LIGHTCLIENTTYPE() (uint8, error) { + return _SequencerSoloClient.Contract.LIGHTCLIENTTYPE(&_SequencerSoloClient.CallOpts) +} + +// LIGHTCLIENTTYPE is a free data retrieval call binding the contract method 0x57c1c5f4. +// +// Solidity: function LIGHT_CLIENT_TYPE() view returns(uint8) +func (_SequencerSoloClient *SequencerSoloClientCallerSession) LIGHTCLIENTTYPE() (uint8, error) { + return _SequencerSoloClient.Contract.LIGHTCLIENTTYPE(&_SequencerSoloClient.CallOpts) +} + +// ConsensusStates is a free data retrieval call binding the contract method 0x1b738a22. +// +// Solidity: function consensusStates(uint256 ) view returns(uint256) +func (_SequencerSoloClient *SequencerSoloClientCaller) ConsensusStates(opts *bind.CallOpts, arg0 *big.Int) (*big.Int, error) { + var out []interface{} + err := _SequencerSoloClient.contract.Call(opts, &out, "consensusStates", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// ConsensusStates is a free data retrieval call binding the contract method 0x1b738a22. +// +// Solidity: function consensusStates(uint256 ) view returns(uint256) +func (_SequencerSoloClient *SequencerSoloClientSession) ConsensusStates(arg0 *big.Int) (*big.Int, error) { + return _SequencerSoloClient.Contract.ConsensusStates(&_SequencerSoloClient.CallOpts, arg0) +} + +// ConsensusStates is a free data retrieval call binding the contract method 0x1b738a22. +// +// Solidity: function consensusStates(uint256 ) view returns(uint256) +func (_SequencerSoloClient *SequencerSoloClientCallerSession) ConsensusStates(arg0 *big.Int) (*big.Int, error) { + return _SequencerSoloClient.Contract.ConsensusStates(&_SequencerSoloClient.CallOpts, arg0) +} + +// GetState is a free data retrieval call binding the contract method 0x44c9af28. +// +// Solidity: function getState(uint256 height) view returns(uint256 appHash) +func (_SequencerSoloClient *SequencerSoloClientCaller) GetState(opts *bind.CallOpts, height *big.Int) (*big.Int, error) { + var out []interface{} + err := _SequencerSoloClient.contract.Call(opts, &out, "getState", height) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetState is a free data retrieval call binding the contract method 0x44c9af28. +// +// Solidity: function getState(uint256 height) view returns(uint256 appHash) +func (_SequencerSoloClient *SequencerSoloClientSession) GetState(height *big.Int) (*big.Int, error) { + return _SequencerSoloClient.Contract.GetState(&_SequencerSoloClient.CallOpts, height) +} + +// GetState is a free data retrieval call binding the contract method 0x44c9af28. +// +// Solidity: function getState(uint256 height) view returns(uint256 appHash) +func (_SequencerSoloClient *SequencerSoloClientCallerSession) GetState(height *big.Int) (*big.Int, error) { + return _SequencerSoloClient.Contract.GetState(&_SequencerSoloClient.CallOpts, height) +} + +// Verifier is a free data retrieval call binding the contract method 0x2b7ac3f3. +// +// Solidity: function verifier() view returns(address) +func (_SequencerSoloClient *SequencerSoloClientCaller) Verifier(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _SequencerSoloClient.contract.Call(opts, &out, "verifier") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Verifier is a free data retrieval call binding the contract method 0x2b7ac3f3. +// +// Solidity: function verifier() view returns(address) +func (_SequencerSoloClient *SequencerSoloClientSession) Verifier() (common.Address, error) { + return _SequencerSoloClient.Contract.Verifier(&_SequencerSoloClient.CallOpts) +} + +// Verifier is a free data retrieval call binding the contract method 0x2b7ac3f3. +// +// Solidity: function verifier() view returns(address) +func (_SequencerSoloClient *SequencerSoloClientCallerSession) Verifier() (common.Address, error) { + return _SequencerSoloClient.Contract.Verifier(&_SequencerSoloClient.CallOpts) +} + +// VerifyMembership is a free data retrieval call binding the contract method 0xcb535ab5. +// +// Solidity: function verifyMembership((((bytes,bytes)[],bytes,bytes,bytes)[],uint256) proof, bytes key, bytes expectedValue) view returns() +func (_SequencerSoloClient *SequencerSoloClientCaller) VerifyMembership(opts *bind.CallOpts, proof Ics23Proof, key []byte, expectedValue []byte) error { + var out []interface{} + err := _SequencerSoloClient.contract.Call(opts, &out, "verifyMembership", proof, key, expectedValue) + + if err != nil { + return err + } + + return err + +} + +// VerifyMembership is a free data retrieval call binding the contract method 0xcb535ab5. +// +// Solidity: function verifyMembership((((bytes,bytes)[],bytes,bytes,bytes)[],uint256) proof, bytes key, bytes expectedValue) view returns() +func (_SequencerSoloClient *SequencerSoloClientSession) VerifyMembership(proof Ics23Proof, key []byte, expectedValue []byte) error { + return _SequencerSoloClient.Contract.VerifyMembership(&_SequencerSoloClient.CallOpts, proof, key, expectedValue) +} + +// VerifyMembership is a free data retrieval call binding the contract method 0xcb535ab5. +// +// Solidity: function verifyMembership((((bytes,bytes)[],bytes,bytes,bytes)[],uint256) proof, bytes key, bytes expectedValue) view returns() +func (_SequencerSoloClient *SequencerSoloClientCallerSession) VerifyMembership(proof Ics23Proof, key []byte, expectedValue []byte) error { + return _SequencerSoloClient.Contract.VerifyMembership(&_SequencerSoloClient.CallOpts, proof, key, expectedValue) +} + +// VerifyNonMembership is a free data retrieval call binding the contract method 0xfdaab4e5. +// +// Solidity: function verifyNonMembership((((bytes,bytes)[],bytes,bytes,bytes)[],uint256) , bytes ) pure returns() +func (_SequencerSoloClient *SequencerSoloClientCaller) VerifyNonMembership(opts *bind.CallOpts, arg0 Ics23Proof, arg1 []byte) error { + var out []interface{} + err := _SequencerSoloClient.contract.Call(opts, &out, "verifyNonMembership", arg0, arg1) + + if err != nil { + return err + } + + return err + +} + +// VerifyNonMembership is a free data retrieval call binding the contract method 0xfdaab4e5. +// +// Solidity: function verifyNonMembership((((bytes,bytes)[],bytes,bytes,bytes)[],uint256) , bytes ) pure returns() +func (_SequencerSoloClient *SequencerSoloClientSession) VerifyNonMembership(arg0 Ics23Proof, arg1 []byte) error { + return _SequencerSoloClient.Contract.VerifyNonMembership(&_SequencerSoloClient.CallOpts, arg0, arg1) +} + +// VerifyNonMembership is a free data retrieval call binding the contract method 0xfdaab4e5. +// +// Solidity: function verifyNonMembership((((bytes,bytes)[],bytes,bytes,bytes)[],uint256) , bytes ) pure returns() +func (_SequencerSoloClient *SequencerSoloClientCallerSession) VerifyNonMembership(arg0 Ics23Proof, arg1 []byte) error { + return _SequencerSoloClient.Contract.VerifyNonMembership(&_SequencerSoloClient.CallOpts, arg0, arg1) +} + +// UpdateClient is a paid mutator transaction binding the contract method 0x49ff245e. +// +// Solidity: function updateClient(bytes proof, uint256 peptideHeight, uint256 peptideAppHash) returns() +func (_SequencerSoloClient *SequencerSoloClientTransactor) UpdateClient(opts *bind.TransactOpts, proof []byte, peptideHeight *big.Int, peptideAppHash *big.Int) (*types.Transaction, error) { + return _SequencerSoloClient.contract.Transact(opts, "updateClient", proof, peptideHeight, peptideAppHash) +} + +// UpdateClient is a paid mutator transaction binding the contract method 0x49ff245e. +// +// Solidity: function updateClient(bytes proof, uint256 peptideHeight, uint256 peptideAppHash) returns() +func (_SequencerSoloClient *SequencerSoloClientSession) UpdateClient(proof []byte, peptideHeight *big.Int, peptideAppHash *big.Int) (*types.Transaction, error) { + return _SequencerSoloClient.Contract.UpdateClient(&_SequencerSoloClient.TransactOpts, proof, peptideHeight, peptideAppHash) +} + +// UpdateClient is a paid mutator transaction binding the contract method 0x49ff245e. +// +// Solidity: function updateClient(bytes proof, uint256 peptideHeight, uint256 peptideAppHash) returns() +func (_SequencerSoloClient *SequencerSoloClientTransactorSession) UpdateClient(proof []byte, peptideHeight *big.Int, peptideAppHash *big.Int) (*types.Transaction, error) { + return _SequencerSoloClient.Contract.UpdateClient(&_SequencerSoloClient.TransactOpts, proof, peptideHeight, peptideAppHash) +} diff --git a/package.json b/package.json index 2610dea2..7ce74f9c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@open-ibc/vibc-core-smart-contracts", - "version": "4.0.1", + "version": "4.0.2", "main": "dist/index.js", "bin": { "verify-vibc-core-smart-contracts": "./dist/scripts/verify-contract-script.js", diff --git a/specs/update.spec.yaml b/specs/update.spec.yaml index 04cb8a89..6b6c43ce 100644 --- a/specs/update.spec.yaml +++ b/specs/update.spec.yaml @@ -50,6 +50,21 @@ - 0 - '{{OptimisticProofVerifier}}' - '{{L1BlockAddress}}' + +- name: SequencerSigVerifier + description: 'SequencerSignatureVerifier' + factoryName: 'SequencerSignatureVerifier' + deployer: 'KEY_DEPLOYER' + deployArgs: + - '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266' + - '0x4440000000000000000000000000000000000000000000000000000000000000' + +- name: SequencerSoloClient + description: 'SequencerSoloClient' + factoryName: 'SequencerSoloClient' + deployer: 'KEY_DEPLOYER' + deployArgs: + - '{{SequencerSigVerifier}}' - name: DummyLightClient description: 'DummyLightClient' diff --git a/src/evm/contracts/SequencerSignatureVerifier.ts b/src/evm/contracts/SequencerSignatureVerifier.ts new file mode 100644 index 00000000..24457e86 --- /dev/null +++ b/src/evm/contracts/SequencerSignatureVerifier.ts @@ -0,0 +1,218 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedListener, + TypedContractMethod, +} from "./common"; + +export type OpIcs23ProofPathStruct = { prefix: BytesLike; suffix: BytesLike }; + +export type OpIcs23ProofPathStructOutput = [prefix: string, suffix: string] & { + prefix: string; + suffix: string; +}; + +export type OpIcs23ProofStruct = { + path: OpIcs23ProofPathStruct[]; + key: BytesLike; + value: BytesLike; + prefix: BytesLike; +}; + +export type OpIcs23ProofStructOutput = [ + path: OpIcs23ProofPathStructOutput[], + key: string, + value: string, + prefix: string +] & { + path: OpIcs23ProofPathStructOutput[]; + key: string; + value: string; + prefix: string; +}; + +export type Ics23ProofStruct = { + proof: OpIcs23ProofStruct[]; + height: BigNumberish; +}; + +export type Ics23ProofStructOutput = [ + proof: OpIcs23ProofStructOutput[], + height: bigint +] & { proof: OpIcs23ProofStructOutput[]; height: bigint }; + +export interface SequencerSignatureVerifierInterface extends Interface { + getFunction( + nameOrSignature: + | "CHAIN_ID" + | "SEQUENCER" + | "verifyMembership" + | "verifyNonMembership" + | "verifyStateUpdate" + ): FunctionFragment; + + encodeFunctionData(functionFragment: "CHAIN_ID", values?: undefined): string; + encodeFunctionData(functionFragment: "SEQUENCER", values?: undefined): string; + encodeFunctionData( + functionFragment: "verifyMembership", + values: [BytesLike, BytesLike, BytesLike, Ics23ProofStruct] + ): string; + encodeFunctionData( + functionFragment: "verifyNonMembership", + values: [BytesLike, BytesLike, Ics23ProofStruct] + ): string; + encodeFunctionData( + functionFragment: "verifyStateUpdate", + values: [BigNumberish, BytesLike, BytesLike, BytesLike] + ): string; + + decodeFunctionResult(functionFragment: "CHAIN_ID", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "SEQUENCER", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "verifyMembership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "verifyNonMembership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "verifyStateUpdate", + data: BytesLike + ): Result; +} + +export interface SequencerSignatureVerifier extends BaseContract { + connect(runner?: ContractRunner | null): SequencerSignatureVerifier; + waitForDeployment(): Promise; + + interface: SequencerSignatureVerifierInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + CHAIN_ID: TypedContractMethod<[], [string], "view">; + + SEQUENCER: TypedContractMethod<[], [string], "view">; + + verifyMembership: TypedContractMethod< + [ + appHash: BytesLike, + key: BytesLike, + value: BytesLike, + proofs: Ics23ProofStruct + ], + [void], + "view" + >; + + verifyNonMembership: TypedContractMethod< + [arg0: BytesLike, arg1: BytesLike, arg2: Ics23ProofStruct], + [void], + "view" + >; + + verifyStateUpdate: TypedContractMethod< + [ + l2BlockNumber: BigNumberish, + appHash: BytesLike, + l1BlockHash: BytesLike, + signature: BytesLike + ], + [void], + "view" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "CHAIN_ID" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "SEQUENCER" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "verifyMembership" + ): TypedContractMethod< + [ + appHash: BytesLike, + key: BytesLike, + value: BytesLike, + proofs: Ics23ProofStruct + ], + [void], + "view" + >; + getFunction( + nameOrSignature: "verifyNonMembership" + ): TypedContractMethod< + [arg0: BytesLike, arg1: BytesLike, arg2: Ics23ProofStruct], + [void], + "view" + >; + getFunction( + nameOrSignature: "verifyStateUpdate" + ): TypedContractMethod< + [ + l2BlockNumber: BigNumberish, + appHash: BytesLike, + l1BlockHash: BytesLike, + signature: BytesLike + ], + [void], + "view" + >; + + filters: {}; +} diff --git a/src/evm/contracts/SequencerSoloClient.ts b/src/evm/contracts/SequencerSoloClient.ts new file mode 100644 index 00000000..6489ce00 --- /dev/null +++ b/src/evm/contracts/SequencerSoloClient.ts @@ -0,0 +1,237 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedListener, + TypedContractMethod, +} from "./common"; + +export type OpIcs23ProofPathStruct = { prefix: BytesLike; suffix: BytesLike }; + +export type OpIcs23ProofPathStructOutput = [prefix: string, suffix: string] & { + prefix: string; + suffix: string; +}; + +export type OpIcs23ProofStruct = { + path: OpIcs23ProofPathStruct[]; + key: BytesLike; + value: BytesLike; + prefix: BytesLike; +}; + +export type OpIcs23ProofStructOutput = [ + path: OpIcs23ProofPathStructOutput[], + key: string, + value: string, + prefix: string +] & { + path: OpIcs23ProofPathStructOutput[]; + key: string; + value: string; + prefix: string; +}; + +export type Ics23ProofStruct = { + proof: OpIcs23ProofStruct[]; + height: BigNumberish; +}; + +export type Ics23ProofStructOutput = [ + proof: OpIcs23ProofStructOutput[], + height: bigint +] & { proof: OpIcs23ProofStructOutput[]; height: bigint }; + +export interface SequencerSoloClientInterface extends Interface { + getFunction( + nameOrSignature: + | "LIGHT_CLIENT_TYPE" + | "consensusStates" + | "getState" + | "updateClient" + | "verifier" + | "verifyMembership" + | "verifyNonMembership" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "LIGHT_CLIENT_TYPE", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "consensusStates", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getState", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "updateClient", + values: [BytesLike, BigNumberish, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "verifier", values?: undefined): string; + encodeFunctionData( + functionFragment: "verifyMembership", + values: [Ics23ProofStruct, BytesLike, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "verifyNonMembership", + values: [Ics23ProofStruct, BytesLike] + ): string; + + decodeFunctionResult( + functionFragment: "LIGHT_CLIENT_TYPE", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "consensusStates", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "getState", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "updateClient", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "verifier", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "verifyMembership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "verifyNonMembership", + data: BytesLike + ): Result; +} + +export interface SequencerSoloClient extends BaseContract { + connect(runner?: ContractRunner | null): SequencerSoloClient; + waitForDeployment(): Promise; + + interface: SequencerSoloClientInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + LIGHT_CLIENT_TYPE: TypedContractMethod<[], [bigint], "view">; + + consensusStates: TypedContractMethod<[arg0: BigNumberish], [bigint], "view">; + + getState: TypedContractMethod<[height: BigNumberish], [bigint], "view">; + + updateClient: TypedContractMethod< + [ + proof: BytesLike, + peptideHeight: BigNumberish, + peptideAppHash: BigNumberish + ], + [void], + "nonpayable" + >; + + verifier: TypedContractMethod<[], [string], "view">; + + verifyMembership: TypedContractMethod< + [proof: Ics23ProofStruct, key: BytesLike, expectedValue: BytesLike], + [void], + "view" + >; + + verifyNonMembership: TypedContractMethod< + [arg0: Ics23ProofStruct, arg1: BytesLike], + [void], + "view" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "LIGHT_CLIENT_TYPE" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "consensusStates" + ): TypedContractMethod<[arg0: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "getState" + ): TypedContractMethod<[height: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "updateClient" + ): TypedContractMethod< + [ + proof: BytesLike, + peptideHeight: BigNumberish, + peptideAppHash: BigNumberish + ], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "verifier" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "verifyMembership" + ): TypedContractMethod< + [proof: Ics23ProofStruct, key: BytesLike, expectedValue: BytesLike], + [void], + "view" + >; + getFunction( + nameOrSignature: "verifyNonMembership" + ): TypedContractMethod< + [arg0: Ics23ProofStruct, arg1: BytesLike], + [void], + "view" + >; + + filters: {}; +} diff --git a/src/evm/contracts/factories/SequencerSignatureVerifier__factory.ts b/src/evm/contracts/factories/SequencerSignatureVerifier__factory.ts new file mode 100644 index 00000000..ab64884e --- /dev/null +++ b/src/evm/contracts/factories/SequencerSignatureVerifier__factory.ts @@ -0,0 +1,353 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + Contract, + ContractFactory, + ContractTransactionResponse, + Interface, +} from "ethers"; +import type { + Signer, + BytesLike, + AddressLike, + ContractDeployTransaction, + ContractRunner, +} from "ethers"; +import type { NonPayableOverrides } from "../common"; +import type { + SequencerSignatureVerifier, + SequencerSignatureVerifierInterface, +} from "../SequencerSignatureVerifier"; + +const _abi = [ + { + type: "constructor", + inputs: [ + { + name: "sequencer_", + type: "address", + internalType: "address", + }, + { + name: "chainId_", + type: "bytes32", + internalType: "bytes32", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "CHAIN_ID", + inputs: [], + outputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "SEQUENCER", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "verifyMembership", + inputs: [ + { + name: "appHash", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "proofs", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + outputs: [], + stateMutability: "pure", + }, + { + type: "function", + name: "verifyNonMembership", + inputs: [ + { + name: "", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "", + type: "bytes", + internalType: "bytes", + }, + { + name: "", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + ], + outputs: [], + stateMutability: "pure", + }, + { + type: "function", + name: "verifyStateUpdate", + inputs: [ + { + name: "l2BlockNumber", + type: "uint256", + internalType: "uint256", + }, + { + name: "appHash", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "l1BlockHash", + type: "bytes32", + internalType: "bytes32", + }, + { + name: "signature", + type: "bytes", + internalType: "bytes", + }, + ], + outputs: [], + stateMutability: "view", + }, + { + type: "error", + name: "InvalidAppHash", + inputs: [], + }, + { + type: "error", + name: "InvalidIbcStateProof", + inputs: [], + }, + { + type: "error", + name: "InvalidL1BlockHash", + inputs: [], + }, + { + type: "error", + name: "InvalidL1BlockNumber", + inputs: [], + }, + { + type: "error", + name: "InvalidPacketProof", + inputs: [], + }, + { + type: "error", + name: "InvalidProofKey", + inputs: [], + }, + { + type: "error", + name: "InvalidProofValue", + inputs: [], + }, + { + type: "error", + name: "InvalidRLPEncodedL1BlockNumber", + inputs: [], + }, + { + type: "error", + name: "InvalidRLPEncodedL1StateRoot", + inputs: [], + }, + { + type: "error", + name: "InvalidSequencerSignature", + inputs: [], + }, + { + type: "error", + name: "MethodNotImplemented", + inputs: [], + }, +] as const; + +const _bytecode = + "0x60c060405234801561001057600080fd5b50604051610e39380380610e3983398101604081905261002f91610045565b6001600160a01b0390911660805260a05261007f565b6000806040838503121561005857600080fd5b82516001600160a01b038116811461006f57600080fd5b6020939093015192949293505050565b60805160a051610d896100b06000396000818160ba0152610584015260008181607601526105ee0152610d896000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80632a6ded741461005c57806375fd4ca91461007157806385e1f4d0146100b5578063c2f0329f146100ea578063e8d90039146100fd575b600080fd5b61006f61006a3660046109a3565b610110565b005b6100987f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6100dc7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100ac565b61006f6100f8366004610a16565b610129565b61006f61010b366004610ab2565b610313565b604051632974974360e01b815260040160405180910390fd5b6101338180610b13565b600081811061014457610144610b5d565b90506020028101906101569190610b73565b610164906020810190610b93565b604051610172929190610bda565b6040518091039020858560405161018a929190610bda565b6040518091039020146101b05760405163026a287560e51b815260040160405180910390fd5b6101ba8180610b13565b60008181106101cb576101cb610b5d565b90506020028101906101dd9190610b73565b6101eb906040810190610b93565b6040516101f9929190610bda565b60405180910390208383604051610211929190610bda565b604051809103902014610237576040516310d9300f60e11b815260040160405180910390fd5b61026c6102448280610b13565b600081811061025557610255610b5d565b90506020028101906102679190610b73565b610327565b6102768280610b13565b600181811061028757610287610b5d565b90506020028101906102999190610b73565b6102a7906040810190610b93565b6102b091610bea565b146102ce57604051636589f0e160e11b815260040160405180910390fd5b6102ec6102db8280610b13565b600181811061025557610255610b5d565b861461030b576040516392cb8fbb60e01b815260040160405180910390fd5b505050505050565b610320858585858561054b565b5050505050565b60008060026103396040850185610b93565b604051610347929190610bda565b602060405180830381855afa158015610364573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906103879190610c08565b905060026103986060850185610b93565b6103af6103a86020880188610b93565b9050610659565b6103bc6020880188610b93565b6103c66020610659565b876040516020016103dd9796959493929190610c5c565b60408051601f19818403018152908290526103f791610ca0565b602060405180830381855afa158015610414573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906104379190610c08565b915060005b6104468480610b13565b905081101561054457600261045b8580610b13565b8381811061046b5761046b610b5d565b905060200281019061047d9190610cb3565b6104879080610b93565b856104928880610b13565b868181106104a2576104a2610b5d565b90506020028101906104b49190610cb3565b6104c2906020810190610b93565b6040516020016104d6959493929190610cc9565b60408051601f19818403018152908290526104f091610ca0565b602060405180830381855afa15801561050d573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906105309190610c08565b92508061053c81610cf1565b91505061043c565b5050919050565b604080516020808201889052818301879052606080830187905283518084039091018152608083018452805190820120600060a08401527f000000000000000000000000000000000000000000000000000000000000000060c084015260e080840191909152835180840390910181526101008301808552815191830191909120601f860183900490920283016101209081019094528481526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169361063293879187918291018382808284376000920191909152506106c892505050565b6001600160a01b031614610320576040516339e27c8560e21b815260040160405180910390fd5b6060805b6080831061069b578083607f1660801760f81b604051602001610681929190610d18565b60408051601f198184030190525260079290921c9161065d565b808360f81b6040516020016106b1929190610d18565b604051602081830303815290604052915050919050565b60008060006106d785856106ee565b915091506106e481610733565b5090505b92915050565b60008082516041036107245760208301516040840151606085015160001a61071887828585610885565b9450945050505061072c565b506000905060025b9250929050565b600081600481111561074757610747610d3d565b0361074f5750565b600181600481111561076357610763610d3d565b036107b55760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064015b60405180910390fd5b60028160048111156107c9576107c9610d3d565b036108165760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016107ac565b600381600481111561082a5761082a610d3d565b036108825760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b60648201526084016107ac565b50565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156108bc5750600090506003610940565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610910573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661093957600060019250925050610940565b9150600090505b94509492505050565b60008083601f84011261095b57600080fd5b50813567ffffffffffffffff81111561097357600080fd5b60208301915083602082850101111561072c57600080fd5b60006040828403121561099d57600080fd5b50919050565b600080600080606085870312156109b957600080fd5b84359350602085013567ffffffffffffffff808211156109d857600080fd5b6109e488838901610949565b909550935060408701359150808211156109fd57600080fd5b50610a0a8782880161098b565b91505092959194509250565b60008060008060008060808789031215610a2f57600080fd5b86359550602087013567ffffffffffffffff80821115610a4e57600080fd5b610a5a8a838b01610949565b90975095506040890135915080821115610a7357600080fd5b610a7f8a838b01610949565b90955093506060890135915080821115610a9857600080fd5b50610aa589828a0161098b565b9150509295509295509295565b600080600080600060808688031215610aca57600080fd5b853594506020860135935060408601359250606086013567ffffffffffffffff811115610af657600080fd5b610b0288828901610949565b969995985093965092949392505050565b6000808335601e19843603018112610b2a57600080fd5b83018035915067ffffffffffffffff821115610b4557600080fd5b6020019150600581901b360382131561072c57600080fd5b634e487b7160e01b600052603260045260246000fd5b60008235607e19833603018112610b8957600080fd5b9190910192915050565b6000808335601e19843603018112610baa57600080fd5b83018035915067ffffffffffffffff821115610bc557600080fd5b60200191503681900382131561072c57600080fd5b8183823760009101908152919050565b803560208310156106e857600019602084900360031b1b1692915050565b600060208284031215610c1a57600080fd5b5051919050565b6000815160005b81811015610c425760208185018101518683015201610c28565b81811115610c51576000828601525b509290920192915050565b86888237600087820160008152610c738189610c21565b9050858782376000908601908152610c8b8186610c21565b93845250506020909101979650505050505050565b6000610cac8284610c21565b9392505050565b60008235603e19833603018112610b8957600080fd5b8486823760008582018581528385602083013760009301602001928352509095945050505050565b600060018201610d1157634e487b7160e01b600052601160045260246000fd5b5060010190565b6000610d248285610c21565b6001600160f81b03199390931683525050600101919050565b634e487b7160e01b600052602160045260246000fdfea26469706673582212204c0012eebe28f63fe39b9984570299ceb809e22dea601def9f555ce47d4bfdc664736f6c634300080f0033"; + +type SequencerSignatureVerifierConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: SequencerSignatureVerifierConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class SequencerSignatureVerifier__factory extends ContractFactory { + constructor(...args: SequencerSignatureVerifierConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override getDeployTransaction( + sequencer_: AddressLike, + chainId_: BytesLike, + overrides?: NonPayableOverrides & { from?: string } + ): Promise { + return super.getDeployTransaction(sequencer_, chainId_, overrides || {}); + } + override deploy( + sequencer_: AddressLike, + chainId_: BytesLike, + overrides?: NonPayableOverrides & { from?: string } + ) { + return super.deploy(sequencer_, chainId_, overrides || {}) as Promise< + SequencerSignatureVerifier & { + deploymentTransaction(): ContractTransactionResponse; + } + >; + } + override connect( + runner: ContractRunner | null + ): SequencerSignatureVerifier__factory { + return super.connect(runner) as SequencerSignatureVerifier__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): SequencerSignatureVerifierInterface { + return new Interface(_abi) as SequencerSignatureVerifierInterface; + } + static connect( + address: string, + runner?: ContractRunner | null + ): SequencerSignatureVerifier { + return new Contract( + address, + _abi, + runner + ) as unknown as SequencerSignatureVerifier; + } +} diff --git a/src/evm/contracts/factories/SequencerSoloClient__factory.ts b/src/evm/contracts/factories/SequencerSoloClient__factory.ts new file mode 100644 index 00000000..3ee30684 --- /dev/null +++ b/src/evm/contracts/factories/SequencerSoloClient__factory.ts @@ -0,0 +1,339 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + Contract, + ContractFactory, + ContractTransactionResponse, + Interface, +} from "ethers"; +import type { + Signer, + AddressLike, + ContractDeployTransaction, + ContractRunner, +} from "ethers"; +import type { NonPayableOverrides } from "../common"; +import type { + SequencerSoloClient, + SequencerSoloClientInterface, +} from "../SequencerSoloClient"; + +const _abi = [ + { + type: "constructor", + inputs: [ + { + name: "verifier_", + type: "address", + internalType: "contract ISignatureVerifier", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "LIGHT_CLIENT_TYPE", + inputs: [], + outputs: [ + { + name: "", + type: "uint8", + internalType: "enum LightClientType", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "consensusStates", + inputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "getState", + inputs: [ + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [ + { + name: "appHash", + type: "uint256", + internalType: "uint256", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "updateClient", + inputs: [ + { + name: "proof", + type: "bytes", + internalType: "bytes", + }, + { + name: "peptideHeight", + type: "uint256", + internalType: "uint256", + }, + { + name: "peptideAppHash", + type: "uint256", + internalType: "uint256", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "verifier", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "contract ISignatureVerifier", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "verifyMembership", + inputs: [ + { + name: "proof", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "expectedValue", + type: "bytes", + internalType: "bytes", + }, + ], + outputs: [], + stateMutability: "view", + }, + { + type: "function", + name: "verifyNonMembership", + inputs: [ + { + name: "", + type: "tuple", + internalType: "struct Ics23Proof", + components: [ + { + name: "proof", + type: "tuple[]", + internalType: "struct OpIcs23Proof[]", + components: [ + { + name: "path", + type: "tuple[]", + internalType: "struct OpIcs23ProofPath[]", + components: [ + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + { + name: "suffix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "key", + type: "bytes", + internalType: "bytes", + }, + { + name: "value", + type: "bytes", + internalType: "bytes", + }, + { + name: "prefix", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + { + name: "", + type: "bytes", + internalType: "bytes", + }, + ], + outputs: [], + stateMutability: "pure", + }, + { + type: "error", + name: "AppHashHasNotPassedFraudProofWindow", + inputs: [], + }, + { + type: "error", + name: "CannotUpdatePendingOptimisticConsensusState", + inputs: [], + }, + { + type: "error", + name: "NoConsensusStateAtHeight", + inputs: [ + { + name: "height", + type: "uint256", + internalType: "uint256", + }, + ], + }, + { + type: "error", + name: "NonMembershipProofsNotYetImplemented", + inputs: [], + }, +] as const; + +const _bytecode = + "0x60a06040526000805460ff1916600217905534801561001d57600080fd5b5060405161092438038061092483398101604081905261003c9161004d565b6001600160a01b031660805261007d565b60006020828403121561005f57600080fd5b81516001600160a01b038116811461007657600080fd5b9392505050565b60805161087f6100a56000396000818160ba015281816101a60152610262015261087f6000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806349ff245e1161005b57806349ff245e1461010757806357c1c5f41461011c578063cb535ab514610131578063fdaab4e51461014457600080fd5b80631b738a22146100825780632b7ac3f3146100b557806344c9af28146100f4575b600080fd5b6100a2610090366004610326565b60016020526000908152604090205481565b6040519081526020015b60405180910390f35b6100dc7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100ac565b6100a2610102366004610326565b610157565b61011a610115366004610388565b61016d565b005b610124600281565b6040516100ac91906103d9565b61011a61013f366004610419565b610258565b61011a6101523660046104ae565b61030d565b6000818152600160205260408120545b92915050565b60008281526001602052604090205481811461019c5760405163f0cd4ed960e01b815260040160405180910390fd5b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663e8d9003984846101db602060008a8c610517565b6101e491610541565b6101f1896020818d610517565b6040518663ffffffff1660e01b8152600401610211959493929190610588565b600060405180830381600087803b15801561022b57600080fd5b505af115801561023f573d6000803e3d6000fd5b5050506000938452505060016020526040909120555050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663c2f0329f6102ab610299600160208a01356105b9565b60009081526001602052604090205490565b6040516001600160e01b031960e084901b1681526102d6919088908890889088908d9060040161066d565b60006040518083038186803b1580156102ee57600080fd5b505afa158015610302573d6000803e3d6000fd5b505050505050505050565b604051634dfb272b60e11b815260040160405180910390fd5b60006020828403121561033857600080fd5b5035919050565b60008083601f84011261035157600080fd5b50813567ffffffffffffffff81111561036957600080fd5b60208301915083602082850101111561038157600080fd5b9250929050565b6000806000806060858703121561039e57600080fd5b843567ffffffffffffffff8111156103b557600080fd5b6103c18782880161033f565b90989097506020870135966040013595509350505050565b60208101600383106103fb57634e487b7160e01b600052602160045260246000fd5b91905290565b60006040828403121561041357600080fd5b50919050565b60008060008060006060868803121561043157600080fd5b853567ffffffffffffffff8082111561044957600080fd5b61045589838a01610401565b9650602088013591508082111561046b57600080fd5b61047789838a0161033f565b9096509450604088013591508082111561049057600080fd5b5061049d8882890161033f565b969995985093965092949392505050565b6000806000604084860312156104c357600080fd5b833567ffffffffffffffff808211156104db57600080fd5b6104e787838801610401565b945060208601359150808211156104fd57600080fd5b5061050a8682870161033f565b9497909650939450505050565b6000808585111561052757600080fd5b8386111561053457600080fd5b5050820193919092039150565b8035602083101561016757600019602084900360031b1b1692915050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b8581528460208201528360408201526080606082015260006105ae60808301848661055f565b979650505050505050565b6000828210156105d957634e487b7160e01b600052601160045260246000fd5b500390565b6000808335601e198436030181126105f557600080fd5b830160208101925035905067ffffffffffffffff81111561061557600080fd5b8060051b360382131561038157600080fd5b6000808335601e1984360301811261063e57600080fd5b830160208101925035905067ffffffffffffffff81111561065e57600080fd5b80360382131561038157600080fd5b86815260806020820152600061068760808301878961055f565b828103604084015261069a81868861055f565b905082810360608401526106ae84856105de565b604083526040830181815260608401905060608260051b8501018360005b8481101561082a57868303605f1901845236869003607e19018235126106f157600080fd5b858235016106ff81826105de565b608086526080860181815260a08701905060a08260051b8801018360005b848110156107a057898303609f1901845236869003603e190182351261074257600080fd5b858235016107508182610627565b6040865261076260408701828461055f565b9150506107726020830183610627565b9250858203602087015261078782848361055f565b602097880197909650949094019350505060010161071d565b50506107af6020860186610627565b9450925087810360208901526107c681858561055f565b93505050506107d86040830183610627565b86830360408801526107eb83828461055f565b925050506107fc6060830183610627565b9250858203606087015261081182848361055f565b60209788019790965094909401935050506001016106cc565b505060208801356020860152809550505050505097965050505050505056fea264697066735822122025ed54171b40b90bce4fe59365b6fa45eb8cd1df74879f14134d16826fa2339864736f6c634300080f0033"; + +type SequencerSoloClientConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: SequencerSoloClientConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class SequencerSoloClient__factory extends ContractFactory { + constructor(...args: SequencerSoloClientConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override getDeployTransaction( + verifier_: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ): Promise { + return super.getDeployTransaction(verifier_, overrides || {}); + } + override deploy( + verifier_: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ) { + return super.deploy(verifier_, overrides || {}) as Promise< + SequencerSoloClient & { + deploymentTransaction(): ContractTransactionResponse; + } + >; + } + override connect( + runner: ContractRunner | null + ): SequencerSoloClient__factory { + return super.connect(runner) as SequencerSoloClient__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): SequencerSoloClientInterface { + return new Interface(_abi) as SequencerSoloClientInterface; + } + static connect( + address: string, + runner?: ContractRunner | null + ): SequencerSoloClient { + return new Contract( + address, + _abi, + runner + ) as unknown as SequencerSoloClient; + } +} diff --git a/src/evm/contracts/factories/index.ts b/src/evm/contracts/factories/index.ts index b521fc0d..f833556f 100644 --- a/src/evm/contracts/factories/index.ts +++ b/src/evm/contracts/factories/index.ts @@ -19,4 +19,6 @@ export { IbcUtils__factory } from "./IbcUtils__factory"; export { Moon__factory } from "./Moon__factory"; export { OptimisticLightClient__factory } from "./OptimisticLightClient__factory"; export { OptimisticProofVerifier__factory } from "./OptimisticProofVerifier__factory"; +export { SequencerSignatureVerifier__factory } from "./SequencerSignatureVerifier__factory"; +export { SequencerSoloClient__factory } from "./SequencerSoloClient__factory"; export { UniversalChannelHandler__factory } from "./UniversalChannelHandler__factory"; diff --git a/src/evm/contracts/index.ts b/src/evm/contracts/index.ts index b4b75561..97073740 100644 --- a/src/evm/contracts/index.ts +++ b/src/evm/contracts/index.ts @@ -22,6 +22,8 @@ export type { IbcUtils } from "./IbcUtils"; export type { Moon } from "./Moon"; export type { OptimisticLightClient } from "./OptimisticLightClient"; export type { OptimisticProofVerifier } from "./OptimisticProofVerifier"; +export type { SequencerSignatureVerifier } from "./SequencerSignatureVerifier"; +export type { SequencerSoloClient } from "./SequencerSoloClient"; export type { UniversalChannelHandler } from "./UniversalChannelHandler"; export * as factories from "./factories"; export { Dispatcher__factory } from "./factories/Dispatcher__factory"; @@ -61,4 +63,6 @@ export { RevertingStringMars__factory } from "./factories/Mars.sol/RevertingStri export { Moon__factory } from "./factories/Moon__factory"; export { OptimisticLightClient__factory } from "./factories/OptimisticLightClient__factory"; export { OptimisticProofVerifier__factory } from "./factories/OptimisticProofVerifier__factory"; +export { SequencerSoloClient__factory } from "./factories/SequencerSoloClient__factory"; +export { SequencerSignatureVerifier__factory } from "./factories/SequencerSignatureVerifier__factory"; export { UniversalChannelHandler__factory } from "./factories/UniversalChannelHandler__factory";