1

I try to deploy smart contracts using Infura to the rinkeby test network and got this error:

Running migration: 1_initial_migration.js
 Deploying Migrations...
      ... 0xd0aaaa46ae5cede2e2895ab4cd47f7df84f88a20e4504335f710277b32684e45
    Error encountered, bailing. Network state unknown. Review successful transactions manually.
    Error: Contract transaction couldn't be found after 50 blocks

Here is a fragment of truffle-config.js where I had setup a rinkeby network:

  rinkeby: {
     host: "localhost",
     provider: function() {
        return new HDWalletProvider(
        mnemonic,
        `https://rinkeby.infura.io/v3/${infuraKey}`
    )
  },
  gas : 2000000,
  network_id: 4
},

My environment:

Ubuntu 16.04 LTS, truffle.js 4.1.13

Migrations files: 1_initial_migrations.js

var Migrations = artifacts.require("./Migrations.sol");

module.exports = function(deployer) {
  deployer.deploy(Migrations);
};

2_deploy_contracts.js

let GigBlack        = artifacts.require("./GigBlack.sol");
let GigGold         = artifacts.require("./GigGold.sol");
let GigSilver       = artifacts.require("./GigSilver.sol");
let GigPlatinum     = artifacts.require("./GigPlatinum.sol");
let GigCrowdsale    = artifacts.require("./GigCrowdsale.sol");

const BigNumber = web3.BigNumber;

const decimals = 18;

const config = {
    wallet: web3.eth.accounts[0], 
    addressTxFeeCollector: web3.eth.accounts[1],
    startTime: new BigNumber(1632044800),
    endTime: new BigNumber(2000000000), 

    // 1 GZB = 0.0025 ETH
    rate: new BigNumber(400),                                        

    // ETH amount. 8% from total supply of 1 billion tokens is sold on crowdsale
    // 80M GZB = 200k ETH 
    cap: new BigNumber(200000).mul(new BigNumber(10).pow(decimals)), 

    // total GZB supply: 1B
    totalSupply: new BigNumber(1000 * 10**6).mul(new BigNumber(10).pow(decimals)),

    // token amount for crowdsale : 8% of total supply = 80M GZB
    amountCrowdsale: new BigNumber(80 * 10**6).mul(new BigNumber(10).pow(decimals)),

    // amount to lock in a fee bank (90% of total supply) = 900M GZB
    amountFeeBank: new BigNumber(900 * 10**6).mul(new BigNumber(10).pow(decimals)),

    partnerWallet: '0x1F5a6E8f32BDdabbcFCB20978c3bF676501e712D'
};


module.exports = (deployer) => {
    deployer.then(async () => {

        await deployer.deploy(GigGold, config.addressTxFeeCollector);
        await deployer.deploy(GigSilver, config.addressTxFeeCollector);
        await deployer.deploy(GigPlatinum, config.addressTxFeeCollector);
        await deployer.deploy(GigBlack, config.addressTxFeeCollector);

        await deployer.deploy(
            GigCrowdsale, 
            config.startTime,
            config.endTime,
            config.rate,
            config.cap,
            config.wallet,
            GigBlack.address,
            config.partnerWallet
        );

        // retrieve gigBlack contract interface
        const gigBlack = GigBlack.at(GigBlack.address);

        // turn off fees for crowdsale stage
        await gigBlack.setFeeEnabled(false);

        // transfer amount for crowdsale
        await gigBlack.transfer(GigCrowdsale.address, config.amountCrowdsale, {from: config.wallet});

        // transfer amount to the fee bank
        const feeBankAddress = await gigBlack.feeBank(); 
        await gigBlack.transfer(feeBankAddress, config.amountFeeBank, {from: config.wallet});

        return GigCrowdsale.deployed();
    });
};

I tried to change the value of a gas regarding a similar issue, but this didn`t help. Also, I have to mention, that contracts can be deployed successfully to ropsten tesnetwork using infura.

  • What's your migrations file like? – Lauri Peltonen Apr 23 at 17:59
  • @LauriPeltonen I have put them to op right now. – VadimKovalenko Apr 24 at 7:51
  • Seeing as it can't even deploy the first migration I'd guess it's a network issue - probably your Infura connection has some problems – Lauri Peltonen Apr 24 at 7:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.