diff --git a/packages/chains/src/base/assets.ts b/packages/chains/src/base/assets.ts index 9a6a29949..58cb7de3c 100644 --- a/packages/chains/src/base/assets.ts +++ b/packages/chains/src/base/assets.ts @@ -32,6 +32,7 @@ export const OGN = "0x7002458B1DF59EccB57387bC79fFc7C29E22e6f7"; export const EURC = "0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42"; export const USDplus = "0xB79DD08EA68A908A97220C76d19A6aA9cBDE4376"; export const wUSDplus = "0xd95ca61CE9aAF2143E81Ef5462C0c2325172E028"; +export const USDz = "0x04D5ddf5f3a8939889F11E97f8c4BB48317F1938"; export const assets: SupportedAsset[] = [ { @@ -302,6 +303,20 @@ export const assets: SupportedAsset[] = [ initialCf: "0.85", initialSupplyCap: parseUnits(String(40_000_000), 6).toString(), initialBorrowCap: "1" + }, + { + symbol: assetSymbols.USDz, + underlying: USDz, + name: "USDz", + decimals: 18, + oracle: OracleTypes.ChainlinkPriceOracleV2, + oracleSpecificParams: { + aggregator: "0xe25969e2Fa633a0C027fAB8F30Fc9C6A90D60B48", + feedBaseCurrency: ChainlinkFeedBaseCurrency.USD + }, + initialCf: "0.80", + initialSupplyCap: parseEther(String(13_000_000)).toString(), + initialBorrowCap: parseEther(String(10_000_000)).toString() } // DO NOT ADD TO MARKET UNLESS PROPER ORACLE IS DEPLOYED // { diff --git a/packages/contracts/chainDeploy/helpers/oracles/chainlink.ts b/packages/contracts/chainDeploy/helpers/oracles/chainlink.ts index 45effde95..537d3a0d5 100644 --- a/packages/contracts/chainDeploy/helpers/oracles/chainlink.ts +++ b/packages/contracts/chainDeploy/helpers/oracles/chainlink.ts @@ -15,7 +15,7 @@ export const deployChainlinkOracle = async ({ chainlinkAssets, namePostfix }: ChainlinkDeployFnParams): Promise<{ cpo: any; chainLinkv2: any }> => { - const { deployer } = await getNamedAccounts(); + const { deployer, multisig } = await getNamedAccounts(); const publicClient = await viem.getPublicClient(); let tx: Hex; @@ -42,7 +42,8 @@ export const deployChainlinkOracle = async ({ args: [deployConfig.stableToken, deployConfig.nativeTokenUsdChainlinkFeed] } }, - proxyContract: "OpenZeppelinTransparentProxy" + proxyContract: "OpenZeppelinTransparentProxy", + owner: multisig ?? deployer }, waitConfirmations: 1, skipIfAlreadyDeployed: true diff --git a/packages/contracts/chainDeploy/helpers/oracles/erc4626.ts b/packages/contracts/chainDeploy/helpers/oracles/erc4626.ts index 075611113..0e97761ad 100644 --- a/packages/contracts/chainDeploy/helpers/oracles/erc4626.ts +++ b/packages/contracts/chainDeploy/helpers/oracles/erc4626.ts @@ -9,7 +9,7 @@ export const deployErc4626PriceOracle = async ({ deployments, erc4626Assets }: Erc4626OracleFnParams): Promise => { - const { deployer } = await getNamedAccounts(); + const { deployer, multisig } = await getNamedAccounts(); const publicClient = await viem.getPublicClient(); const mpo = await viem.getContractAt( @@ -28,9 +28,10 @@ export const deployErc4626PriceOracle = async ({ args: [] } }, - owner: deployer, + owner: multisig, proxyContract: "OpenZeppelinTransparentProxy" - } + }, + skipIfAlreadyDeployed: true }); if (e4626o.transactionHash) await publicClient.waitForTransactionReceipt({ hash: e4626o.transactionHash as Address }); console.log("ERC4626Oracle: ", e4626o.address); diff --git a/packages/contracts/chainDeploy/helpers/oracles/utils.ts b/packages/contracts/chainDeploy/helpers/oracles/utils.ts index 0516b82fa..e3a1f9d4b 100644 --- a/packages/contracts/chainDeploy/helpers/oracles/utils.ts +++ b/packages/contracts/chainDeploy/helpers/oracles/utils.ts @@ -21,6 +21,7 @@ export async function addUnderlyingsToMpo( } if (underlyings.length) { + console.log("adding underlyings to mpo", underlyings, oracles); if ((await mpo.read.admin()).toLowerCase() === deployer.toLowerCase()) { const tx = await mpo.write.add([underlyings, oracles]); console.log("tx: ", tx); diff --git a/packages/contracts/chainDeploy/mainnets/base.ts b/packages/contracts/chainDeploy/mainnets/base.ts index 1fe40aa4f..e63b3d621 100644 --- a/packages/contracts/chainDeploy/mainnets/base.ts +++ b/packages/contracts/chainDeploy/mainnets/base.ts @@ -40,7 +40,7 @@ export const deploy = async ({ getNamedAccounts, deployments }: HardhatRuntimeEnvironment): Promise => { - const { deployer } = await getNamedAccounts(); + const { deployer, multisig } = await getNamedAccounts(); const publicClient = await viem.getPublicClient(); //// ERC4626 Oracle @@ -103,7 +103,8 @@ export const deploy = async ({ methodName: "initialize", args: [[], []] } - } + }, + owner: multisig ?? deployer } }); console.log("CurveV2LpTokenPriceOracleNoRegistry: ", curveV2OracleNoRegistry.address); diff --git a/packages/contracts/hardhat.config.ts b/packages/contracts/hardhat.config.ts index abcc4f03b..769270758 100644 --- a/packages/contracts/hardhat.config.ts +++ b/packages/contracts/hardhat.config.ts @@ -22,7 +22,8 @@ const config: HardhatUserConfig = { namedAccounts: { deployer: { default: 0 }, multisig: { - 34443: "0x8Fba84867Ba458E7c6E2c024D2DE3d0b5C3ea1C2" + 34443: "0x8Fba84867Ba458E7c6E2c024D2DE3d0b5C3ea1C2", + 8453: "0x9eC25b8063De13d478Ba8121b964A339A1BB0ebB" } }, solidity: { diff --git a/packages/contracts/tasks/chain-specific/base/index.ts b/packages/contracts/tasks/chain-specific/base/index.ts index 737660a49..b850a0bf9 100644 --- a/packages/contracts/tasks/chain-specific/base/index.ts +++ b/packages/contracts/tasks/chain-specific/base/index.ts @@ -28,4 +28,5 @@ export const RSR_MARKET = "0xfc6b82668E10AFF62f208C492fc95ef1fa9C0426"; export const wsuperOETH_MARKET = "0xC462eb5587062e2f2391990b8609D2428d8Cf598"; export const wusdm_MARKET = "0xe30965Acd0Ee1CE2e0Cd0AcBFB3596bD6fC78A51"; export const usdPlus_MARKET = "0x74109171033F662D5b898A7a2FcAB2f1EF80c201"; -export const wusdPlus_MARKET = "0xF1bbECD6aCF648540eb79588Df692c6b2F0fbc09"; \ No newline at end of file +export const wusdPlus_MARKET = "0xF1bbECD6aCF648540eb79588Df692c6b2F0fbc09"; +export const USDz_MARKET = "0xa4442b665d4c6DBC6ea43137B336e3089f05626C"; diff --git a/packages/contracts/tasks/chain-specific/base/markets.ts b/packages/contracts/tasks/chain-specific/base/markets.ts index 453403684..17cf676b3 100644 --- a/packages/contracts/tasks/chain-specific/base/markets.ts +++ b/packages/contracts/tasks/chain-specific/base/markets.ts @@ -4,7 +4,7 @@ import { assetSymbols } from "@ionicprotocol/types"; import { COMPTROLLER } from "."; task("markets:deploy:base:new", "deploy base market").setAction(async (_, { viem, run }) => { - const assetsToDeploy: string[] = [assetSymbols.wUSDplus]; + const assetsToDeploy: string[] = [assetSymbols.USDz]; for (const asset of base.assets.filter((asset) => assetsToDeploy.includes(asset.symbol))) { if (!asset.underlying || !asset.symbol) { throw new Error("Invalid asset"); @@ -34,7 +34,7 @@ task("markets:deploy:base:new", "deploy base market").setAction(async (_, { viem }); task("base:set-caps:new", "one time setup").setAction(async (_, { viem, run }) => { - const asset = base.assets.find((asset) => asset.symbol === assetSymbols.wUSDplus); + const asset = base.assets.find((asset) => asset.symbol === assetSymbols.USDz); if (!asset) { throw new Error("asset not found in base assets"); } diff --git a/packages/contracts/tasks/chain-specific/base/rewards.ts b/packages/contracts/tasks/chain-specific/base/rewards.ts index bb6342d63..8c56742a2 100644 --- a/packages/contracts/tasks/chain-specific/base/rewards.ts +++ b/packages/contracts/tasks/chain-specific/base/rewards.ts @@ -9,6 +9,7 @@ import { ION, RSR_MARKET, usdPlus_MARKET, + USDz_MARKET, weETH_MARKET, wusdm_MARKET, wusdPlus_MARKET @@ -307,4 +308,37 @@ task("base:add-rewards:epoch2:supply:wusdplus", "add rewards to a market").setAc deployments ); } +); + +task("base:add-rewards:epoch2:supply:usdz", "add rewards to a market").setAction( + async (_, { viem, deployments, getNamedAccounts }) => { + const { deployer, multisig } = await getNamedAccounts(); + const rewardToken = ION; + const rewardTokenName = "ION"; + const market = USDz_MARKET; + const rewardAmount = (50_000).toString(); + + // Sending tokens + const _rewardToken = await viem.getContractAt("EIP20Interface", rewardToken); + let balance = await _rewardToken.read.balanceOf([market]); + console.log("balance: ", balance); + if (balance < parseEther(rewardAmount)) { + const tx = await _rewardToken.write.transfer([market, parseEther(rewardAmount) - balance]); + console.log(`Sent ${rewardAmount} ${rewardTokenName} to ${market} - ${tx}`); + } else { + console.log(`Market already has enough ${rewardTokenName} - ${market}`); + } + + await setupRewards( + "supply", + market, + rewardTokenName, + rewardToken, + SUPPLY_DURATION, + deployer as Address, + viem, + deployments, + multisig as Address + ); + } ); \ No newline at end of file diff --git a/packages/contracts/tasks/flywheel/setup.ts b/packages/contracts/tasks/flywheel/setup.ts index c4280f012..e91317fb5 100644 --- a/packages/contracts/tasks/flywheel/setup.ts +++ b/packages/contracts/tasks/flywheel/setup.ts @@ -13,7 +13,8 @@ export const setupRewards = async ( epochDuration: number, deployer: Address, viem: HardhatRuntimeEnvironment["viem"], - deployments: HardhatRuntimeEnvironment["deployments"] + deployments: HardhatRuntimeEnvironment["deployments"], + multisig?: Address ) => { const publicClient = await viem.getPublicClient(); const needsMultisig = await upgradeMarketToSupportFlywheel(market, viem, deployer, deployments); @@ -50,7 +51,8 @@ export const setupRewards = async ( methodName: "initialize", args: [rewardToken, zeroAddress, type === "borrow" ? booster!.address : zeroAddress, deployer] } - } + }, + owner: multisig ?? deployer }, waitConfirmations: 1, skipIfAlreadyDeployed: true diff --git a/packages/types/src/enums.ts b/packages/types/src/enums.ts index d749648e6..e3c62bfc0 100644 --- a/packages/types/src/enums.ts +++ b/packages/types/src/enums.ts @@ -200,6 +200,7 @@ export enum assetSymbols { EURC = "EURC", USDplus = "USD+", wUSDplus = "wUSD+", + USDz = "USDz", // optimism OP = "OP", diff --git a/packages/ui/constants/index.ts b/packages/ui/constants/index.ts index c36664bc9..49e5422c7 100644 --- a/packages/ui/constants/index.ts +++ b/packages/ui/constants/index.ts @@ -199,8 +199,9 @@ export const pools: Record = { 'WETH', 'wsuperOETHb', 'OGN', - 'wUSDM', + 'USDz', 'wUSD+', + 'wUSDM', 'USD+', 'EURC', 'cbBTC', diff --git a/packages/ui/public/img/symbols/32/color/usdz.png b/packages/ui/public/img/symbols/32/color/usdz.png new file mode 100644 index 000000000..0490dce4b Binary files /dev/null and b/packages/ui/public/img/symbols/32/color/usdz.png differ diff --git a/packages/ui/utils/multipliers.ts b/packages/ui/utils/multipliers.ts index 27db74272..0493ba75b 100644 --- a/packages/ui/utils/multipliers.ts +++ b/packages/ui/utils/multipliers.ts @@ -602,6 +602,21 @@ export const multipliers: Record< ionAPR: true, flywheel: true } + }, + USDz: { + borrow: { + ionic: 0, + turtle: false, + rewards: false, + ionAPR: false + }, + supply: { + ionic: 0, + turtle: false, + rewards: true, + ionAPR: true, + flywheel: true + } } } },