Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

Update script #80

Merged
merged 17 commits into from
Aug 1, 2024
Merged
34 changes: 30 additions & 4 deletions chainDeploy/mainnets/base.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ChainDeployConfig } from "../helpers";
import { OracleTypes, SupportedAsset } from "../../chains/types";
import { ChainDeployConfig, deployChainlinkOracle } from "../helpers";
import { ChainlinkAsset, ChainlinkSpecificParams, OracleTypes, SupportedAsset } from "../../chains/types";
import { base } from "../../chains";
import { deployAerodromeOracle } from "../helpers/oracles/aerodrome";
import { HardhatRuntimeEnvironment } from "hardhat/types";
Expand Down Expand Up @@ -32,10 +32,15 @@ const aerodromeAssets: SupportedAsset[] = base.assets.filter(
(asset) => asset.oracle === OracleTypes.AerodromePriceOracle
);

export const deploy = async ({ run, viem, getNamedAccounts, deployments }: HardhatRuntimeEnvironment): Promise<void> => {
export const deploy = async ({
run,
viem,
getNamedAccounts,
deployments
}: HardhatRuntimeEnvironment): Promise<void> => {
const { deployer } = await getNamedAccounts();

//// ChainLinkV2 Oracle
//// Aerodrome Oracle
await deployAerodromeOracle({
run,
viem,
Expand All @@ -46,6 +51,27 @@ export const deploy = async ({ run, viem, getNamedAccounts, deployments }: Hardh
pricesContract
});

//// ChainlinkV2 Oracle
const chainlinkAssets = assets
.filter((asset) => asset.oracle === OracleTypes.ChainlinkPriceOracleV2)
.map(
(asset) =>
({
aggregator: (asset.oracleSpecificParams as ChainlinkSpecificParams).aggregator,
feedBaseCurrency: (asset.oracleSpecificParams as ChainlinkSpecificParams).feedBaseCurrency,
symbol: asset.symbol
}) as ChainlinkAsset
);
await deployChainlinkOracle({
run,
viem,
getNamedAccounts,
deployments,
deployConfig,
assets: base.assets,
chainlinkAssets
});

//// Uniswap V3 Liquidator Funder
const uniswapV3LiquidatorFunder = await deployments.deploy("UniswapV3LiquidatorFunder", {
from: deployer,
Expand Down
1 change: 1 addition & 0 deletions chains/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ export enum assetSymbols {
LUSD = "LUSD",
SOV = "SOV",
tBTC = "tBTC",
RSR = "RSR",
ION = "ION"
}
12 changes: 12 additions & 0 deletions chains/base/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const WBTC = "0x1ceA84203673764244E05693e42E6Ace62bE9BA5";
export const weETH = "0x04C0599Ae5A44757c0af6F9eC3b93da8976c150A";
export const eUSD = "0xcfa3ef56d303ae4faaba0592388f19d7c3399fb4";
export const bsdETH = "0xcb327b99ff831bf8223cced12b1338ff3aa322ff";
export const RSR = "0xaB36452DbAC151bE02b16Ca17d8919826072f64a";
export const ION = "0x3eE5e23eEE121094f1cFc0Ccc79d6C809Ebd22e5";

export const assets: SupportedAsset[] = [
Expand Down Expand Up @@ -140,6 +141,17 @@ export const assets: SupportedAsset[] = [
initialBorrowCap: parseEther(String(5_200)).toString(),
initialCf: "0.70"
},
{
symbol: assetSymbols.RSR,
underlying: RSR,
name: "Reserve Rights",
decimals: 18,
oracle: OracleTypes.ChainlinkPriceOracleV2,
oracleSpecificParams: {
aggregator: "0xAa98aE504658766Dfe11F31c5D95a0bdcABDe0b1",
feedBaseCurrency: ChainlinkFeedBaseCurrency.USD
}
},
{
symbol: assetSymbols.ION,
underlying: ION,
Expand Down
16 changes: 16 additions & 0 deletions contracts/compound/CErc20RewardsDelegate.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ import "./CErc20Delegate.sol";
import "./EIP20Interface.sol";

contract CErc20RewardsDelegate is CErc20Delegate {
function _getExtensionFunctions() public pure virtual override returns (bytes4[] memory functionSelectors) {
uint8 fnsCount = 2;

bytes4[] memory superFunctionSelectors = super._getExtensionFunctions();
functionSelectors = new bytes4[](superFunctionSelectors.length + fnsCount);

for (uint256 i = 0; i < superFunctionSelectors.length; i++) {
functionSelectors[i] = superFunctionSelectors[i];
}

functionSelectors[--fnsCount + superFunctionSelectors.length] = this.claim.selector;
functionSelectors[--fnsCount + superFunctionSelectors.length] = this.approve.selector;

require(fnsCount == 0, "use the correct array length");
}

/// @notice A reward token claim function
/// to be overridden for use cases where rewardToken needs to be pulled in
function claim() external {}
Expand Down
Loading
Loading