SimpleBank is a Truffle project that contains a starter contract, migration and Truffle JavaScript test files. In this exercise you are going to implement the SimpleBank.sol contract.
contracts/SimpleBank.sol
: the partial implementation of a Solidity Contract you will complete.test/simpleBank.test.js
: the Truffle test file that describes the behavior of a correct SimpleBank contract.
- Latest truffle version.
npm -g uninstall truffle && npm -g install truffle
- Your preferred code editor.
- Familiarity with terminals.
Follow the comments outlined in SimpleBank.sol to implement its functionality. The test are there to determine correct contract behavior as well as guide you through the implementation.
The general workflow is to use Test Drive Development's red green process:
- Enable a test in
simpleBank.test.js
. This means changingit.skip
, toit
in the test declaration. - Run
truffle test
from a terminal. - Use the failed test output along with the hints in
contracts/SimpleBank.sol
to make the test pass.
Check out the testing files to see how tests are implemented in JavaScript. We will go over the details of implementing tests later in the curriculum. Of course, if you have questions, do reach out in Discord, or schedule an Office Hour session with one of our mentors.