Deploy Contract
Use Arbitrum Sepolia testnet
https://dashboard.alchemy.com/apps/j3k2fv9o3o9wje2x/setup
拿 Node RPC API
Setting ALCHEMY API
npx hardhat vars set “varible name”
1 | npx hardhat vars set ALCHEMY_API_KEY |
Create Arbitrum Sepolia account
use private key
1 | npx hardhat vars set ARBITRUM_SEPOLIA_PRIVATE_KEY |
Setting network
在hardhat.config.js的module.exports設定網路
1 | networks: { |
Create scripts dictionary
1 | mkdir scripts |
Create deploy.js
1 | touch deploy.js |
1 | const { ethers } = require("hardhat"); |
Use commad
1 | npx hardhat run-- network arbitrumSepolia scripts/deploy.js |
terminal will show the contract address
1 | 0xe8f6dab9045c9ce68d37ea95e416d54e7e5678ef |
you can search the address on the arbiscan.io
https://sepolia.arbiscan.io/address/0xe8f6dab9045c9ce68d37ea95e416d54e7e5678ef