This repository provides practical example to deploy Smart Contracts in different public EVM networks, following different approaches:
Node JS installed: https://nodejs.org/
DESIRED_NETWORK variable can be:
- ethereum_goerli_testnet
- polygon_mumbai_testnet
- binance_bsc_testnet
These networks are specified in networks section in both files (you can add new ones):
- Truffle/truffle-config.js
- Hardhat/hardhat.config.ts
If you have problems with RPC URLs (they change from time to time) check last ones here: https://rpc.info/
- Network: Ethereum Goerli
- New RPC URL: https://sepolia.infura.io/v3/
- Chain ID: 11155111
- Currency symbol: SepoliaETH
- Block explorer: https://sepolia.etherscan.io/
- Faucet: https://sepoliafaucet.com/
- Network: Polygon Mumbai
- New RPC URL: https://rpc-mumbai.maticvigil.com/
- Chain ID: 80001
- Currency symbol: MATIC
- Block explorer: https://mumbai.polygonscan.com/
- Faucet: https://faucet.polygon.technology/
More info here: https://wiki.polygon.technology/docs/develop/metamask/config-polygon-on-metamask/
- Network: Smart Chain - Testnet
- New RPC URL: https://data-seed-prebsc-1-s1.binance.org:8545/
- Chain ID: 97
- Currency symbol: BNB
- Block explorer: https://testnet.bscscan.com
- Faucet: https://testnet.bnbchain.org/faucet-smart
More info here: https://academy.binance.com/en/articles/connecting-metamask-to-binance-smart-chain
- Network: Ethereum Goerli
- New RPC URL: https://goerli.infura.io/v3/
- Chain ID: 5
- Currency symbol: GoerliETH
- Block explorer: https://goerli.etherscan.io/
- Faucet: https://goerlifaucet.com/
npm install -g truffle
cd Truffle
npm i
truffle compile
truffle migrate --network DESIRED_NETWORK
truffle run verify DEPLOYED_CONTRACT_NAME@DEPLOYED_CONTRACT_ADDRESS --network DESIRED_NETWORK
truffle compile
truffle migrate --network ethereum_goerli_testnet
truffle run verify Notarization@0x... --network ethereum_goerli_testnet
cd Hardhat
npm install
npx hardhat clean
npx hardhat compile
npx hardhat run ./scripts/deploy.ts --network DESIRED_NETWORK
npx hardhat verify --network DESIRED_NETWORK DEPLOYED_CONTRACT_ADDRESS
npx hardhat run ./scripts/deploy.ts --network ethereum_goerli_testnet
npx hardhat verify --network ethereum_goerli_testnet 0x...
You have to select your preffered network form Metamask.
Just click on the "Deploy" button when your Smart Contract is ready.
You have to confirm the transaction of the Smart Contract deployment.
You will see an overview of the public/external functions of your already deployed Smart Contract.
You can directly execute your Smart Contract functions from the Remix web IDE for test purposes.