Commit Graph

534 Commits

Author SHA1 Message Date
Matthias Seitz 5c6ce6b0a1
feat: improved solc management (#539)
* feat: improved solc management

* test: add basic test

* rustfmt

* rustfmt

* feat: add support for lib paths

* test: add dapp testing data

* feat: support dapp style libs

* fix: doc test

* use SOLC_path by default

* docs: import readme

* feat: add diagnostics

* chore: cleanup

* docs: update compile docs

* style: use red for error msg

* style: simplifiy error format

* chore: add newline on successful compiler run log

* feat: allow ignoring error codes so that they do not get logged

* chore: use solc 0.6.6 to match CI Version

* fix: make constructor public in hardhat tests

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-10-30 20:59:44 +03:00
Georgios Konstantopoulos 8a7f42b6fa ci: load rinkeby privkey from secrets 2021-10-30 15:52:38 +02:00
Alexey Shekhirin dc3ac427f4
feat(providers): unify get_block_receipts for eth/parity RPCs (#541)
* feat(providers): unify get_block_receipts for eth/parity RPCs

* add besu

* impl tryfrom for nodeclient

* better node client storage

* fix lint

* tryfrom<&str> -> fromstr

* fix: remove nested Option

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-10-30 16:50:46 +03:00
Alexey Shekhirin 3b2aa955d0
test(middleware): get rinkeby private key from env var (#542) 2021-10-30 14:12:42 +03:00
dependabot[bot] e71fa21ccb
chore(deps): bump arrayvec from 0.7.1 to 0.7.2 (#540)
Bumps [arrayvec](https://github.com/bluss/arrayvec) from 0.7.1 to 0.7.2.
- [Release notes](https://github.com/bluss/arrayvec/releases)
- [Changelog](https://github.com/bluss/arrayvec/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bluss/arrayvec/compare/0.7.1...0.7.2)

---
updated-dependencies:
- dependency-name: arrayvec
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-29 17:45:45 +02:00
Matthias Seitz dcf20022c6
chore: add rustfmt.toml (#537)
* chore: add rustfmt.toml

* rustfmt

* chore: Update readme with fmt info

* ci: update ci

* chore: rustfmt

* rustfmt

* rustfmt

* ci: install libudev

* chore(clippy): make clippy happy

* chore(clippy): make clippy happy

* revert ci

* ci: install libudev
2021-10-29 14:29:35 +02:00
Matthias Seitz eede86df41
feat: add abi code trait impls (#531)
* feat: use const generics for array tokenize

* feat: add abi encode decode impls

* test: add some tests

* chore: move abi codec to core

* update changelog
2021-10-28 01:07:24 +03:00
dependabot[bot] e089ad7755
chore(deps): bump tracing-subscriber from 0.3.0 to 0.3.1 (#532)
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.3.0 to 0.3.1.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.3.0...tracing-subscriber-0.3.1)

---
updated-dependencies:
- dependency-name: tracing-subscriber
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-27 12:27:52 +02:00
dependabot[bot] ba08969b8f
chore(deps): bump serde-aux from 2.3.0 to 3.0.1 (#533)
Bumps [serde-aux](https://github.com/vityafx/serde-aux) from 2.3.0 to 3.0.1.
- [Release notes](https://github.com/vityafx/serde-aux/releases)
- [Commits](https://github.com/vityafx/serde-aux/commits)

---
updated-dependencies:
- dependency-name: serde-aux
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-27 12:27:37 +02:00
dependabot[bot] 7ceaba9328
chore(deps): bump syn from 1.0.80 to 1.0.81 (#535)
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.80 to 1.0.81.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.80...1.0.81)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-27 12:27:22 +02:00
dependabot[bot] d50fc88441
chore(deps): bump proc-macro2 from 1.0.30 to 1.0.32 (#534)
Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.30 to 1.0.32.
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.30...1.0.32)

---
updated-dependencies:
- dependency-name: proc-macro2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-27 12:27:14 +02:00
Matthias Seitz 241491a237
feat: add ethers-solc crate (#522)
* feat: initial draft dedicated solc crate

* feat: add sources helper

* feat: more utility functions

* chore: more ergonomics

* chore: more ergonomics

* rustfmt

* feat: add solc error

* feat: replace eyre with thiserror

* fix: use serde default

* fix: compliant semver

* docs: fix comments
2021-10-26 14:28:10 +03:00
Georgios Konstantopoulos 5ab0b7e0f4 feat(signer): expose Wallet::sign_hash 2021-10-25 16:45:39 +03:00
Georgios Konstantopoulos c3dec4a798 chore(etherscan): expose modules 2021-10-25 15:40:29 +03:00
dependabot[bot] d815dab9ad
chore(deps): bump tracing-subscriber from 0.2.25 to 0.3.0 (#529)
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.2.25 to 0.3.0.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.2.25...tracing-subscriber-0.3.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-25 10:38:48 +03:00
Alexey Shekhirin 0445414928
chore: update to Rust edition 2021 (#528) 2021-10-24 23:45:01 +03:00
Alexey Shekhirin cba1a85483
refactor(core, contract, etherscan): move Chain enum, use HashMap::from (#524)
* refactor(contract, etherscan): make use of HashMap::from

* feat(core): Chain enum

* rename unknown chain error

* reorg imports
2021-10-24 21:41:50 +03:00
Matthias Seitz 5779a3cdaf
feat: add ethabitype support for solidity style enums (#526)
* feat: tokenize solidity like enums

* test: add enum test

* rustfmt
2021-10-24 20:58:41 +03:00
Matthias Seitz b072b05515
fix: use debug fmt for nested arrays (#527) 2021-10-24 17:02:06 +03:00
Matthias Seitz dbd3929b74
test: add underscore test (#505)
* test: add underscore test

* test: ensure underscore fn names are correctly encoded against live contract

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-10-22 14:25:46 +03:00
Georgios Konstantopoulos ef9b3988ce
fix: ensure gas estimation includes the access list in 1559/2930 txs (#523)
* fix: ensure gas estimation includes the access list in 1559/2930 txs

* feat: add gas_price to typed tx

* feat: add access list to typed tx

* chore(providers): cleanup fill_transaction

* chore: fmt

* chore: enable 712 on ethers-contract at top level crate

* fix: do not error if eth_createAccessList is not available

* feat: only use access list if needed
2021-10-20 23:18:58 +03:00
Sebastian Martinez 9db36e59fb
fix: eip712 signing with ledger hw (#518)
* fix: eip712 signing with ledger hw

This commit fixes the way a EIP712 derived struct is sent to the
Ledger HW to obtain the signature.

It also checks if the Ledger ETH app is at least 1.6.0 since this
is a requirement.

* fix: apply cargo fmt

* fix: revert ledger eip712 test

* refactor: remove unused code

* test: add ledger eip712 test

* fix: cargo fmt

* fix: move the logic to app.rs

* feat: make sign_typed_data take a reference

* chore: ensure abigen is enabled in ledger tests

we need this to compile ethers-contract as a standalone package

* test: ensure that the ledger sig verifies

* test: pass foo_bar by ref

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-10-19 11:52:36 +03:00
dependabot[bot] 1d2ed0d964
chore(deps): bump reqwest from 0.11.5 to 0.11.6 (#521)
Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.5 to 0.11.6.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.5...v0.11.6)

---
updated-dependencies:
- dependency-name: reqwest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-19 08:23:48 +03:00
dependabot[bot] 0ba128ae5c
chore(deps): bump instant from 0.1.11 to 0.1.12 (#520)
Bumps [instant](https://github.com/sebcrozet/instant) from 0.1.11 to 0.1.12.
- [Release notes](https://github.com/sebcrozet/instant/releases)
- [Changelog](https://github.com/sebcrozet/instant/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sebcrozet/instant/compare/v0.1.11...v0.1.12)

---
updated-dependencies:
- dependency-name: instant
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-19 08:23:36 +03:00
Matthias Seitz c5a45f7bf4
feat: add abi type trait (#519)
* feat: add abi type trait

* rustfmt

* fix: fix imports

* feat: use const generic for u8 array

* rustfmt

* fix: imports
2021-10-18 23:24:53 +03:00
Matthias Seitz fb4d9a9ef1
feat: function call enums EthCall macro and more (#517)
* fix: do not sort event variants

* style: use deref over clone

* style: refactor some stuff

* feat: add ethcall trait

* feat: include in abigen

* feat: add bare bones eth call derive

* feat: impl EthCall derive

* feat: support enums

* feat: use abigen enum derive

* fix: concrete abi and map errors

* test: first call test

* rustfmt

* chore: use correct trait name on error

* feat: derive display for call structs

* feat: add from conversion

* test: add convert test

* chore: docs and test

* chore: update changelog

* cargo fix

* feat: add unit type derive support and more test

* chore: patch ethabi

* chore: rm ethabi patch

* feat: add encode/decode trait impls

* style: use AsRef<[u8]>

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

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

* style: reindent macro body

* test: add tuple event test

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-10-18 13:28:38 +03:00
Alexey Shekhirin 071a41605b
feat(etherscan): transaction endpoints (#512)
* feat(etherscan): transaction endpoints

* bump ethers-etherscan version to 0.1.1

* feat: replace anyhow::Result with thiserror strong types

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-10-17 13:01:20 +03:00
Matthias Seitz c3528b78db
fix: use syn::Index for tuple access (#515)
* fix: use syn::Index for tuple access

* rustfmt
2021-10-16 19:45:42 +03:00
Alexey Shekhirin 956a87a924
test(middleware): fix flapping gas oracle (#514)
* test(middleware): fix flapping gas oracle

* into > from
2021-10-16 18:47:17 +03:00
Matthias Seitz bef7960a2b
feat: add display support for events (#513)
* chore: move proc macro implementation to separate modules

* feat: add display derive macro

* chore: reexport hex

* feat: add EthDisplay

* test: add display test

* fix: use ? op

* feat: derive EthDisplay in abigen

* feat: derive display for event enum

* chore: update changelog
2021-10-16 16:42:17 +03:00
Matthias Seitz 4608ddd9fa
chore: move proc macro implementation to separate modules (#510) 2021-10-16 11:19:42 +03:00
Georgios Konstantopoulos 4996fa2ca4 docs: add telegram metadata (#509)
* docs: add telegram metadata

* docs: add crates meta
2021-10-15 17:45:01 +03:00
Georgios Konstantopoulos b96c73ac3b
chore: remove GasNow api since it's deprecated (#508)
:rip:
2021-10-15 14:05:54 +03:00
dependabot[bot] cb46b1afed
chore(deps): bump proc-macro2 from 1.0.29 to 1.0.30 (#504)
Bumps [proc-macro2](https://github.com/alexcrichton/proc-macro2) from 1.0.29 to 1.0.30.
- [Release notes](https://github.com/alexcrichton/proc-macro2/releases)
- [Commits](https://github.com/alexcrichton/proc-macro2/compare/1.0.29...1.0.30)

---
updated-dependencies:
- dependency-name: proc-macro2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-13 16:07:30 +03:00
Matthias Seitz 44bb02f857
feat: substitute overloaded functions (#501)
* feat: substitute overloaded functions

* chore: update changelog
2021-10-13 12:53:43 +03:00
Matthias Seitz ea8551da4c
feat: add support for multiple contract definitions in abigen macro (#498)
* feat: support multiple contracts in abigen

* fix: use correct events decl

* fix: parsing and tests

* test: add test

* chore: update changelog
2021-10-11 17:18:09 +03:00
dependabot[bot] 6d9b300b86
chore(deps): bump thiserror from 1.0.29 to 1.0.30 (#500)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.29 to 1.0.30.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.29...1.0.30)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-11 15:42:55 +03:00
dependabot[bot] 69c771c1c3
chore(deps): bump syn from 1.0.78 to 1.0.80 (#499)
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.78 to 1.0.80.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.78...1.0.80)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-11 15:42:47 +03:00
Rohit Narurkar 2255b877de
feat: impl Deserialize for block number (#497) 2021-10-11 15:42:10 +03:00
Matthias Seitz 6216b2e4a2
chore: remove unused && cargo fix (#496)
* chore: rm allows

* chore: cargo fix
2021-10-10 09:31:34 +01:00
Georgios Konstantopoulos 0c94b58cd5
chore: simplify eip712 example (#492)
* chore(contract): gate eip712

* examples: simplify permit hash

* chore: fmt
2021-10-08 17:31:42 +01:00
Ryan d7ab229a4c
derive-eip712: initial implementation of eip712 derive macro (#481)
* derive-eip712: initial implementation of eip712 derive macro

This commit provides an initial implementation for a derive macro
to encode typed data according to EIP-712, https://eips.ethereum.org/EIPS/eip-712

Additionally, this commit introduces a new signer trait method:

    async fn sign_typed_data<T: Eip712 + Send + Sync>(
        &self,
        payload: &T,
    ) -> Result<Signature, Self::Error>;

And implements the new method for each of the signers (wallet, ledger,
aws).

Additionally, these changes include using `WalletError` for the Wallet
signer error type

At the moment, derive does not recurse the primary type to find nested
Eip712 structs. This is something that is noted in the source and
currently responds with an error regarding custom types.

A subsequent PR should be opened once this issue becomes needed. For the
moment, the current implementation should satisfy non-nested, basic struct types.

* rename to ethers-derive-eip712; move to ethers-core

* refactor of derive-eip712 macro; use ParamType and EthAbiToken

* macro updates; add byte array checker for paramtype; use literal constant for domain type hash

* replace std::convert::Infallible with WalletError as Wallet signer error type

* update workspace members and dev dependencies for examples folder

* add example for eip712 and test against contract

* remove extraneous backward slash in '\x19\x01' prefix; example tests pass

* update unreleased change log

* remove print statements

* use parse_macro_input macro; remove dead code; handle nest struct not implemented error

* move eip712 example to solidity-contract tests folder; update cargo workspace dependencies

* allow optional EIP712Domain parameter when encoding eip712 struct and signing typed data

* add documentation for eip712 feature

* Update ethers-signers/src/ledger/mod.rs

Co-authored-by: Sebastian Martinez <me@sebastinez.dev>

* add error enum for Eip712Error; use sign_payload for ledger signer

* add EIP712WithDomain type for providing a wrapper around custom setting of the domain

* make LedgerWallet sign_payload public

* use optional feature gated dependencies for eip712; add default method for encode_eip712

* add default domain_separator method, pre-compute separator hash

* move derive-eip712 deps to dev deps

* remove invalid sign payload parameter, add await on async method

* remove deprecated comment

* debugging 'bad key handle' error for ledger signer

try using 'sign_message'

* await sign digest for aws signer

* remove extra space, fix fmt warning

* fix test, fmt errors

* use gt 0.6.0 pragma compiler version

* enable ABIEncoderV2 for solidity test contract

* chore: make test constructor public

Co-authored-by: Sebastian Martinez <me@sebastinez.dev>
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2021-10-08 16:22:51 +01:00
dependabot[bot] 06eb8f223c
chore(deps): bump reqwest from 0.11.4 to 0.11.5 (#490)
Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.4 to 0.11.5.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.4...v0.11.5)

---
updated-dependencies:
- dependency-name: reqwest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-08 15:15:41 +01:00
georgewhewell 7d2e900cbb
fix: allow clippy::redundant_clone and clippy::type_complexity in abigen (#491) 2021-10-08 15:14:16 +01:00
dependabot[bot] b93cc4af75
chore(deps): bump tracing from 0.1.28 to 0.1.29 (#488)
Bumps [tracing](https://github.com/tokio-rs/tracing) from 0.1.28 to 0.1.29.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-0.1.28...tracing-0.1.29)

---
updated-dependencies:
- dependency-name: tracing
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-06 16:58:23 +01:00
dependabot[bot] fdf07db0aa
chore(deps): bump tracing-subscriber from 0.2.24 to 0.2.25 (#487)
Bumps [tracing-subscriber](https://github.com/tokio-rs/tracing) from 0.2.24 to 0.2.25.
- [Release notes](https://github.com/tokio-rs/tracing/releases)
- [Commits](https://github.com/tokio-rs/tracing/compare/tracing-subscriber-0.2.24...tracing-subscriber-0.2.25)

---
updated-dependencies:
- dependency-name: tracing-subscriber
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-06 16:58:16 +01:00
Matthias Seitz 7d5ea2c1e3
feat: add etherscan client crate (#486)
* feat: add etherscan client crate

* fix: return response

* chore: rename evm version
2021-10-04 20:05:11 +01:00
Matthias Seitz 5d8b66a68f
feat: add general solc contract types (#484) 2021-10-04 07:45:32 +01:00
Georgios Konstantopoulos c7e4e0d433 chore: expose I256 functions 2021-10-02 23:53:17 +03:00
Alexey Shekhirin 1f17788133
feat(contract, abigen): support artifact format in proc macro (#480)
* feat(contract, abigen): support artifact format in proc macro

* don't change source abi_str
2021-10-02 20:16:55 +03:00