You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.
beta: {
provider: function() { //below coinbase account has much ETH.
return new HDWalletProviderPriv(['..privatekey...'], "http://127.0.0.1:8545/");
},
gas:6000000, //default 4712388
gasPrice:3000000000,
network_id: 1990
},
Logic.sol
pragma solidity ^0.5.0;
import "@openzeppelin/upgrades/contracts/Initializable.sol";
contract Logic is Initializable {
uint maxDeposit;
function initialize(uint _value) initializer public {
maxDeposit = _value;
}
function getMaxDeposit() public view returns(uint) {
return maxDeposit;
}
}
oz create and initialize
Fails with error: "The contract code couldn't be stored, please check your gas limit."
$ oz create
✓ Compiling contracts with Truffle, using settings from truffle.js file
Truffle output:
Compiling your contracts...
===========================
> Compiling ./contracts/Logic.sol
> Compiling ./contracts/Migrations.sol
> Compiling ./contracts/Test.sol
> Compiling @openzeppelin/upgrades/contracts/Initializable.sol
> Artifacts written to /Users/kimyong/workspace/blocery-mvp/truffle5/build/contracts
> Compiled successfully using:
- solc: 0.5.0+commit.1d4f565a.Emscripten.clang
? Pick a contract to instantiate Logic
? Pick a network beta
All contracts are up to date
? Do you want to call a function on the instance after creating it? Yes
? Select which function * initialize(_value: uint256)
? _value (uint256): 42
✖ Creating instance for contract at 0x07118daA8212e33DADC538ca61a4787883b6e4aa and calling 'initialize' with:
- _value (uint256): "42"
The contract code couldn't be stored, please check your gas limit.
oz create then oz send-tx to initialize succeeds
$ oz create --network beta
✓ Compiling contracts with Truffle, using settings from truffle.js file
Truffle output:
Compiling your contracts...
===========================
> Compiling ./contracts/Logic.sol
> Compiling ./contracts/Migrations.sol
> Compiling ./contracts/Test.sol
> Compiling @openzeppelin/upgrades/contracts/Initializable.sol
> Artifacts written to /Users/kimyong/workspace/blocery-mvp/truffle5/build/contracts
> Compiled successfully using:
- solc: 0.5.0+commit.1d4f565a.Emscripten.clang
? Pick a contract to instantiate Logic
All contracts are up to date
? Do you want to call a function on the instance after creating it? No
Possible initialization method (initialize) found in contract. Make sure you initialize your instance.
✓ Instance created at 0x5EA3A037454C7B4a3be2Eb32D54cB1DDbdE9F75e
0x5EA3A037454C7B4a3be2Eb32D54cB1DDbdE9F75e
$ oz send-tx --network beta
? Pick an instance Logic at 0x5EA3A037454C7B4a3be2Eb32D54cB1DDbdE9F75e
? Select which function * initialize(_value: uint256)
? _value (uint256): 50000
✓ Transaction successful. Transaction hash: 0x00e08a490c76342aa565fff18edc1a5048682fd4011e11bbec6cd13405c7c75a
The text was updated successfully, but these errors were encountered:
oz create
withinitialize
to private geth network fails with "The contract code couldn't be stored, please check your gas limit."Reported in the forum: https://forum.openzeppelin.com/t/openzeppelin-create-on-private-geth-check-your-gas-limit-error/1357
💻 Environment
Truffle.js
Logic.sol
oz create and initialize
Fails with error: "The contract code couldn't be stored, please check your gas limit."
oz create then oz send-tx to initialize succeeds
The text was updated successfully, but these errors were encountered: