How to test smart contract in CLI like a PRO
Install Nix if you haven't already. Then install dapptools:
curl https://dapp.tools/install | sh
curl -L https://foundry.paradigm.xyz | bash
Then, run foundryup in a new terminal session or after reloading your PATH.
npm install ganache --global
Create .envrc file base on .envrc.example. Then, run below for checkout/update all git submodules:
make update
# Start ganache
make ganache
# Get all accounts, we could import with `ethsign import`
seth accounts
# Check balance
seth balance 0x6a442De9B3deB2f3bA56D8DD86529d6bBe6542B1
make deploy
cast call $SC_COUNTER_ADDR "getCounter()(uint256)"
cast send $SC_COUNTER_ADDR "setCounter(uint256)" 1 --legacy
seth call $SC_COUNTER_ADDR "getCounter()(uint256)"
seth send $SC_COUNTER_ADDR "setCounter(uint256)" 2
make test
👤 Dung Huynh
- Website: https://productsway.com/
- Twitter: @jellydn
- Github: @jellydn
Give a ⭐️ if this project helped you!
This README was generated with ❤️ by readme-md-generator