Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add forge upload-selectors command #1676

Merged
merged 3 commits into from
May 24, 2022

Conversation

marktoda
Copy link
Contributor

@marktoda marktoda commented May 20, 2022

This PR adds a new command to forge forge upload-selectors which builds a given contract and uploads the fresh ABI to sig.eth.samczsun.com 4byte selector database. See #1672

@marktoda marktoda force-pushed the feat/upload-selectors branch 2 times, most recently from 3005be7 to a375ef8 Compare May 20, 2022 07:54
@marktoda marktoda changed the title Feat/upload selectors Add upload-selectors command to forge May 20, 2022
@marktoda
Copy link
Contributor Author

marktoda commented May 20, 2022

Example console output

❯ forge upload-selectors LinearVestingVault
Duplicated: Function unvested(): 0xda919faa
Duplicated: Function initialize(): 0x8129fc1c
Duplicated: Function Unauthorized(): 0x82b42900
Duplicated: Function InvalidClaim(): 0xed3c247c
Duplicated: Function totalAmount(): 0x1a39d8ef
Duplicated: Function claim(): 0x4e71d92d
Duplicated: Function vestEndTimestamp(): 0x556d1e56
Duplicated: Function vested(): 0xfea5657c
Duplicated: Function vestedOn(uint256): 0xaba02235
Duplicated: Function token(): 0xfc0c546a
Duplicated: Function vestStartTimestamp(): 0xddb0d2ed
Duplicated: Function amountClaimed(): 0xad6b5d04
Duplicated: Function beneficiary(): 0x38af3eed
Duplicated: Function NotVested(): 0x9225b941
Duplicated: Function InvalidParams(): 0xa86b6512
Duplicated: Event Claimed(address,address,uint256): 0xf7a40077ff7a04c7e61f6f26fb13774259ddf1b6bce9ecf26a8276cdd3992683
Duplicated: Event Initialized(uint8): 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498
Selectors successfully uploaded to https://sig.eth.samczsun.com

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice,

couple of smol nits

cli/src/cmd/forge/fourbyte.rs Outdated Show resolved Hide resolved
cli/src/cmd/forge/fourbyte.rs Outdated Show resolved Hide resolved
cli/src/cmd/forge/fourbyte.rs Show resolved Hide resolved
cli/src/cmd/forge/fourbyte.rs Outdated Show resolved Hide resolved
cli/src/cmd/forge/fourbyte.rs Show resolved Hide resolved
cli/src/cmd/forge/fourbyte.rs Outdated Show resolved Hide resolved
cli/src/opts/forge.rs Outdated Show resolved Hide resolved
@mattsse mattsse added T-feature Type: feature C-forge Command: forge labels May 20, 2022
@marktoda marktoda requested a review from mattsse May 20, 2022 20:01
@marktoda marktoda force-pushed the feat/upload-selectors branch 2 times, most recently from 19f63a9 to 2bb7cef Compare May 20, 2022 22:29
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm,

merge together with #1674

Comment on lines +31 to +32
extra_output: vec![ContractOutputSelection::Abi],
..Default::default()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

cli/src/cmd/forge/fourbyte.rs Show resolved Hide resolved
@mattsse
Copy link
Member

mattsse commented May 21, 2022

needs cargo +nightly fmt

@marktoda
Copy link
Contributor Author

marktoda commented May 21, 2022

Thanks! -- ran cargo +nightly fmt and clippy

@marktoda marktoda requested a review from mattsse May 21, 2022 16:09
@marktoda marktoda changed the title Add upload-selectors command to forge Use sig.eth.samczsun.com as selector database May 21, 2022
@marktoda marktoda changed the title Use sig.eth.samczsun.com as selector database Add forge upload-selectors command May 21, 2022
@marktoda
Copy link
Contributor Author

merge together with #1674

You just mean, at the same time? Also happy to merge them into one PR if that's what you mean

@mattsse
Copy link
Member

mattsse commented May 22, 2022

Let's prepare both and then merge them in one go

@marktoda
Copy link
Contributor Author

Clippy issue and integration tests failures seem unrelated to my changes; I'm happy to fix them if needed

@marktoda
Copy link
Contributor Author

    Checking anvil-rpc v0.1.0 (/home/runner/work/foundry/foundry/anvil/rpc)
error: you are deriving `PartialEq` and can implement `Eq`
  --> anvil/rpc/src/response.rs:36:17
   |
36 | #[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
   |                 ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq`

@marktoda
Copy link
Contributor Author

ah looks like they are solved in #1699

Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this is better fit for cast since it's a utility command and we have all the 4bytes-related functions (that are being swapped now) in there as well?

@marktoda
Copy link
Contributor Author

@onbjerg I see the argument for cast, but think the convenience of being able to run inside a contract repo and automatically build and upload latest abi is nice. From cast I'd expect the user would have to point to an existing abi

This commit adds a new command to forge to upload a contract's abi to
sig.eth.samczsun.com selector database
- added default for CoreBuildArgs
- cleaned up code ordering
- moved url to constant
@marktoda
Copy link
Contributor Author

rebased on master to get clippy / lint fixes

@gakonst gakonst merged commit c5d49c4 into foundry-rs:master May 24, 2022
@gakonst
Copy link
Member

gakonst commented May 24, 2022

@marktoda a nice follow up here would be cast upload-signature 'foo()', if you're interested in taking that up

@marktoda
Copy link
Contributor Author

Ah, that's a good idea. I'll work on that

mattsse added a commit that referenced this pull request May 28, 2022
* keep tack of emitter of logs (#1669)

* [not compiling] keep tack of emitter of logs

by switching from RawLog to Log

* ugly fix

* cargo +nightly fmt

* Add comment

Co-authored-by: Bjerg <[email protected]>

* fix variable name

Co-authored-by: Bjerg <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>

* provide default impls for remaining visitor methods (#1706)

* chore(clippy): make clippy happy (#1707)

* chore: bump ethers

* feat(bind): option to skip Cargo.toml from consistency checks (#1702)

* feat(bind): option to skip Cargo.toml from consistency checks

* chore: cargo fmt

* Update cli/src/cmd/forge/bind.rs

Co-authored-by: Matthias Seitz <[email protected]>

* chore: clippy lints

Co-authored-by: Matthias Seitz <[email protected]>
Co-authored-by: Georgios Konstantopoulos <[email protected]>

* fix(verify): encode constructor arguments correctly (#1711)

* fix(verify): encode constructor arguments correctly

* chore: rotate api keys

* Update cli/tests/it/verify.rs

Co-authored-by: Georgios Konstantopoulos <[email protected]>

* feat: use rotating api keys in fork unit tests (#1693)

* feat: use rotating api keys in fork unit tests

* fix: use correct path

Co-authored-by: Georgios Konstantopoulos <[email protected]>

* refactor: spawn backendhandler on background thread (#1704)

* fix(watch): only watch dirs that exists (#1710)

* Switch selector database to sig.eth.samczsun.com (#1674)

* feat(utils): use samczsun selector directory

This commit switches the utils crate to use samczsun's new function
selector over 4byte for an improved interface and better stability

* feat(cast): update cli to use new 4byte interface

The util bindings were changed to use samczsun's selector library in the
previous commit; this commit updates the cast cli to properly use the
slightly changed interface.

Also ran cargo fmt which updated some unrelated formatting

* fix: review comments

- undo unrelated cargo fmt changes
- rename fourbyte_* -> decode_* in utils

* fix: remove fourbyte test helper

No longer necessary with sig.eth.samczsun.com

* Add `forge upload-selectors` command (#1676)

* feat: add upload selectors command to forge

This commit adds a new command to forge to upload a contract's abi to
sig.eth.samczsun.com selector database

* fix: review comments

- added default for CoreBuildArgs
- cleaned up code ordering
- moved url to constant

* fix: derive CoreBuildArgs::Default

* test: rotate rinkeby keys

* fix(forge/install): add git status check before commit (#1696)

* fix(forge/install): add git status check before commit

* move logic to git_status_clean function

Co-authored-by: test <[email protected]>

* write chunk

* restore original

* write chunks w/ paren

* semicolon cleanup

* write_semicolon

* feat: add `cast upload-signature` (#1716)

* feat: add `cast upload-signature`

This commit adds a new cast command to upload a raw function signature
to the https://sig.eth.samczsun.com 4byte database.

It also moves some of the original signature upload logic from `forge
upload-selectors` to a helper in foundry_utils

API looks like:
```
❯ cast upload-signature 'function approve(address,uint256)' 'transfer(uint256)' 'event Transfer(uint256,address)'
Duplicated: Function approve(address,uint256): 0x095ea7b3
Duplicated: Function transfer(uint256): 0x12514bba
Duplicated: Event Transfer(uint256,address): 0xabe1dcf9fcb8e5fb309db76bcab112a217aa5754d0f038921282bfe7907aa516
```

* fix: move selectors utils to separate module

* fix: add examples to cli help

* test(cast): add integration test for `cast upload-signature`

* feat(cast): allow uploading contract artifacts

This commit enables the `cast upload-signatures` tool to take contract
artifact files and upload the entire json to sig.eth.samczsun.com

* test: update failing tests (#1714)

* test: fix flaky timestamp test (#1727)

* fix: expressive value_name in clap annotations (#1700)

* value_name in forge test

* test debug help

* remove help and revert debug value_name to TEST FUNCTION

* forge test value_name

* forge value_name

* forge args add value_name

* all cast value_name

* Update cli/src/cmd/cast/run.rs

Co-authored-by: Matthias Seitz <[email protected]>

* cast FourByteDecode merge conflict

Co-authored-by: Matthias Seitz <[email protected]>

* ClapChain value_name (#1731)

* utils & cleanup

* fix(forge/install): git status check (#1732)

* fix(cli): can_update_libs_section test (#1733)

* write_chunk! where possible

* func def fmt

* fix attrs

* tests

* linter

* anvil value_name (#1743)

* docs

* indented & indented_if

* unused import

* cleanup

* ci: add additional ci jobs for forks (#1728)

* ci: add additional ci jobs for forks

* test: fix flaky anvil test

* ci: setup git config

* ci: setup git config

* ci: setup git config global

* chore: fix flaky snapshot test

* fix: enable tokio time feature (#1750)

* chore(deps): replace colored with yansi (#1722)

* feat(config): add allow paths setting (#1751)

* ci: set git config global in cross platform ci (#1754)

* ci: set git config global in cross platform ci

* fix: flaky tests

* fix: use proper types

* fix(cast): improve cast wallet new (#1713)

* fix(cast): improve cast wallet new

* chore: cleanup imports

Co-authored-by: jole <[email protected]>
Co-authored-by: Bjerg <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>
Co-authored-by: Georgios Konstantopoulos <[email protected]>
Co-authored-by: Meet Mangukiya <[email protected]>
Co-authored-by: marktoda <[email protected]>
Co-authored-by: 0xYYY <[email protected]>
Co-authored-by: test <[email protected]>
Co-authored-by: Shawn Harmsen <[email protected]>
jpopesculian pushed a commit to jpopesculian/foundry that referenced this pull request Jun 3, 2022
* keep tack of emitter of logs (foundry-rs#1669)

* [not compiling] keep tack of emitter of logs

by switching from RawLog to Log

* ugly fix

* cargo +nightly fmt

* Add comment

Co-authored-by: Bjerg <[email protected]>

* fix variable name

Co-authored-by: Bjerg <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>

* provide default impls for remaining visitor methods (foundry-rs#1706)

* chore(clippy): make clippy happy (foundry-rs#1707)

* chore: bump ethers

* feat(bind): option to skip Cargo.toml from consistency checks (foundry-rs#1702)

* feat(bind): option to skip Cargo.toml from consistency checks

* chore: cargo fmt

* Update cli/src/cmd/forge/bind.rs

Co-authored-by: Matthias Seitz <[email protected]>

* chore: clippy lints

Co-authored-by: Matthias Seitz <[email protected]>
Co-authored-by: Georgios Konstantopoulos <[email protected]>

* fix(verify): encode constructor arguments correctly (foundry-rs#1711)

* fix(verify): encode constructor arguments correctly

* chore: rotate api keys

* Update cli/tests/it/verify.rs

Co-authored-by: Georgios Konstantopoulos <[email protected]>

* feat: use rotating api keys in fork unit tests (foundry-rs#1693)

* feat: use rotating api keys in fork unit tests

* fix: use correct path

Co-authored-by: Georgios Konstantopoulos <[email protected]>

* refactor: spawn backendhandler on background thread (foundry-rs#1704)

* fix(watch): only watch dirs that exists (foundry-rs#1710)

* Switch selector database to sig.eth.samczsun.com (foundry-rs#1674)

* feat(utils): use samczsun selector directory

This commit switches the utils crate to use samczsun's new function
selector over 4byte for an improved interface and better stability

* feat(cast): update cli to use new 4byte interface

The util bindings were changed to use samczsun's selector library in the
previous commit; this commit updates the cast cli to properly use the
slightly changed interface.

Also ran cargo fmt which updated some unrelated formatting

* fix: review comments

- undo unrelated cargo fmt changes
- rename fourbyte_* -> decode_* in utils

* fix: remove fourbyte test helper

No longer necessary with sig.eth.samczsun.com

* Add `forge upload-selectors` command (foundry-rs#1676)

* feat: add upload selectors command to forge

This commit adds a new command to forge to upload a contract's abi to
sig.eth.samczsun.com selector database

* fix: review comments

- added default for CoreBuildArgs
- cleaned up code ordering
- moved url to constant

* fix: derive CoreBuildArgs::Default

* test: rotate rinkeby keys

* fix(forge/install): add git status check before commit (foundry-rs#1696)

* fix(forge/install): add git status check before commit

* move logic to git_status_clean function

Co-authored-by: test <[email protected]>

* write chunk

* restore original

* write chunks w/ paren

* semicolon cleanup

* write_semicolon

* feat: add `cast upload-signature` (foundry-rs#1716)

* feat: add `cast upload-signature`

This commit adds a new cast command to upload a raw function signature
to the https://sig.eth.samczsun.com 4byte database.

It also moves some of the original signature upload logic from `forge
upload-selectors` to a helper in foundry_utils

API looks like:
```
❯ cast upload-signature 'function approve(address,uint256)' 'transfer(uint256)' 'event Transfer(uint256,address)'
Duplicated: Function approve(address,uint256): 0x095ea7b3
Duplicated: Function transfer(uint256): 0x12514bba
Duplicated: Event Transfer(uint256,address): 0xabe1dcf9fcb8e5fb309db76bcab112a217aa5754d0f038921282bfe7907aa516
```

* fix: move selectors utils to separate module

* fix: add examples to cli help

* test(cast): add integration test for `cast upload-signature`

* feat(cast): allow uploading contract artifacts

This commit enables the `cast upload-signatures` tool to take contract
artifact files and upload the entire json to sig.eth.samczsun.com

* test: update failing tests (foundry-rs#1714)

* test: fix flaky timestamp test (foundry-rs#1727)

* fix: expressive value_name in clap annotations (foundry-rs#1700)

* value_name in forge test

* test debug help

* remove help and revert debug value_name to TEST FUNCTION

* forge test value_name

* forge value_name

* forge args add value_name

* all cast value_name

* Update cli/src/cmd/cast/run.rs

Co-authored-by: Matthias Seitz <[email protected]>

* cast FourByteDecode merge conflict

Co-authored-by: Matthias Seitz <[email protected]>

* ClapChain value_name (foundry-rs#1731)

* utils & cleanup

* fix(forge/install): git status check (foundry-rs#1732)

* fix(cli): can_update_libs_section test (foundry-rs#1733)

* write_chunk! where possible

* func def fmt

* fix attrs

* tests

* linter

* anvil value_name (foundry-rs#1743)

* docs

* indented & indented_if

* unused import

* cleanup

* ci: add additional ci jobs for forks (foundry-rs#1728)

* ci: add additional ci jobs for forks

* test: fix flaky anvil test

* ci: setup git config

* ci: setup git config

* ci: setup git config global

* chore: fix flaky snapshot test

* fix: enable tokio time feature (foundry-rs#1750)

* chore(deps): replace colored with yansi (foundry-rs#1722)

* feat(config): add allow paths setting (foundry-rs#1751)

* ci: set git config global in cross platform ci (foundry-rs#1754)

* ci: set git config global in cross platform ci

* fix: flaky tests

* fix: use proper types

* fix(cast): improve cast wallet new (foundry-rs#1713)

* fix(cast): improve cast wallet new

* chore: cleanup imports

Co-authored-by: jole <[email protected]>
Co-authored-by: Bjerg <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>
Co-authored-by: Georgios Konstantopoulos <[email protected]>
Co-authored-by: Meet Mangukiya <[email protected]>
Co-authored-by: marktoda <[email protected]>
Co-authored-by: 0xYYY <[email protected]>
Co-authored-by: test <[email protected]>
Co-authored-by: Shawn Harmsen <[email protected]>
jpopesculian pushed a commit to jpopesculian/foundry that referenced this pull request Jun 6, 2022
* keep tack of emitter of logs (foundry-rs#1669)

* [not compiling] keep tack of emitter of logs

by switching from RawLog to Log

* ugly fix

* cargo +nightly fmt

* Add comment

Co-authored-by: Bjerg <[email protected]>

* fix variable name

Co-authored-by: Bjerg <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>

* provide default impls for remaining visitor methods (foundry-rs#1706)

* chore(clippy): make clippy happy (foundry-rs#1707)

* chore: bump ethers

* feat(bind): option to skip Cargo.toml from consistency checks (foundry-rs#1702)

* feat(bind): option to skip Cargo.toml from consistency checks

* chore: cargo fmt

* Update cli/src/cmd/forge/bind.rs

Co-authored-by: Matthias Seitz <[email protected]>

* chore: clippy lints

Co-authored-by: Matthias Seitz <[email protected]>
Co-authored-by: Georgios Konstantopoulos <[email protected]>

* fix(verify): encode constructor arguments correctly (foundry-rs#1711)

* fix(verify): encode constructor arguments correctly

* chore: rotate api keys

* Update cli/tests/it/verify.rs

Co-authored-by: Georgios Konstantopoulos <[email protected]>

* feat: use rotating api keys in fork unit tests (foundry-rs#1693)

* feat: use rotating api keys in fork unit tests

* fix: use correct path

Co-authored-by: Georgios Konstantopoulos <[email protected]>

* refactor: spawn backendhandler on background thread (foundry-rs#1704)

* fix(watch): only watch dirs that exists (foundry-rs#1710)

* Switch selector database to sig.eth.samczsun.com (foundry-rs#1674)

* feat(utils): use samczsun selector directory

This commit switches the utils crate to use samczsun's new function
selector over 4byte for an improved interface and better stability

* feat(cast): update cli to use new 4byte interface

The util bindings were changed to use samczsun's selector library in the
previous commit; this commit updates the cast cli to properly use the
slightly changed interface.

Also ran cargo fmt which updated some unrelated formatting

* fix: review comments

- undo unrelated cargo fmt changes
- rename fourbyte_* -> decode_* in utils

* fix: remove fourbyte test helper

No longer necessary with sig.eth.samczsun.com

* Add `forge upload-selectors` command (foundry-rs#1676)

* feat: add upload selectors command to forge

This commit adds a new command to forge to upload a contract's abi to
sig.eth.samczsun.com selector database

* fix: review comments

- added default for CoreBuildArgs
- cleaned up code ordering
- moved url to constant

* fix: derive CoreBuildArgs::Default

* test: rotate rinkeby keys

* fix(forge/install): add git status check before commit (foundry-rs#1696)

* fix(forge/install): add git status check before commit

* move logic to git_status_clean function

Co-authored-by: test <[email protected]>

* write chunk

* restore original

* write chunks w/ paren

* semicolon cleanup

* write_semicolon

* feat: add `cast upload-signature` (foundry-rs#1716)

* feat: add `cast upload-signature`

This commit adds a new cast command to upload a raw function signature
to the https://sig.eth.samczsun.com 4byte database.

It also moves some of the original signature upload logic from `forge
upload-selectors` to a helper in foundry_utils

API looks like:
```
❯ cast upload-signature 'function approve(address,uint256)' 'transfer(uint256)' 'event Transfer(uint256,address)'
Duplicated: Function approve(address,uint256): 0x095ea7b3
Duplicated: Function transfer(uint256): 0x12514bba
Duplicated: Event Transfer(uint256,address): 0xabe1dcf9fcb8e5fb309db76bcab112a217aa5754d0f038921282bfe7907aa516
```

* fix: move selectors utils to separate module

* fix: add examples to cli help

* test(cast): add integration test for `cast upload-signature`

* feat(cast): allow uploading contract artifacts

This commit enables the `cast upload-signatures` tool to take contract
artifact files and upload the entire json to sig.eth.samczsun.com

* test: update failing tests (foundry-rs#1714)

* test: fix flaky timestamp test (foundry-rs#1727)

* fix: expressive value_name in clap annotations (foundry-rs#1700)

* value_name in forge test

* test debug help

* remove help and revert debug value_name to TEST FUNCTION

* forge test value_name

* forge value_name

* forge args add value_name

* all cast value_name

* Update cli/src/cmd/cast/run.rs

Co-authored-by: Matthias Seitz <[email protected]>

* cast FourByteDecode merge conflict

Co-authored-by: Matthias Seitz <[email protected]>

* ClapChain value_name (foundry-rs#1731)

* utils & cleanup

* fix(forge/install): git status check (foundry-rs#1732)

* fix(cli): can_update_libs_section test (foundry-rs#1733)

* write_chunk! where possible

* func def fmt

* fix attrs

* tests

* linter

* anvil value_name (foundry-rs#1743)

* docs

* indented & indented_if

* unused import

* cleanup

* ci: add additional ci jobs for forks (foundry-rs#1728)

* ci: add additional ci jobs for forks

* test: fix flaky anvil test

* ci: setup git config

* ci: setup git config

* ci: setup git config global

* chore: fix flaky snapshot test

* fix: enable tokio time feature (foundry-rs#1750)

* chore(deps): replace colored with yansi (foundry-rs#1722)

* feat(config): add allow paths setting (foundry-rs#1751)

* ci: set git config global in cross platform ci (foundry-rs#1754)

* ci: set git config global in cross platform ci

* fix: flaky tests

* fix: use proper types

* fix(cast): improve cast wallet new (foundry-rs#1713)

* fix(cast): improve cast wallet new

* chore: cleanup imports

Co-authored-by: jole <[email protected]>
Co-authored-by: Bjerg <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>
Co-authored-by: Georgios Konstantopoulos <[email protected]>
Co-authored-by: Meet Mangukiya <[email protected]>
Co-authored-by: marktoda <[email protected]>
Co-authored-by: 0xYYY <[email protected]>
Co-authored-by: test <[email protected]>
Co-authored-by: Shawn Harmsen <[email protected]>
jpopesculian pushed a commit that referenced this pull request Jun 8, 2022
* keep tack of emitter of logs (#1669)

* [not compiling] keep tack of emitter of logs

by switching from RawLog to Log

* ugly fix

* cargo +nightly fmt

* Add comment

Co-authored-by: Bjerg <[email protected]>

* fix variable name

Co-authored-by: Bjerg <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>

* provide default impls for remaining visitor methods (#1706)

* chore(clippy): make clippy happy (#1707)

* chore: bump ethers

* feat(bind): option to skip Cargo.toml from consistency checks (#1702)

* feat(bind): option to skip Cargo.toml from consistency checks

* chore: cargo fmt

* Update cli/src/cmd/forge/bind.rs

Co-authored-by: Matthias Seitz <[email protected]>

* chore: clippy lints

Co-authored-by: Matthias Seitz <[email protected]>
Co-authored-by: Georgios Konstantopoulos <[email protected]>

* fix(verify): encode constructor arguments correctly (#1711)

* fix(verify): encode constructor arguments correctly

* chore: rotate api keys

* Update cli/tests/it/verify.rs

Co-authored-by: Georgios Konstantopoulos <[email protected]>

* feat: use rotating api keys in fork unit tests (#1693)

* feat: use rotating api keys in fork unit tests

* fix: use correct path

Co-authored-by: Georgios Konstantopoulos <[email protected]>

* refactor: spawn backendhandler on background thread (#1704)

* fix(watch): only watch dirs that exists (#1710)

* Switch selector database to sig.eth.samczsun.com (#1674)

* feat(utils): use samczsun selector directory

This commit switches the utils crate to use samczsun's new function
selector over 4byte for an improved interface and better stability

* feat(cast): update cli to use new 4byte interface

The util bindings were changed to use samczsun's selector library in the
previous commit; this commit updates the cast cli to properly use the
slightly changed interface.

Also ran cargo fmt which updated some unrelated formatting

* fix: review comments

- undo unrelated cargo fmt changes
- rename fourbyte_* -> decode_* in utils

* fix: remove fourbyte test helper

No longer necessary with sig.eth.samczsun.com

* Add `forge upload-selectors` command (#1676)

* feat: add upload selectors command to forge

This commit adds a new command to forge to upload a contract's abi to
sig.eth.samczsun.com selector database

* fix: review comments

- added default for CoreBuildArgs
- cleaned up code ordering
- moved url to constant

* fix: derive CoreBuildArgs::Default

* test: rotate rinkeby keys

* fix(forge/install): add git status check before commit (#1696)

* fix(forge/install): add git status check before commit

* move logic to git_status_clean function

Co-authored-by: test <[email protected]>

* write chunk

* restore original

* write chunks w/ paren

* semicolon cleanup

* write_semicolon

* feat: add `cast upload-signature` (#1716)

* feat: add `cast upload-signature`

This commit adds a new cast command to upload a raw function signature
to the https://sig.eth.samczsun.com 4byte database.

It also moves some of the original signature upload logic from `forge
upload-selectors` to a helper in foundry_utils

API looks like:
```
❯ cast upload-signature 'function approve(address,uint256)' 'transfer(uint256)' 'event Transfer(uint256,address)'
Duplicated: Function approve(address,uint256): 0x095ea7b3
Duplicated: Function transfer(uint256): 0x12514bba
Duplicated: Event Transfer(uint256,address): 0xabe1dcf9fcb8e5fb309db76bcab112a217aa5754d0f038921282bfe7907aa516
```

* fix: move selectors utils to separate module

* fix: add examples to cli help

* test(cast): add integration test for `cast upload-signature`

* feat(cast): allow uploading contract artifacts

This commit enables the `cast upload-signatures` tool to take contract
artifact files and upload the entire json to sig.eth.samczsun.com

* test: update failing tests (#1714)

* test: fix flaky timestamp test (#1727)

* fix: expressive value_name in clap annotations (#1700)

* value_name in forge test

* test debug help

* remove help and revert debug value_name to TEST FUNCTION

* forge test value_name

* forge value_name

* forge args add value_name

* all cast value_name

* Update cli/src/cmd/cast/run.rs

Co-authored-by: Matthias Seitz <[email protected]>

* cast FourByteDecode merge conflict

Co-authored-by: Matthias Seitz <[email protected]>

* ClapChain value_name (#1731)

* utils & cleanup

* fix(forge/install): git status check (#1732)

* fix(cli): can_update_libs_section test (#1733)

* write_chunk! where possible

* func def fmt

* fix attrs

* tests

* linter

* anvil value_name (#1743)

* docs

* indented & indented_if

* unused import

* cleanup

* ci: add additional ci jobs for forks (#1728)

* ci: add additional ci jobs for forks

* test: fix flaky anvil test

* ci: setup git config

* ci: setup git config

* ci: setup git config global

* chore: fix flaky snapshot test

* fix: enable tokio time feature (#1750)

* chore(deps): replace colored with yansi (#1722)

* feat(config): add allow paths setting (#1751)

* ci: set git config global in cross platform ci (#1754)

* ci: set git config global in cross platform ci

* fix: flaky tests

* fix: use proper types

* fix(cast): improve cast wallet new (#1713)

* fix(cast): improve cast wallet new

* chore: cleanup imports

Co-authored-by: jole <[email protected]>
Co-authored-by: Bjerg <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>
Co-authored-by: Georgios Konstantopoulos <[email protected]>
Co-authored-by: Meet Mangukiya <[email protected]>
Co-authored-by: marktoda <[email protected]>
Co-authored-by: 0xYYY <[email protected]>
Co-authored-by: test <[email protected]>
Co-authored-by: Shawn Harmsen <[email protected]>
jpopesculian pushed a commit that referenced this pull request Jun 8, 2022
* keep tack of emitter of logs (#1669)

* [not compiling] keep tack of emitter of logs

by switching from RawLog to Log

* ugly fix

* cargo +nightly fmt

* Add comment

Co-authored-by: Bjerg <[email protected]>

* fix variable name

Co-authored-by: Bjerg <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>

* provide default impls for remaining visitor methods (#1706)

* chore(clippy): make clippy happy (#1707)

* chore: bump ethers

* feat(bind): option to skip Cargo.toml from consistency checks (#1702)

* feat(bind): option to skip Cargo.toml from consistency checks

* chore: cargo fmt

* Update cli/src/cmd/forge/bind.rs

Co-authored-by: Matthias Seitz <[email protected]>

* chore: clippy lints

Co-authored-by: Matthias Seitz <[email protected]>
Co-authored-by: Georgios Konstantopoulos <[email protected]>

* fix(verify): encode constructor arguments correctly (#1711)

* fix(verify): encode constructor arguments correctly

* chore: rotate api keys

* Update cli/tests/it/verify.rs

Co-authored-by: Georgios Konstantopoulos <[email protected]>

* feat: use rotating api keys in fork unit tests (#1693)

* feat: use rotating api keys in fork unit tests

* fix: use correct path

Co-authored-by: Georgios Konstantopoulos <[email protected]>

* refactor: spawn backendhandler on background thread (#1704)

* fix(watch): only watch dirs that exists (#1710)

* Switch selector database to sig.eth.samczsun.com (#1674)

* feat(utils): use samczsun selector directory

This commit switches the utils crate to use samczsun's new function
selector over 4byte for an improved interface and better stability

* feat(cast): update cli to use new 4byte interface

The util bindings were changed to use samczsun's selector library in the
previous commit; this commit updates the cast cli to properly use the
slightly changed interface.

Also ran cargo fmt which updated some unrelated formatting

* fix: review comments

- undo unrelated cargo fmt changes
- rename fourbyte_* -> decode_* in utils

* fix: remove fourbyte test helper

No longer necessary with sig.eth.samczsun.com

* Add `forge upload-selectors` command (#1676)

* feat: add upload selectors command to forge

This commit adds a new command to forge to upload a contract's abi to
sig.eth.samczsun.com selector database

* fix: review comments

- added default for CoreBuildArgs
- cleaned up code ordering
- moved url to constant

* fix: derive CoreBuildArgs::Default

* test: rotate rinkeby keys

* fix(forge/install): add git status check before commit (#1696)

* fix(forge/install): add git status check before commit

* move logic to git_status_clean function

Co-authored-by: test <[email protected]>

* write chunk

* restore original

* write chunks w/ paren

* semicolon cleanup

* write_semicolon

* feat: add `cast upload-signature` (#1716)

* feat: add `cast upload-signature`

This commit adds a new cast command to upload a raw function signature
to the https://sig.eth.samczsun.com 4byte database.

It also moves some of the original signature upload logic from `forge
upload-selectors` to a helper in foundry_utils

API looks like:
```
❯ cast upload-signature 'function approve(address,uint256)' 'transfer(uint256)' 'event Transfer(uint256,address)'
Duplicated: Function approve(address,uint256): 0x095ea7b3
Duplicated: Function transfer(uint256): 0x12514bba
Duplicated: Event Transfer(uint256,address): 0xabe1dcf9fcb8e5fb309db76bcab112a217aa5754d0f038921282bfe7907aa516
```

* fix: move selectors utils to separate module

* fix: add examples to cli help

* test(cast): add integration test for `cast upload-signature`

* feat(cast): allow uploading contract artifacts

This commit enables the `cast upload-signatures` tool to take contract
artifact files and upload the entire json to sig.eth.samczsun.com

* test: update failing tests (#1714)

* test: fix flaky timestamp test (#1727)

* fix: expressive value_name in clap annotations (#1700)

* value_name in forge test

* test debug help

* remove help and revert debug value_name to TEST FUNCTION

* forge test value_name

* forge value_name

* forge args add value_name

* all cast value_name

* Update cli/src/cmd/cast/run.rs

Co-authored-by: Matthias Seitz <[email protected]>

* cast FourByteDecode merge conflict

Co-authored-by: Matthias Seitz <[email protected]>

* ClapChain value_name (#1731)

* utils & cleanup

* fix(forge/install): git status check (#1732)

* fix(cli): can_update_libs_section test (#1733)

* write_chunk! where possible

* func def fmt

* fix attrs

* tests

* linter

* anvil value_name (#1743)

* docs

* indented & indented_if

* unused import

* cleanup

* ci: add additional ci jobs for forks (#1728)

* ci: add additional ci jobs for forks

* test: fix flaky anvil test

* ci: setup git config

* ci: setup git config

* ci: setup git config global

* chore: fix flaky snapshot test

* fix: enable tokio time feature (#1750)

* chore(deps): replace colored with yansi (#1722)

* feat(config): add allow paths setting (#1751)

* ci: set git config global in cross platform ci (#1754)

* ci: set git config global in cross platform ci

* fix: flaky tests

* fix: use proper types

* fix(cast): improve cast wallet new (#1713)

* fix(cast): improve cast wallet new

* chore: cleanup imports

Co-authored-by: jole <[email protected]>
Co-authored-by: Bjerg <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>
Co-authored-by: Georgios Konstantopoulos <[email protected]>
Co-authored-by: Meet Mangukiya <[email protected]>
Co-authored-by: marktoda <[email protected]>
Co-authored-by: 0xYYY <[email protected]>
Co-authored-by: test <[email protected]>
Co-authored-by: Shawn Harmsen <[email protected]>
jpopesculian pushed a commit that referenced this pull request Jun 9, 2022
* keep tack of emitter of logs (#1669)

* [not compiling] keep tack of emitter of logs

by switching from RawLog to Log

* ugly fix

* cargo +nightly fmt

* Add comment

Co-authored-by: Bjerg <[email protected]>

* fix variable name

Co-authored-by: Bjerg <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>

* provide default impls for remaining visitor methods (#1706)

* chore(clippy): make clippy happy (#1707)

* chore: bump ethers

* feat(bind): option to skip Cargo.toml from consistency checks (#1702)

* feat(bind): option to skip Cargo.toml from consistency checks

* chore: cargo fmt

* Update cli/src/cmd/forge/bind.rs

Co-authored-by: Matthias Seitz <[email protected]>

* chore: clippy lints

Co-authored-by: Matthias Seitz <[email protected]>
Co-authored-by: Georgios Konstantopoulos <[email protected]>

* fix(verify): encode constructor arguments correctly (#1711)

* fix(verify): encode constructor arguments correctly

* chore: rotate api keys

* Update cli/tests/it/verify.rs

Co-authored-by: Georgios Konstantopoulos <[email protected]>

* feat: use rotating api keys in fork unit tests (#1693)

* feat: use rotating api keys in fork unit tests

* fix: use correct path

Co-authored-by: Georgios Konstantopoulos <[email protected]>

* refactor: spawn backendhandler on background thread (#1704)

* fix(watch): only watch dirs that exists (#1710)

* Switch selector database to sig.eth.samczsun.com (#1674)

* feat(utils): use samczsun selector directory

This commit switches the utils crate to use samczsun's new function
selector over 4byte for an improved interface and better stability

* feat(cast): update cli to use new 4byte interface

The util bindings were changed to use samczsun's selector library in the
previous commit; this commit updates the cast cli to properly use the
slightly changed interface.

Also ran cargo fmt which updated some unrelated formatting

* fix: review comments

- undo unrelated cargo fmt changes
- rename fourbyte_* -> decode_* in utils

* fix: remove fourbyte test helper

No longer necessary with sig.eth.samczsun.com

* Add `forge upload-selectors` command (#1676)

* feat: add upload selectors command to forge

This commit adds a new command to forge to upload a contract's abi to
sig.eth.samczsun.com selector database

* fix: review comments

- added default for CoreBuildArgs
- cleaned up code ordering
- moved url to constant

* fix: derive CoreBuildArgs::Default

* test: rotate rinkeby keys

* fix(forge/install): add git status check before commit (#1696)

* fix(forge/install): add git status check before commit

* move logic to git_status_clean function

Co-authored-by: test <[email protected]>

* write chunk

* restore original

* write chunks w/ paren

* semicolon cleanup

* write_semicolon

* feat: add `cast upload-signature` (#1716)

* feat: add `cast upload-signature`

This commit adds a new cast command to upload a raw function signature
to the https://sig.eth.samczsun.com 4byte database.

It also moves some of the original signature upload logic from `forge
upload-selectors` to a helper in foundry_utils

API looks like:
```
❯ cast upload-signature 'function approve(address,uint256)' 'transfer(uint256)' 'event Transfer(uint256,address)'
Duplicated: Function approve(address,uint256): 0x095ea7b3
Duplicated: Function transfer(uint256): 0x12514bba
Duplicated: Event Transfer(uint256,address): 0xabe1dcf9fcb8e5fb309db76bcab112a217aa5754d0f038921282bfe7907aa516
```

* fix: move selectors utils to separate module

* fix: add examples to cli help

* test(cast): add integration test for `cast upload-signature`

* feat(cast): allow uploading contract artifacts

This commit enables the `cast upload-signatures` tool to take contract
artifact files and upload the entire json to sig.eth.samczsun.com

* test: update failing tests (#1714)

* test: fix flaky timestamp test (#1727)

* fix: expressive value_name in clap annotations (#1700)

* value_name in forge test

* test debug help

* remove help and revert debug value_name to TEST FUNCTION

* forge test value_name

* forge value_name

* forge args add value_name

* all cast value_name

* Update cli/src/cmd/cast/run.rs

Co-authored-by: Matthias Seitz <[email protected]>

* cast FourByteDecode merge conflict

Co-authored-by: Matthias Seitz <[email protected]>

* ClapChain value_name (#1731)

* utils & cleanup

* fix(forge/install): git status check (#1732)

* fix(cli): can_update_libs_section test (#1733)

* write_chunk! where possible

* func def fmt

* fix attrs

* tests

* linter

* anvil value_name (#1743)

* docs

* indented & indented_if

* unused import

* cleanup

* ci: add additional ci jobs for forks (#1728)

* ci: add additional ci jobs for forks

* test: fix flaky anvil test

* ci: setup git config

* ci: setup git config

* ci: setup git config global

* chore: fix flaky snapshot test

* fix: enable tokio time feature (#1750)

* chore(deps): replace colored with yansi (#1722)

* feat(config): add allow paths setting (#1751)

* ci: set git config global in cross platform ci (#1754)

* ci: set git config global in cross platform ci

* fix: flaky tests

* fix: use proper types

* fix(cast): improve cast wallet new (#1713)

* fix(cast): improve cast wallet new

* chore: cleanup imports

Co-authored-by: jole <[email protected]>
Co-authored-by: Bjerg <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>
Co-authored-by: Georgios Konstantopoulos <[email protected]>
Co-authored-by: Meet Mangukiya <[email protected]>
Co-authored-by: marktoda <[email protected]>
Co-authored-by: 0xYYY <[email protected]>
Co-authored-by: test <[email protected]>
Co-authored-by: Shawn Harmsen <[email protected]>
jpopesculian pushed a commit that referenced this pull request Jun 10, 2022
* keep tack of emitter of logs (#1669)

* [not compiling] keep tack of emitter of logs

by switching from RawLog to Log

* ugly fix

* cargo +nightly fmt

* Add comment

Co-authored-by: Bjerg <[email protected]>

* fix variable name

Co-authored-by: Bjerg <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>

* provide default impls for remaining visitor methods (#1706)

* chore(clippy): make clippy happy (#1707)

* chore: bump ethers

* feat(bind): option to skip Cargo.toml from consistency checks (#1702)

* feat(bind): option to skip Cargo.toml from consistency checks

* chore: cargo fmt

* Update cli/src/cmd/forge/bind.rs

Co-authored-by: Matthias Seitz <[email protected]>

* chore: clippy lints

Co-authored-by: Matthias Seitz <[email protected]>
Co-authored-by: Georgios Konstantopoulos <[email protected]>

* fix(verify): encode constructor arguments correctly (#1711)

* fix(verify): encode constructor arguments correctly

* chore: rotate api keys

* Update cli/tests/it/verify.rs

Co-authored-by: Georgios Konstantopoulos <[email protected]>

* feat: use rotating api keys in fork unit tests (#1693)

* feat: use rotating api keys in fork unit tests

* fix: use correct path

Co-authored-by: Georgios Konstantopoulos <[email protected]>

* refactor: spawn backendhandler on background thread (#1704)

* fix(watch): only watch dirs that exists (#1710)

* Switch selector database to sig.eth.samczsun.com (#1674)

* feat(utils): use samczsun selector directory

This commit switches the utils crate to use samczsun's new function
selector over 4byte for an improved interface and better stability

* feat(cast): update cli to use new 4byte interface

The util bindings were changed to use samczsun's selector library in the
previous commit; this commit updates the cast cli to properly use the
slightly changed interface.

Also ran cargo fmt which updated some unrelated formatting

* fix: review comments

- undo unrelated cargo fmt changes
- rename fourbyte_* -> decode_* in utils

* fix: remove fourbyte test helper

No longer necessary with sig.eth.samczsun.com

* Add `forge upload-selectors` command (#1676)

* feat: add upload selectors command to forge

This commit adds a new command to forge to upload a contract's abi to
sig.eth.samczsun.com selector database

* fix: review comments

- added default for CoreBuildArgs
- cleaned up code ordering
- moved url to constant

* fix: derive CoreBuildArgs::Default

* test: rotate rinkeby keys

* fix(forge/install): add git status check before commit (#1696)

* fix(forge/install): add git status check before commit

* move logic to git_status_clean function

Co-authored-by: test <[email protected]>

* write chunk

* restore original

* write chunks w/ paren

* semicolon cleanup

* write_semicolon

* feat: add `cast upload-signature` (#1716)

* feat: add `cast upload-signature`

This commit adds a new cast command to upload a raw function signature
to the https://sig.eth.samczsun.com 4byte database.

It also moves some of the original signature upload logic from `forge
upload-selectors` to a helper in foundry_utils

API looks like:
```
❯ cast upload-signature 'function approve(address,uint256)' 'transfer(uint256)' 'event Transfer(uint256,address)'
Duplicated: Function approve(address,uint256): 0x095ea7b3
Duplicated: Function transfer(uint256): 0x12514bba
Duplicated: Event Transfer(uint256,address): 0xabe1dcf9fcb8e5fb309db76bcab112a217aa5754d0f038921282bfe7907aa516
```

* fix: move selectors utils to separate module

* fix: add examples to cli help

* test(cast): add integration test for `cast upload-signature`

* feat(cast): allow uploading contract artifacts

This commit enables the `cast upload-signatures` tool to take contract
artifact files and upload the entire json to sig.eth.samczsun.com

* test: update failing tests (#1714)

* test: fix flaky timestamp test (#1727)

* fix: expressive value_name in clap annotations (#1700)

* value_name in forge test

* test debug help

* remove help and revert debug value_name to TEST FUNCTION

* forge test value_name

* forge value_name

* forge args add value_name

* all cast value_name

* Update cli/src/cmd/cast/run.rs

Co-authored-by: Matthias Seitz <[email protected]>

* cast FourByteDecode merge conflict

Co-authored-by: Matthias Seitz <[email protected]>

* ClapChain value_name (#1731)

* utils & cleanup

* fix(forge/install): git status check (#1732)

* fix(cli): can_update_libs_section test (#1733)

* write_chunk! where possible

* func def fmt

* fix attrs

* tests

* linter

* anvil value_name (#1743)

* docs

* indented & indented_if

* unused import

* cleanup

* ci: add additional ci jobs for forks (#1728)

* ci: add additional ci jobs for forks

* test: fix flaky anvil test

* ci: setup git config

* ci: setup git config

* ci: setup git config global

* chore: fix flaky snapshot test

* fix: enable tokio time feature (#1750)

* chore(deps): replace colored with yansi (#1722)

* feat(config): add allow paths setting (#1751)

* ci: set git config global in cross platform ci (#1754)

* ci: set git config global in cross platform ci

* fix: flaky tests

* fix: use proper types

* fix(cast): improve cast wallet new (#1713)

* fix(cast): improve cast wallet new

* chore: cleanup imports

Co-authored-by: jole <[email protected]>
Co-authored-by: Bjerg <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>
Co-authored-by: Georgios Konstantopoulos <[email protected]>
Co-authored-by: Meet Mangukiya <[email protected]>
Co-authored-by: marktoda <[email protected]>
Co-authored-by: 0xYYY <[email protected]>
Co-authored-by: test <[email protected]>
Co-authored-by: Shawn Harmsen <[email protected]>
gakonst added a commit that referenced this pull request Jun 11, 2022
* squashed WIP initial comments implementation

* Use FormatBuffer for both main buf and temp bufs

The FormatBuffer now implements fmt::Write and handles the indentation
logic, tracking characters and line length. Formatter continues to
control the rest of the logic for how to build strings

* add idempotency test

* try to correctly prefix/postfix given indentation grouping

* [wip] fix(forge): `fmt` write chunk (#1717)

* keep tack of emitter of logs (#1669)

* [not compiling] keep tack of emitter of logs

by switching from RawLog to Log

* ugly fix

* cargo +nightly fmt

* Add comment

Co-authored-by: Bjerg <[email protected]>

* fix variable name

Co-authored-by: Bjerg <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>

* provide default impls for remaining visitor methods (#1706)

* chore(clippy): make clippy happy (#1707)

* chore: bump ethers

* feat(bind): option to skip Cargo.toml from consistency checks (#1702)

* feat(bind): option to skip Cargo.toml from consistency checks

* chore: cargo fmt

* Update cli/src/cmd/forge/bind.rs

Co-authored-by: Matthias Seitz <[email protected]>

* chore: clippy lints

Co-authored-by: Matthias Seitz <[email protected]>
Co-authored-by: Georgios Konstantopoulos <[email protected]>

* fix(verify): encode constructor arguments correctly (#1711)

* fix(verify): encode constructor arguments correctly

* chore: rotate api keys

* Update cli/tests/it/verify.rs

Co-authored-by: Georgios Konstantopoulos <[email protected]>

* feat: use rotating api keys in fork unit tests (#1693)

* feat: use rotating api keys in fork unit tests

* fix: use correct path

Co-authored-by: Georgios Konstantopoulos <[email protected]>

* refactor: spawn backendhandler on background thread (#1704)

* fix(watch): only watch dirs that exists (#1710)

* Switch selector database to sig.eth.samczsun.com (#1674)

* feat(utils): use samczsun selector directory

This commit switches the utils crate to use samczsun's new function
selector over 4byte for an improved interface and better stability

* feat(cast): update cli to use new 4byte interface

The util bindings were changed to use samczsun's selector library in the
previous commit; this commit updates the cast cli to properly use the
slightly changed interface.

Also ran cargo fmt which updated some unrelated formatting

* fix: review comments

- undo unrelated cargo fmt changes
- rename fourbyte_* -> decode_* in utils

* fix: remove fourbyte test helper

No longer necessary with sig.eth.samczsun.com

* Add `forge upload-selectors` command (#1676)

* feat: add upload selectors command to forge

This commit adds a new command to forge to upload a contract's abi to
sig.eth.samczsun.com selector database

* fix: review comments

- added default for CoreBuildArgs
- cleaned up code ordering
- moved url to constant

* fix: derive CoreBuildArgs::Default

* test: rotate rinkeby keys

* fix(forge/install): add git status check before commit (#1696)

* fix(forge/install): add git status check before commit

* move logic to git_status_clean function

Co-authored-by: test <[email protected]>

* write chunk

* restore original

* write chunks w/ paren

* semicolon cleanup

* write_semicolon

* feat: add `cast upload-signature` (#1716)

* feat: add `cast upload-signature`

This commit adds a new cast command to upload a raw function signature
to the https://sig.eth.samczsun.com 4byte database.

It also moves some of the original signature upload logic from `forge
upload-selectors` to a helper in foundry_utils

API looks like:
```
❯ cast upload-signature 'function approve(address,uint256)' 'transfer(uint256)' 'event Transfer(uint256,address)'
Duplicated: Function approve(address,uint256): 0x095ea7b3
Duplicated: Function transfer(uint256): 0x12514bba
Duplicated: Event Transfer(uint256,address): 0xabe1dcf9fcb8e5fb309db76bcab112a217aa5754d0f038921282bfe7907aa516
```

* fix: move selectors utils to separate module

* fix: add examples to cli help

* test(cast): add integration test for `cast upload-signature`

* feat(cast): allow uploading contract artifacts

This commit enables the `cast upload-signatures` tool to take contract
artifact files and upload the entire json to sig.eth.samczsun.com

* test: update failing tests (#1714)

* test: fix flaky timestamp test (#1727)

* fix: expressive value_name in clap annotations (#1700)

* value_name in forge test

* test debug help

* remove help and revert debug value_name to TEST FUNCTION

* forge test value_name

* forge value_name

* forge args add value_name

* all cast value_name

* Update cli/src/cmd/cast/run.rs

Co-authored-by: Matthias Seitz <[email protected]>

* cast FourByteDecode merge conflict

Co-authored-by: Matthias Seitz <[email protected]>

* ClapChain value_name (#1731)

* utils & cleanup

* fix(forge/install): git status check (#1732)

* fix(cli): can_update_libs_section test (#1733)

* write_chunk! where possible

* func def fmt

* fix attrs

* tests

* linter

* anvil value_name (#1743)

* docs

* indented & indented_if

* unused import

* cleanup

* ci: add additional ci jobs for forks (#1728)

* ci: add additional ci jobs for forks

* test: fix flaky anvil test

* ci: setup git config

* ci: setup git config

* ci: setup git config global

* chore: fix flaky snapshot test

* fix: enable tokio time feature (#1750)

* chore(deps): replace colored with yansi (#1722)

* feat(config): add allow paths setting (#1751)

* ci: set git config global in cross platform ci (#1754)

* ci: set git config global in cross platform ci

* fix: flaky tests

* fix: use proper types

* fix(cast): improve cast wallet new (#1713)

* fix(cast): improve cast wallet new

* chore: cleanup imports

Co-authored-by: jole <[email protected]>
Co-authored-by: Bjerg <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>
Co-authored-by: Georgios Konstantopoulos <[email protected]>
Co-authored-by: Meet Mangukiya <[email protected]>
Co-authored-by: marktoda <[email protected]>
Co-authored-by: 0xYYY <[email protected]>
Co-authored-by: test <[email protected]>
Co-authored-by: Shawn Harmsen <[email protected]>

* [wip] feat(fmt): format buffer groups (#1780)

* fmt groups

* reset to init start group functionality & use where needed

* expand test case

* [wip] feat(fmt): intermediate chunk struct (#1831)

* wip: use a struct for managing an intermediate representation

* cleanup visit function definition

* fix import statements

* restrict temp bufs to the current line restriction and simplify visit contract

* consistent ordering of parameters in chunk operations

* fix up using list formatting for multiline support

* convert to second iteration of write_chunk_separated

Co-authored-by: Julian Popescu <[email protected]>

* [wip] feat(fmt): expressions (#1809)

* add an Operator trait for implementing Expression formatting

* basic implementation of write operator expression

* add grouping of expression parts by precedence

* Add tests back and fix unnecessary indent

Chunks were being unnecessarily indented because writing source to a
temp buffer wasn't accounting the indent already existing, thereby
essentially adding extra indent where not needed when being written
again to the underlying buffer

* Add custom error to fmt (#1852)

* feat(fmt): Add single line helpers (#1860)

* Add single line helpers and reimplement surrounds and function definition with helpers

* feat(fmt): `for`, `while` & `do while` statements (#1864)

* for while statements

* rm comments

* for loop header

* do while support

* uncomment tests

* rm comments

* address comments

* feat(fmt): Expression multiline formatting (#1879)

* Basic flat expressions

* Add expression formatting

* fix var definition to handle multiline declaration appropriately

* Add assignment expressions

* fix tests

* simplify result handling

Co-authored-by: Roman Krasiuk <[email protected]>

* add information about chunks and comments

* fix unit tests

* fix(fmt): comment indent (#1888)

* fix comment indent

* Fix postfix categorization for multiline comments

Postfix comments try to see if they sit on an indent greater
than the next code block. However the code was splitting the src into
lines before removing comments to check for the next code point causing
it to break on multiline comments

* Fix write_raw indent len

`write_raw` wasn't appropriately trimming base_indent_len and was off by
one in special cases. In addition `write_raw` was not setting
is_beginning_of_line correctly

Co-authored-by: Julian Popescu <[email protected]>

* fix spacing in source unit parts

* fix spacing in contract parts with comments

* fix statement spacing

* make lined statements dryer

* fix duplicated prefix statement in visit_src block

* fix event multiline edge cases

* convert attributes to chunks after newline to account for line length

* better function ordering and Transact helpers

* add doc comments to visit helpers

* add doc comments to other helper traits and structs

* add location info to break and continue

* trim the end of comments where necessary

* fix expression lists

* fix the case of a missing list param

* dep(fmt): update ethers & solang (#1909)

* upd solang

* remove helpers

* attr override

* fix

* remove

* group ident path

Co-authored-by: Roman Krasiuk <[email protected]>
Co-authored-by: jole <[email protected]>
Co-authored-by: Bjerg <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>
Co-authored-by: Georgios Konstantopoulos <[email protected]>
Co-authored-by: Meet Mangukiya <[email protected]>
Co-authored-by: marktoda <[email protected]>
Co-authored-by: 0xYYY <[email protected]>
Co-authored-by: test <[email protected]>
Co-authored-by: Shawn Harmsen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge T-feature Type: feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants