From e518b7ad2f48e6247441d88f5a213ad2a56ed228 Mon Sep 17 00:00:00 2001 From: didi Date: Fri, 22 Dec 2023 17:37:25 +0100 Subject: [PATCH] skip FlowNFT contracts if not deployed --- .../info-print-contract-addresses.js | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/packages/ethereum-contracts/ops-scripts/info-print-contract-addresses.js b/packages/ethereum-contracts/ops-scripts/info-print-contract-addresses.js index 5342a0f8e1..407c5cea8d 100644 --- a/packages/ethereum-contracts/ops-scripts/info-print-contract-addresses.js +++ b/packages/ethereum-contracts/ops-scripts/info-print-contract-addresses.js @@ -6,6 +6,7 @@ const { getScriptRunnerFactory: S, getCodeAddress, extractWeb3Options, + ZERO_ADDRESS, } = require("./libs/common"); /** @@ -110,21 +111,29 @@ module.exports = eval(`(${S.toString()})()`)(async function ( const constantOutflowNFTProxyAddress = await superTokenLogicContract.CONSTANT_OUTFLOW_NFT(); - output += `CONSTANT_OUTFLOW_NFT_PROXY=${constantOutflowNFTProxyAddress}\n`; - const constantOutflowNFTLogicAddress = await ( - await UUPSProxiable.at(constantOutflowNFTProxyAddress) - ).getCodeAddress(); - output += `CONSTANT_OUTFLOW_NFT_LOGIC=${constantOutflowNFTLogicAddress}\n`; + // FlowNFTs are optional, zero address means not deployed + if (constantOutflowNFTProxyAddress !== ZERO_ADDRESS) { + output += `CONSTANT_OUTFLOW_NFT_PROXY=${constantOutflowNFTProxyAddress}\n`; + + const constantOutflowNFTLogicAddress = await ( + await UUPSProxiable.at(constantOutflowNFTProxyAddress) + ).getCodeAddress(); + output += `CONSTANT_OUTFLOW_NFT_LOGIC=${constantOutflowNFTLogicAddress}\n`; + } const constantInflowNFTProxyAddress = await superTokenLogicContract.CONSTANT_INFLOW_NFT(); - output += `CONSTANT_INFLOW_NFT_PROXY=${constantInflowNFTProxyAddress}\n`; - const constantInflowNFTLogicAddress = await ( - await UUPSProxiable.at(constantInflowNFTProxyAddress) - ).getCodeAddress(); - output += `CONSTANT_INFLOW_NFT_LOGIC=${constantInflowNFTLogicAddress}\n`; + // FlowNFTs are optional, zero address means not deployed + if (constantInflowNFTProxyAddress !== ZERO_ADDRESS) { + output += `CONSTANT_INFLOW_NFT_PROXY=${constantInflowNFTProxyAddress}\n`; + + const constantInflowNFTLogicAddress = await ( + await UUPSProxiable.at(constantInflowNFTProxyAddress) + ).getCodeAddress(); + output += `CONSTANT_INFLOW_NFT_LOGIC=${constantInflowNFTLogicAddress}\n`; + } if (! skipTokens) { await Promise.all(