A simpler way of coding solidity.
Use this for fast prototyping and a clean project
Ensure pre-requisites:
- Linux/MacOS
- Python 3.8.5+
- solc 0.8.0+ [Instructions]
- ganache. To install:
npm install ganache-cli --global
Recommended Setup:
- Fish Shell
- VirtualFish (venv manager)
- StarShip Cross Shell Prompt
Now, open a new terminal and:
#clone repo
git clone https://github.com/officialnico/brownie-template-lite.git
cd brownie-template-lite
#create a virtual environment
python -m venv venv
#activate env
source venv/bin/activate
#install dependencies
pip install -r requirements.txt
#install openzeppelin library, to import from .sol (ignore FileExistsErrors)
brownie pm install OpenZeppelin/[email protected]
In terminal:
#run one test
brownie test tests/test_Simpletoken.py::test_transfer
#run tests for one module
brownie test tests/test_Simpletoken.py
#run all tests
pytest
From terminal:
brownie console
In brownie console:
>>> t = Simpletoken.deploy("TEST", "Test Token", 18, 100, {'from': accounts[0]})
Transaction sent: 0x3f113379b70d00041068b27733c37c2977354d8c70cb0b30b0af3087fca9c2b8
Gas price: 0.0 gwei Gas limit: 6721975 Nonce: 0
Simpletoken.constructor confirmed Block: 1 Gas used: 551616 (8.21%)
Simpletoken deployed at: 0x3194cBDC3dbcd3E11a07892e7bA5c3394048Cc87
>>> t.symbol()
'TEST'
inspired and derived from vw-cli by trentmc & Ocean Protocol