diff --git a/README.md b/README.md index e7b85e5..4b86200 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,7 @@ The above script will perform following operation: | TransparentForwarder | 0xb28AE76CA80a461c633624F9764f37235800F533 | | Staking | 0x7F56e39f6629e5D5E281fB9F65BdC7121F2F6E69 | -### Calypso hub (hardhat) + ## Testnet ### Calypso Testnet diff --git a/deployments/calypsoMainnet.json b/deployments/calypsoMainnet.json deleted file mode 100644 index 90fa64e..0000000 --- a/deployments/calypsoMainnet.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "ResultManager": "0xeDbaBd3D5A871f54838315d99BF7d06749159005", - "Forwarder": "0xa9f5E56320EED42051db050DfB73B5549c78BB3B", - "TransparentForwarder": "0x0AA11CC12410c0F09fc881a362b0c2E695969162", - "Staking": "0x81321F01CE2CB74510A8B33f090c85887f51C402" -} \ No newline at end of file diff --git a/deployments/nebulaMainnet.json b/deployments/nebulaMainnet.json deleted file mode 100644 index 33b7d44..0000000 --- a/deployments/nebulaMainnet.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "ResultManager": "0xBd4642B6E698cE2A6DFD7bd69FDF5Af968bE05d9", - "Forwarder": "0x951350581E842F85800cC8dA0b96192a71DfEc0d", - "TransparentForwarder": "0xD910E832ead086314409D56ECD3D2dB1256CfF58", - "Staking": "0xb28AE76CA80a461c633624F9764f37235800F533" -} \ No newline at end of file diff --git a/hardhat.config.js b/hardhat.config.js index 60c9d6d..936d4a4 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -12,198 +12,229 @@ const { RINKEBY_RPC } = process.env; module.exports = { solidity: "0.8.9", networks: { - sChainLocal: { - url: "http://localhost:15000", - accounts: [ - "0xde9be858da4a475276426320d5e9262ecfc3ba460bfac56360bfa6c4c28b4ee0", - "0xdf57089febbacf7ba0bc227dafbffa9fc08a93fdc68e1e42411a14efcf23656e", - ], - }, ethereum: { chainId: 1, + // url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, url: "https://eth.meowrpc.com", ledgerAccounts: [ - process.env.DEPLOYER_ADDRESS, // specify Ledger Address here (required) ADMIN ADDRESS + process.env.DEPLOYER_ADDRESS, ], timeout: 600000, }, calypsoMainnet: { chainId: 1564830818, url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, - timeout: 600000, // this is important, because otherwise the request can time out before you've reviewed and confirmed your transaction on the Ledger + // url: "https://mainnet.skalenodes.com/v1/honorable-steel-rasalhague", + // ledgerAccounts: [ + // process.env.DEPLOYER_ADDRESS, + // ], + timeout: 600000, }, - eth: { - chainId: 1, - url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, - timeout: 600000, // this is important, because otherwise the request can time out before you've reviewed and confirmed your transaction on the Ledger - }, nebulaMainnet: { chainId: 1482601649, url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, + // url: "https://mainnet.skalenodes.com/v1/green-giddy-denebola", + // ledgerAccounts: [ + // process.env.DEPLOYER_ADDRESS, + // ], timeout: 600000, }, titanMainnet: { chainId: 1350216234, url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, + // url: "https://mainnet.skalenodes.com/v1/parallel-stormy-spica", + // ledgerAccounts: [ + // process.env.DEPLOYER_ADDRESS, + // ], timeout: 600000, }, europaMainnet: { chainId: 2046399126, url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, + // url: "https://mainnet.skalenodes.com/v1/elated-tan-skat", + // ledgerAccounts: [ + // process.env.DEPLOYER_ADDRESS, + // ], timeout: 600000, }, polygon: { chainId: 137, url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, + // url: "https://1rpc.io/matic", + // ledgerAccounts: [ + // process.env.DEPLOYER_ADDRESS, + // ], timeout: 600000, }, moonbeam: { chainId: 1284, + //url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, url: "https://rpc.api.moonbeam.network", ledgerAccounts: [ - process.env.DEPLOYER_ADDRESS, // specify Ledger Address here (required) ADMIN ADDRESS + process.env.DEPLOYER_ADDRESS, ], timeout: 600000, }, meter: { chainId: 82, + //url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, url: "https://rpc.meter.io", ledgerAccounts: [ - process.env.DEPLOYER_ADDRESS, // specify Ledger Address here (required) ADMIN ADDRESS + process.env.DEPLOYER_ADDRESS, ], timeout: 600000, }, zksyncEra: { chainId: 324, + //url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, url: "https://mainnet.era.zksync.io", ledgerAccounts: [ - process.env.DEPLOYER_ADDRESS, // specify Ledger Address here (required) ADMIN ADDRESS + process.env.DEPLOYER_ADDRESS, ], timeout: 600000, }, canto: { chainId: 7700, + //url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, url: "https://canto.slingshot.finance/", ledgerAccounts: [ - process.env.DEPLOYER_ADDRESS, // specify Ledger Address here (required) ADMIN ADDRESS + process.env.DEPLOYER_ADDRESS, ], timeout: 600000, }, BNBMainnet: { chainId: 56, + //url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, url: "https://bsc-dataseed4.bnbchain.org", ledgerAccounts: [ - process.env.DEPLOYER_ADDRESS, // specify Ledger Address here (required) ADMIN ADDRESS + process.env.DEPLOYER_ADDRESS, ], timeout: 600000, }, opBNBMainnet: { chainId: 204, + //url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, url: "https://opbnb-mainnet-rpc.bnbchain.org", ledgerAccounts: [ - process.env.DEPLOYER_ADDRESS, // specify Ledger Address here (required) ADMIN ADDRESS + process.env.DEPLOYER_ADDRESS, ], timeout: 600000, }, polygonZkEvmMainnet: { chainId: 1101, url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, + // url: "https://polygon-zkevm-mainnet.public.blastapi.io ", + // ledgerAccounts: [ + // process.env.DEPLOYER_ADDRESS, + // ], timeout: 600000, gasPrice: 3000000000 }, xdcMainnet: { chainId: 50, + // url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, url: "https://erpc.xinfin.network", ledgerAccounts: [ - process.env.DEPLOYER_ADDRESS, // specify Ledger Address here (required) ADMIN ADDRESS + process.env.DEPLOYER_ADDRESS, ], timeout: 600000, }, optimism: { chainId: 10, + // url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, url: "https://mainnet.optimism.io", ledgerAccounts: [ - process.env.DEPLOYER_ADDRESS, // specify Ledger Address here (required) ADMIN ADDRESS + process.env.DEPLOYER_ADDRESS, ], timeout: 600000, }, arbitrumOne: { chainId: 42161, + // url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, url: "https://arb1.arbitrum.io/rpc", ledgerAccounts: [ - process.env.DEPLOYER_ADDRESS, // specify Ledger Address here (required) ADMIN ADDRESS + process.env.DEPLOYER_ADDRESS, ], timeout: 600000, }, base: { chainId: 8453, + // url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, url: "https://mainnet.base.org", ledgerAccounts: [ - process.env.DEPLOYER_ADDRESS, // specify Ledger Address here (required) ADMIN ADDRESS + process.env.DEPLOYER_ADDRESS, ], timeout: 600000, }, linea: { chainId: 59144, + // url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, url: "https://rpc.linea.build", ledgerAccounts: [ - process.env.DEPLOYER_ADDRESS, // specify Ledger Address here (required) ADMIN ADDRESS + process.env.DEPLOYER_ADDRESS, ], timeout: 600000, }, scroll: { chainId: 534352, + // url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, url: "https://rpc.scroll.io/", ledgerAccounts: [ - process.env.DEPLOYER_ADDRESS, // specify Ledger Address here (required) ADMIN ADDRESS + process.env.DEPLOYER_ADDRESS, ], timeout: 600000, }, blast: { chainId: 81457, + // url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, url: "https://rpc.blast.io", ledgerAccounts: [ - process.env.DEPLOYER_ADDRESS, // specify Ledger Address here (required) ADMIN ADDRESS + process.env.DEPLOYER_ADDRESS, ], timeout: 600000, }, gnosis: { chainId: 100, + // url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, url: "https://rpc.gnosischain.com", ledgerAccounts: [ - process.env.DEPLOYER_ADDRESS, // specify Ledger Address here (required) ADMIN ADDRESS + process.env.DEPLOYER_ADDRESS, ], timeout: 600000, }, avalanche: { chainId: 43114, + // url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, url: "https://avax.meowrpc.com", ledgerAccounts: [ - process.env.DEPLOYER_ADDRESS, // specify Ledger Address here (required) ADMIN ADDRESS + process.env.DEPLOYER_ADDRESS, ], timeout: 600000, }, conflux: { chainId: 1030, + // url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, url: "https://evm.confluxrpc.com", ledgerAccounts: [ - process.env.DEPLOYER_ADDRESS, // specify Ledger Address here (required) ADMIN ADDRESS + process.env.DEPLOYER_ADDRESS, ], timeout: 600000, }, fraxtal: { chainId: 252, + // url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, url: "https://rpc.frax.com", ledgerAccounts: [ - process.env.DEPLOYER_ADDRESS, // specify Ledger Address here (required) ADMIN ADDRESS + process.env.DEPLOYER_ADDRESS, ], timeout: 600000, }, mode: { chainId: 34443, + // url: "http://127.0.0.1:1248", // this is the RPC endpoint exposed by Frame, url: "https://mainnet.mode.network/", ledgerAccounts: [ - process.env.DEPLOYER_ADDRESS, // specify Ledger Address here (required) ADMIN ADDRESS + process.env.DEPLOYER_ADDRESS, ], timeout: 600000, }, diff --git a/scripts/validateResult.js b/scripts/validateResult.js new file mode 100644 index 0000000..b3ea670 --- /dev/null +++ b/scripts/validateResult.js @@ -0,0 +1,59 @@ +const { ethers } = require("hardhat"); +const abi = require("./TransparentForwarder.json"); + +async function main() { + // Replace with your contract's ABI + + // Replace with your contract's address + const contractAddress = "0xa27a80D473a688A75469cb7Ef3bBDf1d250A5003"; + const privateKey = process.env.TESTNET_DEPLOYER_KEY; + + // Replace with your _data value + const data = "0x05fbf253e685bbe2de2b28b995d65e201e51fe0a72bd99bddd87b84d98d0b30900000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000259102b37de83bdda9f38ac8254e596f0d9ac61d2035c07936675e87342817160000000000000000000000000000000000000000000000000000000000004f7a30000000000000000000000000000000000000000000000000000000066a364fb00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000001bf2c3c06061b6a7c6a576269f9263eea0584ef481c8240cad0529a241e6faa9d0000000000000000000000000000000000000000000000000000000000000041903310afa23a0069d70a5086e8ed731eebc21c99f022aa2705b71dea931341c1025089ca1d0b940f3428d07590b67b60ac70aa2523fc31b6098bfc1652c2ec4d1b00000000000000000000000000000000000000000000000000000000000000"; + // Get the provider and signer (Assuming you have a local node or network configured in Hardhat) + const provider = new ethers.providers.JsonRpcProvider("https://mainnet.skalenodes.com/v1/green-giddy-denebola"); + const wallet = new ethers.Wallet(privateKey, provider); + + // Create a contract instance + const contract = new ethers.Contract(contractAddress, abi, wallet); + + // Call the validateResult function + try { + // const response = await contract.updateAndGetResult(data, { gasLimit: 30000000 }); + // await response.wait(); + // console.log(response); + + const response = await contract.validateResult(data); + console.log("Transaction Response:", response); + console.log("Decoded Result:", response); + + // Convert BigNumber values to strings for readability + const success = response[0]; + const uintValue1 = response[1]; + const intValue = response[2]; + const uintValue2 = response[3]; + console.log("Success:", success); + console.log("Value :", Number(uintValue1)); + console.log("Power :", intValue); + console.log("Timestamp :", Number(uintValue2)); + + + // const response = await contract.getResult("0x59102b37de83bdda9f38ac8254e596f0d9ac61d2035c07936675e87342817160"); + // console.log("Transaction Response:", response); + + // // Convert BigNumber values to strings for readability + // const uintValue1 = Number(response[0]); + // const intValue = response[1]; + // const uintValue2 = Number(response[2]); + // console.log("Uint256 Value 1:", uintValue1); + // console.log("Int8:", intValue); + // console.log("Uint256 Timestamp 2:", uintValue2); + } catch (error) { + console.error("Error calling validateResult:", error); + } +} + +main().catch((error) => { + console.error(error); + process.exitCode = 1; +});