Skip to content

Commit ae74c06

Browse files
Types upgrade after PROVIDER removal
1 parent d0e1ae5 commit ae74c06

19 files changed

+88
-141
lines changed

contracts/registrar/IZNSSubRegistrar.sol

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity 0.8.26;
33

4-
import { IDistributionConfig } from "../types/IDistributionConfig.sol";
5-
import { PaymentConfig } from "../treasury/IZNSTreasury.sol";
6-
import { IZNSPricer } from "../types/IZNSPricer.sol";
7-
4+
import {IDistributionConfig} from "../types/IDistributionConfig.sol";
5+
import {PaymentConfig} from "../treasury/IZNSTreasury.sol";
6+
import {IZNSPricer} from "../types/IZNSPricer.sol";
87

98
/**
109
* @title IZNSSubRegistrar.sol - Interface for the ZNSSubRegistrar contract responsible for registering subdomains.
11-
*/
10+
*/
1211
interface IZNSSubRegistrar is IDistributionConfig {
1312
/**
14-
* @notice Reverted when someone other than parent owner is trying to buy a subdomain under the parent that is locked\
13+
* @notice Reverted when someone other than parent owner is trying to buy
14+
a subdomain under the parent that is locked\
1515
* or when the parent provided does not exist.
1616
*/
1717
error ParentLockedOrDoesntExist(bytes32 parentHash);
@@ -23,22 +23,25 @@ interface IZNSSubRegistrar is IDistributionConfig {
2323

2424
/**
2525
* @notice Emitted when a new `DistributionConfig.pricerContract` is set for a domain.
26-
*/
27-
event PricerContractSet(bytes32 indexed domainHash, address indexed pricerContract);
26+
*/
27+
event PricerContractSet(
28+
bytes32 indexed domainHash,
29+
address indexed pricerContract
30+
);
2831

2932
/**
3033
* @notice Emitted when a new `DistributionConfig.paymentType` is set for a domain.
31-
*/
34+
*/
3235
event PaymentTypeSet(bytes32 indexed domainHash, PaymentType paymentType);
3336

3437
/**
3538
* @notice Emitted when a new `DistributionConfig.accessType` is set for a domain.
36-
*/
39+
*/
3740
event AccessTypeSet(bytes32 indexed domainHash, AccessType accessType);
3841

3942
/**
4043
* @notice Emitted when a new full `DistributionConfig` is set for a domain at once.
41-
*/
44+
*/
4245
event DistributionConfigSet(
4346
bytes32 indexed domainHash,
4447
IZNSPricer pricerContract,
@@ -48,7 +51,7 @@ interface IZNSSubRegistrar is IDistributionConfig {
4851

4952
/**
5053
* @notice Emitted when a `mintlist` is updated for a domain.
51-
*/
54+
*/
5255
event MintlistUpdated(
5356
bytes32 indexed domainHash,
5457
uint256 indexed ownerIndex,
@@ -64,16 +67,19 @@ interface IZNSSubRegistrar is IDistributionConfig {
6467

6568
/**
6669
* @notice Emitted when the ZNSRootRegistrar address is set in state.
67-
*/
70+
*/
6871
event RootRegistrarSet(address registrar);
6972

7073
function distrConfigs(
7174
bytes32 domainHash
72-
) external view returns (
73-
IZNSPricer pricerContract,
74-
PaymentType paymentType,
75-
AccessType accessType
76-
);
75+
)
76+
external
77+
view
78+
returns (
79+
IZNSPricer pricerContract,
80+
PaymentType paymentType,
81+
AccessType accessType
82+
);
7783

7884
function isMintlistedForDomain(
7985
bytes32 domainHash,

contracts/types/IZNSPricer.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity 0.8.26;
33

4-
54
/**
65
* @title IZNSPricer.sol
76
* @notice Base interface required to be inherited by all Pricing contracts to work with zNS
@@ -14,7 +13,8 @@ interface IZNSPricer {
1413
error ParentPriceConfigNotSet(bytes32 parentHash);
1514

1615
/**
17-
* @notice Reverted when domain owner is trying to set it's stake fee percentage higher than 100% (uint256 "10,000").
16+
* @notice Reverted when domain owner is trying to set it's stake fee percentage higher than 100%
17+
(uint256 "10,000").
1818
*/
1919
error FeePercentageValueTooLarge(uint256 feePercentage, uint256 maximum);
2020

@@ -49,7 +49,7 @@ interface IZNSPricer {
4949
/**
5050
* @notice Returns the fee for a given price.
5151
* @dev Fees are only supported for PaymentType.STAKE !
52-
*/
52+
*/
5353
function getFeeForPrice(
5454
bytes32 parentHash,
5555
uint256 price

hardhat.config.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,20 @@ const config : HardhatUserConfig = {
150150
"oz-proxies/",
151151
],
152152
},
153+
// meowtestnet: {
154+
// url: `${process.env.MEOWTESTNET_RPC_URL}`,
155+
// chainId: 883424730,
156+
// accounts: [ // Comment out for CI, uncomment this when using Sepolia
157+
// `${process.env.DEPLOYER_PRIVATE_KEY}`,
158+
// `${process.env.ZERO_VAULT_PRIVATE_KEY}`,
159+
// `${process.env.TESTNET_PRIVATE_KEY_A}`,
160+
// `${process.env.TESTNET_PRIVATE_KEY_B}`,
161+
// `${process.env.TESTNET_PRIVATE_KEY_C}`,
162+
// `${process.env.TESTNET_PRIVATE_KEY_D}`,
163+
// `${process.env.TESTNET_PRIVATE_KEY_E}`,
164+
// `${process.env.TESTNET_PRIVATE_KEY_F}`,
165+
// ],
166+
// },
153167
};
154168

155169
export default config;

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@
7575
"typescript": "^5.0.2"
7676
},
7777
"dependencies": {
78-
"@zero-tech/zdc": "0.1.3",
78+
"@zero-tech/zdc": "0.1.6",
7979
"axios": "^1.4.0",
8080
"dotenv": "16.0.3",
8181
"mongodb": "^6.1.0",
8282
"winston": "^3.11.0"
8383
}
84-
}
84+
}

src/deploy/missions/contracts/access-controller.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ import {
44
import { znsNames } from "./names";
55
import { HardhatRuntimeEnvironment } from "hardhat/types";
66
import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
7-
import { DefenderRelayProvider } from "@openzeppelin/defender-sdk-relay-signer-client/lib/ethers";
8-
import { IZNSContracts } from "../../campaign/types";
7+
import { IZNSCampaignConfig, IZNSContracts } from "../../campaign/types";
98

109

1110
export class ZNSAccessControllerDM extends BaseDeployMission<
1211
HardhatRuntimeEnvironment,
1312
SignerWithAddress,
14-
DefenderRelayProvider,
13+
IZNSCampaignConfig<SignerWithAddress>,
1514
IZNSContracts
1615
> {
1716
proxyData = {
@@ -27,6 +26,6 @@ IZNSContracts
2726
adminAddresses,
2827
} = this.config;
2928

30-
return [ governorAddresses, adminAddresses ];
29+
return [governorAddresses, adminAddresses];
3130
}
3231
}

src/deploy/missions/contracts/address-resolver.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ import {
55
import { ProxyKinds, ResolverTypes } from "../../constants";
66
import { znsNames } from "./names";
77
import { HardhatRuntimeEnvironment } from "hardhat/types";
8-
import { DefenderRelayProvider } from "@openzeppelin/defender-sdk-relay-signer-client/lib/ethers";
9-
import { IZNSContracts } from "../../campaign/types";
8+
import { IZNSCampaignConfig, IZNSContracts } from "../../campaign/types";
109
import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
1110

1211

1312
export class ZNSAddressResolverDM extends BaseDeployMission<
1413
HardhatRuntimeEnvironment,
1514
SignerWithAddress,
16-
DefenderRelayProvider,
15+
IZNSCampaignConfig<SignerWithAddress>,
1716
IZNSContracts
1817
> {
1918
proxyData = {

src/deploy/missions/contracts/curve-pricer.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ import { ProxyKinds } from "../../constants";
66
import { znsNames } from "./names";
77
import { HardhatRuntimeEnvironment } from "hardhat/types";
88
import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
9-
import { DefenderRelayProvider } from "@openzeppelin/defender-sdk-relay-signer-client/lib/ethers";
10-
import { IZNSContracts } from "../../campaign/types";
9+
import { IZNSCampaignConfig, IZNSContracts } from "../../campaign/types";
1110

1211

1312
export class ZNSCurvePricerDM extends BaseDeployMission<
1413
HardhatRuntimeEnvironment,
1514
SignerWithAddress,
16-
DefenderRelayProvider,
15+
IZNSCampaignConfig<SignerWithAddress>,
1716
IZNSContracts
1817
> {
1918
proxyData = {

src/deploy/missions/contracts/domain-token.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ import { ProxyKinds } from "../../constants";
66
import { znsNames } from "./names";
77
import { HardhatRuntimeEnvironment } from "hardhat/types";
88
import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
9-
import { DefenderRelayProvider } from "@openzeppelin/defender-sdk-relay-signer-client/lib/ethers";
109
import { IZNSCampaignConfig, IZNSContracts } from "../../campaign/types";
1110

1211

1312
export class ZNSDomainTokenDM extends BaseDeployMission<
1413
HardhatRuntimeEnvironment,
1514
SignerWithAddress,
16-
DefenderRelayProvider,
15+
IZNSCampaignConfig<SignerWithAddress>,
1716
IZNSContracts
1817
> {
1918
proxyData = {
@@ -33,7 +32,7 @@ IZNSContracts
3332
defaultRoyaltyReceiver,
3433
defaultRoyaltyFraction,
3534
},
36-
} = this.config as IZNSCampaignConfig<SignerWithAddress>;
35+
} = this.config ;
3736

3837
return [ await accessController.getAddress(), name, symbol, defaultRoyaltyReceiver, defaultRoyaltyFraction ];
3938
}

src/deploy/missions/contracts/fixed-pricer.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ import {
66
import { znsNames } from "./names";
77
import { HardhatRuntimeEnvironment } from "hardhat/types";
88
import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
9-
import { DefenderRelayProvider } from "@openzeppelin/defender-sdk-relay-signer-client/lib/ethers";
10-
import { IZNSContracts } from "../../campaign/types";
9+
import { IZNSCampaignConfig, IZNSContracts } from "../../campaign/types";
1110

1211

1312
export class ZNSFixedPricerDM extends BaseDeployMission<
1413
HardhatRuntimeEnvironment,
1514
SignerWithAddress,
16-
DefenderRelayProvider,
15+
IZNSCampaignConfig<SignerWithAddress>,
1716
IZNSContracts
1817
> {
1918
proxyData = {

src/deploy/missions/contracts/meow-token/meow-token.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import { ethers } from "ethers";
88
import { znsNames } from "../names";
99
import { HardhatRuntimeEnvironment } from "hardhat/types";
1010
import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
11-
import { DefenderRelayProvider } from "@openzeppelin/defender-sdk-relay-signer-client/lib/ethers";
12-
import { IZNSContracts } from "../../../campaign/types";
11+
import { IZNSCampaignConfig, IZNSContracts } from "../../../campaign/types";
1312
import { MeowToken__factory } from "@zero-tech/ztoken/typechain-js";
1413
import meowArtifact from "@zero-tech/ztoken/artifacts/contracts/MeowToken.sol/MeowToken.json";
1514

@@ -21,7 +20,7 @@ export const meowTokenSymbol = "MEOW";
2120
export class MeowTokenDM extends BaseDeployMission<
2221
HardhatRuntimeEnvironment,
2322
SignerWithAddress,
24-
DefenderRelayProvider,
23+
IZNSCampaignConfig<SignerWithAddress>,
2524
IZNSContracts
2625
> {
2726
proxyData = {
@@ -35,7 +34,7 @@ IZNSContracts
3534
constructor (args : IDeployMissionArgs<
3635
HardhatRuntimeEnvironment,
3736
SignerWithAddress,
38-
DefenderRelayProvider,
37+
IZNSCampaignConfig<SignerWithAddress>,
3938
IZNSContracts
4039
>) {
4140
super(args);
@@ -68,7 +67,7 @@ IZNSContracts
6867
this.logger.debug(`Writing ${this.contractName} to DB...`);
6968

7069
const factory = new MeowToken__factory(this.config.deployAdmin);
71-
const baseContract = factory.attach(this.config.stakingTokenAddress as string);
70+
const baseContract = factory.attach(this.config.stakingTokenAddress);
7271
// TODO remove!
7372
// const baseContract = await this.campaign.deployer.getContractObject(
7473
// this.contractName,
@@ -99,7 +98,7 @@ IZNSContracts
9998

10099
this.logger.debug(`${this.contractName} ${msg} post deploy sequence`);
101100

102-
return this.config.mockMeowToken as boolean;
101+
return this.config.mockMeowToken ;
103102
}
104103

105104
async postDeploy () {

0 commit comments

Comments
 (0)