From 37063475c5adad6780836f463a95c3965599b29f Mon Sep 17 00:00:00 2001 From: srdtrk Date: Wed, 10 Jul 2024 14:09:40 +0800 Subject: [PATCH] imp: contract --- contracts/abi/SP1ICS07Tendermint.json | 26 +++++- contracts/src/SP1ICS07Tendermint.sol | 28 +++---- .../types/sp1ics07tendermint/contract.go | 81 +++++++++++++------ 3 files changed, 91 insertions(+), 44 deletions(-) diff --git a/contracts/abi/SP1ICS07Tendermint.json b/contracts/abi/SP1ICS07Tendermint.json index 04d5c98..a591743 100644 --- a/contracts/abi/SP1ICS07Tendermint.json +++ b/contracts/abi/SP1ICS07Tendermint.json @@ -3,12 +3,17 @@ "type": "constructor", "inputs": [ { - "name": "_ics07UpdateClientProgramVkey", + "name": "_updateClientProgramVkey", "type": "bytes32", "internalType": "bytes32" }, { - "name": "_ics07VerifyMembershipProgramVkey", + "name": "_membershipProgramVkey", + "type": "bytes32", + "internalType": "bytes32" + }, + { + "name": "_updateClientAndMembershipProgramVkey", "type": "bytes32", "internalType": "bytes32" }, @@ -318,7 +323,20 @@ }, { "type": "function", - "name": "ics07UpdateClientProgramVkey", + "name": "membershipProgramVkey", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bytes32", + "internalType": "bytes32" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "updateClientAndMembershipProgramVkey", "inputs": [], "outputs": [ { @@ -331,7 +349,7 @@ }, { "type": "function", - "name": "ics07VerifyMembershipProgramVkey", + "name": "updateClientProgramVkey", "inputs": [], "outputs": [ { diff --git a/contracts/src/SP1ICS07Tendermint.sol b/contracts/src/SP1ICS07Tendermint.sol index 5e3c025..cd215e3 100644 --- a/contracts/src/SP1ICS07Tendermint.sol +++ b/contracts/src/SP1ICS07Tendermint.sol @@ -14,13 +14,13 @@ import "forge-std/console.sol"; /// @custom:poc This is a proof of concept implementation. contract SP1ICS07Tendermint { /// @notice The verification key for the update client program. - bytes32 public immutable ics07UpdateClientProgramVkey; + bytes32 public immutable updateClientProgramVkey; /// @notice The verification key for the verify (non)membership program. - bytes32 public immutable ics07VerifyMembershipProgramVkey; + bytes32 public immutable membershipProgramVkey; /// @notice The verification key for the update client and membership program. bytes32 public immutable updateClientAndMembershipProgramVkey; /// @notice The SP1 verifier contract. - ISP1Verifier public verifier; + ISP1Verifier public immutable verifier; /// @notice The ICS07Tendermint client state ICS07Tendermint.ClientState private clientState; @@ -31,20 +31,22 @@ contract SP1ICS07Tendermint { uint64 public constant ALLOWED_SP1_CLOCK_DRIFT = 3000; // 3000 seconds /// @notice The constructor sets the program verification key and the initial client and consensus states. - /// @param _ics07UpdateClientProgramVkey The verification key for the update client program. + /// @param _updateClientProgramVkey The verification key for the update client program. + /// @param _membershipProgramVkey The verification key for the verify (non)membership program. + /// @param _updateClientAndMembershipProgramVkey The verification key for the update client and membership program. /// @param _verifier The address of the SP1 verifier contract. /// @param _clientState The encoded initial client state. /// @param _consensusState The encoded initial consensus state. constructor( - bytes32 _ics07UpdateClientProgramVkey, - bytes32 _ics07VerifyMembershipProgramVkey, + bytes32 _updateClientProgramVkey, + bytes32 _membershipProgramVkey, bytes32 _updateClientAndMembershipProgramVkey, address _verifier, bytes memory _clientState, bytes32 _consensusState ) { - ics07UpdateClientProgramVkey = _ics07UpdateClientProgramVkey; - ics07VerifyMembershipProgramVkey = _ics07VerifyMembershipProgramVkey; + updateClientProgramVkey = _updateClientProgramVkey; + membershipProgramVkey = _membershipProgramVkey; updateClientAndMembershipProgramVkey = _updateClientAndMembershipProgramVkey; verifier = ISP1Verifier(_verifier); @@ -90,7 +92,7 @@ contract SP1ICS07Tendermint { // TODO: Make sure that other checks have been made in the proof verification // such as the consensus state not being outside the trusting period. - verifier.verifyProof(ics07UpdateClientProgramVkey, publicValues, proof); + verifier.verifyProof(updateClientProgramVkey, publicValues, proof); // adding the new consensus state to the mapping clientState.latest_height = output.new_height; @@ -150,11 +152,7 @@ contract SP1ICS07Tendermint { trustedConsensusStateBz ); - verifier.verifyProof( - ics07VerifyMembershipProgramVkey, - publicValues, - proof - ); + verifier.verifyProof(membershipProgramVkey, publicValues, proof); } /// @notice The entrypoint for updating the client and membership proof. @@ -212,7 +210,7 @@ contract SP1ICS07Tendermint { abi.encode(output.update_client_output.new_consensus_state) ); - verifier.verifyProof(ics07UpdateClientProgramVkey, publicValues, proof); + verifier.verifyProof(updateClientProgramVkey, publicValues, proof); } /// @notice Validates the MembershipOutput public values. diff --git a/e2e/interchaintestv8/types/sp1ics07tendermint/contract.go b/e2e/interchaintestv8/types/sp1ics07tendermint/contract.go index 3108497..98e8e1b 100644 --- a/e2e/interchaintestv8/types/sp1ics07tendermint/contract.go +++ b/e2e/interchaintestv8/types/sp1ics07tendermint/contract.go @@ -95,7 +95,7 @@ type UpdateClientProgramUpdateClientOutput struct { // ContractMetaData contains all meta data concerning the Contract contract. var ContractMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_ics07UpdateClientProgramVkey\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_ics07VerifyMembershipProgramVkey\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_verifier\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_clientState\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"_consensusState\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"ALLOWED_SP1_CLOCK_DRIFT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"abiPublicTypes\",\"inputs\":[{\"name\":\"output\",\"type\":\"tuple\",\"internalType\":\"structMembershipProgram.MembershipOutput\",\"components\":[{\"name\":\"commitment_root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"kv_pairs\",\"type\":\"tuple[]\",\"internalType\":\"structMembershipProgram.KVPair[]\",\"components\":[{\"name\":\"key\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"value\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}]},{\"name\":\"output2\",\"type\":\"tuple\",\"internalType\":\"structUpdateClientAndMembershipProgram.UcAndMembershipOutput\",\"components\":[{\"name\":\"update_client_output\",\"type\":\"tuple\",\"internalType\":\"structUpdateClientProgram.UpdateClientOutput\",\"components\":[{\"name\":\"trusted_consensus_state\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.ConsensusState\",\"components\":[{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"next_validators_hash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"new_consensus_state\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.ConsensusState\",\"components\":[{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"next_validators_hash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"env\",\"type\":\"tuple\",\"internalType\":\"structUpdateClientProgram.Env\",\"components\":[{\"name\":\"chain_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"trust_threshold\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.TrustThreshold\",\"components\":[{\"name\":\"numerator\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"denominator\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"trusting_period\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"now\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"trusted_height\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.Height\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"revision_height\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"new_height\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.Height\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"revision_height\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}]},{\"name\":\"kv_pairs\",\"type\":\"tuple[]\",\"internalType\":\"structMembershipProgram.KVPair[]\",\"components\":[{\"name\":\"key\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"value\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}]}],\"outputs\":[],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getClientState\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.ClientState\",\"components\":[{\"name\":\"chain_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"trust_level\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.TrustThreshold\",\"components\":[{\"name\":\"numerator\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"denominator\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"latest_height\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.Height\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"revision_height\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"trusting_period\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"unbonding_period\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"is_frozen\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getConsensusState\",\"inputs\":[{\"name\":\"revisionHeight\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ics07UpdateClientProgramVkey\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ics07VerifyMembershipProgramVkey\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validateMembershipOutput\",\"inputs\":[{\"name\":\"outputCommitmentRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proofHeight\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"trustedConsensusStateBz\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validateUpdateClientPublicValues\",\"inputs\":[{\"name\":\"output\",\"type\":\"tuple\",\"internalType\":\"structUpdateClientProgram.UpdateClientOutput\",\"components\":[{\"name\":\"trusted_consensus_state\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.ConsensusState\",\"components\":[{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"next_validators_hash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"new_consensus_state\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.ConsensusState\",\"components\":[{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"next_validators_hash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"env\",\"type\":\"tuple\",\"internalType\":\"structUpdateClientProgram.Env\",\"components\":[{\"name\":\"chain_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"trust_threshold\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.TrustThreshold\",\"components\":[{\"name\":\"numerator\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"denominator\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"trusting_period\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"now\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"trusted_height\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.Height\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"revision_height\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"new_height\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.Height\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"revision_height\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}]}],\"outputs\":[],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifier\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractISP1Verifier\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifyIcs07MembershipProof\",\"inputs\":[{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"publicValues\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"trustedConsensusStateBz\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"kvPairHashes\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"outputs\":[],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifyIcs07UcAndMembershipProof\",\"inputs\":[{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"publicValues\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"kvPairHashes\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyIcs07UpdateClientProof\",\"inputs\":[{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"publicValues\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"}]", + ABI: "[{\"type\":\"constructor\",\"inputs\":[{\"name\":\"_updateClientProgramVkey\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_membershipProgramVkey\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_updateClientAndMembershipProgramVkey\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_verifier\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_clientState\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"_consensusState\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"ALLOWED_SP1_CLOCK_DRIFT\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"abiPublicTypes\",\"inputs\":[{\"name\":\"output\",\"type\":\"tuple\",\"internalType\":\"structMembershipProgram.MembershipOutput\",\"components\":[{\"name\":\"commitment_root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"kv_pairs\",\"type\":\"tuple[]\",\"internalType\":\"structMembershipProgram.KVPair[]\",\"components\":[{\"name\":\"key\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"value\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}]},{\"name\":\"output2\",\"type\":\"tuple\",\"internalType\":\"structUpdateClientAndMembershipProgram.UcAndMembershipOutput\",\"components\":[{\"name\":\"update_client_output\",\"type\":\"tuple\",\"internalType\":\"structUpdateClientProgram.UpdateClientOutput\",\"components\":[{\"name\":\"trusted_consensus_state\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.ConsensusState\",\"components\":[{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"next_validators_hash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"new_consensus_state\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.ConsensusState\",\"components\":[{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"next_validators_hash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"env\",\"type\":\"tuple\",\"internalType\":\"structUpdateClientProgram.Env\",\"components\":[{\"name\":\"chain_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"trust_threshold\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.TrustThreshold\",\"components\":[{\"name\":\"numerator\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"denominator\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"trusting_period\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"now\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"trusted_height\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.Height\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"revision_height\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"new_height\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.Height\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"revision_height\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}]},{\"name\":\"kv_pairs\",\"type\":\"tuple[]\",\"internalType\":\"structMembershipProgram.KVPair[]\",\"components\":[{\"name\":\"key\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"value\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}]}],\"outputs\":[],\"stateMutability\":\"pure\"},{\"type\":\"function\",\"name\":\"getClientState\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.ClientState\",\"components\":[{\"name\":\"chain_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"trust_level\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.TrustThreshold\",\"components\":[{\"name\":\"numerator\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"denominator\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"latest_height\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.Height\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"revision_height\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"trusting_period\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"unbonding_period\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"is_frozen\",\"type\":\"bool\",\"internalType\":\"bool\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getConsensusState\",\"inputs\":[{\"name\":\"revisionHeight\",\"type\":\"uint32\",\"internalType\":\"uint32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"membershipProgramVkey\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"updateClientAndMembershipProgramVkey\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"updateClientProgramVkey\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validateMembershipOutput\",\"inputs\":[{\"name\":\"outputCommitmentRoot\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"proofHeight\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"trustedConsensusStateBz\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"validateUpdateClientPublicValues\",\"inputs\":[{\"name\":\"output\",\"type\":\"tuple\",\"internalType\":\"structUpdateClientProgram.UpdateClientOutput\",\"components\":[{\"name\":\"trusted_consensus_state\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.ConsensusState\",\"components\":[{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"next_validators_hash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"new_consensus_state\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.ConsensusState\",\"components\":[{\"name\":\"timestamp\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"root\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"next_validators_hash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}]},{\"name\":\"env\",\"type\":\"tuple\",\"internalType\":\"structUpdateClientProgram.Env\",\"components\":[{\"name\":\"chain_id\",\"type\":\"string\",\"internalType\":\"string\"},{\"name\":\"trust_threshold\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.TrustThreshold\",\"components\":[{\"name\":\"numerator\",\"type\":\"uint8\",\"internalType\":\"uint8\"},{\"name\":\"denominator\",\"type\":\"uint8\",\"internalType\":\"uint8\"}]},{\"name\":\"trusting_period\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"now\",\"type\":\"uint64\",\"internalType\":\"uint64\"}]},{\"name\":\"trusted_height\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.Height\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"revision_height\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]},{\"name\":\"new_height\",\"type\":\"tuple\",\"internalType\":\"structICS07Tendermint.Height\",\"components\":[{\"name\":\"revision_number\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"revision_height\",\"type\":\"uint32\",\"internalType\":\"uint32\"}]}]}],\"outputs\":[],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifier\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractISP1Verifier\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifyIcs07MembershipProof\",\"inputs\":[{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"publicValues\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"proofHeight\",\"type\":\"uint32\",\"internalType\":\"uint32\"},{\"name\":\"trustedConsensusStateBz\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"kvPairHashes\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"outputs\":[],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"verifyIcs07UcAndMembershipProof\",\"inputs\":[{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"publicValues\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"kvPairHashes\",\"type\":\"bytes32[]\",\"internalType\":\"bytes32[]\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"verifyIcs07UpdateClientProof\",\"inputs\":[{\"name\":\"proof\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"publicValues\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"}]", } // ContractABI is the input ABI used to generate the binding from. @@ -366,12 +366,12 @@ func (_Contract *ContractCallerSession) GetConsensusState(revisionHeight uint32) return _Contract.Contract.GetConsensusState(&_Contract.CallOpts, revisionHeight) } -// Ics07UpdateClientProgramVkey is a free data retrieval call binding the contract method 0x975c0796. +// MembershipProgramVkey is a free data retrieval call binding the contract method 0x2b69debf. // -// Solidity: function ics07UpdateClientProgramVkey() view returns(bytes32) -func (_Contract *ContractCaller) Ics07UpdateClientProgramVkey(opts *bind.CallOpts) ([32]byte, error) { +// Solidity: function membershipProgramVkey() view returns(bytes32) +func (_Contract *ContractCaller) MembershipProgramVkey(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} - err := _Contract.contract.Call(opts, &out, "ics07UpdateClientProgramVkey") + err := _Contract.contract.Call(opts, &out, "membershipProgramVkey") if err != nil { return *new([32]byte), err @@ -383,26 +383,26 @@ func (_Contract *ContractCaller) Ics07UpdateClientProgramVkey(opts *bind.CallOpt } -// Ics07UpdateClientProgramVkey is a free data retrieval call binding the contract method 0x975c0796. +// MembershipProgramVkey is a free data retrieval call binding the contract method 0x2b69debf. // -// Solidity: function ics07UpdateClientProgramVkey() view returns(bytes32) -func (_Contract *ContractSession) Ics07UpdateClientProgramVkey() ([32]byte, error) { - return _Contract.Contract.Ics07UpdateClientProgramVkey(&_Contract.CallOpts) +// Solidity: function membershipProgramVkey() view returns(bytes32) +func (_Contract *ContractSession) MembershipProgramVkey() ([32]byte, error) { + return _Contract.Contract.MembershipProgramVkey(&_Contract.CallOpts) } -// Ics07UpdateClientProgramVkey is a free data retrieval call binding the contract method 0x975c0796. +// MembershipProgramVkey is a free data retrieval call binding the contract method 0x2b69debf. // -// Solidity: function ics07UpdateClientProgramVkey() view returns(bytes32) -func (_Contract *ContractCallerSession) Ics07UpdateClientProgramVkey() ([32]byte, error) { - return _Contract.Contract.Ics07UpdateClientProgramVkey(&_Contract.CallOpts) +// Solidity: function membershipProgramVkey() view returns(bytes32) +func (_Contract *ContractCallerSession) MembershipProgramVkey() ([32]byte, error) { + return _Contract.Contract.MembershipProgramVkey(&_Contract.CallOpts) } -// Ics07VerifyMembershipProgramVkey is a free data retrieval call binding the contract method 0xc77eb6c2. +// UpdateClientAndMembershipProgramVkey is a free data retrieval call binding the contract method 0x2e930d2f. // -// Solidity: function ics07VerifyMembershipProgramVkey() view returns(bytes32) -func (_Contract *ContractCaller) Ics07VerifyMembershipProgramVkey(opts *bind.CallOpts) ([32]byte, error) { +// Solidity: function updateClientAndMembershipProgramVkey() view returns(bytes32) +func (_Contract *ContractCaller) UpdateClientAndMembershipProgramVkey(opts *bind.CallOpts) ([32]byte, error) { var out []interface{} - err := _Contract.contract.Call(opts, &out, "ics07VerifyMembershipProgramVkey") + err := _Contract.contract.Call(opts, &out, "updateClientAndMembershipProgramVkey") if err != nil { return *new([32]byte), err @@ -414,18 +414,49 @@ func (_Contract *ContractCaller) Ics07VerifyMembershipProgramVkey(opts *bind.Cal } -// Ics07VerifyMembershipProgramVkey is a free data retrieval call binding the contract method 0xc77eb6c2. +// UpdateClientAndMembershipProgramVkey is a free data retrieval call binding the contract method 0x2e930d2f. // -// Solidity: function ics07VerifyMembershipProgramVkey() view returns(bytes32) -func (_Contract *ContractSession) Ics07VerifyMembershipProgramVkey() ([32]byte, error) { - return _Contract.Contract.Ics07VerifyMembershipProgramVkey(&_Contract.CallOpts) +// Solidity: function updateClientAndMembershipProgramVkey() view returns(bytes32) +func (_Contract *ContractSession) UpdateClientAndMembershipProgramVkey() ([32]byte, error) { + return _Contract.Contract.UpdateClientAndMembershipProgramVkey(&_Contract.CallOpts) } -// Ics07VerifyMembershipProgramVkey is a free data retrieval call binding the contract method 0xc77eb6c2. +// UpdateClientAndMembershipProgramVkey is a free data retrieval call binding the contract method 0x2e930d2f. // -// Solidity: function ics07VerifyMembershipProgramVkey() view returns(bytes32) -func (_Contract *ContractCallerSession) Ics07VerifyMembershipProgramVkey() ([32]byte, error) { - return _Contract.Contract.Ics07VerifyMembershipProgramVkey(&_Contract.CallOpts) +// Solidity: function updateClientAndMembershipProgramVkey() view returns(bytes32) +func (_Contract *ContractCallerSession) UpdateClientAndMembershipProgramVkey() ([32]byte, error) { + return _Contract.Contract.UpdateClientAndMembershipProgramVkey(&_Contract.CallOpts) +} + +// UpdateClientProgramVkey is a free data retrieval call binding the contract method 0xbad9af88. +// +// Solidity: function updateClientProgramVkey() view returns(bytes32) +func (_Contract *ContractCaller) UpdateClientProgramVkey(opts *bind.CallOpts) ([32]byte, error) { + var out []interface{} + err := _Contract.contract.Call(opts, &out, "updateClientProgramVkey") + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// UpdateClientProgramVkey is a free data retrieval call binding the contract method 0xbad9af88. +// +// Solidity: function updateClientProgramVkey() view returns(bytes32) +func (_Contract *ContractSession) UpdateClientProgramVkey() ([32]byte, error) { + return _Contract.Contract.UpdateClientProgramVkey(&_Contract.CallOpts) +} + +// UpdateClientProgramVkey is a free data retrieval call binding the contract method 0xbad9af88. +// +// Solidity: function updateClientProgramVkey() view returns(bytes32) +func (_Contract *ContractCallerSession) UpdateClientProgramVkey() ([32]byte, error) { + return _Contract.Contract.UpdateClientProgramVkey(&_Contract.CallOpts) } // ValidateMembershipOutput is a free data retrieval call binding the contract method 0x0ac733e2.