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: opt-in skip validation #264

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/lib/assetBridger/erc20Bridger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,14 @@ export class Erc20Bridger extends AssetBridger<
*/
public async getL1ERC20Address(
erc20L2Address: string,
l2Provider: Provider
l2Provider: Provider,
skipValidation = false
): Promise<string> {
await this.checkL2Network(l2Provider)

const arbERC20 = L2GatewayToken__factory.connect(erc20L2Address, l2Provider)
const l1Address = await arbERC20.functions.l1Address().then(([res]) => res)
if (skipValidation) return l1Address

// check that this l1 address is indeed registered to this l2 token
const l2GatewayRouter = L2GatewayRouter__factory.connect(
Expand Down