Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ghost Collection #428

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions helpers/hardhat-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,14 +489,15 @@ export const eContractidToContractName = {
EXRP: "MintableERC721",
WGLMR: "MintableERC721",
MockBendDaoLendPool: "MockLendPool",
AggregatorGHOST: "ERC721OracleWrapper",
PositionMoverLogic: "PositionMoverLogic",
PoolPositionMoverImpl: "PoolPositionMover",
GHOST: "MintableERC721",
};

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?/);
process.env.XTOKEN_SYMBOL_UPGRADE_WHITELIST?.trim().split(/\s?,\s?/);
3 changes: 3 additions & 0 deletions helpers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ export interface iAssetBase<T> {
EXRP: T;
uBAYC: T;
uPPG: T;
GHOST: T;
}

export type iAssetsWithoutETH<T> = Omit<iAssetBase<T>, "ETH">;
Expand Down Expand Up @@ -578,6 +579,7 @@ export type iParaSpacePoolAssets<T> = Pick<
| "EXRP"
| "uBAYC"
| "uPPG"
| "GHOST"
>;

export type iMultiPoolsAssets<T> = iAssetCommon<T> | iParaSpacePoolAssets<T>;
Expand Down Expand Up @@ -651,6 +653,7 @@ export enum ERC721TokenContractId {
KODA = "KODA",
BLOCKS = "BLOCKS",
EXRP = "EXRP",
GHOST = "GHOST",
}

export enum NTokenContractId {
Expand Down
10 changes: 10 additions & 0 deletions market-config/auctionStrategies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,16 @@ export const auctionStrategyEXRP: IAuctionStrategyParams = {
tickLength: "900",
};

export const auctionStrategyGHOST: IAuctionStrategyParams = {
name: "auctionStrategyGHOST",
maxPriceMultiplier: utils.parseUnits("3", 18).toString(),
minExpPriceMultiplier: utils.parseUnits("1.2", 18).toString(),
minPriceMultiplier: utils.parseUnits("0.8", 18).toString(),
stepLinear: utils.parseUnits("0.06875", 18).toString(),
stepExp: utils.parseUnits("0.0285474001559822", 18).toString(),
tickLength: "900",
};

export const auctionStrategyLinear: IAuctionStrategyParams = {
name: "auctionStrategyLinear",
maxPriceMultiplier: utils.parseUnits("3", 18).toString(),
Expand Down
4 changes: 4 additions & 0 deletions market-config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ import {
strategyEXRP,
strategyuBAYC,
strategyuPPG,
strategyGHOST,
} from "./reservesConfigs";

export const CommonConfig: Pick<
Expand Down Expand Up @@ -385,6 +386,7 @@ export const GoerliConfig: IParaSpaceConfiguration = {
BLOCKS: strategyBLOCKS,
uBAYC: strategyuBAYC,
uPPG: strategyuPPG,
GHOST: strategyGHOST,
},
DelegationRegistry: "0x00000000000000447e69651d841bD8D104Bed493",
};
Expand Down Expand Up @@ -898,6 +900,7 @@ export const MainnetConfig: IParaSpaceConfiguration = {
BLOCKS: "0x059EDD72Cd353dF5106D2B9cC5ab83a52287aC3a",
uBAYC: "0x1e610de0d7acfa1d820024948a91d96c5c9ce6b9",
uPPG: "0x30F7c830e0C2f4bEC871DF809D73E27eF19EB151",
GHOST: "0x9401518f4ebba857baa879d9f76e1cc8b31ed197",
},
YogaLabs: {
ApeCoinStaking: "0x5954aB967Bc958940b7EB73ee84797Dc8a2AFbb9",
Expand Down Expand Up @@ -993,6 +996,7 @@ export const MainnetConfig: IParaSpaceConfiguration = {
BLOCKS: strategyBLOCKS,
uBAYC: strategyuBAYC,
uPPG: strategyuPPG,
GHOST: strategyGHOST,
},
Mocks: undefined,
Oracle: MainnetOracleConfig,
Expand Down
2 changes: 2 additions & 0 deletions market-config/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export const MOCK_CHAINLINK_AGGREGATORS_PRICES = {
EXRP: parseEther("0.2").toString(),
uBAYC: parseEther("0.000002768").toString(),
uPPG: parseEther("0.000000477").toString(),
GHOST: parseEther("0.5").toString(),
};

export const MOCK_CHAINLINK_AGGREGATORS_USD_PRICES = {
Expand Down Expand Up @@ -132,6 +133,7 @@ export const MOCK_CHAINLINK_AGGREGATORS_USD_PRICES = {
EXRP: parseUnits("170", 8).toString(),
uBAYC: parseUnits("0.005", 8).toString(),
uPPG: parseUnits("0.004", 8).toString(),
GHOST: parseUnits("1000", 8).toString(),
};

export const MOCK_TOKEN_MINT_VALUE = {
Expand Down
18 changes: 18 additions & 0 deletions market-config/reservesConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
auctionStrategyZero,
auctionStrategyEXRP,
auctionStrategyUniswapV3,
auctionStrategyGHOST,
} from "./auctionStrategies";
import {
rateStrategyAAVE,
Expand Down Expand Up @@ -114,6 +115,7 @@ import {
timeLockStrategyEXRP,
timeLockStrategyuPPG,
timeLockStrategyuBAYC,
timeLockStrategyGHOST,
} from "./timeLockStrategies";

export const strategyDAI: IReserveParams = {
Expand Down Expand Up @@ -1111,3 +1113,19 @@ export const strategyuPPG: IReserveParams = {
borrowCap: "0",
supplyCap: "0",
};

export const strategyGHOST: IReserveParams = {
strategy: rateStrategyNFT,
auctionStrategy: auctionStrategyBEANZ,
timeLockStrategy: timeLockStrategyGHOST,
baseLTVAsCollateral: "3000",
liquidationProtocolFeePercentage: "0",
liquidationThreshold: "6500",
liquidationBonus: "10500",
borrowingEnabled: false,
reserveDecimals: "0",
xTokenImpl: eContractid.NTokenImpl,
reserveFactor: "0",
borrowCap: "0",
supplyCap: "1000",
};
12 changes: 12 additions & 0 deletions market-config/timeLockStrategies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,18 @@ export const timeLockStrategyBEANZ: ITimeLockStrategyParams = {
period: "86400",
};

export const timeLockStrategyGHOST: ITimeLockStrategyParams = {
name: "timeLockStrategyGHOST",
minThreshold: "5",
midThreshold: "20",
minWaitTime: "12",
midWaitTime: "7200",
maxWaitTime: "21600",
poolPeriodWaitTime: "600",
poolPeriodLimit: "40",
period: "86400",
};

export const timeLockStrategyDEGODS: ITimeLockStrategyParams = {
name: "timeLockStrategyDEGODS",
minThreshold: "4",
Expand Down
6 changes: 4 additions & 2 deletions scripts/upgrade/ntoken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@ export const upgradeNToken = async (verify = false) => {
continue;
}

if (XTOKEN_SYMBOL_UPGRADE_WHITELIST && !XTOKEN_SYMBOL_UPGRADE_WHITELIST.includes(symbol)) {
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
Loading