Commit Graph

101 Commits

Author SHA1 Message Date
DaniPopes 439a0c7de0
chore(deps): bump and use workspace dependencies (#2222)
* chore: update all deps

* chore: update dependabot

* chore: separate ethers package from workspace

* chore: package metadata

* chore: use package.*.workspace = true

* fix: docs.rs build

* chore: update examples manifests

* chore: use workspace dependencies for ethers-* crates

* fix: test

* chore: use workspace dependencies for all dependencies

* chore: pin rust-crypto

* chore: add license field to example crates

* fixes

* more fixes

* fix: test

* last fixes

* fix: wasm

* fix: docs.rs build

* fix

* fix: wasm-pack error

see also https://github.com/rustwasm/wasm-pack/issues/1238

* fix: wasm deps and example

* ci: update

* fix: wasm tests

* fix: eip712 tests

* fix: windows ci

* fix

* chore: update docsrs metadata

* chore: bump version to match crates.io

* chore: rm bad release.toml config

* chore: rm release.toml

bad configuration

* chore: add exclude to workspace

* fix: middleware

* fix: solc feature flags

* chore: run cargo upgrade

* chore: update deps

* chore: update remaining deps

* undo fix

* update lock

* bump yubi

* fix: update coins-* and fix spki breaking changes
2023-03-16 12:28:35 -07:00
Matthias Seitz 304fe0988d
chore(clippy): make clippy happy (#2264)
* chore(clippy): make clippy happy

* chore: silence clippy fp

---------

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2023-03-15 16:12:34 -07:00
Georgios Konstantopoulos 18a049b4c4
chore: bump crypto deps (#2260)
* chore(core): bump k256

* fix: use correct recovery api

* fix(signers): use correct apis

* chore(signers): bump elliptic curve

* feat: use PreHashSigner

* feat: bump yubihsm and adjust for breakages

* chore: clippy
2023-03-14 23:13:46 -07:00
StackOverflowExcept1on 11287f4941
bump coins-bip39 to 0.8.1 and coins-bip32 to 0.8.0 (#2246) 2023-03-13 12:42:25 -07:00
DaniPopes fbf8acb6a5
fix: udeps (#2215) 2023-02-28 18:25:25 -07:00
DaniPopes da743fc8b2
ci/test: improve CI jobs and tests (#2189)
* ci: move to scripts directory

* nits

* ci: improve main CI jobs

* fix: install script

* fix

* fix: use curl for windows installation

* fix: wasm typo

* tests: move to single binary

* chore: clippy

* chore: clippy

* chore: clippy

* fix: test command

* fix: quote tests

* update script

* fix: action exclude

* fix: dev deps

* fix: only run wasm in own job

* ci: add aarch64 targets

* test: rm useless test

* ci: update security audit

* ci: add deny CI

* chore: rm unused audit.toml

* chore: update geth.rs

* ci: remove unusable targets

* fix: install script path

* fix: wasm

* improve script

* fix: failing ci

* fix: contract tests

* ci: improve install script

* update middleware tests

* move integration etherscan tests to tests/ dir

* fix: eip2930 access_list field name

* add pendingtransaction must_use

* add random anvil comment

* ci: add miri job

* ci: simplify

* fixci

* Revert "add pendingtransaction must_use"

This reverts commit 770b21b4a3.

* fix: macos script

* fix: use curl in script

* unused ci

* update script

* fix wasm

* rm_miri

* fix: signer test

* fix: wasm ci

* fix: ipc test

* fix: live celo tests

* fix: abi online source test

* fix: windows paths in test

* chore: update serial_test

* ci: run live tests separately

* fix: provider tests

* fix: unused var

* fix: feature

* fix merge

* fix: etherscan key tests

* ci: rm duplicate audit

* fix: split etherscan test ci

* fix: etherscan test

* fix: generate multiple unused ports

* fix: source test

* fix: udeps

* rm unused
2023-02-28 17:26:27 -07:00
Matthias Seitz 936fbcd287
test: add parse pk test (#2194) 2023-02-27 13:20:41 -07:00
James Prestwich cc3156db7a
Workaround for https://github.com/LedgerHQ/app-ethereum/issues/409 (#2192)
* fix: edge cases and workarounds for ledger signer

* feat: add tracing to ledger signer

* chore: Changelog
2023-02-27 13:13:55 -07:00
DaniPopes 203e350940
docs: fix broken links, update documentation (#2203)
* docs: fix broken links

* docs: update READMEs and module-level documentation
2023-02-27 13:03:17 -07:00
Yiannis M 0a7e7423e2
feat(signers): Allow parsing of private key that has `0x` prefix (#2037) 2023-01-11 19:41:41 -08:00
Gyuho Lee 04e3021dc0
ethers-signers/aws: sighash on the inner/updated tx object (#1977)
Signed-off-by: Gyuho Lee <gyuho.lee@avalabs.org>

Signed-off-by: Gyuho Lee <gyuho.lee@avalabs.org>
2023-01-03 16:09:08 +02:00
0xKitsune f94e6f549f
added `from_bytes` for `Wallet` type (#1983)
* added `from_bytes` for `Wallet` type

* added key_from_bytes test for Wallet::from_bytes

* updated changelog
2022-12-30 14:45:19 +02:00
Jared Tokuz a88d2d03e3
refac: change awsSigner to own kmsclient (#1922) 2022-12-02 19:06:06 -08:00
DaniPopes debd6fec3d
chore: clippy (#1812)
* chore: clippy

* fmt
2022-11-07 15:43:11 -08:00
DaniPopes 0734fce48c
fix(contract, signers): cyclic deps (#1730)
* fix(signers): cyclic deps

* fix(contract): cyclic deps

* fix: feature
2022-09-24 12:41:04 -07:00
DaniPopes 733c5d3dfd
fix(contract): relax Middleware trait bound for getters (#1728)
* wip

* fix(contract): relax Middleware trait bound for getters

* chore: clippy

* move

* fix: multicall
2022-09-23 17:32:24 -07:00
Matthias Seitz 6a86d4ff22
chore(clippy): make clippy happy (#1659) 2022-09-04 10:57:52 -07:00
Matthias Seitz 608fd841c5
chore(clippy): make clippy happy (#1595) 2022-08-13 14:03:23 -07:00
moh-eulith cff1ce4068
Derive Clone on Wallet (#1573) 2022-08-08 10:30:13 -07:00
Matthias Seitz c75608eda1
ci: rm pinned nightly (#1541)
* ci: rm pinned nightly

* chore(clippy): make clippy happy
2022-07-31 19:00:31 -07:00
moh-eulith b74a38eaad
fmt (#1539) 2022-07-31 11:21:23 -07:00
moh-eulith 7306a3c360
Add a simple constructor for Wallet (#1530)
* Add a simple constructor for Wallet

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

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-07-30 16:01:02 -07:00
Matthias Seitz 0b88e4246d
deps: bump crypto deps (#1465) 2022-07-06 14:11:23 -07:00
Luke Tchang 4d9916570f
fix(signers): aws eip712 does not use eip155 (#1309)
* fix(signers): aws eip712 does not use eip155

* chore: update changelog

* chore: lints

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-05-25 14:15:00 -07:00
Dan Cline 799660bd26
fix(signer): use wallet chainid for tx signing (#1308)
* add a test checking that the wallet outputs a signature with a
   correct v
2022-05-25 14:10:07 -07:00
Matthias Seitz cffcc7bbec
chore(clippy): fix newest nightly lints (#1298) 2022-05-22 15:18:57 -07:00
Georgios Konstantopoulos 25834c7f74 fix: pass tx with chain by ref 2022-05-02 22:35:41 +03:00
Max da38083013
Fix: Ledger should have correct signature v value for chains with large chain ID (#1204)
* fix: Ledger should have correct signature v value

* format code

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2022-05-02 11:53:11 -07:00
Dan Cline d5de795382
Use EIP155 for all signers with empty transaction `chain_id` (#1198)
* remove error when signing with a different chain

 - a chain_id mismatch between the signer and the transaction is valid
   since the behavior is the same between two signers with different
   chain ids
 - a specified chain_id should be signed regardless of the chain_id of
   the signer
 - refactor `sign_hash` to no longer take an `eip155` flag - it now
   _just_ signs hashes. EIP155 is specific to transactions, so we
   now normalize the `v` value in `sign_transaction_sync`

* use signer chain_id for tx in trezor signer

 - use the trezor signer's chain_id if the transaction's chain_id
   doesn't exist
 - sets the chain_id in both `sign_tx` and the Signer implementation's
   `sign_transaction`

* use signer chain_id for tx in ledger signer

 - use the ledger signer's chain_id if the transaction's chain_id
   doesn't exist
 - sets the chain_id in both `sign_tx` and the Signer implementation's
   `sign_transaction`

* prefer transaction chain_id in aws signer

 - uses the signer chain_id if the transaction chain_id doesn't exist
 - refactor `sign_digest_with_eip155` to take an input chain_id, so the
   signer chain_id is not used every time. If we want to enforce
   transaction and signer chain ids to be consistent, this should be
   undone

* add private key signing test for an empty chain_id

* Apply suggestions from code review

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

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

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2022-05-02 11:51:25 -07:00
Luke Tchang b3679fe113
fix: aws signer does not throw error on unnormalized sig (#1099)
* fix: reverts aws signer fix around sig normalization

* chore: update changelog
2022-03-31 10:04:28 -07:00
Dan Cline 842f4d260f
feat(core): add dev as a chain (#1093)
adds a new error message to etherscan if the user tries to create an
etherscan client with a 1337/ganache/dev chain
2022-03-30 11:20:23 -07:00
Matthias Seitz 916e9a7334
chore(clippy): add some deny lints (#1064)
* feat: add deny lints

* trim ethers core

* trim ethers eip712

* deny ethers contract derive

* deny ethers contract abigen

* deny ethers contract

* deny ethers providers

* chore: add denies and fix unused deps

* doc: fix links

* fix: wasm build

* doc: fix links

* doc: fix links

* doc: fix inline doc links

* docs: fix intra doc links
2022-03-19 10:05:39 -07:00
Rohit Narurkar 17d5b0ef38
Chore/update eth keystore (#910)
* chore(signers): bump up eth-keystore

* doc(signers): update doc for new_keystore

* chore: add changelog
2022-02-14 12:08:33 +02:00
Matthias Seitz cc5c67ed0a
chore: fix all warnings (#890) 2022-02-10 08:54:39 +02:00
Dan Cline 01544ec4b7
Implement RLP decoding for transactions (#805)
* Implement RLP decoding for transactions

* set chain_id in fill_transaction
2022-01-30 21:21:16 +02:00
Georgios Konstantopoulos 0c949f65bb chore: lints 2022-01-29 21:19:49 +02:00
joshieDo c6b51e3ae0
feat/trezor: cache session on filesystem (#747)
* save and read from cache

* fix

* read/write from/to file directly

* add cache_dir to TrezorEthereum

* fmt & clippy
2021-12-30 01:38:29 +02:00
Georgios Konstantopoulos 568d9c8697
Update Cryptography crates (#617)
* fix(core): use new k256 for pubkey calculation

* fix(core): deserialize moonbeam keys with new fn

* chore(signers): update crypto crates

* chore: update cargo lock

* ci: remove libudev req

* chore: cargo fmt

* chore: fix outstanding yubihsm errors
2021-12-21 00:41:57 +02:00
Matthias Seitz e24117a1e1
chore(clippy): make clippy happy (#705) 2021-12-19 06:28:38 +02:00
joshieDo 5bf3f73548
fix: contract creation on trezor (#695)
* fix contract creation on trezor

* handle when _to_ param is an empty string

* return TrezorError when receiving an ENS name

* fix typo
2021-12-15 19:52:06 +02:00
joshieDo ebf52934e4
fix handling empty tx parameters (#686) 2021-12-13 19:39:24 +02:00
joshieDo 6bf325dcab
feat: trezor support (#663)
* added trezor signer

* linting

* TrezorHDPath instead of HDPath

* update trezor_client rev. added compatible hidapi backend

* remove unused variables

* keep track of the client session_id

* add to Other derivation paths to trezor

* remove commented macro

* remove unnecessary drops

* no ens

* added TrezorTransaction that loads from TypedTransaction

* enforce minimum firmware version

* add big data test to trezor app

* clippy

* replace trezor-client git with published crate

* change one char string to char

* bump trezor-client, with ethereum feature only
2021-12-13 08:23:01 -07:00
Matthias Seitz 59cf991828
feat(abigen): use structs for outputs (#664)
* feat(abigen): use structs for outputs

* update CHANGELOG

* make clippy happy

* fix lints
2021-12-09 16:00:59 -07:00
Georgios Konstantopoulos bb3a2fd27c
release: 0.6.0 (#611)
* release(core): 0.6.0

* release(providers): 0.6.0

* release(contract-abigen): 0.6.0

* release(contract-derive): 0.6.0

* release(derive-eip712): 0.2.0

* release(ethers-solc): 0.1.0

* release(contract): 0.6.0

* release(etherscan): 0.2.0

* release(signers): 0.6.0

* release(middleware): 0.6.0

* chore: update dev deps

* refactor(core): move docs to readme

* refactor(contract): move docs to readme

* refactor(providers): move docs to readme

* chore: bump ethers cargo toml

* refactor(signers): move docs to readme

* refactor(middleware): move docs to readme

* fix(ethers): adjust re-exports to allow searching internal packages

* docs: fix broken links

we cannot use relative crate imports because the readmes
are also imported by the parent crate

* alias readmes to be accessible to ethers crate
2021-11-23 21:23:12 +02:00
Rohit Narurkar 6cd5625787
(fix): new_keystore returns uuid as well (#559)
* (fix): new_keystore returns uuid as well

* (chore): add changelog for the changes

* (chore): revert fmt change pushed accidentally

* (chore): remove 2nd fmt change pushed accidentally
2021-11-05 12:28:16 +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
Georgios Konstantopoulos 5ab0b7e0f4 feat(signer): expose Wallet::sign_hash 2021-10-25 16:45:39 +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
Matthias Seitz 6216b2e4a2
chore: remove unused && cargo fix (#496)
* chore: rm allows

* chore: cargo fix
2021-10-10 09:31:34 +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