* 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>
* chore(core): remove ethers dep
* chore(providers): remove ethers dep
tests using higher-rank crates are temporarily disabled
* chore(middleware): remove ethers dep and move tests over from providers
* chore(signers): remove ethers dep
* fix(contracts): correctly determine ethers sub-crates & remove ethers
* fix: re-enable tests for all members
* fix: make contract compile without middleware dep
move over the test using middleware to ethers-middleware
* chore: cargo fmt
* chore(contract): add missing import
* WIP
* WIP
* fix(middleware): use rustls as dev dep
* chore: cargo fmt
* fix: use different key for nonce manager to avoid nonce conflicts
* chore: fix celo test ported over to middlewares
the test had the same private key with an existing middleware test,
causing potential nonce reuses
it now also uses a different storage contract, so we had to change
it to use u256 instead of string
* fix(middleware): enable contracts/celo feature
* chore: ignore non-eip2718 txs to rinkeby
* feat: partial wasm32 support
* make compile for wasm32
* feat: att async-trait attr
* make compatible with wasm
* add type alias for archs
* rustfmt
* add wasm ci
* make compile with wasm-pack test
* make compile with wasm-pack test
* make compile with wasm-pack test
* make compile with wasm-pack test
* ci: disable wasmpack
* feat: use wasm timer delay
* feat: add wasm provider
* rustfmt
* misc refactor
* add wasm example
* make example a directory
* untrack error log
* move profile to root
* fix unused imports
* ci: enable wasm-pack test
* style: unify websocket implementations
* fix: typos
* fix: make policy compatible with wasm target
* chore: do not include ethers-wasm example as top level workspace member
* chore: modify wasm32 dependencies
* chore: make note about getrandom
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
* feat(contract): use eip-1559 txs by default
This may break any tests which use Ganache, since it only supports legacy transactions.
We should replace Ganache with hardhat where possible
* fix(providers): always try setting default_sender
* chore: make all test transactions legacy
* feat(multicall): allow submitting legacy txs
* chore: default to legacy txs via feature flag
This is useful for chains like Celo that do not support the Typed Envelope
* fix: use legacy txs in ds proxy deployment / tests
* chore: fix review comments
* feat(providers): add eth_feeHistory api
* add access list
* feat: fill transactions with access list / default sender info
* feat: add helpers for operating on the txs enum
* feat: send_transaction takes TypedTransaction now
* fix(contract): temp wrap all contract txs as Legacy txs
* feat(middleware): use TypedTransaction in Transformer
* feat(signers): use TypedTransaction in Wallet/Ledger
* feat(core): add helpers for setting typed tx fields
* feat(signer): use typed transactions
* fix(middleware): adjust nonce/gas/escalators for TypedTxs
The GPO and the Escalators will throw an error if they are provided an EIP1559 transaction
* fix(providers): ensure the correct account's nonce is filled
* fix: add .into() to txs until we make the fn call more generic
* Revert "fix: add .into() to txs until we make the fn call more generic"
This reverts commit 04dc34b26d0e3f418ed3fc69ea35ad538b83dd50.
* feat: generalize send_transaction interface
* fix: only set the nonce manually in the Signer middleware
* fix(transformer): fill the transaction after transformation
* chore: fix compilation errors & lints
* fix(signer): set the correct account's nonce
* feat: make trace_call / call take TypedTransaction
* fix: set sender to transaction in signer
* chore: ethgasstation broke
* chore: cargo fmt / lints
* Fix(signer): pass the chain id
* fix: final tx encoding fixes
1. Normalize v values for eip1559/2730
2. Make access lists mandatory for 1559
3. do not double-rlp on rlp_signed
* fix: set access list only if available
* test: check 1559 / 2930 txs
* fix: do not prepend a 0 for Legacy txs & test
* chore: code review comments
* chore: fix aws signer signature
* chore: update deps (#352)
* chore(deps): bump elliptic-curve from 0.10.4 to 0.10.5
Bumps [elliptic-curve](https://github.com/RustCrypto/traits) from 0.10.4 to 0.10.5.
- [Release notes](https://github.com/RustCrypto/traits/releases)
- [Commits](https://github.com/RustCrypto/traits/compare/elliptic-curve-v0.10.4...elliptic-curve-v0.10.5)
---
updated-dependencies:
- dependency-name: elliptic-curve
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
* chore: bump deps
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* fix(core): make chain id mandatory
* fix(signers): make chain id mandatory
* test: make chain id mandatory
* test: add missing chain id
* fix: add missing chain id
* chore(wallet): set chain_id by default to 1
* ci: run CI on master
* fix(yubi): add missing chain id
* chore: skip ganache test with celo features
* ci: run only on push to master
* fix: add missing chain id
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Update crypto deps for ethers
* Update version 0.4.0
* Missed a version
* Fix internal version dependencies
* chore: use published eth-keystore-rs
Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>