Truffle v4 used to deploy the contract successfully, but Truffle v5 truffle migrate
command fails.
My process to deploy:
1) delete buidl/ folder
2) truffle compile
3) truffle migrate
Truffle v5
The error I get is:
Error: *** Deployment Failed ***
"ContractName" ran out of gas. Something in the constructor (ex: infinite loop)
caused gas estimation to fail. Try:
* Making your contract constructor more efficient
* Setting the gas manually in your config or as a deployment parameter
* Using the solc optimizer settings in 'truffle.js'
* Setting a higher network block limit if you are on a
private network or test client (like ganache).
at C:\Users\dziug\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-deployer\src\deployment.js:364:1
at process._tickCallback (internal/process/next_tick.js:68:7)
Truffle v5.0.0 (core: 5.0.0)
Node v10.4.0
My truffle-config.js looks like this:
module.exports = {
networks: {
development: {
host: 'localhost',
port: 8545,
network_id: '*',
compilers: {
solc: {
version: "^0.4.24",
optimizer: {
enabled: true,
runs: 200
}
}
}
Then I installed truffle v4 and tried to migrate the same contract:
1) npm uninstall -g truffle
2) npm install -g [email protected]
3) delete buidl/ folder
4) truffle compile
5) truffle migrate
And it works. I can deploy it on the rinkeby too.
Remix doesn't deploy it with
javascript VM: "creation of ContractName errored: transaction execution failed"
However, I can deploy it to Rinkeby through Remix
I need this contract to be deployed with truffle v5, because I will develop Solidity 0.5.* contracts that will communicate with the one I am trying to deploy right now, otherwise I won't be able to test with javascript.
The contract I am trying to deploy is: https://github.com/cryptocopycats/awesome-cryptokitties/tree/master/contracts
with couple fixes and additions. Contract starts from KittyCore.sol