Commit Graph

50 Commits

Author SHA1 Message Date
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
Matthias Seitz 42bf98330b
feat: support human readable struct inputs (#482)
* feat: keep track of custom types in abi parser

* feat: use internal structs for abi parsers

* test: add human readable struct input test

* chore: update changelog

* fix conflicts

* fix: remove eprintln

* make clippy happy

* make clippy happy

* rustfmt

* make clippy happy
2021-10-02 17:34:01 +03:00
Alexey Shekhirin 4036f45f3d
feat(contract, abigen): support Hardhat ABI format (#478) 2021-09-30 11:27:24 +03:00
Georgios Konstantopoulos 8574e6a376
release: 0.5.3 (#471)
* release: version 0.5.3

* chore: update changelog
2021-09-27 13:20:10 +03:00
Matthias Seitz 32c75ab1f5
fix: cleanup lock file after exec cargo metadata (#431)
* fix: cleanup lock file after exec cargo metadata

* fix typos
2021-09-05 13:19:08 +03:00
TannrA 32ad5a6abd
Event aliasing for contract bindings (#425)
* contracts: enable event aliases for Abigen

* contract: unit tests for event aliases

* contract: cleanup expand_event function

* Address pr suggestions

* contracts: remove unnecessary clone

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

* Make clippy happy

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2021-09-03 18:57:40 +03:00
Georgios Konstantopoulos 9df4d21d3b
(cargo-release) version 0.5.1 (#414) 2021-08-29 02:53:10 +03:00
Georgios Konstantopoulos 6cc20688d0
fix(abigen): generate correct imports depending on ethers crate usage (#413) 2021-08-28 21:53:01 +03:00
Matthias Seitz d35444cc49
feat: add wasm http provider support (#403)
* fix: use on wasm only

* feat: enable http provider in wasm

* add http example

* chore: add more verbosity to example

* fix: double webpack issue

* use mnemonic builder
2021-08-24 01:28:05 +03:00
Nick Hynes 26324343ec
fix: use once_cell with feature=std in abigen (#401) 2021-08-23 14:50:55 +03:00
Matthias Seitz ea566663d4
feat: wasm support (#390)
* 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>
2021-08-23 12:56:44 +03:00
Georgios Konstantopoulos 6cb7cac675
Release: 0.4 (#382)
* fix(abigen): use `no_deps` to avoid touching a Cargo.lock

* fix: use once_cell default features

* release: publish versions

core/providers/signers: 0.4.6
contract: 0.4.7
middleware: 0.4.8
ethers: 0.4.0
2021-08-16 11:54:12 +03:00
Matthias Seitz ba5f650dec
feat: generate rust structs from solidity JSON ABI (#378)
* add raw abi model

* feat: simplify struct representation

* feat: add struct generation

* use structs as function input

* fix: failing test

* add example

* rustfmt
2021-08-16 10:29:44 +03:00
Matthias Seitz 109a6b85ee
fix: only wrap single struct param in a tuple (#368) 2021-08-11 03:21:30 +03:00
Georgios Konstantopoulos 746d8b7bf2
chore(abigen): allow clippy enum variant names (#364) 2021-08-06 15:47:57 +03:00
Matthias Seitz b0b4f4e09e
feat: detect ethers crate paths in derive macros (#366)
* feat: determine ethers crate name using metadata

* use crate detection
2021-08-06 15:47:17 +03:00
Matthias Seitz 9d38d1a412
fix: convert tuple arguments to tuples (#363) 2021-08-02 18:24:22 +02:00
Matthias Seitz ed83223b93
cargo clippy --fix (#346) 2021-07-24 21:53:40 +03:00
Zaki Manian 371b7d1576
Update crypto deps for ethers (#333)
* 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>
2021-07-07 20:18:14 +03:00
Georgios Konstantopoulos 33a39cff86
fix: remove dependency on curl (#285) 2021-05-01 21:26:37 +03:00
Matthias Seitz 32b4e9e3f5
fix(abigen): add indexed attribute when deriving EthEvent (#255)
* fix(abigen): add indexed attribute when deriving EthEvent

* chore(clippy): make clippy happy
2021-04-02 08:46:39 +03:00
Matthias Seitz 816c5fc071
feat(abigen): extend ethevent trait methods and decoding (#239)
* feat: extend EthEvent with decode_log method and support indexed proc
macro attributes

* test: check that ethevent proc macro attributes compile

* docs: document EthEvent proc macro attributes and add example

* refactor: change decode_log to take a reference

* refactor: use ethers as fully qualified path

* feat: add events enum generation

* feat: introduce EthLogDecode trait

* feat: generate EthLogDecode implementations

* refactor: use fully qualified syntax during abigen

* fix: switch to new Event builder

* fix: make test compile again

* test: update failing tests

* refactor: rename event function

* chore(clippy): make clippy happy

* fix: rename the event correctly

* fix: add missing indexed attribute

* Revert "fix: rename the event correctly"

This reverts commit 03eabc3ead.

* fix: make indexed names optional

* fix: dsproxy name

* fix: rename ethers top level module imports
2021-03-19 17:44:59 +02:00
Matthias Seitz 57010c1c60
feat(abigen): include ethevent proc macro in abigen code gen workflow (#232)
* fix: make EthEvent name method a trait method

* refactor: make expand methods members of Context

* fix: make AbiParser parsing non consumeable

* feat: add struct expanding

* feat: use derive(EthEvent) in abigen workflow

* test: check EthEvent in abigen macro

* test: make test compile again

* refactor: simplify and optimize abi parsing from single str

* test: add human readable abigen tests
2021-03-16 21:37:19 +02:00
Georgios Konstantopoulos 61767c8dd2
release: 0.2.2 (#219) 2021-03-04 09:30:27 +02:00
James Prestwich 3e5f7a795f
feature: report path on failed abigen load (#205) 2021-02-22 20:35:40 +02:00
lerencao 732ff29d14
make abigen reproducible (#200)
* use BTreeMap to make abigen bindings deterministic
2021-02-19 08:34:56 +02:00
Georgios Konstantopoulos a43299c838
fix(abigen): correctly parse params in human readable abi (#194)
* fix(abigen): correctly parse params in human readable abi

* chore: make clippy happy

* test: remove unwrap

* chore: make clippy happy again

* chore: fix contract.rs example

* chore: rename to contract using human readable format

* examples: add abigen example with path to abi

* fix: pin funty version to fix bitvec error

* chore: remove unused import

* chore: fix deps
2021-02-16 19:10:26 +02:00
Georgios Konstantopoulos fc4b3e4ce4
release: bump to 0.2.0 (#151) 2021-01-13 20:10:50 +02:00
Georgios Konstantopoulos 98a00e8b7a
chore: use published coins-ledger (#132) 2021-01-05 14:15:18 +02:00
Georgios Konstantopoulos 5c1f8f532a
Upgrade to Tokio 1.0 and remove async-std (#120)
* feat(providers): tokio 1.0

BREAKING: This removes async-std as a compatibility option

* feat: tokio 1.0 in rest of crates

* fix: patch Cargo.toml until deps are released

* fix(contract): load ws deps

* feat: bytes 1.0 (#121)

* feat(core): move to bytes::Bytes

* feat: adjust rest of crates to Bytes

* chore: bump deps

CI fails due to:
https://github.com/snapview/tokio-tungstenite/pull/142#discussion_r550445144

* chore: use latest tokio-tungstenite

* ci: split tests into jobs (#129)

* Switch to `hex` (#128)

* fix(core): replace rustc_hex with hex

* fix(providers): replace rustc_hex with hex

* chore: replace rustc-hex with hex

* chore: cargo fmt

* fix(ledger): copy address from string correctly

* chore: fix flaky tests

Fixes #105
2020-12-31 19:19:14 +02:00
Georgios Konstantopoulos 5860a1df6c
Trim some dependencies (#116)
* core: trim deps

* providers: trim deps

* contract: trim deps

* middleware: trim deps

* signers: trim deps
2020-12-25 02:17:21 +02:00
Georgios Konstantopoulos eb26915081
feat: allow encoding/decoding function data (#90)
* feat: allow encoding/decoding function data

* feat: allow decoding event data

* feat: human readable abi

inspired from https://blog.ricmoo.com/human-readable-contract-abis-in-ethers-js-141902f4d917

* test: add event / fn decoding tests

* chore: fix clippy

* feat(abigen): allow providing args in human readable format
2020-10-29 09:48:24 +02:00
Georgios Konstantopoulos c65497543e
feat: convert signing to k256 (#72)
* feat: convert signing to k256

* fix: pass pre-hashed message to sig verification

* feat: wrap the hash to a Digest implementation

* refactor: cleanup and move digest impl to separate file

* chore: adjust abigen tests due to rust update

* test: add byte equality test between ethers-rs / web3.js signatures

* fix(keys): use 512 blocks for sha256

Co-authored-by: Rohit Narurkar <rohit.narurkar@protonmail.com>
Co-authored-by: Alex Vlasov <alex.m.vlasov@gmail.com>
2020-10-01 11:02:21 +03:00
Georgios Konstantopoulos 2d51c523ba
feature: Middleware Architecture (#65)
* feat: convert Provider to Middleware trait

* feat: move gas oracle to middleware crate

* feat: move signer to middleware crate

* feat: add nonce manager middleware and test stacking

* refactor: convert generic middleware jsonrpc type to associated type

* feat: move ethers-contract to middleware arch

* test(provider): make tests pass

* test(middleware): move middleware tests from signer

* test: fix ethers examples

* fix(contract): make tests compile

* chore: fix clippy

* feat: deduplicate trait delegation

* refactor(signer): deduplicate tx signing logic across signers

* fix doctests

* fix: examples, celo tests and ci
2020-09-25 00:33:09 +03:00
Rohit Narurkar a9bb98b5a7
Implement Multicall functionality for batched calls (#43)
* Implement Multicall functionality for batched calls

* Documentation, some modifications as suggested in the review

* (Abigen) handle single input arg and set output irrespective of mutability

* implement send functionality and allow clearing calls

* Fix detokenization, dont require pre-processing anymore

* panic when more than supported number of calls are pushed

* add doc for panics in case of add_call

* (multicall) eth_balance support, update bindings

* refactor: move multicall to its own directory

* fix: add infura api key

* ci: ensure CI runs on PRs from forks

* test(multicall): re-use aggregate call

* contract: make multicall docs compile and remove redundant clones

* ci: add public etherscan API key so that forks don't get rate limited

* chore: adjust test contract naming

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2020-07-03 19:52:09 +03:00
Georgios Konstantopoulos 1cfbc7b3c3
Replace contract client references with Arc (#35)
* feat(provider): allow specifying a default polling interval param

This parameter is going to be used for all subsequent client calls by default. It can still be overriden with the internal
`interval` calls

* feat(contract): replace reference to Client with Arc

* feat(abigen): adjusts codegen to use Arcs

* fix(ethers): adjust examples to new apis

* fix(provider): return TxHash instead of PendingTransaction on tx submission

Returning a PendingTransaction allowed us to have nice ethers.js-like syntax where you submit
a transaction and then can immediately await it. Unfortunately, now that we use Arcs and not lifetimes
this meant that we would need to bind the function call in a variable, and then await on it, which is pretty
bad UX.

To fix this, we revert back to returning a TxHash and introduce a convenience method on the provider and the
contract which takes a tx_hash and returns a PendingTransaction object. The syntax ends up being slightly
more verbose (although more explicit), but the issue is fixed.
2020-06-22 11:44:08 +03:00
Georgios Konstantopoulos 8240b26a80
docs: add missing attribution to Gnosis for codegen & macros 2020-06-20 17:02:57 +03:00
Georgios Konstantopoulos 4ff466a593
fix intradoc links and add missing cargo metadata (#29) 2020-06-20 16:55:07 +03:00
Georgios Konstantopoulos 1a47e933ae
feat(signers): implement Serde and make Wallet API smaller (#20)
* feat(signers): implement Serde and make API smaller

* fix: add abigen as a dev-dependency feature
2020-06-17 09:38:04 +03:00
Georgios Konstantopoulos 570b45eb10
ABI Encoder v2 + ABI Spec v6.6 (#17)
* feat(core): update ethabi and enable more Toeknize impls

* feat(contract/abigen): implement simple AbiEncoderV2

* tests(ethers): add abigen example

* fix(core): fix abi tests

* chore: make clippy happy
2020-06-16 15:08:42 +03:00
Georgios Konstantopoulos d90b03da06
Add streamed logs to the provider (#9)
* feat(provider): implement Streamed logs

This utilizes eth_getFilterChanges. The stream struct must be instantiated with a factory that yields logs/hashes.
Consumers are expected to use the `FilterStream` trait in order to simplify their type definitions

* feat(provider): expose streaming methods

* test(provider): add new blocks/pending txs test

* feat(contract): allow events to be streamed

* test(contract): add integration test for streaming event logs

* perf(contract-factory): take abi and bytecode by value instead of reference

The abi, bytecode and the factory's deploy method now consume the structs instead of being passed by reference. While this means that
consumers might need to clone before using them, this gives us some more flexiblity around factories inside helper functions

* refactor(contract): use test helpers to reduce code dup

* chore: make clippy happy
2020-06-15 11:46:07 +03:00
Georgios Konstantopoulos a1096f8705
chore(abigen): fix doctest 2020-06-11 12:16:36 +03:00
Georgios Konstantopoulos 9cad87a879
chore: fix examples 2020-06-11 09:45:14 +03:00
Georgios Konstantopoulos aa454b945b
chore(abigen): remove unnecessary stuff 2020-06-10 22:46:55 +03:00
Georgios Konstantopoulos f562b47fd2
docs(abigen): update struct 2020-06-10 22:34:39 +03:00
Georgios Konstantopoulos 73b502ed5f
macro: re-enable paths/etherscan and enable more complex tokens 2020-06-04 00:05:05 +03:00
Georgios Konstantopoulos ba7fedc7d3
abigen: simplify structs and re-enable file/remote codegen 2020-06-03 23:09:46 +03:00
Georgios Konstantopoulos b0feff2432
fix: serialize null filters 2020-06-03 00:10:46 +03:00
Georgios Konstantopoulos 701e442f94
fix(proc-macro): adjust to rest of contract fixes 2020-06-02 14:56:09 +03:00
Georgios Konstantopoulos cd4914d37f
refactor: pull crates to root dir 2020-06-01 21:24:22 +03:00