Giter Site home page Giter Site logo

augmint / augmint-web Goto Github PK

View Code? Open in Web Editor NEW
17.0 8.0 8.0 22.57 MB

Augmint Web Frontend

Home Page: http://www.augmint.org

License: GNU Affero General Public License v3.0

JavaScript 96.84% HTML 0.32% CSS 2.72% Shell 0.12%
ethereum cryptocurrencies loan money smart-contracts solidity dapp solidity-contracts financial

augmint-web's Introduction

Augmint

Augmint - Stable Digital Tokens - Web Frontend

Build Status Greenkeeper badge Discord license

Concept

Decentralized stablecoins targeted to fiat currencies built on Ethereum.

The first Augmint token is AEUR.

1 AEUR โ‰ˆ 1 EUR.

  • Buy and sell AEUR for ETH or EUR.
  • Get a loan in AEUR by depositing ETH.
  • Lock AEUR to earn a premium.

Try it: https://www.augmint.org

Manifesto

White Paper

Related repos

Get in touch

Contribution

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.

Code of Conduct

Authors

See team on www.augmint.org

Decentlabs The project was born at DECENT Labs

Concept, initial version

Check the whole team on augmint.org

Licence

This project is licensed under the GNU Affero General Public License v3.0 license - see the LICENSE file for details.

augmint-web's People

Contributors

admrid avatar brigittaforrai avatar byossarian avatar dependabot[bot] avatar ejulcsi avatar greenkeeper[bot] avatar greenkeeperio-bot avatar gyurka00 avatar hello-brsd avatar krosza avatar phraktle avatar reyrodrigez avatar rszaloki avatar snyk-bot avatar szerintedmi avatar treerz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

augmint-web's Issues

Default fee & repayment grace period

Proposal: dailly 1 thousandth of the amount due, from the maturity day after, reason: the outstanding due and not repaid cause an inflationary push.User must have incentive to be punctual. The default fee equal with the accrued thousandth during the grace period.

display tokenUcd & exchange pending balances

similar as for user pending balances: pending ETH reserve, UCD reserve and tokenSupply balance
TBD: shall we always display pending balances instead and indicate it's not confirmed?

UCD transfer fail handling

need to throw if fails & handle on client side
maybe do it together with transaction history (ie. events need to be emitted for that)

Sell ETH from reserve for UCD

Feature to send ETH from token reserve to sell for UCD (on 1:ethUSD rate)
Any user can buy from that, UCD from sale goes to Market Reserve balance
Requires separate contract(s)

order amount

why is the number 2 here, see picture in case of both users?
order amount

introduce UCD transfer fees

deducted from every UCD transfer, minamount: param (0.01 UCD?), txFee: 0.001%
collect to separate contract
TBD:

  • UX of displaying it: we won't create a separate transaction entry , it would be too expensive. But user transactions displayed won't sum up to balance. We could calculate tx fee on client side and display it? What if txFee % changes later?
    --> fee amount added to emitted events, FE displays it
  • how to treat internal transfers?
    won't deduct, use systemTransfer for internal transfers

loan collateral computation error

Product 7 - Repay in a few seconds
Collateral (goes to escrow): put a number beginning with 3 it Will divide 3 times the amount from your eth balance e.g. 3000 collateral divide 9000

balances not refreshed with Metamask on onNewBlock recevied

User and tokenUcd balances are not refreshed with Metamask when executing tx from other browser - newblock event received but it fetches the original balances

to reproduce:

  1. open two browser windows, one using Metamask
  2. create a new loan (or transfer UCD) in the window which doesn't use Metamask
  3. balances are not refreshed (totalsupply or user's UCD balance) in the Metamask browser window despite newBlock event received and processed

When using a browser without Metamask then it works properly.

it's only on testrpc, must be tested with real chain

truffle migrate error

$ truffle migrate --reset
Compiling .\contracts\ERC20Impl.sol...
Compiling .\contracts\EthBackedLoan.sol...
Compiling .\contracts\Exchange.sol...
Compiling .\contracts\LoanManager.sol...
Compiling .\contracts\OrdersLib.sol...
Compiling .\contracts\Owned.sol...
Compiling .\contracts\Rates.sol...
Compiling .\contracts\TokenUcd.sol...

Compilation warnings encountered:

/C/Users/Iroda/desktop/ucd-poc/contracts/OrdersLib.sol:20:9: Warning: Variable i s declared as a storage pointer. Use an explicit "storage" keyword to silence th is warning.
Order[] orders;
^------------^
,/C/Users/Iroda/desktop/ucd-poc/contracts/OrdersLib.sol:36:9: Warning: Variable is declared as a storage pointer. Use an explicit "storage" keyword to silence t his warning.
OrderData order;
^-------------^

Writing artifacts to .\build\contracts

Using network 'development'.

Running migration: 1_initial_migration.js
Replacing Migrations...
... undefined
Error encountered, bailing. Network state unknown. Review successful transaction s manually.
Error: Error: Exceeds block gas limit
at StateManager.queueTransaction (C:\Users\Iroda\AppData\Roaming\nvm\v8.2.1\ node_modules\ethereumjs-testrpc\build\cli.node.js:102477:21)
at GethApiDouble.eth_sendTransaction (C:\Users\Iroda\AppData\Roaming\nvm\v8. 2.1\node_modules\ethereumjs-testrpc\build\cli.node.js:102066:14)
at GethApiDouble.handleRequest (C:\Users\Iroda\AppData\Roaming\nvm\v8.2.1\no de_modules\ethereumjs-testrpc\build\cli.node.js:101882:10)
at next (C:\Users\Iroda\AppData\Roaming\nvm\v8.2.1\node_modules\ethereumjs-t estrpc\build\cli.node.js:52856:18)
at VmSubprovider.handleRequest (C:\Users\Iroda\AppData\Roaming\nvm\v8.2.1\no de_modules\ethereumjs-testrpc\build\cli.node.js:59803:12)
at next (C:\Users\Iroda\AppData\Roaming\nvm\v8.2.1\node_modules\ethereumjs-t estrpc\build\cli.node.js:52856:18)
at GethDefaults.handleRequest (C:\Users\Iroda\AppData\Roaming\nvm\v8.2.1\nod e_modules\ethereumjs-testrpc\build\cli.node.js:101787:12)
at next (C:\Users\Iroda\AppData\Roaming\nvm\v8.2.1\node_modules\ethereumjs-t estrpc\build\cli.node.js:52856:18)
at FilterSubprovider.handleRequest (C:\Users\Iroda\AppData\Roaming\nvm\v8.2. 1\node_modules\ethereumjs-testrpc\build\cli.node.js:59362:7)
at next (C:\Users\Iroda\AppData\Roaming\nvm\v8.2.1\node_modules\ethereumjs-t estrpc\build\cli.node.js:52856:18)
at Object.InvalidResponse (C:\Users\Iroda\AppData\Roaming\nvm\v8.2.1\node_mo dules\truffle\build\cli.bundled.js:37295:16)
at C:\Users\Iroda\AppData\Roaming\nvm\v8.2.1\node_modules\truffle\build\cli. bundled.js:224765:36
at C:\Users\Iroda\AppData\Roaming\nvm\v8.2.1\node_modules\truffle\build\cli. bundled.js:66971:11
at C:\Users\Iroda\AppData\Roaming\nvm\v8.2.1\node_modules\truffle\build\cli. bundled.js:208348:9
at XMLHttpRequest.request.onreadystatechange (C:\Users\Iroda\AppData\Roaming \nvm\v8.2.1\node_modules\truffle\build\cli.bundled.js:209773:13)
at XMLHttpRequestEventTarget.dispatchEvent (C:\Users\Iroda\AppData\Roaming\n vm\v8.2.1\node_modules\truffle\build\cli.bundled.js:67130:18)
at XMLHttpRequest._setReadyState (C:\Users\Iroda\AppData\Roaming\nvm\v8.2.1\ node_modules\truffle\build\cli.bundled.js:67420:12)
at XMLHttpRequest._onHttpResponseEnd (C:\Users\Iroda\AppData\Roaming\nvm\v8. 2.1\node_modules\truffle\build\cli.bundled.js:67575:12)
at IncomingMessage. (C:\Users\Iroda\AppData\Roaming\nvm\v8.2.1\no de_modules\truffle\build\cli.bundled.js:67535:24)
at emitNone (events.js:110:20)

display ETH transfer history

user has 2 accounts, UCD and ETH, the history shows only the UCD transactions ,
we may show also the ETH history too

send back remainder ETH less default fee on collection

When loan defaults the collection should send back the remainder (if any) from the collateral (calculated on actual eth/usd rates) less default fee (parameter % of collateral, 5% to start with).

As part of this task we collect defaulting fee to augmintToken contract, separate collection to feeAccount might implemented later (when we will implement collection caller reward)

Add client side validations

  • new loan: Min loan amount & ETH balance
  • Repay loan: f sufficient UCD balance
  • Buy/Sell UCD: ETH/UCD balance
  • Buy/Sell UCD: min amounts when #31 resolved
  • ...

Get a UCD loan page

Get a UCD loan
Get an UCD loan

Page info panel:
You can get UCD for ETH collateral.
When you repay the UCD on maturity you will get back all of your ETH.
If you decide not to repay the UCD loan then your ETH will be taken to system reserves, except any excess amount. above the value of your loan and fee obligations which will be transferred to your ETH account

Discount rate info text
Disbursed UCD amount / amount due on maturity,
e.g. Loan amount is 150 UCD discount rate is 95% then
disbursed loan sum is 142,5 UCD.

Loan coverage ratio Loan/ Collateral ratio
info text:
Loan/ Collateral ratio (L/C)
UCD loan amount./USD value of ETH collateral,
e.g. loan amount is 3 000 UCD, L/C= 80%, you need to put in escrow 3 750 USD worth of ETH,
that is 18, 75 ETH if 1,0 ETH= 200 USD.

Min disbursed loan amount: Min. pay out:

Repay period: Repayment period:
info text:
...and your ETH collateral will go to the system reserves, except any excess amount. above the value of your loan and fee obligations which will be transferred to your ETH account

yarn fails

$ yarn start
yarn start v0.27.5
$ node node_modules/cross-env/dist/bin/cross-env.js NODE_PATH=./src react-script s start
module.js:487
throw err;
^

Error: Cannot find module 'webpack/lib/node/NodeTemplatePlugin'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object. (C:\Users\Iroda\Desktop\ucd-poc\node_modules\html-webp ack-plugin\lib\compiler.js:11:26)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object. (C:\Users\Iroda\Desktop\ucd-poc\node_modules\html-webp ack-plugin\index.js:7:21)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
error Command failed with exit code 1.

display pending transactions

TBD: shall we give user confirmation on form and have a global component (eg. in EthereumState.js) with list of pending txs + confirmation numbers

Token UCD page

for intervention management,
needed info on the state of the UCD monetary balances

new data to this page:

  1. **Open loan obligations: **
    it is the sum of the Open loans amounts
    2 . ** User token balance: **
    it is the sum of all users UCD accounts or Total token supply -UCD Reserve
  2. Hot/cold (+/-)token
    equals: User token balance - Open loan obligations

Example:
Total token supply: 2829900 UCD
UCD Reserve: 142474 UCD

User token balance: 2687426 UCD

Loans
Loan amount: 2808000 UCD
Loan amount: 7000 UCD
Loan amount: 500 UCD
Loan amount: 5000 UCD
Open loan obligations: 2820500 UCD

User token balance - Open loan obligations=
Hot/cold (+/-)token -133074 UCD

UX tip: UCD and ETH amounts here in a separate column

refactor balance refresh

we refresh user and tokenUcd balances onNewBlock
that's not ideal:

  1. transaction is pending right after submission so only pending balances are updated
  2. too many unnecessary refreshes on test networks

check onNewBlock if it's a block relevant to user/tokenUcd/exchange and/or do refresh on relevant log events

error when trying to repay last loan with Metamask

trying to repay last loan, got error but only with Metamask

"Repay loan failed. Error: Error: Error: [ethjs-rpc] rpc error with payload {"id":6483394661779,"jsonrpc":"2.0","params":[{"from":"0xd912aecb07e9f4e1ea8e6b4779e7fb6aa1c3e4d8","to":"0x066a1db4199b08d3b05e59523214ed1959636b81","value":"0x0","data":"0x371fd8e60000000000000000000000000000000000000000000000000000000000000004","gas":"0x2dc6c0","gasPrice":"0x4a817c800"}],"method":"eth_estimateGas"} Error: Error: VM Exception while executing eth_estimateGas: invalid opcode\n at /usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:59880:17\n at /usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:88044:5\n at /usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:11863:9\n at /usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:8423:16\n at replenish (/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:8943:25)\n at iterateeCallback (/usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:8933:17)\n at /usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:8908:16\n at /usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:11860:13\n at /usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:88040:9\n at /usr/local/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:73948:7\n at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:43905:26\n at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:64306:9\n at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:10069:16\n at iterateeCallback (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:9934:17)\n at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:10085:16\n at next (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:72912:9)\n at resultObj.id (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:64286:9)\n at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:10160:16\n at replenish (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:9954:17)\n at iterateeCallback (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/background.js:9939:17)"

Collision bug?

started UCD client opened in mozzilla
loans, and orders
then started another account from metamask/Chrome
opposite order placed , executed wanted to see transaction history of the other account in mozzilla then came these error messages in both browser
collision bug
what to do?

Get ucd loan - exact amount

Loan amount (to be payed back)
you give an exact amount of 500, get back az a loan 499,9999 UCD loan
in case of instant/short maturities

tidy up new loan success page

eg. link to my account + link to loan details
maybe use standard loan details component (handle that new loan might not be loaded yet)

deploy to testnet

test deployment to Ropsten and/or Rinkeby and test app
create/update scripts for deployment

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.