From 66c920d578e6cb41d7fe2e737ec4cd0966f10d5d Mon Sep 17 00:00:00 2001 From: Alexis Sellier Date: Wed, 16 Jun 2021 17:37:55 +0200 Subject: [PATCH] Use canonical addresses for fetching safes --- src/utils.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils.ts b/src/utils.ts index 6d7a85254..5bb7a66d0 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -177,7 +177,8 @@ export async function resolveLabel(label: string, config: Config): Promise { if (! config.safe.api) return false; - const response = await fetch(`${config.safe.api}/safes/${address}`, { method: 'HEAD' }); + const addr = ethers.utils.getAddress(address); + const response = await fetch(`${config.safe.api}/safes/${addr}`, { method: 'HEAD' }); return response.ok; } @@ -186,7 +187,8 @@ export async function isSafe(address: string, config: Config): Promise export async function getSafe(address: string, config: Config): Promise { if (! config.safe.api) return null; - const response = await fetch(`${config.safe.api}/safes/${address}`, { + const addr = ethers.utils.getAddress(address); + const response = await fetch(`${config.safe.api}/safes/${addr}`, { method: 'GET', headers: { 'Accept': 'application/json',