-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #226 from Augmint/staging
release v1.0.12
- Loading branch information
Showing
9 changed files
with
203 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,116 +13,113 @@ Decentralised stable cryptocurrency on Ethereum | |
|
||
## Concept | ||
|
||
Augmint provides digital tokens, value of each token pegged to a fiat currency. | ||
Decentralized stablecoins targeted to fiat currencies built on Ethereum. | ||
|
||
The first Augmint token will be A-EUR (Augmint Euro), pegged to EUR. | ||
The first Augmint token is AEUR. | ||
|
||
The value of 1 A-EUR is always closely around 1 EUR. | ||
**1 AEUR ≈ 1 EUR.** | ||
|
||
Augmint tokens are cryptocurrency tokens with all the benefits of cryptocurrencies: stored securely in a decentralised manner and instantly transferable worldwide. | ||
- Buy and sell AEUR for ETH or EUR. | ||
- Get a loan in AEUR by depositing ETH. | ||
- Lock AEUR to earn a premium. | ||
|
||
Read more and try it: **[www.augmint.cc](http://www.augmint.cc)** | ||
Try it: **[https://www.augmint.org](http://www.augmint.org)** | ||
|
||
**[Our Trello board](https://trello.com/b/RYGAt2so/augmint-documents)** with a collection of documents about the project. | ||
**[Manifesto](https://www.augmint.org/manifesto)** | ||
|
||
**[White paper draft](http://bit.ly/augmint-wp)** - Work in progress. Please feel free to comment it: questions, ideas, suggestions are welcome. | ||
**[White Paper](http://bit.ly/augmint-wp)** | ||
|
||
## Components | ||
### Related repos | ||
|
||
[Web frontend repo](https://github.com/Augmint/augmint-web) | ||
- [Web frontend](https://github.com/Augmint/augmint-web) | ||
- [@augmint/js library](https://github.com/Augmint/augmint-js) | ||
|
||
## Flows | ||
## Flow diagrams | ||
|
||
[Contract dependency graph](docs/contractDependencies.png) | ||
- [Loan flow](docs/loanFlow.png) | ||
- [Lock flow](docs/lockFlow.png) | ||
- [Exchange flow](docs/exchangeFlow.png) | ||
- [Flow of funds](https://docs.google.com/document/d/1IQwGEsImpAv2Nlz5IgU_iCJkEqlM2VUHf5SFkcvb80A/#heading=h.jsbfubuh6okn) | ||
|
||
Sequence diagrams: | ||
## Solidity Contracts | ||
|
||
* [Loan flow](docs/loanFlow.png) | ||
* [Lock flow](docs/lockFlow.png) | ||
* [Exchange flow](docs/exchangeFlow.png) | ||
* [Reserve Sales flow](docs/reserveSalesFlow.png) _(not implemented yet)_ | ||
### Dependencies | ||
|
||
[Flow of funds](https://docs.google.com/document/d/1IQwGEsImpAv2Nlz5IgU_iCJkEqlM2VUHf5SFkcvb80A/#heading=h.jsbfubuh6okn) | ||
[![Contract dependency graph](docs/contractDependencies.png)](docs/contractDependencies.png) | ||
|
||
## Solidity Contracts | ||
### List of contracts | ||
|
||
* [Restricted.sol](./contracts/generic/Restricted.sol) | ||
- [Restricted.sol](./contracts/generic/Restricted.sol) | ||
Stores permissions per address | ||
* [MultiSig.sol](./contracts/generic/MultiSig.sol) | ||
- [MultiSig.sol](./contracts/generic/MultiSig.sol) | ||
Abstract contract to manage multi signature approval and execution of atomic, one-off contract scripts | ||
* [StabilityBoardProxy.sol](./contracts/generic/StabilityBoardProxy.sol) | ||
- [StabilityBoardProxy.sol](./contracts/generic/StabilityBoardProxy.sol) | ||
Augmint parameters can be set only via this contract with a quorum approving a contract script to run. | ||
* [ERC20.sol](./contracts/generic/ERC20.sol) | ||
- [ERC20.sol](./contracts/generic/ERC20.sol) | ||
Standard [ERC20](https://theethereum.wiki/w/index.php/ERC20_Token_Standard) token interface. | ||
* [SystemAccount.sol](./contracts/generic/ERC20.sol) | ||
- [SystemAccount.sol](./contracts/generic/ERC20.sol) | ||
Abstract contract to maintain balances of Augmint system accounts | ||
* [AugmintReserves](./contracts/AugmintReserves.sol) | ||
* Holds Augmint's ETH and token reserves | ||
* [InterestEarnedAccount](./contracts/InterestEarnedAccount.sol) | ||
* Holds interest earning from token lending - only from repaid loans, i.e. already "earned" | ||
* Provides interest for Locks | ||
* [FeeAccount.sol](./contracts/FeeAccount.sol) | ||
* holds all fees: tokens from transfer and exchange fees (to be implemented) + ETH fees from defaulting fees | ||
* calculates transferFees | ||
* [AugmintToken.sol](./contracts/generic/AugmintToken.sol) | ||
- [AugmintReserves](./contracts/AugmintReserves.sol) | ||
- Holds Augmint's ETH and token reserves | ||
- [InterestEarnedAccount](./contracts/InterestEarnedAccount.sol) | ||
- Holds interest earning from token lending - only from repaid loans, i.e. already "earned" | ||
- Provides interest for Locks | ||
- [FeeAccount.sol](./contracts/FeeAccount.sol) | ||
- holds all fees: tokens from transfer and exchange fees (to be implemented) + ETH fees from defaulting fees | ||
- calculates transferFees | ||
- [AugmintToken.sol](./contracts/generic/AugmintToken.sol) | ||
Base contract for all Augmint tokens, [TokenAEur.sol](./contracts/TokenAEur.sol) being the first implementation. | ||
* ERC20 standard functions | ||
* maintains account token balances | ||
* Generic `transferAndNotify` "convenience" function | ||
* allows MonetarySupervisor to issue tokens on loan disbursement and for reserve | ||
* allows accounts to burn their tokens (used by repay loan and burn from reserves via MonetarySupervisor contract) | ||
* [MonetarySupervisor.sol](./contracts/MonetarySupervisor.sol) | ||
* maintains system wide KPIs (totalLockAmount, totalLoanAmount) | ||
* enforces system wide limits (Loan to Deposit ratio limits) | ||
* issue to & from reserve functions | ||
* [TokenAEur.sol](./contracts/TokenAEur.sol) | ||
* First AugmintToken contract instance, pegged for pegged to EUR (A-EUR aka Augmint Euro aka A€ ) | ||
* Sets standard token parameters (name, symbol, decimals, peggedSymbol etc.) | ||
* [Rates.sol](./contracts/Rates.sol) | ||
- ERC20 standard functions | ||
- maintains account token balances | ||
- Generic `transferAndNotify` "convenience" function | ||
- allows MonetarySupervisor to issue tokens on loan disbursement and for reserve | ||
- allows accounts to burn their tokens (used by repay loan and burn from reserves via MonetarySupervisor contract) | ||
- [MonetarySupervisor.sol](./contracts/MonetarySupervisor.sol) | ||
- maintains system wide KPIs (totalLockAmount, totalLoanAmount) | ||
- enforces system wide limits (Loan to Deposit ratio limits) | ||
- issue to & from reserve functions | ||
- [TokenAEur.sol](./contracts/TokenAEur.sol) | ||
- First AugmintToken contract instance, pegged for pegged to EUR (A-EUR aka Augmint Euro aka A€ ) | ||
- Sets standard token parameters (name, symbol, decimals, peggedSymbol etc.) | ||
- [Rates.sol](./contracts/Rates.sol) | ||
A contract to return fiat/ETH exchange rates. | ||
* [Exchange.sol](./contracts/Exchange.sol) | ||
- [Exchange.sol](./contracts/Exchange.sol) | ||
EUR / ETH exchange contract. Sell or buy A-EUR for ETH | ||
* [LoanManager.sol](./contracts/LoanManager.sol) | ||
* Loan products and their parameters | ||
* Maintains all loans via new loan, repayment, collection functions | ||
* Holds collateral in escrow | ||
* [Locker.sol](./contracts/Lock.sol) | ||
* Lock products and parameters | ||
* Token funds locking and releasing | ||
* Holds locked tokens (with interest) | ||
- [LoanManager.sol](./contracts/LoanManager.sol) | ||
- Loan products and their parameters | ||
- Maintains all loans via new loan, repayment, collection functions | ||
- Holds collateral in escrow | ||
- [Locker.sol](./contracts/Lock.sol) | ||
- Lock products and parameters | ||
- Token funds locking and releasing | ||
- Holds locked tokens (with interest) | ||
|
||
## Contribution | ||
## Contributions | ||
|
||
Augmint is an open and transparent project. | ||
|
||
We are seeking for great minds to extend our core team. Contribution in any area is much appreciated: development, testing, UX&UI design, legal, marketing spreading the word etc. | ||
We are looking for great minds to extend our core team. Contributions in any area is much appreciated: development, testing, UX&UI design, legal, marketing, spreading the word etc. | ||
|
||
**[Development environment setup](docs/developmentEnvironment.md)** | ||
[Code of Conduct](CODE_OF_CONDUCT.md) | ||
|
||
## Publish NPM package | ||
|
||
When the abiniser directory changed: | ||
- bump the version property in the package.json | ||
- `npm publish --access public` | ||
## [Development environment setup](docs/developmentEnvironment.md) | ||
|
||
## Get in touch | ||
|
||
Drop us an email: hello@augmint.cc | ||
or | ||
say hi on our [Discord server](https://discord.gg/PwDmsnu): [![Discord](https://img.shields.io/discord/407574313810788364.svg)](https://discord.gg/PwDmsnu) | ||
- [[email protected]](mailto:hello@augmint.org) | ||
- [Discord server](https://discord.gg/PwDmsnu) [![Discord](https://img.shields.io/discord/407574313810788364.svg)](https://discord.gg/PwDmsnu) | ||
- [Telegram](https://t.me/augmint) | ||
|
||
## Authors | ||
|
||
![DECENT](http://www.decent.org/images/logo-voronoi_120x33.png) | ||
See team on [www.augmint.org](https://www.augmint.org) | ||
|
||
The project was born at [DECENT Labs](http://www.decent.org) | ||
<img src="https://github.com/Augmint/augmint-web/raw/staging/src/assets/images/decentlabs.png" alt="Decentlabs" width="60" height="60"> The project was born at [DECENT Labs](http://www.decent.org) | ||
|
||
### Concept, initial version | ||
|
||
* [szerintedmi](https://github.com/szerintedmi) | ||
* [Charlie](https://github.com/krosza) | ||
|
||
Check the whole team on [augmint.cc](http://www.augmint.cc) | ||
- [szerintedmi](https://github.com/szerintedmi) | ||
- [Charlie](https://github.com/krosza) | ||
|
||
## Licence | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
contracts/SB_scripts/mainnet/Main0025_recreateLoanProducts.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* Recreate loan products on mainnet (fix for discountRate rounding error) */ | ||
|
||
pragma solidity 0.4.24; | ||
|
||
import "../../StabilityBoardProxy.sol"; | ||
import "../../LoanManager.sol"; | ||
|
||
contract Main0025_recreateLoanProducts { | ||
|
||
StabilityBoardProxy public constant STABILITY_BOARD_PROXY = StabilityBoardProxy(0xde36a8773531406dCBefFdfd3C7b89fCed7A9F84); | ||
LoanManager public constant LOAN_MANAGER = LoanManager(0x1cABc34618ecf2949F0405A86353e7705E01C38b); | ||
|
||
function execute(Main0025_recreateLoanProducts /* self, not used */) external { | ||
// called via StabilityBoardProxy | ||
require(address(this) == address(STABILITY_BOARD_PROXY), "only execute via StabilityBoardProxy"); | ||
|
||
|
||
/****************************************************************************** | ||
* Disable current loan products | ||
******************************************************************************/ | ||
|
||
LOAN_MANAGER.setLoanProductActiveState(1, false); | ||
LOAN_MANAGER.setLoanProductActiveState(2, false); | ||
LOAN_MANAGER.setLoanProductActiveState(3, false); | ||
LOAN_MANAGER.setLoanProductActiveState(4, false); | ||
LOAN_MANAGER.setLoanProductActiveState(5, false); | ||
|
||
|
||
/****************************************************************************** | ||
* Add new loan products | ||
******************************************************************************/ | ||
|
||
// Formulas used for conversion: | ||
|
||
// IRPA: Interest Rate Per Annum : the percentage value on the UI | ||
// LPDR: Loan Product Discount Rate : uint32 discountRate constructor parameter | ||
|
||
// IRPA = (1_000_000 / LPDR - 1) * (365 / termInDays) | ||
// LPDR = 1_000_000 / (IRPA * termInDays / 365 + 1) | ||
|
||
// discountRates: | ||
// [180, 90, 30, 14, 7].map(termInDays => Math.ceil(1000000 / (0.049 * termInDays / 365 + 1))) | ||
// [976406, 988063, 995989, 998125, 999062] | ||
|
||
// addLoanProduct: | ||
// term, discountRate, collateralRatio, minDisbursedAmount, defaultingFeePt, isActive | ||
|
||
LOAN_MANAGER.addLoanProduct(180 days, 976406, 600000, 800, 100000, true); // 4.9% p.a. | ||
LOAN_MANAGER.addLoanProduct(90 days, 988063, 600000, 800, 100000, true); // 4.9% p.a. | ||
LOAN_MANAGER.addLoanProduct(30 days, 995989, 600000, 800, 100000, true); // 4.9% p.a. | ||
LOAN_MANAGER.addLoanProduct(14 days, 998125, 600000, 800, 100000, true); // 4.9% p.a. | ||
LOAN_MANAGER.addLoanProduct(7 days, 999062, 600000, 800, 100000, true); // 4.9% p.a. | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
mainnet_migrations/37_deploy_Main0025_recreateLoanProducts.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const Main0025_recreateLoanProducts = artifacts.require("./Main0025_recreateLoanProducts.sol"); | ||
|
||
module.exports = function(deployer) { | ||
deployer.then(async () => { | ||
await deployer.deploy(Main0025_recreateLoanProducts); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@augmint/contracts", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"description": "Augmint Stable Tokens - Solidity contract's abi and deployment descriptors", | ||
"author": "“Augmint”", | ||
"homepage": "https://github.com/Augmint/augmint-contracts#readme", | ||
|
@@ -59,7 +59,7 @@ | |
"solidity-coverage": "0.5.11", | ||
"stringifier": "2.0.0", | ||
"truffle": "4.1.14", | ||
"truffle-hdwallet-provider": "1.0.8", | ||
"truffle-hdwallet-provider": "1.0.9", | ||
"wait-on": "3.2.0", | ||
"web3v1": "npm:[email protected]" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.