Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Sep 20, 2023
1 parent 0171b6b commit 2c9b612
Show file tree
Hide file tree
Showing 204 changed files with 31,323 additions and 24 deletions.
2 changes: 1 addition & 1 deletion stable/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: c4c95852eed38ce1d0d6184ed26a985a
config: 45f58e762353980e2cd490136ee45c78
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file modified stable/.doctrees/commands/console.doctree
Binary file not shown.
Binary file modified stable/.doctrees/commands/networks.doctree
Binary file not shown.
Binary file modified stable/.doctrees/commands/pm.doctree
Binary file not shown.
Binary file modified stable/.doctrees/environment.pickle
Binary file not shown.
Binary file modified stable/.doctrees/methoddocs/ape.doctree
Binary file not shown.
Binary file modified stable/.doctrees/methoddocs/api.doctree
Binary file not shown.
Binary file modified stable/.doctrees/methoddocs/cli.doctree
Binary file not shown.
Binary file modified stable/.doctrees/methoddocs/contracts.doctree
Binary file not shown.
Binary file modified stable/.doctrees/methoddocs/exceptions.doctree
Binary file not shown.
Binary file modified stable/.doctrees/methoddocs/managers.doctree
Binary file not shown.
Binary file modified stable/.doctrees/methoddocs/plugins.doctree
Binary file not shown.
Binary file modified stable/.doctrees/methoddocs/types.doctree
Binary file not shown.
Binary file modified stable/.doctrees/methoddocs/utils.doctree
Binary file not shown.
Binary file modified stable/.doctrees/userguides/contracts.doctree
Binary file not shown.
Binary file modified stable/.doctrees/userguides/dependencies.doctree
Binary file not shown.
60 changes: 60 additions & 0 deletions stable/_sources/userguides/contracts.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,32 @@ from ape import Contract
contract = Contract("v2.registry.ychad.eth")
```

## From ABIs

You can load contracts using their ABIs:

```python
from ape import Contract

address = "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45"

# Using a JSON str:
contract = Contract(
address, abi='[{"name":"foo","type":"fallback", "stateMutability":"nonpayable"}]'
)

# Using a JSON file path:
contract = Contract(address, abi="abi.json")

# Using a Python dictionary from JSON:
contract = Contract(
address,
abi=[{"name":"foo","type":"fallback", "stateMutability":"nonpayable"}]
)
```

This will create the Contract instance from the given ABI.

## From Previous Deployment

Ape keeps track of your deployments for you so you can always refer back to a version that you deployed previously.
Expand Down Expand Up @@ -224,3 +250,37 @@ contract = ape.Contract("0x...")
bytes_value = contract.encode_input(0, 1, 2, 4, 5)
method_id, input_dict = contract.decode_input(bytes_value)
```

## Multi-Call and Multi-Transaction

The `ape_ethereum` core plugin comes with a `multicall` module containing tools for interacting with the [multicall3 smart contract](https://github.com/mds1/multicall).
Multicall allows you to group function calls and transactions into a single call or transaction.

Here is an example of how you can use the multicall module:

```python
import ape
from ape_ethereum import multicall


ADDRESSES = ("0xF4b8A02D4e8D76070bD7092B54D2cBbe90fa72e9", "0x80067013d7F7aF4e86b3890489AcAFe79F31a4Cb")
POOLS = [ape.project.IPool.at(a) for a in ADDRESSES]


def main():
# Use multi-call.
call = multicall.Call()
for pool in POOLS:
call.add(pool.getReserves)

print(list(call()))

# Use multi-transaction.
tx = multicall.Transaction()
for pool in POOLS:
tx.add(pool.ApplyDiscount, 123)

acct = ape.accounts.load("signer")
for result in tx(sender=acct):
print(result)
```
23 changes: 23 additions & 0 deletions stable/_sources/userguides/dependencies.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,29 @@ For `npm` dependencies, you use an `npm:` prefix.
For local dependencies, you give it a path to the local dependency.
`--version` is not required when using a local dependency.

### remove

Remove previously installed packages using the `remove` command:

```shell
ape pm remove OpenZeppelin
```

If there is a single version installed, the command will remove the single version.
If multiple versions are installed, pass additional arguments specifying the version(s) to be removed:

```shell
ape pm remove OpenZeppelin 4.5.0 4.6.0
```

To skip the confirmation prompts, use the `--yes` flag (abbreviated as `-y`):

```shell
ape pm remove OpenZeppelin all --yes
```

**NOTE**: Additionally, use the `all` special version key to delete all versions.

### compile

Dependencies are not compiled when they are installed.
Expand Down
1 change: 1 addition & 0 deletions stable/commands/accounts.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<option value="">Select version...</option>
<option value="latest">latest</option>
<option value="stable">stable</option>
<option value="v0.6.19">v0.6.19</option>
<option value="v0.6.18">v0.6.18</option>
<option value="v0.6.17">v0.6.17</option>
<option value="v0.6.16">v0.6.16</option>
Expand Down
1 change: 1 addition & 0 deletions stable/commands/compile.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<option value="">Select version...</option>
<option value="latest">latest</option>
<option value="stable">stable</option>
<option value="v0.6.19">v0.6.19</option>
<option value="v0.6.18">v0.6.18</option>
<option value="v0.6.17">v0.6.17</option>
<option value="v0.6.16">v0.6.16</option>
Expand Down
3 changes: 2 additions & 1 deletion stable/commands/console.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<option value="">Select version...</option>
<option value="latest">latest</option>
<option value="stable">stable</option>
<option value="v0.6.19">v0.6.19</option>
<option value="v0.6.18">v0.6.18</option>
<option value="v0.6.17">v0.6.17</option>
<option value="v0.6.16">v0.6.16</option>
Expand Down Expand Up @@ -208,7 +209,7 @@ <h2>console<a class="headerlink" href="#console" title="Permalink to this headin
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">ethereum</span></code></p>
</dd>
<dt class="field-even">Options<span class="colon">:</span></dt>
<dd class="field-even"><p>:mainnet:geth | ethereum:mainnet:geth | :mainnet | ethereum:mainnet | :goerli:geth | ethereum:goerli:geth | :goerli | ethereum:goerli | :sepolia:geth | ethereum:sepolia:geth | :sepolia | ethereum:sepolia | ::test | ethereum:local:test | ::geth | ethereum:local:geth | :local | ethereum:local | ethereum</p>
<dd class="field-even"><p>:mainnet:geth | ethereum:mainnet:geth | :mainnet | ethereum:mainnet | :goerli:geth | ethereum:goerli:geth | :goerli | ethereum:goerli | :sepolia:geth | ethereum:sepolia:geth | :sepolia | ethereum:sepolia | ::geth | ethereum:local:geth | ::test | ethereum:local:test | :local | ethereum:local | ethereum</p>
</dd>
</dl>
</dd></dl>
Expand Down
1 change: 1 addition & 0 deletions stable/commands/init.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<option value="">Select version...</option>
<option value="latest">latest</option>
<option value="stable">stable</option>
<option value="v0.6.19">v0.6.19</option>
<option value="v0.6.18">v0.6.18</option>
<option value="v0.6.17">v0.6.17</option>
<option value="v0.6.16">v0.6.16</option>
Expand Down
5 changes: 3 additions & 2 deletions stable/commands/networks.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<option value="">Select version...</option>
<option value="latest">latest</option>
<option value="stable">stable</option>
<option value="v0.6.19">v0.6.19</option>
<option value="v0.6.18">v0.6.18</option>
<option value="v0.6.17">v0.6.17</option>
<option value="v0.6.16">v0.6.16</option>
Expand Down Expand Up @@ -237,7 +238,7 @@ <h2>list<a class="headerlink" href="#networks-list" title="Permalink to this hea
<dd><p>Filter the results by network</p>
<dl class="field-list simple">
<dt class="field-odd">Options<span class="colon">:</span></dt>
<dd class="field-odd"><p>goerli-fork | mainnet-fork | mainnet | local | sepolia-fork | sepolia | goerli</p>
<dd class="field-odd"><p>sepolia | mainnet-fork | local | sepolia-fork | mainnet | goerli-fork | goerli</p>
</dd>
</dl>
</dd></dl>
Expand Down Expand Up @@ -276,7 +277,7 @@ <h2>run<a class="headerlink" href="#networks-run" title="Permalink to this headi
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">ethereum:local:geth</span></code></p>
</dd>
<dt class="field-even">Options<span class="colon">:</span></dt>
<dd class="field-even"><p>:mainnet:geth | ethereum:mainnet:geth | :mainnet | ethereum:mainnet | :goerli:geth | ethereum:goerli:geth | :goerli | ethereum:goerli | :sepolia:geth | ethereum:sepolia:geth | :sepolia | ethereum:sepolia | ::test | ethereum:local:test | ::geth | ethereum:local:geth | :local | ethereum:local | ethereum</p>
<dd class="field-even"><p>:mainnet:geth | ethereum:mainnet:geth | :mainnet | ethereum:mainnet | :goerli:geth | ethereum:goerli:geth | :goerli | ethereum:goerli | :sepolia:geth | ethereum:sepolia:geth | :sepolia | ethereum:sepolia | ::geth | ethereum:local:geth | ::test | ethereum:local:test | :local | ethereum:local | ethereum</p>
</dd>
</dl>
</dd></dl>
Expand Down
1 change: 1 addition & 0 deletions stable/commands/plugins.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<option value="">Select version...</option>
<option value="latest">latest</option>
<option value="stable">stable</option>
<option value="v0.6.19">v0.6.19</option>
<option value="v0.6.18">v0.6.18</option>
<option value="v0.6.17">v0.6.17</option>
<option value="v0.6.16">v0.6.16</option>
Expand Down
45 changes: 45 additions & 0 deletions stable/commands/pm.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<option value="">Select version...</option>
<option value="latest">latest</option>
<option value="stable">stable</option>
<option value="v0.6.19">v0.6.19</option>
<option value="v0.6.18">v0.6.18</option>
<option value="v0.6.17">v0.6.17</option>
<option value="v0.6.16">v0.6.16</option>
Expand Down Expand Up @@ -146,6 +147,7 @@
<li class="toctree-l2"><a class="reference internal" href="#pm-compile">compile</a></li>
<li class="toctree-l2"><a class="reference internal" href="#pm-install">install</a></li>
<li class="toctree-l2"><a class="reference internal" href="#pm-list">list</a></li>
<li class="toctree-l2"><a class="reference internal" href="#pm-remove">remove</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="console.html">console</a></li>
Expand Down Expand Up @@ -295,6 +297,49 @@ <h2>list<a class="headerlink" href="#pm-list" title="Permalink to this heading">
<dd><p>Include packages not referenced by the local project</p>
</dd></dl>

</section>
<section id="pm-remove">
<h2>remove<a class="headerlink" href="#pm-remove" title="Permalink to this heading"></a></h2>
<p>Remove a package</p>
<p>This command removes a package from the installed packages.</p>
<p>If specific versions are provided, only those versions of the package will be
removed. If no versions are provided, the command will prompt you to choose
versions to remove. You can also choose to remove all versions of the package.</p>
<p>Examples:</p>
<ul class="simple">
<li><p>Remove specific versions: ape pm remove &lt;PackageName&gt; “1.0.0” “2.0.0”</p></li>
<li><p>Prompt to choose versions: ape pm remove &lt;PackageName&gt;</p></li>
<li><p>Remove all versions: ape pm remove &lt;PackageName&gt; -y</p></li>
</ul>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>pm<span class="w"> </span>remove<span class="w"> </span><span class="o">[</span>OPTIONS<span class="o">]</span><span class="w"> </span>PACKAGE<span class="w"> </span><span class="o">[</span>VERSIONS<span class="o">]</span>...
</pre></div>
</div>
<p class="rubric">Options</p>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-pm-remove-v">
<span id="cmdoption-pm-remove-verbosity"></span><span class="sig-name descname"><span class="pre">-v</span></span><span class="sig-prename descclassname"></span><span class="sig-prename descclassname"><span class="pre">,</span> </span><span class="sig-name descname"><span class="pre">--verbosity</span></span><span class="sig-prename descclassname"> <span class="pre">&lt;LVL&gt;</span></span><a class="headerlink" href="#cmdoption-pm-remove-v" title="Permalink to this definition"></a></dt>
<dd><p>One of ERROR, WARNING, SUCCESS, INFO, or DEBUG</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-pm-remove-y">
<span id="cmdoption-pm-remove-yes"></span><span class="sig-name descname"><span class="pre">-y</span></span><span class="sig-prename descclassname"></span><span class="sig-prename descclassname"><span class="pre">,</span> </span><span class="sig-name descname"><span class="pre">--yes</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-pm-remove-y" title="Permalink to this definition"></a></dt>
<dd><p>Automatically confirm the removal of the package(s)</p>
</dd></dl>

<p class="rubric">Arguments</p>
<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-pm-remove-arg-PACKAGE">
<span id="cmdoption-pm-remove-arg-package"></span><span class="sig-name descname"><span class="pre">PACKAGE</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-pm-remove-arg-PACKAGE" title="Permalink to this definition"></a></dt>
<dd><p>Required argument</p>
</dd></dl>

<dl class="std option">
<dt class="sig sig-object std" id="cmdoption-pm-remove-arg-VERSIONS">
<span id="cmdoption-pm-remove-arg-versions"></span><span class="sig-name descname"><span class="pre">VERSIONS</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-pm-remove-arg-VERSIONS" title="Permalink to this definition"></a></dt>
<dd><p>Optional argument(s)</p>
</dd></dl>

</section>
</section>

Expand Down
1 change: 1 addition & 0 deletions stable/commands/run.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<option value="">Select version...</option>
<option value="latest">latest</option>
<option value="stable">stable</option>
<option value="v0.6.19">v0.6.19</option>
<option value="v0.6.18">v0.6.18</option>
<option value="v0.6.17">v0.6.17</option>
<option value="v0.6.16">v0.6.16</option>
Expand Down
1 change: 1 addition & 0 deletions stable/commands/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<option value="">Select version...</option>
<option value="latest">latest</option>
<option value="stable">stable</option>
<option value="v0.6.19">v0.6.19</option>
<option value="v0.6.18">v0.6.18</option>
<option value="v0.6.17">v0.6.17</option>
<option value="v0.6.16">v0.6.16</option>
Expand Down
41 changes: 39 additions & 2 deletions stable/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<option value="">Select version...</option>
<option value="latest">latest</option>
<option value="stable">stable</option>
<option value="v0.6.19">v0.6.19</option>
<option value="v0.6.18">v0.6.18</option>
<option value="v0.6.17">v0.6.17</option>
<option value="v0.6.16">v0.6.16</option>
Expand Down Expand Up @@ -380,6 +381,8 @@ <h2 id="Symbols">Symbols</h2>
<li><a href="commands/pm.html#cmdoption-pm-install-v">pm-install command line option</a>
</li>
<li><a href="commands/pm.html#cmdoption-pm-list-v">pm-list command line option</a>
</li>
<li><a href="commands/pm.html#cmdoption-pm-remove-v">pm-remove command line option</a>
</li>
<li><a href="commands/test.html#cmdoption-test-v">test command line option</a>
</li>
Expand Down Expand Up @@ -430,6 +433,8 @@ <h2 id="Symbols">Symbols</h2>
<li><a href="commands/plugins.html#cmdoption-plugins-install-y">plugins-install command line option</a>
</li>
<li><a href="commands/plugins.html#cmdoption-plugins-uninstall-y">plugins-uninstall command line option</a>
</li>
<li><a href="commands/pm.html#cmdoption-pm-remove-y">pm-remove command line option</a>
</li>
</ul></li>
<li>
Expand Down Expand Up @@ -508,6 +513,8 @@ <h2 id="Symbols">Symbols</h2>
<li><a href="commands/pm.html#cmdoption-pm-install-v">pm-install command line option</a>
</li>
<li><a href="commands/pm.html#cmdoption-pm-list-v">pm-list command line option</a>
</li>
<li><a href="commands/pm.html#cmdoption-pm-remove-v">pm-remove command line option</a>
</li>
<li><a href="commands/test.html#cmdoption-test-v">test command line option</a>
</li>
Expand All @@ -526,6 +533,8 @@ <h2 id="Symbols">Symbols</h2>
<li><a href="commands/plugins.html#cmdoption-plugins-install-y">plugins-install command line option</a>
</li>
<li><a href="commands/plugins.html#cmdoption-plugins-uninstall-y">plugins-uninstall command line option</a>
</li>
<li><a href="commands/pm.html#cmdoption-pm-remove-y">pm-remove command line option</a>
</li>
</ul></li>
</ul></td>
Expand Down Expand Up @@ -1139,6 +1148,8 @@ <h2 id="B">B</h2>
<li><a href="methoddocs/managers.html#ape.managers.chain.ChainManager.base_fee">(ape.managers.chain.ChainManager property)</a>
</li>
</ul></li>
<li><a href="methoddocs/api.html#ape.api.networks.NetworkAPI.base_fee_multiplier">base_fee_multiplier (ape.api.networks.NetworkAPI property)</a>
</li>
<li><a href="methoddocs/api.html#ape.api.address.BaseAddress">BaseAddress (class in ape.api.address)</a>
</li>
<li><a href="methoddocs/types.html#ape.types.BaseContractLog">BaseContractLog (class in ape.types)</a>
Expand Down Expand Up @@ -2248,6 +2259,8 @@ <h2 id="P">P</h2>

<ul>
<li><a href="commands/pm.html#cmdoption-pm-install-arg-PACKAGE">pm-install command line option</a>
</li>
<li><a href="commands/pm.html#cmdoption-pm-remove-arg-PACKAGE">pm-remove command line option</a>
</li>
</ul></li>
<li><a href="methoddocs/managers.html#ape.managers.networks.NetworkManager.parse_network_choice">parse_network_choice() (ape.managers.networks.NetworkManager method)</a>
Expand Down Expand Up @@ -2379,6 +2392,23 @@ <h2 id="P">P</h2>
<li><a href="commands/pm.html#cmdoption-pm-list-v">--verbosity</a>
</li>
<li><a href="commands/pm.html#cmdoption-pm-list-v">-v</a>
</li>
</ul></li>
<li>
pm-remove command line option

<ul>
<li><a href="commands/pm.html#cmdoption-pm-remove-v">--verbosity</a>
</li>
<li><a href="commands/pm.html#cmdoption-pm-remove-y">--yes</a>
</li>
<li><a href="commands/pm.html#cmdoption-pm-remove-v">-v</a>
</li>
<li><a href="commands/pm.html#cmdoption-pm-remove-y">-y</a>
</li>
<li><a href="commands/pm.html#cmdoption-pm-remove-arg-PACKAGE">PACKAGE</a>
</li>
<li><a href="commands/pm.html#cmdoption-pm-remove-arg-VERSIONS">VERSIONS</a>
</li>
</ul></li>
<li><a href="methoddocs/managers.html#ape.managers.chain.BlockContainer.poll_blocks">poll_blocks() (ape.managers.chain.BlockContainer method)</a>
Expand Down Expand Up @@ -2838,10 +2868,10 @@ <h2 id="V">V</h2>
<li><a href="methoddocs/types.html#ape.types.signatures.SignableMessage.version">(ape.types.signatures.SignableMessage attribute)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="methoddocs/managers.html#ape.managers.project.dependency.NpmDependency.version_from_json">version_from_json (ape.managers.project.dependency.NpmDependency property)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="methoddocs/managers.html#ape.managers.project.dependency.NpmDependency.version_from_local_json">version_from_local_json (ape.managers.project.dependency.NpmDependency property)</a>
</li>
<li><a href="methoddocs/api.html#ape.api.projects.DependencyAPI.version_id">version_id (ape.api.projects.DependencyAPI property)</a>
Expand All @@ -2852,6 +2882,13 @@ <h2 id="V">V</h2>
<li><a href="methoddocs/managers.html#ape.managers.project.dependency.LocalDependency.version_id">(ape.managers.project.dependency.LocalDependency property)</a>
</li>
<li><a href="methoddocs/managers.html#ape.managers.project.dependency.NpmDependency.version_id">(ape.managers.project.dependency.NpmDependency property)</a>
</li>
</ul></li>
<li>
VERSIONS

<ul>
<li><a href="commands/pm.html#cmdoption-pm-remove-arg-VERSIONS">pm-remove command line option</a>
</li>
</ul></li>
<li><a href="methoddocs/exceptions.html#ape.exceptions.VirtualMachineError">VirtualMachineError</a>
Expand Down
1 change: 1 addition & 0 deletions stable/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<option value="">Select version...</option>
<option value="latest">latest</option>
<option value="stable">stable</option>
<option value="v0.6.19">v0.6.19</option>
<option value="v0.6.18">v0.6.18</option>
<option value="v0.6.17">v0.6.17</option>
<option value="v0.6.16">v0.6.16</option>
Expand Down
Loading

0 comments on commit 2c9b612

Please sign in to comment.