TrueFi is a decentralized protocol for uncollateralized lending. This repository contains all smart contracts used across TrueFi ecosystem. Contracts are written in Solidity. All key functionalities are tested with attached TypeScript test suite. Apart from contracts and tests repository contains scripts used for deployment and maintenance of existing infrastructure.
Repository consists of following sub-projects.
Core TrueFi smart contracts. These contracts are responsible for establishing main protocol functionalities like creating loans, rating loans, rewarding raters etc. This repository also contains contracts used for TRU liquidity mining program.
Contracts used for True Currencies - a set of fully-backed stablecoins. True Currencies feature tokens pegged to USD, AUD, HKD, GBP and CAD.
Contracts implementing TrueFi governance. Sub-project features both governor contract and all contracts implementing voting mechanisms.
Contracts and utilities allowing to use unified proxy structure across whole TrueFi ecosystem.
Contracts implementing TRU - TrueFi ecosystem governance token.
Smart contracts implementing True Gold - a synthetic gold on Ethereum blockchain.
In order to compile the contracts first clone the repository. In order to do that run
git clone [email protected]:trusttoken/smart-contracts.git
Then enter smart-contracts
directory and install all necessary dependencies by running
yarn
Important note: You need to have node
and yarn
already installed on your machine.
In order to compile the smart contracts run
yarn build
In order to run test suite, run
yarn test
Make sure to install all dependencies and compile contracts first.
In order to run linter, run
yarn lint
In order to run typescript type checks, run
yarn typecheck
All three check suites can be run at once by running
yarn checks
Before proceeding make sure you have the smart contracts compiled. If needed compile by running
yarn build
In order to run coverage, run
yarn coverage
You may also want to run coverage for specific tests.
You can do so by providing named argument --testfiles
yarn coverage --testfiles "path/to/tests"
Important note: Keep in mind that when running coverage smart contracts are additionally compiled with optimizer disabled and it may take longer for tests to complete.