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 | shcurl -L https://foundry.paradigm.xyz | bashThen, run foundryup in a new terminal session or after reloading your PATH.
npm install ganache --globalCreate .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 0x6a442De9B3deB2f3bA56D8DD86529d6bBe6542B1make deploycast call $SC_COUNTER_ADDR "getCounter()(uint256)"
cast send $SC_COUNTER_ADDR "setCounter(uint256)" 1 --legacyseth call $SC_COUNTER_ADDR "getCounter()(uint256)"
seth send $SC_COUNTER_ADDR "setCounter(uint256)" 2make 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
![ITMan - Tip #25 - Command line tools for smart contract like a PRO [Vietnamese]](https://i.ytimg.com/vi/eGJMubePnws/hqdefault.jpg)