Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ The above script will perform following operation:
| TransparentForwarder | 0xb28AE76CA80a461c633624F9764f37235800F533 |
| Staking | 0x7F56e39f6629e5D5E281fB9F65BdC7121F2F6E69 |

### Calypso hub (hardhat)
<!-- ### Calypso hub (hardhat)

| Contract | Address |
| -------------------- | ------------------------------------------ |
Expand All @@ -168,7 +168,7 @@ The above script will perform following operation:
| ResultManager | 0xBd4642B6E698cE2A6DFD7bd69FDF5Af968bE05d9 |
| Forwarder | 0x951350581E842F85800cC8dA0b96192a71DfEc0d |
| TransparentForwarder | 0xD910E832ead086314409D56ECD3D2dB1256CfF58 |
| Staking | 0xb28AE76CA80a461c633624F9764f37235800F533 |
| Staking | 0xb28AE76CA80a461c633624F9764f37235800F533 | -->

## Testnet
### Calypso Testnet
Expand Down
6 changes: 0 additions & 6 deletions deployments/calypsoMainnet.json

This file was deleted.

6 changes: 0 additions & 6 deletions deployments/nebulaMainnet.json

This file was deleted.

95 changes: 63 additions & 32 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
70 changes: 70 additions & 0 deletions scripts/validateResult.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
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 = "0xD910E832ead086314409D56ECD3D2dB1256CfF58";
const privateKey = process.env.TESTNET_DEPLOYER_KEY;

// Replace with your _data value
const data = "0xcdf9ab9f5bb7631f812b6ba5f8bbe1053589060a13aae11c802e00553c4c565400000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000259102b37de83bdda9f38ac8254e596f0d9ac61d2035c07936675e873428171600000000000000000000000000000000000000000000000000000000000052417000000000000000000000000000000000000000000000000000000006679304d00000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000001121342e1ee18563ecb29b769cdc592567969113c02408c2ab64172331f39299e0000000000000000000000000000000000000000000000000000000000000041a62420b72d2473f1e35a5cbaf4a598148b5c75094bee3b7e748657a2911c13e22f2d2641f44533d252d199dd92d59da976eeeec538db0ce8db7f322451baf7761c00000000000000000000000000000000000000000000000000000000000000";
// 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, { gasLimit: 30000000 });
// console.log("Transaction Response:", response);
// const result = ethers.utils.defaultAbiCoder.decode(
// ["bool","uint256", "int8", "uint256"],
// response.data
// );
// console.log(result);
// console.log("Decoded Result:", result);

// // Convert BigNumber values to strings for readability
// const success = result[0];
// const uintValue1 = Number(result[1]);
// const intValue = result[2];
// const uintValue2 = Number(result[3]);
// console.log("Success:", success);
// console.log("Uint256 Value 1:", uintValue1);
// console.log("Int8 Value:", intValue);
// console.log("Uint256 Value 2:", uintValue2);


// const response = await contract.getResult("0x59102b37de83bdda9f38ac8254e596f0d9ac61d2035c07936675e87342817160");
// console.log("Transaction Response:", response);
// const result = ethers.utils.defaultAbiCoder.decode(
// ["uint256", "int8", "uint256"],
// response.data
// );
// console.log(result);
// console.log("Decoded Result:", result);

// // Convert BigNumber values to strings for readability
// const uintValue1 = Number(result[0]);
// const intValue = result[1];
// const uintValue2 = Number(result[2]);
// console.log("Uint256 Value 1:", uintValue1);
// console.log("Int8 Value:", intValue);
// console.log("Uint256 Value 2:", uintValue2);
} catch (error) {
console.error("Error calling validateResult:", error);
}
}

main().catch((error) => {
console.error(error);
process.exitCode = 1;
});