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

feature(contracts-bedrock): add verify.ts for verifying any contract #66

Merged
merged 5 commits into from
Oct 18, 2023

Conversation

welkin22
Copy link
Contributor

Description

Add a new hardhat task so that we can easily verify the contract

Rationale

The old contract verification method in the current version is invalid, and we cannot verify the contract easily.

Example

npx hardhat opbnb-verify --contract-address 0xc0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d30007 L2CrossDomainMessenger 0xd506952e78eecd5d4424b1990a0c99b1568e7c2c

You can use npx hardhat help opbnb-verify to view detailed help documentation

Changes

  • add verify.ts
  • import verify.ts into index.ts

@owen-reorg
Copy link
Collaborator

Verify opBNB Tokens Created by OptimismMintableERC20Factory Guide

Transaction Example:
https://testnet.opbnbscan.com/tx/0x83b676f62fd5db70e14a0e40eef40819032deddc7dc4e100ac93ee9f592584ab?tab=logs

CleanShot 2023-10-17 at 14 10 19@2x

Get the localToken address in OptimismMintableERC20Created event. Which is 0xd1917629b3e6a72e6772aab5dbe58eb7fa3c2f33 in the transaction above.

Run command as below:

$ npx hardhat opbnb-verify --contract-address 0xD1917629B3E6A72E6772Aab5dBe58Eb7FA3C2F33 OptimismMintableERC20 0x4200000000000000000000000000000000000010 0xe0BB0D3DE8c10976511e5030cA403dBf4c25165B BTCB BTCB
  • change 0xD1917629B3E6A72E6772Aab5dBe58Eb7FA3C2F33 to your localToken address
  • 0x4200000000000000000000000000000000000010 0xe0BB0D3DE8c10976511e5030cA403dBf4c25165B BTCB BTCB is the parameters of the constructor functions(constructor(address _bridge, address _remoteToken, string memory _name, string memory _symbol)). Replace the information with your deployed token.

@welkin22 welkin22 merged commit 4e8ed54 into bnb-chain:develop Oct 18, 2023
9 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.

None yet

3 participants