2021-08-21 12:34:21 +00:00
|
|
|
[package]
|
|
|
|
name = "ethers"
|
2022-11-27 20:27:58 +00:00
|
|
|
version = "1.0.2"
|
2022-09-18 15:45:45 +00:00
|
|
|
edition = "2021"
|
2022-12-18 11:41:11 +00:00
|
|
|
rust-version = "1.64" # must also be changed in **/Cargo.toml and .clippy.toml
|
2021-08-21 12:34:21 +00:00
|
|
|
authors = ["Georgios Konstantopoulos <me@gakonst.com>"]
|
|
|
|
license = "MIT OR Apache-2.0"
|
2021-08-28 23:53:10 +00:00
|
|
|
readme = "README.md"
|
2021-08-21 12:34:21 +00:00
|
|
|
documentation = "https://docs.rs/ethers"
|
|
|
|
repository = "https://github.com/gakonst/ethers-rs"
|
|
|
|
homepage = "https://docs.rs/ethers"
|
2022-09-18 15:45:45 +00:00
|
|
|
description = "Complete Ethereum library and wallet implementation in Rust."
|
2020-05-22 18:37:21 +00:00
|
|
|
|
2021-08-21 12:34:21 +00:00
|
|
|
[workspace]
|
2020-05-26 09:37:31 +00:00
|
|
|
members = [
|
2022-01-07 10:12:21 +00:00
|
|
|
"ethers-addressbook",
|
2021-08-21 12:34:21 +00:00
|
|
|
"ethers-contract",
|
|
|
|
"ethers-providers",
|
|
|
|
"ethers-signers",
|
|
|
|
"ethers-core",
|
|
|
|
"ethers-middleware",
|
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 15:22:51 +00:00
|
|
|
"ethers-etherscan",
|
2021-12-03 17:27:55 +00:00
|
|
|
"ethers-solc",
|
2022-09-28 18:58:26 +00:00
|
|
|
"examples/ethers-wasm",
|
2021-08-21 12:34:21 +00:00
|
|
|
]
|
|
|
|
|
2021-08-28 00:54:46 +00:00
|
|
|
default-members = [
|
2022-01-07 10:12:21 +00:00
|
|
|
"ethers-addressbook",
|
2021-08-28 00:54:46 +00:00
|
|
|
"ethers-contract",
|
|
|
|
"ethers-providers",
|
|
|
|
"ethers-signers",
|
|
|
|
"ethers-core",
|
|
|
|
"ethers-middleware",
|
2021-10-26 11:28:10 +00:00
|
|
|
"ethers-etherscan",
|
2022-09-28 18:58:26 +00:00
|
|
|
"ethers-solc",
|
2021-08-23 09:56:44 +00:00
|
|
|
]
|
2021-08-21 12:34:21 +00:00
|
|
|
|
2022-10-25 18:12:50 +00:00
|
|
|
[package.metadata.docs.rs]
|
|
|
|
all-features = true
|
|
|
|
rustdoc-args = ["--cfg", "docsrs"]
|
|
|
|
|
|
|
|
[package.metadata.playground]
|
|
|
|
features = ["full"]
|
|
|
|
|
2021-08-21 12:34:21 +00:00
|
|
|
[features]
|
2022-09-09 23:19:29 +00:00
|
|
|
default = ["abigen"]
|
|
|
|
|
2021-08-21 12:34:21 +00:00
|
|
|
celo = [
|
|
|
|
"ethers-core/celo",
|
|
|
|
"ethers-providers/celo",
|
|
|
|
"ethers-signers/celo",
|
|
|
|
"ethers-contract/celo",
|
|
|
|
"ethers-middleware/celo",
|
2022-09-28 18:58:26 +00:00
|
|
|
"legacy",
|
2020-05-26 09:37:31 +00:00
|
|
|
]
|
2021-08-21 12:34:21 +00:00
|
|
|
|
2022-09-18 15:45:45 +00:00
|
|
|
legacy = ["ethers-core/legacy", "ethers-contract/legacy"]
|
2021-08-21 12:34:21 +00:00
|
|
|
|
|
|
|
# individual features per sub-crate
|
|
|
|
## core
|
2021-10-20 20:18:58 +00:00
|
|
|
eip712 = ["ethers-contract/eip712", "ethers-core/eip712"]
|
2021-08-21 12:34:21 +00:00
|
|
|
## providers
|
|
|
|
ws = ["ethers-providers/ws"]
|
|
|
|
ipc = ["ethers-providers/ipc"]
|
2022-09-18 15:45:45 +00:00
|
|
|
rustls = [
|
2022-12-21 14:44:42 +00:00
|
|
|
"ethers-middleware/rustls",
|
2022-09-18 15:45:45 +00:00
|
|
|
"ethers-providers/rustls",
|
|
|
|
"ethers-etherscan/rustls",
|
|
|
|
"ethers-contract/rustls",
|
2022-09-28 18:58:26 +00:00
|
|
|
"ethers-solc/rustls",
|
2022-09-18 15:45:45 +00:00
|
|
|
]
|
|
|
|
openssl = [
|
2022-12-21 14:44:42 +00:00
|
|
|
"ethers-middleware/openssl",
|
2022-09-18 15:45:45 +00:00
|
|
|
"ethers-providers/openssl",
|
|
|
|
"ethers-etherscan/openssl",
|
|
|
|
"ethers-contract/openssl",
|
2022-09-28 18:58:26 +00:00
|
|
|
"ethers-solc/openssl",
|
2022-09-18 15:45:45 +00:00
|
|
|
]
|
2021-12-03 17:11:09 +00:00
|
|
|
dev-rpc = ["ethers-providers/dev-rpc"]
|
2021-08-21 12:34:21 +00:00
|
|
|
## signers
|
|
|
|
ledger = ["ethers-signers/ledger"]
|
2021-12-13 15:23:01 +00:00
|
|
|
trezor = ["ethers-signers/trezor"]
|
2021-08-21 12:34:21 +00:00
|
|
|
yubi = ["ethers-signers/yubi"]
|
|
|
|
## contracts
|
|
|
|
abigen = ["ethers-contract/abigen"]
|
2021-11-14 12:27:05 +00:00
|
|
|
### abigen without reqwest
|
|
|
|
abigen-offline = ["ethers-contract/abigen-offline"]
|
2021-11-03 08:05:09 +00:00
|
|
|
## solc
|
2022-07-06 21:11:56 +00:00
|
|
|
solc-full = ["ethers-solc", "ethers-solc/full"]
|
|
|
|
solc-tests = ["ethers-solc", "ethers-solc/tests"]
|
|
|
|
solc-sha2-asm = ["ethers-solc", "ethers-solc/asm"]
|
2021-08-21 12:34:21 +00:00
|
|
|
|
|
|
|
[dependencies]
|
2022-10-25 18:02:59 +00:00
|
|
|
ethers-addressbook = { version = "^1.0.0", default-features = false, path = "./ethers-addressbook" }
|
2022-10-25 18:03:00 +00:00
|
|
|
ethers-contract = { version = "^1.0.0", default-features = false, path = "./ethers-contract" }
|
2022-10-25 18:02:59 +00:00
|
|
|
ethers-core = { version = "^1.0.0", default-features = false, path = "./ethers-core" }
|
2022-10-25 18:03:00 +00:00
|
|
|
ethers-providers = { version = "^1.0.0", default-features = false, path = "./ethers-providers" }
|
2022-10-25 18:03:00 +00:00
|
|
|
ethers-signers = { version = "^1.0.0", default-features = false, path = "./ethers-signers" }
|
2022-10-25 18:03:01 +00:00
|
|
|
ethers-middleware = { version = "^1.0.0", default-features = false, path = "./ethers-middleware" }
|
2022-10-25 18:03:00 +00:00
|
|
|
ethers-solc = { version = "^1.0.0", default-features = false, path = "./ethers-solc", optional = true }
|
2022-10-25 18:03:01 +00:00
|
|
|
ethers-etherscan = { version = "^1.0.0", default-features = false, path = "./ethers-etherscan" }
|
2021-08-21 12:34:21 +00:00
|
|
|
|
2022-10-25 18:12:50 +00:00
|
|
|
[dev-dependencies]
|
|
|
|
ethers-contract = { version = "^1.0.0", default-features = false, path = "./ethers-contract", features = [
|
|
|
|
"abigen",
|
|
|
|
"eip712",
|
|
|
|
] }
|
|
|
|
ethers-providers = { version = "^1.0.0", default-features = false, path = "./ethers-providers", features = [
|
|
|
|
"ws",
|
|
|
|
] }
|
|
|
|
|
2021-12-13 21:25:10 +00:00
|
|
|
[target.'cfg(target_family = "unix")'.dev-dependencies]
|
2022-10-25 18:03:00 +00:00
|
|
|
ethers-providers = { version = "^1.0.0", default-features = false, path = "./ethers-providers", features = [
|
2022-09-18 15:45:45 +00:00
|
|
|
"ws",
|
2022-09-28 18:58:26 +00:00
|
|
|
"ipc",
|
2022-09-18 15:45:45 +00:00
|
|
|
] }
|
2022-03-17 12:10:15 +00:00
|
|
|
eyre = "0.6"
|
2022-02-15 20:32:38 +00:00
|
|
|
rand = "0.8.5"
|
2021-08-21 12:34:21 +00:00
|
|
|
serde = { version = "1.0.124", features = ["derive"] }
|
|
|
|
serde_json = "1.0.64"
|
2022-05-29 00:54:45 +00:00
|
|
|
tokio = { version = "1.18", features = ["macros", "rt-multi-thread"] }
|
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 15:22:51 +00:00
|
|
|
hex = "0.4.3"
|
2022-11-22 21:15:45 +00:00
|
|
|
bytes = "1.3.0"
|
2021-12-03 17:27:55 +00:00
|
|
|
|
|
|
|
# profile for the wasm example
|
|
|
|
[profile.release.package.ethers-wasm]
|
|
|
|
# Tell `rustc` to optimize for small code size.
|
2021-12-19 14:56:54 +00:00
|
|
|
opt-level = "s"
|
2022-04-04 22:33:06 +00:00
|
|
|
|
2022-07-06 21:11:56 +00:00
|
|
|
[[example]]
|
|
|
|
name = "abigen"
|
|
|
|
path = "examples/abigen.rs"
|
|
|
|
required-features = ["ethers-solc"]
|
|
|
|
|
2022-04-04 22:33:06 +00:00
|
|
|
[[example]]
|
|
|
|
name = "contract_human_readable"
|
|
|
|
path = "examples/contract_human_readable.rs"
|
2022-07-06 21:11:56 +00:00
|
|
|
required-features = ["ethers-solc"]
|
2022-04-04 22:33:06 +00:00
|
|
|
|
|
|
|
[[example]]
|
|
|
|
name = "contract_with_abi"
|
|
|
|
path = "examples/contract_with_abi.rs"
|
2022-07-06 21:11:56 +00:00
|
|
|
required-features = ["ethers-solc"]
|
2022-04-04 22:33:06 +00:00
|
|
|
|
|
|
|
[[example]]
|
|
|
|
name = "contract_with_abi_and_bytecode"
|
|
|
|
path = "examples/contract_with_abi_and_bytecode.rs"
|
2022-07-06 21:11:56 +00:00
|
|
|
required-features = ["ethers-solc"]
|
2022-04-04 22:33:06 +00:00
|
|
|
|
|
|
|
[[example]]
|
|
|
|
name = "ipc"
|
|
|
|
path = "examples/ipc.rs"
|
|
|
|
required-features = ["ipc"]
|
|
|
|
|
|
|
|
[[example]]
|
|
|
|
name = "ledger"
|
|
|
|
path = "examples/ledger.rs"
|
|
|
|
required-features = ["ledger"]
|
|
|
|
|
|
|
|
[[example]]
|
|
|
|
name = "moonbeam_with_abi"
|
|
|
|
path = "examples/moonbeam_with_abi.rs"
|
2022-07-06 21:11:56 +00:00
|
|
|
required-features = ["legacy", "ethers-solc"]
|
2022-04-04 22:33:06 +00:00
|
|
|
|
|
|
|
[[example]]
|
|
|
|
name = "trezor"
|
|
|
|
path = "examples/trezor.rs"
|
|
|
|
required-features = ["trezor"]
|
|
|
|
|
|
|
|
[[example]]
|
|
|
|
name = "yubi"
|
|
|
|
path = "examples/yubi.rs"
|
2022-05-13 20:10:05 +00:00
|
|
|
required-features = ["yubi"]
|
2022-06-01 15:22:39 +00:00
|
|
|
|
|
|
|
[[example]]
|
|
|
|
name = "paginated_logs"
|
|
|
|
path = "examples/paginated_logs.rs"
|
|
|
|
required-features = ["rustls"]
|
2022-11-09 16:09:03 +00:00
|
|
|
|
|
|
|
[[example]]
|
|
|
|
name = "subscribe_contract_events"
|
|
|
|
path = "examples/subscribe_contract_events.rs"
|
|
|
|
required-features = ["rustls", "ws"]
|
|
|
|
|
|
|
|
[[example]]
|
|
|
|
name = "subscribe_contract_events_with_meta"
|
|
|
|
path = "examples/subscribe_contract_events_with_meta.rs"
|
|
|
|
required-features = ["rustls", "ws"]
|