mirror of
https://github.com/status-im/hackathon-registration-dapp.git
synced 2025-02-05 17:14:36 +00:00
Adding TODO docs to index.js
This commit is contained in:
parent
34e4d562e3
commit
63971e2cf2
@ -2,12 +2,53 @@ import React, { Fragment } from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import EmbarkJS from 'Embark/EmbarkJS';
|
||||
import web3 from 'Embark/web3'
|
||||
import merkleData from './merkle';
|
||||
const { sha3 } = require('ethereumjs-util');
|
||||
|
||||
|
||||
//import SimpleStorage from 'Embark/contracts/SimpleStorage';
|
||||
class App extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
EmbarkJS.onReady(async (error) => {
|
||||
if(error){
|
||||
alert("Error loading the DAPP");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const code = location.hash.replace("#"); // QR code value
|
||||
const hashedCode = sha3(code); // Code converted to format used on merkletree
|
||||
const accounts = await web3.eth.getAccounts();
|
||||
|
||||
web3.eth.defaultAccount = accounts[0];
|
||||
|
||||
// TODO: if code is empty show error or something
|
||||
// TODO: Build merkle tree using merkledata.elements (see https://github.com/ameensol/merkle-tree-solidity)
|
||||
// TODO: Call the contract function validRequest(bytes32[] _proof, bytes5 _code, address _dest)
|
||||
// The values to send are, a merkle proof, code, and the web3.eth.defaultAccount.
|
||||
// The merkle proof function uses a bytes32 hash, so you need to use hashedCode
|
||||
// TODO: if result is false, show error or something because the code is invalid or has been used
|
||||
// TODO: if result is true the code hasn't been processed. Proceed to verify if the background service will process that transaction
|
||||
// TODO: use orbit db, check if exist a value in a keyvalue store `status-hackathon-fund-requests`
|
||||
// the key to use is the code
|
||||
// TODO: if a value exists, the background service will process this code, show a message indicating that transaction is being processed
|
||||
// TODO: if it doesnt,
|
||||
// let's add a value to that keyvalue store. The key is the code, and the value is all the data used to invoke the validRequest contract function
|
||||
// show a message indicating that transaction is being processed
|
||||
//
|
||||
|
||||
// We'll deal with the redirect to ENS Registration after the previous code is implemented, and the background service is done processing the transaction
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
render(){
|
||||
return <h1>Hello World</h1>
|
||||
|
12147
package-lock.json
generated
12147
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -25,7 +25,6 @@
|
||||
"dependencies": {
|
||||
"crypto": "^1.0.1",
|
||||
"ethereumjs-util": "^5.2.0",
|
||||
"ipfs": "^0.32.3",
|
||||
"ipfs-api": "^24.0.2",
|
||||
"merkle-tree-solidity": "^1.0.8",
|
||||
"orbit-db": "^0.19.9",
|
||||
|
Loading…
x
Reference in New Issue
Block a user