Merge branch 'master' of https://github.com/status-im/hackathon-registration-dapp
This commit is contained in:
commit
f874a91308
|
@ -1,5 +1,8 @@
|
|||
# hackathon-registration-dapp
|
||||
|
||||
### Prerequisites:
|
||||
- Geth, IPFS and Embark installed
|
||||
|
||||
### Installation:
|
||||
|
||||
```
|
||||
|
@ -17,7 +20,7 @@ A nodejs service was created to receive funding requests. It requires a geth lig
|
|||
1. Edit `server/config.js` and set the contract address and the private key of the controller address.
|
||||
2. `node server/main.js`
|
||||
|
||||
### Running the dapp.
|
||||
### Running the dapp in a development environment
|
||||
0. `embark run`
|
||||
1. Browse http://localhost:8000/index.htm?CODE_TO_REDEEM
|
||||
|
||||
|
|
|
@ -83,6 +83,13 @@ contract SNTGiveaway is Controlled {
|
|||
require(SNT.transfer(msg.sender, sntBalance), "Transfer did not work");
|
||||
selfdestruct(msg.sender);
|
||||
}
|
||||
|
||||
/// @notice Extract balance in ETH + SNT from the contract
|
||||
function retrieveFunds() public onlyController {
|
||||
uint sntBalance = SNT.balanceOf(address(this));
|
||||
require(SNT.transfer(msg.sender, sntBalance), "Transfer did not work");
|
||||
selfdestruct(msg.sender);
|
||||
}
|
||||
|
||||
|
||||
function() public payable {
|
||||
|
|
|
@ -13,7 +13,7 @@ for(i = 0; i < numCodes; i++){
|
|||
const code = crypto.randomBytes(codeLength).toString('hex');
|
||||
|
||||
codes.push(code);
|
||||
elements.push(sha3(new Buffer(code, 'hex')));
|
||||
elements.push(sha3(Buffer.from(code, 'hex')));
|
||||
}
|
||||
|
||||
const merkleTree = new MerkleTree.default(elements);
|
||||
|
|
Loading…
Reference in New Issue