Awesome
💰 TrueFi Smart Contracts
🗂 Table of Contents
💡 Intro
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.
📎 Projects
Repository consists of following sub-projects.
TrueFi
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.
True Currencies
Contracts used for True Currencies - a set of fully-backed stablecoins. True Currencies feature tokens pegged to USD, AUD, HKD, GBP and CAD.
Governance
Contracts implementing TrueFi governance. Sub-project features both governor contract and all contracts implementing voting mechanisms.
Proxy
Contracts and utilities allowing to use unified proxy structure across whole TrueFi ecosystem.
Trust Token
Contracts implementing TRU - TrueFi ecosystem governance token.
True Gold
Smart contracts implementing True Gold - a synthetic gold on Ethereum blockchain.
🧰 Installation
In order to compile the contracts first clone the repository. In order to do that run
git clone git@github.com: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
✅ Testing
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
🛡 Coverage
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.