Hardhat
Last updated
mkdir contracts && cd contractstouch your_contract.soltouch secrets.json{ "privateKey": "YOUR-PRIVATE-KEY-HERE"}require('@nomiclabs/hardhat-ethers');const { privateKey } = require('./secrets.json'); module.exports = {solidity: "0.8.1",defaultNetwork: "rinkeby",networks: { rinkeby: { url: "https://eth-rinkeby.alchemyapi.io/v2/123abc123abc123abc123abc123abcde", accounts: [privateKey] }, sanko: { url: "https://sanko-arb-sepolia.rpc.caldera.xyz/http", // RPC URL Here chainId: 1992 , // ChainID Here }},}npx hardhat compilejsmkdir scripts && cd scriptstouch deploy.jsasync function main() {// 1. Get the contract to deployconst Your_Contract = await ethers.getContractFactory('your_contract');console.log('Deploying Your_Contract...'); // 2. Instantiating a new smart contractconst your_contract = await Your_Contract.deploy(); // 3. Waiting for the deployment to resolveawait your_contract.deployed(); // 4. Use the contract instance to get the contract addressconsole.log('Your_Contract deployed to:', your_contract.address);} main().then(() => process.exit(0)).catch((error) => { console.error(error); process.exit(1);});npx hardhat run scripts/deploy.js --network sanko