Skip to content

Commit

Permalink
Add deployment scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
wojciech-turek committed Dec 8, 2023
1 parent ab74f87 commit 47abb75
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/deploy/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ generated-markups

# editors
.idea
deployments/localhost
3 changes: 2 additions & 1 deletion packages/deploy/deploy/300_catalyst/301_deploy_catalyst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
25 changes: 25 additions & 0 deletions packages/deploy/deploy/300_catalyst/303_catalyst_upgrade-v2.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import {DeployFunction} from 'hardhat-deploy/types';
import {HardhatRuntimeEnvironment} from 'hardhat/types';

const func: DeployFunction = async function (
hre: HardhatRuntimeEnvironment
): Promise<void> {
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'];
2 changes: 1 addition & 1 deletion packages/deploy/deploy/400_asset/402_deploy_asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
23 changes: 23 additions & 0 deletions packages/deploy/deploy/400_asset/408_asset_upgrade-v2.ts
Original file line number Diff line number Diff line change
@@ -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'];
4 changes: 4 additions & 0 deletions packages/deploy/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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': [
Expand Down
1 change: 1 addition & 0 deletions packages/deploy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"private": true,
"dependencies": {
"@sandbox-smart-contracts/asset": "*",
"@sandbox-smart-contracts/asset-1.0.3": "npm:@sandbox-smart-contracts/[email protected]",
"@sandbox-smart-contracts/core": "*",
"@sandbox-smart-contracts/dependency-operator-filter": "*",
"@sandbox-smart-contracts/dependency-royalty-management": "*",
Expand Down
16 changes: 16 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2154,6 +2154,21 @@ __metadata:
languageName: node
linkType: hard

"@sandbox-smart-contracts/asset-1.0.3@npm:@sandbox-smart-contracts/[email protected]":
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"
Expand Down Expand Up @@ -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/[email protected]"
"@sandbox-smart-contracts/core": "*"
"@sandbox-smart-contracts/dependency-operator-filter": "*"
"@sandbox-smart-contracts/dependency-royalty-management": "*"
Expand Down

1 comment on commit 47abb75

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage for this commit

98.65%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
packages/asset/contracts
   Asset.sol95%90%96.88%98.28%117, 208, 310, 310–311, 77
   AssetCreate.sol94.64%84.21%100%100%140, 142, 200, 216, 333, 74
   AssetReveal.sol94.35%86.21%96.55%98.89%143, 147, 181, 376, 416, 424, 441, 75, 98
   AuthSuperValidator.sol90%83.33%100%88.89%51–52
   Catalyst.sol95.39%92.19%96.15%98.39%124, 126, 139, 151, 223, 79
packages/asset/contracts/interfaces
   IAsset.sol100%100%100%100%
   IAssetCreate.sol100%100%100%100%
   IAssetReveal.sol100%100%100%100%
   ICatalyst.sol100%100%100%100%
   ITokenUtils.sol100%100%100%100%
packages/asset/contracts/libraries
   TokenIdUtils.sol100%100%100%100%

Please sign in to comment.