Guest User

Untitled

a guest
Nov 18th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. TokenSale.at(this.state.contractAddress).then((instance) => {
  2. instance.participationSize.call().then((r) => {
  3. console.log('participationSize: ', r)
  4. })
  5. })
  6.  
  7. pragma solidity ^0.4.15;
  8. import "./libs/zeppelin/crowdsale/CappedCrowdsale.sol";
  9. import "./libs/zeppelin/crowdsale/FinalizableCrowdsale.sol";
  10.  
  11. contract TokenSale is CappedCrowdsale, FinalizableCrowdsale {
  12.  
  13. mapping (address => uint256) public participationWeis;
  14. address[] public participationAddressLUT;
  15.  
  16. function TokenSale(uint256 _startTime, uint256 _endTime, uint256 _rate, uint256 _goal, uint256 _cap, address _wallet, address _tokenContractAddress)
  17. CappedCrowdsale(_cap)
  18. FinalizableCrowdsale()
  19. Crowdsale(_startTime, _endTime, _rate, _wallet)
  20. {
  21. bootstrapParticipation();
  22. }
  23.  
  24.  
  25. function bootstrapParticipation() internal {
  26. address participant = 0xcede48d8ac162d1b08ed9419010de3c99f2cfdd6;
  27. uint256 weiAmount = 1000000;
  28. participationWeis[participant] = participationWeis[participant].add(weiAmount);
  29. participationAddressLUT.push(participant);
  30.  
  31. participant = 0x854bd635fd4e8684a326664e0698c8fefae6dd97;
  32. weiAmount = 5000000;
  33. participationWeis[participant] = participationWeis[participant].add(weiAmount);
  34. participationAddressLUT.push(participant);
  35. }
  36.  
  37.  
  38. function participationSize() public returns (uint256) {
  39. return participationAddressLUT.length;
  40. }
  41.  
  42. }
Add Comment
Please, Sign In to add comment