-
Notifications
You must be signed in to change notification settings - Fork 11.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The error "Error: The contract code couldn't be stored, please check your gas amount." shows up when deploying Crowdsale contract on Ropsten/Rinkeby. #984
Comments
Hello @sheraz104. Many things can cause this error, and it's generally misleading. Take a look at trufflesuite/truffle#522 |
https://vmexceptionwhileprocessingtransactionrevert.com/ may also help |
I've received this error as well when an abstract function was not implemented IIRC. |
@sheraz104 please provide more info (ideally also upload your full project to github so that we can see how the contracts are deployed). This is almost definitely an issue with your constructor arguments coming from the migration/deploy script. |
Hi, I have the same error message even when I changed the gas to 4700000 higher than default in truffle.js. The default "Migrations.sol" file is as follow:pragma solidity ^0.4.23; contract Migrations { modifier restricted() { function Migrations() public { function setCompleted(uint completed) public restricted { function upgrade(address new_address) public restricted {
|
After couple of attempts, found the information in "#358". By changing as per suggestion by spalladino in the deployment script: |
😆 awesome website @shrugs!!! I can see it in the short future as one of the most popular stack overflow answers. |
I'm unable to resolve the issue. |
@Sheraz-dev please upload your code to a github repo so that it's easier for people to use :) |
const HDWalletProvider = require('truffle-hdwallet-provider'); const provider = new HDWalletProvider( const web3 = new Web3(provider) const deploy = async()=>{ } |
same problem |
share your smart contract code |
I got the same problem but when i remove function calling inside my constructor it works fine. Why? |
@dhruv-karan . Try this in your deploy script. change these two lines from this. to this Your 1st Line Your 2nd Line |
@ymekuria |
Hi, I am having the same problem and not getting what is causing it, can anyone help me if I share the code? Thanks! |
@romisalve Sure. Please post on https://forum.openzeppelin.com. |
.deploy({data: '0x' + bytecode, arguments:['hi']}) // add 0x before bytecode |
Deleting the |
I've tried increasing gas to maximum, and tried debugging the code looking for potential issues to no avail. The contract deploy on ganache/TestRPC without an issue.
Could anyone help?
The text was updated successfully, but these errors were encountered: