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

feat: add filecoin chains #2177

Merged
merged 4 commits into from Feb 27, 2023
Merged

feat: add filecoin chains #2177

merged 4 commits into from Feb 27, 2023

Conversation

AmeanAsad
Copy link
Contributor

Motivation

Adding Filecoin chains into the Chain enum. Filecoin is launching its own virtual machine and adding the Filecoin chains into ethers-rs allows developers to use them in the rust web3 tooling. The main personal use I have is estimating chain gas costs when using Foundry to deploy smart contracts on the Filecoin virtual machine.

Solution

Added filecoin chains into the Chain enum and the other corresponding spots required for their definition.

PR Checklist

  • Added Tests (N/A)
  • Added Documentation (N/A)
  • Updated the changelog
  • Breaking changes

Comment on lines +306 to +308
FilecoinHyperspaceTestnet => {
("https://api.hyperspace.node.glif.io/rpc/v1", "https://hyperspace.filfox.info")
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

are these compatible with etherscan API?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are not

Copy link
Owner

@gakonst gakonst Feb 23, 2023

Choose a reason for hiding this comment

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

Hmm then we cannot use them. We could make verification just not work on foundry but doubt we'll want to add special handling here

Where can we read more about the filecoin evm spec?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gakonst Here are some resources regarding docs/specs:

@prestwich
Copy link
Collaborator

prestwich commented Feb 22, 2023

we can't guarantee that ethers will behave properly for any virtualized EVM 🤔

@AmeanAsad
Copy link
Contributor Author

@prestwich the filecoin virtual machine is EVM compatible (idk if that helps). The main reason for this request is to enable gas estimation in Foundry which uses ethers Chain enum. As of now that is the only functionality required from this change. Is that acceptable?

@prestwich
Copy link
Collaborator

the FVM has a virtualized EVM, this is not necessarily the same thing as being EVM-compatible 😅

@DaniPopes
Copy link
Collaborator

I think this is ok, given that:

Although they have their own precompiles

Copy link
Owner

@gakonst gakonst left a comment

Choose a reason for hiding this comment

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

K - given no block explorer handlign im fine w this

@gakonst gakonst merged commit 47b56a6 into gakonst:master Feb 27, 2023
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.

None yet

5 participants