This box is meant to get developers set up with a functioning Compound (https://compound.finance) sandbox with which to build and test smart contracts on top of the protocol. It contains all of the Compound v2 smart contracts, mock ERC20 and cToken contracts, and a migration script to deploy to a local blockchain.
- Install Truffle globally
npm install -g truffle
- Download this box inside of a new project directory. This will install all project dependencies.
truffle unbox SeanJCasey/compound-sandbox
- Spin up a local blockchain. You can use Truffle's built-in
develop
command, or another tool such as Ganache UI.
truffle develop
- Compile and deploy the smart contracts. (The
migrate
command compiles them as its first step).
Using truffle develop
:
migrate
Using another blockchain:
truffle migrate
- (if not using
truffle develop
) Enter the Truffle console to interact with the deployed smart contracts:
truffle console --network development
Use Truffle's built-in syntax to make calls or send transactions.