Skip to content

jellydn/eth-cli

Repository files navigation

Welcome to eth-cli 👋

License: MIT Twitter: jellydn

How to test smart contract in CLI like a PRO

ITMan - Tip #25 - Command line tools for smart contract like a PRO [Vietnamese]

Install dapptools

Install Nix if you haven't already. Then install dapptools:

curl https://dapp.tools/install | sh

Install Foundry

curl -L https://foundry.paradigm.xyz | bash

Then, run foundryup in a new terminal session or after reloading your PATH.

Install Ganache

npm install ganache --global

Usage

Create .envrc file base on .envrc.example. Then, run below for checkout/update all git submodules:

make update

Run testnet

# Start ganache
make ganache
# Get all accounts, we could import with `ethsign import`
seth accounts
# Check balance
seth balance 0x6a442De9B3deB2f3bA56D8DD86529d6bBe6542B1

Deploy to testnet

make deploy

Cast

cast call $SC_COUNTER_ADDR "getCounter()(uint256)"
cast send $SC_COUNTER_ADDR "setCounter(uint256)" 1 --legacy

Seth

seth call $SC_COUNTER_ADDR "getCounter()(uint256)"
seth send $SC_COUNTER_ADDR "setCounter(uint256)" 2

Test

make test

Useful references

Author

👤 Dung Huynh

Show your support

Give a ⭐️ if this project helped you!


This README was generated with ❤️ by readme-md-generator

About

How to test smart contract in CLI like a PRO

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published