augmint / augmint-web Goto Github PK
View Code? Open in Web Editor NEWAugmint Web Frontend
Home Page: http://www.augmint.org
License: GNU Affero General Public License v3.0
Augmint Web Frontend
Home Page: http://www.augmint.org
License: GNU Affero General Public License v3.0
https://docs.google.com/spreadsheets/d/1R5RURTLQv0XBY46XN3RVojHdv9LAQcNJbYZeg1ig_CU/edit?usp=sharing
first draft, to be discussed
a double book keeping model
only some parts requires coding
it is the core UCD part only
ETH part should be prepared to
**The purpose to create the ecosystem's indicators for monetary management ** ( market intervention)
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
UCD/ETH orders and order fills should be rounded.
Introducing min amounts for orders will help
Still a question of how to handle small remainders from conversions. Eg. 100 UCD for sell, 98.80 filled - what to do with the .20? Same with ETH.
need to throw if fails & handle on client side
maybe do it together with transaction history (ie. events need to be emitted for that)
for intervention management,
needed info on the state of the UCD monetary balances
new data to this page:
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
TBD: shall we give user confirmation on form and have a global component (eg. in EthereumState.js) with list of pending txs + confirmation numbers
eg. link to my account + link to loan details
maybe use standard loan details component (handle that new loan might not be loaded yet)
UI hangs in submitting status after submit when tx fails with invalid opcode (eg. loan amount too low) despite MetaMask shows tx failed.
MetaMask/metamask-extension#2060
deducted from every UCD transfer, minamount: param (0.01 UCD?), txFee: 0.001%
collect to separate contract
TBD:
e.g.
UCD = 25,2
ETH = 25,234
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)"
so that anyone call it if tokenUcd fails to do batch collection for any reason
create private chain creation and launch scripts, test migration and app
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)
consider implementing ERC-223
eth amount released from escrow
When disbursed amount is two digits then rounding is different by client than contract.
E.g. 1ETH entered, displayed 160.77 UCD disbursed on client but actual disbursed is 160.78
E.g. form scroll down on home page, click on concept link navigates to the middle of concept page
https://reacttraining.com/react-router/web/guides/scroll-restoration
prerendering enabled on netlify but it needs to be tested if suits and/or use this method:
https://medium.com/superhighfives/an-almost-static-stack-6df0a2791319
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.
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:
When using a browser without Metamask then it works properly.
it's only on testrpc, must be tested with real chain
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)
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
user has 2 accounts, UCD and ETH, the history shows only the UCD transactions ,
we may show also the ETH history too
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?
we refresh user and tokenUcd balances onNewBlock
that's not ideal:
check onNewBlock if it's a block relevant to user/tokenUcd/exchange and/or do refresh on relevant log events
Eg. piggyback oraclize's pricing contract
if connected then UI should refresh rates at every new block (?)
$ 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.
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
$ 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)
test deployment to Ropsten and/or Rinkeby and test app
create/update scripts for deployment
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.