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

added poly and mainnet diamond extensions #495

Open
wants to merge 3 commits into
base: develop
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
14 changes: 14 additions & 0 deletions contracts/shared/interfaces/IMainnetDiamond.sol
Original file line number Diff line number Diff line change
@@ -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
{}
6 changes: 6 additions & 0 deletions contracts/shared/interfaces/IPolygonDiamond.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import { ITellerDiamond } from "./ITellerDiamond.sol";

abstract contract IPolyDiamond is ITellerDiamond {}
4 changes: 0 additions & 4 deletions contracts/shared/interfaces/ITellerDiamond.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -58,7 +55,6 @@ abstract contract ITellerDiamond is
SignersFacet,
NFTFacet,
MainnetNFTInterestFacet,
NFTMainnetBridgingToPolygonFacet,
CompoundFacet,
CompoundClaimCompFacet,
AaveFacet,
Expand Down
5 changes: 4 additions & 1 deletion deploy/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { getDappAddresses, getNativeToken, isEtheremNetwork } from '../config'
import {
ICollateralEscrow,
ILoansEscrow,
IMainnetDiamond,
IPolyDiamond,
ITellerDiamond,
ITToken,
UpgradeableBeaconFactory,
Expand Down Expand Up @@ -222,6 +224,7 @@ const deployProtocol: DeployFunction = async (hre) => {
owner: deployer,
execute,
}

const diamond = await deployDiamond<ITellerDiamond, any>(tellerDiamondArgs)
await addAuthorizedAddresses(hre, diamond)
const ERC1155_PREDICATE = `0x0B9020d4E32990D67559b1317c7BF0C15D6EB88f`
Expand All @@ -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()
}
}

Expand Down
7 changes: 6 additions & 1 deletion test/integration/poly-bridge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import hre, {
import { getMarkets, isEtheremNetwork } from '../../config'
import { Market } from '../../types/custom/config-types'
import {
IMainnetDiamond,
IPolyDiamond,
ITellerDiamond,
MainnetNFTFacet,
MainnetNFTFacetMock,
Expand Down Expand Up @@ -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
Expand Down