Commit Graph

157 Commits

Author SHA1 Message Date
DaniPopes 5f32e983e9
test: rm useless test 2023-02-24 22:33:58 +01:00
DaniPopes e06fcd4fd3
fix: quote tests 2023-02-24 22:07:44 +01:00
DaniPopes 3732de844c
fix(abigen): builtin trait derives (#2170)
* fix(abigen): builtin trait derives

* refactor: EthDisplay

* feat(derive): improve type detection

* chore: cleanup

* chore: edition 2021

* chore: clippy

* chore: use unreachable
2023-02-20 16:27:43 -08:00
Mathis c21362b696
Make order of types in shared_types deterministic (#2169)
* Add missing development dependencies to flake.nix

* Use BTreeMap/Set for deterministic shared types

Fixes an issue where the order of types in the generated shared_types is
not always deterministic.
2023-02-20 16:18:31 -08:00
DaniPopes 6336e96995
refactor(abigen): derives, struct expansion (#2160)
* refactor: abigen derives

* refactor: struct expansion

* refactor: structs 2

* chore: abigen derives and visibility

* refactor: abigen docs

* refactor: structs 3

* chore: doc

* chore: structs conditional default

* refactor: method expansion

* refactor: final doc

* refactor: expansions, add docs, extra From impl

* refactor: final struct expansion

* feat(types): implement bytes::Bytes static methods

* feat: use static Bytes for bytecode

* merge artifact

* refactor: event input expansion

* refactor: common expand params

* refactor: method params expansion

* refactor: struct fields expansion

* refactor: types array expansion

* mergings

* cleanup

* flatten

* selector fmt

* chore: clippy

* refactor: common, imports
2023-02-19 16:53:29 -08:00
frankie 9733b16afc
Include deployed bytecode in abigen output (#2163)
* test

* sanity check
2023-02-18 12:53:39 -08:00
DaniPopes f9ced12fee
refactor(abigen): solidity types expansion (#2131)
* refactor: event input expansion

* refactor: common expand params

* refactor: method params expansion

* refactor: struct fields expansion

* refactor: types array expansion

* clippy
2023-02-13 17:15:28 -08:00
James Prestwich 0c16eb971d
Prestwich/event no lifetime (#2105)
* refactor(breaking): remove lifetime from Event

* fix: example updated to use new event
2023-02-13 17:14:38 -08:00
Paul Lange bfe3ba9d5f
contracts: allow upper case acronyms lint (#2128) 2023-02-10 11:52:55 -08:00
Jacob Turner b08c1e29b8
[fix]: Use pascal casing for type names in structs generated by abigen (#2130)
* [fix]: Use pascal casing for type names in structs generated by abigen

* [fix]: Revert the downversioning changes
2023-02-10 11:50:09 -08:00
georgewhewell c0fd8326f0
chore(clippy): fix bare urls in abigen (#2133) 2023-02-10 11:49:27 -08:00
DaniPopes fd02bbc418
refactor(abigen): inline docs (#2090)
* refactor: abigen docs

* chore: doc

* refactor: final doc

* mergings

* fix: unremove Default
2023-01-30 21:28:57 -08:00
DaniPopes 93e1850646
refactor/feat(abigen,types): add bytes::Bytes static methods, refactor struct declaration (#2089)
* refactor: final struct expansion

* feat(types): implement bytes::Bytes static methods

* feat: use static Bytes for bytecode

* chore: add rustfmt skip directive

* clippy
2023-01-30 12:12:35 -08:00
Matthias Seitz d3ad5478ae
feat(abi): add helper functions to access solidity types (#2081) 2023-01-27 13:12:32 -05:00
Matthias Seitz 8ecd566930
fix: add missing pub for tuple structs (#2080) 2023-01-27 13:07:27 -05:00
Georgios Konstantopoulos f2099a8eaa
chore: fix clippy (#2059) 2023-01-16 18:11:27 -08:00
Georgios Konstantopoulos 10b18e0d58 chore: do not expose util module 2023-01-13 11:10:31 -08:00
Georgios Konstantopoulos 219004efcb fix(abigen): add back mod util 2023-01-13 11:09:13 -08:00
DaniPopes c2d7b8321f
refactor(abigen): source (#2016)
* rm parse_address

* refactor: sources

* add comments, support <chain>:<address>

* fix doc

* chore: clippy

* fmt

* fix

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
2023-01-13 10:59:44 -08:00
DaniPopes d1e934791d
refactor(abigen): Abigen, ContractBindings (#2019)
* use format_ident

* lib.rs

* refactor: ContractBindings

* refactor: from_file

* add write_fmt

* mv

* error msg

* revert mod docs
2023-01-13 10:23:59 -08:00
Nick 9e559aefeb
fix(abigen): ensure correct ABI in `From` impl (#2036)
* fix(abigen): ensure correct ABI in `From` impl

`new` creates a `Contract` with the correct ABI, but the `From` impl
simply wraps the source `Contract`, which could have a completely
different ABI. In effect this was an unsafe cast, and indeed was
observed to trigger a "method not found (this should never happen)"
panic for subsequent method lookups. Implementing `From` in terms of
`new` fixes this, at the cost of an extra `Arc::clone()` (which I can't
see how to eliminate without piercing the `ethers::contract::Contract`
public API).

* Remove unnecessary `async` from test

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>

Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
2023-01-13 10:18:17 -08:00
DaniPopes 79f27e2366
docs(abigen): rename `event_derives` to `derives` (#2018)
* chore: rename event_derives to derives

Misleading name, `event_derives` implies that only Solidity events'
structs would apply, while this is not true

* last derive

* mv

* docs

* docs

* last doc
2023-01-13 10:17:32 -08:00
DaniPopes 0187bedd11
feat(abigen): use prettyplease (#2027) 2023-01-09 07:17:22 +02:00
DaniPopes 96f4723c13
fix(abigen): tests (#2015)
* fix: methods tests

* fix: remaining paths in tests
2023-01-06 11:30:34 +02:00
Matthias Seitz 6ac3e75c6a
fix: use full path of i256 (#2000) 2023-01-03 15:12:47 +02:00
DaniPopes d8d4eac3ad
fix(contract): add setter for MultiBindings' rustfmt (#1948) 2022-12-22 21:05:00 +02:00
Genysys 91cd6ccce8
feat: adds bscscan as abi source (#1955) 2022-12-19 17:54:24 +02:00
joshieDo 92e726921a
chore: add celo chain (#1932)
* add celo chain

* add missing chain case

* clippy & fmt
2022-12-07 21:37:11 -08:00
Matthias Seitz 3dfc04f9fe
chore(clippy): make clippy happy (#1923) 2022-12-05 22:05:33 -08:00
Matthias Seitz 556821f077
chore: generate selector as hex in docs (#1924) 2022-12-05 22:05:24 -08:00
Dan Cline 80d887b67e
docs: update MRSV to 1.64 (#1926)
* IntoFuture was implemented in #1826, which means the MSRV should now
   be 1.64
2022-12-05 22:04:48 -08:00
Matthias Seitz 0ce6b107d6
fix: make version detection infallible (#1916) 2022-12-01 06:14:51 -08:00
Matthias Seitz 17addcfd91
fix(abigen): rm wrong brackets (#1914) 2022-11-30 13:14:40 -08:00
Matthias Seitz c542844424
fix: handle non existing Cargo.toml edge case (#1886) 2022-11-23 07:35:55 -08:00
Will Smith 9d75e5f178
Fix: use cwd manifest (#1869)
* fix(abigen): make compatible with older rust versions

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

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

* fix: linting

* fix(abigen): use active cargo.toml over crate cargo.toml

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2022-11-17 11:23:10 -08:00
Will Smith a525659f5d
fix(abigen): make compatible with older rust versions (#1868)
* fix(abigen): make compatible with older rust versions

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

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

* fix: linting

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2022-11-17 10:43:41 -08:00
Georgios Konstantopoulos 74bf6fbb04 chore: fmt / clippy 2022-11-15 13:36:25 -08:00
Will Smith d47e34dc5b
fix: generated crate not using generated version (#1852)
* fix: generated crate not using generated version

* add docs

* wip: add base testcases

* fix: str formatting

* fix: add missing comma

* fix: tests and file loading

* fix: strip whitespaces

* fix: case where we are using specified crate

* linting: remove extra ref

* refactor: use toml parser over regex

* fix: add case for path and ethers-contract

* fix: add missing comma

* feat: don't check for path

* remove build-dep fallback
2022-11-15 13:00:12 -08:00
Matthias Seitz 3b52c2fc7e
fix: improve overloaded param diff matching (#1853) 2022-11-11 14:25:31 -08:00
DaniPopes fb88215a87
fix: rustdoc errors (#1808)
* fix: rustdoc warnings

* fix: partially re-run abigen for multicall_contract

* fix

* fix test

* fix: rustdoc nightly warnings
2022-11-07 15:43:23 -08:00
DaniPopes debd6fec3d
chore: clippy (#1812)
* chore: clippy

* fmt
2022-11-07 15:43:11 -08:00
Matthias Seitz ef22e05a9a
fix(abigen): remove trailing test,script markers (#1776) 2022-10-11 10:48:30 -07: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
Clifton King b1124441ec
feat(abigen): descriptive deserialization errors (#1633)
* feat(abigen): descriptive deserialization errors

* update changelog

* map_err -> wrap_err
2022-08-23 17:54:56 -07:00