A crowdsourced bank credit system based on Ethereum
The dApp is divided into 3 contracts:
TrstToken
is the contract that handles token transactionVault
is the contract that handles lending logicStaking
is the contract that handles voting logic
- TrstToken
- State getters
balance(address)
price()
totalSupply()
redeem(amount)
- State getters
- Vault
- State getters
stakable()
ghetto methodloanStatus(address)
proposedLoan(address)
term(address)
lentTimestamp(address)
interestRateNum()
,interestRateDenom()
latenessMultiplierNum()
,latenessMultiplierDenom()
proposeLoan(amount, term)
cancelProposal()
returnLoan()
- State getters
- Staking
- State getters
upperThreshold()
lowerThreshold()
rewardRateNum()
,rewardRateDenom()
punishmentRate()
,punishmentRateDenom()
stake(candidate, staker)
totalStake(candidate)
stakers(candidate)
setStake(candidate, amount)
cancelStake(candidate)
- State getters
npm install
oryarn install
- Start the Ethereum dev node and leave it running. Either,
- If you don't have Ganache installed, open a new terminal and
yarn start
- If you have it installed, start Ganache and add
truffle-config.js
to its project setting
- If you don't have Ganache installed, open a new terminal and
yarn build
oryarn ganache-build
, depending if you use Ganache or not
yarn test
TBA