-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Deploy on Ropsten fails but no message explaining why #974
Comments
@rmi7 Is this your contract deployed to Ropsten at tx 0x082a3ebedd92bae28e00a9a3476f5f67b31ad8779c01e0c15b1b66ba54247297 ? Could you look at the artifacts for Looks like it should be: 0x8a5fa2e6035fb19880a54f4f974d1ef320290988 |
Looks like it yes, and no, there is no update to the for all other migrations before this one there is an update to the are there any specific things that I could be doing inside a migration file which would prevent the UPDATE verified that that is indeed my contract, verified and added source code, still leaves the question why |
I'm getting the same kind of timeout it seems it does update my version but still get a timeout. My Versions:
|
@michaeljohnbennett The timeout problem should be fixed in 4.1.11 - recent changes to a dependency in the wallet provider resulted in commands failing to exit correctly. As a side note - it's now important that you wrap providers in a function in @rmi7 Can you share your |
I cleaned out node_modules and did a reinstall of 4.1.11 and it works. Also globally. I am using the lazy initialisation functions for wallet provider functions. You should have that changed on master branch docs as well as its confusing all the variations on this piece caused me a lot of hassle at the beginning. Thanks so much for you help. |
Ah ok! Thanks for the tip about the docs, will check that out. |
that didn't fix it for me, still working on ganache + ropsten dry run, but not actual deploy on ropsten, the last migration is the below, the other two contracts I require have been successfully deployed (their Result = Last Migrationconst ICO = artifacts.require('./ICO.sol');
const MyToken = artifacts.require('./MyToken.sol');
const Membership = artifacts.require('./Membership.sol');
const UnixTimestamp = jsTimestamp => (
Math.floor(jsTimestamp / 1000)
);
module.exports = async (deployer, network, accounts) => {
// get already deployed MyToken + Membership contracts
const token = await MyToken.deployed();
const member = await Membership.deployed();
// constructor args for Ico contract
const rate = 3000;
const token = token.address;
const tokenWallet = accounts[0];
const membership = member.address;
let ethWallet;
let startTime;
let endTime;
if (network === 'mainnet') {
// ETH wallet is separate address
if (!process.env.ETH_WALLET_ADDRESS) {
throw new Error('need ETH_WALLET_ADDRESS env var to be set');
}
if (!web3.isAddress(process.env.ETH_WALLET_ADDRESS)) {
throw new Error(`env var ETH_WALLET_ADDRESS is not a vlid ETH address, value: ${process.env.ETH_WALLET_ADDRESS}`);
}
ethWallet = process.env.ETH_WALLET_ADDRESS;
startTime = 1529146400;
endTime = 1535264399;
} else {
ethWallet = accounts[0];
startTime = UnixTimestamp(Date.now() + 60 * 1000 * 5); // 5 minutes from now
endTime = UnixTimestamp(Date.now() + 60 * 1000 * 60 * 24 * 14); // 14 days
}
// deploy Ico contract --> GAS USED: 2,291,944
await deployer.deploy(ICO, startTime, endTime, rate, ethWallet, token, tokenWallet, membership);
console.log('DEPLOYED ICO', ICO.address, (await ICO.deployed()).address);
const ico = await ICO.deployed();
// allow Ico contract to add members to membership contract
await member.addAdmin(ico.address);
// get the max amount of tokens that this Ico contract will sell
// we can later update this to be even bigger if the need arises, using another token.approve from remix
const MAX_ICO_TOKENS = 14625000; // 19000000 + 150% of 19000000;
// allow Ico contract to transfer MAX_ICO_TOKENS NTS tokens
await token.approve(ico.address, web3.toWei(MAX_ICO_TOKENS))
};
|
@rmi7 Believe the problem is with async/await which Migrations only supports if it's wrapped in a TLDR; everything should work if you wrap your async/await migrations logic like this: module.exports = function(deployer, network, accounts) {
deployer.then(async function(){
... all your setup / deploys / etc
}) There's a nice example of this here and the issue is being tracked at #501. |
thanks @cgewecke, amazing that does it!!! 🎇😎☄️ |
also relevant: trufflesuite/truffle-migrate#29 (comment) |
Issue
so I’m deploying 3 contracts (+ Migrations.sol) on both ganache locally AND
—dry-run
on ropsten. both giving me the below output for deployment of the last contract of the 4:but when I actually deploy on ropsten (so no dry run) I only get this for the last contract:
Expected Behavior
Expected either:
MyMagicalContract.sol
MyMagicalContract.sol
Actual Results
MyMagicalContract.sol
MyMagicalContract.sol
Environment
4.1.11
8.9.4
5.6.0
The text was updated successfully, but these errors were encountered: