Skip to content

Commit

Permalink
Merge branch 'feat/08' into feat/automine
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey authored Apr 17, 2024
2 parents 663be58 + cdcc09b commit f193f5e
Show file tree
Hide file tree
Showing 72 changed files with 1,204 additions and 992 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
docs:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/draft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
jobs:
update-draft:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
# Drafts your next Release notes as Pull Requests are merged into "main"
- uses: release-drafter/release-drafter@v5
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-yaml

Expand All @@ -10,7 +10,7 @@ repos:
- id: isort

- repo: https://github.com/psf/black
rev: 24.2.0
rev: 24.3.0
hooks:
- id: black
name: black
Expand All @@ -21,7 +21,7 @@ repos:
- id: flake8

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.9.0
hooks:
- id: mypy
additional_dependencies: [
Expand Down
2 changes: 1 addition & 1 deletion docs/userguides/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ deployments:
mainnet:
- contract_type: MyContract
address: 0x5FbDB2315678afecb367f032d93F642f64180aa3
goerli:
sepolia:
- contract_type: MyContract
address: 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
```
Expand Down
14 changes: 7 additions & 7 deletions docs/userguides/networks.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Networks

When interacting with a blockchain, you will have to select an ecosystem (e.g. Ethereum, Arbitrum, or Fantom), a network (e.g. Mainnet or Goerli) and a provider (e.g. Eth-Tester, Geth, or Alchemy).
When interacting with a blockchain, you will have to select an ecosystem (e.g. Ethereum, Arbitrum, or Fantom), a network (e.g. Mainnet or Sepolia) and a provider (e.g. Eth-Tester, Geth, or Alchemy).
Networks are part of ecosystems and typically defined in plugins.
For example, the `ape-ethereum` plugin comes with Ape and can be used for handling EVM-like behavior.

Expand Down Expand Up @@ -195,7 +195,7 @@ To add a corresponding entry in `ape-etherscan` (assuming you are using `ape-eth
etherscan:
ethereum:
rate_limit: 15 # Configure a rate limit that makes sense for retry logic.
# The name of the entry is the same as your custom network!
customnetwork:
uri: https://custom.scan # URL used for showing transactions
Expand Down Expand Up @@ -360,9 +360,9 @@ ethereum:
# Most networks use 120 seconds (2 minutes).
transaction_acceptance_timeout: 60

# The amount of times to retry fetching a receipt. This is useful
# because decentralized systems may show the transaction accepted
# on some nodes but not on others, and potentially RPC requests
# The amount of times to retry fetching a receipt. This is useful
# because decentralized systems may show the transaction accepted
# on some nodes but not on others, and potentially RPC requests
# won't return a receipt immediately after sending its transaction.
# This config accounts for such delay. The default is `20`.
max_receipt_retries: 10
Expand All @@ -371,13 +371,13 @@ ethereum:
# estimates gas. Note: local networks tend to use "max" here
# by default.
gas_limit: auto

# Base-fee multipliers are useful for times when the base fee changes
# before a transaction is sent but after the base fee was derived,
# thus causing rejection. A multiplier reduces the chance of
# rejection. The default for live networks is `1.4` times the base fee.
base_fee_multiplier: 1.2

# The block time helps Ape make decisions about
# polling chain data.
block_time: 10
Expand Down
8 changes: 4 additions & 4 deletions docs/userguides/scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ from ape.cli import ape_cli_context

@click.command()
@ape_cli_context()
def cli(cli_ctx):
def cli(cli_ctx):
# There is no connection yet at this point.
testnets = {
"ethereum": ["sepolia", "goerli"],
"polygon": ["mumbai"]
"ethereum": ["sepolia"],
"polygon": ["amoy"]
}
nm = cli_ctx.network_manager

Expand Down Expand Up @@ -137,7 +137,7 @@ Without specifying `--network`, the script with connect to your default network.
Else, specify the network using the `--network` flag:

```shell
ape run foobar --network polygon:mumbai:alchemy
ape run foobar --network polygon:amoy:alchemy
```

You can also change networks within the script using the `ProviderContextManager` (see examples in the CLI-script section above).
Expand Down
108 changes: 54 additions & 54 deletions docs/userguides/transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ assert receipt.sender == dev
Deploying from [ape console](./console.html) allows you to interact with a contract in real time. You can also use the `--network` flag to connect a live network.

```bash
ape console --network ethereum:goerli:alchemy
ape console --network ethereum:sepolia:alchemy
```

This will launch an IPython shell:

```python
In [1]: dev = accounts.load("dev")
In [2]: token = dev.deploy(project.Token)
In [2]: token = dev.deploy(project.Token)
In [3]: token.contract_method_defined_in_contract()
```

Expand Down Expand Up @@ -194,58 +194,58 @@ The trace might look something like:
```bash
Call trace for '0x43abb1fdadfdae68f84ce8cd2582af6ab02412f686ee2544aa998db662a5ef50'
txn.origin=0x1e59ce931B4CFea3fe4B875411e280e173cB7A9C
ContractA.methodWithoutArguments() -> 0x00..7a9c [469604 gas]
├── SYMBOL.supercluster(x=234444) -> [
│ [23523523235235, 11111111111, 234444],
│ [
│ 345345347789999991,
│ 99999998888882,
│ 345457847457457458457457457
│ ],
│ [234444, 92222229999998888882, 3454],
│ [
│ 111145345347789999991,
│ 333399998888882,
│ 234545457847457457458457457457
│ ]
│ ] [461506 gas]
├── SYMBOL.methodB1(lolol="ice-cream", dynamo=345457847457457458457457457) [402067 gas]
│ ├── ContractC.getSomeList() -> [
│ │ 3425311345134513461345134534531452345,
│ │ 111344445534535353,
│ │ 993453434534534534534977788884443333
│ │ ] [370103 gas]
│ └── ContractC.methodC1(
│ windows95="simpler",
│ jamaica=345457847457457458457457457,
│ cardinal=ContractA
│ ) [363869 gas]
├── SYMBOL.callMe(blue=tx.origin) -> tx.origin [233432 gas]
├── SYMBOL.methodB2(trombone=tx.origin) [231951 gas]
│ ├── ContractC.paperwork(ContractA) -> (
│ │ os="simpler",
│ │ country=345457847457457458457457457,
│ │ wings=ContractA
│ │ ) [227360 gas]
│ ├── ContractC.methodC1(windows95="simpler", jamaica=0, cardinal=ContractC) [222263 gas]
│ ├── ContractC.methodC2() [147236 gas]
│ └── ContractC.methodC2() [122016 gas]
├── ContractC.addressToValue(tx.origin) -> 0 [100305 gas]
├── SYMBOL.bandPractice(tx.origin) -> 0 [94270 gas]
├── SYMBOL.methodB1(lolol="lemondrop", dynamo=0) [92321 gas]
│ ├── ContractC.getSomeList() -> [
│ │ 3425311345134513461345134534531452345,
│ │ 111344445534535353,
│ │ 993453434534534534534977788884443333
│ │ ] [86501 gas]
│ └── ContractC.methodC1(windows95="simpler", jamaica=0, cardinal=ContractA) [82729 gas]
└── SYMBOL.methodB1(lolol="snitches_get_stiches", dynamo=111) [55252 gas]
├── ContractC.getSomeList() -> [
│ 3425311345134513461345134534531452345,
│ 111344445534535353,
│ 993453434534534534534977788884443333
│ ] [52079 gas]
└── ContractC.methodC1(windows95="simpler", jamaica=111, cardinal=ContractA) [48306 gas]
ContractA.methodWithoutArguments() -> 0x00..7a9c [469604 gas]
├── SYMBOL.supercluster(x=234444) -> [
│ [23523523235235, 11111111111, 234444],
│ [
│ 345345347789999991,
│ 99999998888882,
│ 345457847457457458457457457
│ ],
│ [234444, 92222229999998888882, 3454],
│ [
│ 111145345347789999991,
│ 333399998888882,
│ 234545457847457457458457457457
│ ]
│ ] [461506 gas]
├── SYMBOL.methodB1(lolol="ice-cream", dynamo=345457847457457458457457457) [402067 gas]
│ ├── ContractC.getSomeList() -> [
│ │ 3425311345134513461345134534531452345,
│ │ 111344445534535353,
│ │ 993453434534534534534977788884443333
│ │ ] [370103 gas]
│ └── ContractC.methodC1(
│ windows95="simpler",
│ jamaica=345457847457457458457457457,
│ cardinal=ContractA
│ ) [363869 gas]
├── SYMBOL.callMe(blue=tx.origin) -> tx.origin [233432 gas]
├── SYMBOL.methodB2(trombone=tx.origin) [231951 gas]
│ ├── ContractC.paperwork(ContractA) -> (
│ │ os="simpler",
│ │ country=345457847457457458457457457,
│ │ wings=ContractA
│ │ ) [227360 gas]
│ ├── ContractC.methodC1(windows95="simpler", jamaica=0, cardinal=ContractC) [222263 gas]
│ ├── ContractC.methodC2() [147236 gas]
│ └── ContractC.methodC2() [122016 gas]
├── ContractC.addressToValue(tx.origin) -> 0 [100305 gas]
├── SYMBOL.bandPractice(tx.origin) -> 0 [94270 gas]
├── SYMBOL.methodB1(lolol="lemondrop", dynamo=0) [92321 gas]
│ ├── ContractC.getSomeList() -> [
│ │ 3425311345134513461345134534531452345,
│ │ 111344445534535353,
│ │ 993453434534534534534977788884443333
│ │ ] [86501 gas]
│ └── ContractC.methodC1(windows95="simpler", jamaica=0, cardinal=ContractA) [82729 gas]
└── SYMBOL.methodB1(lolol="snitches_get_stiches", dynamo=111) [55252 gas]
├── ContractC.getSomeList() -> [
│ 3425311345134513461345134534531452345,
│ 111344445534535353,
│ 993453434534534534534977788884443333
│ ] [52079 gas]
└── ContractC.methodC1(windows95="simpler", jamaica=111, cardinal=ContractA) [48306 gas]
```

Additionally, you can view the traces of other transactions on your network.
Expand Down
24 changes: 12 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
"hypothesis-jsonschema==0.19.0", # JSON Schema fuzzer extension
],
"lint": [
"black>=24.2.0,<25", # Auto-formatter and linter
"mypy>=1.8.0,<2", # Static type analyzer
"black>=24.3.0,<25", # Auto-formatter and linter
"mypy>=1.9.0,<2", # Static type analyzer
"types-PyYAML", # Needed due to mypy typeshed
"types-requests", # Needed due to mypy typeshed
"types-setuptools", # Needed due to mypy typeshed
"pandas-stubs==1.2.0.62", # Needed due to mypy typeshed
"types-SQLAlchemy>=1.4.49", # Needed due to mypy typeshed
"types-python-dateutil", # Needed due to mypy typeshed
"flake8>=7.0.0,<8", # Style linter
"flake8-breakpoint>=1.1.0,<2", # Detect breakpoints left in code
"flake8-print>=4.0.1,<5", # Detect print statements left in code
Expand Down Expand Up @@ -97,15 +98,14 @@
install_requires=[
"click>=8.1.6,<9",
"ijson>=3.1.4,<4",
"importlib-metadata",
"importlib-metadata", # NOTE: Needed on 3.8 for entry_points `group=` kwarg.
"ipython>=8.5.0,<9",
"lazyasd>=0.1.4",
"packaging>=23.0,<24",
"pandas>=1.3.0,<2",
"pluggy>=1.3,<2",
"pydantic>=2.5.2,<3",
"pydantic-settings>=2.0.3,<3",
"PyGithub>=1.59,<2",
"pytest>=6.0,<8.0",
"python-dateutil>=2.8.2,<3",
"PyYAML>=5.0,<7",
Expand All @@ -117,18 +117,18 @@
"urllib3>=2.0.0,<3",
"watchdog>=3.0,<4",
# ** Dependencies maintained by Ethereum Foundation **
"eth-abi>=4.2.1,<5",
"eth-abi>=5.1.0,<6",
"eth-account>=0.10.0,<0.11",
"eth-typing>=3.5.2,<4",
"eth-utils>=2.3.1,<3",
"py-geth>=4.2.0,<5",
"web3[tester]>=6.15.1,<7",
"py-geth>=4.4.0,<5",
"web3[tester]>=6.16.0,<6.17.1",
# ** Dependencies maintained by ApeWorX **
"eip712>=0.2.3,<0.4",
"ethpm-types>=0.6.7,<0.7",
"eth_pydantic_types>=0.1.0a5,<0.2",
"evmchains>=0.0.2,<0.1",
"evm-trace>=0.1.2",
"eip712>=0.2.7,<0.3",
"ethpm-types>=0.6.9,<0.7",
"eth_pydantic_types>=0.1.0,<0.2",
"evmchains>=0.0.6,<0.1",
"evm-trace>=0.1.3,<0.2",
],
entry_points={
"console_scripts": ["ape=ape._cli:cli"],
Expand Down
Loading

0 comments on commit f193f5e

Please sign in to comment.