Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
deps(contracts): bumped sp1 contracts to v1.0.1 and bumped the linter (
Browse files Browse the repository at this point in the history
…#77)

* deps: bumped package.json

* deps: ran 'bun install'

* fix: fix the contract paths

* deps: bumped linter

* imp: updated linter

* style: fixed all lint issues

* imp: ran abi gen

* fix: rust compiler

* style: ran linter
  • Loading branch information
srdtrk authored Jul 25, 2024
1 parent af38efa commit 7aa5323
Show file tree
Hide file tree
Showing 27 changed files with 195 additions and 211 deletions.
5 changes: 4 additions & 1 deletion .solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"named-parameters-mapping": "warn",
"no-console": "off",
"not-rely-on-time": "off",
"one-contract-per-file": "off"
"one-contract-per-file": "off",
"gas-custom-errors": "off",
"reason-string": "off",
"max-line-length": "off"
}
}
Binary file modified bun.lockb
Binary file not shown.
58 changes: 29 additions & 29 deletions contracts/abi/SP1ICS07Tendermint.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
"type": "constructor",
"inputs": [
{
"name": "_updateClientProgramVkey",
"name": "updateClientProgramVkey",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "_membershipProgramVkey",
"name": "membershipProgramVkey",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "_updateClientAndMembershipProgramVkey",
"name": "updateClientAndMembershipProgramVkey",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "_verifier",
"name": "verifier",
"type": "address",
"internalType": "address"
},
Expand Down Expand Up @@ -58,12 +58,12 @@
"internalType": "struct MembershipProgram.MembershipOutput",
"components": [
{
"name": "commitment_root",
"name": "commitmentRoot",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "kv_pairs",
"name": "kvPairs",
"type": "tuple[]",
"internalType": "struct MembershipProgram.KVPair[]",
"components": [
Expand All @@ -87,12 +87,12 @@
"internalType": "struct UpdateClientAndMembershipProgram.UcAndMembershipOutput",
"components": [
{
"name": "update_client_output",
"name": "updateClientOutput",
"type": "tuple",
"internalType": "struct UpdateClientProgram.UpdateClientOutput",
"components": [
{
"name": "trusted_consensus_state",
"name": "trustedConsensusState",
"type": "tuple",
"internalType": "struct ICS07Tendermint.ConsensusState",
"components": [
Expand All @@ -107,14 +107,14 @@
"internalType": "bytes32"
},
{
"name": "next_validators_hash",
"name": "nextValidatorsHash",
"type": "bytes32",
"internalType": "bytes32"
}
]
},
{
"name": "new_consensus_state",
"name": "newConsensusState",
"type": "tuple",
"internalType": "struct ICS07Tendermint.ConsensusState",
"components": [
Expand All @@ -129,7 +129,7 @@
"internalType": "bytes32"
},
{
"name": "next_validators_hash",
"name": "nextValidatorsHash",
"type": "bytes32",
"internalType": "bytes32"
}
Expand All @@ -141,12 +141,12 @@
"internalType": "struct UpdateClientProgram.Env",
"components": [
{
"name": "chain_id",
"name": "chainId",
"type": "string",
"internalType": "string"
},
{
"name": "trust_threshold",
"name": "trustThreshold",
"type": "tuple",
"internalType": "struct ICS07Tendermint.TrustThreshold",
"components": [
Expand All @@ -163,7 +163,7 @@
]
},
{
"name": "trusting_period",
"name": "trustingPeriod",
"type": "uint32",
"internalType": "uint32"
},
Expand All @@ -175,34 +175,34 @@
]
},
{
"name": "trusted_height",
"name": "trustedHeight",
"type": "tuple",
"internalType": "struct ICS07Tendermint.Height",
"components": [
{
"name": "revision_number",
"name": "revisionNumber",
"type": "uint32",
"internalType": "uint32"
},
{
"name": "revision_height",
"name": "revisionHeight",
"type": "uint32",
"internalType": "uint32"
}
]
},
{
"name": "new_height",
"name": "newHeight",
"type": "tuple",
"internalType": "struct ICS07Tendermint.Height",
"components": [
{
"name": "revision_number",
"name": "revisionNumber",
"type": "uint32",
"internalType": "uint32"
},
{
"name": "revision_height",
"name": "revisionHeight",
"type": "uint32",
"internalType": "uint32"
}
Expand All @@ -211,7 +211,7 @@
]
},
{
"name": "kv_pairs",
"name": "kvPairs",
"type": "tuple[]",
"internalType": "struct MembershipProgram.KVPair[]",
"components": [
Expand Down Expand Up @@ -277,12 +277,12 @@
"internalType": "struct ICS07Tendermint.ClientState",
"components": [
{
"name": "chain_id",
"name": "chainId",
"type": "string",
"internalType": "string"
},
{
"name": "trust_level",
"name": "trustLevel",
"type": "tuple",
"internalType": "struct ICS07Tendermint.TrustThreshold",
"components": [
Expand All @@ -299,34 +299,34 @@
]
},
{
"name": "latest_height",
"name": "latestHeight",
"type": "tuple",
"internalType": "struct ICS07Tendermint.Height",
"components": [
{
"name": "revision_number",
"name": "revisionNumber",
"type": "uint32",
"internalType": "uint32"
},
{
"name": "revision_height",
"name": "revisionHeight",
"type": "uint32",
"internalType": "uint32"
}
]
},
{
"name": "trusting_period",
"name": "trustingPeriod",
"type": "uint32",
"internalType": "uint32"
},
{
"name": "unbonding_period",
"name": "unbondingPeriod",
"type": "uint32",
"internalType": "uint32"
},
{
"name": "is_frozen",
"name": "isFrozen",
"type": "bool",
"internalType": "bool"
}
Expand Down
9 changes: 3 additions & 6 deletions contracts/script/SP1ICS07Tendermint.s.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
pragma solidity >=0.8.25;

import "forge-std/console.sol";
import { Script } from "forge-std/Script.sol";
import { stdJson } from "forge-std/StdJson.sol";
import { SP1ICS07Tendermint } from "../src/SP1ICS07Tendermint.sol";
import { SP1Verifier } from "@sp1-contracts/v1.0.0-rc1/SP1Verifier.sol";
import { SP1Verifier } from "@sp1-contracts/v1.0.1/SP1Verifier.sol";
import { ICS07Tendermint } from "../src/ics07-tendermint/ICS07Tendermint.sol";

struct SP1ICS07TendermintGenesisJson {
Expand All @@ -21,8 +20,6 @@ contract SP1TendermintScript is Script {

SP1ICS07Tendermint public ics07Tendermint;

function setUp() public { }

// Deploy the SP1 Tendermint contract with the supplied initialization parameters.
function run() public returns (address) {
// Read the initialization parameters for the SP1 Tendermint contract.
Expand Down Expand Up @@ -50,7 +47,7 @@ contract SP1TendermintScript is Script {
ICS07Tendermint.ClientState memory clientState = ics07Tendermint.getClientState();
assert(keccak256(abi.encode(clientState)) == keccak256(genesis.trustedClientState));

bytes32 consensusHash = ics07Tendermint.getConsensusStateHash(clientState.latest_height.revision_height);
bytes32 consensusHash = ics07Tendermint.getConsensusStateHash(clientState.latestHeight.revisionHeight);
assert(consensusHash == keccak256(abi.encode(trustedConsensusState)));

return address(ics07Tendermint);
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/ISP1ICS07Tendermint.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
pragma solidity >=0.8.25;

import { ICS07Tendermint } from "./ics07-tendermint/ICS07Tendermint.sol";
import { UpdateClientProgram } from "./ics07-tendermint/UpdateClientProgram.sol";
Expand Down
Loading

0 comments on commit 7aa5323

Please sign in to comment.