-
Notifications
You must be signed in to change notification settings - Fork 44
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
improve(unwrapWeth): load WETH addresses from constants #1840
base: master
Are you sure you want to change the base?
Conversation
scripts/unwrapWeth.ts
Outdated
@@ -23,6 +23,7 @@ const WETH_ADDRESSES = { | |||
288: "0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000", | |||
324: "0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91", | |||
8453: "0x4200000000000000000000000000000000000006", | |||
7777777: "0x4200000000000000000000000000000000000006", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we just import { TOKEN_SYMBOLS_MAP } from ../src/utils
and dereference TOKEN_SYMBOLS_MAP.WETH.addresses[chainId]
? Then we get these addresses for free.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one nit
@@ -36,10 +34,10 @@ export async function run(): Promise<void> { | |||
const signerAddr = await baseSigner.getAddress(); | |||
const chainId = Number(args.chainId); | |||
const connectedSigner = baseSigner.connect(await getProvider(chainId)); | |||
if (!isKeyOf(chainId, WETH_ADDRESSES)) { | |||
if (!TOKEN_SYMBOLS_MAP.WETH.addresses[chainId]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we convert this to an assert( )
Simple refactor to re-use constants