Commit Graph

384 Commits

Author SHA1 Message Date
georgewhewell c0fd8326f0
chore(clippy): fix bare urls in abigen (#2133) 2023-02-10 11:49:27 -08:00
James Prestwich 2607c67ca0
Refactor factories to use `Borrow<M>` (#2103)
* refactor: abstract factories over Borrow

* chore: changelog

* fix: docs for factory and type aliases
2023-02-07 10:51:34 -08:00
James Prestwich 0236de8d2a
refactor: make contract abstract over Borrow (#2082)
* refactor: contract abstract over Borrow

* refactor: preserve old connect usage

* nit: remove commented out modules

* chore: changelog

* test: add compile check to tests

* docs: add usage note to doc and make sure contractcall is visible

* fix: test compilation

* refactor: ContractCallInternal -> FunctionCall, ContractInternal -> ContractInstance

* fix: Send IntoFuture

* nit: must-use on connect

* docs: remove deprecation warning in docstrings for type aliases

* Update ethers-contract/src/call.rs

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

---------

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2023-02-06 13:27:01 -08:00
DaniPopes fd02bbc418
refactor(abigen): inline docs (#2090)
* refactor: abigen docs

* chore: doc

* refactor: final doc

* mergings

* fix: unremove Default
2023-01-30 21:28:57 -08:00
DaniPopes 93e1850646
refactor/feat(abigen,types): add bytes::Bytes static methods, refactor struct declaration (#2089)
* refactor: final struct expansion

* feat(types): implement bytes::Bytes static methods

* feat: use static Bytes for bytecode

* chore: add rustfmt skip directive

* clippy
2023-01-30 12:12:35 -08:00
Matthias Seitz 60e1779626
fix: add cfg to IntoFuture preventing Send (#2086) 2023-01-30 12:06:34 -08:00
wigy 7da559bbed
fix(provider): Add Send bound to return type of JsonRpcClient::request (#2072) 2023-01-27 16:57:08 -05:00
Guillaume Malette 83b12a80e3
Make ContractCall IntoFuture implement Send (#2083)
* fix(contracts): Add a failing test showing that ContractCall IntoFuture is not Send

* fix(contracts): Add Send bound for IntoFuture implementation of ContractCall

* chore: update CHAGELOG

* chore: fmt

---------

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2023-01-27 14:54:49 -05:00
Matthias Seitz d3ad5478ae
feat(abi): add helper functions to access solidity types (#2081) 2023-01-27 13:12:32 -05:00
Matthias Seitz 8ecd566930
fix: add missing pub for tuple structs (#2080) 2023-01-27 13:07:27 -05:00
WillQ c60990d7b6
remove EthAbiType derive generated unwrap (#2056)
* remove EthAbiType derive generated unwrap

* use simply expect
2023-01-17 11:15:59 -08:00
Georgios Konstantopoulos f2099a8eaa
chore: fix clippy (#2059) 2023-01-16 18:11:27 -08:00
Georgios Konstantopoulos 10b18e0d58 chore: do not expose util module 2023-01-13 11:10:31 -08:00
Georgios Konstantopoulos 219004efcb fix(abigen): add back mod util 2023-01-13 11:09:13 -08:00
DaniPopes c2d7b8321f
refactor(abigen): source (#2016)
* rm parse_address

* refactor: sources

* add comments, support <chain>:<address>

* fix doc

* chore: clippy

* fmt

* fix

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2023-01-13 10:59:44 -08:00
DaniPopes d1e934791d
refactor(abigen): Abigen, ContractBindings (#2019)
* use format_ident

* lib.rs

* refactor: ContractBindings

* refactor: from_file

* add write_fmt

* mv

* error msg

* revert mod docs
2023-01-13 10:23:59 -08:00
DaniPopes 5edcd3765c
feat(contract): use u64 and add more chains to multicall (#2042)
* feat: add new chains and use u64

* chore: manually implement Clone and Debug to avoid trait bounds.

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2023-01-13 10:18:55 -08:00
Nick 9e559aefeb
fix(abigen): ensure correct ABI in `From` impl (#2036)
* fix(abigen): ensure correct ABI in `From` impl

`new` creates a `Contract` with the correct ABI, but the `From` impl
simply wraps the source `Contract`, which could have a completely
different ABI. In effect this was an unsafe cast, and indeed was
observed to trigger a "method not found (this should never happen)"
panic for subsequent method lookups. Implementing `From` in terms of
`new` fixes this, at the cost of an extra `Arc::clone()` (which I can't
see how to eliminate without piercing the `ethers::contract::Contract`
public API).

* Remove unnecessary `async` from test

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
2023-01-13 10:18:17 -08:00
DaniPopes 79f27e2366
docs(abigen): rename `event_derives` to `derives` (#2018)
* chore: rename event_derives to derives

Misleading name, `event_derives` implies that only Solidity events'
structs would apply, while this is not true

* last derive

* mv

* docs

* docs

* last doc
2023-01-13 10:17:32 -08:00
DaniPopes 015eeabea8
feat(contract): return multicall pending transaction (#2044)
* feat(contract): return multicall pending transaction

* fix: tests

* docs: update CHANGELOG.md
2023-01-11 19:30:56 -08:00
DaniPopes 0187bedd11
feat(abigen): use prettyplease (#2027) 2023-01-09 07:17:22 +02:00
DaniPopes 96f4723c13
fix(abigen): tests (#2015)
* fix: methods tests

* fix: remaining paths in tests
2023-01-06 11:30:34 +02:00
DaniPopes 24b9ae2404
fix(contract): doctests (#2007) 2023-01-04 13:29:10 +02:00
Matthias Seitz 6ac3e75c6a
fix: use full path of i256 (#2000) 2023-01-03 15:12:47 +02:00
DaniPopes 97582cc346
feat(core, contract): improve `determine_ethers_crates` (#1988)
* refactor: determine_ethers_crates

* feat: improve crate resolution

* export new types and functions

* export

* fix: file name check

* fix: invert condition and check CARGO_MANIFEST_DIR

* use abigen macro to generate multicall

* chore: rm debug

* rm unnecessary .replace

* chore: clippy

* chore: clippy

* Revert "chore: clippy"

This reverts commit bd220f308d.

* Revert "chore: clippy"

This reverts commit 5550f4e856.

* add tests

* better tests, docs

* add another test

* fix docs

* refactor: add an environment struct for determining ethers crates

* fix: use fmt::Debug to escape paths

* docs: rename and rm old docs

* feat: use global path for crates

* fix: docs

* chore: move rand impl to tests mod
2023-01-03 15:11:57 +02:00
DaniPopes d272318483
chore: update all rust editions to 2021 (#1979) 2022-12-30 14:48:29 +02:00
Akram Hussein 69e0ff7301
fix: doc typo regarding Multicall::call_array (#1985) 2022-12-30 14:44:03 +02:00
dependabot[bot] a42cc9f63f
chore(deps): bump once_cell from 1.16.0 to 1.17.0 (#1987)
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.16.0 to 1.17.0.
- [Release notes](https://github.com/matklad/once_cell/releases)
- [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md)
- [Commits](https://github.com/matklad/once_cell/compare/v1.16.0...v1.17.0)

---
updated-dependencies:
- dependency-name: once_cell
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-30 14:43:05 +02:00
DaniPopes d8d4eac3ad
fix(contract): add setter for MultiBindings' rustfmt (#1948) 2022-12-22 21:05:00 +02:00
Yiannis M 813600e6c9
fix: Add `openssl` and `rustls` feature flags in ethers-middleware (#1961)
* fix: ethers-middleware: Add `openssl` and `rustls` feature flags

* fix: ethers-contract-derive: Disable default features of ethers-contract-abigen

Without this fix, `rustls` was enabled by default even if user had `openssl` feature flag
2022-12-21 16:44:42 +02:00
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
joshieDo 92e726921a
chore: add celo chain (#1932)
* add celo chain

* add missing chain case

* clippy & fmt
2022-12-07 21:37:11 -08:00
Matthias Seitz 3dfc04f9fe
chore(clippy): make clippy happy (#1923) 2022-12-05 22:05:33 -08:00
Matthias Seitz 556821f077
chore: generate selector as hex in docs (#1924) 2022-12-05 22:05:24 -08:00
Dan Cline 80d887b67e
docs: update MRSV to 1.64 (#1926)
* IntoFuture was implemented in #1826, which means the MSRV should now
   be 1.64
2022-12-05 22:04:48 -08:00
Matthias Seitz 0ce6b107d6
fix: make version detection infallible (#1916) 2022-12-01 06:14:51 -08:00
DaniPopes 2d793edc94
fix(contract): multicall decode error (#1907)
* wip

* use empty bytes for reverts

* minor improvements

* fix test

* use is_empty

* docs

* clippy

* fix: rust-analyzer bug

* revert rename
2022-11-30 13:20:22 -08:00
Matthias Seitz 17addcfd91
fix(abigen): rm wrong brackets (#1914) 2022-11-30 13:14:40 -08:00
Georgios Konstantopoulos 78e89f8efa (cargo-release) version 1.0.2 2022-11-27 12:27:57 -08:00
Georgios Konstantopoulos 4a70dc5614 (cargo-release) version 1.0.2 2022-11-27 12:27:56 -08:00
Georgios Konstantopoulos 758a0e5b6e (cargo-release) version 1.0.2 2022-11-27 12:27:56 -08:00
Matthias Seitz c542844424
fix: handle non existing Cargo.toml edge case (#1886) 2022-11-23 07:35:55 -08:00
Matthias Seitz 84f896f47b
chore(clippy): make clippy happy (#1888) 2022-11-23 07:35:38 -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
Matthias Seitz 616bd92cc4
fix: mock ethers mod layout (#1884) 2022-11-22 13:07:51 -08:00
Will Smith 9d75e5f178
Fix: use cwd manifest (#1869)
* fix(abigen): make compatible with older rust versions

* Update ethers-contract/ethers-contract-abigen/src/multi.rs

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

* fix: linting

* fix(abigen): use active cargo.toml over crate cargo.toml

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2022-11-17 11:23:10 -08:00
Will Smith a525659f5d
fix(abigen): make compatible with older rust versions (#1868)
* fix(abigen): make compatible with older rust versions

* Update ethers-contract/ethers-contract-abigen/src/multi.rs

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

* fix: linting

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2022-11-17 10:43:41 -08:00
Georgios Konstantopoulos 74bf6fbb04 chore: fmt / clippy 2022-11-15 13:36:25 -08:00