Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Dec 9, 2024
1 parent ef03733 commit fa6eaac
Show file tree
Hide file tree
Showing 25 changed files with 37 additions and 11 deletions.
Binary file modified latest/.doctrees/commands/networks.doctree
Binary file not shown.
Binary file modified latest/.doctrees/environment.pickle
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/ape.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/ape_accounts.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/ape_compile.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/ape_ethereum.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/ape_node.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/ape_pm.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/ape_test.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/api.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/cli.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/contracts.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/exceptions.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/managers.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/plugins.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/types.doctree
Binary file not shown.
Binary file modified latest/.doctrees/methoddocs/utils.doctree
Binary file not shown.
Binary file modified latest/.doctrees/userguides/contracts.doctree
Binary file not shown.
13 changes: 12 additions & 1 deletion latest/_sources/userguides/contracts.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,18 @@ from ape import Contract
contract = Contract("0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45")
```

It will fetch the `contract-type` using the explorer plugin from the active network, such as [ape-etherscan](https://github.com/ApeWorX/ape-etherscan).
If the contract ABI and/or code is cached on disk or in memory (such as from a previous deploy or retrieval), it will use it.
Otherwise, it will fetch the `ContractType` using the explorer plugin from the active network, such as [ape-etherscan](https://github.com/ApeWorX/ape-etherscan).

To avoid fetching the contract from an explorer such as Etherscan, use `fetch_from_explorer=False`.

```python
from ape import Contract

contract = Contract("0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45", fetch_from_explorer=False)
```

This also avoids checking for an updated `ContractType` and forces Ape to only use types cached to disk or in memory.

If you have the [ENS plugin](https://github.com/ApeWorX/ape-ens) installed, you can use `.eth` domain names as the argument:

Expand Down
6 changes: 3 additions & 3 deletions latest/commands/networks.html
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ <h2>list<a class="headerlink" href="#networks-list" title="Link to this heading"
<dd><p>Filter the results by ecosystem</p>
<dl class="field-list simple">
<dt class="field-odd">Options<span class="colon">:</span></dt>
<dd class="field-odd"><p>rootstock | ethereum | zksync | shibarium | celo | oort | apechain | geist | gnosis | polynomial | world-chain | crossfi | base | taiko | soneium | avalanche | blast | polygon-zkevm | xai | optimism | bttc | abstract | polygon | linea | shape | zetachain | zora | lumia | wemix | unichain | lens | fraxtal | moonbeam | fantom | mantle | palm | cronos | kroma | metis | arbitrum | scroll | cronos-zkevm | xmtp | flow-evm | astar | berachain | bsc</p>
<dd class="field-odd"><p>celo | shape | xai | gnosis | astar | cronos-zkevm | polygon | arbitrum | fantom | zora | flow-evm | geist | palm | kroma | shibarium | taiko | world-chain | bttc | blast | soneium | lens | fraxtal | polygon-zkevm | zksync | avalanche | lumia | mantle | ethereum | polynomial | unichain | bsc | moonbeam | oort | wemix | apechain | abstract | cronos | xmtp | linea | scroll | rootstock | optimism | zetachain | base | metis | crossfi | berachain</p>
</dd>
</dl>
</dd></dl>
Expand All @@ -204,7 +204,7 @@ <h2>list<a class="headerlink" href="#networks-list" title="Link to this heading"
<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>nova-fork | alfajores | alfajores-fork | dev-fork | minato-fork | chiado | bartio-fork | mainnet-fork | fuji | donau-fork | local | cardona | moonbase-fork | mumbai-fork | minato | puppynet | dev | nova | puppynet-fork | curtis-fork | moonriver-fork | chiado-fork | mainnet | curtis | sepolia | goerli-fork | holesky | testnet | prism-fork | opbnb-fork | hekla | moonbase | testnet-fork | hekla-fork | polter | cardona-fork | fuji-fork | bartio | holesky-fork | polter-fork | prism | goerli | moonriver | opbnb-testnet | donau | amoy-fork | sepolia-fork | amoy | opbnb | opbnb-testnet-fork | mumbai</p>
<dd class="field-odd"><p>mumbai | moonbase-fork | opbnb-testnet-fork | testnet | chiado | hekla | minato-fork | donau-fork | donau | local | mainnet-fork | sepolia | curtis-fork | prism | curtis | puppynet-fork | holesky-fork | moonriver | mumbai-fork | minato | chiado-fork | opbnb-fork | goerli-fork | opbnb | dev-fork | sepolia-fork | alfajores | mainnet | fuji | cardona | alfajores-fork | moonriver-fork | amoy | polter | bartio | prism-fork | bartio-fork | cardona-fork | testnet-fork | nova-fork | amoy-fork | nova | holesky | hekla-fork | moonbase | opbnb-testnet | dev | puppynet | polter-fork | fuji-fork | goerli</p>
</dd>
</dl>
</dd></dl>
Expand All @@ -215,7 +215,7 @@ <h2>list<a class="headerlink" href="#networks-list" title="Link to this heading"
<dd><p>Filter the results by provider</p>
<dl class="field-list simple">
<dt class="field-odd">Options<span class="colon">:</span></dt>
<dd class="field-odd"><p>test | node</p>
<dd class="field-odd"><p>node | test</p>
</dd>
</dl>
</dd></dl>
Expand Down
4 changes: 2 additions & 2 deletions latest/methoddocs/ape_node.html

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion latest/methoddocs/contracts.html
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ <h1>ape.contracts<a class="headerlink" href="#ape-contracts" title="Link to this

<dl class="py method">
<dt class="sig sig-object py" id="ape.contracts.base.ContractContainer.at">
<span class="sig-name descname"><span class="pre">at</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">address</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">AddressType</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">txn_hash</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">HexBytes</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="#ape.contracts.base.ContractInstance" title="ape.contracts.base.ContractInstance"><span class="pre">ContractInstance</span></a></span></span><a class="headerlink" href="#ape.contracts.base.ContractContainer.at" title="Link to this definition"></a></dt>
<span class="sig-name descname"><span class="pre">at</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">address</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">AddressType</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">txn_hash</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">HexBytes</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fetch_from_explorer</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="#ape.contracts.base.ContractInstance" title="ape.contracts.base.ContractInstance"><span class="pre">ContractInstance</span></a></span></span><a class="headerlink" href="#ape.contracts.base.ContractContainer.at" title="Link to this definition"></a></dt>
<dd><p>Get a contract at the given address.</p>
<p>Usage example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span data-line="1"><span class="kn">from</span> <span class="nn">ape</span> <span class="kn">import</span> <span class="n">project</span>
Expand All @@ -461,6 +461,7 @@ <h1>ape.contracts<a class="headerlink" href="#ape-contracts" title="Link to this
a different ABI than <code class="xref py py-attr docutils literal notranslate"><span class="pre">contract_type</span></code>.</p></li>
<li><p><strong>txn_hash</strong> (<em>Union</em><em>[</em><em>str</em><em>, </em><em>HexBytes</em><em>]</em>) – The hash of the transaction that deployed the
contract, if available. Defaults to <code class="docutils literal notranslate"><span class="pre">None</span></code>.</p></li>
<li><p><strong>fetch_from_explorer</strong> (<em>bool</em>) – Set to <code class="docutils literal notranslate"><span class="pre">False</span></code> to avoid fetching from an explorer.</p></li>
</ul>
</dd>
<dt class="field-even">Returns<span class="colon">:</span></dt>
Expand Down
Loading

0 comments on commit fa6eaac

Please sign in to comment.