Skip to content

Commit

Permalink
Pandora deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoujia6139 committed Feb 18, 2024
1 parent f2dc7e1 commit b73493a
Show file tree
Hide file tree
Showing 9 changed files with 549 additions and 45 deletions.
480 changes: 480 additions & 0 deletions contracts/mocks/tokens/Pandora.sol

Large diffs are not rendered by default.

23 changes: 22 additions & 1 deletion helpers/contracts-deployments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ import {
PoolAAPositionMover__factory,
PoolBorrowAndStake__factory,
PoolBorrowAndStake,
Pandora,
} from "../types";
import {
getACLManager,
Expand Down Expand Up @@ -1406,6 +1407,7 @@ export const deployAllERC721Tokens = async (verify?: boolean) => {
| Land
| Meebits
| Moonbirds
| Pandora
| Contract
| StakefishNFTManager;
} = {};
Expand All @@ -1430,7 +1432,7 @@ export const deployAllERC721Tokens = async (verify?: boolean) => {
console.log("contract address is already in db", tokenSymbol);
continue;
} else if (tokensConfig[tokenSymbol]) {
console.log("contract address is already in db", tokenSymbol);
console.log("contract address is set in market config", tokenSymbol);
await insertContractAddressInDb(
tokenSymbol,
tokensConfig[tokenSymbol],
Expand Down Expand Up @@ -1488,6 +1490,14 @@ export const deployAllERC721Tokens = async (verify?: boolean) => {
continue;
}

if (tokenSymbol === ERC721TokenContractId.PANDORA) {
tokens[tokenSymbol] = await deployPandora(
await deployer.getAddress(),
verify
);
continue;
}

if (tokenSymbol === ERC721TokenContractId.BAYC) {
tokens[tokenSymbol] = await deployBAYC(
[tokenSymbol, tokenSymbol, "8000", "0"],
Expand Down Expand Up @@ -2191,6 +2201,17 @@ export const deployUniswapSwapRouter = async (
verify
);

export const deployPandora = async (
owner: string,
verify?: boolean
): Promise<Pandora> =>
withSaveAndVerify(
await getContractFactory("Pandora"),
eContractid.PANDORA,
[owner],
verify
) as Promise<Pandora>;

export const deployStETH = async (verify?: boolean): Promise<StETHMocked> =>
withSaveAndVerify(
await getContractFactory("StETHMocked"),
Expand Down
1 change: 1 addition & 0 deletions helpers/hardhat-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,7 @@ export const eContractidToContractName = {
MockBendDaoLendPool: "MockLendPool",
PositionMoverLogic: "PositionMoverLogic",
PoolPositionMoverImpl: "PoolPositionMover",
PANDORA: "Pandora",
};

export const XTOKEN_TYPE_UPGRADE_WHITELIST =
Expand Down
2 changes: 2 additions & 0 deletions helpers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ export enum eContractid {
NFTDescriptor = "NFTDescriptor",
NonfungibleTokenPositionDescriptor = "NonfungibleTokenPositionDescriptor",
NonfungiblePositionManager = "NonfungiblePositionManager",
PANDORA = "PANDORA",
StETH = "stETH",
WStETH = "wstETH",
MockAToken = "MockAToken",
Expand Down Expand Up @@ -671,6 +672,7 @@ export enum ERC721TokenContractId {
KODA = "KODA",
BLOCKS = "BLOCKS",
EXRP = "EXRP",
PANDORA = "PANDORA",
}

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 auctionStrategyPandora: IAuctionStrategyParams = {
name: "auctionStrategyPandora",
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
46 changes: 2 additions & 44 deletions market-config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ import {
strategySTONE,
strategyTIA,
strategyMANTA,
strategyPandora,
} from "./reservesConfigs";

export const CommonConfig: Pick<
Expand Down Expand Up @@ -353,50 +354,7 @@ export const GoerliConfig: IParaSpaceConfiguration = {
},
// RESERVE ASSETS - CONFIG, ASSETS, BORROW RATES,
ReservesConfig: {
DAI: strategyDAI,
USDC: strategyUSDC,
USDT: strategyUSDT,
FRAX: strategyFRAX,
WETH: strategyWETH,
APE: strategyAPE,
WBTC: strategyWBTC,
stETH: strategySTETH,
wstETH: strategyWSTETH,
aWETH: strategyAWETH,
bendETH: strategyBENDETH,
cbETH: strategyCBETH,
rETH: strategyRETH,
astETH: strategyASTETH,
awstETH: strategyAWSTETH,
cETH: strategyCETH,
PUNK: strategyPUNK,
BLUR: strategyBLUR,
DOODLE: strategyDoodles,
BAYC: strategyBAYC,
MAYC: strategyMAYC,
WPUNKS: strategyWPunks,
MOONBIRD: strategyMoonbird,
MEEBITS: strategyMeebits,
AZUKI: strategyAzuki,
OTHR: strategyOthr,
CLONEX: strategyClonex,
UniswapV3: strategyUniswapV3,
sAPE: strategySAPE,
cAPE: strategyCAPE,
yAPE: strategyYAPE,
BAKC: strategyBAKC,
SEWER: strategySEWER,
PPG: strategyPudgyPenguins,
SFVLDR: strategyStakefishValidator,
HVMTL: strategyHVMTL,
BEANZ: strategyBEANZ,
DEGODS: strategyDEGODS,
EXP: strategyEXP,
VSL: strategyVSL,
KODA: strategyKODA,
BLOCKS: strategyBLOCKS,
uBAYC: strategyuBAYC,
uPPG: strategyuPPG,
PANDORA: strategyPandora,
},
DelegationRegistry: "0x00000000000000447e69651d841bD8D104Bed493",
};
Expand Down
2 changes: 2 additions & 0 deletions market-config/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const MOCK_CHAINLINK_AGGREGATORS_PRICES = {
KODA: parseEther("9.5").toString(),
BLOCKS: parseEther("9.54").toString(),
EXRP: parseEther("0.2").toString(),
PANDORA: parseEther("9").toString(),
uBAYC: parseEther("0.000002768").toString(),
uPPG: parseEther("0.000000477").toString(),
};
Expand Down Expand Up @@ -140,6 +141,7 @@ export const MOCK_CHAINLINK_AGGREGATORS_USD_PRICES = {
KODA: parseUnits("14154", 8).toString(),
BLOCKS: parseUnits("10800", 8).toString(),
EXRP: parseUnits("170", 8).toString(),
PANDORA: parseUnits("20000", 8).toString(),
uBAYC: parseUnits("0.005", 8).toString(),
uPPG: parseUnits("0.004", 8).toString(),
};
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,
auctionStrategyPandora,
} from "./auctionStrategies";
import {
rateStrategyAAVE,
Expand Down Expand Up @@ -117,6 +118,7 @@ import {
timeLockStrategyuBAYC,
timeLockStrategyTIA,
timeLockStrategyaUSDC,
timeLockStrategyPandora,
} from "./timeLockStrategies";

export const strategyDAI: IReserveParams = {
Expand Down Expand Up @@ -1099,6 +1101,22 @@ export const strategyEXRP: IReserveParams = {
supplyCap: "1000",
};

export const strategyPandora: IReserveParams = {
strategy: rateStrategyNFT,
auctionStrategy: auctionStrategyPandora,
timeLockStrategy: timeLockStrategyPandora,
baseLTVAsCollateral: "3000",
liquidationProtocolFeePercentage: "0",
liquidationThreshold: "5000",
liquidationBonus: "10500",
borrowingEnabled: false,
reserveDecimals: "0",
xTokenImpl: eContractid.NTokenImpl,
reserveFactor: "0",
borrowCap: "0",
supplyCap: "1000",
};

export const strategyuBAYC: IReserveParams = {
strategy: rateStrategyBLUR,
auctionStrategy: auctionStrategyZero,
Expand Down
12 changes: 12 additions & 0 deletions market-config/timeLockStrategies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -796,3 +796,15 @@ export const timeLockStrategyEXRP: ITimeLockStrategyParams = {
poolPeriodLimit: "100",
period: "86400",
};

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

0 comments on commit b73493a

Please sign in to comment.