StephenGrider / EthereumCasts

Companion repo to an Ethereum/Solidity course on Udemy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to store contract code caused by an HDWalletProvider issue with node deployment

scasplte2 opened this issue · comments

Kept receiving the error "UnhandledPromiseRejectionWarning: Error: The contract code couldn't be stored, please check your gas limit" when trying to deploy the Inbox contract with node.

Seems there is some sort of issue with the HDWalletProvider 0.0.5, as documented here
https://stackoverflow.com/questions/50201353/unhandledpromiserejectionwarning-error-the-contract-code-couldnt-be-stored-p

Following the instructions and installing 0.0.3 resolved the issue for me.

The other workaround to this issue (with HDWalletProvider 0.0.5) is to explicitly specify the contract bytecode is in hexadecimal format by prefixing the bytecode string with "0x". For example:

"0x" + bytecode

See discussion in https://ethereum.stackexchange.com/questions/47482/error-the-contract-code-couldnt-be-stored-please-check-your-gas-limit/

@aidanbon Thanks a lot man! "0x" + bytecode this did the trick!

Worked for me, too. Thanks @aidanbon :)