I am deploying my contract using web3 by taking values (just copy paste) from Etherscan (i.e. abi, contract creation code, etc.) and then deploy my contract on Ganache (gui). When i run the my code through node deploy.js
following error displayed (However, on Ganache GUI, that command shows that my contract has been deployed and also shows its address).
Here is my code:
async function deployWithCreationCode(){
var contract = new web3.eth.Contract(abi);
var dc = await contract.deploy({data: crCode})
.send({
from: account1,
gas: 6721975, // i cannot assign more gas above gas limit of ganache... is it possible to increase this limit.... ?
gasPrice: '30000000'
});
return dc._address;
}
Here is my error:
UnhandledPromiseRejectionWarning: Error: Returned error: VM Exception while processing transaction: out of gas
Note: If size of my contract creation code is less, then no error at all.