Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
version: 8
run_install: true

- name: Get changes
run: git diff --name-only -r HEAD^1 HEAD

- name: Test
run: |
npx tsx ./src/verify.ts $(git diff --name-only -r HEAD^1 HEAD)
Binary file added data/TSC/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 0 additions & 11 deletions data/UNI/data.json

This file was deleted.

11 changes: 0 additions & 11 deletions data/USDT/data.json

This file was deleted.

225 changes: 0 additions & 225 deletions src/abis/L2StandardERC20.ts

This file was deleted.

28 changes: 5 additions & 23 deletions src/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { isAddressEqual, isAddress } from "viem/utils";

import { OptimismMintableERC20Abi } from "./abis/OptimismMintableERC20";
import { StandardBridgeAbi } from "./abis/StandardBridge";
import { L2StandardERC20Abi } from "./abis/L2StandardERC20";
import { getViemChain, TokenData } from "./utils";

async function main() {
Expand Down Expand Up @@ -48,7 +47,7 @@ async function main() {
throw new Error(`Invalid address for chainId ${chainId}`);
}

const [BRIDGE, REMOTE_TOKEN, l2Bridge, l1Token] = await Promise.all([
const [BRIDGE, REMOTE_TOKEN] = await Promise.all([
client
.readContract({
abi: OptimismMintableERC20Abi,
Expand All @@ -63,34 +62,17 @@ async function main() {
address: address as Address,
})
.catch(() => null),
client
.readContract({
abi: L2StandardERC20Abi,
functionName: "l2Bridge",
address: address as Address,
})
.catch(() => null),
client
.readContract({
abi: L2StandardERC20Abi,
functionName: "l1Token",
address: address as Address,
})
.catch(() => null),
]);
console.log("BRIDGE", BRIDGE);
console.log("REMOTE_TOKEN", REMOTE_TOKEN);

const localBridge = BRIDGE || l2Bridge;
const remoteToken = REMOTE_TOKEN || l1Token;

// mintable
if (localBridge && remoteToken) {
if (BRIDGE && REMOTE_TOKEN) {
mintable = true;
console.log(chainId, "is mintable");

const baseChainId = Object.entries(data!.addresses).find(
([_, address]) => isAddressEqual(address as Address, remoteToken)
([_, address]) => isAddressEqual(address as Address, REMOTE_TOKEN)
);
if (!baseChainId) {
throw new Error(
Expand All @@ -109,7 +91,7 @@ async function main() {
.readContract({
abi: StandardBridgeAbi,
functionName: "OTHER_BRIDGE",
address: localBridge,
address: BRIDGE,
})
.catch(() => null);
if (!BASE_BRIDGE) {
Expand All @@ -129,7 +111,7 @@ async function main() {
if (!REMOTE_BRIDGE) {
throw new Error("REMOTE_BRIDGE not found");
}
if (!isAddressEqual(REMOTE_BRIDGE, localBridge)) {
if (!isAddressEqual(REMOTE_BRIDGE, BRIDGE)) {
throw new Error("Bridge addresses do not match");
}
} else {
Expand Down
Loading