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 aliases for Base, BaseSepolia and BaseGoerli #32

Merged
merged 5 commits into from
Jan 26, 2024

Conversation

gabrielstoica
Copy link
Contributor

Motivation

There are no aliases set for Base Mainnet, Base Sepolia and Base Goerli.

Solution

Add aliases for Base, BaseGoerli and BaseSepolia and related tests.

Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

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

Thanks!

@DaniPopes
Copy link
Member

DaniPopes commented Jan 26, 2024

Wait, the JSON file has not updated, are you sure this does anything? It looks to me that the aliases are the exact same as the default serialization done by Serde (snake_case) and Strum (kebab-case).

@gabrielstoica
Copy link
Contributor Author

gabrielstoica commented Jan 26, 2024

Shouldn't this set the aliases so they can be used direcly in the foundry.toml file? e.g.

[etherscan]
base = { key = "${API_KEY_BASE}" }
base_goerli = { key = "${API_KEY_BASE}" }
base_sepolia = { key = "${API_KEY_BASE}" }

@DaniPopes
Copy link
Member

DaniPopes commented Jan 26, 2024

Yes, but those are the default values which are already valid, see:

chains/assets/chains.json

Lines 471 to 473 in 534bb02

"8453": {
"internalId": "Base",
"name": "base",

@gabrielstoica
Copy link
Contributor Author

gabrielstoica commented Jan 26, 2024

Indeed, when verifying a contract and passing the chain as --chain base-sepolia everything works, but when trying to run a script having that foundry.toml configuration file and providing the RPC URL as --rpc-url base_sepolia, I'm getting At least one of 'url' or 'chain' must be present for Etherscan config with unknown alias 'base_sepolia'.
Thought this will fix the error. Correct me if I'm wrong.

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.

@DaniPopes I've added more serde kebab cases aliases

and tests

@mattsse mattsse force-pushed the feature/base-alias branch from a529334 to 61a81f3 Compare January 26, 2024 11:38
@gabrielstoica
Copy link
Contributor Author

@mattsse Shouldn't all aliases also have a snake case format?

@mattsse
Copy link
Member

mattsse commented Jan 26, 2024

this is the default for serde

@mattsse mattsse merged commit 4c0fc27 into alloy-rs:main Jan 26, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants