December 2018
Intermediate to advanced
222 pages
6h 6m
English
Once the funding goal is reached, the crowdfunding owner will collect of the all funds by running the checkGoalReached method.
The HTML is just a simple button, as shown in the following code:
<button type="button" id="checkGoal" class="btn btn-success">CheckGoal</button>
Similar to the fund function, we call the smart contract in JavaScript using the following code:
instance.checkGoalReached({ from: selectAcct, gas:3500000});
Here is the detailed logic:
handleCheckGoal: function(event) { event.preventDefault(); $("#displayMsg").html(""); var selectAcct = $('#accts').find(":selected").val(); App.contracts.CrowdFunding.deployed().then(function(instance) { return instance.checkGoalReached({ from: selectAcct, gas:3500000}); ...Read now
Unlock full access