From e3aa05a6eccbcbc941cca12da1d958adb9862e09 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Mon, 26 Nov 2018 08:51:22 -0400 Subject: [PATCH 1/3] Update README.md --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 89a2212..3941ac9 100644 --- a/README.md +++ b/README.md @@ -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 From 2710d7bfc947c9d92b01c1ab43acafd307dd0232 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Mon, 26 Nov 2018 08:55:30 -0400 Subject: [PATCH 2/3] Added function to only retrieve funds --- contracts/SNTGiveaway.sol | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contracts/SNTGiveaway.sol b/contracts/SNTGiveaway.sol index 02e4cdb..f266dac 100644 --- a/contracts/SNTGiveaway.sol +++ b/contracts/SNTGiveaway.sol @@ -1039,6 +1039,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 { From 6f7a153ce535e1780708f0cd09f2465275ccf06e Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Mon, 26 Nov 2018 08:56:14 -0400 Subject: [PATCH 3/3] Fixed deprecated buffer creation --- server/codegen.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/codegen.js b/server/codegen.js index 3fba99c..aa794a9 100644 --- a/server/codegen.js +++ b/server/codegen.js @@ -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);