leapdao / bridge-ui Goto Github PK
View Code? Open in Web Editor NEWdApp for interacting with LeapDAO chain
Home Page: https://testnet.leapdao.org
License: GNU General Public License v3.0
dApp for interacting with LeapDAO chain
Home Page: https://testnet.leapdao.org
License: GNU General Public License v3.0
I'm trying to deposit 2 PSC, but UI sending 0.000000018
Transaction: https://rinkeby.etherscan.io/tx/0x36cf1850ccdb3563b27a0219275a1e44a05c1f4858cfa10bddfb81762ac93920
could be useful to manually call activate on some slot that is "ripe".
if something can be derived, it should be derived
— sunify
Let's create a token page, so we can see rich info about colors
Now it is only token cents
Something is not right with Web3PromiEvent
deposit.js:96 Uncaught TypeError: Cannot read property 'color' of undefined
at Deposit.render (deposit.js:96)
UX
We want LeapDAO to govern which tokens may be registered on the chain. That's why registerToken
became a governable method just recently and thus should be executed via applyProposal
only.
With this change the current "Register token" page should be changed to allow everyone to propose a token to add.
I suggest to start small and just put a link to Google Form (or Typeform) asking for token address and freetext description.
gardener: @troggy / 10%
worker: @johannbarbie / 75%
reviewer: @troggy / 15%
Governance proposals are changes to the plasma contract that are held for 7 days before applied to the contract. They are displayed for all users to see on testnet and mainnet.
Add more detailed description for each type of proposal, so that it is easier to understand the consequence of the change
gardener: @troggy / 10%
worker: ___ / 70%
reviewer: ___ / 20%
Now it's hardcoded, but we need to be able to change it without affecting the repo (building versions for testnet and mainnet for example)
It should:
Stacking UI can be moved to /stake
Requires node JSON RPC changes (to request all balances by color)
token
field on ParsecBridge contract publicI got a Runtime Error, Please Help me.
brokim@anonymous:~/workspace/leapdao/bridge-ui$ yarn start
yarn run v1.10.1
$ ./node_modules/.bin/webpack-dev-server --config webpack.config.dev.js
Starting type checking service...
Using 1 worker with 2048MB memory limit
ℹ 「wds」: Project is running at http://localhost:1234/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: 404s will fallback to /index.html
Type checking in progress...
⚠ 「wdm」: Hash: 535be0743da2710de64c
Version: webpack 4.27.1
Time: 35902ms
Built at: 2019. 01. 07. 오전 12:57:32
Asset Size Chunks Chunk Names
3f99887f903cf946744f9da9a982a961.png 14.7 KiB [emitted]
5af1ec187d63930a0998895a5df36b31.svg 1000 bytes [emitted]
7efbc71c1c0fb24892eb3df82f98cbce.png 833 bytes [emitted]
f5eac1518665bcf468ff23181ade4951.png 1.93 KiB [emitted]
index.535be0743da2710de64c.js 11.7 MiB main [emitted] main
index.html 1.49 KiB [emitted]
Entrypoint main = index.535be0743da2710de64c.js
[0] multi (webpack)-dev-server/client?http://localhost:1234 ./src/index.tsx 40 bytes {main} [built]
[./node_modules/antd/dist/antd.min.css] 455 bytes {main} [built]
[./node_modules/loglevel/lib/loglevel.js] 7.68 KiB {main} [built]
[./node_modules/mobx-react/index.module.js] 48.7 KiB {main} [built]
[./node_modules/react-dom/index.js] 1.33 KiB {main} [built]
[./node_modules/react-router-dom/es/index.js] 1010 bytes {main} [built]
[./node_modules/react-router/es/index.js] 723 bytes {main} [built]
[./node_modules/react/index.js] 190 bytes {main} [built]
[./node_modules/strip-ansi/index.js] 161 bytes {main} [built]
[./node_modules/url/url.js] 22.8 KiB {main} [built]
[./node_modules/webpack-dev-server/client/index.js?http://localhost:1234] (webpack)-dev-server/client?http://localhost:1234 7.78 KiB {main} [built]
[./node_modules/webpack-dev-server/client/overlay.js] (webpack)-dev-server/client/overlay.js 3.58 KiB {main} [built]
[./node_modules/webpack-dev-server/client/socket.js] (webpack)-dev-server/client/socket.js 1.05 KiB {main} [built]
[./node_modules/webpack/hot sync ^./log$] (webpack)/hot sync nonrecursive ^./log$ 170 bytes {main} [built]
[./src/index.tsx] 4.14 KiB {main} [built]
+ 1599 hidden modules
WARNING in EnvironmentPlugin - CONFIG environment variable is undefined.
You can pass an object with default values to suppress this warning.
See https://webpack.js.org/plugins/environment-plugin for example.
WARNING in EnvironmentPlugin - NETWORK_ID environment variable is undefined.
You can pass an object with default values to suppress this warning.
See https://webpack.js.org/plugins/environment-plugin for example.
WARNING in EnvironmentPlugin - PLASMA_NODE environment variable is undefined.
You can pass an object with default values to suppress this warning.
See https://webpack.js.org/plugins/environment-plugin for example.
Child html-webpack-plugin for "index.html":
Asset Size Chunks Chunk Names
3f99887f903cf946744f9da9a982a961.png 14.7 KiB [emitted]
7efbc71c1c0fb24892eb3df82f98cbce.png 833 bytes [emitted]
f5eac1518665bcf468ff23181ade4951.png 1.93 KiB [emitted]
+ 1 hidden asset
Entrypoint undefined = index.html
[./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html] 2.27 KiB {0} [built]
[./node_modules/lodash/lodash.js] 527 KiB {0} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 472 bytes {0} [built]
[./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {0} [built]
[./src/apple-touch-icon.png] 82 bytes {0} [built]
[./src/config sync recursive ^././config.json$] ./src/config sync ^././config.json$ 186 bytes {0} [optional] [built]
[./src/config/env.js] 21 bytes {0} [not cacheable] [built]
[./src/config/index.ts] 703 bytes {0} [built]
[./src/config/testnet/config.json] 377 bytes {0} [optional] [built]
[./src/favicon-16x16.png] 82 bytes {0} [built]
[./src/favicon-32x32.png] 82 bytes {0} [built]
ℹ 「wdm」: Compiled with warnings.
ERROR in /home/brokim/workspace/leapdao/bridge-ui/node_modules/web3/types.d.ts(1,10):
TS2305: Module '"../@types/bn.js"' has no exported member 'BigNumber'.
ERROR in /home/brokim/workspace/leapdao/bridge-ui/node_modules/web3/types.d.ts(1,27):
TS2497: Module '"/home/brokim/workspace/leapdao/bridge-ui/node_modules/@types/bn.js/index"' resolves to a non-module entity and cannot be imported using this construct.
ERROR in /home/brokim/workspace/leapdao/bridge-ui/src/stores/contractStore.ts(55,7):
TS2322: Type 'import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/web3/types").Contract' is not assignable to type 'import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/@types/web3/eth/contract").default'.
Types of property 'methods' are incompatible.
Type '{ [fnName: string]: (...args: any[]) => import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/web3/types").TransactionObject; }' is not assignable to type '{ [fnName: string]: (...args: any[]) => import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/@types/web3/eth/types").TransactionObject; }'.
Index signatures are incompatible.
Type '(...args: any[]) => import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/web3/types").TransactionObject' is not assignable to type '(...args: any[]) => import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/@types/web3/eth/types").TransactionObject'.
Type 'import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/web3/types").TransactionObject' is not assignable to type 'import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/@types/web3/eth/types").TransactionObject'.
Types of property 'send' are incompatible.
Type '(tx?: import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/web3/types").Tx) => import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/web3/types").PromiEvent' is not assignable to type '(tx?: import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/@types/web3/eth/types").Tx) => import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/@types/web3/promiEvent").default'.
Type 'import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/web3/types").PromiEvent' is not assignable to type 'import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/@types/web3/promiEvent").default'.
Types of property 'once' are incompatible.
Type '{ (type: "transactionHash", handler: (receipt: string) => void): import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/web3/types").PromiEvent; (type: "receipt", handler: (receipt: import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/web3/types").TransactionReceipt) => void): import("/home/brok...' is not assignable to type '{ (type: "transactionHash", handler: (receipt: string) => void): import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/@types/web3/promiEvent").default; (type: "receipt", handler: (receipt: import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/@types/web3/types").TransactionReceipt) => void): im...'.
Types of parameters 'type' and 'type' are incompatible.
Type '"receipt"' is not assignable to type '"transactionHash"'.
ERROR in /home/brokim/workspace/leapdao/bridge-ui/src/stores/contractStore.ts(62,7):
TS2322: Type 'import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/web3/types").Contract' is not assignable to type 'import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/@types/web3/eth/contract").default'.
ERROR in /home/brokim/workspace/leapdao/bridge-ui/src/stores/contractStore.ts(68,5):
TS2322: Type 'import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/web3/types").Contract' is not assignable to type 'import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/@types/web3/eth/contract").default'.
ERROR in /home/brokim/workspace/leapdao/bridge-ui/src/stores/governanceContract.ts(8,31):
TS2307: Cannot find module 'web3/Eth/ABI'.
ERROR in /home/brokim/workspace/leapdao/bridge-ui/src/stores/token.ts(217,5):
TS2322: Type 'Promise<{ futureReceipt: PromiEvent; }>' is not assignable to type 'Promise'.
Type '{ futureReceipt: PromiEvent; }' is not assignable to type 'InflightTxReceipt'.
Types of property 'futureReceipt' are incompatible.
Type 'import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/web3/types").PromiEvent<import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/web3/types").TransactionReceipt>' is not assignable to type 'import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/@types/web3/promiEvent").default<import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/web3/types").TransactionReceipt>'.
Types of property 'once' are incompatible.
Type '{ (type: "transactionHash", handler: (receipt: string) => void): import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/web3/types").PromiEvent<import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/web3/types").TransactionReceipt>; (type: "receipt", handler: (receipt: import("/home/brokim/workspace/le...' is not assignable to type '{ (type: "transactionHash", handler: (receipt: string) => void): import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/@types/web3/promiEvent").default<import("/home/brokim/workspace/leapdao/bridge-ui/node_modules/web3/types").TransactionReceipt>; (type: "receipt", handler: (receipt: import("/home/brokim/wor...'.
Types of parameters 'type' and 'type' are incompatible.
Type '"receipt"' is not assignable to type '"transactionHash"'.
ERROR in /home/brokim/workspace/leapdao/bridge-ui/src/utils/abis/bridge.ts(1,31):
TS2307: Cannot find module 'web3/Eth/ABI'.
ERROR in /home/brokim/workspace/leapdao/bridge-ui/src/utils/abis/exitHandler.ts(1,31):
TS2307: Cannot find module 'web3/Eth/ABI'.
ERROR in /home/brokim/workspace/leapdao/bridge-ui/src/utils/abis/operator.ts(1,31):
TS2307: Cannot find module 'web3/Eth/ABI'.
ERROR in /home/brokim/workspace/leapdao/bridge-ui/src/utils/abis/proxy.ts(1,31):
TS2307: Cannot find module 'web3/Eth/ABI'.
Version: typescript 3.2.2
So we can get rid of HTTP polling (basically reviving #31 once more)
But should
Currently, we can only run dev mode, but should be able to build a dapp for deploy
antd
libraryRelated to leapdao/leap-contracts#78
It was started like a staking UI, then like a UI for plasma bridge, but now there are a lot of stuff here:
and we want to add:
So, we probably should:
TypeError: bridge.methods.epochLength is not a function
at readSlots (bridge.ts:23)
at Bridge.loadContractData (bridge.ts:65)
Signature changed: proof for youngest input is additionally required now
Currently, node list is hardcoded on the status page. Let's get it from the connected node to avoid redundancy
Stakeholders should be able to see pending governance proposals and veto them.
Related: leapdao/leap-contracts#66
create a user interface (ideally in bridge) with the following abilities:
bounty gardener: @johannbarbie / 10%
bounty worker: open / 80%
bounty reviewer: open / 10%
Setup instance of the bridge UI for testnet:
testnet.leapdao.org
Requires (to be done separately): #76
Value: 300 DAI
gardener: @troggy / 5%
worker: @troggy / 85%
reviewer: @johannbarbie / 10%
Use tokenOfOwnerByIndex
from ERC721Enumerable
INFURA websockets are not realiable — aren't working sometimes
Just need to disable all submit stuff (deposit and stake) and hide balance
Exits take time. In case governance proposal upgrades ExitHandler contract in a way which messes with the exits, it may be too late to exit even if proposal is not applied yet. Like this:
Timeline:
<proposal created>-------------------------------<proposal applied>
<exit started>-------------------------------<exit finalized>
So we should display not only the time proposal becomes effective, but also the time left for safe exit. Safe exit = exit which will be finalized before the ExitHandler upgrade proposal applied.
This should consider the fact that it may take different time for different UTXOs to exit due to Plasma setup, somewhere in interval [exitDuration, exitDuration × 2]
(ref) where exitDuration
should be read from the ExitHandler contract.
exitDuration × 2
seconds).[exitDuration, exitDuration × 2]
)exitDuration
seconds)Here not safe
means that, depending on the nature of the ExitHandler upgrade, new contract logic MAY be used in the contract at the exit finalization time and thus potentially mess the exit. Probably not safe
is a too strong wording here 🤔
Size: XS as per bounty policy
gardener: @troggy / 10% — 20 DAI
worker: ___ / 80% — 160 DAI
reviewer: __ / 10% —20 DAI
We need to send two transactions:
approve
on a token contract (to increase allowance)bet
or deposit
on bridge contract for buying slot and deposit respectivelyCurrently, we sending two tx in a row. So user confirming one tx and then MetaMask pops up again and asking to submit the second tx. It's a pretty bad UX.
Maybe we should increase allowance in separate form and show it like we showing the balance. If the user will try to buy a slot with stake > allowance we should disable submit button. Same for deposit
Looks like CORS issue.
Probably related: web3/web3.js#1803
Firefox 63.0b13
Value: 165 DAI
gardener: @troggy / 0%
worker: @troggy / 90%
reviewer: @johannbarbie / 10%
If proposal is to change some numeric parameter (e.g. epochLength), show the current value as well.
Like "Change epoch length from 1 to 3
". Combined with #72 (out of scope here) it should be much easier for people to assess the change
Size: XS S
gardener: @troggy / 10%
worker: @troggy / 80%
reviewer: @johannbarbie / 10%
And cleanup styles
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.