Skip to main content
more research results
Source Link
Utgarda
  • 801
  • 7
  • 20

Ropsten has lower gas limit - around 4.7M and you can't set it yourself, since it's a public testnet. Gas limit value that you put in your settings can't override the blockchain's gas limit. You can try Rinkeby - it has 7693375, check the number at the top of the stats page: https://www.rinkeby.io/#stats

Check this related question: Is there a reason Ropsten doesn't have the same block gas limit as mainnet?

I tried running your deploy with Ganache v6.1.8, default gas limit 6721975, but it didn't even deploy the token:

truffle migrate --reset --network development
Using network 'development'.

Running migration: 1_deploy.js
Deploying Token:
        Name            : Sportist
        Symbol          : S
        Decimals        : 6
        Cap             : 10000000000000000
  Deploying Token...
  ... undefined
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: Exceeds block gas limit

You don't have to inherit every conract in OpenZeppelin's collection, your crowdsale contract is clearly too big:

contract TokenCrowdsale is AllowanceCrowdsale, RefundableCrowdsale, IndividuallyCappedCrowdsale, StagedCrowdsale

Nevertheless, when I put the default value, 6700000, which is, by no coinscidence, less than Ganache's block gas limit, both transactions passed.

Try putting a value less than your target blockchain's limit.

Ropsten has lower gas limit - around 4.7M and you can't set it yourself, since it's a public testnet. Gas limit value that you put in your settings can't override the blockchain's gas limit. You can try Rinkeby - it has 7693375, check the number at the top of the stats page: https://www.rinkeby.io/#stats

Check this related question: Is there a reason Ropsten doesn't have the same block gas limit as mainnet?

Ropsten has lower gas limit - around 4.7M and you can't set it yourself, since it's a public testnet. Gas limit value that you put in your settings can't override the blockchain's gas limit. You can try Rinkeby - it has 7693375, check the number at the top of the stats page: https://www.rinkeby.io/#stats

Check this related question: Is there a reason Ropsten doesn't have the same block gas limit as mainnet?

I tried running your deploy with Ganache v6.1.8, default gas limit 6721975, but it didn't even deploy the token:

truffle migrate --reset --network development
Using network 'development'.

Running migration: 1_deploy.js
Deploying Token:
        Name            : Sportist
        Symbol          : S
        Decimals        : 6
        Cap             : 10000000000000000
  Deploying Token...
  ... undefined
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: Exceeds block gas limit

You don't have to inherit every conract in OpenZeppelin's collection, your crowdsale contract is clearly too big:

contract TokenCrowdsale is AllowanceCrowdsale, RefundableCrowdsale, IndividuallyCappedCrowdsale, StagedCrowdsale

Nevertheless, when I put the default value, 6700000, which is, by no coinscidence, less than Ganache's block gas limit, both transactions passed.

Try putting a value less than your target blockchain's limit.

Source Link
Utgarda
  • 801
  • 7
  • 20

Ropsten has lower gas limit - around 4.7M and you can't set it yourself, since it's a public testnet. Gas limit value that you put in your settings can't override the blockchain's gas limit. You can try Rinkeby - it has 7693375, check the number at the top of the stats page: https://www.rinkeby.io/#stats

Check this related question: Is there a reason Ropsten doesn't have the same block gas limit as mainnet?