Skip to content

Commit

Permalink
chore: add link libraray debug info and support upgrade ntoken by symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoujia6139 committed Nov 6, 2023
1 parent ef6aea8 commit e3c43ad
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions helpers/contracts-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,8 @@ export const linkLibraries = (
if (addr === undefined) {
continue;
}
console.log("****linkLibraries*****libName:", libName);
console.log("****linkLibraries*****addr:", addr);

for (const fixup of fixups) {
bytecode =
Expand Down
3 changes: 3 additions & 0 deletions helpers/hardhat-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,3 +497,6 @@ export const XTOKEN_TYPE_UPGRADE_WHITELIST =
process.env.XTOKEN_TYPE_UPGRADE_WHITELIST?.trim()
.split(/\s?,\s?/)
.map((x) => +x);
export const XTOKEN_SYMBOL_UPGRADE_WHITELIST =
process.env.XTOKEN_SYMBOL_UPGRADE_WHITELIST?.trim()
.split(/\s?,\s?/);
7 changes: 7 additions & 0 deletions scripts/upgrade/ntoken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import dotenv from "dotenv";
import {
DRY_RUN,
GLOBAL_OVERRIDES,
XTOKEN_SYMBOL_UPGRADE_WHITELIST,
XTOKEN_TYPE_UPGRADE_WHITELIST,
} from "../../helpers/hardhat-constants";
import {dryRunEncodedData} from "../../helpers/contracts-helpers";
Expand Down Expand Up @@ -75,6 +76,12 @@ export const upgradeNToken = async (verify = false) => {
continue;
}

if (XTOKEN_SYMBOL_UPGRADE_WHITELIST && !XTOKEN_SYMBOL_UPGRADE_WHITELIST.includes(symbol)) {
console.log(symbol + "not in XTOKEN_SYMBOL_UPGRADE_WHITELIST, skip...");
continue;
}


if (xTokenType == XTokenType.NTokenBAYC) {
if (!nTokenBAYCImplementationAddress) {
console.log("deploy NTokenBAYC implementation");
Expand Down

0 comments on commit e3c43ad

Please sign in to comment.