Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
717ffec
commit 8b3ee68
Showing
10 changed files
with
1,060 additions
and
982 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
packages/deploy/deploy/700_land/polygon_land/700_deploy_operator_filter_subscription.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import {DeployFunction} from 'hardhat-deploy/types'; | ||
import {HardhatRuntimeEnvironment} from 'hardhat/types'; | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const {deployments, getNamedAccounts} = hre; | ||
const {deploy, read, catchUnknownSigner, execute} = deployments; | ||
|
||
const {deployer, sandAdmin} = await getNamedAccounts(); | ||
|
||
// Operator filter subscription | ||
await deploy('OperatorFilterLandSubscription', { | ||
from: deployer, | ||
contract: | ||
'@sandbox-smart-contracts/dependency-operator-filter/contracts/OperatorFilterSubscription.sol:OperatorFilterSubscription', | ||
log: true, | ||
skipIfAlreadyDeployed: true, | ||
}); | ||
|
||
const owner = await read('OperatorFilterLandSubscription', 'owner'); | ||
if (owner != sandAdmin) { | ||
await catchUnknownSigner( | ||
execute( | ||
'OperatorFilterLandSubscription', | ||
{from: owner, log: true}, | ||
'transferOwnership', | ||
sandAdmin | ||
) | ||
); | ||
} | ||
}; | ||
export default func; | ||
func.tags = [ | ||
'OperatorFilterLandSubscription', | ||
'OperatorFilterLandSubscription_deploy', | ||
'L2', | ||
]; |
78 changes: 78 additions & 0 deletions
78
...s/deploy/deploy/700_land/polygon_land/701_deploy_fake_polygon_operator_filter_registry.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import {HardhatRuntimeEnvironment} from 'hardhat/types'; | ||
import {DeployFunction} from 'hardhat-deploy/types'; | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const {deployments, getNamedAccounts} = hre; | ||
const {deploy} = deployments; | ||
|
||
const {deployer, landAdmin} = await getNamedAccounts(); | ||
|
||
const operatorFilterRegistry = await deployments.getOrNull( | ||
'PolygonOperatorFilterRegistry' | ||
); | ||
|
||
if (!operatorFilterRegistry) { | ||
const mockMarketPlace1 = await deploy('MockMarketPlace1', { | ||
from: deployer, | ||
contract: | ||
'@sandbox-smart-contracts/dependency-operator-filter/contracts/mock/MockMarketPlace1.sol:MockERC1155MarketPlace1', | ||
args: [], | ||
log: true, | ||
skipIfAlreadyDeployed: true, | ||
}); | ||
|
||
const mockMarketPlace2 = await deploy('MockMarketPlace2', { | ||
from: deployer, | ||
contract: | ||
'@sandbox-smart-contracts/dependency-operator-filter/contracts/mock/MockMarketPlace2.sol:MockERC1155MarketPlace2', | ||
args: [], | ||
log: true, | ||
skipIfAlreadyDeployed: true, | ||
}); | ||
|
||
const mockMarketPlace3 = await deploy('MockMarketPlace3', { | ||
from: deployer, | ||
contract: | ||
'@sandbox-smart-contracts/dependency-operator-filter/contracts/mock/MockMarketPlace3.sol:MockERC1155MarketPlace3', | ||
args: [], | ||
log: true, | ||
skipIfAlreadyDeployed: true, | ||
}); | ||
|
||
const mockMarketPlace4 = await deploy('MockMarketPlace4', { | ||
from: deployer, | ||
contract: | ||
'@sandbox-smart-contracts/dependency-operator-filter/contracts/mock/MockMarketPlace4.sol:MockERC1155MarketPlace4', | ||
args: [], | ||
log: true, | ||
skipIfAlreadyDeployed: true, | ||
}); | ||
|
||
const defaultSubscription = '0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6'; | ||
const OperatorFilterLandSubscription = await deployments.get( | ||
'OperatorFilterLandSubscription' | ||
); | ||
|
||
await deploy('PolygonOperatorFilterRegistry', { | ||
from: deployer, | ||
contract: 'MockOperatorFilterRegistry', | ||
args: [ | ||
defaultSubscription, | ||
[mockMarketPlace1.address, mockMarketPlace2.address], | ||
], | ||
log: true, | ||
skipIfAlreadyDeployed: true, | ||
}); | ||
|
||
await deployments.execute( | ||
'PolygonOperatorFilterRegistry', | ||
{from: landAdmin, log: true}, | ||
'registerAndCopyEntries', | ||
OperatorFilterLandSubscription.address, | ||
defaultSubscription | ||
); | ||
} | ||
}; | ||
export default func; | ||
func.tags = ['PolygonOperatorFilterRegistry', 'L2']; | ||
func.dependencies = ['OperatorFilterLandSubscription']; |
34 changes: 34 additions & 0 deletions
34
packages/deploy/deploy/700_land/polygon_land/702_deploy_polygon_land.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import {HardhatRuntimeEnvironment} from 'hardhat/types'; | ||
import {DeployFunction} from 'hardhat-deploy/types'; | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const {deployments, getNamedAccounts} = hre; | ||
const {deploy, execute} = deployments; | ||
const {deployer, landAdmin, upgradeAdmin} = await getNamedAccounts(); | ||
const TRUSTED_FORWARDER = await deployments.get('TRUSTED_FORWARDER_V2'); | ||
|
||
await deploy('PolygonLand', { | ||
from: deployer, | ||
contract: 'PolygonLandV1', | ||
proxy: { | ||
owner: upgradeAdmin, | ||
proxyContract: 'OpenZeppelinTransparentProxy', | ||
execute: { | ||
methodName: 'initialize', | ||
args: [TRUSTED_FORWARDER.address], | ||
}, | ||
upgradeIndex: 0, | ||
}, | ||
log: true, | ||
}); | ||
|
||
await execute( | ||
'PolygonLand', | ||
{from: deployer, log: true}, | ||
'changeAdmin', | ||
landAdmin | ||
); | ||
}; | ||
export default func; | ||
func.tags = ['PolygonLand', 'PolygonLand_deploy', 'L2']; | ||
func.dependencies = ['TRUSTED_FORWARDER_V2']; |
22 changes: 22 additions & 0 deletions
22
packages/deploy/deploy/700_land/polygon_land/703_upgrade_polygon_land.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import {HardhatRuntimeEnvironment} from 'hardhat/types'; | ||
import {DeployFunction} from 'hardhat-deploy/types'; | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const {deployments, getNamedAccounts} = hre; | ||
const {deploy} = deployments; | ||
|
||
const {deployer, upgradeAdmin} = await getNamedAccounts(); | ||
await deploy('PolygonLand', { | ||
from: deployer, | ||
contract: 'PolygonLandV2', | ||
proxy: { | ||
owner: upgradeAdmin, | ||
proxyContract: 'OpenZeppelinTransparentProxy', | ||
upgradeIndex: 1, | ||
}, | ||
log: true, | ||
}); | ||
}; | ||
export default func; | ||
func.tags = ['PolygonLand', 'PolygonLandV2', 'L2']; | ||
func.dependencies = ['PolygonLand_deploy']; |
21 changes: 21 additions & 0 deletions
21
packages/deploy/deploy/700_land/polygon_land/704_upgrade_polygonV3_land.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import {HardhatRuntimeEnvironment} from 'hardhat/types'; | ||
import {DeployFunction} from 'hardhat-deploy/types'; | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const {deployments, getNamedAccounts} = hre; | ||
const {deploy} = deployments; | ||
const {deployer, upgradeAdmin} = await getNamedAccounts(); | ||
await deploy('PolygonLand', { | ||
from: deployer, | ||
contract: 'PolygonLand', | ||
proxy: { | ||
owner: upgradeAdmin, | ||
proxyContract: 'OpenZeppelinTransparentProxy', | ||
upgradeIndex: 2, | ||
}, | ||
log: true, | ||
}); | ||
}; | ||
export default func; | ||
func.tags = ['PolygonLand', 'PolygonLandV3', 'L2']; | ||
func.dependencies = ['PolygonLandV2', 'RoyaltyManager_deploy']; |
52 changes: 52 additions & 0 deletions
52
packages/deploy/deploy/700_land/polygon_land/705_polygon_land_setup.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import {HardhatRuntimeEnvironment} from 'hardhat/types'; | ||
import {DeployFunction} from 'hardhat-deploy/types'; | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const {deployments, getNamedAccounts} = hre; | ||
const {execute} = deployments; | ||
const {landAdmin} = await getNamedAccounts(); | ||
|
||
const RoyaltyManager = await deployments.get('RoyaltyManager'); | ||
const OperatorFilterLandSubscription = await deployments.get( | ||
'OperatorFilterLandSubscription' | ||
); | ||
const PolygonOperatorFilterRegistry = await deployments.get( | ||
'PolygonOperatorFilterRegistry' | ||
); | ||
|
||
await execute( | ||
'PolygonLand', | ||
{from: landAdmin, log: true}, | ||
'setRoyaltyManager', | ||
RoyaltyManager.address | ||
); | ||
|
||
console.log(OperatorFilterLandSubscription.address); | ||
console.log(PolygonOperatorFilterRegistry.address); | ||
|
||
await deployments.execute( | ||
'PolygonLand', | ||
{from: landAdmin, log: true}, | ||
'setOperatorRegistry', | ||
PolygonOperatorFilterRegistry.address | ||
); | ||
|
||
await deployments.execute( | ||
'PolygonLand', | ||
{from: landAdmin, log: true}, | ||
'register', | ||
OperatorFilterLandSubscription.address, | ||
true | ||
); | ||
}; | ||
|
||
export default func; | ||
|
||
func.tags = ['PolygonLand', 'PolygonLand_setup']; | ||
func.dependencies = [ | ||
'OperatorFilterLandSubscription_deploy', | ||
'PolygonOperatorFilterRegistry', | ||
'PolygonLand_deploy', | ||
'PolygonLandV2', | ||
'PolygonLandV3', | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.