Commit Graph

156 Commits

Author SHA1 Message Date
Genysys 91cd6ccce8
feat: adds bscscan as abi source (#1955) 2022-12-19 17:54:24 +02:00
Andrey Kuznetsov 279aea6323
feat(contract): add_calls and call_array for multicall (#1941) 2022-12-18 13:05:02 +02:00
Andrey Kuznetsov 5bc9ee73b2
fix(contract): allow 16 calls in multicall (#1934) 2022-12-15 09:47:59 +02:00
James Prestwich d6fea13d23
feature: providererror conversion to middleware error (#1920)
* feature: providererror conversion to middleware error

* chore: update changelog
2022-12-02 12:12:14 -08:00
Andrea Simeoni c4e09f261e
Fix: handle panic on Ws error (#1915)
* On Ws error close all active subscriptions and force clients to reconnect. the Websocket.

* Comment typos

* Unit tests
Lint
cargo +nightly fmt

* - Added CHANGELOG entry
- Added `#` prefix to issue IDs where missing

* ownership typo

Co-authored-by: Andrea Simeoni <>
2022-12-01 11:00:10 -08:00
Dan Cline 4b685621ed
feat(providers): add a subset of admin namespace (#1880)
* tell Geth to expose the admin namespace

* wip: add admin namespace support

 * add networking and peer related structs

* add rest of chain config fields

* add datadir to geth

* fix data dir ref

* add dev flag to geth

* set dev only if block_time is not set

* put mutually exclusive options in an enum

* make block_time use the devmode enum

* add p2p port to geth

* add basic impls for admin endpoints

* move from_int_or_hex to ethers-core utils

* fix nodeinfo protocol field

 * the type is better represented by a struct which can have either eth
   or snap

* add chain id and discovery toggle for Geth

* remove PeerEvent

 * should re-add when peer event endpoints are implemented

* simplify serde options for admin responses

* change signature for peer modification apis

 * these admin apis accept an enode, which _may_ be an enr, but could
   also be a legacy enode "v4" url.

* add note on where `ChainConfig` fields come from

* add note on PeerInfo about the source of fields

* add admin namespace support to CHANGELOG

* update pr number in changelog

* cargo fmt

* move chainconfig to genesis in utils

* accept genesis file in geth

* add genesis writing to geth spawn

* finally get geth nodes to connect

* import io::Read in provider tests

* fix PeerInfo and use enode id for provider test

* make clippy happy

* improve documentation for genesis module

* remove not(wasm) attributes on genesis module

* remove debugging printlns

* remove io::Read from provider tests

* add failing post merge test case

* add full mainnet nodeinfo for testing

* support deserializing json bignums to U256

 * the serde_json arbitrary_precision feature is necessary so the
   serde_json::Number variant of `IntOrHexOrBigNum` can be converted
   into a string and fed into U256::from_dec_string

* fix from_int_or_hex_opt doc string

* remove third variant from IntOrHex

 * unnecessary since serde_json::Number handles smaller ints as well

* add comments for ids

* fix enode id type in admin_peers provider test

* fix admin typo in Cargo.toml

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>

* add method to wait on a gethinstance adding a peer

* fix dial loop and wait_to_add_peer doc comments

* update geth

 * the build can be updated by changing the GETH_BUILD env var

* wait for geth to exit on drop

* remove unnecessary wait

* fix mid-handshake PeerInfo deserialization

* remove println

* make tests less flaky

* handle discovery with the rest of the non dev opts

* dump geth stderr to debug failing ci test

 * add method which dumps the unread stderr of the geth instance into a
   string

* remove call_raw debug println

 * bug is due to authrpc endpoint being in use

* use unused port when authrpc port is not specified

* remove dump_stderr from GethInstance

 * did not work properly anyways

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-11-30 13:22:44 -08:00
Andrea Simeoni 16ab3d5820
Feat middleware stack builder (#1890)
* ProviderBuilder struct + docs

* README

* Docs typos

* Removed useless Arc
Rename module

* Unit tests

* cargo +nightly fmt

* CHANGELOG

* CHANGELOG typo

* ci: fix docs job

* review: Removed Option<M>. Builder functions directly consume self.

* feat: `with_signer` builder function

* feat: `nonce_manager` builder function

* feat: `gas_oracle` builder function

* Unit tests

* Docs

* fix: cargo +nightly fmt

* Update ethers-middleware/src/builder.rs

Typo

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* Builder functions provided as a trait
Update docs
Update tests

* cargo +nightly fmt

* CHANGELOG

Co-authored-by: Andrea Simeoni <>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2022-11-28 12:16:21 -08:00
Andrea Simeoni 845aa4920f
feat: Instantiate an event builder without a contract instance (#1882)
* Build an `Event` without requiring a contract instance

* Contract unit test

* Function to set Event address

* Example

* Typo to improve readability

* CHANGELOG

* cargo +nightly fmt

* FIX conflict

* review: applied Address alias

Co-authored-by: Andrea Simeoni <>
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-11-22 13:15:36 -08:00
Dave Belvedere a0fb1bf196
I256 parse support (#1863)
* Added support for I256 in format_units. Added two complement support for I256.

* Add I256 support into parse_units

Co-authored-by: Dave Belvedere <dave@protonmail.com>
2022-11-16 16:03:07 -08:00
Will Smith d47e34dc5b
fix: generated crate not using generated version (#1852)
* fix: generated crate not using generated version

* add docs

* wip: add base testcases

* fix: str formatting

* fix: add missing comma

* fix: tests and file loading

* fix: strip whitespaces

* fix: case where we are using specified crate

* linting: remove extra ref

* refactor: use toml parser over regex

* fix: add case for path and ethers-contract

* fix: add missing comma

* feat: don't check for path

* remove build-dep fallback
2022-11-15 13:00:12 -08:00
MouseLess.eth 936cecc3ad
Add `op` field to `VMOperation` to determine executed opcode (#1858)
* created opcode enum and added to VMOperation. Fixes #1857

* rebuild trace logs to include missing fields

* opcode descriptions for docs + changelog

* restore traces and indent trace

* opcode 0x20 should be SHA3
2022-11-15 11:36:52 -08:00
Dave Belvedere 5ae0a848c7
I256 asr doc (#1860)
* Update I256 documentation to call out diversions from standard numeric types on the right shift operator

* Update changelog

* Address review comment. Link changelog notes to PR

Co-authored-by: Dave Belvedere <dave@protonmail.com>
2022-11-15 11:33:54 -08:00
Dave Belvedere 5c9a048f73
Add Arithmetic Shift Left operation for I256. Minor update to the ASR tests to include coverage for a shift of 0, and move to 'I256::minus_one' over 'I256::from(-1i8)' syntax (#1452)
Co-authored-by: Dave Belvedere <dave@protonmail.com>
2022-11-08 16:10:53 -08:00
Georgios Konstantopoulos 960d89fccc
Revert "fix: get_logs_paginated fetches past latest block (#1818)" (#1845)
This reverts commit eb40392399.
2022-11-08 16:05:28 -08:00
Roger So eb40392399
fix: get_logs_paginated fetches past latest block (#1818) 2022-11-07 12:43:11 -08:00
halo3mic ba9aa7838b
Fixes: #1822 (#1823)
* Fixes: #1822

* Fixes: gakonst#1822 :: update1

* Fixes: #1822 :: Add ParseOverflow err & rm rust_decimals from ethers-core

* update changelog
2022-11-07 12:28:43 -08:00
DaniPopes 5c762c44d7
fmt: all (#1751)
* fmt: all

* fmt: eol
2022-09-28 11:58:26 -07:00
Luke Tchang e034a8f979
docs: add comment about safety of u8 -> u64 cast in signature (#1704)
* docs: add comment about u8 -> u64 cast in signature

* fix: format

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-09-18 08:45:33 -07:00
Trevor Porter c568fd3934
fix(providers): don't default to "latest" block ID for `eth_estimateGas` (#1657)
* Don't default to 'latest' block ID for eth_estimateGas

* Add changelog entry

* Amend comment
2022-09-16 11:23:34 -07:00
Robin Molen-Grigull c9c22f4dfa
fix: geth trace types (#1682)
* fix: geth trace types

* update: changelog entry added
2022-09-09 16:20:25 -07:00
DaniPopes c341f31fc4
chore: add abigen to default features (#1684)
* chore: add abigen to default features

* docs: update CHANGELOG.md
2022-09-09 16:19:29 -07:00
Matthias Seitz 0e7f46b03d
feat(abigen): subsitute structs in event bindings (#1674)
* fix(abigen): handle event defaults

* feat(abigen): subsitute structs in event bindings

* update changelog

* chore: rustfmt

* fix broken tests

* chore(clippy): make clippy happy
2022-09-07 09:14:13 -07:00
Noah Citron a052ff8bd4
fix: legacy transaction rlp decoding (#1672)
* fix legacy tx rlp decoding

* add test for type 0 tx in 2718 envelopes

* update changelog

* refactor

* fmt
2022-09-06 09:08:05 -07:00
DaniPopes 72449c09e1
feat(contract): add extra Multicall helper methods (#1666)
* feat(contract): add extra Multicall helper methods

* docs: update CHANGELOG.md

* normalize helper methods' names
2022-09-05 09:54:49 -07:00
Noah Citron 744d5c055e
fix: incorrect encoding on TransactionReceipt (#1661)
* fix TransactionReceipt rlp encoding

* add tests

* update changelog
2022-09-04 10:59:53 -07:00
Clifton King de90662725
feat(core): improved debug format for Bytes (#1658)
* feat(core): improved debug format for Bytes

* update changelog
2022-09-04 10:58:06 -07:00
Matthias Seitz 0b04ffe787
feat: add uint8 type (#1639)
* feat: add uint8 type

* update changelog

* derive default

* fix: failing test
2022-08-28 12:17:48 -07:00
Jacob b71e6ad00b
ethers-etherscan: derive debug, clone and copy (#1634)
* ethers-etherscan: derive debug, clone and copy

Derive Debug, Clone and Copy on all appropriate Structs and Enums.

* Update changelog
2022-08-24 12:50:29 -07:00
Clifton King b1124441ec
feat(abigen): descriptive deserialization errors (#1633)
* feat(abigen): descriptive deserialization errors

* update changelog

* map_err -> wrap_err
2022-08-23 17:54:56 -07:00
Jacob ff66008cbe
Fix 'get_transactions' response. (#1632)
* Fix 'get_transactions' response.

* Add some explanation to GenesisOption.

* One-line-ifying

* Update changelog
2022-08-23 09:17:00 -07:00
Matthias Seitz ff754263a3
fix(solc): use cache context when determining artifact files (#1621)
* fix(solc): use cache context when determining artifact files

* update  changelog
2022-08-19 14:33:28 -07:00
Matthias Seitz e6c1927a1c
feat(abigen): add contract filter (#1564)
* feat(abigen): add contract filter

* refactor: move to top of file

* add tests

* update changelog
2022-08-04 08:22:00 -07:00
Matthias Seitz 27a184db45
feat: add EthError trait and derive (#1549)
* feat: add EthError trait and derive

* update changelog
2022-08-02 11:03:52 -07:00
Matthias Seitz e62c84d650
fix(solc): convert source paths on windows (#1540)
* fix(solc): convert source paths on windows

* refactor: slash all paths

* fix: use correct import

* feat: slash compiler output

* add util function

* slash by default

* slash artifact id

* typo

* updat cfg

* unify cfg

* update changelog
2022-08-01 09:47:41 -07:00
Marcelo Fornet c7563a5f64
Add support to Aurora network (#1535)
* Add support to Aurora network

Documentation about aurora chain:
https://doc.aurora.dev/getting-started/network-endpoints

* Update changelog

* Format code using rustfmt.toml
2022-07-30 12:42:04 -07:00
Mark Tyneway 16f686df26
ethers-solc: add immutableReferences output selector (#1523)
* ethers-solc: add immutableReferences output selector

It is a property on the deployed bytecode object
on the compiler output. This is the precursor for
`forge inspect <contract-name> immutableReferences`.

* chore: update changelog
2022-07-28 11:07:24 -07:00
Clifton King c418f4ef34
fix(abigen): abigen feature required for bindings (#1508)
* fix(abigen): abigen feature required for bindings

traits such as ethers::contract::EthDisplay require abigen

* update changelog

* abigen now uses re-exported version of serde_json
2022-07-26 08:28:39 -07:00
Hari 3766c2b47c
feat(etherscan): erc1155 token transfer events endpoint (#1503)
Added the function `get_erc1155_transfer_events` and the corresponding struct `ERC1155TokenTransferEvent`.
2022-07-26 08:28:09 -07:00
wren cb7e586645
feat(debug_traceTransaction): initial commit (#1469)
* feat(debug_traceTransaction): initial commit

* chore(changelog): updated changelog

* feat(debug_traceTransaction): type adjusments

* feat(debug_traceTransaction): type adjusments

* Update ethers-providers/src/provider.rs

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* Update ethers-providers/src/provider.rs

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>

* chore(format): cargo +nightly fmt

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-07-24 14:46:38 -07:00
Matthias Seitz fb8ebd8231
feat(solc): handle conflicting artifacts properly (#1491)
* feat(solc): handle conflicting artifacts properly

* refactor(solc): update write extras function

* chore: update CHANGELOG
2022-07-24 14:39:37 -07:00
Matthias Seitz a5c326162a
fix: use correct model for txpool_content endpoint (#1501)
* fix: use correct model for txpool_content endpoint

* chore: update CHANGELOG

* update failing tests

* Update ethers-providers/tests/txpool.rs

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-07-24 03:21:09 +02:00
Clifton King aa008727ee
fix(abigen): contract names can be reserve words (#1498)
* fix(abigen): contract names can be reserve words

* update changelog

* clippy warning

* module names consistent with other safe_*

* update refs to generated abis

* move reserved words tests to their own fn

* added note to changelog re: module name changes
2022-07-24 03:18:24 +02:00
James Prestwich 13ce18fd3b
feature: allow event builder to stream with meta (#1483)
* feature: allow event builder to stream with meta

* doc: improve rustdoc

* feature: subscribe_with_meta

* chore: fmt
2022-07-17 11:26:16 -07:00
Matthias Seitz fb3fb161c0
chore: make ethers-solc optional (#1463)
* chore: make ethers-solc optional

* chore: update CHANGELOG

* add missing requirement

* add abigen req
2022-07-06 14:11:56 -07:00
Mark Tyneway 1efdadefc0
ethers-solc: fix build info default directory (#1458)
* ethers-solc: fix build info default directory

This commit fixes the default behavior for the `build-info`
directory when it is unconfigured. It should end up in
the configured artifacts directory, taking into account
whatever the config for the artifacts directory is.
If the build info is specifically configured, then that
will take precendence over the default.

* chore: add changelog entry
2022-07-06 11:44:47 -07:00
Mark Tyneway 3bafe5b9e4
feat(ethers-solc): configurable build-info output dir (#1433)
* feat(ethers-solc): configurable build-info output dir

* chore: update changelog
2022-06-30 09:21:46 -07:00
Matthias Seitz f5793525f2
feat: capture unknown fields (#1423)
* feat(core): add OtherFields type

* feat: capture unknown fields

* chore: update CHANGELOG

* test: update tests

* docs: fix doc tests

* fix: make docs compile on stable
2022-06-28 15:18:15 -07:00
h00p30 94c7559ab5
TypedTransaction methods into builder style (#1414) 2022-06-25 20:44:55 -04:00
Julian Popescu ec379da527
Use H64 for Block Nonce (#1396)
* Use H64 for Block Nonce

Signed-off-by: Julian Popescu <hi@julian.dev>

* Update changelog

Signed-off-by: Julian Popescu <hi@julian.dev>
2022-06-23 11:02:29 -04:00
Matthias Seitz 05864ff9ed
fix: net_version returns string (#1376)
* fix: net_version returns string

* chore: update CHANGELOG
2022-06-14 13:00:46 -07:00