From 6bd8e0dd3e262da72a6aeb7568acf0a91f716588 Mon Sep 17 00:00:00 2001 From: Juan Manuel Rodriguez Defago Date: Tue, 11 Apr 2023 10:43:35 -0300 Subject: [PATCH] fix: make sure ENS record always exist --- config/arbitrumGoerliAddressScript.ts | 3 +++ config/goerliAddressScript.ts | 3 +++ config/mainnetAddressScript.ts | 3 +++ config/mainnetArbitrumAddressScript.ts | 3 +++ 4 files changed, 12 insertions(+) diff --git a/config/arbitrumGoerliAddressScript.ts b/config/arbitrumGoerliAddressScript.ts index 88ea59ff..ca11a8eb 100644 --- a/config/arbitrumGoerliAddressScript.ts +++ b/config/arbitrumGoerliAddressScript.ts @@ -38,6 +38,9 @@ const main = (): void => { output.bridgeBlockNumber = '1023272' // Bridge deployment block on L2 output.network = 'arbitrum-goerli' output.useTokenLockManager = false + if(output.ens == '') { + output.ens = '0x0000000000000000000000000000000000000000' // to avoid crashes due to bad config + } fs.writeFileSync(__dirname + '/generatedAddresses.json', JSON.stringify(output, null, 2)) } catch (e) { console.log(`Error saving artifacts: ${e.message}`) diff --git a/config/goerliAddressScript.ts b/config/goerliAddressScript.ts index b5c5f91f..cba6f613 100644 --- a/config/goerliAddressScript.ts +++ b/config/goerliAddressScript.ts @@ -39,6 +39,9 @@ const main = (): void => { output.network = 'goerli' output.tokenLockManager = '0x9a7a54e86560f4304d8862Ea00F45D1090c59ac8' // we don't have one, this is rinkebys' output.useTokenLockManager = true + if(output.ens == '') { + output.ens = '0x0000000000000000000000000000000000000000' // to avoid crashes due to bad config + } fs.writeFileSync(__dirname + '/generatedAddresses.json', JSON.stringify(output, null, 2)) } catch (e) { console.log(`Error saving artifacts: ${e.message}`) diff --git a/config/mainnetAddressScript.ts b/config/mainnetAddressScript.ts index 18e9c9b8..c788de33 100644 --- a/config/mainnetAddressScript.ts +++ b/config/mainnetAddressScript.ts @@ -39,6 +39,9 @@ const main = (): void => { output.bridgeBlockNumber = '16083315' // Bridge deployment block on L1 output.tokenLockManager = '0xFCf78AC094288D7200cfdB367A8CD07108dFa128' output.useTokenLockManager = true + if(output.ens == '') { + output.ens = '0x0000000000000000000000000000000000000000' // to avoid crashes due to bad config + } fs.writeFileSync(__dirname + '/generatedAddresses.json', JSON.stringify(output, null, 2)) } catch (e) { console.log(`Error saving artifacts: ${e.message}`) diff --git a/config/mainnetArbitrumAddressScript.ts b/config/mainnetArbitrumAddressScript.ts index f1009de1..838cb8e9 100644 --- a/config/mainnetArbitrumAddressScript.ts +++ b/config/mainnetArbitrumAddressScript.ts @@ -42,6 +42,9 @@ const main = (): void => { if(output.ethereumDIDRegistry == '') { output.ethereumDIDRegistry = '0xdCa7EF03e98e0DC2B855bE647C39ABe984fcF21B' // since the package doens't have it yet } + if(output.ens == '') { + output.ens = '0x0000000000000000000000000000000000000000' // to avoid crashes due to bad config + } fs.writeFileSync(__dirname + '/generatedAddresses.json', JSON.stringify(output, null, 2)) } catch (e) { console.log(`Error saving artifacts: ${e.message}`)