Skip to content

Commit

Permalink
example ism
Browse files Browse the repository at this point in the history
  • Loading branch information
aroralanuk committed Nov 12, 2024
1 parent 249d1eb commit 0d55121
Show file tree
Hide file tree
Showing 8 changed files with 5,024 additions and 55 deletions.
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"name": "@ethsign/",
"name": "@hyperlane-xyz/community",
"version": "1.0.0",
"description": "",
"repository": {
"type": "git",
"url": "git+https://github.com/EthSign"
},
"description": "A repository for community-contributions to Hyperlane protocol.",
"repository": "https://github.com/hyperlane-xyz/community-isms",
"license": "Apache-2.0",
"keywords": [
"Hyperlane",
"Solidity"
],
"scripts": {
"prepare": "husky",
"clean": "forge clean && hardhat clean && rm -rf cache_hardhat",
Expand All @@ -18,9 +20,8 @@
"test:coverage": "forge coverage",
"test:gas": "forge test --gas-report"
},
"author": "",
"license": "ISC",
"dependencies": {
"@hyperlane-xyz/core": "^5.8.0",
"@openzeppelin/contracts": "5.0.2",
"@openzeppelin/contracts-upgradeable": "5.0.2"
},
Expand Down
1 change: 1 addition & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/
@openzeppelin/contracts-upgradeable/=node_modules/@openzeppelin/contracts-upgradeable/
@hyperlane-xyz/=node_modules/@hyperlane-xyz/core/
ds-test/=node_modules/ds-test/src
forge-std/=node_modules/forge-std/src
9 changes: 0 additions & 9 deletions scripts/01-deploy-upgradeable.ts

This file was deleted.

14 changes: 0 additions & 14 deletions src/Counter.sol

This file was deleted.

24 changes: 24 additions & 0 deletions src/ExampleIsm.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity >=0.8.0;

import { IInterchainSecurityModule } from "@hyperlane-xyz/contracts/interfaces/IInterchainSecurityModule.sol";

contract ExampleIsm is IInterchainSecurityModule {
// @dev The first 128 enum values are reserved for core Hyperlane types
uint8 public constant COMMUNITY_MASK = 0x80;

// TODO: Replace with actual community types you want to use
enum CommunityTypes {
EXAMPLE_ISM
}

// @inheritdoc IInterchainSecurityModule
uint8 public moduleType = uint8(CommunityTypes.EXAMPLE_ISM) | COMMUNITY_MASK;

// @inheritdoc IInterchainSecurityModule
function verify(bytes calldata, bytes calldata) public view returns (bool) {
// TODO: Implement the verification logic for incoming messages and return true if the message is valid
// check AbstractMultisigIsm.sol for a reference implementation
return true;
}
}
24 changes: 0 additions & 24 deletions test/Counter.t.sol

This file was deleted.

23 changes: 23 additions & 0 deletions test/ExampleIsm.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// SPDX-License-Identifier: MIT or Apache-2.0
pragma solidity ^0.8.13;

import { Test } from "forge-std/Test.sol";
import { ExampleIsm } from "../src/ExampleIsm.sol";

contract ExampleIsmTest is Test {
ExampleIsm public exampleIsm;
uint8 public constant EXAMPLE_ISM_TYPE = 128;

function setUp() public {
exampleIsm = new ExampleIsm();
}

function test_moduleType() public view {
assertEq(exampleIsm.moduleType(), EXAMPLE_ISM_TYPE);
}

// TODO: Implement the test for the verify function
function test_verify() public view {
assertTrue(exampleIsm.verify(abi.encode(""), abi.encode("")));
}
}
Loading

0 comments on commit 0d55121

Please sign in to comment.