ape-config.yaml file allows you to configure ape. This guide serves as an index of the settings you can include
Specify a different path to your
This is useful when using a different naming convention, such as
src/ rather than
You can also use an absolute path. This is useful for projects that compile contracts outside their directory.
You can change the default ecosystem by including the following:
The default ecosystem is
Configure dependencies for your ape project.
Ape downloads and caches dependencies in the
.ape/packages/<name>/<version-id> directory where
<name> refers to the name of the dependency and
<version-id> refers to the version or branch of the package.
dependencies: - name: OpenZeppelin github: OpenZeppelin/openzeppelin-contracts version: 4.4.2
will download the Open Zeppelin package with version
version: config first attempts to use an official GitHub release, but if the release is not found, it will check the release tags.
If you know the version is not available as an official release, bypass the original check by using the
ref: key is also used for installing branches.
For example, to install a version available as a
git tag, do the following:
dependencies: - name: Uniswap github: Uniswap/v3-core ref: v1.0.0
ref: config installs the code from that reference; the
version: config uses the official GitHub release API, and then only if that fails will it check the
Often times, the
v prefix is required when using tags.
However, if cloning the tag fails,
ape will retry with a
Bypass the original failing attempt by including a
v in your dependency config.
To ignore files from a dependency project, use the
exclude setting to specify glob patterns:
dependencies: - name: dependency-project-name github: org-name/dependency-project-name exclude: - package.json # Ignore package.json files. - mocks/**/* # Ignore all files in the 'mocks' directory
To use dependencies in the
ape-solidity plugin, configure
solidity: import_remapping: - "@openzeppelin=OpenZeppelin/4.4.2"
Now, in your solidity files, import
OpenZeppelin sources via:
You can also set the name of the dependency’s contracts folder, e.g.:
dependencies: - name: DappToolsERC20 github: dapphub/erc20 ref: dappnix contracts_folder: src
You can also use local dependencies:
dependencies: - name: MyDependency local: local/path/to/MyDependency contracts_folder: src/contracts
This is helpful when:
Working on multiple packages at once
When there is not a suitable
DependencyAPIimplementation available for downloading your dependency
Share import deployments to public networks with your teammates:
deployments: ethereum: mainnet: - contract_type: MyContract address: 0xc123aAacCcbBbaAa444777000111222111222111 ropsten: - contract_type: MyContract address: 0xc222000cCcbBbaAa444777000111222111222222
When using the
geth provider, you can customize its settings.
For example, to change the URI for an Ethereum network, do:
geth: ethereum: mainnet: uri: http://localhost:5030
Set default network and network providers:
ethereum: default_network: mainnet-fork mainnet_fork: default_provider: hardhat
Set the gas limit for a given network:
ethereum: default_network: mainnet-fork mainnet_fork: gas_limit: max
You may use one of:
"auto"- gas limit is estimated for each transaction
"max"- the maximum block gas limit is used
A number or numeric string, base 10 or 16 (e.g.
For the local network configuration, the default is
"max". Otherwise it is
Set which plugins you want to always use:
plugins: - name: solidity version: 0.1.0b2 - name: ens
Install these plugins by running command:
ape plugins install
Configure your test accounts:
test: mnemonic: test test test test test test test test test test test junk number_of_accounts: 5