Skip to content

Commit

Permalink
fix: fix marketplace deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
adjisb committed Sep 29, 2023
1 parent ccd2dac commit 199ad8a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 28 deletions.
14 changes: 1 addition & 13 deletions packages/deploy/deploy/marketplace/03_deploy_asset_matcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,13 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const {deploy} = deployments;
const {deployer} = await getNamedAccounts();

// TODO: to be fetched from env?
const deployMeta = process.env.DEPLOY_META;
const exchangeContract = deployMeta ? 'ExchangeMeta' : 'Exchange';

const assetMatcher = await deploy('AssetMatcher', {
await deploy('AssetMatcher', {
from: deployer,
contract:
'@sandbox-smart-contracts/marketplace/contracts/exchange/AssetMatcher.sol:AssetMatcher',
log: true,
skipIfAlreadyDeployed: true,
});

await deployments.execute(
exchangeContract,
{from: deployer},
'setAssetMatcherContract',
assetMatcher.address
);
};
export default func;
func.tags = ['AssetMatcher', 'AssetMatcher_deploy'];
func.dependencies = ['Exchange'];
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {DeployFunction} from 'hardhat-deploy/types';
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const {deployments, getNamedAccounts} = hre;
const {deploy} = deployments;
const {deployer, upgradeAdmin, exchangeFeeRecipient} =
const {deployer, sandAdmin, upgradeAdmin, exchangeFeeRecipient} =
await getNamedAccounts();

let TRUSTED_FORWARDER = await deployments.getOrNull('TRUSTED_FORWARDER');
Expand All @@ -17,32 +17,28 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
}
const orderValidator = await deployments.get('OrderValidator');
const royaltiesRegistry = await deployments.get('RoyaltiesRegistry');
const assetMatcher = await deployments.get('AssetMatcher');

// TODO: Do we need oll the combinations of flags ? Can we have two deployments scripts with different tags each ?
// TODO: to be fetched from env?
const deployMeta = process.env.DEPLOY_META;
const nativeOrder = process.env.NATIVE_ORDER;
const metaNative = process.env.META_NATIVE;

const contract = deployMeta ? 'ExchangeMeta' : 'Exchange';
const newProtocolFeePrimary = 0;
const newProtocolFeeSecondary = 250;

await deploy('Exchange', {
from: deployer,
contract: `@sandbox-smart-contracts/marketplace/contracts/exchange/${contract}.sol:${contract}`,
contract: `@sandbox-smart-contracts/marketplace/contracts/exchange/Exchange.sol:Exchange`,
proxy: {
owner: upgradeAdmin,
proxyContract: 'OpenZeppelinTransparentProxy',
execute: {
methodName: '__Exchange_init',
args: [
sandAdmin,
TRUSTED_FORWARDER.address,
0,
250,
newProtocolFeePrimary,
newProtocolFeeSecondary,
exchangeFeeRecipient,
royaltiesRegistry,
royaltiesRegistry.address,
orderValidator.address,
nativeOrder,
metaNative,
assetMatcher.address,
],
},
upgradeIndex: 0,
Expand All @@ -53,4 +49,8 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
};
export default func;
func.tags = ['Exchange', 'Exchange_deploy'];
func.dependencies = ['RoyaltiesRegistry_deploy', 'OrderValidator_deploy'];
func.dependencies = [
'RoyaltiesRegistry_deploy',
'OrderValidator_deploy',
'AssetMatcher_deploy',
];

1 comment on commit 199ad8a

@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

70.42%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
packages/marketplace/contracts/exchange
   AssetMatcher.sol100%100%100%100%
   Exchange.sol86.79%85%85.71%89.47%152, 54, 79, 79–80
   ExchangeCore.sol78.76%59.09%100%89.66%116, 139–140, 140, 140, 140, 140, 143, 143, 204–205, 207–208, 245, 247–249, 255–257, 280–281, 298, 76
   OrderValidator.sol69.81%53.85%100%81.82%38, 54, 61–62, 62, 62, 72, 82–83, 88, 90, 90, 90, 90–91, 93
   WhiteList.sol97.73%93.75%100%100%57
packages/marketplace/contracts/exchange/libraries
   LibFill.sol55%33.33%66.67%63.64%48–49, 61, 71–72, 72, 72–73
   LibOrderDataGeneric.sol22.81%22.22%40%20.59%16–23, 25–26, 28, 41, 43, 43, 43–44, 46–47, 50, 50, 50–51, 53, 56, 56, 56–57, 59, 62, 66, 68, 68, 68–70, 73, 82, 82, 82–84
packages/marketplace/contracts/interfaces
   IAssetMatcher.sol100%100%100%100%
   IOrderValidator.sol100%100%100%100%
   IRoyaltiesProvider.sol100%100%100%100%
   IWhiteList.sol100%100%100%100%
packages/marketplace/contracts/lib-asset
   LibAsset.sol100%100%100%100%
packages/marketplace/contracts/lib-bp
   BpLibrary.sol100%100%100%100%
packages/marketplace/contracts/lib-order
   LibMath.sol27.50%18.75%50%30%100–103, 17–18, 33–34, 50, 50, 50–51, 72, 72, 72–73, 75, 88, 88, 88–89, 93, 93, 93, 93, 93, 97
   LibOrder.sol66.67%50%100%72.73%105, 105, 107, 107, 41–43, 54, 66
   LibOrderData.sol100%100%100%100%
packages/marketplace/contracts/lib-part
   LibPart.sol0%100%0%0%21
packages/marketplace/contracts/royalties
   IERC2981.sol100%100%100%100%
   LibRoyalties2981.sol35.71%25%100%33.33%19, 22–23, 23, 23–27
packages/marketplace/contracts/royalties-registry
   IMultiRoyaltyRecipients.sol100%100%100%100%
   RoyaltiesRegistry.sol70.40%67.65%93.33%67.11%160, 166, 166, 166–167, 170, 170, 170–171, 174, 202–203, 212, 216, 232–233, 236–244, 247, 247, 247–248, 250, 256, 259, 273–274, 276, 60
packages/marketplace/contracts/transfer-manager
   TransferExecutor.sol75.76%64.29%100%81.25%49–51, 58–59, 63, 66–67
   TransferManager.sol72.26%57.14%100%78.16%110, 114–115, 146–148, 148, 148–149, 156–157, 192–194, 194, 194–195, 195, 195–196, 202–203, 203, 203–204, 208, 248, 265, 269–271, 271, 271–273, 278–279, 302, 306–307, 62, 82–83
packages/marketplace/contracts/transfer-manager/interfaces
   IRoyaltyUGC.sol100%100%100%100%
   ITransferExecutor.sol100%100%100%100%
   ITransferManager.sol100%100%100%100%
packages/marketplace/contracts/transfer-manager/lib
   LibDeal.sol100%100%100%100%
   LibFeeSide.sol44.44%37.50%100%44.44%21, 24, 24, 24–25, 27, 27, 27–28, 30
   LibTransfer.sol0%0%0%0%7–8, 8, 8

Please sign in to comment.