diff --git a/packages/deploy/.gitignore b/packages/deploy/.gitignore index a77e23ebbf..885c058545 100644 --- a/packages/deploy/.gitignore +++ b/packages/deploy/.gitignore @@ -14,3 +14,4 @@ generated-markups # editors .idea +deployments/localhost \ No newline at end of file diff --git a/packages/deploy/deploy/300_catalyst/301_deploy_catalyst.ts b/packages/deploy/deploy/300_catalyst/301_deploy_catalyst.ts index 6aac331e00..619b4c2d83 100644 --- a/packages/deploy/deploy/300_catalyst/301_deploy_catalyst.ts +++ b/packages/deploy/deploy/300_catalyst/301_deploy_catalyst.ts @@ -31,7 +31,8 @@ const func: DeployFunction = async function ( await deploy('Catalyst', { from: deployer, log: true, - contract: '@sandbox-smart-contracts/asset/contracts/Catalyst.sol:Catalyst', + contract: + '@sandbox-smart-contracts/asset-1.0.3/contracts/Catalyst.sol:Catalyst', proxy: { owner: upgradeAdmin, proxyContract: 'OpenZeppelinTransparentProxy', diff --git a/packages/deploy/deploy/300_catalyst/303_catalyst_upgrade-v2.ts b/packages/deploy/deploy/300_catalyst/303_catalyst_upgrade-v2.ts new file mode 100644 index 0000000000..8e33642291 --- /dev/null +++ b/packages/deploy/deploy/300_catalyst/303_catalyst_upgrade-v2.ts @@ -0,0 +1,25 @@ +import {DeployFunction} from 'hardhat-deploy/types'; +import {HardhatRuntimeEnvironment} from 'hardhat/types'; + +const func: DeployFunction = async function ( + hre: HardhatRuntimeEnvironment +): Promise { + const {deployments, getNamedAccounts} = hre; + const {deploy} = deployments; + + const {deployer, upgradeAdmin} = await getNamedAccounts(); + + await deploy('Catalyst', { + from: deployer, + log: true, + contract: '@sandbox-smart-contracts/asset/contracts/Catalyst.sol:Catalyst', + proxy: { + owner: upgradeAdmin, + proxyContract: 'OpenZeppelinTransparentProxy', + upgradeIndex: 1, + }, + }); +}; +export default func; +func.tags = ['Catalyst_upgrade']; +func.dependencies = ['Catalyst_deploy', 'Catalyst_setup']; diff --git a/packages/deploy/deploy/400_asset/402_deploy_asset.ts b/packages/deploy/deploy/400_asset/402_deploy_asset.ts index 0e4cc5392c..562c55ebde 100644 --- a/packages/deploy/deploy/400_asset/402_deploy_asset.ts +++ b/packages/deploy/deploy/400_asset/402_deploy_asset.ts @@ -14,7 +14,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { await deploy('Asset', { from: deployer, - contract: '@sandbox-smart-contracts/asset/contracts/Asset.sol:Asset', + contract: '@sandbox-smart-contracts/asset-1.0.3/contracts/Asset.sol:Asset', proxy: { owner: upgradeAdmin, proxyContract: 'OpenZeppelinTransparentProxy', diff --git a/packages/deploy/deploy/400_asset/408_asset_upgrade-v2.ts b/packages/deploy/deploy/400_asset/408_asset_upgrade-v2.ts new file mode 100644 index 0000000000..9e70c55d89 --- /dev/null +++ b/packages/deploy/deploy/400_asset/408_asset_upgrade-v2.ts @@ -0,0 +1,23 @@ +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('Asset', { + from: deployer, + contract: '@sandbox-smart-contracts/asset/contracts/Asset.sol:Asset', + proxy: { + owner: upgradeAdmin, + proxyContract: 'OpenZeppelinTransparentProxy', + upgradeIndex: 1, + }, + log: true, + }); +}; +export default func; + +func.tags = ['Asset_upgrade']; +func.dependencies = ['Asset_deploy', 'Asset_setup']; diff --git a/packages/deploy/hardhat.config.ts b/packages/deploy/hardhat.config.ts index 7f2a36af1c..a65edb1f9a 100644 --- a/packages/deploy/hardhat.config.ts +++ b/packages/deploy/hardhat.config.ts @@ -14,6 +14,10 @@ import './tasks/importedPackages'; // Package name : solidity source code path const importedPackages = { '@sandbox-smart-contracts/asset': 'contracts/', + '@sandbox-smart-contracts/asset-1.0.3': [ + 'contracts/Asset.sol', + 'contracts/Catalyst.sol', + ], '@sandbox-smart-contracts/giveaway': 'contracts/SignedMultiGiveaway.sol', '@sandbox-smart-contracts/faucets': 'contracts/FaucetsERC1155.sol', '@sandbox-smart-contracts/marketplace': [ diff --git a/packages/deploy/package.json b/packages/deploy/package.json index 981c29aba0..7946a0b9df 100644 --- a/packages/deploy/package.json +++ b/packages/deploy/package.json @@ -16,6 +16,7 @@ "private": true, "dependencies": { "@sandbox-smart-contracts/asset": "*", + "@sandbox-smart-contracts/asset-1.0.3": "npm:@sandbox-smart-contracts/asset@1.0.3", "@sandbox-smart-contracts/core": "*", "@sandbox-smart-contracts/dependency-operator-filter": "*", "@sandbox-smart-contracts/dependency-royalty-management": "*", diff --git a/yarn.lock b/yarn.lock index c51c579b8a..1aa88b76e6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2154,6 +2154,21 @@ __metadata: languageName: node linkType: hard +"@sandbox-smart-contracts/asset-1.0.3@npm:@sandbox-smart-contracts/asset@1.0.3": + version: 1.0.3 + resolution: "@sandbox-smart-contracts/asset@npm:1.0.3" + dependencies: + "@manifoldxyz/libraries-solidity": ^1.0.4 + "@manifoldxyz/royalty-registry-solidity": ^2.0.3 + "@openzeppelin/contracts": 4.9.3 + "@openzeppelin/contracts-upgradeable": 4.9.3 + "@sandbox-smart-contracts/dependency-metatx": 1.0.1 + "@sandbox-smart-contracts/dependency-operator-filter": 1.0.1 + "@sandbox-smart-contracts/dependency-royalty-management": 1.0.2 + checksum: bbf63b91b98bf694fd68592d7f35a5aacafb2bfd67243352f27b4bf062dc17c13509c480571077cadc451059c15587029145caece2814495d69cd5241e82f6db + languageName: node + linkType: hard + "@sandbox-smart-contracts/asset@*, @sandbox-smart-contracts/asset@workspace:packages/asset": version: 0.0.0-use.local resolution: "@sandbox-smart-contracts/asset@workspace:packages/asset" @@ -2411,6 +2426,7 @@ __metadata: "@nomiclabs/hardhat-ethers": ^2.2.3 "@openzeppelin/hardhat-upgrades": ^2.5.0 "@sandbox-smart-contracts/asset": "*" + "@sandbox-smart-contracts/asset-1.0.3": "npm:@sandbox-smart-contracts/asset@1.0.3" "@sandbox-smart-contracts/core": "*" "@sandbox-smart-contracts/dependency-operator-filter": "*" "@sandbox-smart-contracts/dependency-royalty-management": "*"