-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
4,142 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { assetSymbols, ChainAddresses, underlying } from "@ionicprotocol/types"; | ||
|
||
import { assets } from "./assets"; | ||
|
||
const chainAddresses: ChainAddresses = { | ||
PAIR_INIT_HASH: "", // TODO is this used anywhere? | ||
STABLE_TOKEN: "", | ||
UNISWAP_V2_ROUTER: "", | ||
UNISWAP_V2_FACTORY: "", | ||
UNISWAP_V3: { | ||
FACTORY: "", | ||
PAIR_INIT_HASH: "", | ||
QUOTER_V2: "" // unused | ||
}, | ||
UNISWAP_V3_ROUTER: "", // universal router, need to check if this works | ||
W_BTC_TOKEN: "", // underlying(assets, assetSymbols.WBTC), | ||
W_TOKEN: underlying(assets, assetSymbols.WETH), | ||
W_TOKEN_USD_CHAINLINK_PRICE_FEED: "0x6b7AB4213c77A671Fc7AEe8eB23C9961fDdaB3b2" | ||
}; | ||
|
||
export default chainAddresses; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { assetSymbols, OracleTypes, SupportedAsset, SupportedChains } from "@ionicprotocol/types"; | ||
import { parseEther } from "viem"; | ||
|
||
import { wrappedAssetDocs } from "../common"; | ||
|
||
export const WETH = "0x4200000000000000000000000000000000000006"; | ||
|
||
export const assets: SupportedAsset[] = [ | ||
{ | ||
symbol: assetSymbols.WETH, | ||
underlying: WETH, | ||
name: "Wrapped Ether", | ||
decimals: 18, | ||
oracle: OracleTypes.FixedNativePriceOracle, | ||
extraDocs: wrappedAssetDocs(SupportedChains.superseed), | ||
initialBorrowCap: parseEther("100").toString(), | ||
initialSupplyCap: parseEther("100").toString(), | ||
initialCf: "0.5" | ||
} | ||
]; | ||
|
||
export default assets; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { FundingStrategy } from "@ionicprotocol/types"; | ||
|
||
const fundingStrategies: FundingStrategy[] = []; | ||
|
||
export default fundingStrategies; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { ChainConfig, SupportedChains } from "@ionicprotocol/types"; | ||
|
||
import deployments from "../../../sdk/deployments/superseed.json"; | ||
|
||
import chainAddresses from "./addresses"; | ||
import { assets } from "./assets"; | ||
import fundingStrategies from "./fundingStrategies"; | ||
import irms from "./irms"; | ||
import leveragePairs from "./leveragePairs"; | ||
import liquidationDefaults from "./liquidation"; | ||
import oracles from "./oracles"; | ||
import specificParams from "./params"; | ||
import deployedPlugins from "./plugins"; | ||
import redemptionStrategies from "./redemptionStrategies"; | ||
|
||
const chainConfig: ChainConfig = { | ||
chainId: SupportedChains.superseed, | ||
chainAddresses, | ||
assets, | ||
irms, | ||
liquidationDefaults, | ||
oracles, | ||
specificParams, | ||
deployedPlugins, | ||
redemptionStrategies, | ||
fundingStrategies, | ||
chainDeployments: deployments.contracts, | ||
leveragePairs | ||
}; | ||
|
||
export default chainConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { IrmTypes } from "@ionicprotocol/types"; | ||
|
||
const baseIrms = [IrmTypes.JumpRateModel]; | ||
|
||
const irms: IrmTypes[] = [...baseIrms]; | ||
|
||
export default irms; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { LeveragePoolConfig } from "@ionicprotocol/types"; | ||
|
||
const leveragePairs: LeveragePoolConfig[] = []; | ||
|
||
export default leveragePairs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { LiquidationDefaults, LiquidationStrategy } from "@ionicprotocol/types"; | ||
import { zeroAddress } from "viem"; | ||
|
||
import chainAddresses from "./addresses"; | ||
import { WETH } from "./assets"; | ||
|
||
const liquidationDefaults: LiquidationDefaults = { | ||
DEFAULT_ROUTER: chainAddresses.UNISWAP_V2_ROUTER, | ||
ASSET_SPECIFIC_ROUTER: {}, | ||
SUPPORTED_OUTPUT_CURRENCIES: [zeroAddress, WETH], | ||
SUPPORTED_INPUT_CURRENCIES: [zeroAddress, WETH], | ||
LIQUIDATION_STRATEGY: LiquidationStrategy.UNISWAP, | ||
MINIMUM_PROFIT_NATIVE: 0n, | ||
LIQUIDATION_INTERVAL_SECONDS: 20, | ||
jarvisPools: [], | ||
balancerPools: [] | ||
}; | ||
|
||
export default liquidationDefaults; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { OracleTypes } from "@ionicprotocol/types"; | ||
|
||
const baseOracles = [OracleTypes.FixedNativePriceOracle, OracleTypes.MasterPriceOracle, OracleTypes.SimplePriceOracle]; | ||
|
||
const oracles: OracleTypes[] = [...baseOracles]; | ||
|
||
export default oracles; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { assetSymbols, ChainParams } from "@ionicprotocol/types"; | ||
import { Address } from "viem"; | ||
|
||
import chainAddresses from "./addresses"; | ||
|
||
const specificParams: ChainParams = { | ||
blocksPerYear: BigInt(30 * 60 * 24 * 365), // 30 blocks per minute = 2 sec block time | ||
cgId: "ethereum", | ||
metadata: { | ||
chainIdHex: "0x14d2", | ||
name: "Superseed", | ||
shortName: "Superseed", | ||
uniswapV3Fees: {}, | ||
img: "https://raw.githubusercontent.com/superseed-xyz/brand-kit/227ecaadf8da2ad9acb208428ff178a2cd345565/logos-wordmarks/logos/small-black.svg", | ||
blockExplorerUrls: { default: { name: "superseed", url: "https://explorer-superseed-mainnet-0.t.conduit.xyz" } }, | ||
rpcUrls: { | ||
default: { | ||
http: ["https://mainnet.superseed.xyz"] | ||
}, | ||
public: { | ||
http: ["https://mainnet.superseed.xyz"] | ||
} | ||
}, | ||
nativeCurrency: { | ||
symbol: "ETH", | ||
name: "ETH" | ||
}, | ||
wrappedNativeCurrency: { | ||
symbol: assetSymbols.WETH, | ||
address: chainAddresses.W_TOKEN as Address, | ||
name: "WETH", | ||
decimals: 18, | ||
color: "#7A88A1", | ||
overlayTextColor: "#fff", | ||
logoURL: "https://d1912tcoux65lj.cloudfront.net/network/ethereum.png" | ||
} | ||
} | ||
}; | ||
|
||
export default specificParams; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { DeployedPlugins } from "@ionicprotocol/types"; | ||
|
||
const deployedPlugins: DeployedPlugins = {}; | ||
|
||
export default deployedPlugins; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { RedemptionStrategy } from "@ionicprotocol/types"; | ||
|
||
const redemptionStrategies: RedemptionStrategy[] = []; | ||
|
||
export default redemptionStrategies; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { superseed } from "@ionicprotocol/chains"; | ||
|
||
import { ChainDeployConfig } from "../helpers"; | ||
import { Address } from "viem"; | ||
import { HardhatRuntimeEnvironment } from "hardhat/types"; | ||
|
||
const assets = superseed.assets; | ||
|
||
export const deployConfig: ChainDeployConfig = { | ||
blocksPerYear: Number(superseed.specificParams.blocksPerYear), | ||
cgId: superseed.specificParams.cgId, | ||
nativeTokenName: "Ethereum", | ||
nativeTokenSymbol: "ETH", | ||
stableToken: superseed.chainAddresses.STABLE_TOKEN as Address, | ||
uniswap: { | ||
flashSwapFee: 30, // TODO set the correct fee | ||
hardcoded: [], | ||
uniswapData: [], | ||
uniswapOracleInitialDeployTokens: [], | ||
uniswapV2FactoryAddress: superseed.chainAddresses.UNISWAP_V2_FACTORY as Address, | ||
uniswapV2RouterAddress: superseed.chainAddresses.UNISWAP_V2_ROUTER as Address, | ||
uniswapV3SwapRouter: superseed.chainAddresses.UNISWAP_V3_ROUTER as Address, | ||
uniswapV3Quoter: superseed.chainAddresses.UNISWAP_V3?.QUOTER_V2 as Address | ||
}, | ||
wtoken: superseed.chainAddresses.W_TOKEN as Address, | ||
nativeTokenUsdChainlinkFeed: superseed.chainAddresses.W_TOKEN_USD_CHAINLINK_PRICE_FEED as Address | ||
}; | ||
|
||
export const deploy = async ({ | ||
run, | ||
viem, | ||
getNamedAccounts, | ||
deployments | ||
}: HardhatRuntimeEnvironment): Promise<void> => { | ||
const { deployer } = await getNamedAccounts(); | ||
const publicClient = await viem.getPublicClient(); | ||
|
||
//// Uniswap V3 Liquidator Funder | ||
const uniswapV3LiquidatorFunder = await deployments.deploy("UniswapV3LiquidatorFunder", { | ||
from: deployer, | ||
args: [], | ||
log: true, | ||
waitConfirmations: 1 | ||
}); | ||
console.log("UniswapV3LiquidatorFunder: ", uniswapV3LiquidatorFunder.address); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
5330 |
Oops, something went wrong.