Guest User

Untitled

a guest
Dec 14th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. function getAvailableAllocation(address _addr)
  2. constant
  3. returns (uint ethAvailableAllocation)
  4. {
  5. return investorActions.getAvailableAllocation(_addr);
  6. }
  7.  
  8. onSubmit = async event => {
  9. event.preventDefault();
  10.  
  11. const accounts = await web3.eth.getAccounts();
  12.  
  13. await fund.methods.getAvailableAllocation(this.state.value).call({
  14. from: accounts[0],
  15. address: this.state.value
  16. }).then(console.log);
  17.  
  18. <form onSubmit={this.onSubmit}>
  19. <h4>Available allocation</h4>
  20. <h5>Get the remaining available amount in Ether that an investor can subscribe for</h5>
  21. <div>
  22. <label>Your ethereum address</label>
  23. <input
  24. value={this.state.address}
  25. onChange={event => this.setState({ address: event.target.value })}
  26. />
  27. </div>
  28. <button>Get available allocation</button>
  29. </form>
Add Comment
Please, Sign In to add comment