I basically followed this Zeppelin crowdsale tutorial, just changed the names of the contracts. I was able to successfully deploy on a local Ganache, but then when trying to deploy to the live ethereum network it fails on invalid address
, apparently raised by migrating 1_initial_migration.js
, which looks like this:
var Migrations = artifacts.require("./Migrations.sol");
module.exports = function(deployer) {
deployer.deploy(Migrations);
};
and Migrations.sol looks like this:
pragma solidity ^0.4.17;
contract Migrations {
address public owner;
uint public last_completed_migration;
modifier restricted() {
if (msg.sender == owner) _;
}
function Migrations() public {
owner = msg.sender;
}
function setCompleted(uint completed) public restricted {
last_completed_migration = completed;
}
function upgrade(address new_address) public restricted {
Migrations upgraded = Migrations(new_address);
upgraded.setCompleted(last_completed_migration);
}
}
Here is a screenshot from the terminal where truffle migration
fails:
How is it possible that I can deploy to Ganache but not to the live network? Am I doing something wrong? Any suggestions?
--light
modifier. can this be the reason?