From 5dc9532a91d85c547a8a8655128d0aaf9ffa94af Mon Sep 17 00:00:00 2001 From: cgewecke Date: Wed, 25 May 2022 09:15:07 -0700 Subject: [PATCH 1/3] Rename WrappedfCashFactory to WrappedfCashFactoryExperimental --- .../integration/wrap/notional/WrappedfCashFactory.sol | 8 -------- .../wrap/notional/WrappedfCashFactoryExperimental.sol | 8 ++++++++ .../notionalTradeModule/notionalTradeModule.spec.ts | 4 ++-- test/integration/notionalTradeModule/utils.ts | 4 ++-- utils/contracts/index.ts | 2 +- utils/contracts/notional.ts | 2 +- utils/deploys/deployExternal.ts | 8 ++++---- 7 files changed, 18 insertions(+), 18 deletions(-) delete mode 100644 contracts/protocol/integration/wrap/notional/WrappedfCashFactory.sol create mode 100644 contracts/protocol/integration/wrap/notional/WrappedfCashFactoryExperimental.sol diff --git a/contracts/protocol/integration/wrap/notional/WrappedfCashFactory.sol b/contracts/protocol/integration/wrap/notional/WrappedfCashFactory.sol deleted file mode 100644 index 53b690ec1..000000000 --- a/contracts/protocol/integration/wrap/notional/WrappedfCashFactory.sol +++ /dev/null @@ -1,8 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.11; -import { WrappedfCashFactory as WrappedfCashFactoryBase } from "wrapped-fcash/contracts/proxy/WrappedfCashFactory.sol"; - -contract WrappedfCashFactory is WrappedfCashFactoryBase { - constructor(address _beacon) WrappedfCashFactoryBase(_beacon){ - } -} diff --git a/contracts/protocol/integration/wrap/notional/WrappedfCashFactoryExperimental.sol b/contracts/protocol/integration/wrap/notional/WrappedfCashFactoryExperimental.sol new file mode 100644 index 000000000..d13446337 --- /dev/null +++ b/contracts/protocol/integration/wrap/notional/WrappedfCashFactoryExperimental.sol @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.11; +import { WrappedfCashFactory } from "wrapped-fcash/contracts/proxy/WrappedfCashFactory.sol"; + +contract WrappedfCashFactoryExperimental is WrappedfCashFactory { + constructor(address _beacon) WrappedfCashFactory(_beacon){ + } +} diff --git a/test/integration/notionalTradeModule/notionalTradeModule.spec.ts b/test/integration/notionalTradeModule/notionalTradeModule.spec.ts index c70c8051d..238383860 100644 --- a/test/integration/notionalTradeModule/notionalTradeModule.spec.ts +++ b/test/integration/notionalTradeModule/notionalTradeModule.spec.ts @@ -22,7 +22,7 @@ import { ManagerIssuanceHookMock, NotionalTradeModule, WrappedfCash, - WrappedfCashFactory, + WrappedfCashFactoryExperimental, } from "@utils/contracts"; import { IERC20 } from "@typechain/IERC20"; @@ -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( diff --git a/test/integration/notionalTradeModule/utils.ts b/test/integration/notionalTradeModule/utils.ts index 5209e1bdb..66e88aada 100644 --- a/test/integration/notionalTradeModule/utils.ts +++ b/test/integration/notionalTradeModule/utils.ts @@ -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"; @@ -95,7 +95,7 @@ export async function getCurrencyIdAndMaturity(underlyingAddress: string, maturi } export async function deployWrappedfCashInstance( - wrappedfCashFactory: WrappedfCashFactory, + wrappedfCashFactory: WrappedfCashFactoryExperimental, currencyId: number, maturity: BigNumber, ) { diff --git a/utils/contracts/index.ts b/utils/contracts/index.ts index 593889b16..41a0ceed6 100644 --- a/utils/contracts/index.ts +++ b/utils/contracts/index.ts @@ -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"; diff --git a/utils/contracts/notional.ts b/utils/contracts/notional.ts index db5715c7d..402a69e80 100644 --- a/utils/contracts/notional.ts +++ b/utils/contracts/notional.ts @@ -1,3 +1,3 @@ // External Uniswap Contracts export { WrappedfCash } from "../../typechain/WrappedfCash"; -export { WrappedfCashFactory } from "../../typechain/WrappedfCashFactory"; +export { WrappedfCashFactoryExperimental } from "../../typechain/WrappedfCashFactoryExperimental"; diff --git a/utils/deploys/deployExternal.ts b/utils/deploys/deployExternal.ts index 0ef99cfbd..63d8ac209 100644 --- a/utils/deploys/deployExternal.ts +++ b/utils/deploys/deployExternal.ts @@ -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, @@ -73,7 +73,7 @@ import { import { WrappedfCash, - WrappedfCashFactory + WrappedfCashFactoryExperimental } from "../contracts/notional"; import { StakingRewards__factory } from "../../typechain/factories/StakingRewards__factory"; @@ -732,8 +732,8 @@ export default class DeployExternalContracts { return await new WrappedfCash__factory(this._deployerSigner).deploy(notionalProxy, weth); } - public async deployWrappedfCashFactory(beacon: Address): Promise { - return await new WrappedfCashFactory__factory(this._deployerSigner).deploy(beacon); + public async deployWrappedfCashFactory(beacon: Address): Promise { + return await new WrappedfCashFactoryExperimental__factory(this._deployerSigner).deploy(beacon); } From 756a3024321d68ce34fdb9891dd5e079be075003 Mon Sep 17 00:00:00 2001 From: cgewecke Date: Wed, 25 May 2022 09:34:59 -0700 Subject: [PATCH 2/3] Add noop state variable to WrappedfCashFactoryExperimental to introduce bytecode difference --- .../wrap/notional/WrappedfCashFactoryExperimental.sol | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contracts/protocol/integration/wrap/notional/WrappedfCashFactoryExperimental.sol b/contracts/protocol/integration/wrap/notional/WrappedfCashFactoryExperimental.sol index d13446337..b4a50577a 100644 --- a/contracts/protocol/integration/wrap/notional/WrappedfCashFactoryExperimental.sol +++ b/contracts/protocol/integration/wrap/notional/WrappedfCashFactoryExperimental.sol @@ -2,7 +2,12 @@ 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){ } } From 75670c12c8a6a9443816a56d5c4fcdfa7e570ce0 Mon Sep 17 00:00:00 2001 From: cgewecke Date: Wed, 25 May 2022 12:10:29 -0700 Subject: [PATCH 3/3] Add noop public state variable to WrappedfCash, nUpgradeableBeacon for hardhat-etherscan --- contracts/protocol/integration/wrap/notional/WrappedfCash.sol | 3 +++ .../protocol/integration/wrap/notional/nUpgradeableBeacon.sol | 3 +++ 2 files changed, 6 insertions(+) diff --git a/contracts/protocol/integration/wrap/notional/WrappedfCash.sol b/contracts/protocol/integration/wrap/notional/WrappedfCash.sol index 9c79d4033..84bb3e80e 100644 --- a/contracts/protocol/integration/wrap/notional/WrappedfCash.sol +++ b/contracts/protocol/integration/wrap/notional/WrappedfCash.sol @@ -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){ } } diff --git a/contracts/protocol/integration/wrap/notional/nUpgradeableBeacon.sol b/contracts/protocol/integration/wrap/notional/nUpgradeableBeacon.sol index 1c0dd1854..dd2e2a450 100644 --- a/contracts/protocol/integration/wrap/notional/nUpgradeableBeacon.sol +++ b/contracts/protocol/integration/wrap/notional/nUpgradeableBeacon.sol @@ -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_) {} }