helderjnpinto / publicmint-web3-scripts

Scripts using only web3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

publicmint-web3-scripts

Scripts using only web3 and hardhat for deployment and testing purposes

setup

npm install

configure .env.example to .env setting private key 'PK' and from address 'ADDR'

Get USD balances

  • Native balance node ./src/getBalance.js

  • ERC20 USD balance node ./src/getBalanceERC20.js

Native transfer

node ./src/transfer.js

Public mint intrinsic gas

The minimum amount of gas in normal ethereum network is 21000 in public mint is 25000 If you use metamask you need to change default values. e

Compile

Executing npm scripts:

  • yarn compile

Or directly hardhat:

npx hardhat compile

Test

Executing npm scripts:

  • yarn test:hd

Or directly hardhat:

npx hardhat test --network hardhat

Deploy

Using hardhat node:

  • yarn deploy:hd

Using testNet:

  • yarn deploy:testNet

Or directly hardhat:

  • npx hardhat run --network testNet ./scripts/1_migration.js

! Note: for mainNet configure manually hardhat-config variable networkToLoad to mainNet

About

Scripts using only web3

License:MIT License


Languages

Language:JavaScript 91.6%Language:Solidity 8.2%Language:Shell 0.2%