Skip to content

Commit

Permalink
skip FlowNFT contracts if not deployed
Browse files Browse the repository at this point in the history
  • Loading branch information
d10r committed Dec 22, 2023
1 parent d634909 commit e518b7a
Showing 1 changed file with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const {
getScriptRunnerFactory: S,
getCodeAddress,
extractWeb3Options,
ZERO_ADDRESS,
} = require("./libs/common");

/**
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit e518b7a

Please sign in to comment.