Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(notional): Fix contract name and bytecode shadowing issues for temp Notional contracts #255

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 3 additions & 0 deletions contracts/protocol/integration/wrap/notional/WrappedfCash.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { INotionalV2 } from "wrapped-fcash/interfaces/notional/INotionalV2.sol";
import { IWETH9 } from "wrapped-fcash/interfaces/IWETH9.sol";

contract WrappedfCash is wfCashERC4626 {
// Does nothing - disambiguates this contract from WrappedfCashFactory so
// hardhat-etherscan can verify it.
uint8 public noop;
constructor(INotionalV2 _notionalProxy, IWETH9 _weth) wfCashERC4626(_notionalProxy, _weth){
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import { WrappedfCashFactory } from "wrapped-fcash/contracts/proxy/WrappedfCashFactory.sol";

// This contract will be removed before NotionalTradeModule goes to production. It's temporarily included
// to support module development and staging_mainnet testing before Notional deploys their own version of it.
contract WrappedfCashFactoryExperimental is WrappedfCashFactory {
// Does nothing - disambiguates this contract from WrappedfCashFactory so
// hardhat-etherscan can verify it.
uint8 public noop;
constructor(address _beacon) WrappedfCashFactory(_beacon){
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import "openzeppelin-contracts-V4/proxy/beacon/UpgradeableBeacon.sol";
/// @dev Re-exporting to make available to brownie
/// UpgradeableBeacon is Ownable, default owner is the deployer
contract nUpgradeableBeacon is UpgradeableBeacon {
// Does nothing - disambiguates this contract from WrappedfCashFactory so
// hardhat-etherscan can verify it.
uint8 public noop;
constructor(address implementation_) UpgradeableBeacon(implementation_) {}
}

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
ManagerIssuanceHookMock,
NotionalTradeModule,
WrappedfCash,
WrappedfCashFactory,
WrappedfCashFactoryExperimental,
} from "@utils/contracts";

import { IERC20 } from "@typechain/IERC20";
Expand Down Expand Up @@ -96,7 +96,7 @@ describe("Notional trade module integration [ @forked-mainnet ]", () => {
let underlyingTokenAmount: BigNumber;
let fCashAmount: BigNumber;
let snapshotId: string;
let wrappedFCashFactory: WrappedfCashFactory;
let wrappedFCashFactory: WrappedfCashFactoryExperimental;

before(async () => {
wrappedFCashFactory = await deployWrappedfCashFactory(
Expand Down
4 changes: 2 additions & 2 deletions test/integration/notionalTradeModule/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ethers, network } from "hardhat";
import { BigNumber, Signer } from "ethers";
import { INotionalProxy, WrappedfCash, WrappedfCashFactory } from "@utils/contracts";
import { INotionalProxy, WrappedfCash, WrappedfCashFactoryExperimental } from "@utils/contracts";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address";
import { IERC20 } from "@typechain/IERC20";
import { ICErc20 } from "@typechain/ICErc20";
Expand Down Expand Up @@ -95,7 +95,7 @@ export async function getCurrencyIdAndMaturity(underlyingAddress: string, maturi
}

export async function deployWrappedfCashInstance(
wrappedfCashFactory: WrappedfCashFactory,
wrappedfCashFactory: WrappedfCashFactoryExperimental,
currencyId: number,
maturity: BigNumber,
) {
Expand Down
2 changes: 1 addition & 1 deletion utils/contracts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export { WrapV2AdapterMock } from "../../typechain/WrapV2AdapterMock";
export { WrapModule } from "../../typechain/WrapModule";
export { WrapModuleV2 } from "../../typechain/WrapModuleV2";
export { WrappedfCash } from "../../typechain/WrappedfCash";
export { WrappedfCashFactory } from "../../typechain/WrappedfCashFactory";
export { WrappedfCashFactoryExperimental } from "../../typechain/WrappedfCashFactoryExperimental";
export { WrappedfCashMock } from "../../typechain/WrappedfCashMock";
export { WrappedfCashFactoryMock } from "../../typechain/WrappedfCashFactoryMock";
export { YearnWrapV2Adapter } from "../../typechain/YearnWrapV2Adapter";
Expand Down
2 changes: 1 addition & 1 deletion utils/contracts/notional.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// External Uniswap Contracts
export { WrappedfCash } from "../../typechain/WrappedfCash";
export { WrappedfCashFactory } from "../../typechain/WrappedfCashFactory";
export { WrappedfCashFactoryExperimental } from "../../typechain/WrappedfCashFactoryExperimental";
8 changes: 4 additions & 4 deletions utils/deploys/deployExternal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { Unitroller__factory } from "../../typechain/factories/Unitroller__facto
import { WETH9__factory } from "../../typechain/factories/WETH9__factory";
import { WhitePaperInterestRateModel__factory } from "../../typechain/factories/WhitePaperInterestRateModel__factory";
import { WrappedfCash__factory } from "../../typechain/factories/WrappedfCash__factory";
import { WrappedfCashFactory__factory } from "../../typechain/factories/WrappedfCashFactory__factory";
import { WrappedfCashFactoryExperimental__factory } from "../../typechain/factories/WrappedfCashFactoryExperimental__factory";

import {
CurveDeposit,
Expand Down Expand Up @@ -73,7 +73,7 @@ import {

import {
WrappedfCash,
WrappedfCashFactory
WrappedfCashFactoryExperimental
} from "../contracts/notional";

import { StakingRewards__factory } from "../../typechain/factories/StakingRewards__factory";
Expand Down Expand Up @@ -732,8 +732,8 @@ export default class DeployExternalContracts {
return await new WrappedfCash__factory(this._deployerSigner).deploy(notionalProxy, weth);
}

public async deployWrappedfCashFactory(beacon: Address): Promise<WrappedfCashFactory> {
return await new WrappedfCashFactory__factory(this._deployerSigner).deploy(beacon);
public async deployWrappedfCashFactory(beacon: Address): Promise<WrappedfCashFactoryExperimental> {
return await new WrappedfCashFactoryExperimental__factory(this._deployerSigner).deploy(beacon);
}


Expand Down