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 verify command to allow verifying deployed contracts against local source code #948

Merged
merged 2 commits into from
Nov 2, 2023

Conversation

cburgdorf
Copy link
Collaborator

@cburgdorf cburgdorf commented Nov 2, 2023

What was wrong?

People need to be able to verify that a deployed contract matches the source code
that the author claims was used to deploy it. Previously, there was no simple
way to achieve this.

How was it fixed?

These are the steps to verify a contract with the verify command:

  1. Obtain the project's source code locally.
  2. Ensure it is the same source code that was used to deploy the contract. (e.g. check out a specific tag)
  3. From the project directory run fe verify <contract-address> <json-rpc-url>

Example:

$ fe verify 0xf0adbb9ed4135d1509ad039505bada942d18755f https://example-eth-mainnet-rpc.com
It's a match!✨

Onchain contract:
Address: 0xf0adbb9ed4135d1509ad039505bada942d18755f
Bytecode: 0x60008..76b90

Local contract:
Contract name: SimpleDAO
Source file: /home/work/ef/simple_dao/fe_contracts/simpledao/src/main.fe
Bytecode: 0x60008..76b90

Hint: Run with --verbose to see the contract's source code.

This builds on #947

@cburgdorf cburgdorf changed the title Christoph/feat/verify Add verify command to allow verifying deployed contracts against local source code Nov 2, 2023
Copy link
Member

@g-r-a-n-t g-r-a-n-t left a comment

Choose a reason for hiding this comment

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

looks great

Copy link
Collaborator

@sbillig sbillig left a comment

Choose a reason for hiding this comment

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

👍

@cburgdorf cburgdorf merged commit 53221ef into ethereum:master Nov 2, 2023
7 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