Cytonic Ethereum
Last updated
module.exports = {
networks: {
cytonicTestnet: {
url: "https://rpc.evm.testnet.cytonic.com",
chainId: 52226,
accounts: [process.env.PRIVATE_KEY]
}
}
};[rpc_endpoints]
cytonicTestnet = "https://rpc.evm.testnet.cytonic.com"
[profile.default]
chain_id = 52226// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract SimpleStorage {
uint256 public value;
function setValue(uint256 _value) external {
value = _value;
}
}async function main() {
const Contract = await ethers.getContractFactory("SimpleStorage");
const contract = await Contract.deploy();
await contract.deployed();
console.log("Deployed to:", contract.address);
}
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});npx hardhat run scripts/deploy.js --network cytonicTestnetconst provider = new ethers.providers.JsonRpcProvider(
"https://rpc.evm.testnet.cytonic.com"
);
const contract = new ethers.Contract(
"0xYourContractAddress",
["function value() view returns (uint256)", "function setValue(uint256)"],
provider
);
// Read value
const value = await contract.value();
console.log("Value:", value.toString());