Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ OP_SEPOLIA_RPC=https://sepolia.optimism.io
BASE_RPC=https://base-mainnet.public.blastapi.io
ETHEREUM_RPC=https://eth-mainnet.public.blastapi.io
ARBITRUM_ONE_RPC=https://arbitrum-one.public.blastapi.io
OP_MAINNET_RPC=https://optimism-mainnet.public.blastapi.io
OP_MAINNET_RPC=https://public-op-mainnet.fastnode.io
POLYGON_MAINNET_RPC=https://polygon-bor-rpc.publicnode.com
UNICHAIN_RPC=https://mainnet.unichain.org
AVALANCHE_RPC=https://avalanche-c-chain-rpc.publicnode.com
Expand Down
18 changes: 18 additions & 0 deletions deployments/deploy-arbitrumone-stage.log
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,21 @@ Rebalancer: 0x34Df9cD75fA0b4d8fF300AeDf7591f79dFdd61C9
Target Vault: 0x451291AdB56ffA03Ef2A542389CeE16Ec3A8295D
Deploying ERC4626 Adapter USDC
ERC4626AdapterUSDC: 0xd7B2FC36b3D967DE88f9A4e3C84b7dBEF73e7eF3

Deployment ID: MVP
Deploying USDC Public Pool
Using config for: stage, ARBITRUM_ONE
Deploying USDC Public Liquidity Pool
Deployer: 0xdBD91aD22bE5304e385b7b0A2Cfe91164e416e11
DEPLOYER_ADDRESS: 0xdBD91aD22bE5304e385b7b0A2Cfe91164e416e11
LiquidityPoolPublicUSDC-V2-7187ffa: 0xEBa34aE94CFf4142E30544F86D210b1807BdCb42

Deployer: 0xdBD91aD22bE5304e385b7b0A2Cfe91164e416e11
DEPLOYER_ADDRESS: 0xdBD91aD22bE5304e385b7b0A2Cfe91164e416e11
Deployment ID: MVP
Deploying ERC4626 Adapter USDC
Using config for: stage, ARBITRUM_ONE
Rebalancer: 0x34Df9cD75fA0b4d8fF300AeDf7591f79dFdd61C9
Target Vault: 0xEBa34aE94CFf4142E30544F86D210b1807BdCb42
Deploying ERC4626 Adapter USDC
ERC4626AdapterUSDC-V2-7187ffa: 0x5291A3582a7eC37BA800327f7Cd1e0bF137A4ec0
2 changes: 2 additions & 0 deletions deployments/deployments.staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ eip155:42161:
LiquidityPoolAaveUSDC: "0x2B7899f3d553FCcf61122BdA60f5f9a9AE390683"
LiquidityPoolUSDC: "0x578aD20ec27E11B3772F91cc6f435d782cc362EA"
LiquidityPoolAaveUSDCLongTerm: "0x4ce56b5D7e79dF121aF2eC055D096eF983F459e6"
LiquidityPoolPublicUSDC: "0xEBa34aE94CFf4142E30544F86D210b1807BdCb42"
ERC4626AdapterUSDC: "0x5291A3582a7eC37BA800327f7Cd1e0bF137A4ec0"
CensoredTransferFromMulticall: "0xd0A630c391daEb244369DB0f75CBDF7dFeEaEaC3"
USDC: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
Rebalancer: "0x34Df9cD75fA0b4d8fF300AeDf7591f79dFdd61C9"
Expand Down
2 changes: 1 addition & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ const config: HardhatUserConfig = {
},
[Network.OP_MAINNET]: {
chainId: networkConfig.OP_MAINNET.ChainId,
url: process.env.OP_MAINNET_RPC || "https://optimism-mainnet.public.blastapi.io",
url: process.env.OP_MAINNET_RPC || "https://public-op-mainnet.fastnode.io",
accounts,
},
[Network.POLYGON_MAINNET]: {
Expand Down
14 changes: 7 additions & 7 deletions network.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ export const LiquidityPoolAaveUSDCV3 = "LiquidityPoolAaveUSDC-V3-e09cc75";
export const LiquidityPoolUSDCV3 = "LiquidityPoolUSDC-V3-e09cc75";
export const LiquidityPoolUSDCStablecoinV3 = "LiquidityPoolUSDCStablecoin-V3-e09cc75";

export const LiquidityPoolAaveUSDCV4 = "LiquidityPoolAaveUSDC-V4-TBD";
export const LiquidityPoolUSDCV4 = "LiquidityPoolUSDC-V4-TBD";
export const LiquidityPoolPublicUSDCV2 = "LiquidityPoolPublicUSDC-V2-TBD";
export const LiquidityPoolUSDCStablecoinV4 = "LiquidityPoolUSDCStablecoin-V4-TBD";
export const LiquidityPoolAaveUSDCLongTermV3 = "LiquidityPoolAaveUSDCLongTerm-V3-TBD";
export const ERC4626AdapterUSDCV2 = "ERC4626AdapterUSDC-V2-TBD";
export const LiquidityPoolAaveUSDCV4 = "LiquidityPoolAaveUSDC-V4-7187ffa";
export const LiquidityPoolUSDCV4 = "LiquidityPoolUSDC-V4-7187ffa";
export const LiquidityPoolPublicUSDCV2 = "LiquidityPoolPublicUSDC-V2-7187ffa";
export const LiquidityPoolUSDCStablecoinV4 = "LiquidityPoolUSDCStablecoin-V4-7187ffa";
export const LiquidityPoolAaveUSDCLongTermV3 = "LiquidityPoolAaveUSDCLongTerm-V3-7187ffa";
export const ERC4626AdapterUSDCV2 = "ERC4626AdapterUSDC-V2-7187ffa";
export const LiquidityPoolAaveUSDCLongTermVersions = [
LiquidityPoolAaveUSDCLongTerm,
LiquidityPoolAaveUSDCLongTermV2,
Expand Down Expand Up @@ -809,7 +809,7 @@ export const networkConfig: NetworksConfig = {
ProtocolFeeRate: 20,
FeeSetter: "0x2D5B6C193C39D2AECb4a99052074E6F325258a0f",
},
ERC4626AdapterUSDCTargetVault: LiquidityPoolPublicUSDC,
ERC4626AdapterUSDCTargetVault: LiquidityPoolPublicUSDCV2,
},
},
BASE: {
Expand Down
4 changes: 3 additions & 1 deletion scripts/deployERC4626Adapter.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dotenv from "dotenv";
dotenv.config();
import hre from "hardhat";
import {getVerifier, getHardhatNetworkConfig, getNetworkConfig} from "./helpers";
import {getVerifier, getHardhatNetworkConfig, getNetworkConfig, logDeployers} from "./helpers";
import {resolveProxyXAddress, toBytes32, resolveXAddress} from "../test/helpers";
import {isSet, assert, DEFAULT_ADMIN_ROLE, sameAddress} from "./common";
import {ERC4626Adapter} from "../typechain-types";
Expand All @@ -10,6 +10,8 @@ import {Network, NetworkConfig, ERC4626AdapterUSDCVersions} from "../network.con
export async function main() {
const [deployer] = await hre.ethers.getSigners();

await logDeployers();

const LIQUIDITY_ADMIN_ROLE = toBytes32("LIQUIDITY_ADMIN_ROLE");
const WITHDRAW_PROFIT_ROLE = toBytes32("WITHDRAW_PROFIT_ROLE");
const PAUSER_ROLE = toBytes32("PAUSER_ROLE");
Expand Down
4 changes: 3 additions & 1 deletion scripts/deployUSDCPublicPool.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dotenv from "dotenv";
dotenv.config();
import hre from "hardhat";
import {getVerifier, getHardhatNetworkConfig, getNetworkConfig} from "./helpers";
import {getVerifier, getHardhatNetworkConfig, getNetworkConfig, logDeployers} from "./helpers";
import {toBytes32} from "../test/helpers";
import {isSet, assert, DEFAULT_ADMIN_ROLE, sameAddress, assertAddress} from "./common";
import {PublicLiquidityPool} from "../typechain-types";
Expand All @@ -10,6 +10,8 @@ import {Network, NetworkConfig, LiquidityPoolPublicUSDCVersions} from "../networ
export async function main() {
const [deployer] = await hre.ethers.getSigners();

await logDeployers();

const WITHDRAW_PROFIT_ROLE = toBytes32("WITHDRAW_PROFIT_ROLE");
const PAUSER_ROLE = toBytes32("PAUSER_ROLE");
const FEE_SETTER_ROLE = toBytes32("FEE_SETTER_ROLE");
Expand Down
6 changes: 6 additions & 0 deletions scripts/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,3 +464,9 @@ export async function getHardhatStandaloneRepayerConfig(repayerEnv: StandaloneRe
export function percentsToBps(input: number[]): bigint[] {
return input.map(el => BigInt(el) * 10000n / 100n);
}

export async function logDeployers() {
const [deployer] = await hre.ethers.getSigners();
console.log(`Deployer: ${deployer.address}`);
console.log(`DEPLOYER_ADDRESS: ${process.env.DEPLOYER_ADDRESS}`);
}
8 changes: 7 additions & 1 deletion test/ERC4626Adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ describe("ERC4626Adapter", function () {

it("Should NOT withdraw liquidity as profit from the target vault, 2 shares, 5 assets", async function () {
const {
adapter, liquidityPool, usdc, USDC_DEC, lp, user, generateProfit, withdrawProfit
adapter, liquidityPool, usdc, USDC_DEC, lp, user, generateProfit, withdrawProfit, liquidityAdmin,
} = await loadFixture(deployAll);
const amount = 2n;
const amountOthers = 100n * USDC_DEC;
Expand All @@ -513,6 +513,12 @@ describe("ERC4626Adapter", function () {
expect(await adapter.totalDeposited()).to.eq(amount);
expect(await liquidityPool.maxWithdraw(adapter)).to.eq(2n);
expect(await usdc.balanceOf(user)).to.eq(2n);

await adapter.connect(liquidityAdmin).withdraw(user, amount);
expect(await adapter.totalDeposited()).to.eq(0n);
expect(await liquidityPool.balanceOf(adapter)).to.eq(0n);
expect(await liquidityPool.maxWithdraw(adapter)).to.eq(0n);
expect(await usdc.balanceOf(user)).to.eq(4n);
});

it("Should NOT allow native token donations", async function () {
Expand Down