From fe6cb4c638c72438f7e69e18a4c51318b763fedc Mon Sep 17 00:00:00 2001 From: Seun Lanlege Date: Sat, 24 Aug 2024 10:47:29 +0000 Subject: [PATCH] update contract address & abi --- abis/evmHost.ts | 165 +++++++++++++++++++++++++-------------------- abis/handler.ts | 10 +++ abis/pingModule.ts | 23 ++++++- index.ts | 5 +- package.json | 2 +- yarn.lock | 8 +-- 6 files changed, 133 insertions(+), 80 deletions(-) diff --git a/abis/evmHost.ts b/abis/evmHost.ts index cb1d230..6f49096 100644 --- a/abis/evmHost.ts +++ b/abis/evmHost.ts @@ -129,6 +129,12 @@ const ABI = [ name: "timeoutTimestamp", type: "uint256", }, + { + indexed: false, + internalType: "bytes", + name: "context", + type: "bytes", + }, { indexed: false, internalType: "uint256", @@ -971,6 +977,11 @@ const ABI = [ name: "fee", type: "uint256", }, + { + internalType: "bytes", + name: "context", + type: "bytes", + }, ], internalType: "struct DispatchGet", name: "get", @@ -1156,6 +1167,11 @@ const ABI = [ name: "height", type: "uint64", }, + { + internalType: "bytes", + name: "context", + type: "bytes", + }, ], internalType: "struct GetRequest", name: "request", @@ -1194,78 +1210,6 @@ const ABI = [ stateMutability: "nonpayable", type: "function", }, - { - inputs: [ - { - components: [ - { - internalType: "bytes", - name: "source", - type: "bytes", - }, - { - internalType: "bytes", - name: "dest", - type: "bytes", - }, - { - internalType: "uint64", - name: "nonce", - type: "uint64", - }, - { - internalType: "address", - name: "from", - type: "address", - }, - { - internalType: "uint64", - name: "timeoutTimestamp", - type: "uint64", - }, - { - internalType: "bytes[]", - name: "keys", - type: "bytes[]", - }, - { - internalType: "uint64", - name: "height", - type: "uint64", - }, - ], - internalType: "struct GetRequest", - name: "request", - type: "tuple", - }, - { - components: [ - { - internalType: "uint256", - name: "fee", - type: "uint256", - }, - { - internalType: "address", - name: "sender", - type: "address", - }, - ], - internalType: "struct FeeMetadata", - name: "meta", - type: "tuple", - }, - { - internalType: "bytes32", - name: "commitment", - type: "bytes32", - }, - ], - name: "dispatchTimeOut", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, { inputs: [ { @@ -1427,6 +1371,83 @@ const ABI = [ stateMutability: "nonpayable", type: "function", }, + { + inputs: [ + { + components: [ + { + internalType: "bytes", + name: "source", + type: "bytes", + }, + { + internalType: "bytes", + name: "dest", + type: "bytes", + }, + { + internalType: "uint64", + name: "nonce", + type: "uint64", + }, + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "uint64", + name: "timeoutTimestamp", + type: "uint64", + }, + { + internalType: "bytes[]", + name: "keys", + type: "bytes[]", + }, + { + internalType: "uint64", + name: "height", + type: "uint64", + }, + { + internalType: "bytes", + name: "context", + type: "bytes", + }, + ], + internalType: "struct GetRequest", + name: "request", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "fee", + type: "uint256", + }, + { + internalType: "address", + name: "sender", + type: "address", + }, + ], + internalType: "struct FeeMetadata", + name: "meta", + type: "tuple", + }, + { + internalType: "bytes32", + name: "commitment", + type: "bytes32", + }, + ], + name: "dispatchTimeOut", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, { inputs: [], name: "feeToken", diff --git a/abis/handler.ts b/abis/handler.ts index 21113b3..08c4dc3 100644 --- a/abis/handler.ts +++ b/abis/handler.ts @@ -113,6 +113,11 @@ const ABI = [ name: "height", type: "uint64", }, + { + internalType: "bytes", + name: "context", + type: "bytes", + }, ], internalType: "struct GetRequest[]", name: "timeouts", @@ -235,6 +240,11 @@ const ABI = [ name: "height", type: "uint64", }, + { + internalType: "bytes", + name: "context", + type: "bytes", + }, ], internalType: "struct GetRequest", name: "request", diff --git a/abis/pingModule.ts b/abis/pingModule.ts index b24ee46..a8baa73 100644 --- a/abis/pingModule.ts +++ b/abis/pingModule.ts @@ -36,6 +36,7 @@ const ABI = [ type: "bytes", }, ], + indexed: false, internalType: "struct StorageValue[]", name: "message", type: "tuple[]", @@ -126,6 +127,11 @@ const ABI = [ name: "height", type: "uint64", }, + { + internalType: "bytes", + name: "context", + type: "bytes", + }, ], internalType: "struct GetRequest", name: "request", @@ -347,6 +353,11 @@ const ABI = [ name: "height", type: "uint64", }, + { + internalType: "bytes", + name: "context", + type: "bytes", + }, ], internalType: "struct GetRequest", name: "request", @@ -381,7 +392,7 @@ const ABI = [ }, ], internalType: "struct IncomingGetResponse", - name: "", + name: "response", type: "tuple", }, ], @@ -429,6 +440,11 @@ const ABI = [ name: "height", type: "uint64", }, + { + internalType: "bytes", + name: "context", + type: "bytes", + }, ], internalType: "struct GetRequest", name: "", @@ -733,6 +749,11 @@ const ABI = [ name: "hostAddr", type: "address", }, + { + internalType: "address", + name: "tokenFaucet", + type: "address", + }, ], name: "setIsmpHost", outputs: [], diff --git a/index.ts b/index.ts index ae5a289..7f438e1 100644 --- a/index.ts +++ b/index.ts @@ -24,7 +24,7 @@ import PING_MODULE from "./abis/pingModule"; import EVM_HOST from "./abis/evmHost"; import HANDLER from "./abis/handler"; -const PING_MODULE_ADDRESS = "0x1aD48ADeD62e7C685dF4fb75e6d14d34C8B83081"; +const PING_MODULE_ADDRESS = "0x42C6551d05eA47c46Fc7B01BBaaD37c466481361"; /* Using a viem client, dispatches an onchain transaction to the ping module. @@ -111,6 +111,7 @@ async function testPostAndGetRequest() { source: "0x", dest: OP.state_machine, nonce: 0n, + context: "0x", from: account.address, keys: [account.address, opSepoliaIsmpHost.address, opSepoliaHandler.address], height: BigInt(height), // latest height @@ -383,7 +384,7 @@ async function setUp() { }); const tokenFaucet = getContract({ - address: "0x50A60531EF45a62711A812C081CC2C17ac683def", + address: "0x17d8cc0859fbA942A7af243c3EBB69AbBfe0a320", abi: parseAbi(["function drip(address token) public"]), client: { public: bscTestnetClient, wallet: bscWalletClient }, }); diff --git a/package.json b/package.json index ab35a2c..ded2603 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "dependencies": { "@ethereumjs/util": "^9.1.0", "@polkadot/api": "^12.3.1", - "@polytope-labs/hyperclient": "^0.4.3", + "@polytope-labs/hyperclient": "^0.5.0", "dotenv": "^16.4.5", "log-timestamp": "^0.3.0", "prettify": "^0.1.7", diff --git a/yarn.lock b/yarn.lock index 2602b94..e389de2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -419,10 +419,10 @@ tslib "^2.6.2" ws "^8.16.0" -"@polytope-labs/hyperclient@^0.4.3": - version "0.4.3" - resolved "https://registry.yarnpkg.com/@polytope-labs/hyperclient/-/hyperclient-0.4.3.tgz#028fdaa56d7608c294b60b30264c56658c689a77" - integrity sha512-8Ogpn4I7Ifox6TKT9N7sQqGGs3uHW436n9Ta4ZFTvNF3EvEQc4gzH7Gn2NqGqq7lWDnVDc4Et8rYliK4ZAsMRw== +"@polytope-labs/hyperclient@^0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@polytope-labs/hyperclient/-/hyperclient-0.5.0.tgz#6072416e99dd3505ccb4d7400a19e6437d20fb44" + integrity sha512-0AdePntSt6cmaFmFbVU9XEU3KbrM3UZsT0iaKKlx1LK/fCMFCf3eFyhpj/C7wMPurOpYaE6yyafd/H3L8llvzg== "@scure/base@^1.1.1", "@scure/base@^1.1.5", "@scure/base@~1.1.6": version "1.1.7"