Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.50 KB | None | 0 0
  1. truffle.cmd migrate --network rinkeby
  2.  
  3. Running migration: 2_deploy_contracts.js
  4. Deploying SampleCrowdsale...
  5. ... 0x3c154f82e895eaa104ff183538f32a3b9b7b0812c0b1523e2d7aed735ca9e422
  6. Error encountered, bailing. Network state unknown. Review successful transactions manually.
  7. Error: The contract code couldn't be stored, please check your gas amount.
  8. at Object.callback (C:UsersyAppDataRoamingnpmnode_modulestrufflebuildcli.bundled.js:218485:46)
  9. at C:UsersyAppDataRoamingnpmnode_modulestrufflebuildcli.bundled.js:34886:25
  10. at C:UsersyAppDataRoamingnpmnode_modulestrufflebuildcli.bundled.js:220423:9
  11. at C:UsersyAppDataRoamingnpmnode_modulestrufflebuildcli.bundled.js:72910:11
  12. at C:UsersyAppDataRoamingnpmnode_modulestrufflebuildcli.bundled.js:204149:9
  13. at Web3ProviderEngine._inspectResponseForNewBlock (C:UsersyDesktopCodesolidity-test-deploynode_modulesweb3-provider-engineindex.js:231:12)
  14. at C:UsersyDesktopCodesolidity-test-deploynode_modulesweb3-provider-engineindex.js:131:14
  15. at C:UsersyDesktopCodesolidity-test-deploynode_modulesasyncdistasync.js:421:16
  16. at replenish (C:UsersyDesktopCodesolidity-test-deploynode_modulesasyncdistasync.js:941:25)
  17. at iterateeCallback (C:UsersyDesktopCodesolidity-test-deploynode_modulesasyncdistasync.js:931:17)
  18.  
  19. pragma solidity ^0.4.11;
  20.  
  21. import "zeppelin-solidity/contracts/crowdsale/CappedCrowdsale.sol";
  22. import "zeppelin-solidity/contracts/crowdsale/RefundableCrowdsale.sol";
  23. import "zeppelin-solidity/contracts/token/MintableToken.sol";
  24.  
  25. /**
  26. * @title SampleCrowdsaleToken
  27. * @dev Very simple ERC20 Token that can be minted.
  28. * It is meant to be used in a crowdsale contract.
  29. */
  30. contract SampleCrowdsaleToken is MintableToken {
  31.  
  32. string public constant name = "Sample Crowdsale Token";
  33. string public constant symbol = "SCT";
  34. uint8 public constant decimals = 18;
  35.  
  36. }
  37.  
  38. /**
  39. * @title SampleCrowdsale
  40. * @dev This is an example of a fully fledged crowdsale.
  41. * The way to add new features to a base crowdsale is by multiple inheritance.
  42. * In this example we are providing following extensions:
  43. * CappedCrowdsale - sets a max boundary for raised funds
  44. * RefundableCrowdsale - set a min goal to be reached and returns funds if it's not met
  45. *
  46. * After adding multiple features it's good practice to run integration tests
  47. * to ensure that subcontracts works together as intended.
  48. */
  49. contract SampleCrowdsale is CappedCrowdsale, RefundableCrowdsale {
  50.  
  51. function SampleCrowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, uint256 _goal, uint256 _cap, address _wallet)
  52. CappedCrowdsale(_cap)
  53. FinalizableCrowdsale()
  54. RefundableCrowdsale(_goal)
  55. Crowdsale(_startTime, _endTime, _rate, _wallet)
  56. {
  57. //As goal needs to be met for a successful crowdsale
  58. //the value needs to less or equal than a cap which is limit for accepted funds
  59. require(_goal <= _cap);
  60. }
  61.  
  62. function createTokenContract() internal returns (MintableToken) {
  63. return new SampleCrowdsaleToken();
  64. }
  65.  
  66. }
  67.  
  68. var SampleCrowdsale = artifacts.require("../contracts/SampleCrowdsale.sol");
  69.  
  70. module.exports = function(deployer) {
  71. deployer.deploy(SampleCrowdsale, {gas: 5000000});
  72. };
  73.  
  74. var HDWalletProvider = require("truffle-hdwallet-provider");
  75. var mnemonic = "nyxynyx-has-changed-this";
  76.  
  77.  
  78. module.exports = {
  79. networks: {
  80. development: {
  81. host: "localhost",
  82. port: 8545,
  83. network_id: "*" // Match any network id
  84. },
  85.  
  86. rinkeby: {
  87. provider: new HDWalletProvider(mnemonic, "https://rinkeby.infura.io/nyxynyx-has-changed-this"),
  88. network_id: '4'
  89. }
  90. }
  91. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement