This commit is contained in:
Richard Ramos 2018-11-26 09:04:34 -04:00
commit f874a91308
3 changed files with 12 additions and 2 deletions

View File

@ -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

View File

@ -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 {

View File

@ -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);