EthereumCasts icon indicating copy to clipboard operation
EthereumCasts copied to clipboard

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

Open scasplte2 opened this issue 6 years ago • 3 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.

scasplte2 avatar May 31 '18 22:05 scasplte2

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 avatar Jun 01 '18 05:06 aidanbon

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

Sherry-94 avatar Aug 01 '18 21:08 Sherry-94

Worked for me, too. Thanks @aidanbon :)

dovuofficial avatar Aug 02 '18 14:08 dovuofficial