An example of a simple contract is shown in the section. This is a simple contract in solidity, which performs only addition. We will see how migrations and tests can be created for this contract.
Follow the steps outline:
- Create a directory named simplecontract:
$ mkdir simplecontract
- Change directory to simplecontract:
$ cd simplecontract
- Initialize Truffle to create a skeleton structure for smart contract development:
$ truffle init truffle init Downloading... Unpacking... Setting up... Unbox successful. Sweet! Commands: Compile: truffle compile Migrate: truffle migrate Test contracts: truffle test
The tree structure produced by the init command is as follows:
├── contracts │ └── Migrations.sol ├── migrations ...