Cannot deploy on rinkeby network using truffle - ethereum

I'm trying to deploy simple crowdsale coin on the rinkeby test network. I'm using https://github.com/gustavoguimaraes/my-ico as template, where my code is at https://github.com/nmiculinic/shitcoin ; master commit; hash 599edc5d5a7d1c614d64fb43f96e19bdab9e8252
However I'm unable to get this simple coin deployed to the rinkeby test network (nor the gustav's one for that matter) with the following error:
shitcoin (master) ✔ truffle migrate --reset --network rinkeby
Compiling ./contracts/Shitcoin.sol...
Compiling zeppelin-solidity/contracts/math/SafeMath.sol...
Compiling zeppelin-solidity/contracts/ownership/Ownable.sol...
Compiling zeppelin-solidity/contracts/token/BasicToken.sol...
Compiling zeppelin-solidity/contracts/token/ERC20.sol...
Compiling zeppelin-solidity/contracts/token/ERC20Basic.sol...
Compiling zeppelin-solidity/contracts/token/MintableToken.sol...
Compiling zeppelin-solidity/contracts/token/StandardToken.sol...
Writing artifacts to ./build/contracts
Using network 'rinkeby'.
Running migration: 1_initial_migration.js
Replacing Migrations...
... 0x0bd42558d2daba72c886b369a492d1432397d9d617d14ce6655e1723b1d03058
Migrations: 0xb5b69afbaf45bdfb3e3fd73164259a6cd55d031a
Saving successful migration to network...
... 0xb3f5e8d87729e05b258fa97fda467d068e68c2903b60b8dc3989631c2e804262
Saving artifacts...
Running migration: 2_deploy_contracts.js
Deploying ShitCoinCrowdsale...
... 0x113fbb45883d804a6befe05d3fa9ef940ecc2ab02196abc830b5b994064e57cc
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: The contract code couldn't be stored, please check your gas amount.
at Object.callback (/usr/lib/node_modules/truffle/build/cli.bundled.js:222830:46)
at /usr/lib/node_modules/truffle/build/cli.bundled.js:35149:25
at /usr/lib/node_modules/truffle/build/cli.bundled.js:224768:9
at /usr/lib/node_modules/truffle/build/cli.bundled.js:66971:11
at /usr/lib/node_modules/truffle/build/cli.bundled.js:208348:9
at XMLHttpRequest.request.onreadystatechange (/usr/lib/node_modules/truffle/build/cli.bundled.js:209773:13)
at XMLHttpRequestEventTarget.dispatchEvent (/usr/lib/node_modules/truffle/build/cli.bundled.js:67130:18)
at XMLHttpRequest._setReadyState (/usr/lib/node_modules/truffle/build/cli.bundled.js:67420:12)
at XMLHttpRequest._onHttpResponseEnd (/usr/lib/node_modules/truffle/build/cli.bundled.js:67575:12)
at IncomingMessage.<anonymous> (/usr/lib/node_modules/truffle/build/cli.bundled.js:67535:24)

Related

Deployment Failed: project ID does not have access to archive state

I am trying to deploy my smart contract code in Infura using truffle, but this error has been raised
Deploying 'Migrations'
----------------------
Error: *** Deployment Failed ***
"Migrations" -- Unknown Error: {"jsonrpc":"2.0","id":6,"error": {"code":-32002,"message":"project ID does not have access to archive state","data":{"see":"https://infura.io/dashboard"}}}
{
"originalError": {}
}.
Any help
Thanks
It is weird.
I think it works if I skip the dry-run. But not sure why kovan-fork is not working. It was working yesterday.
You can change the network as you want
truffle migrate --network kovan --reset --skip-dry-run

Puppeteer Error: Failed to launch the browser process when run in Google Cloud Function

I have function tracking use Cloud Scheduler run every min, every day deploy in Google Cloud Function.
In this function, I have use puppeteer and mostly function tracking run very well but sometimes, my functions have an error
Error: Failed to launch the browser process!
[0220/073301.661396:ERROR:address_tracker_linux.cc(201)] Could not bind NETLINK socket: Permission denied (13)
[0220/073301.661935:ERROR:file_path_watcher_linux.cc(71)] Failed to read /proc/sys/fs/inotify/max_user_watches
Inconsistency detected by ld.so: ../elf/dl-tls.c: 481: _dl_allocate_tls_init: Assertion `listp->slotinfo[cnt].gen <= GL(dl_tls_generation)' failed!
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md
at onClose (/srv/node_modules/puppeteer/lib/Launcher.js:750:14)
at ChildProcess.helper.addEventListener (/srv/node_modules/puppeteer/lib/Launcher.js:740:61)
at emitTwo (events.js:131:20)
at ChildProcess.emit (events.js:214:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
This is the frequency of errors
Puppeteer version: v2.0.0 and update newest v2.1.1 yesterday
Platform/ OS version: Google Cloud Function
Node.js version: 8
I searched for all the issues of puppeteer but unsolvable my case. Please help me
Thankyou
You need to downgrade your puppeteer version to 2.0.0, it's looks like if there is something which make failed puppeteer when you deploy your app.
You can check
https://github.com/puppeteer/puppeteer/issues/5379#issuecomment-587185091
For elastic beanstalk worked for me by downgrade puppeteer version.

Private Ethereum : Got error (Transaction was not mined within 750 seconds) when saving migration to chain on a private Ethereum network

I tried to migrate the contract Migrations by using Truffle migrate, it got hang and show error message as belows. Please help me if I configured anything wrong.
⠸ Saving migration to chain. {
"jsonrpc": "2.0",
"id": 1574154369501,
"result": "0x"
}
Error: Error: Error: Transaction was not mined within 750 seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!
at Object.run (/usr/local/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:92:1)
at
at process._tickCallback (internal/process/next_tick.js:188:7)
Truffle v5.1.0 (core: 5.1.0)
Node v8.10.0
This problem was fixed. The root cause was an environment. At the first time I ran this on VirtualBox Ubantu. The performance was quite slow. Then I tried to run on Host Windows. It's fast and worked.

Migration 2_deploy_contracts invalid or does not take any parameters at Object.run()

I am trying to compile my smart contracts using truffle pet-shop. I have the following contract in directory election/contracts/election.sol ;
pragma solidity >=0.4.0 <0.6.0;
contract Election{
string public candidate;
constructor() public{
candidate="Zeeshan";
}
}
The migration file to deploy contracts in directory election/migrations/2_deploy_contracts1.js is as follows;
var Election1=artifacts.require("election.sol");
module.export=function(deployer){
deployer.deploy(Election1)
};
I am using the following command to migrate the contracts:
truffle migrate
And I am getting the following results:
Compiling your contracts...
===========================
> Compiling .\contracts\Election.sol
> Compiling .\contracts\election.sol
> Artifacts written to D:\Notes\BCS\Semester 8\FYP\Practise Coding\dapp university 2 hr video code\election\build\contracts
> Compiled successfully using:
- solc: 0.5.8+commit.23d335f2.Emscripten.clang
Starting migrations...
======================
> Network name: 'development'
> Network id: 5777
> Block gas limit: 0x6691b7
2_deploy_contracts1.js
======================
Error: Error: Migration D:\Notes\BCS\Semester 8\FYP\Practise Coding\dapp university 2 hr video code\election\migrations\2_deploy_contracts1.js invalid or does not take any parameters
at Object.run (C:\Users\mk141\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-migrate\index.js:92:1)
at process._tickCallback (internal/process/next_tick.js:68:7)
Truffle v5.0.30 (core: 5.0.30)
Node v10.16.1
Its also compiling Election.sol because I renamed election.sol to Election.sol and it stores election.sol in cache perhaps.
As you can see above its giving Error:Migration 2_deploy_contracts invalid or does not take any parameters at Object.run() and i don't know how to resolve it.
I was making a mistake in 2_deploy_contracts1.js file. There is module.exports instead of module.export. So the new 2_deploy_contracts1.js file will be;
var Election1=artifacts.require("election.sol");
module.exports=function(deployer){
deployer.deploy(Election1)
};
Also, I was using the following command to migrate again;
truffle migrate
Instead, I should use the following command if I am migrating again;
truffle migrate --reset
We use this command because we already migrated our smart contracts in the built folder. This command will remove all previously migrated files in the built folder and add new migrated files of smart contracts.
In the require function you need to check the name of your contract like Election.sol and check for any typos

Error migrating truffle rinkeby [Cannot read property 'bind' of undefined]

I'm trying to deploy/migrate contract to rinkeby network, while using command:
truffle deploy --reset --network=rinkeby
It loads the keys and afterwards throws error:
C:\Users\marti\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\truffle-provider\wrapper.js:26
var originalSendAsync = provider.sendAsync.bind(provider);
TypeError: Cannot read property 'bind' of undefined
I'm able to run truffle develop without any issues
I'm also using:
truffle-hdwallet-provider
zappelin-solidity
Okay so the issue was comming from the truffle-hdwallet-provider version.
changing the ver from : 1.0.0-web3one.2
to : 0.0.6
solved the issue