Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- truffle.cmd migrate --network rinkeby
- Running migration: 2_deploy_contracts.js
- Deploying SampleCrowdsale...
- ... 0x3c154f82e895eaa104ff183538f32a3b9b7b0812c0b1523e2d7aed735ca9e422
- Error encountered, bailing. Network state unknown. Review successful transactions manually.
- Error: The contract code couldn't be stored, please check your gas amount.
- at Object.callback (C:UsersyAppDataRoamingnpmnode_modulestrufflebuildcli.bundled.js:218485:46)
- at C:UsersyAppDataRoamingnpmnode_modulestrufflebuildcli.bundled.js:34886:25
- at C:UsersyAppDataRoamingnpmnode_modulestrufflebuildcli.bundled.js:220423:9
- at C:UsersyAppDataRoamingnpmnode_modulestrufflebuildcli.bundled.js:72910:11
- at C:UsersyAppDataRoamingnpmnode_modulestrufflebuildcli.bundled.js:204149:9
- at Web3ProviderEngine._inspectResponseForNewBlock (C:UsersyDesktopCodesolidity-test-deploynode_modulesweb3-provider-engineindex.js:231:12)
- at C:UsersyDesktopCodesolidity-test-deploynode_modulesweb3-provider-engineindex.js:131:14
- at C:UsersyDesktopCodesolidity-test-deploynode_modulesasyncdistasync.js:421:16
- at replenish (C:UsersyDesktopCodesolidity-test-deploynode_modulesasyncdistasync.js:941:25)
- at iterateeCallback (C:UsersyDesktopCodesolidity-test-deploynode_modulesasyncdistasync.js:931:17)
- pragma solidity ^0.4.11;
- import "zeppelin-solidity/contracts/crowdsale/CappedCrowdsale.sol";
- import "zeppelin-solidity/contracts/crowdsale/RefundableCrowdsale.sol";
- import "zeppelin-solidity/contracts/token/MintableToken.sol";
- /**
- * @title SampleCrowdsaleToken
- * @dev Very simple ERC20 Token that can be minted.
- * It is meant to be used in a crowdsale contract.
- */
- contract SampleCrowdsaleToken is MintableToken {
- string public constant name = "Sample Crowdsale Token";
- string public constant symbol = "SCT";
- uint8 public constant decimals = 18;
- }
- /**
- * @title SampleCrowdsale
- * @dev This is an example of a fully fledged crowdsale.
- * The way to add new features to a base crowdsale is by multiple inheritance.
- * In this example we are providing following extensions:
- * CappedCrowdsale - sets a max boundary for raised funds
- * RefundableCrowdsale - set a min goal to be reached and returns funds if it's not met
- *
- * After adding multiple features it's good practice to run integration tests
- * to ensure that subcontracts works together as intended.
- */
- contract SampleCrowdsale is CappedCrowdsale, RefundableCrowdsale {
- function SampleCrowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, uint256 _goal, uint256 _cap, address _wallet)
- CappedCrowdsale(_cap)
- FinalizableCrowdsale()
- RefundableCrowdsale(_goal)
- Crowdsale(_startTime, _endTime, _rate, _wallet)
- {
- //As goal needs to be met for a successful crowdsale
- //the value needs to less or equal than a cap which is limit for accepted funds
- require(_goal <= _cap);
- }
- function createTokenContract() internal returns (MintableToken) {
- return new SampleCrowdsaleToken();
- }
- }
- var SampleCrowdsale = artifacts.require("../contracts/SampleCrowdsale.sol");
- module.exports = function(deployer) {
- deployer.deploy(SampleCrowdsale, {gas: 5000000});
- };
- var HDWalletProvider = require("truffle-hdwallet-provider");
- var mnemonic = "nyxynyx-has-changed-this";
- module.exports = {
- networks: {
- development: {
- host: "localhost",
- port: 8545,
- network_id: "*" // Match any network id
- },
- rinkeby: {
- provider: new HDWalletProvider(mnemonic, "https://rinkeby.infura.io/nyxynyx-has-changed-this"),
- network_id: '4'
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement