Skip to content

Commit

Permalink
fixing getNetworkPublicKey to not include securityZone param
Browse files Browse the repository at this point in the history
  • Loading branch information
eshelB committed Sep 23, 2024
1 parent e8b1494 commit 0b7a0bc
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions docs/devdocs/FhenixJS/Network Keys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,25 @@ The Public Key is constant for the lifetime of the network, but still has to be
<Tabs>
<TabItem value="ethers.js" label="ethers.js">
```javascript
const networkPkAbi = new Interface(["function getNetworkPublicKey(int32 securityZone)"]);
const callData = networkPkAbi.encodeFunctionData("getNetworkPublicKey", [0]); // last param is the security zone, generally 0
const networkPkAbi = new Interface(["function getNetworkPublicKey()"])
let result = await provider.call({
to: "0x0000000000000000000000000000000000000080",
data: callData
data: networkPkAbi.encodeFunctionData("getNetworkPublicKey");
});
```
</TabItem>
<TabItem value="web3.js" label="Web3.js">
```javascript
const networkPkSig = web3.eth.abi.encodeFunctionSignature("function getNetworkPublicKey(int32 securityZone)");
const param = web3.eth.abi.encodeParameter("int32", 0); // last param is the security zone, generally 0
const networkPkSig = web3.eth.abi.encodeFunctionSignature("getNetworkPublicKey()");
let result = await web3.eth.call({
to: "0x0000000000000000000000000000000000000080",
data: networkPkSig + param
data: networkPkSig
});
```
</TabItem>
<TabItem value="cast (Foundry)" label="cast (Foundry)">
```shell
cast call 0x0000000000000000000000000000000000000080 --rpc-url "https://api.helium.fhenix.zone" "getNetworkPublicKey()"
```
</TabItem>
</Tabs>

0 comments on commit 0b7a0bc

Please sign in to comment.