Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to use unlimited contract size with ganache-cli #1424

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Allow to override EVM version per language
- Add support for Ganache 7 CLI flags
- Support Ganache unlimited contract size

### Changed
- Force files to be opened as UTF-8
Expand Down
1 change: 1 addition & 0 deletions brownie/_cli/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"time",
"network_id",
"chain_id",
"unlimited_contract_size",
)


Expand Down
7 changes: 6 additions & 1 deletion brownie/network/rpc/ganache.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"unlock": "--wallet.unlockedAccounts",
"network_id": "--chain.networkId",
"chain_id": "--chain.chainId",
"unlimited_contract_size": "--chain.allowUnlimitedContractSize",
},
"<=6": {
"port": "--port",
Expand All @@ -46,6 +47,7 @@
"unlock": "--unlock",
"network_id": "--networkId",
"chain_id": "--chainId",
"unlimited_contract_size": "--allowUnlimitedContractSize",
},
}

Expand Down Expand Up @@ -85,7 +87,10 @@ def launch(cmd: str, **kwargs: Dict) -> None:
cmd_list.extend([cli_flags[key], address])
else:
try:
cmd_list.extend([cli_flags[key], str(value)])
if value is True:
cmd_list.append(cli_flags[key])
elif value is not False:
cmd_list.extend([cli_flags[key], str(value)])
except KeyError:
warnings.warn(
f"Ignoring invalid commandline setting for ganache-cli: "
Expand Down
1 change: 1 addition & 0 deletions docs/network-management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ The following optional fields may be given for development networks, which are p
* ``default_balance``: The starting balance for all unlocked accounts. Can be given as unit string like "1000 ether" or "50 gwei" or as an number **in Ether**. Will default to 100 ether.
* ``time``: Date (ISO 8601) that the first block should start. Use this feature, along with :func:`Chain.sleep <Chain.sleep>` to test time-dependent code. Defaults to the current time.
* ``unlock``: A single address or a list of addresses to unlock. These accounts are added to the :func:`Accounts <brownie.network.account.Accounts>` container and can be used as if the private key is known. Also works in combination with ``fork`` to send transactions from any account.
* ``unlimited_contract_size``: Allows deployed contracts to be over the maximum limit of 24675 bytes. The value should be either `true` or `false`.

.. note::
These optional commandline fields can also be specified on a project level in the project's ``brownie-config.yaml`` file. See the :ref:`configuration files<config>`.
Expand Down