diff --git a/contracts/shared/interfaces/IMainnetDiamond.sol b/contracts/shared/interfaces/IMainnetDiamond.sol new file mode 100644 index 000000000..0849d7fac --- /dev/null +++ b/contracts/shared/interfaces/IMainnetDiamond.sol @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import { ITellerDiamond } from "./ITellerDiamond.sol"; +import { MainnetNFTFacet } from "../../nft/mainnet/MainnetNFTFacet.sol"; +import { + NFTMainnetBridgingToPolygonFacet +} from "../../nft/mainnet/NFTMainnetBridgingToPolygonFacet.sol"; + +abstract contract IMainnetDiamond is + ITellerDiamond, + MainnetNFTFacet, + NFTMainnetBridgingToPolygonFacet +{} diff --git a/contracts/shared/interfaces/IPolygonDiamond.sol b/contracts/shared/interfaces/IPolygonDiamond.sol new file mode 100644 index 000000000..5ce327646 --- /dev/null +++ b/contracts/shared/interfaces/IPolygonDiamond.sol @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +import { ITellerDiamond } from "./ITellerDiamond.sol"; + +abstract contract IPolyDiamond is ITellerDiamond {} diff --git a/contracts/shared/interfaces/ITellerDiamond.sol b/contracts/shared/interfaces/ITellerDiamond.sol index 07a61887e..696835476 100644 --- a/contracts/shared/interfaces/ITellerDiamond.sol +++ b/contracts/shared/interfaces/ITellerDiamond.sol @@ -29,9 +29,6 @@ import { NFTFacet } from "../../nft/NFTFacet.sol"; import { MainnetNFTInterestFacet } from "../../nft/mainnet/MainnetNFTInterestFacet.sol"; -import { - NFTMainnetBridgingToPolygonFacet -} from "../../nft/mainnet/NFTMainnetBridgingToPolygonFacet.sol"; import { CollateralFacet } from "../../market/CollateralFacet.sol"; import { CompoundFacet } from "../../escrow/dapps/CompoundFacet.sol"; import { @@ -58,7 +55,6 @@ abstract contract ITellerDiamond is SignersFacet, NFTFacet, MainnetNFTInterestFacet, - NFTMainnetBridgingToPolygonFacet, CompoundFacet, CompoundClaimCompFacet, AaveFacet, diff --git a/deploy/protocol.ts b/deploy/protocol.ts index e2ec384c9..b9a98bc19 100644 --- a/deploy/protocol.ts +++ b/deploy/protocol.ts @@ -5,6 +5,8 @@ import { getDappAddresses, getNativeToken, isEtheremNetwork } from '../config' import { ICollateralEscrow, ILoansEscrow, + IMainnetDiamond, + IPolyDiamond, ITellerDiamond, ITToken, UpgradeableBeaconFactory, @@ -222,6 +224,7 @@ const deployProtocol: DeployFunction = async (hre) => { owner: deployer, execute, } + const diamond = await deployDiamond(tellerDiamondArgs) await addAuthorizedAddresses(hre, diamond) const ERC1155_PREDICATE = `0x0B9020d4E32990D67559b1317c7BF0C15D6EB88f` @@ -230,7 +233,7 @@ const deployProtocol: DeployFunction = async (hre) => { isEtheremNetwork(network, true) && nftV2.isApprovedForAll(diamond.address, ERC1155_PREDICATE) ) { - await diamond.initNFTBridge() + await (diamond as IMainnetDiamond).initNFTBridge() } } diff --git a/test/integration/poly-bridge.test.ts b/test/integration/poly-bridge.test.ts index 165f9b6f4..782e3e911 100644 --- a/test/integration/poly-bridge.test.ts +++ b/test/integration/poly-bridge.test.ts @@ -13,6 +13,8 @@ import hre, { import { getMarkets, isEtheremNetwork } from '../../config' import { Market } from '../../types/custom/config-types' import { + IMainnetDiamond, + IPolyDiamond, ITellerDiamond, MainnetNFTFacet, MainnetNFTFacetMock, @@ -42,7 +44,10 @@ if (isEtheremNetwork(hre.network)) { const { log } = hre // define needed variablez let deployer: Signer - let diamond: ITellerDiamond & MainnetNFTFacet & MainnetNFTFacetMock + let diamond: ITellerDiamond & + IMainnetDiamond & + IPolyDiamond & + MainnetNFTFacetMock let nftV1: TellerNFT let nftV2: TellerNFTV2 & MainnetTellerNFT let tellerDictionary: TellerNFTDictionary