Commit Graph

73 Commits

Author SHA1 Message Date
DaniPopes debd6fec3d
chore: clippy (#1812)
* chore: clippy

* fmt
2022-11-07 15:43:11 -08:00
Matthias Seitz 12548b5abf
fix: skip json abi formatting (#1777) 2022-10-11 08:10:31 -07:00
DaniPopes d2c9db5ae9
fix(core, etherscan): RawAbi and Abi (#1757) 2022-09-29 11:15: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 513ed588ca
chore: export abi related types (#1677)
* chore: export abi related types

* feat: expose function
2022-09-08 09:07:38 -07:00
Matthias Seitz 0e7f46b03d
feat(abigen): subsitute structs in event bindings (#1674)
* fix(abigen): handle event defaults

* feat(abigen): subsitute structs in event bindings

* update changelog

* chore: rustfmt

* fix broken tests

* chore(clippy): make clippy happy
2022-09-07 09:14:13 -07:00
Matthias Seitz 430c56ee4a
fix(abigen): only derive default of no arrays len > 32 (#1653)
* fix(abigen): only derive default of no arrays len > 32

* impl default
2022-08-31 08:24:21 -07:00
Matthias Seitz 0b04ffe787
feat: add uint8 type (#1639)
* feat: add uint8 type

* update changelog

* derive default

* fix: failing test
2022-08-28 12:17:48 -07:00
Matthias Seitz 27a184db45
feat: add EthError trait and derive (#1549)
* feat: add EthError trait and derive

* update changelog
2022-08-02 11:03:52 -07:00
Matthias Seitz 6bb25e5228
fix(abigen): resolve output struct types correctly (#1546)
* fix(abigen): resolve output struct types correctly

* chore(clippy): make clippy happy
2022-08-01 09:45:31 -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
Matthias Seitz b354102073
fix: use fully qualified path for Result (#1527) 2022-07-28 11:06:06 -07:00
Matthias Seitz a958b4fd28
fix(eip712): improve argument parsing (#1485)
* fix(eip712): improve argument parsing

* use reexported serde_json

* chore: rustfmt

* fix: add missing salt
2022-07-20 00:09:11 -07:00
jole b287fcca4d
Generate structs for the return data of abigen-erated contracts (#1440)
* convert some helper functions

* use said helpers

* more

* don't derive EthCall on return structs

* move return structs to separate function

* remove unused

* remove duplicate code

* reduce code duplication

also use an iterator instead of a presized vector

* comments

* stuck

* fix wrong field

* rename

* don't generate structs for no-output functions

* cosmetic changes

* test: decode and verify result

* more testing

unnamed output (tuple struct)
no output (doesn't exist) -> can't verify this in code though

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

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

* remove dbg print

oops :(

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2022-07-04 11:54:02 -07:00
Matthias Seitz f17f900d01
fix(abigen): remove redundant index adjustment for many overloads (#1419) 2022-06-27 11:52:06 -07:00
Matthias Seitz 659ac061b2
refactor(abigen): replace ethabi::Reader (#1417)
* feat: add human readable function parser

* clippy fix

* revert bad clippy

* refactor(abigen): replace ethabi::Reader

* fix: add token to tuple token parsing
2022-06-26 17:26:43 -07:00
Matthias Seitz 2524663674
fix(abigen): use abi signature attribute if provided (#1409) 2022-06-23 02:53:24 -04:00
Matthias Seitz 847110a3fe
fix: filter out empty bytecode (#1248) 2022-05-11 07:34:41 -07:00
Matthias Seitz fd994d7fde
feat(abigen): support overloaded events (#1233)
* feat(abigen): support overloaded events

* chore: update CHANGELOG
2022-05-07 09:31:53 -07:00
oblique 6faceb20d7
feat: Relax `Clone` requirements when `Arc<M>` is used (#1183)
`#[derive(Clone)]` was implementing `Clone` only if `M` was `Clone`,
however because of `Arc<M>` this can be relaxed.
2022-04-27 15:33:22 +03:00
Matthias Seitz b6b5b09f4a
feat(abigen): add abi object deserializer and generate deploy function (#1030)
* feat(abigen): add abi object deserializer

* chore: rustfmt

* refactor: use enum type for deser abi

* refactor: use enum types for deser

* chore: rustfmt

* feat: add bytecode field

* feat: generate bytecode static

* feat: generate deployment function

* refactor: deploy function

* feat: add contract deployer type

* feat: make 0x prefix optional

* feat: add deploy function

* feat: add deploy example

* chore: update CHANGELOG

* chore(clippy): make clippy happy
2022-03-18 21:23:33 -07:00
oblique 46d7afd65b
fix(abigen): safe ident field names (#989) 2022-03-05 20:25:03 +02:00
Matthias Seitz 960b873b00
fix(abigen): safe ident underscore followed by numeric (#970) 2022-02-28 00:04:43 +02:00
Matthias Seitz 10fcf60791
fix(abigen): support functions with different casing (#972) 2022-02-27 17:40:57 +02:00
Matthias Seitz f5ef8149e5
feat(abigen): support shared type during multiabigen (#959)
* refactor: move type deduplication to abigen crate

* refactor: separate expansion process

* feat: support shared type during multiabigen

* test: add type deduplication test

* chore: rustfmt

* typos

* chore(clippy): make clippy happy

* chore: add anonymous field
2022-02-24 22:09:08 +02:00
Matthias Seitz 45a37faa3d
fix(abigen): handle lossy ethabi generated abi structs (#950)
* fix(abigen): handle lossy ethabi generated abi structs

* chore: rustfmt
2022-02-22 20:26:21 +02:00
James Prestwich 7e4e8e200a
refactor: replace anyhow with eyre (#858)
* refactor: replace anyhow with eyre

* chore: update changelog

* refactor: simplify bail logic for duplicate method signatures

* refactor: simplify bail logic throughout

* refactor: use eyre::ensure

* refactor: more idiomatic use of eyre
2022-02-02 22:44:53 +02:00
Matthias Seitz 1f4ecc6e75
feat(abigen): add provided derives for call and event enums (#721)
* feat(abigen): add provided derives for call and event enums

* chore: update CHANGELOG
2021-12-20 23:24:21 +02:00
Matthias Seitz 3c164bc9bf
feat(abigen): add EthAbiCodec proc macro (#704)
* feat(abigen): add EthAbiCodec proc macro

* rustfmt

* fix: tuple codec
2021-12-19 16:40:17 +02: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
Matthias Seitz 279a2c316c
feat(abigen): support overloaded functions with different casing (#650)
* fix: support overloaded functions with different casing

* chore: fmt

* chore: typos

* feat: better method alias handling
2021-12-05 12:36:49 -08:00
Matthias Seitz 9b6cc37ca0
fix: method deduplication (#619)
* fix: method deduplication

* fix: handle name conflicts in parameters

* fix: order of numerated aliases
2021-11-27 14:31:36 +02:00
Matthias Seitz 2c30468b70
fix(codec)!: ambiguity unit8[] and bytes (#613)
* fix: unit8 encoding

* feat: use ethers::types::Bytes for solidity bytes type

* feat: add const generic from impls

* fix: failing tests

* fix: make compatible with bytes

* update changelog

* make compatible with encoding changes

* chore rm write to file
2021-11-24 22:15:17 +02:00
Sebastian Martinez e72636210c
Refactor crate determination in new ethers-macro crate (#555)
* fix: compute ethers-core path in derive eip712

Co-authored-by: Ryan <ryan.tate@fieldresponder.io>

* refactor: move crate determination to ethers-macro

* docs: update fmt command

* fix: change cargo_metadata dep to optional

Co-authored-by: Ryan <ryan.tate@fieldresponder.io>
2021-11-05 15:00:01 +02:00
Matthias Seitz a07838eaf5
fix: preserve underscores in case of collisions (#548)
* fix: overloaded with same type arguments

* fix: numerate overloaded functions

* docs: add note

* chore: update changelog

* style: rename vars

* fix: draft underscore fix

* fix: underscore aliases
2021-11-01 01:06:31 +02:00
Matthias Seitz 4123823383
feat: enumerate overloaded functions if they are nameless (#545)
* fix: overloaded with same type arguments

* fix: numerate overloaded functions

* docs: add note

* chore: update changelog

* style: rename vars
2021-10-31 13:24:02 +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
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
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 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
Matthias Seitz 6216b2e4a2
chore: remove unused && cargo fix (#496)
* chore: rm allows

* chore: cargo fix
2021-10-10 09:31:34 +01:00
georgewhewell 7d2e900cbb
fix: allow clippy::redundant_clone and clippy::type_complexity in abigen (#491) 2021-10-08 15:14:16 +01: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
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 6cc20688d0
fix(abigen): generate correct imports depending on ethers crate usage (#413) 2021-08-28 21:53:01 +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