truffle environment for frax solidity smart contract testing
-
required dependencies: node, npm
-
install truffle:
npm install -g truffle
-
install ganache: https://www.trufflesuite.com/docs/ganache/quickstart
-
compile contracts
- compiling contracts in ./contracts:
truffle compile
- compiling contracts in ./contracts:
-
deploy contracts onto local instance of Ethereum (Ganache)
- to run 2_deploy_contracts.js in frax-truffle/migrations:
truffle migrate
truffle migrate --reset
(this re-deploys the contracts if they're already deployed)
- to run 2_deploy_contracts.js in frax-truffle/migrations:
-
run test scripts
- to run all of the test scripts in ./test:
truffle test
- to run a specific test script:
truffle test ./specific-test-script.js
- to run all of the test scripts in ./test:
truffle uses the version of the solidity compiler as specified in ./truffle-config.js (currently set to 0.6.6).
truffle will deploy to the port specified in ./truffle-config.js (currently set to port 7545, which is also default for Ganache). if you set a different port in ganache, make sure to update this config file.
info on migrations: https://www.trufflesuite.com/docs/truffle/getting-started/running-migrations
info on how to write test scripts (in javascript): https://www.trufflesuite.com/docs/truffle/testing/writing-tests-in-javascript