Skip to content

Commit

Permalink
feat: add contract verification exception for L2 precompiles (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredlacs authored Aug 18, 2023
1 parent 33fd25b commit 8bd3835
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions checks/check-targets-verified-etherscan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { JsonRpcProvider } from '@ethersproject/providers'
import { bullet, toAddressLink, getExplorer } from '../presentation/report'
import { ProposalCheck, TenderlySimulation } from '../types'
import { getProvider } from '../utils/utils'
import { ARBITRUM_PRECOMPILES } from '../utils/constants'

/**
* Check all targets with code are verified on Etherscan
Expand Down Expand Up @@ -40,6 +41,7 @@ async function checkVerificationStatuses(
const address = toAddressLink(addr, false, getExplorer(sim.simulation.network_id))
if (status === 'eoa') info.push(bullet(`${address}: EOA (verification not applicable)`))
else if (status === 'verified') info.push(bullet(`${address}: Contract (verified)`))
else if (ARBITRUM_PRECOMPILES.has(addr)) info.push(`${address}: Arbitrum Precompile (verification not applicable)`)
else info.push(bullet(`${address}: Contract (not verified)`))
}
return info
Expand Down
4 changes: 4 additions & 0 deletions utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ export const SIM_NAME = process.env.SIM_NAME ? process.env.SIM_NAME : null
export const DAO_NAME = process.env.DAO_NAME ? process.env.DAO_NAME : null
export const GOVERNOR_ADDRESS = process.env.GOVERNOR_ADDRESS ? process.env.GOVERNOR_ADDRESS : null
export const REPORTS_BRANCH = 'reports'

export const ARBITRUM_PRECOMPILES = new Set([
"0x0000000000000000000000000000000000000064", // ArbSys
])

0 comments on commit 8bd3835

Please sign in to comment.