Skip to content

Commit

Permalink
Merge pull request #1424 from danhper/ganache-unlimited-contract-size
Browse files Browse the repository at this point in the history
Allow to use unlimited contract size with ganache-cli
  • Loading branch information
iamdefinitelyahuman authored Feb 8, 2022
2 parents d4dbcc2 + 46f315a commit 567ecdb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
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

0 comments on commit 567ecdb

Please sign in to comment.