diff --git a/.env.sample b/.env.sample index 4d8e973b6..085892c89 100644 --- a/.env.sample +++ b/.env.sample @@ -1,22 +1,41 @@ +# We use the environment level to validate against certain requirements +ENV_LEVEL="dev" | "test" | "prod" + # Private key of the account Hardhat will use PRIVATE_KEY= +# Set this for Mainnet +MAINNET_RPC_URL= +# Set this for Sepolia +SEPOLIA_RPC_URL= + # ENV vars for MongoDB, for local development you can use below MONGO_DB_URI="mongodb://localhost:27018" MONGO_DB_NAME="zns-campaign" -MONGO_DB_CLIENT_OPTS="" +# Optional params for Mongo Client class specifically +MONGO_DB_CLIENT_OPTS= +# This is crucial based on the DB behaviour you want. MongoAdapter will create a new DB version if this is NOT passed +# and it will use existing version if specified. If you want to deploy from scratch, do not supply and the previous +# versioned data will be wiped out. +# If you wish to save the previous data and write a new version on top, look at the next ENV var. +MONGO_DB_VERSION= +# This is crucial to saving the data written in previous DB (DEPLOYED) version. +# If this is not passed or passed as "false", previous DB data will be wiped out. +# If you want to save the previous contract data in DB, set this to "true"! +ARCHIVE_PREVIOUS_DB_VERSION="true" | "false" # ENV vars for Logger -LOG_LEVEL="info" | "debug" +LOG_LEVEL="debug" | "info" | "warn" | "error +# Removes logger output and does not write to file as well SILENT_LOGGER="false" | "true" -# We use the environment level to validate against certain requirements -ENV_LEVEL="dev" | "test" | "prod" - # Boolean value for if we deploy the mock # true = we deploy the mock # false = we use a hard coded address and pull data from chain MOCK_MEOW_TOKEN= +# Address of the MEOW Token deployed to the network PRIOR to running Campaign or any other EXISTING token +# This is only used if MOCK_MEOW_TOKEN is set to false (`test` and `prod` environments) +STAKING_TOKEN_ADDRESS= # Environment variables to create an entirely custom config when `env_level` above is not dev MAX_PRICE= @@ -26,14 +45,16 @@ BASE_LENGTH= DECIMALS= PRECISION= -REG_FEE_PERCENT= -ROYALTY_FRACTION= +PROTOCOL_FEE_PERC= -TOKEN_NAME= -TOKEN_SYMBOL= +# Domain Token data +DOMAIN_TOKEN_NAME= +DOMAIN_TOKEN_SYMBOL= +ROYALTY_FRACTION= ROYALTY_RECEIVER= + +# Zero Vault is where all the Protocol Fees end up. Required to be set! ZERO_VAULT_ADDRESS= -STAKING_TOKEN_ADDRESS= # base64 encoded value of a comma separated list of address e.g. "0x123,0x456" === "MHgxMjMsMHg0NTY=" GOVERNOR_ADDRESSES= @@ -42,4 +63,21 @@ ADMIN_ADDRESSES= # The deploy campaign will automatically verify and monitor contracts on testnets or mainnet, but not hardhat # to turn off this flow for testing, set these values to "false" and "true" otherwise MONITOR_CONTRACTS="false" -VERIFY_CONTRACTS="false" \ No newline at end of file +VERIFY_CONTRACTS="false" + +DEFENDER_KEY= +DEFENDER_SECRET= +RELAYER_KEY= +RELAYER_SECRET= + +# Tenderly +# this is your key to access Tenderly Zer0 Org +TENDERLY_ACCESS_KEY= +# This is the name of the project (e.g. "zns-sepolia-test") to which you want to push +TENDERLY_PROJECT_SLUG= +# Account ID of the Zer0 Org on Tenderly +TENDERLY_ACCOUNT_ID="zer0-os" + +# Below are used only for the `deploy:devnet` script (for testing new logic) NOT RELATED TO THE DEPLOY CAMPAIGN ! +TENDERLY_DEVNET_TEMPLATE="zns-devnet" +DEVNET_RPC_URL= diff --git a/.gitignore b/.gitignore index bc60a8bec..2abca5351 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,6 @@ deployments *.env docker docker*.tgz + +# We don't ever use the generated manifests +.openzeppelin diff --git a/.openzeppelin/sepolia.json b/.openzeppelin/sepolia.json deleted file mode 100644 index 117ac9c27..000000000 --- a/.openzeppelin/sepolia.json +++ /dev/null @@ -1,1581 +0,0 @@ -{ - "manifestVersion": "3.2", - "admin": { - "address": "0x0BB918C323A2Df7cb88E685f42dF45Db79C4e117", - "txHash": "0x801920ae01094ba22451bb95dba0558d134227a397a363fff6d326cbe6a767cf" - }, - "proxies": [ - { - "address": "0xd1295C95448E6874d35CCAE0B4b0b44b4071521b", - "txHash": "0xc46e936813b6ccf7edb40b98c3747f86580af46540f4b432c804d54d32f5358b", - "kind": "uups" - }, - { - "address": "0x2DAF6c14B5cB6Ad1cB48BC5E7019A388c4ad8f05", - "txHash": "0xe376d9bb25faea1db301e1bb9f410e59dc72d67d29b4d01ec4a269bae668a05c", - "kind": "uups" - }, - { - "address": "0xC6FCf37e3D18E3699678311417cCb84E74318E52", - "txHash": "0x2ebcbb5979a720f0cddf8571fb68d20f5592f235fc329a74df7615cabaea22a6", - "kind": "transparent" - }, - { - "address": "0x31543dfb8B63995Ef788428d05133fd807cbcE13", - "txHash": "0xd87c11202af4a6295fe70380fd329984189f76e7505e26340e1e697c2ccac53b", - "kind": "uups" - }, - { - "address": "0x638ab67a7e55Aaf63af91FE49695242CE56A1721", - "txHash": "0xe48531eeea65f968476117940b12a88eac4eb243fc1a49f95b1fe1f22513d880", - "kind": "uups" - }, - { - "address": "0xc61cb67B81127eec6Cf274DFE1DdB802Ce762722", - "txHash": "0x321f9dd3a2d3146e13742b797c14c3e974d0c2a55242c182b69a009c8e92ac03", - "kind": "uups" - }, - { - "address": "0x9bB729a16C5F81BD6ca6261C375F18dD9DD90fAF", - "txHash": "0x391ca74e8fde31f75a430220c198d54e5756108c4866a865a6b5a69e344f2ae6", - "kind": "uups" - }, - { - "address": "0xE8FE0b2f3CB0A9c3bDb45768bF72fE4C33DddC44", - "txHash": "0x32f9b5cd68371f29154cadfcfa6d67f89ff929bcd129b4e194038ca19a7174fc", - "kind": "uups" - }, - { - "address": "0xee50A573561200eC538FaD5B41632F98B97D9741", - "txHash": "0x36e723278908a1cf75e1bc2ce33255bfa7f5ed6f69787894649af7383417e554", - "kind": "uups" - } - ], - "impls": { - "bd7f58e618c1c2dcf7da55b81f9e5fc810d492018a394dcf80cb2411f4d44c21": { - "address": "0x6b077Aed0f0791489694eA64D3b341CAc9d04fe5", - "txHash": "0x059bf76e3f439b861422406ceb594412fd4f9cf15d3f4ed534d8fc5512f6a7c5", - "layout": { - "solcVersion": "0.8.18", - "storage": [ - { - "label": "accessController", - "offset": 0, - "slot": "0", - "type": "t_contract(IZNSAccessController)9083", - "contract": "AAccessControlled", - "src": "contracts\\access\\AAccessControlled.sol:23" - }, - { - "label": "_initialized", - "offset": 20, - "slot": "0", - "type": "t_uint8", - "contract": "Initializable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\Initializable.sol:62", - "retypedFrom": "bool" - }, - { - "label": "_initializing", - "offset": 21, - "slot": "0", - "type": "t_bool", - "contract": "Initializable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\Initializable.sol:67" - }, - { - "label": "__gap", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)50_storage", - "contract": "ERC1967UpgradeUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\ERC1967\\ERC1967UpgradeUpgradeable.sol:197" - }, - { - "label": "__gap", - "offset": 0, - "slot": "51", - "type": "t_array(t_uint256)50_storage", - "contract": "UUPSUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\UUPSUpgradeable.sol:107" - }, - { - "label": "resolvers", - "offset": 0, - "slot": "101", - "type": "t_mapping(t_string_memory_ptr,t_address)", - "contract": "ZNSRegistry", - "src": "contracts\\registry\\ZNSRegistry.sol:17" - }, - { - "label": "records", - "offset": 0, - "slot": "102", - "type": "t_mapping(t_bytes32,t_struct(DomainRecord)12267_storage)", - "contract": "ZNSRegistry", - "src": "contracts\\registry\\ZNSRegistry.sol:23" - }, - { - "label": "operators", - "offset": 0, - "slot": "103", - "type": "t_mapping(t_address,t_mapping(t_address,t_bool))", - "contract": "ZNSRegistry", - "src": "contracts\\registry\\ZNSRegistry.sol:31" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)50_storage": { - "label": "uint256[50]", - "numberOfBytes": "1600" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(IZNSAccessController)9083": { - "label": "contract IZNSAccessController", - "numberOfBytes": "20" - }, - "t_mapping(t_address,t_bool)": { - "label": "mapping(address => bool)", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_mapping(t_address,t_bool))": { - "label": "mapping(address => mapping(address => bool))", - "numberOfBytes": "32" - }, - "t_mapping(t_bytes32,t_struct(DomainRecord)12267_storage)": { - "label": "mapping(bytes32 => struct IZNSRegistry.DomainRecord)", - "numberOfBytes": "32" - }, - "t_mapping(t_string_memory_ptr,t_address)": { - "label": "mapping(string => address)", - "numberOfBytes": "32" - }, - "t_string_memory_ptr": { - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(DomainRecord)12267_storage": { - "label": "struct IZNSRegistry.DomainRecord", - "members": [ - { - "label": "owner", - "type": "t_address", - "offset": 0, - "slot": "0" - }, - { - "label": "resolver", - "type": "t_address", - "offset": 0, - "slot": "1" - } - ], - "numberOfBytes": "64" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "label": "uint8", - "numberOfBytes": "1" - }, - "t_string_storage": { - "label": "string" - } - }, - "namespaces": {} - } - }, - "66568442f1232127844e9b11df79a7304815210c036a7f612a73b679292f24d6": { - "address": "0x5c5b7564fEcB08D04AA322E8AfB3D2411eB40F74", - "txHash": "0x8c135660bc1850a7d0b8d52b2199e355de33a940d0aed99bfface1f5811988c9", - "layout": { - "solcVersion": "0.8.18", - "storage": [ - { - "label": "accessController", - "offset": 0, - "slot": "0", - "type": "t_contract(IZNSAccessController)9083", - "contract": "AAccessControlled", - "src": "contracts\\access\\AAccessControlled.sol:23" - }, - { - "label": "_initialized", - "offset": 20, - "slot": "0", - "type": "t_uint8", - "contract": "Initializable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\Initializable.sol:62", - "retypedFrom": "bool" - }, - { - "label": "_initializing", - "offset": 21, - "slot": "0", - "type": "t_bool", - "contract": "Initializable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\Initializable.sol:67" - }, - { - "label": "__gap", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)50_storage", - "contract": "ContextUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\utils\\ContextUpgradeable.sol:36" - }, - { - "label": "__gap", - "offset": 0, - "slot": "51", - "type": "t_array(t_uint256)50_storage", - "contract": "ERC165Upgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\utils\\introspection\\ERC165Upgradeable.sol:41" - }, - { - "label": "_name", - "offset": 0, - "slot": "101", - "type": "t_string_storage", - "contract": "ERC721Upgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\ERC721\\ERC721Upgradeable.sol:25" - }, - { - "label": "_symbol", - "offset": 0, - "slot": "102", - "type": "t_string_storage", - "contract": "ERC721Upgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\ERC721\\ERC721Upgradeable.sol:28" - }, - { - "label": "_owners", - "offset": 0, - "slot": "103", - "type": "t_mapping(t_uint256,t_address)", - "contract": "ERC721Upgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\ERC721\\ERC721Upgradeable.sol:31" - }, - { - "label": "_balances", - "offset": 0, - "slot": "104", - "type": "t_mapping(t_address,t_uint256)", - "contract": "ERC721Upgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\ERC721\\ERC721Upgradeable.sol:34" - }, - { - "label": "_tokenApprovals", - "offset": 0, - "slot": "105", - "type": "t_mapping(t_uint256,t_address)", - "contract": "ERC721Upgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\ERC721\\ERC721Upgradeable.sol:37" - }, - { - "label": "_operatorApprovals", - "offset": 0, - "slot": "106", - "type": "t_mapping(t_address,t_mapping(t_address,t_bool))", - "contract": "ERC721Upgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\ERC721\\ERC721Upgradeable.sol:40" - }, - { - "label": "__gap", - "offset": 0, - "slot": "107", - "type": "t_array(t_uint256)44_storage", - "contract": "ERC721Upgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\ERC721\\ERC721Upgradeable.sol:517" - }, - { - "label": "_defaultRoyaltyInfo", - "offset": 0, - "slot": "151", - "type": "t_struct(RoyaltyInfo)3388_storage", - "contract": "ERC2981Upgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\common\\ERC2981Upgradeable.sol:36" - }, - { - "label": "_tokenRoyaltyInfo", - "offset": 0, - "slot": "152", - "type": "t_mapping(t_uint256,t_struct(RoyaltyInfo)3388_storage)", - "contract": "ERC2981Upgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\common\\ERC2981Upgradeable.sol:37" - }, - { - "label": "__gap", - "offset": 0, - "slot": "153", - "type": "t_array(t_uint256)48_storage", - "contract": "ERC2981Upgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\common\\ERC2981Upgradeable.sol:123" - }, - { - "label": "_tokenURIs", - "offset": 0, - "slot": "201", - "type": "t_mapping(t_uint256,t_string_storage)", - "contract": "ERC721URIStorageUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\ERC721\\extensions\\ERC721URIStorageUpgradeable.sol:21" - }, - { - "label": "__gap", - "offset": 0, - "slot": "202", - "type": "t_array(t_uint256)49_storage", - "contract": "ERC721URIStorageUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\ERC721\\extensions\\ERC721URIStorageUpgradeable.sol:74" - }, - { - "label": "__gap", - "offset": 0, - "slot": "251", - "type": "t_array(t_uint256)50_storage", - "contract": "ERC1967UpgradeUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\ERC1967\\ERC1967UpgradeUpgradeable.sol:197" - }, - { - "label": "__gap", - "offset": 0, - "slot": "301", - "type": "t_array(t_uint256)50_storage", - "contract": "UUPSUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\UUPSUpgradeable.sol:107" - }, - { - "label": "baseURI", - "offset": 0, - "slot": "351", - "type": "t_string_storage", - "contract": "ZNSDomainToken", - "src": "contracts\\token\\ZNSDomainToken.sol:30" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)44_storage": { - "label": "uint256[44]", - "numberOfBytes": "1408" - }, - "t_array(t_uint256)48_storage": { - "label": "uint256[48]", - "numberOfBytes": "1536" - }, - "t_array(t_uint256)49_storage": { - "label": "uint256[49]", - "numberOfBytes": "1568" - }, - "t_array(t_uint256)50_storage": { - "label": "uint256[50]", - "numberOfBytes": "1600" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_contract(IZNSAccessController)9083": { - "label": "contract IZNSAccessController", - "numberOfBytes": "20" - }, - "t_mapping(t_address,t_bool)": { - "label": "mapping(address => bool)", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_mapping(t_address,t_bool))": { - "label": "mapping(address => mapping(address => bool))", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_uint256)": { - "label": "mapping(address => uint256)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_address)": { - "label": "mapping(uint256 => address)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_string_storage)": { - "label": "mapping(uint256 => string)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_struct(RoyaltyInfo)3388_storage)": { - "label": "mapping(uint256 => struct ERC2981Upgradeable.RoyaltyInfo)", - "numberOfBytes": "32" - }, - "t_string_storage": { - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(RoyaltyInfo)3388_storage": { - "label": "struct ERC2981Upgradeable.RoyaltyInfo", - "members": [ - { - "label": "receiver", - "type": "t_address", - "offset": 0, - "slot": "0" - }, - { - "label": "royaltyFraction", - "type": "t_uint96", - "offset": 20, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "label": "uint8", - "numberOfBytes": "1" - }, - "t_uint96": { - "label": "uint96", - "numberOfBytes": "12" - } - }, - "namespaces": {} - } - }, - "caae2b04be541e7af7152cadc730e7a92c7370f618e73d7ea77d3edb025863b5": { - "address": "0xb3d9288e2E1AFCD57d0378dBeD84E7998e0467f4", - "txHash": "0x671ffcdec0207548d6f37e36fbef8ee4e717d6dafa944c43f0cfbc89266f7680", - "layout": { - "solcVersion": "0.8.3", - "storage": [ - { - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8", - "contract": "Initializable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\Initializable.sol:62", - "retypedFrom": "bool" - }, - { - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool", - "contract": "Initializable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\Initializable.sol:67" - }, - { - "label": "__gap", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)50_storage", - "contract": "ContextUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\utils\\ContextUpgradeable.sol:36" - }, - { - "label": "_owner", - "offset": 0, - "slot": "51", - "type": "t_address", - "contract": "OwnableUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\access\\OwnableUpgradeable.sol:22" - }, - { - "label": "__gap", - "offset": 0, - "slot": "52", - "type": "t_array(t_uint256)49_storage", - "contract": "OwnableUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\access\\OwnableUpgradeable.sol:94" - }, - { - "label": "_balances", - "offset": 0, - "slot": "101", - "type": "t_mapping(t_address,t_uint256)", - "contract": "ERC20Upgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\ERC20\\ERC20Upgradeable.sol:37" - }, - { - "label": "_allowances", - "offset": 0, - "slot": "102", - "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))", - "contract": "ERC20Upgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\ERC20\\ERC20Upgradeable.sol:39" - }, - { - "label": "_totalSupply", - "offset": 0, - "slot": "103", - "type": "t_uint256", - "contract": "ERC20Upgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\ERC20\\ERC20Upgradeable.sol:41" - }, - { - "label": "_name", - "offset": 0, - "slot": "104", - "type": "t_string_storage", - "contract": "ERC20Upgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\ERC20\\ERC20Upgradeable.sol:43" - }, - { - "label": "_symbol", - "offset": 0, - "slot": "105", - "type": "t_string_storage", - "contract": "ERC20Upgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\ERC20\\ERC20Upgradeable.sol:44" - }, - { - "label": "__gap", - "offset": 0, - "slot": "106", - "type": "t_array(t_uint256)45_storage", - "contract": "ERC20Upgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\ERC20\\ERC20Upgradeable.sol:400" - }, - { - "label": "_paused", - "offset": 0, - "slot": "151", - "type": "t_bool", - "contract": "PausableUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\security\\PausableUpgradeable.sol:29" - }, - { - "label": "__gap", - "offset": 0, - "slot": "152", - "type": "t_array(t_uint256)49_storage", - "contract": "PausableUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\security\\PausableUpgradeable.sol:116" - }, - { - "label": "__gap", - "offset": 0, - "slot": "201", - "type": "t_array(t_uint256)50_storage", - "contract": "ERC20PausableUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\ERC20\\extensions\\ERC20PausableUpgradeable.sol:52" - }, - { - "label": "_accountBalanceSnapshots", - "offset": 0, - "slot": "251", - "type": "t_mapping(t_address,t_struct(Snapshots)1215_storage)", - "contract": "ERC20SnapshotUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\ERC20\\extensions\\ERC20SnapshotUpgradeable.sol:62" - }, - { - "label": "_totalSupplySnapshots", - "offset": 0, - "slot": "252", - "type": "t_struct(Snapshots)1215_storage", - "contract": "ERC20SnapshotUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\ERC20\\extensions\\ERC20SnapshotUpgradeable.sol:63" - }, - { - "label": "_currentSnapshotId", - "offset": 0, - "slot": "254", - "type": "t_struct(Counter)2038_storage", - "contract": "ERC20SnapshotUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\ERC20\\extensions\\ERC20SnapshotUpgradeable.sol:66" - }, - { - "label": "__gap", - "offset": 0, - "slot": "255", - "type": "t_array(t_uint256)46_storage", - "contract": "ERC20SnapshotUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\token\\ERC20\\extensions\\ERC20SnapshotUpgradeable.sol:207" - }, - { - "label": "authorizedToSnapshot", - "offset": 0, - "slot": "301", - "type": "t_mapping(t_address,t_bool)", - "contract": "MeowToken", - "src": "@zero-tech\\ztoken\\contracts\\MeowToken.sol:16" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)45_storage": { - "label": "uint256[45]", - "numberOfBytes": "1440" - }, - "t_array(t_uint256)46_storage": { - "label": "uint256[46]", - "numberOfBytes": "1472" - }, - "t_array(t_uint256)49_storage": { - "label": "uint256[49]", - "numberOfBytes": "1568" - }, - "t_array(t_uint256)50_storage": { - "label": "uint256[50]", - "numberOfBytes": "1600" - }, - "t_array(t_uint256)dyn_storage": { - "label": "uint256[]", - "numberOfBytes": "32" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_address,t_bool)": { - "label": "mapping(address => bool)", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_mapping(t_address,t_uint256))": { - "label": "mapping(address => mapping(address => uint256))", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_struct(Snapshots)1215_storage)": { - "label": "mapping(address => struct ERC20SnapshotUpgradeable.Snapshots)", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_uint256)": { - "label": "mapping(address => uint256)", - "numberOfBytes": "32" - }, - "t_string_storage": { - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(Counter)2038_storage": { - "label": "struct CountersUpgradeable.Counter", - "members": [ - { - "label": "_value", - "type": "t_uint256", - "offset": 0, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_struct(Snapshots)1215_storage": { - "label": "struct ERC20SnapshotUpgradeable.Snapshots", - "members": [ - { - "label": "ids", - "type": "t_array(t_uint256)dyn_storage", - "offset": 0, - "slot": "0" - }, - { - "label": "values", - "type": "t_array(t_uint256)dyn_storage", - "offset": 0, - "slot": "1" - } - ], - "numberOfBytes": "64" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "label": "uint8", - "numberOfBytes": "1" - } - }, - "namespaces": {} - } - }, - "88cc07660fb461a485a68b9fd498ca11a380c1b67bb29625f3d27b2d0bfaa75f": { - "address": "0xD2dbF1FB68D0EC7468783a8FB3f2bf0Cf50dc106", - "txHash": "0xf242b810c3c4a7646ce76f9da68d949d490cc9f214efd16b70f4841aa7ac77c0", - "layout": { - "solcVersion": "0.8.18", - "storage": [ - { - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8", - "contract": "Initializable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\Initializable.sol:62", - "retypedFrom": "bool" - }, - { - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool", - "contract": "Initializable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\Initializable.sol:67" - }, - { - "label": "__gap", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)50_storage", - "contract": "ERC1967UpgradeUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\ERC1967\\ERC1967UpgradeUpgradeable.sol:197" - }, - { - "label": "__gap", - "offset": 0, - "slot": "51", - "type": "t_array(t_uint256)50_storage", - "contract": "UUPSUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\UUPSUpgradeable.sol:107" - }, - { - "label": "accessController", - "offset": 0, - "slot": "101", - "type": "t_contract(IZNSAccessController)9083", - "contract": "AAccessControlled", - "src": "contracts\\access\\AAccessControlled.sol:23" - }, - { - "label": "registry", - "offset": 0, - "slot": "102", - "type": "t_contract(IZNSRegistry)12424", - "contract": "ARegistryWired", - "src": "contracts\\registry\\ARegistryWired.sol:22" - }, - { - "label": "domainAddresses", - "offset": 0, - "slot": "103", - "type": "t_mapping(t_bytes32,t_address)", - "contract": "ZNSAddressResolver", - "src": "contracts\\resolver\\ZNSAddressResolver.sol:26" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)50_storage": { - "label": "uint256[50]", - "numberOfBytes": "1600" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(IZNSAccessController)9083": { - "label": "contract IZNSAccessController", - "numberOfBytes": "20" - }, - "t_contract(IZNSRegistry)12424": { - "label": "contract IZNSRegistry", - "numberOfBytes": "20" - }, - "t_mapping(t_bytes32,t_address)": { - "label": "mapping(bytes32 => address)", - "numberOfBytes": "32" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "label": "uint8", - "numberOfBytes": "1" - } - }, - "namespaces": {} - } - }, - "9667dec4ce0bcd3e65a8a49868b77f27305df9bf2a1ab470048fb39090922d8d": { - "address": "0xA99202D6618DC9C9FEC1beEc986447de02C0C18d", - "txHash": "0xd0e9880afd751a51c8671cd9219ad6095f8dc7f0388105549e5852f62c658ad0", - "layout": { - "solcVersion": "0.8.18", - "storage": [ - { - "label": "accessController", - "offset": 0, - "slot": "0", - "type": "t_contract(IZNSAccessController)9083", - "contract": "AAccessControlled", - "src": "contracts\\access\\AAccessControlled.sol:23" - }, - { - "label": "registry", - "offset": 0, - "slot": "1", - "type": "t_contract(IZNSRegistry)12424", - "contract": "ARegistryWired", - "src": "contracts\\registry\\ARegistryWired.sol:22" - }, - { - "label": "_initialized", - "offset": 20, - "slot": "1", - "type": "t_uint8", - "contract": "Initializable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\Initializable.sol:62", - "retypedFrom": "bool" - }, - { - "label": "_initializing", - "offset": 21, - "slot": "1", - "type": "t_bool", - "contract": "Initializable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\Initializable.sol:67" - }, - { - "label": "__gap", - "offset": 0, - "slot": "2", - "type": "t_array(t_uint256)50_storage", - "contract": "ERC1967UpgradeUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\ERC1967\\ERC1967UpgradeUpgradeable.sol:197" - }, - { - "label": "__gap", - "offset": 0, - "slot": "52", - "type": "t_array(t_uint256)50_storage", - "contract": "UUPSUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\UUPSUpgradeable.sol:107" - }, - { - "label": "priceConfigs", - "offset": 0, - "slot": "102", - "type": "t_mapping(t_bytes32,t_struct(CurvePriceConfig)14276_storage)", - "contract": "ZNSCurvePricer", - "src": "contracts\\price\\ZNSCurvePricer.sol:31" - } - ], - "types": { - "t_array(t_uint256)50_storage": { - "label": "uint256[50]", - "numberOfBytes": "1600" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(IZNSAccessController)9083": { - "label": "contract IZNSAccessController", - "numberOfBytes": "20" - }, - "t_contract(IZNSRegistry)12424": { - "label": "contract IZNSRegistry", - "numberOfBytes": "20" - }, - "t_mapping(t_bytes32,t_struct(CurvePriceConfig)14276_storage)": { - "label": "mapping(bytes32 => struct ICurvePriceConfig.CurvePriceConfig)", - "numberOfBytes": "32" - }, - "t_struct(CurvePriceConfig)14276_storage": { - "label": "struct ICurvePriceConfig.CurvePriceConfig", - "members": [ - { - "label": "maxPrice", - "type": "t_uint256", - "offset": 0, - "slot": "0" - }, - { - "label": "minPrice", - "type": "t_uint256", - "offset": 0, - "slot": "1" - }, - { - "label": "maxLength", - "type": "t_uint256", - "offset": 0, - "slot": "2" - }, - { - "label": "baseLength", - "type": "t_uint256", - "offset": 0, - "slot": "3" - }, - { - "label": "precisionMultiplier", - "type": "t_uint256", - "offset": 0, - "slot": "4" - }, - { - "label": "feePercentage", - "type": "t_uint256", - "offset": 0, - "slot": "5" - }, - { - "label": "isSet", - "type": "t_bool", - "offset": 0, - "slot": "6" - } - ], - "numberOfBytes": "224" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "label": "uint8", - "numberOfBytes": "1" - } - }, - "namespaces": {} - } - }, - "20272ca8e56af220e6f51844417eb00597b2d56ba6aba437bb507c4b6bc34c26": { - "address": "0x7697a7Ac78E98732a33cc05A5f68CFCA80F1152A", - "txHash": "0x374e45425c4b6f299f8c7add049b5028f3269641475ed91330d2ece4d6062889", - "layout": { - "solcVersion": "0.8.18", - "storage": [ - { - "label": "accessController", - "offset": 0, - "slot": "0", - "type": "t_contract(IZNSAccessController)9083", - "contract": "AAccessControlled", - "src": "contracts\\access\\AAccessControlled.sol:23" - }, - { - "label": "registry", - "offset": 0, - "slot": "1", - "type": "t_contract(IZNSRegistry)12424", - "contract": "ARegistryWired", - "src": "contracts\\registry\\ARegistryWired.sol:22" - }, - { - "label": "_initialized", - "offset": 20, - "slot": "1", - "type": "t_uint8", - "contract": "Initializable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\Initializable.sol:62", - "retypedFrom": "bool" - }, - { - "label": "_initializing", - "offset": 21, - "slot": "1", - "type": "t_bool", - "contract": "Initializable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\Initializable.sol:67" - }, - { - "label": "__gap", - "offset": 0, - "slot": "2", - "type": "t_array(t_uint256)50_storage", - "contract": "ERC1967UpgradeUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\ERC1967\\ERC1967UpgradeUpgradeable.sol:197" - }, - { - "label": "__gap", - "offset": 0, - "slot": "52", - "type": "t_array(t_uint256)50_storage", - "contract": "UUPSUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\UUPSUpgradeable.sol:107" - }, - { - "label": "paymentConfigs", - "offset": 0, - "slot": "102", - "type": "t_mapping(t_bytes32,t_struct(PaymentConfig)13601_storage)", - "contract": "ZNSTreasury", - "src": "contracts\\treasury\\ZNSTreasury.sol:28" - }, - { - "label": "stakedForDomain", - "offset": 0, - "slot": "103", - "type": "t_mapping(t_bytes32,t_struct(Stake)13608_storage)", - "contract": "ZNSTreasury", - "src": "contracts\\treasury\\ZNSTreasury.sol:38" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)50_storage": { - "label": "uint256[50]", - "numberOfBytes": "1600" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(IERC20)7100": { - "label": "contract IERC20", - "numberOfBytes": "20" - }, - "t_contract(IZNSAccessController)9083": { - "label": "contract IZNSAccessController", - "numberOfBytes": "20" - }, - "t_contract(IZNSRegistry)12424": { - "label": "contract IZNSRegistry", - "numberOfBytes": "20" - }, - "t_mapping(t_bytes32,t_struct(PaymentConfig)13601_storage)": { - "label": "mapping(bytes32 => struct PaymentConfig)", - "numberOfBytes": "32" - }, - "t_mapping(t_bytes32,t_struct(Stake)13608_storage)": { - "label": "mapping(bytes32 => struct IZNSTreasury.Stake)", - "numberOfBytes": "32" - }, - "t_struct(PaymentConfig)13601_storage": { - "label": "struct PaymentConfig", - "members": [ - { - "label": "token", - "type": "t_contract(IERC20)7100", - "offset": 0, - "slot": "0" - }, - { - "label": "beneficiary", - "type": "t_address", - "offset": 0, - "slot": "1" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Stake)13608_storage": { - "label": "struct IZNSTreasury.Stake", - "members": [ - { - "label": "token", - "type": "t_contract(IERC20)7100", - "offset": 0, - "slot": "0" - }, - { - "label": "amount", - "type": "t_uint256", - "offset": 0, - "slot": "1" - } - ], - "numberOfBytes": "64" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "label": "uint8", - "numberOfBytes": "1" - } - }, - "namespaces": {} - } - }, - "5677da637cf218b4cd99a1ba4f15051b0e4f851346d62a99f6932b01bdb12add": { - "address": "0xE517aC1657b1d4159653d2be96E1011F29AFD3C7", - "txHash": "0x19193ae01eb44039d5390cb11f3e04eb4a1edacbe68f6f9f7b6f58f6969ed9f8", - "layout": { - "solcVersion": "0.8.18", - "storage": [ - { - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8", - "contract": "Initializable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\Initializable.sol:62", - "retypedFrom": "bool" - }, - { - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool", - "contract": "Initializable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\Initializable.sol:67" - }, - { - "label": "__gap", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)50_storage", - "contract": "ERC1967UpgradeUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\ERC1967\\ERC1967UpgradeUpgradeable.sol:197" - }, - { - "label": "__gap", - "offset": 0, - "slot": "51", - "type": "t_array(t_uint256)50_storage", - "contract": "UUPSUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\UUPSUpgradeable.sol:107" - }, - { - "label": "accessController", - "offset": 0, - "slot": "101", - "type": "t_contract(IZNSAccessController)9083", - "contract": "AAccessControlled", - "src": "contracts\\access\\AAccessControlled.sol:23" - }, - { - "label": "registry", - "offset": 0, - "slot": "102", - "type": "t_contract(IZNSRegistry)12424", - "contract": "ARegistryWired", - "src": "contracts\\registry\\ARegistryWired.sol:22" - }, - { - "label": "rootPricer", - "offset": 0, - "slot": "103", - "type": "t_contract(IZNSPricer)14340", - "contract": "ZNSRootRegistrar", - "src": "contracts\\registrar\\ZNSRootRegistrar.sol:36" - }, - { - "label": "treasury", - "offset": 0, - "slot": "104", - "type": "t_contract(IZNSTreasury)13764", - "contract": "ZNSRootRegistrar", - "src": "contracts\\registrar\\ZNSRootRegistrar.sol:37" - }, - { - "label": "domainToken", - "offset": 0, - "slot": "105", - "type": "t_contract(IZNSDomainToken)13254", - "contract": "ZNSRootRegistrar", - "src": "contracts\\registrar\\ZNSRootRegistrar.sol:38" - }, - { - "label": "subRegistrar", - "offset": 0, - "slot": "106", - "type": "t_contract(IZNSSubRegistrar)10830", - "contract": "ZNSRootRegistrar", - "src": "contracts\\registrar\\ZNSRootRegistrar.sol:39" - } - ], - "types": { - "t_array(t_uint256)50_storage": { - "label": "uint256[50]", - "numberOfBytes": "1600" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_contract(IZNSAccessController)9083": { - "label": "contract IZNSAccessController", - "numberOfBytes": "20" - }, - "t_contract(IZNSDomainToken)13254": { - "label": "contract IZNSDomainToken", - "numberOfBytes": "20" - }, - "t_contract(IZNSPricer)14340": { - "label": "contract IZNSPricer", - "numberOfBytes": "20" - }, - "t_contract(IZNSRegistry)12424": { - "label": "contract IZNSRegistry", - "numberOfBytes": "20" - }, - "t_contract(IZNSSubRegistrar)10830": { - "label": "contract IZNSSubRegistrar", - "numberOfBytes": "20" - }, - "t_contract(IZNSTreasury)13764": { - "label": "contract IZNSTreasury", - "numberOfBytes": "20" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "label": "uint8", - "numberOfBytes": "1" - } - }, - "namespaces": {} - } - }, - "dc02c2915ba6814cf6740bfd304621905cde4ab9ab9696413aa8cd2dd1db8456": { - "address": "0x444462c2BD865c5248D967c3020bABbc6EEd5CCF", - "txHash": "0x8eefd897cc75f3140a4f0b0a34c1bbf68d2ab54f4d1cf83c6b610a280a002c9d", - "layout": { - "solcVersion": "0.8.18", - "storage": [ - { - "label": "accessController", - "offset": 0, - "slot": "0", - "type": "t_contract(IZNSAccessController)9083", - "contract": "AAccessControlled", - "src": "contracts\\access\\AAccessControlled.sol:23" - }, - { - "label": "registry", - "offset": 0, - "slot": "1", - "type": "t_contract(IZNSRegistry)12424", - "contract": "ARegistryWired", - "src": "contracts\\registry\\ARegistryWired.sol:22" - }, - { - "label": "_initialized", - "offset": 20, - "slot": "1", - "type": "t_uint8", - "contract": "Initializable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\Initializable.sol:62", - "retypedFrom": "bool" - }, - { - "label": "_initializing", - "offset": 21, - "slot": "1", - "type": "t_bool", - "contract": "Initializable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\Initializable.sol:67" - }, - { - "label": "__gap", - "offset": 0, - "slot": "2", - "type": "t_array(t_uint256)50_storage", - "contract": "ERC1967UpgradeUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\ERC1967\\ERC1967UpgradeUpgradeable.sol:197" - }, - { - "label": "__gap", - "offset": 0, - "slot": "52", - "type": "t_array(t_uint256)50_storage", - "contract": "UUPSUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\UUPSUpgradeable.sol:107" - }, - { - "label": "priceConfigs", - "offset": 0, - "slot": "102", - "type": "t_mapping(t_bytes32,t_struct(PriceConfig)9536_storage)", - "contract": "ZNSFixedPricer", - "src": "contracts\\price\\ZNSFixedPricer.sol:23" - } - ], - "types": { - "t_array(t_uint256)50_storage": { - "label": "uint256[50]", - "numberOfBytes": "1600" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(IZNSAccessController)9083": { - "label": "contract IZNSAccessController", - "numberOfBytes": "20" - }, - "t_contract(IZNSRegistry)12424": { - "label": "contract IZNSRegistry", - "numberOfBytes": "20" - }, - "t_mapping(t_bytes32,t_struct(PriceConfig)9536_storage)": { - "label": "mapping(bytes32 => struct IZNSFixedPricer.PriceConfig)", - "numberOfBytes": "32" - }, - "t_struct(PriceConfig)9536_storage": { - "label": "struct IZNSFixedPricer.PriceConfig", - "members": [ - { - "label": "price", - "type": "t_uint256", - "offset": 0, - "slot": "0" - }, - { - "label": "feePercentage", - "type": "t_uint256", - "offset": 0, - "slot": "1" - }, - { - "label": "isSet", - "type": "t_bool", - "offset": 0, - "slot": "2" - } - ], - "numberOfBytes": "96" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "label": "uint8", - "numberOfBytes": "1" - } - }, - "namespaces": {} - } - }, - "286213230d48e028ce7ee77c0fdab611484c81ea01ce1c6a86c9d69f7c13b590": { - "address": "0x435E763E53F26c2EaD8667D4243528BE124ED52c", - "txHash": "0x5f9ec4a8318cbeaabd148625ebd7bbc92d73f25dc282da85888acfd384046cd0", - "layout": { - "solcVersion": "0.8.18", - "storage": [ - { - "label": "accessController", - "offset": 0, - "slot": "0", - "type": "t_contract(IZNSAccessController)9083", - "contract": "AAccessControlled", - "src": "contracts\\access\\AAccessControlled.sol:23" - }, - { - "label": "registry", - "offset": 0, - "slot": "1", - "type": "t_contract(IZNSRegistry)12424", - "contract": "ARegistryWired", - "src": "contracts\\registry\\ARegistryWired.sol:22" - }, - { - "label": "_initialized", - "offset": 20, - "slot": "1", - "type": "t_uint8", - "contract": "Initializable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\Initializable.sol:62", - "retypedFrom": "bool" - }, - { - "label": "_initializing", - "offset": 21, - "slot": "1", - "type": "t_bool", - "contract": "Initializable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\Initializable.sol:67" - }, - { - "label": "__gap", - "offset": 0, - "slot": "2", - "type": "t_array(t_uint256)50_storage", - "contract": "ERC1967UpgradeUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\ERC1967\\ERC1967UpgradeUpgradeable.sol:197" - }, - { - "label": "__gap", - "offset": 0, - "slot": "52", - "type": "t_array(t_uint256)50_storage", - "contract": "UUPSUpgradeable", - "src": "@openzeppelin\\contracts-upgradeable\\proxy\\utils\\UUPSUpgradeable.sol:107" - }, - { - "label": "rootRegistrar", - "offset": 0, - "slot": "102", - "type": "t_contract(IZNSRootRegistrar)10643", - "contract": "ZNSSubRegistrar", - "src": "contracts\\registrar\\ZNSSubRegistrar.sol:25" - }, - { - "label": "distrConfigs", - "offset": 0, - "slot": "103", - "type": "t_mapping(t_bytes32,t_struct(DistributionConfig)14299_storage)", - "contract": "ZNSSubRegistrar", - "src": "contracts\\registrar\\ZNSSubRegistrar.sol:32" - }, - { - "label": "mintlist", - "offset": 0, - "slot": "104", - "type": "t_mapping(t_bytes32,t_struct(Mintlist)11572_storage)", - "contract": "ZNSSubRegistrar", - "src": "contracts\\registrar\\ZNSSubRegistrar.sol:44" - } - ], - "types": { - "t_address": { - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)50_storage": { - "label": "uint256[50]", - "numberOfBytes": "1600" - }, - "t_bool": { - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(IZNSAccessController)9083": { - "label": "contract IZNSAccessController", - "numberOfBytes": "20" - }, - "t_contract(IZNSPricer)14340": { - "label": "contract IZNSPricer", - "numberOfBytes": "20" - }, - "t_contract(IZNSRegistry)12424": { - "label": "contract IZNSRegistry", - "numberOfBytes": "20" - }, - "t_contract(IZNSRootRegistrar)10643": { - "label": "contract IZNSRootRegistrar", - "numberOfBytes": "20" - }, - "t_enum(AccessType)14286": { - "label": "enum IDistributionConfig.AccessType", - "members": [ - "LOCKED", - "OPEN", - "MINTLIST" - ], - "numberOfBytes": "1" - }, - "t_enum(PaymentType)14289": { - "label": "enum IDistributionConfig.PaymentType", - "members": [ - "DIRECT", - "STAKE" - ], - "numberOfBytes": "1" - }, - "t_mapping(t_address,t_bool)": { - "label": "mapping(address => bool)", - "numberOfBytes": "32" - }, - "t_mapping(t_bytes32,t_struct(DistributionConfig)14299_storage)": { - "label": "mapping(bytes32 => struct IDistributionConfig.DistributionConfig)", - "numberOfBytes": "32" - }, - "t_mapping(t_bytes32,t_struct(Mintlist)11572_storage)": { - "label": "mapping(bytes32 => struct ZNSSubRegistrar.Mintlist)", - "numberOfBytes": "32" - }, - "t_mapping(t_uint256,t_mapping(t_address,t_bool))": { - "label": "mapping(uint256 => mapping(address => bool))", - "numberOfBytes": "32" - }, - "t_struct(DistributionConfig)14299_storage": { - "label": "struct IDistributionConfig.DistributionConfig", - "members": [ - { - "label": "pricerContract", - "type": "t_contract(IZNSPricer)14340", - "offset": 0, - "slot": "0" - }, - { - "label": "paymentType", - "type": "t_enum(PaymentType)14289", - "offset": 20, - "slot": "0" - }, - { - "label": "accessType", - "type": "t_enum(AccessType)14286", - "offset": 21, - "slot": "0" - } - ], - "numberOfBytes": "32" - }, - "t_struct(Mintlist)11572_storage": { - "label": "struct ZNSSubRegistrar.Mintlist", - "members": [ - { - "label": "list", - "type": "t_mapping(t_uint256,t_mapping(t_address,t_bool))", - "offset": 0, - "slot": "0" - }, - { - "label": "ownerIndex", - "type": "t_uint256", - "offset": 0, - "slot": "1" - } - ], - "numberOfBytes": "64" - }, - "t_uint256": { - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "label": "uint8", - "numberOfBytes": "1" - } - }, - "namespaces": {} - } - } - } -} diff --git a/contracts/token/mocks/MeowTokenMock.sol b/contracts/token/mocks/MeowTokenMock.sol index 7224d2ff0..7465f6a21 100644 --- a/contracts/token/mocks/MeowTokenMock.sol +++ b/contracts/token/mocks/MeowTokenMock.sol @@ -3,6 +3,7 @@ pragma solidity 0.8.3; import { MeowToken } from "@zero-tech/ztoken/contracts/MeowToken.sol"; +import { MeowTokenTest } from "@zero-tech/ztoken/contracts/MeowTokenTest.sol"; contract MeowTokenMock is MeowToken { diff --git a/hardhat.config.ts b/hardhat.config.ts index bb4eda5aa..3259b20ae 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -6,8 +6,9 @@ require("dotenv").config(); import * as tenderly from "@tenderly/hardhat-tenderly"; import "@nomicfoundation/hardhat-toolbox"; -import "@nomiclabs/hardhat-ethers"; -import "@nomicfoundation/hardhat-network-helpers"; +import "@nomicfoundation/hardhat-ethers"; +import "@nomicfoundation/hardhat-verify"; +import "@nomicfoundation/hardhat-toolbox/network-helpers"; import "@nomicfoundation/hardhat-chai-matchers"; import "@openzeppelin/hardhat-upgrades"; import "solidity-coverage"; @@ -36,7 +37,7 @@ subtask(TASK_TEST_RUN_MOCHA_TESTS) // keep it commented out and uncomment when using DevNet // locally. // !!! Uncomment this when using Tenderly !!! -// tenderly.setup({ automaticVerifications: false }); +tenderly.setup({ automaticVerifications: false }); const config : HardhatUserConfig = { solidity: { @@ -107,7 +108,13 @@ const config : HardhatUserConfig = { // accounts: [ // Comment out for CI, uncomment this when using Sepolia // `${process.env.TESTNET_PRIVATE_KEY_A}`, // `${process.env.TESTNET_PRIVATE_KEY_B}`, - // ] + // `${process.env.TESTNET_PRIVATE_KEY_C}`, + // `${process.env.TESTNET_PRIVATE_KEY_D}`, + // `${process.env.TESTNET_PRIVATE_KEY_E}`, + // `${process.env.TESTNET_PRIVATE_KEY_F}`, + // ], + // // Must have to avoid instead failing as `invalid length for result data` error + // throwOnCallFailures: false, // not sure if this even works }, devnet: { // Add current URL that you spawned if not using automated spawning @@ -115,9 +122,18 @@ const config : HardhatUserConfig = { chainId: 1, }, }, + defender: { + useDefenderDeploy: false, + apiKey: `${process.env.DEFENDER_KEY}`, + apiSecret: `${process.env.DEFENDER_SECRET}`, + }, etherscan: { apiKey: `${process.env.ETHERSCAN_API_KEY}`, }, + sourcify: { + // If set to "true", will try to verify the contracts after deployment + enabled: false, + }, tenderly: { project: `${process.env.TENDERLY_PROJECT_SLUG}`, username: `${process.env.TENDERLY_ACCOUNT_ID}`, diff --git a/package.json b/package.json index 7ac258ba7..9c5787107 100644 --- a/package.json +++ b/package.json @@ -1,81 +1,82 @@ -{ - "name": "@zero-tech/zns-contracts", - "version": "0.7.0", - "description": "Zero Name Service Smart Contracts", - "author": "Zero CPT", - "license": "ISC", - "repository": "https://github.com/zer0-os/zNS.git", - "engines": { - "node": ">=18", - "npm": ">=9" - }, - "scripts": { - "compile": "hardhat compile", - "lint-sol": "yarn solhint ./contracts/**/*.sol", - "lint-ts": "yarn eslint ./test/** ./src/**", - "lint": "yarn lint-sol & yarn lint-ts --no-error-on-unmatched-pattern", - "clean": "hardhat clean", - "build": "yarn run clean && yarn run compile", - "postbuild": "yarn save-tag", - "typechain": "hardhat typechain", - "pretest": "yarn mongo:start", - "test": "hardhat test", - "test-local": "yarn test", - "posttest": "yarn mongo:stop", - "semantic-release": "semantic-release --tag-format='v${version}-dev'", - "coverage": "hardhat coverage", - "check-coverage": "istanbul check-coverage --statements 90 --branches 87 --functions 89 --lines 90", - "devnet": "ts-node src/tenderly/devnet/devnet-execute.ts", - "gas-cost": "ts-node src/utils/gas-costs.ts", - "docgen": "hardhat docgen", - "save-tag": "chmod a+x ./src/utils/git-tag/save-tag.sh && bash ./src/utils/git-tag/save-tag.sh", - "mongo:start": "docker-compose up -d", - "mongo:stop": "docker-compose stop", - "mongo:down": "docker-compose down", - "mongo:drop": "ts-node src/utils/drop-db.ts" - }, - "pre-commit": [ - "lint" - ], - "devDependencies": { - "@ensdomains/ensjs": "2.1.0", - "@ethersproject/providers": "5.7.2", - "@nomicfoundation/hardhat-chai-matchers": "1.0.6", - "@nomicfoundation/hardhat-network-helpers": "^1.0.8", - "@nomicfoundation/hardhat-toolbox": "2.0.2", - "@nomiclabs/hardhat-ethers": "2.2.2", - "@nomiclabs/hardhat-etherscan": "3.1.7", - "@openzeppelin/contracts": "4.9.3", - "@openzeppelin/contracts-400": "npm:@openzeppelin/contracts@4.0.0", - "@openzeppelin/contracts-upgradeable": "4.9.3", - "@openzeppelin/contracts-upgradeable-400": "npm:@openzeppelin/contracts-upgradeable@4.0.0", - "@openzeppelin/hardhat-upgrades": "1.26.0", - "@semantic-release/git": "^10.0.1", - "@tenderly/hardhat-tenderly": "^1.7.4", - "@typechain/ethers-v5": "10.1.0", - "@typechain/hardhat": "6.1.2", - "@types/chai": "4.2.0", - "@types/mocha": "9.1.0", - "@types/node": "^18.15.11", - "@zero-tech/eslint-config-cpt": "0.2.7", - "@zero-tech/ztoken": "2.0.0", - "chai": "4.2.0", - "eslint": "^8.37.0", - "ethers": "5.5.1", - "hardhat": "2.13.0", - "hardhat-gas-reporter": "1.0.8", - "semantic-release": "^21.0.1", - "solhint": "4.0.0", - "solidity-coverage": "^0.8.2", - "solidity-docgen": "^0.6.0-beta.35", - "ts-node": "10.9.1", - "typechain": "8.1.0", - "typescript": "^5.0.2" - }, - "dependencies": { - "axios": "^1.4.0", - "dotenv": "16.0.3", - "mongodb": "^6.1.0", - "winston": "^3.11.0" - } -} +{ + "name": "@zero-tech/zns-contracts", + "version": "0.7.0", + "description": "Zero Name Service Smart Contracts", + "author": "Zero CPT", + "license": "ISC", + "repository": "https://github.com/zer0-os/zNS.git", + "engines": { + "node": ">=18", + "npm": ">=9" + }, + "scripts": { + "compile": "hardhat compile", + "lint-sol": "yarn solhint ./contracts/**/*.sol", + "lint-ts": "yarn eslint ./test/** ./src/**", + "lint": "yarn lint-sol & yarn lint-ts --no-error-on-unmatched-pattern", + "clean": "hardhat clean", + "build": "yarn run clean && yarn run compile", + "postbuild": "yarn save-tag", + "typechain": "hardhat typechain", + "pretest": "yarn mongo:start", + "test": "hardhat test", + "test-local": "yarn test", + "posttest": "yarn mongo:stop", + "semantic-release": "semantic-release --tag-format='v${version}-dev'", + "coverage": "hardhat coverage", + "check-coverage": "istanbul check-coverage --statements 90 --branches 87 --functions 89 --lines 90", + "devnet": "ts-node src/tenderly/devnet/devnet-execute.ts", + "gas-cost": "ts-node src/utils/gas-costs.ts", + "docgen": "hardhat docgen", + "save-tag": "chmod a+x ./src/utils/git-tag/save-tag.sh && bash ./src/utils/git-tag/save-tag.sh", + "mongo:start": "docker-compose up -d", + "mongo:stop": "docker-compose stop", + "mongo:down": "docker-compose down", + "mongo:drop": "ts-node src/utils/drop-db.ts", + "run-sepolia": "hardhat run src/deploy/run-campaign.ts --network sepolia" + }, + "pre-commit": [ + "lint" + ], + "devDependencies": { + "@ensdomains/ensjs": "2.1.0", + "@nomicfoundation/hardhat-chai-matchers": "^2.0.2", + "@nomicfoundation/hardhat-ethers": "^3.0.5", + "@nomicfoundation/hardhat-network-helpers": "^1.0.9", + "@nomicfoundation/hardhat-toolbox": "^4.0.0", + "@nomicfoundation/hardhat-verify": "^2.0.0", + "@openzeppelin/contracts": "4.9.3", + "@openzeppelin/contracts-400": "npm:@openzeppelin/contracts@4.0.0", + "@openzeppelin/contracts-upgradeable": "4.9.3", + "@openzeppelin/contracts-upgradeable-400": "npm:@openzeppelin/contracts-upgradeable@4.0.0", + "@openzeppelin/defender-sdk": "^1.7.0", + "@openzeppelin/hardhat-upgrades": "2.4.3", + "@semantic-release/git": "^10.0.1", + "@tenderly/hardhat-tenderly": "^2.0.1", + "@typechain/ethers-v6": "^0.5.1", + "@typechain/hardhat": "^9.1.0", + "@types/chai": "^4.3.11", + "@types/mocha": "^9.1.0", + "@types/node": "^18.15.11", + "@zero-tech/eslint-config-cpt": "0.2.7", + "@zero-tech/ztoken": "2.0.0", + "chai": "^4.3.10", + "eslint": "^8.37.0", + "ethers": "^6.9.0", + "hardhat": "^2.19.1", + "hardhat-gas-reporter": "^1.0.9", + "semantic-release": "^21.0.1", + "solhint": "^4.0.0", + "solidity-coverage": "^0.8.5", + "solidity-docgen": "^0.6.0-beta.36", + "ts-node": "10.9.1", + "typechain": "^8.3.2", + "typescript": "^5.0.2" + }, + "dependencies": { + "axios": "^1.4.0", + "dotenv": "16.0.3", + "mongodb": "^6.1.0", + "winston": "^3.11.0" + } +} diff --git a/src/deploy/campaign/deploy-campaign.ts b/src/deploy/campaign/deploy-campaign.ts index 90750cf06..24e26c2d8 100644 --- a/src/deploy/campaign/deploy-campaign.ts +++ b/src/deploy/campaign/deploy-campaign.ts @@ -5,13 +5,12 @@ import { TLogger, IMissionInstances, TZNSContractState, + ContractV6, } from "./types"; import { HardhatDeployer } from "../deployer/hardhat-deployer"; -import { TDeployMissionCtor } from "../missions/types"; +import { ITenderlyContractData, TDeployMissionCtor } from "../missions/types"; import { BaseDeployMission } from "../missions/base-deploy-mission"; -import { Contract } from "ethers"; import { MongoDBAdapter } from "../db/mongo-adapter/mongo-adapter"; -import { ContractByName } from "@tenderly/hardhat-tenderly/dist/tenderly/types"; export class DeployCampaign { @@ -20,7 +19,6 @@ export class DeployCampaign { dbAdapter : MongoDBAdapter; logger : TLogger; config : IDeployCampaignConfig; - version : string; // TODO dep: improve typing here so that methods of each contract type are resolved in Mission classes! // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -56,7 +54,6 @@ export class DeployCampaign { this.dbAdapter = dbAdapter; this.logger = logger; this.config = config; - this.version = Date.now().toString(); const campaignProxy = new Proxy(this, DeployCampaign.indexedHandler); @@ -105,7 +102,7 @@ export class DeployCampaign { this.logger.info("Deploy Campaign execution finished successfully."); } - updateStateContract (instanceName : string, contractName : string, contract : Contract) { + updateStateContract (instanceName : string, contractName : string, contract : ContractV6) { this.state.contracts[instanceName] = contract; this.logger.debug(`Data of deployed contract '${contractName}' is added to Campaign state at '${instanceName}'.`); } @@ -128,9 +125,9 @@ export class DeployCampaign { const contracts = await Object.values(this.state.instances).reduce( async ( - acc : Promise>, + acc : Promise>, missionInstance : BaseDeployMission, - ) : Promise> => { + ) : Promise> => { const newAcc = await acc; const data = await missionInstance.getMonitoringData(); @@ -139,8 +136,18 @@ export class DeployCampaign { Promise.resolve([]) ); - await this.deployer.tenderlyVerify(contracts); + try { + const response = await this.deployer.tenderlyPush(contracts); + this.logger.info( + `Tenderly push finished successfully for Project ${this.config.postDeploy.tenderlyProjectSlug} + with data: ${JSON.stringify(response, null, "\t")}` + ); + /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ + } catch (e : any) { + this.logger.error("Tenderly push failed."); + this.logger.error(e.message); + this.logger.debug("Continuing..."); + } - this.logger.info(`Tenderly push finished successfully for Project ${this.config.postDeploy.tenderlyProjectSlug}.`); } } diff --git a/src/deploy/campaign/environments.ts b/src/deploy/campaign/environments.ts index 25b6c1084..a389e48dd 100644 --- a/src/deploy/campaign/environments.ts +++ b/src/deploy/campaign/environments.ts @@ -1,8 +1,8 @@ -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { HardhatEthersSigner, SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { IDeployCampaignConfig } from "./types"; import { - DEFAULT_REGISTRATION_FEE_PERCENT, + DEFAULT_PROTOCOL_FEE_PERCENT, DEFAULT_ROYALTY_FRACTION, ZNS_DOMAIN_TOKEN_NAME, ZNS_DOMAIN_TOKEN_SYMBOL, @@ -14,16 +14,19 @@ import { STAKING_TOKEN_ERR, INVALID_CURVE_ERR, MONGO_URI_ERR, - INVALID_ENV_ERR, + INVALID_ENV_ERR, NO_ZERO_VAULT_ERR, } from "../../../test/helpers"; import { ethers } from "ethers"; import { ICurvePriceConfig } from "../missions/types"; import { DEFAULT_MONGO_URI } from "../db/mongo-adapter/constants"; import { MeowMainnet } from "../missions/contracts/meow-token/mainnet-data"; +import { DefenderRelaySigner } from "@openzeppelin/defender-sdk-relay-signer-client/lib/ethers"; +import env from "hardhat"; + const getCustomAddresses = ( key : string, - account : SignerWithAddress, + deployerAddress : string, accounts ?: Array ) => { const addresses = []; @@ -40,110 +43,93 @@ const getCustomAddresses = ( } } - if (addresses.length === 0) { - if (accounts && accounts.length > 0) { - addresses.push(...accounts); // The user provided custom governors / admins as a param for testing - } else { - addresses.push(account.address); // No custom governors / admins provided, use the deployer as the default - } + if (accounts && accounts.length > 0) { + addresses.push(...accounts); // The user provided custom governors / admins as a param for testing } + + if (!addresses.includes(deployerAddress)) { + // No custom governors / admins provided, use the deployer as the default + addresses.push(deployerAddress); + } + + return addresses; }; // This function builds a config with default values but overrides them with any values that are set -export const getConfig = ( - account : SignerWithAddress, - zeroVault : SignerWithAddress, - governors ?: Array, - admins ?: Array, -) : IDeployCampaignConfig => { - // Price config variables - const maxPrice = - process.env.MAX_PRICE - ? ethers.utils.parseEther(process.env.MAX_PRICE) - : DEFAULT_PRICE_CONFIG.maxPrice; - - const minPrice = - process.env.MIN_PRICE - ? ethers.utils.parseEther(process.env.MIN_PRICE) - : DEFAULT_PRICE_CONFIG.minPrice; +export const getConfig = async ({ + deployer, + governors, + admins, + zeroVaultAddress, + env, // this is ONLY used for tests! +} : { + deployer : SignerWithAddress | DefenderRelaySigner; + governors ?: Array; + admins ?: Array; + zeroVaultAddress ?: string; + env ?: string; +}) : Promise => { + // Will throw an error based on any invalid setup, given the `ENV_LEVEL` set + const priceConfig = validateEnv(env); - const maxLength = - process.env.MAX_LENGTH - ? ethers.BigNumber.from(process.env.MAX_LENGTH) - : DEFAULT_PRICE_CONFIG.maxLength; + let deployerAddress; + if (deployer && Object.keys(deployer).includes("address")) { + deployerAddress = (deployer as HardhatEthersSigner).address; + } else { + deployerAddress = await deployer.getAddress(); + } - const baseLength = - process.env.BASE_LENGTH - ? ethers.BigNumber.from(process.env.BASE_LENGTH) - : DEFAULT_PRICE_CONFIG.baseLength; + if (process.env.ENV_LEVEL === "dev") { + requires(!!zeroVaultAddress, "Must pass `zeroVaultAddress` to `getConfig()` for `dev` environment"); + } - const decimals = process.env.DECIMALS ? ethers.BigNumber.from(process.env.DECIMALS) : DEFAULT_DECIMALS; - const precision = process.env.PRECISION ? ethers.BigNumber.from(process.env.PRECISION) : DECAULT_PRECISION; - const precisionMultiplier = ethers.BigNumber.from(10).pow(decimals.sub(precision)); + const zeroVaultAddressConf = process.env.ENV_LEVEL === "dev" + ? zeroVaultAddress! + : process.env.ZERO_VAULT_ADDRESS!; - const feePercentage = - process.env.REG_FEE_PERCENT - ? ethers.BigNumber.from(process.env.REG_FEE_PERCENT) - : DEFAULT_REGISTRATION_FEE_PERCENT; - const royaltyReceiver = - process.env.ROYALTY_RECEIVER - ? process.env.ROYALTY_RECEIVER - : account.address; + // Domain Token Values + const royaltyReceiver = process.env.ENV_LEVEL !== "dev" ? process.env.ROYALTY_RECEIVER! : zeroVaultAddressConf; const royaltyFraction = process.env.ROYALTY_FRACTION - ? ethers.BigNumber.from(process.env.ROYALTY_FRACTION) + ? BigInt(process.env.ROYALTY_FRACTION) : DEFAULT_ROYALTY_FRACTION; - const priceConfig : ICurvePriceConfig = { - maxPrice, - minPrice, - maxLength, - baseLength, - precisionMultiplier, - feePercentage, - isSet: true, - }; - // Get governor addresses set through env, if any - const governorAddresses = getCustomAddresses("GOVERNOR_ADDRESSES", account, governors); + const governorAddresses = getCustomAddresses("GOVERNOR_ADDRESSES", deployerAddress, governors); // Get admin addresses set through env, if any - const adminAddresses = getCustomAddresses("ADMIN_ADDRESSES", account, admins); + const adminAddresses = getCustomAddresses("ADMIN_ADDRESSES", deployerAddress, admins); const config : IDeployCampaignConfig = { - deployAdmin: account, + env: process.env.ENV_LEVEL!, + deployAdmin: deployer, governorAddresses, adminAddresses, domainToken: { - name: process.env.TOKEN_NAME ? process.env.TOKEN_NAME : ZNS_DOMAIN_TOKEN_NAME, - symbol: process.env.TOKEN_SYMBOL ? process.env.TOKEN_SYMBOL : ZNS_DOMAIN_TOKEN_SYMBOL, + name: process.env.DOMAIN_TOKEN_NAME ? process.env.DOMAIN_TOKEN_NAME : ZNS_DOMAIN_TOKEN_NAME, + symbol: process.env.DOMAIN_TOKEN_SYMBOL ? process.env.DOMAIN_TOKEN_SYMBOL : ZNS_DOMAIN_TOKEN_SYMBOL, defaultRoyaltyReceiver: royaltyReceiver, defaultRoyaltyFraction: royaltyFraction, }, rootPriceConfig: priceConfig, - zeroVaultAddress: process.env.ZERO_VAULT_ADDRESS ? process.env.ZERO_VAULT_ADDRESS : zeroVault.address, - mockMeowToken: process.env.MOCK_MEOW_TOKEN ? !!process.env.MOCK_MEOW_TOKEN : true, - stakingTokenAddress: process.env.STAKING_TOKEN_ADDRESS ? process.env.STAKING_TOKEN_ADDRESS : MeowMainnet.address, + zeroVaultAddress: zeroVaultAddressConf, + mockMeowToken: process.env.MOCK_MEOW_TOKEN === "true", + stakingTokenAddress: process.env.STAKING_TOKEN_ADDRESS!, postDeploy: { - tenderlyProjectSlug: process.env.TENDERLY_PROJECT_SLUG ? process.env.TENDERLY_PROJECT_SLUG : "", + tenderlyProjectSlug: process.env.TENDERLY_PROJECT_SLUG!, monitorContracts: process.env.MONITOR_CONTRACTS === "true", verifyContracts: process.env.VERIFY_CONTRACTS === "true", }, }; - // Will throw an error based on any invalid setup, given the `ENV_LEVEL` set - validate(config); - return config; }; // For testing the behaviour when we manipulate, we have an optional "env" string param -export const validate = ( - config : IDeployCampaignConfig, - env ?: string, - mongoUri ?: string -) => { +export const validateEnv = ( + env ?: string, // this is ONLY used for tests! +) : ICurvePriceConfig => { // Prioritize reading from the env variable first, and only then fallback to the param let envLevel = process.env.ENV_LEVEL; @@ -154,30 +140,114 @@ export const validate = ( envLevel = env; } - if (envLevel === "dev") return; // No validation needed for dev - - if (!mongoUri) mongoUri = process.env.MONGO_URI ? process.env.MONGO_URI : DEFAULT_MONGO_URI; + // Validate price config first since we have to return it + const priceConfig = getValidateRootPriceConfig(); - // Mainnet or testnet - if (envLevel === "prod" || envLevel === "test") { - requires(!config.mockMeowToken, NO_MOCK_PROD_ERR); - requires(config.stakingTokenAddress === MeowMainnet.address, STAKING_TOKEN_ERR); - requires(validatePrice(config.rootPriceConfig), INVALID_CURVE_ERR); - requires(!mongoUri.includes("localhost"), MONGO_URI_ERR); + if (envLevel === "dev") return priceConfig; - if (config.postDeploy.verifyContracts) { - requires(!!process.env.ETHERSCAN_API_KEY, "Must provide an Etherscan API Key to verify contracts"); + if (envLevel === "test" || envLevel === "dev") { + if (process.env.MOCK_MEOW_TOKEN === "false" && !process.env.STAKING_TOKEN_ADDRESS) { + throw new Error("Must provide a staking token address if not mocking MEOW token in `dev` environment"); } + } - if (config.postDeploy.monitorContracts) { - requires(!!process.env.TENDERLY_PROJECT_SLUG, "Must provide a Tenderly Project Slug to monitor contracts"); - requires(!!process.env.TENDERLY_ACCOUNT_ID, "Must provide a Tenderly Account ID to monitor contracts"); - requires(!!process.env.TENDERLY_ACCESS_KEY, "Must provide a Tenderly Access Key to monitor contracts"); - } + if (envLevel !== "test" && envLevel !== "prod") { + // If we reach this code, there is an env variable, but it's not valid. + throw new Error(INVALID_ENV_ERR); + } + + if (!process.env.ROYALTY_RECEIVER) { + throw new Error("Must provide a default royalty receiver"); + } + + if (!process.env.ROYALTY_FRACTION) { + throw new Error("Must provide a default royalty fraction"); } - // If we reach this code, there is an env variable, but it's not valid. - throw new Error(INVALID_ENV_ERR); + if (!process.env.MONGO_URI) { + throw new Error(`Must provide a Mongo URI used for ${envLevel} environment!`); + } + + requires(!!process.env.ZERO_VAULT_ADDRESS, NO_ZERO_VAULT_ERR); + + // Mainnet + if (envLevel === "prod") { + requires(process.env.MOCK_MEOW_TOKEN === "false", NO_MOCK_PROD_ERR); + requires(process.env.STAKING_TOKEN_ADDRESS === MeowMainnet.address, STAKING_TOKEN_ERR); + requires(!process.env.MONGO_URI.includes("localhost"), MONGO_URI_ERR); + } + + if (process.env.VERIFY_CONTRACTS === "true") { + requires(!!process.env.ETHERSCAN_API_KEY, "Must provide an Etherscan API Key to verify contracts"); + } + + if (process.env.MONITOR_CONTRACTS === "true") { + requires(!!process.env.TENDERLY_PROJECT_SLUG, "Must provide a Tenderly Project Slug to monitor contracts"); + requires(!!process.env.TENDERLY_ACCOUNT_ID, "Must provide a Tenderly Account ID to monitor contracts"); + requires(!!process.env.TENDERLY_ACCESS_KEY, "Must provide a Tenderly Access Key to monitor contracts"); + } + + return priceConfig; +}; + +const getValidateRootPriceConfig = () => { + + if (process.env.ENV_LEVEL === "prod") { + requires( + !!process.env.MAX_PRICE + && !!process.env.MIN_PRICE + && !!process.env.MAX_LENGTH + && !!process.env.BASE_LENGTH + && !!process.env.DECIMALS + && !!process.env.PRECISION + && !!process.env.PROTOCOL_FEE_PERC, + "Must provide all price config variables for prod environment!" + ); + } + + // Price config variables + const maxPrice = + process.env.MAX_PRICE + ? ethers.parseEther(process.env.MAX_PRICE) + : DEFAULT_PRICE_CONFIG.maxPrice; + + const minPrice = + process.env.MIN_PRICE + ? ethers.parseEther(process.env.MIN_PRICE) + : DEFAULT_PRICE_CONFIG.minPrice; + + const maxLength = + process.env.MAX_LENGTH + ? BigInt(process.env.MAX_LENGTH) + : DEFAULT_PRICE_CONFIG.maxLength; + + const baseLength = + process.env.BASE_LENGTH + ? BigInt(process.env.BASE_LENGTH) + : DEFAULT_PRICE_CONFIG.baseLength; + + const decimals = process.env.DECIMALS ? BigInt(process.env.DECIMALS) : DEFAULT_DECIMALS; + const precision = process.env.PRECISION ? BigInt(process.env.PRECISION) : DECAULT_PRECISION; + const precisionMultiplier = BigInt(10) ** (decimals - precision); + + const feePercentage = + process.env.PROTOCOL_FEE_PERC + ? BigInt(process.env.PROTOCOL_FEE_PERC) + : DEFAULT_PROTOCOL_FEE_PERCENT; + + const priceConfig : ICurvePriceConfig = { + maxPrice, + minPrice, + maxLength, + baseLength, + precisionMultiplier, + feePercentage, + isSet: true, + }; + + requires(validatePrice(priceConfig), INVALID_CURVE_ERR); + + return priceConfig; }; const requires = (condition : boolean, message : string) => { @@ -188,12 +258,12 @@ const requires = (condition : boolean, message : string) => { // No price spike before `minPrice` kicks in at `maxLength` const validatePrice = (config : ICurvePriceConfig) => { - const strA = "a".repeat(config.maxLength.toNumber()); - const strB = "b".repeat(config.maxLength.add(1).toNumber()); + const strA = "a".repeat(Number(config.maxLength)); + const strB = "b".repeat(Number(config.maxLength + 1n)); const priceA = getCurvePrice(strA, config); const priceB = getCurvePrice(strB, config); - // if A < B, then the price spike is invalid - return !priceA.lt(priceB); + // if B > A, then the price spike is invalid + return (priceB <= priceA); }; diff --git a/src/deploy/campaign/types.ts b/src/deploy/campaign/types.ts index b8c8cc218..1bee5a3cd 100644 --- a/src/deploy/campaign/types.ts +++ b/src/deploy/campaign/types.ts @@ -1,22 +1,25 @@ import { BaseDeployMission } from "../missions/base-deploy-mission"; -import { BigNumber, Contract } from "ethers"; +import { BaseContract } from "ethers"; import { ICurvePriceConfig, TDeployMissionCtor } from "../missions/types"; import { HardhatDeployer } from "../deployer/hardhat-deployer"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { HardhatEthersSigner } from "@nomicfoundation/hardhat-ethers/signers"; import { IZNSContracts } from "../../../test/helpers/types"; import { Logger as WinstonLogger } from "winston"; import { MongoDBAdapter } from "../db/mongo-adapter/mongo-adapter"; +import { DefenderRelaySigner } from "@openzeppelin/defender-sdk-relay-signer-client/lib/ethers"; +export type ContractV6 = BaseContract & Omit; export interface IDeployCampaignConfig { - deployAdmin : SignerWithAddress; + env : string; + deployAdmin : HardhatEthersSigner | DefenderRelaySigner; governorAddresses : Array; adminAddresses : Array; domainToken : { name : string; symbol : string; defaultRoyaltyReceiver : string; - defaultRoyaltyFraction : BigNumber; + defaultRoyaltyFraction : bigint; }; rootPriceConfig : ICurvePriceConfig; zeroVaultAddress : string; @@ -32,7 +35,7 @@ export interface IDeployCampaignConfig { export type TLogger = WinstonLogger | Console; export interface IContractState { - [key : string] : Contract; + [key : string] : ContractV6; } export interface IMissionInstances { diff --git a/src/deploy/constants.ts b/src/deploy/constants.ts index cf773fe2f..23758db41 100644 --- a/src/deploy/constants.ts +++ b/src/deploy/constants.ts @@ -8,19 +8,19 @@ export const ProxyKinds : IProxyKinds = { }; // role names -export const GOVERNOR_ROLE = ethers.utils.solidityKeccak256( +export const GOVERNOR_ROLE = ethers.solidityPackedKeccak256( ["string"], ["GOVERNOR_ROLE"], ); -export const ADMIN_ROLE = ethers.utils.solidityKeccak256( +export const ADMIN_ROLE = ethers.solidityPackedKeccak256( ["string"], ["ADMIN_ROLE"], ); -export const REGISTRAR_ROLE = ethers.utils.solidityKeccak256( +export const REGISTRAR_ROLE = ethers.solidityPackedKeccak256( ["string"], ["REGISTRAR_ROLE"], ); -export const EXECUTOR_ROLE = ethers.utils.solidityKeccak256( +export const EXECUTOR_ROLE = ethers.solidityPackedKeccak256( ["string"], ["EXECUTOR_ROLE"], ); diff --git a/src/deploy/db/mongo-adapter/mongo-adapter.ts b/src/deploy/db/mongo-adapter/mongo-adapter.ts index dddcc970e..18877c11c 100644 --- a/src/deploy/db/mongo-adapter/mongo-adapter.ts +++ b/src/deploy/db/mongo-adapter/mongo-adapter.ts @@ -53,11 +53,11 @@ export class MongoDBAdapter { this.db = this.client.db(this.dbName); this.logger.info({ - message: `MongoDB connected at ${this.dbUri}`, + message: "MongoDB connected", }); } catch (e) { this.logger.error({ - message: `MongoDB connection failed at ${this.dbUri}`, + message: "MongoDB connection failed", error: e, }); throw e; @@ -76,10 +76,10 @@ export class MongoDBAdapter { async close (forceClose = false) { try { await this.client.close(forceClose); - this.logger.info(`MongoDB connection closed at ${this.dbUri}`); + this.logger.info("MongoDB connection closed"); } catch (e) { this.logger.error({ - message: `MongoDB connection failed to close at ${this.dbUri}`, + message: "MongoDB connection failed to close", error: e, }); throw e; @@ -118,7 +118,6 @@ export class MongoDBAdapter { // Versioning methods async configureVersioning (version ?: string) { - // TODO dep: add archiving logic once determined on how to handle it const tempV = await this.getTempVersion(); const deployedV = await this.getDeployedVersion(); diff --git a/src/deploy/db/service/mongo-service.ts b/src/deploy/db/service/mongo-service.ts index 0d8ca150f..1efbddf9e 100644 --- a/src/deploy/db/service/mongo-service.ts +++ b/src/deploy/db/service/mongo-service.ts @@ -25,7 +25,6 @@ export const stopMongo = async () => { const logger = getLogger(); try { - // TODO db: possibly change this to delete the container await execAsync("npm run mongo:stop"); logger.info("MongoDB stopped"); } catch (e) { diff --git a/src/deploy/deployer/constants.ts b/src/deploy/deployer/constants.ts new file mode 100644 index 000000000..64761f7d7 --- /dev/null +++ b/src/deploy/deployer/constants.ts @@ -0,0 +1,22 @@ + +export interface INetworkData { + [env : string] : { + name : string; + id : string; + }; +} + +export const NetworkData : INetworkData = { + test: { + name: "sepolia", + id: "11155111", + }, + prod: { + name: "mainnet", + id: "1", + }, + dev: { + name: "hardhat", + id: "31337", + }, +}; diff --git a/src/deploy/deployer/hardhat-deployer.ts b/src/deploy/deployer/hardhat-deployer.ts index 58bc62d1e..b6f54ffac 100644 --- a/src/deploy/deployer/hardhat-deployer.ts +++ b/src/deploy/deployer/hardhat-deployer.ts @@ -1,20 +1,35 @@ import * as hre from "hardhat"; import { HardhatRuntimeEnvironment } from "hardhat/types"; -import { TDeployArgs, TProxyKind } from "../missions/types"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; -import { ContractByName } from "@tenderly/hardhat-tenderly/dist/tenderly/types"; +import { ITenderlyContractData, TDeployArgs, TProxyKind } from "../missions/types"; +import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; +import { ethers } from "ethers"; +import axios from "axios"; +import { + DefenderRelayProvider, + DefenderRelaySigner, +} from "@openzeppelin/defender-sdk-relay-signer-client/lib/ethers"; +import { ContractV6 } from "../campaign/types"; export class HardhatDeployer { hre : HardhatRuntimeEnvironment; - signer : SignerWithAddress; - - constructor (signer : SignerWithAddress) { + signer : SignerWithAddress | DefenderRelaySigner; + env : string; + provider ?: DefenderRelayProvider; + + constructor ( + signer : SignerWithAddress | DefenderRelaySigner, + env : string, + provider ?: DefenderRelayProvider, + ) { this.hre = hre; this.signer = signer; + this.env = env; + this.provider = provider; } - async getFactory (contractName : string) { - return this.hre.ethers.getContractFactory(contractName); + async getFactory (contractName : string, signer ?: SignerWithAddress | DefenderRelaySigner) { + const attachedSigner = signer ?? this.signer; + return this.hre.ethers.getContractFactory(contractName, attachedSigner as ethers.Signer); } async getContractObject (contractName : string, address : string) { @@ -31,24 +46,42 @@ export class HardhatDeployer { contractName : string; args : TDeployArgs; kind : TProxyKind; - }) { - const contractFactory = await this.hre.ethers.getContractFactory(contractName, this.signer); - const contract = await this.hre.upgrades.deployProxy(contractFactory, args, { + }) : Promise { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + const contractFactory = await this.getFactory(contractName); + const deployment = await this.hre.upgrades.deployProxy(contractFactory, args, { kind, }); - await contract.deployed(); + let receipt; + if (!this.provider) { + return deployment.waitForDeployment(); + } else { + const tx = await deployment.deploymentTransaction(); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + receipt = await this.provider.waitForTransaction(tx!.hash, 3); - return contract; + return contractFactory.attach(receipt.contractAddress); + } } - async deployContract (contractName : string, args : TDeployArgs) { - const contractFactory = await this.hre.ethers.getContractFactory(contractName, this.signer); - const contract = await contractFactory.deploy(...args); - - await contract.deployed(); - - return contract; + async deployContract (contractName : string, args : TDeployArgs) : Promise { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + const contractFactory = await this.getFactory(contractName); + const deployment = await contractFactory.deploy(...args); + + let receipt; + if (!this.provider) { + return deployment.waitForDeployment(); + } else { + const tx = await deployment.deploymentTransaction(); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + receipt = await this.provider.waitForTransaction(tx!.hash, 3); + + return contractFactory.attach(receipt.contractAddress); + } } getContractArtifact (contractName : string) { @@ -63,8 +96,23 @@ export class HardhatDeployer { return this.hre.ethers.provider.getCode(address); } - async tenderlyVerify (contracts : Array) { - return this.hre.tenderly.verify(...contracts); + async tenderlyPush (contracts : Array) { + const inst = axios.create({ + baseURL: "https://api.tenderly.co/", + headers: { + "Content-Type": "application/json", + "X-Access-Key": process.env.TENDERLY_ACCESS_KEY, + }, + }); + + const { data } = await inst.post( + `api/v2/accounts/${process.env.TENDERLY_ACCOUNT_ID}/projects/${process.env.TENDERLY_PROJECT_SLUG}/contracts`, + { + contracts, + } + ); + + return data; } async etherscanVerify ({ diff --git a/src/deploy/logger/create-logger.ts b/src/deploy/logger/create-logger.ts index 8a1d7ad21..df45e91ca 100644 --- a/src/deploy/logger/create-logger.ts +++ b/src/deploy/logger/create-logger.ts @@ -1,6 +1,5 @@ import winston from "winston"; import { TLogger } from "../campaign/types"; -import { includes } from "hardhat/internal/hardhat-network/provider/filter"; let logger : TLogger | null = null; @@ -15,7 +14,6 @@ export const createLogger = (logLevel ?: string, silent ?: boolean) => winston.c transports: [ new winston.transports.Console(), ], - // TODO dep: do we need this to be set ? exitOnError: false, silent, }); diff --git a/src/deploy/missions/base-deploy-mission.ts b/src/deploy/missions/base-deploy-mission.ts index 0e6bf0db9..d451cfbca 100644 --- a/src/deploy/missions/base-deploy-mission.ts +++ b/src/deploy/missions/base-deploy-mission.ts @@ -1,15 +1,14 @@ +/* eslint-disable camelcase */ import { Contract } from "ethers"; import { TDeployArgs, IProxyData, - IDeployMissionArgs, + IDeployMissionArgs, ITenderlyContractData, } from "./types"; import { DeployCampaign } from "../campaign/deploy-campaign"; -import { IDeployCampaignConfig, TLogger } from "../campaign/types"; +import { ContractV6, IDeployCampaignConfig, TLogger } from "../campaign/types"; import { IContractDbData } from "../db/types"; -import { erc1967ProxyName, transparentProxyName } from "./contracts/names"; -import { ProxyKinds } from "../constants"; -import { ContractByName } from "@tenderly/hardhat-tenderly/dist/tenderly/types"; +import { NetworkData } from "../deployer/constants"; export class BaseDeployMission { @@ -35,22 +34,18 @@ export class BaseDeployMission { return this.campaign.dbAdapter.getContract(this.contractName); } - async saveToDB (contract : Contract) { + async saveToDB (contract : ContractV6) { this.logger.debug(`Writing ${this.contractName} to DB...`); this.implAddress = this.proxyData.isProxy - ? await this.campaign.deployer.getProxyImplAddress(contract.address) + ? await this.campaign.deployer.getProxyImplAddress(await contract.getAddress()) : null; - const contractDbDoc = this.buildDbObject(contract, this.implAddress); + const contractDbDoc = await this.buildDbObject(contract, this.implAddress); return this.campaign.dbAdapter.writeContract(this.contractName, contractDbDoc); } - async preDeploy () { - return Promise.resolve(); - } - async needsDeploy () { const dbContract = await this.getFromDB(); @@ -62,9 +57,10 @@ export class BaseDeployMission { const contract = await this.campaign.deployer.getContractObject( this.contractName, dbContract.address, - ); + ) as Contract; - this.logger.debug(`Updating ${this.contractName} in state from DB data with address ${contract.address}`); + // eslint-disable-next-line max-len + this.logger.debug(`Updating ${this.contractName} in state from DB data with address ${await contract.getAddress()}`); this.campaign.updateStateContract(this.instanceName, this.contractName, contract); } @@ -72,7 +68,7 @@ export class BaseDeployMission { return !dbContract; } - deployArgs () : TDeployArgs { + async deployArgs () : Promise { return []; } @@ -80,11 +76,14 @@ export class BaseDeployMission { return this.campaign.deployer.getContractArtifact(this.contractName); } - buildDbObject (hhContract : Contract, implAddress : string | null) : Omit { + async buildDbObject ( + hhContract : ContractV6, + implAddress : string | null + ) : Promise> { const { abi, bytecode } = this.getArtifact(); return { name: this.contractName, - address: hhContract.address, + address: await hhContract.getAddress(), abi: JSON.stringify(abi), bytecode, implementation: implAddress, @@ -92,10 +91,10 @@ export class BaseDeployMission { } async deploy () { - const deployArgs = this.deployArgs(); - this.logger.info(`Deploying ${this.contractName} with arguments: ${this.deployArgs()}`); + const deployArgs = await this.deployArgs(); + this.logger.info(`Deploying ${this.contractName} with arguments: ${deployArgs}`); - let contract; + let contract : ContractV6; if (this.proxyData.isProxy) { contract = await this.campaign.deployer.deployProxy({ contractName: this.contractName, @@ -110,7 +109,7 @@ export class BaseDeployMission { this.campaign.updateStateContract(this.instanceName, this.contractName, contract); - this.logger.info(`Deployment success for ${this.contractName} at ${contract.address}`); + this.logger.info(`Deployment success for ${this.contractName} at ${await contract.getAddress()}`); } async needsPostDeploy () { @@ -123,7 +122,6 @@ export class BaseDeployMission { async execute () { if (await this.needsDeploy()) { - await this.preDeploy(); await this.deploy(); } else { this.logger.info(`Skipping ${this.contractName} deployment...`); @@ -136,43 +134,52 @@ export class BaseDeployMission { async verify () { this.logger.debug(`Verifying ${this.contractName} on Etherscan...`); - const { address } = await this.campaign[this.instanceName]; + const address = await this.campaign[this.instanceName].getAddress(); - const ctorArgs = !this.proxyData.isProxy ? this.deployArgs() : undefined; - - await this.campaign.deployer.etherscanVerify({ - address, - ctorArgs, - }); + const ctorArgs = !this.proxyData.isProxy ? await this.deployArgs() : undefined; + try { + await this.campaign.deployer.etherscanVerify({ + address, + ctorArgs, + }); - this.logger.debug(`Etherscan verification for ${this.contractName} finished successfully.`); + this.logger.debug(`Etherscan verification for ${this.contractName} finished successfully.`); + /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ + } catch (e : any) { + this.logger.error(`Etherscan verification for ${this.contractName} failed.`); + this.logger.error(e.message); + this.logger.debug("Continuing..."); + } } - async getMonitoringData () : Promise> { + async getMonitoringData () : Promise> { + const networkId = NetworkData[this.campaign.config.env].id; const implName = this.contractName; - let implAddress = this.campaign[this.instanceName].address; + let implAddress = await this.campaign[this.instanceName].getAddress(); if (this.proxyData.isProxy) { - const proxyName = this.proxyData.kind === ProxyKinds.uups ? erc1967ProxyName : transparentProxyName; - const proxyAddress = this.campaign[this.instanceName].address; + const proxyAddress = await this.campaign[this.instanceName].getAddress(); implAddress = this.implAddress || await this.campaign.deployer.getProxyImplAddress(proxyAddress); return [ { - name: proxyName, + display_name: `${this.contractName}Proxy`, address: proxyAddress, + network_id: networkId, }, { - name: implName, + display_name: `${implName}Impl`, address: implAddress, + network_id: networkId, }, ]; } return [ { - name: implName, + display_name: implName, address: implAddress, + network_id: networkId, }, ]; } diff --git a/src/deploy/missions/contracts/access-controller.ts b/src/deploy/missions/contracts/access-controller.ts index 6d4e74717..7b09b2449 100644 --- a/src/deploy/missions/contracts/access-controller.ts +++ b/src/deploy/missions/contracts/access-controller.ts @@ -11,7 +11,7 @@ export class ZNSAccessControllerDM extends BaseDeployMission { contractName = znsNames.accessController.contract; instanceName = znsNames.accessController.instance; - deployArgs () { + async deployArgs () { const { governorAddresses, adminAddresses, diff --git a/src/deploy/missions/contracts/address-resolver.ts b/src/deploy/missions/contracts/address-resolver.ts index ce65e0ed3..ef3565c07 100644 --- a/src/deploy/missions/contracts/address-resolver.ts +++ b/src/deploy/missions/contracts/address-resolver.ts @@ -13,10 +13,10 @@ export class ZNSAddressResolverDM extends BaseDeployMission { contractName = znsNames.addressResolver.contract; instanceName = znsNames.addressResolver.instance; - deployArgs () : TDeployArgs { + async deployArgs () : Promise { const { accessController, registry } = this.campaign; - return [ accessController.address, registry.address ]; + return [await accessController.getAddress(), await registry.getAddress()]; } async needsPostDeploy () { @@ -29,7 +29,12 @@ export class ZNSAddressResolverDM extends BaseDeployMission { ResolverTypes.address, ); - return resolverInReg !== addressResolver.address; + const needs = resolverInReg !== await addressResolver.getAddress(); + const msg = needs ? "needs" : "doesn't need"; + + this.logger.debug(`${this.contractName} ${msg} post deploy sequence`); + + return needs; } async postDeploy () { @@ -43,7 +48,9 @@ export class ZNSAddressResolverDM extends BaseDeployMission { await registry.connect(deployAdmin).addResolverType( ResolverTypes.address, - addressResolver.address, + await addressResolver.getAddress(), ); + + this.logger.debug(`${this.contractName} post deploy sequence completed`); } } diff --git a/src/deploy/missions/contracts/curve-pricer.ts b/src/deploy/missions/contracts/curve-pricer.ts index 385fd025b..717799b39 100644 --- a/src/deploy/missions/contracts/curve-pricer.ts +++ b/src/deploy/missions/contracts/curve-pricer.ts @@ -13,7 +13,7 @@ export class ZNSCurvePricerDM extends BaseDeployMission { contractName = znsNames.curvePricer.contract; instanceName = znsNames.curvePricer.instance; - deployArgs () : TDeployArgs { + async deployArgs () : Promise { const { accessController, registry, @@ -22,6 +22,6 @@ export class ZNSCurvePricerDM extends BaseDeployMission { }, } = this.campaign; - return [ accessController.address, registry.address, rootPriceConfig ]; + return [await accessController.getAddress(), await registry.getAddress(), rootPriceConfig]; } } diff --git a/src/deploy/missions/contracts/domain-token.ts b/src/deploy/missions/contracts/domain-token.ts index f261cdbe7..840ec8d86 100644 --- a/src/deploy/missions/contracts/domain-token.ts +++ b/src/deploy/missions/contracts/domain-token.ts @@ -12,8 +12,8 @@ export class ZNSDomainTokenDM extends BaseDeployMission { contractName = znsNames.domainToken.contract; instanceName = znsNames.domainToken.instance; - deployArgs () : TDeployArgs { - const { accessController: { address: acAddress } } = this.campaign; + async deployArgs () : Promise { + const { accessController } = this.campaign; const { domainToken: { name, @@ -23,6 +23,6 @@ export class ZNSDomainTokenDM extends BaseDeployMission { }, } = this.config; - return [ acAddress, name, symbol, defaultRoyaltyReceiver, defaultRoyaltyFraction ]; + return [ await accessController.getAddress(), name, symbol, defaultRoyaltyReceiver, defaultRoyaltyFraction ]; } } diff --git a/src/deploy/missions/contracts/fixed-pricer.ts b/src/deploy/missions/contracts/fixed-pricer.ts index 57e00cc98..e205d1cce 100644 --- a/src/deploy/missions/contracts/fixed-pricer.ts +++ b/src/deploy/missions/contracts/fixed-pricer.ts @@ -13,12 +13,12 @@ export class ZNSFixedPricerDM extends BaseDeployMission { contractName = znsNames.fixedPricer.contract; instanceName = znsNames.fixedPricer.instance; - deployArgs () : TDeployArgs { + async deployArgs () : Promise { const { accessController, registry, } = this.campaign; - return [ accessController.address, registry.address ]; + return [await accessController.getAddress(), await registry.getAddress()]; } } diff --git a/src/deploy/missions/contracts/meow-token/meow-token.ts b/src/deploy/missions/contracts/meow-token/meow-token.ts index faeedbeeb..bb92bfb25 100644 --- a/src/deploy/missions/contracts/meow-token/meow-token.ts +++ b/src/deploy/missions/contracts/meow-token/meow-token.ts @@ -1,7 +1,7 @@ import { BaseDeployMission } from "../../base-deploy-mission"; import { ProxyKinds } from "../../../constants"; import { IDeployMissionArgs, TDeployArgs } from "../../types"; -import { ethers } from "ethers"; +import { Contract, ethers } from "ethers"; import { znsNames } from "../names"; @@ -48,26 +48,33 @@ export class MeowTokenDM extends BaseDeployMission { this.logger.debug(`Writing ${this.contractName} to DB...`); - const contract = await this.campaign.deployer.getContractObject( + const baseContract = await this.campaign.deployer.getContractObject( this.contractName, this.config.stakingTokenAddress, ); + const contract = new Contract(baseContract.target.toString(), baseContract.interface, baseContract.runner); + await this.saveToDB(contract); this.campaign.updateStateContract(this.instanceName, this.contractName, contract); - this.logger.info(`Successfully created ${this.contractName} contract from Mainnet data at ${contract.address}`); + // eslint-disable-next-line max-len + this.logger.info(`Successfully created ${this.contractName} contract from Mainnet data at ${await baseContract.getAddress()}`); } else { await super.deploy(); } } - deployArgs () : TDeployArgs { + async deployArgs () : Promise { return [meowTokenName, meowTokenSymbol]; } async needsPostDeploy () { + const msg = this.config.mockMeowToken ? "needs" : "doesn't need"; + + this.logger.debug(`${this.contractName} ${msg} post deploy sequence`); + return this.config.mockMeowToken; } @@ -81,8 +88,10 @@ export class MeowTokenDM extends BaseDeployMission { // Mint 100,000 MEOW to the deployer await meowToken.connect(deployAdmin).mint( - deployAdmin.address, - ethers.utils.parseEther("100000") + await deployAdmin.getAddress(), + ethers.parseEther("100000") ); + + this.logger.debug(`${this.contractName} post deploy sequence completed`); } } diff --git a/src/deploy/missions/contracts/registry.ts b/src/deploy/missions/contracts/registry.ts index 8b6c7ee6b..221ae9713 100644 --- a/src/deploy/missions/contracts/registry.ts +++ b/src/deploy/missions/contracts/registry.ts @@ -13,8 +13,8 @@ export class ZNSRegistryDM extends BaseDeployMission { contractName = znsNames.registry.contract; instanceName = znsNames.registry.instance; - deployArgs () : TDeployArgs { - const { accessController: { address: acAddress } } = this.campaign; - return [ acAddress ]; + async deployArgs () : Promise { + const { accessController } = this.campaign; + return [ await accessController.getAddress() ]; } } diff --git a/src/deploy/missions/contracts/root-registrar.ts b/src/deploy/missions/contracts/root-registrar.ts index d9567948a..7cbd1d4b8 100644 --- a/src/deploy/missions/contracts/root-registrar.ts +++ b/src/deploy/missions/contracts/root-registrar.ts @@ -13,7 +13,7 @@ export class ZNSRootRegistrarDM extends BaseDeployMission { contractName = znsNames.rootRegistrar.contract; instanceName = znsNames.rootRegistrar.instance; - deployArgs () : TDeployArgs { + async deployArgs () : Promise { const { accessController, registry, @@ -23,12 +23,12 @@ export class ZNSRootRegistrarDM extends BaseDeployMission { } = this.campaign; return [ - accessController.address, - registry.address, + await accessController.getAddress(), + await registry.getAddress(), // we use CurvePricer as the IZNSPricer for root domains - curvePricer.address, - treasury.address, - domainToken.address, + await curvePricer.getAddress(), + await treasury.getAddress(), + await domainToken.getAddress(), ]; } @@ -41,7 +41,11 @@ export class ZNSRootRegistrarDM extends BaseDeployMission { const isRegistrar = await accessController .connect(deployAdmin) - .isRegistrar(rootRegistrar.address); + .isRegistrar(await rootRegistrar.getAddress()); + + const msg = !isRegistrar ? "needs" : "doesn't need"; + + this.logger.debug(`${this.contractName} ${msg} post deploy sequence`); return !isRegistrar; } @@ -57,6 +61,8 @@ export class ZNSRootRegistrarDM extends BaseDeployMission { await accessController .connect(deployAdmin) - .grantRole(REGISTRAR_ROLE, rootRegistrar.address); + .grantRole(REGISTRAR_ROLE, await rootRegistrar.getAddress()); + + this.logger.debug(`${this.contractName} post deploy sequence completed`); } } diff --git a/src/deploy/missions/contracts/sub-registrar.ts b/src/deploy/missions/contracts/sub-registrar.ts index c80010a8a..6a552197d 100644 --- a/src/deploy/missions/contracts/sub-registrar.ts +++ b/src/deploy/missions/contracts/sub-registrar.ts @@ -16,14 +16,14 @@ export class ZNSSubRegistrarDM extends BaseDeployMission { private hasRegistrarRole : boolean | undefined; private isSetOnRoot : boolean | undefined; - deployArgs () : TDeployArgs { + async deployArgs () : Promise { const { accessController, registry, rootRegistrar, } = this.campaign; - return [ accessController.address, registry.address, rootRegistrar.address ]; + return [await accessController.getAddress(), await registry.getAddress(), await rootRegistrar.getAddress()]; } async needsPostDeploy () { @@ -36,12 +36,17 @@ export class ZNSSubRegistrarDM extends BaseDeployMission { this.hasRegistrarRole = await accessController .connect(deployAdmin) - .isRegistrar(subRegistrar.address); + .isRegistrar(await subRegistrar.getAddress()); const currentSubRegistrarOnRoot = await rootRegistrar.subRegistrar(); - this.isSetOnRoot = currentSubRegistrarOnRoot === subRegistrar.address; + this.isSetOnRoot = currentSubRegistrarOnRoot === await subRegistrar.getAddress(); - return !this.hasRegistrarRole || !this.isSetOnRoot; + const needs = !this.hasRegistrarRole || !this.isSetOnRoot; + const msg = needs ? "needs" : "doesn't need"; + + this.logger.debug(`${this.contractName} ${msg} post deploy sequence`); + + return needs; } async postDeploy () { @@ -62,13 +67,15 @@ export class ZNSSubRegistrarDM extends BaseDeployMission { } = this.campaign; if (!this.isSetOnRoot) { - await rootRegistrar.connect(deployAdmin).setSubRegistrar(subRegistrar.address); + await rootRegistrar.connect(deployAdmin).setSubRegistrar(await subRegistrar.getAddress()); } if (!this.hasRegistrarRole) { await accessController .connect(deployAdmin) - .grantRole(REGISTRAR_ROLE, subRegistrar.address); + .grantRole(REGISTRAR_ROLE, await subRegistrar.getAddress()); } + + this.logger.debug(`${this.contractName} post deploy sequence completed`); } } diff --git a/src/deploy/missions/contracts/treasury.ts b/src/deploy/missions/contracts/treasury.ts index 28f99ff7c..f1eb111cf 100644 --- a/src/deploy/missions/contracts/treasury.ts +++ b/src/deploy/missions/contracts/treasury.ts @@ -13,7 +13,7 @@ export class ZNSTreasuryDM extends BaseDeployMission { contractName = znsNames.treasury.contract; instanceName = znsNames.treasury.instance; - deployArgs () : TDeployArgs { + async deployArgs () : Promise { const { accessController, registry, @@ -24,9 +24,9 @@ export class ZNSTreasuryDM extends BaseDeployMission { } = this.campaign; return [ - accessController.address, - registry.address, - meowToken.address, + await accessController.getAddress(), + await registry.getAddress(), + await meowToken.getAddress(), zeroVaultAddress, ]; } diff --git a/src/deploy/missions/types.ts b/src/deploy/missions/types.ts index e4aefe89c..a245dc6ae 100644 --- a/src/deploy/missions/types.ts +++ b/src/deploy/missions/types.ts @@ -1,7 +1,6 @@ import { BaseDeployMission } from "./base-deploy-mission"; import { DeployCampaign } from "../campaign/deploy-campaign"; import { IDeployCampaignConfig, TLogger } from "../campaign/types"; -import { BigNumber } from "ethers"; export interface IDeployMissionArgs { @@ -12,12 +11,18 @@ export interface IDeployMissionArgs { export type TDeployMissionCtor = new (args : IDeployMissionArgs) => BaseDeployMission; -export type TDeployArg = string | Array | BigNumber | ICurvePriceConfig; +export type TDeployArg = string | Array | bigint | ICurvePriceConfig; export type TDeployArgs = Array; export type TProxyKind = "uups" | "transparent" | "beacon" | undefined; +export interface ITenderlyContractData { + display_name : string; + address : string; + network_id : string; +} + export interface IProxyKinds { uups : TProxyKind; transparent : TProxyKind; @@ -30,11 +35,11 @@ export interface IProxyData { } export interface ICurvePriceConfig { - maxPrice : BigNumber; - minPrice : BigNumber; - maxLength : BigNumber; - baseLength : BigNumber; - precisionMultiplier : BigNumber; - feePercentage : BigNumber; + maxPrice : bigint; + minPrice : bigint; + maxLength : bigint; + baseLength : bigint; + precisionMultiplier : bigint; + feePercentage : bigint; isSet : boolean; } diff --git a/src/deploy/run-campaign.ts b/src/deploy/run-campaign.ts index f655ac5b7..78ff2e36d 100644 --- a/src/deploy/run-campaign.ts +++ b/src/deploy/run-campaign.ts @@ -1,27 +1,37 @@ -import * as hre from "hardhat"; -import { getConfig } from "./campaign/environments"; -import { getLogger } from "./logger/create-logger"; -import { runZnsCampaign } from "./zns-campaign"; - -const logger = getLogger(); - -const runCampaign = async () => { - const [deployer, zeroVault] = await hre.ethers.getSigners(); - - // Reading `ENV_LEVEL` environment variable to determine rules to be enforced - const config = getConfig( - deployer, - zeroVault, - ); - - await runZnsCampaign({ - config, - }); -}; - -runCampaign().catch(error => { - logger.error(error); - process.exitCode = 1; -}).finally(() => { - process.exit(0); -}); +import { getConfig } from "./campaign/environments"; +import { runZnsCampaign } from "./zns-campaign"; +import { Defender } from "@openzeppelin/defender-sdk"; + +import { getLogger } from "./logger/create-logger"; + +const logger = getLogger(); + +const runCampaign = async () => { + const credentials = { + apiKey: process.env.DEFENDER_KEY, + apiSecret: process.env.DEFENDER_SECRET, + relayerApiKey: process.env.RELAYER_KEY, + relayerApiSecret: process.env.RELAYER_SECRET, + }; + + const client = new Defender(credentials); + + const provider = client.relaySigner.getProvider(); + const deployer = client.relaySigner.getSigner(provider, { speed: "fast" }); + + const config = await getConfig({ + deployer, + }); + + await runZnsCampaign({ + config, + provider, + }); +}; + +runCampaign().catch(error => { + logger.error(error.stack); + process.exit(1); +}).finally(() => { + process.exit(0); +}); diff --git a/src/deploy/zns-campaign.ts b/src/deploy/zns-campaign.ts index f8faa0096..e7e4bd1d1 100644 --- a/src/deploy/zns-campaign.ts +++ b/src/deploy/zns-campaign.ts @@ -1,3 +1,6 @@ +import * as hre from "hardhat"; +import { DefenderRelayProvider } from "@openzeppelin/defender-sdk-relay-signer-client/lib/ethers"; + import { IDeployCampaignConfig } from "./campaign/types"; import { HardhatDeployer } from "./deployer/hardhat-deployer"; import { DeployCampaign } from "./campaign/deploy-campaign"; @@ -8,18 +11,18 @@ import { ZNSDomainTokenDM, ZNSCurvePricerDM, ZNSRootRegistrarDM, ZNSRegistryDM, ZNSTreasuryDM, ZNSFixedPricerDM, ZNSSubRegistrarDM, } from "./missions/contracts"; -import * as hre from "hardhat"; - import { getMongoAdapter } from "./db/mongo-adapter/get-adapter"; import { getLogger } from "./logger/create-logger"; - +// TODO how do we mock certain things for tests export const runZnsCampaign = async ({ config, + provider, dbVersion, deployer, } : { config : IDeployCampaignConfig; + provider ?: DefenderRelayProvider; dbVersion ?: string; deployer ?: HardhatDeployer; }) => { @@ -27,7 +30,9 @@ export const runZnsCampaign = async ({ const logger = getLogger(); - if (!deployer) deployer = new HardhatDeployer(config.deployAdmin); + if (!deployer) { + deployer = new HardhatDeployer(config.deployAdmin, config.env, provider); + } const dbAdapter = await getMongoAdapter(); diff --git a/src/tenderly/devnet/run-all-flows.ts b/src/tenderly/devnet/run-all-flows.ts index cdbfebfe4..15ba04d89 100644 --- a/src/tenderly/devnet/run-all-flows.ts +++ b/src/tenderly/devnet/run-all-flows.ts @@ -1,6 +1,5 @@ import * as hre from "hardhat"; import * as ethers from "ethers"; -import { BigNumber } from "ethers"; import { deployZNS, hashDomainLabel, PaymentType, @@ -12,7 +11,7 @@ import { registrationWithSetup } from "../../../test/helpers/register-setup"; const domainName = "wilder"; const domainHash = hashDomainLabel(domainName); -const tokenId = BigNumber.from(domainHash); +const tokenId = BigInt(domainHash); export const runAllFlows = async () => { @@ -28,17 +27,17 @@ export const runAllFlows = async () => { isTenderlyRun: true, }); - const rootPrice = BigNumber.from(ethers.utils.parseEther("200")); - const rootFeePercentage = BigNumber.from(250); + const rootPrice = BigInt(ethers.parseEther("200")); + const rootFeePercentage = BigInt(250); const fullRootConfig = { distrConfig: { - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.STAKE, accessType: AccessType.OPEN, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: governor.address, }, priceConfig: { @@ -48,7 +47,7 @@ export const runAllFlows = async () => { }; // get some funds and approve funds for treasury - await zns.meowToken.connect(governor).approve(zns.treasury.address, ethers.constants.MaxUint256); + await zns.meowToken.connect(governor).approve(await zns.treasury.getAddress(), ethers.MaxUint256); const rootHash = await registrationWithSetup({ zns, @@ -60,19 +59,19 @@ export const runAllFlows = async () => { const subdomainLabel = "subdomain"; const fullSubConfig = { distrConfig: { - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), paymentType: PaymentType.DIRECT, accessType: AccessType.OPEN, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: user.address, }, priceConfig: DEFAULT_PRICE_CONFIG, }; - await zns.meowToken.transfer(user.address, ethers.utils.parseEther("10000")); - await zns.meowToken.connect(user).approve(zns.treasury.address, ethers.constants.MaxUint256); + await zns.meowToken.transfer(user.address, ethers.parseEther("10000")); + await zns.meowToken.connect(user).approve(await zns.treasury.getAddress(), ethers.MaxUint256); await registrationWithSetup({ zns, diff --git a/src/tenderly/playground/create-playground.ts b/src/tenderly/playground/create-playground.ts index 3d1f02ab2..c26a262b9 100644 --- a/src/tenderly/playground/create-playground.ts +++ b/src/tenderly/playground/create-playground.ts @@ -15,5 +15,5 @@ export const createPlayground = async ({ const forkURL = `${forkRpcUrlBase}/${forkId}`; - return new ethers.providers.JsonRpcProvider(forkURL); + return new ethers.JsonRpcProvider(forkURL); }; diff --git a/src/tenderly/playground/utils.ts b/src/tenderly/playground/utils.ts index df3d03d08..ec26c4740 100644 --- a/src/tenderly/playground/utils.ts +++ b/src/tenderly/playground/utils.ts @@ -2,8 +2,8 @@ import { ethers } from "ethers"; export const getEther = async ( walletAddress : string, - amountHex = ethers.utils.hexValue(100), // hex encoded wei amount - provider : ethers.providers.JsonRpcProvider, + amountHex = ethers.toBeHex(100), // hex encoded wei amount + provider : ethers.JsonRpcProvider, ) : Promise => { const params = [ [walletAddress], diff --git a/src/utils/gas-costs.ts b/src/utils/gas-costs.ts index d7b63a815..b4684ab09 100644 --- a/src/utils/gas-costs.ts +++ b/src/utils/gas-costs.ts @@ -1,7 +1,5 @@ -import { BigNumber } from "ethers"; - -export const ethMultiplier = BigNumber.from(10).pow(18); +export const ethMultiplier = BigInt(10) ** 18n; export const calcGasCostInCurrency = ( gas : string, @@ -10,14 +8,11 @@ export const calcGasCostInCurrency = ( ) => { let cost; let currency = "WEI"; - cost = BigNumber.from(gas) - .mul(BigNumber.from(gasPriceInGwei)) - .mul(ethMultiplier) - .div(BigNumber.from(10).pow(9)); + cost = BigInt(gas) * BigInt(gasPriceInGwei) * ethMultiplier / (BigInt(10) ** 9n); if (!!ethPriceInUSD) { currency = "USD WEI"; - cost = cost.mul(BigNumber.from(ethPriceInUSD)); + cost = cost * BigInt(ethPriceInUSD); } return { cost, currency }; diff --git a/test/DeployCampaign.integration.test.ts b/test/DeployCampaign.integration.test.ts index c74bff591..433d57ebc 100644 --- a/test/DeployCampaign.integration.test.ts +++ b/test/DeployCampaign.integration.test.ts @@ -1,5 +1,5 @@ import * as hre from "hardhat"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { getConfig } from "../src/deploy/campaign/environments"; import { getLogger } from "../src/deploy/logger/create-logger"; import { runZnsCampaign } from "../src/deploy/zns-campaign"; @@ -15,13 +15,12 @@ import { registerRootDomainBulk, registerSubdomainBulk, } from "./helpers/deploy-helpers"; +import { Defender } from "@openzeppelin/defender-sdk"; describe("DeployCampaign - Integration", () => { - let deployer : SignerWithAddress; - let zeroVault : SignerWithAddress; - let domainAddressMock : SignerWithAddress; - // Minters + let deployAdmin : SignerWithAddress; + let zeroVault : SignerWithAddress; let userA : SignerWithAddress; let userB : SignerWithAddress; let userC : SignerWithAddress; @@ -29,58 +28,93 @@ describe("DeployCampaign - Integration", () => { let userE : SignerWithAddress; let userF : SignerWithAddress; - let zns : TZNSContractState; - let config : IDeployCampaignConfig; + let zns : TZNSContractState; + // let mongoAdapter : MongoDBAdapter; + let users : Array; let distConfig : IDistributionConfig; const logger = getLogger(); // Default baselength is 4, maxLength is 50 - const shortDomain = "wild"; // Length 4 - const mediumDomain = "wilder"; // Length 6 - const longDomain = "wilderwilderwilderwilderwilderwilderwilderwilderwil"; // Length 51 + const shortDomain = "mazz"; // Length 4 + const mediumDomain = "mesder"; // Length 6 + const longDomain = "mesderwilderwilderwilderwilderwilderwilderwilderwil"; // Length 51 const shortHash = hashDomainLabel(shortDomain); const mediumHash = hashDomainLabel(mediumDomain); const longHash = hashDomainLabel(longDomain); - const freeShortSubdomain = "subd"; // Length 4 - const freeMediumSubdomain = "subder"; // Length 6 - const freeLongSubdomain = "subderwilderwilderwilderwilderwilderwilderwilderwil"; // Length 51 + const freeShortSubdomain = "pubj"; // Length 4 + const freeMediumSubdomain = "pubjer"; // Length 6 + const freeLongSubdomain = "pubjerwilderwilderwilderwilderwilderwilderwilderwil"; // Length 51 + + const paidShortSubdomain = "purf"; // Length 4 + const paidMediumSubdomain = "purfer"; // Length 6 + const paidLongSubdomain = "purferwilderwilderwilderwilderwilderwilderwilderwil"; // Length 51 - // Resolve through async call `hashWithParent` in `before` hook + // Resolve subdomain hashes through async call `hashWithParent` in `before` hook let freeShortSubHash : string; let freeMediumSubHash : string; let freeLongSubHash : string; - - const paidShortSubdomain = "surf"; // Length 4 - const paidMediumSubdomain = "surfer"; // Length 6 - const paidLongSubdomain = "surferwilderwilderwilderwilderwilderwilderwilderwil"; // Length 51 - let paidShortSubHash : string; let paidMediumSubHash : string; let paidLongSubHash : string; - const mintAmount = ethers.utils.parseEther("10000000"); + const mintAmount = ethers.parseEther("10000000"); const domains = [shortDomain, mediumDomain, longDomain]; before(async () => { - [deployer, zeroVault, domainAddressMock, userA, userB, userC, userD, userE, userF] = await hre.ethers.getSigners(); + [ deployAdmin, zeroVault, userA, userB, userC, userD, userE, userF ] = await hre.ethers.getSigners(); // Reads `ENV_LEVEL` environment variable to determine rules to be enforced - config = getConfig(deployer, zeroVault); + + let deployer; + let provider; + let zeroVaultAddress; + + if (hre.network.name === "hardhat") { + deployer = deployAdmin; + provider = new hre.ethers.JsonRpcProvider(process.env.SEPOLIA_RPC_URL); + } else { + const credentials = { + apiKey: process.env.DEFENDER_KEY, + apiSecret: process.env.DEFENDER_SECRET, + relayerApiKey: process.env.RELAYER_KEY, + relayerApiSecret: process.env.RELAYER_SECRET, + }; + + const client = new Defender(credentials); + provider = client.relaySigner.getProvider(); + deployer = client.relaySigner.getSigner(provider, { speed: "fast" }); + } + + + config = await getConfig({ + deployer, + zeroVaultAddress: zeroVault.address, + }); config.mockMeowToken = hre.network.name === "hardhat"; - const campaign = await runZnsCampaign({ config, dbVersion: "1.0.0" }); + // First run the `run-campaign` script, then modify the `MONGO_DB_VERSION` environment variable + // Then run this test. The campaign won't be run, but those addresses will be picked up from the DB + const campaign = await runZnsCampaign({ config }); + + // TODO the zns.zeroVaultAddress is not set internally by the treasury, fix this + // because not new deployment? + // Using config.zeroVaultAddress in funcs for now, which is set properly zns = campaign.state.contracts; + // Surprised this typing works for signer of tx + // await zns.treasury.connect(deployer as unknown as Signer) + // .setBeneficiary(ethers.ZeroHash, config.zeroVaultAddress); + // CurvePricer, stake, open distConfig = { - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), paymentType: PaymentType.STAKE, accessType: AccessType.OPEN, }; @@ -97,7 +131,6 @@ describe("DeployCampaign - Integration", () => { freeShortSubHash = await zns.subRegistrar.hashWithParent(shortHash, freeShortSubdomain); freeMediumSubHash = await zns.subRegistrar.hashWithParent(mediumHash, freeMediumSubdomain); freeLongSubHash = await zns.subRegistrar.hashWithParent(longHash, freeLongSubdomain); - paidShortSubHash = await zns.subRegistrar.hashWithParent(shortHash, paidShortSubdomain); paidMediumSubHash = await zns.subRegistrar.hashWithParent(mediumHash, paidMediumSubdomain); paidLongSubHash = await zns.subRegistrar.hashWithParent(longHash, paidLongSubdomain); @@ -105,7 +138,7 @@ describe("DeployCampaign - Integration", () => { await approveBulk(users, zns); // Give the user funds - if (config.mockMeowToken) { + if (hre.network.name === "hardhat" && config.mockMeowToken) { await mintBulk( users, mintAmount, @@ -127,38 +160,19 @@ describe("DeployCampaign - Integration", () => { logger.info(`Price of ${mediumDomain} is ${priceMedium.toString()}`); logger.info(`Price of ${longDomain} is ${priceLong.toString()}`); - const balanceBeforePromises = [ - zns.meowToken.balanceOf(userA.address), - zns.meowToken.balanceOf(userB.address), - zns.meowToken.balanceOf(userC.address), - ]; - - const [balanceBeforeA, balanceBeforeB, balanceBeforeC ]= await Promise.all(balanceBeforePromises); - // 1. Register root domains // Note that this calls `setPriceConfig` internally for each TLD minted so we can also mint subdomains await registerRootDomainBulk( users, domains, - domainAddressMock.address, + config, // domainAddress "https://zns.domains/", // tokenUri distConfig, config.rootPriceConfig, - zns + zns, + logger ); - const balanceAfterPromises = [ - zns.meowToken.balanceOf(userA.address), - zns.meowToken.balanceOf(userB.address), - zns.meowToken.balanceOf(userC.address), - ]; - - const [balanceAfterA, balanceAfterB, balanceAfterC ]= await Promise.all(balanceAfterPromises); - - expect(balanceAfterA).to.equal(balanceBeforeA.sub(priceShort)); - expect(balanceAfterB).to.equal(balanceBeforeB.sub(priceMedium)); - expect(balanceAfterC).to.equal(balanceBeforeC.sub(priceLong)); - logger.info(`Domain ${shortHash} registered for user ${userA.address}`); logger.info(`Domain ${mediumHash} registered for user ${userB.address}`); logger.info(`Domain ${longHash} registered for user ${userC.address}`); @@ -169,40 +183,29 @@ describe("DeployCampaign - Integration", () => { const parents = [shortHash, mediumHash, longHash]; const subdomains = [freeShortSubdomain, freeMediumSubdomain, freeLongSubdomain]; - const balancePromises = [ - zns.meowToken.balanceOf(userA.address), - zns.meowToken.balanceOf(userB.address), - zns.meowToken.balanceOf(userC.address), - ]; - - const [balanceBeforeA, balanceBeforeB, balanceBeforeC ]= await Promise.all(balancePromises); - expect(await zns.registry.exists(freeShortSubHash)).to.be.false; expect(await zns.registry.exists(freeMediumSubHash)).to.be.false; expect(await zns.registry.exists(freeLongSubHash)).to.be.false; + const subdomainHashes = [ + freeShortSubHash, + freeMediumSubHash, + freeLongSubHash, + ]; + // 2. Register subdomains await registerSubdomainBulk( users, parents, subdomains, - domainAddressMock.address, + subdomainHashes, + config.zeroVaultAddress, "https://zns.domains/", distConfig, - zns + zns, + logger ); - const [ - balanceAfterA, - balanceAfterB, - balanceAfterC, - ]= await Promise.all(balancePromises); - - // Owners of parent domains can mint subdomains for free - expect(balanceBeforeA).to.eq(balanceAfterA); - expect(balanceBeforeB).to.eq(balanceAfterB); - expect(balanceBeforeC).to.eq(balanceAfterC); - logger.info(`Subdomain ${freeShortSubHash} registered for user ${userA.address}`); logger.info(`Subdomain ${freeMediumSubHash} registered for user ${userB.address}`); logger.info(`Subdomain ${freeLongSubHash} registered for user ${userC.address}`); @@ -229,7 +232,13 @@ describe("DeployCampaign - Integration", () => { priceShort, priceMedium, priceLong, - ] = await getPriceBulk(subdomains, zns, parents, true); + ] = await getPriceBulk(subdomains, zns, parents); + + const subdomainHashes = [ + paidShortSubHash, + paidMediumSubHash, + paidLongSubHash, + ]; expect(await zns.registry.exists(paidShortSubHash)).to.be.false; expect(await zns.registry.exists(paidMediumSubHash)).to.be.false; @@ -240,10 +249,12 @@ describe("DeployCampaign - Integration", () => { [userD, userE, userF], parents, subdomains, - domainAddressMock.address, + subdomainHashes, + config.zeroVaultAddress, "https://zns.domains/", distConfig, - zns + zns, + logger ); const balanceAfterPromises = [ @@ -259,18 +270,23 @@ describe("DeployCampaign - Integration", () => { ]= await Promise.all(balanceAfterPromises); // Owners of parent domains can mint subdomains for free - expect(balanceAfterD).to.eq(balanceBeforeD.sub(priceShort)); - expect(balanceAfterE).to.eq(balanceBeforeE.sub(priceMedium)); - expect(balanceAfterF).to.eq(balanceBeforeF.sub(priceLong)); + expect(balanceAfterD).to.eq(balanceBeforeD - priceShort); + expect(balanceAfterE).to.eq(balanceBeforeE - priceMedium); + expect(balanceAfterF).to.eq(balanceBeforeF - priceLong); logger.info(`Subdomain ${freeShortSubHash} registered for user ${userA.address}`); logger.info(`Subdomain ${freeMediumSubHash} registered for user ${userB.address}`); logger.info(`Subdomain ${freeLongSubHash} registered for user ${userC.address}`); }); + // Checkpoint here, ran other three consecutively and it was successful it("Revokes a domain correctly", async () => { // 3. Revoke domain - const tx = zns.rootRegistrar.connect(userA).revokeDomain(freeShortSubHash); + // internal promise error somewhere? issue reading 'any'? + const tx = await zns.rootRegistrar.connect(userA).revokeDomain(freeShortSubHash); + + if (hre.network.name !== "hardhat") await tx.wait(1); + await expect(tx).to.emit(zns.rootRegistrar, "DomainRevoked").withArgs(freeShortSubHash, userA.address, false); logger.info( "info", @@ -280,15 +296,18 @@ describe("DeployCampaign - Integration", () => { it("Reclaims a domain correctly", async () => { // 4. Reclaim domain - await zns.registry.connect(userB).updateDomainOwner(freeMediumSubHash, userA.address); + const tx = await zns.registry.connect(userB).updateDomainOwner(freeMediumSubHash, userA.address); logger.info( - "info", `Subdomain ${freeMediumSubHash} ownership given to user ${userA.address} from user ${userB.address}` ); - const tx = zns.rootRegistrar.connect(userB).reclaimDomain(freeMediumSubHash); + if (hre.network.name !== "hardhat") await tx.wait(1); - await expect(tx).to.emit(zns.rootRegistrar, "DomainReclaimed").withArgs(freeMediumSubHash, userB.address); + const tx1 = await zns.rootRegistrar.connect(userB).reclaimDomain(freeMediumSubHash); + + if (hre.network.name !== "hardhat") await tx1.wait(1); + + await expect(tx1).to.emit(zns.rootRegistrar, "DomainReclaimed").withArgs(freeMediumSubHash, userB.address); expect(await zns.registry.getDomainOwner(freeMediumSubHash)).to.equal(userB.address); logger.info(`Subdomain ${freeMediumSubHash} reclaimed by user ${userB.address} from user ${userA.address}`); @@ -296,17 +315,23 @@ describe("DeployCampaign - Integration", () => { it("Reclaims then revokes correctly", async () => { // 5. Reclaim and revoke domain - const tx = zns.registry.connect(userC).updateDomainOwner(freeLongSubHash, userA.address); + const tx = await zns.registry.connect(userC).updateDomainOwner(freeLongSubHash, userA.address); await expect(tx).to.emit(zns.registry, "DomainOwnerSet").withArgs(freeLongSubHash, userA.address); logger.info(`Subdomain ${freeLongSubHash} ownership given to user ${userA.address} from user ${userC.address}`); - const tx1 = zns.rootRegistrar.connect(userC).reclaimDomain(freeLongSubHash); + if (hre.network.name !== "hardhat") await tx.wait(1); + + const tx1 = await zns.rootRegistrar.connect(userC).reclaimDomain(freeLongSubHash); await expect(tx1).to.emit(zns.rootRegistrar, "DomainReclaimed").withArgs(freeLongSubHash, userC.address); + if (hre.network.name !== "hardhat") await tx1.wait(1); + logger.info(`Subdomain ${freeLongSubHash} reclaimed by user ${userC.address}`); expect(await zns.registry.getDomainOwner(freeLongSubHash)).to.equal(userC.address); - const tx2 = zns.rootRegistrar.connect(userC).revokeDomain(freeLongSubHash); + const tx2 = await zns.rootRegistrar.connect(userC).revokeDomain(freeLongSubHash); + if (hre.network.name !== "hardhat") await tx2.wait(1); + await expect(tx2).to.emit(zns.rootRegistrar, "DomainRevoked").withArgs(freeLongSubHash, userC.address, false); logger.info(`Subdomain ${freeLongSubHash} revoked by user ${userC.address}`); }); diff --git a/test/DeployCampaignInt.test.ts b/test/DeployCampaignInt.test.ts index 9004731c6..3944b552c 100644 --- a/test/DeployCampaignInt.test.ts +++ b/test/DeployCampaignInt.test.ts @@ -1,6 +1,7 @@ /* eslint-disable @typescript-eslint/no-empty-function, @typescript-eslint/ban-ts-comment, max-classes-per-file */ import * as hre from "hardhat"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; +import { expect } from "chai"; import { DEFAULT_ROYALTY_FRACTION, DEFAULT_PRICE_CONFIG, @@ -10,9 +11,8 @@ import { NO_MOCK_PROD_ERR, STAKING_TOKEN_ERR, INVALID_CURVE_ERR, - MONGO_URI_ERR, erc1967ProxyName, + MONGO_URI_ERR, } from "./helpers"; -import { expect } from "chai"; import { MeowTokenDM, meowTokenName, @@ -23,7 +23,7 @@ import { ZNSDomainTokenDM, ZNSFixedPricerDM, ZNSRegistryDM, ZNSRootRegistrarDM, ZNSSubRegistrarDM, ZNSTreasuryDM, } from "../src/deploy/missions/contracts"; -import { transparentProxyName, znsNames } from "../src/deploy/missions/contracts/names"; +import { znsNames } from "../src/deploy/missions/contracts/names"; import { IDeployCampaignConfig, TZNSContractState, TLogger } from "../src/deploy/campaign/types"; import { runZnsCampaign } from "../src/deploy/zns-campaign"; import { MeowMainnet } from "../src/deploy/missions/contracts/meow-token/mainnet-data"; @@ -31,19 +31,18 @@ import { HardhatDeployer } from "../src/deploy/deployer/hardhat-deployer"; import { DeployCampaign } from "../src/deploy/campaign/deploy-campaign"; import { getMongoAdapter, resetMongoAdapter } from "../src/deploy/db/mongo-adapter/get-adapter"; import { BaseDeployMission } from "../src/deploy/missions/base-deploy-mission"; -import { ProxyKinds, ResolverTypes } from "../src/deploy/constants"; +import { ResolverTypes } from "../src/deploy/constants"; import { MongoDBAdapter } from "../src/deploy/db/mongo-adapter/mongo-adapter"; -import { getConfig, validate } from "../src/deploy/campaign/environments"; -import { ethers, BigNumber } from "ethers"; +import { getConfig } from "../src/deploy/campaign/environments"; +import { ethers } from "ethers"; import { promisify } from "util"; import { exec } from "child_process"; -import { TDeployArgs } from "../src/deploy/missions/types"; -import { ContractByName } from "@tenderly/hardhat-tenderly/dist/tenderly/types"; +import { ITenderlyContractData, TDeployArgs } from "../src/deploy/missions/types"; import { saveTag } from "../src/utils/git-tag/save-tag"; import { VERSION_TYPES } from "../src/deploy/db/mongo-adapter/constants"; -const execAsync = promisify(exec); +const execAsync = promisify(exec); describe("Deploy Campaign Test", () => { let deployAdmin : SignerWithAddress; @@ -58,14 +57,16 @@ describe("Deploy Campaign Test", () => { let mongoAdapter : MongoDBAdapter; + const env = "dev"; + before(async () => { [deployAdmin, admin, governor, zeroVault, userA, userB] = await hre.ethers.getSigners(); }); describe("MEOW Token Ops", () => { before(async () => { - campaignConfig = { + env, deployAdmin, governorAddresses: [deployAdmin.address], adminAddresses: [deployAdmin.address, admin.address], @@ -94,15 +95,17 @@ describe("Deploy Campaign Test", () => { const { meowToken, dbAdapter } = campaign; - const toMint = hre.ethers.utils.parseEther("972315"); + const toMint = hre.ethers.parseEther("972315"); + + const balanceBefore = await meowToken.balanceOf(userA.address); // `mint()` only exists on the Mocked contract await meowToken.connect(deployAdmin).mint( userA.address, toMint ); - const balance = await meowToken.balanceOf(userA.address); - expect(balance).to.equal(toMint); + const balanceAfter = await meowToken.balanceOf(userA.address); + expect(balanceAfter - balanceBefore).to.equal(toMint); await dbAdapter.dropDB(); }); @@ -119,9 +122,9 @@ describe("Deploy Campaign Test", () => { kind: "transparent", }); - await meow.deployed(); + await meow.waitForDeployment(); - campaignConfig.stakingTokenAddress = meow.address; + campaignConfig.stakingTokenAddress = await meow.getAddress(); const campaign = await runZnsCampaign({ config: campaignConfig, @@ -139,9 +142,8 @@ describe("Deploy Campaign Test", () => { expect(meowToken.address).to.equal(meow.address); expect(meowDMInstance.contractName).to.equal(znsNames.meowToken.contract); - // TODO dep: what else ?? - const toMint = hre.ethers.utils.parseEther("972315"); + const toMint = hre.ethers.parseEther("972315"); // `mint()` only exists on the Mocked contract try { await meowToken.connect(deployAdmin).mint( @@ -156,6 +158,7 @@ describe("Deploy Campaign Test", () => { ); } + // Cannot call to real db to await dbAdapter.dropDB(); }); }); @@ -195,7 +198,7 @@ describe("Deploy Campaign Test", () => { // eslint-disable-next-line no-shadow callback ?: (failingCampaign : DeployCampaign) => Promise; }) => { - const deployer = new HardhatDeployer(deployAdmin); + const deployer = new HardhatDeployer(deployAdmin, env); let dbAdapter = await getMongoAdapter(); let toMatchErr = errorMsgDeploy; @@ -228,7 +231,7 @@ describe("Deploy Campaign Test", () => { expect(contracts[failingInstanceName]).to.be.undefined; } else { // it should deploy AddressResolver - expect(contracts[failingInstanceName].address).to.be.properAddress; + expect(await contracts[failingInstanceName].getAddress()).to.be.properAddress; } // check DB to verify we only deployed half @@ -286,7 +289,7 @@ describe("Deploy Campaign Test", () => { expect(Object.keys(state.instances).length).to.equal(10); expect(state.missions.length).to.equal(10); // it should deploy AddressResolver - expect(state.contracts.addressResolver.address).to.be.properAddress; + expect(await state.contracts.addressResolver.getAddress()).to.be.properAddress; // check DB to verify we deployed everything const allNames = deployedNames.concat(undeployedNames); @@ -311,7 +314,7 @@ describe("Deploy Campaign Test", () => { const fromState = nextCampaign[instance]; expect(fromDB?.address).to.equal(address); - expect(fromState.address).to.equal(address); + expect(await fromState.getAddress()).to.equal(address); }, Promise.resolve() ); @@ -327,6 +330,7 @@ describe("Deploy Campaign Test", () => { [deployAdmin, admin, zeroVault] = await hre.ethers.getSigners(); campaignConfig = { + env, deployAdmin, governorAddresses: [deployAdmin.address], adminAddresses: [deployAdmin.address, admin.address], @@ -439,7 +443,7 @@ describe("Deploy Campaign Test", () => { } = failingCampaign; // we are checking that postDeploy did not add resolverType to Registry - expect(await registry.getResolverType(ResolverTypes.address)).to.be.equal(ethers.constants.AddressZero); + expect(await registry.getResolverType(ResolverTypes.address)).to.be.equal(ethers.ZeroAddress); }; // check contracts are deployed correctly @@ -470,7 +474,7 @@ describe("Deploy Campaign Test", () => { registry, addressResolver, } = nextCampaign; - expect(await registry.getResolverType(ResolverTypes.address)).to.be.equal(addressResolver.address); + expect(await registry.getResolverType(ResolverTypes.address)).to.be.equal(await addressResolver.getAddress()); }); // eslint-disable-next-line max-len @@ -557,7 +561,7 @@ describe("Deploy Campaign Test", () => { } = failingCampaign; // we are checking that postDeploy did not grant REGISTRAR_ROLE to RootRegistrar - expect(await accessController.isRegistrar(rootRegistrar.address)).to.be.false; + expect(await accessController.isRegistrar(await rootRegistrar.getAddress())).to.be.false; }; // check contracts are deployed correctly @@ -588,11 +592,21 @@ describe("Deploy Campaign Test", () => { accessController, rootRegistrar, } = nextCampaign; - expect(await accessController.isRegistrar(rootRegistrar.address)).to.be.true; + expect(await accessController.isRegistrar(await rootRegistrar.getAddress())).to.be.true; }); }); describe("Configurable Environment & Validation", () => { + let envInitial : string; + + beforeEach(async () => { + envInitial = JSON.stringify(process.env); + }); + + afterEach(async () => { + process.env = JSON.parse(envInitial); + }); + // The `validate` function accepts the environment parameter only for the // purpose of testing here as manipulating actual environment variables // like `process.env. = "value"` is not possible in a test environment @@ -601,21 +615,21 @@ describe("Deploy Campaign Test", () => { // for the environment specifically, that is ever only inferred from the `process.env.ENV_LEVEL` it("Gets the default configuration correctly", async () => { // set the environment to get the appropriate variables - const localConfig : IDeployCampaignConfig = await getConfig( - deployAdmin, - zeroVault, - [governor.address], - [admin.address], - ); + const localConfig : IDeployCampaignConfig = await getConfig({ + deployer: deployAdmin, + zeroVaultAddress: zeroVault.address, + governors: [governor.address], + admins: [admin.address], + }); - expect(localConfig.deployAdmin.address).to.eq(deployAdmin.address); + expect(await localConfig.deployAdmin.getAddress()).to.eq(deployAdmin.address); expect(localConfig.governorAddresses[0]).to.eq(governor.address); - expect(localConfig.governorAddresses[1]).to.be.undefined; + expect(localConfig.governorAddresses[1]).to.eq(deployAdmin.address); expect(localConfig.adminAddresses[0]).to.eq(admin.address); - expect(localConfig.adminAddresses[1]).to.be.undefined; + expect(localConfig.adminAddresses[1]).to.eq(deployAdmin.address); expect(localConfig.domainToken.name).to.eq(ZNS_DOMAIN_TOKEN_NAME); expect(localConfig.domainToken.symbol).to.eq(ZNS_DOMAIN_TOKEN_SYMBOL); - expect(localConfig.domainToken.defaultRoyaltyReceiver).to.eq(deployAdmin.address); + expect(localConfig.domainToken.defaultRoyaltyReceiver).to.eq(zeroVault.address); expect(localConfig.domainToken.defaultRoyaltyFraction).to.eq(DEFAULT_ROYALTY_FRACTION); expect(localConfig.rootPriceConfig).to.deep.eq(DEFAULT_PRICE_CONFIG); }); @@ -633,12 +647,12 @@ describe("Deploy Campaign Test", () => { let zns : TZNSContractState; - const config : IDeployCampaignConfig = getConfig( - userB, - userA, - [userB.address, admin.address], // governors - [userB.address, governor.address], // admins - ); + const config : IDeployCampaignConfig = await getConfig({ + deployer: userB, + zeroVaultAddress: userA.address, + governors: [userB.address, admin.address], // governors + admins: [userB.address, governor.address], // admins + }); const campaign = await runZnsCampaign({ config, @@ -649,12 +663,12 @@ describe("Deploy Campaign Test", () => { /* eslint-disable-next-line prefer-const */ zns = campaign.state.contracts; - const rootPaymentConfig = await zns.treasury.paymentConfigs(ethers.constants.HashZero); + const rootPaymentConfig = await zns.treasury.paymentConfigs(ethers.ZeroHash); expect(await zns.accessController.isAdmin(userB.address)).to.be.true; expect(await zns.accessController.isAdmin(governor.address)).to.be.true; expect(await zns.accessController.isGovernor(admin.address)).to.be.true; - expect(rootPaymentConfig.token).to.eq(zns.meowToken.address); + expect(rootPaymentConfig.token).to.eq(await zns.meowToken.getAddress()); expect(rootPaymentConfig.beneficiary).to.eq(userA.address); await dbAdapter.dropDB(); @@ -695,14 +709,12 @@ describe("Deploy Campaign Test", () => { it("Throws if env variable is invalid", async () => { try { - const config = await getConfig( - deployAdmin, - zeroVault, - [deployAdmin.address, governor.address], - [deployAdmin.address, admin.address], - ); - - validate(config, "other"); + await getConfig({ + deployer: deployAdmin, + zeroVaultAddress: zeroVault.address, + governors: [deployAdmin.address, governor.address], + admins: [deployAdmin.address, admin.address], + }); /* eslint-disable @typescript-eslint/no-explicit-any */ } catch (e : any) { @@ -711,16 +723,15 @@ describe("Deploy Campaign Test", () => { }); it("Fails to validate when mocking MEOW on prod", async () => { + process.env.MOCK_MEOW_TOKEN = "true"; + try { - const config = await getConfig( - deployAdmin, - zeroVault, - [deployAdmin.address, governor.address], - [deployAdmin.address, admin.address], - ); - // Modify the config - config.mockMeowToken = true; - validate(config, "prod"); + await getConfig({ + deployer: deployAdmin, + zeroVaultAddress: zeroVault.address, + governors: [deployAdmin.address, governor.address], + admins: [deployAdmin.address, admin.address], + }); /* eslint-disable @typescript-eslint/no-explicit-any */ } catch (e : any) { @@ -729,18 +740,16 @@ describe("Deploy Campaign Test", () => { }); it("Fails to validate if not using the MEOW token on prod", async () => { - try { - const config = await getConfig( - deployAdmin, - zeroVault, - [deployAdmin.address, governor.address], - [deployAdmin.address, admin.address], - ); + process.env.MOCK_MEOW_TOKEN = "false"; + process.env.STAKING_TOKEN_ADDRESS = "0x123"; - config.mockMeowToken = false; - config.stakingTokenAddress = "0x123"; - - validate(config, "prod"); + try { + await getConfig({ + deployer: deployAdmin, + zeroVaultAddress: zeroVault.address, + governors: [deployAdmin.address, governor.address], + admins: [deployAdmin.address, admin.address], + }); /* eslint-disable @typescript-eslint/no-explicit-any */ } catch (e : any) { expect(e.message).includes(STAKING_TOKEN_ERR); @@ -748,22 +757,21 @@ describe("Deploy Campaign Test", () => { }); it("Fails to validate if invalid curve for pricing", async () => { - try { - const config = await getConfig( - deployAdmin, - zeroVault, - [deployAdmin.address, governor.address], - [deployAdmin.address, admin.address], - ); - - config.mockMeowToken = false; - config.stakingTokenAddress = MeowMainnet.address; - config.rootPriceConfig.baseLength = BigNumber.from(3); - config.rootPriceConfig.maxLength = BigNumber.from(5); - config.rootPriceConfig.maxPrice = ethers.constants.Zero; - config.rootPriceConfig.minPrice = ethers.utils.parseEther("3"); + process.env.MOCK_MEOW_TOKEN = "false"; + process.env.STAKING_TOKEN_ADDRESS = MeowMainnet.address; + process.env.BASE_LENGTH = "3"; + process.env.MAX_LENGTH = "5"; + process.env.MAX_PRICE = "0"; + process.env.MIN_PRICE = ethers.parseEther("3").toString(); - validate(config, "prod"); + try { + await getConfig({ + env: "prod", + deployer: deployAdmin, + zeroVaultAddress: zeroVault.address, + governors: [deployAdmin.address, governor.address], + admins: [deployAdmin.address, admin.address], + }); /* eslint-disable @typescript-eslint/no-explicit-any */ } catch (e : any) { expect(e.message).includes(INVALID_CURVE_ERR); @@ -771,42 +779,39 @@ describe("Deploy Campaign Test", () => { }); it("Fails to validate if no mongo uri or local URI in prod", async () => { - try { - const config = await getConfig( - deployAdmin, - zeroVault, - [deployAdmin.address, governor.address], - [deployAdmin.address, admin.address], - ); - - config.mockMeowToken = false; - config.stakingTokenAddress = MeowMainnet.address; - - // Normally we would call to an env variable to grab this value - const uri = ""; + process.env.MOCK_MEOW_TOKEN = "false"; + process.env.STAKING_TOKEN_ADDRESS = MeowMainnet.address; + // Falls back onto the default URI which is for localhost and fails in prod + process.env.MONGO_URI = ""; + process.env.ROYALTY_RECEIVER = "0x123"; + process.env.ROYALTY_FRACTION = "100"; - // Falls back onto the default URI which is for localhost and fails in prod - validate(config, "prod", uri); + try { + await getConfig({ + env: "prod", + deployer: deployAdmin, + zeroVaultAddress: zeroVault.address, + governors: [deployAdmin.address, governor.address], + admins: [deployAdmin.address, admin.address], + }); /* eslint-disable @typescript-eslint/no-explicit-any */ } catch (e : any) { - expect(e.message).includes(MONGO_URI_ERR); + expect(e.message).includes("Must provide a Mongo URI used for prod environment!"); } - try { - const config = await getConfig( - deployAdmin, - zeroVault, - [deployAdmin.address, governor.address], - [deployAdmin.address, admin.address], - ); - - config.mockMeowToken = false; - config.stakingTokenAddress = MeowMainnet.address; + process.env.MOCK_MEOW_TOKEN = "false"; + process.env.STAKING_TOKEN_ADDRESS = MeowMainnet.address; + process.env.MONGO_URI = "mongodb://localhost:27018"; + process.env.ZERO_VAULT_ADDRESS = "0x123"; - // Normally we would call to an env variable to grab this value - const uri = "mongodb://localhost:27018"; - - validate(config, "prod", uri); + try { + await getConfig({ + env: "prod", + deployer: deployAdmin, + zeroVaultAddress: zeroVault.address, + governors: [deployAdmin.address, governor.address], + admins: [deployAdmin.address, admin.address], + }); /* eslint-disable @typescript-eslint/no-explicit-any */ } catch (e : any) { expect(e.message).includes(MONGO_URI_ERR); @@ -814,7 +819,6 @@ describe("Deploy Campaign Test", () => { }); }); - // TODO dep: add more versioning tests here for DB versions! describe("Versioning", () => { let campaign : DeployCampaign; @@ -822,8 +826,9 @@ describe("Deploy Campaign Test", () => { await saveTag(); campaignConfig = { + env, deployAdmin, - governorAddresses: [deployAdmin.address], + governorAddresses: [deployAdmin.address, governor.address], adminAddresses: [deployAdmin.address, admin.address], domainToken: { name: ZNS_DOMAIN_TOKEN_NAME, @@ -988,7 +993,7 @@ describe("Deploy Campaign Test", () => { expect(oldRegistryDocFromNewDB?.bytecode).to.equal(registryDocInitial?.bytecode); // make sure contracts in state have been picked up correctly from DB - expect(newContracts.registry.address).to.equal(registryDocInitial?.address); + expect(await newContracts.registry.getAddress()).to.equal(registryDocInitial?.address); // reset back to default process.env.MONGO_DB_VERSION = initialDBVersionVal; @@ -999,11 +1004,12 @@ describe("Deploy Campaign Test", () => { let config : IDeployCampaignConfig; before (async () => { - [deployAdmin, admin, zeroVault] = await hre.ethers.getSigners(); + [deployAdmin, admin, governor, zeroVault] = await hre.ethers.getSigners(); config = { + env: "dev", deployAdmin, - governorAddresses: [deployAdmin.address], + governorAddresses: [deployAdmin.address, governor.address], adminAddresses: [deployAdmin.address, admin.address], domainToken: { name: ZNS_DOMAIN_TOKEN_NAME, @@ -1038,41 +1044,46 @@ describe("Deploy Campaign Test", () => { } } - const deployer = new HardhatDeployerMock(deployAdmin); + const deployer = new HardhatDeployerMock(deployAdmin, env); const campaign = await runZnsCampaign({ - deployer, config, + deployer, }); const { state: { contracts } } = campaign; ({ dbAdapter: mongoAdapter } = campaign); - Object.values(contracts).forEach(({ address }, idx) => { - if (idx === 0) { - expect(verifyData[idx].ctorArgs).to.be.deep.eq([config.governorAddresses, config.adminAddresses]); - } + await Object.values(contracts).reduce( + async (acc, contract, idx) => { + await acc; - expect(verifyData[idx].address).to.equal(address); - }); + if (idx === 0) { + expect(verifyData[idx].ctorArgs).to.be.deep.eq([config.governorAddresses, config.adminAddresses]); + } + + expect(verifyData[idx].address).to.equal(await contract.getAddress()); + }, + Promise.resolve() + ); }); it("should prepare the correct contract data when pushing to Tenderly Project", async () => { - let tenderlyData : Array = []; + let tenderlyData : Array = []; class HardhatDeployerMock extends HardhatDeployer { - async tenderlyVerify (contracts : Array) { + async tenderlyPush (contracts : Array) { tenderlyData = contracts; } } - const deployer = new HardhatDeployerMock(deployAdmin); + const deployer = new HardhatDeployerMock(deployAdmin, env); config.postDeploy.monitorContracts = true; config.postDeploy.verifyContracts = false; const campaign = await runZnsCampaign({ - deployer, config, + deployer, }); const { state: { instances } } = campaign; @@ -1086,22 +1097,19 @@ describe("Deploy Campaign Test", () => { const dbData = await instance.getFromDB(); if (instance.proxyData.isProxy) { - const proxyName = instance.proxyData.kind === ProxyKinds.uups - ? erc1967ProxyName - : transparentProxyName; // check proxy expect(tenderlyData[idx].address).to.be.eq(dbData?.address); - expect(tenderlyData[idx].name).to.be.eq(proxyName); + expect(tenderlyData[idx].display_name).to.be.eq(`${instance.contractName}Proxy`); // check impl expect(tenderlyData[idx + 1].address).to.be.eq(dbData?.implementation); - expect(tenderlyData[idx + 1].name).to.be.eq(dbData?.name); - expect(tenderlyData[idx + 1].name).to.be.eq(instance.contractName); + expect(tenderlyData[idx + 1].display_name).to.be.eq(`${dbData?.name}Impl`); + expect(tenderlyData[idx + 1].display_name).to.be.eq(`${instance.contractName}Impl`); idx += 2; } else { expect(tenderlyData[idx].address).to.equal(dbData?.address); - expect(tenderlyData[idx].name).to.equal(dbData?.name); - expect(tenderlyData[idx].name).to.equal(instance.contractName); + expect(tenderlyData[idx].display_name).to.equal(dbData?.name); + expect(tenderlyData[idx].display_name).to.equal(instance.contractName); idx++; } }, diff --git a/test/ZNSAccessController.test.ts b/test/ZNSAccessController.test.ts index 13a0e1bf0..c2791c6d2 100644 --- a/test/ZNSAccessController.test.ts +++ b/test/ZNSAccessController.test.ts @@ -1,5 +1,5 @@ import * as hre from "hardhat"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { ZNSAccessController } from "../typechain"; import { deployAccessController } from "./helpers"; import { expect } from "chai"; @@ -52,8 +52,8 @@ describe("ZNSAccessController", () => { await expect( deployAccessController({ deployer, - governorAddresses: [ ethers.constants.AddressZero ], - adminAddresses: [ ethers.constants.AddressZero ], + governorAddresses: [ ethers.ZeroAddress ], + adminAddresses: [ ethers.ZeroAddress ], }) ).to.be.revertedWith("ZNSAccessController: Can't grant role to zero address"); }); @@ -177,11 +177,11 @@ describe("ZNSAccessController", () => { }); it("Should revert when setting role admin without GOVERNOR_ROLE", async () => { - const [ { address: random } ] = randomAccs; + const [ random ] = randomAccs; await expect( accessController.connect(random).setRoleAdmin(REGISTRAR_ROLE, EXECUTOR_ROLE) ).to.be.revertedWith( - getAccessRevertMsg(random, GOVERNOR_ROLE) + getAccessRevertMsg(random.address, GOVERNOR_ROLE) ); }); }); @@ -215,38 +215,38 @@ describe("ZNSAccessController", () => { }); it("Should revert if account does not have GOVERNOR_ROLE", async () => { - const [ { address: random } ] = randomAccs; + const [ random ] = randomAccs; await expect( - accessController.connect(random).checkGovernor(random) + accessController.connect(random).checkGovernor(random.address) ).to.be.revertedWith( - getAccessRevertMsg(random, GOVERNOR_ROLE) + getAccessRevertMsg(random.address, GOVERNOR_ROLE) ); }); it("Should revert if account does not have ADMIN_ROLE", async () => { - const [ { address: random } ] = randomAccs; + const [ random ] = randomAccs; await expect( - accessController.connect(random).checkAdmin(random) + accessController.connect(random).checkAdmin(random.address) ).to.be.revertedWith( - getAccessRevertMsg(random, ADMIN_ROLE) + getAccessRevertMsg(random.address, ADMIN_ROLE) ); }); it("Should revert if account does not have REGISTRAR_ROLE", async () => { - const [ { address: random } ] = randomAccs; + const [ random ] = randomAccs; await expect( - accessController.connect(random).checkRegistrar(random) + accessController.connect(random).checkRegistrar(random.address) ).to.be.revertedWith( - getAccessRevertMsg(random, REGISTRAR_ROLE) + getAccessRevertMsg(random.address, REGISTRAR_ROLE) ); }); it("Should revert if account does not have EXECUTOR_ROLE", async () => { - const [ { address: random } ] = randomAccs; + const [ random ] = randomAccs; await expect( - accessController.connect(random).checkExecutor(random) + accessController.connect(random).checkExecutor(random.address) ).to.be.revertedWith( - getAccessRevertMsg(random, EXECUTOR_ROLE) + getAccessRevertMsg(random.address, EXECUTOR_ROLE) ); }); }); diff --git a/test/ZNSAddressResolver.test.ts b/test/ZNSAddressResolver.test.ts index 4a8095c92..33d64c3aa 100644 --- a/test/ZNSAddressResolver.test.ts +++ b/test/ZNSAddressResolver.test.ts @@ -1,7 +1,12 @@ import * as hre from "hardhat"; -import { ERC165__factory, ZNSAddressResolver__factory, ZNSAddressResolverUpgradeMock__factory } from "../typechain"; +import { + ERC165__factory, + ZNSAddressResolver, + ZNSAddressResolver__factory, + ZNSAddressResolverUpgradeMock__factory, +} from "../typechain"; import { DeployZNSParams, IZNSContracts } from "./helpers/types"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { hashDomainLabel, hashSubdomainName } from "./helpers/hashing"; import { ADMIN_ROLE, @@ -46,7 +51,7 @@ describe("ZNSAddressResolver", () => { await zns.accessController.connect(deployer).grantRole(REGISTRAR_ROLE, mockRegistrar.address); - await zns.registry.connect(deployer).addResolverType(DEFAULT_RESOLVER_TYPE, zns.addressResolver.address); + await zns.registry.connect(deployer).addResolverType(DEFAULT_RESOLVER_TYPE, await zns.addressResolver.getAddress()); await zns.registry.connect(mockRegistrar) .createDomainRecord( @@ -58,8 +63,8 @@ describe("ZNSAddressResolver", () => { it("Should NOT let initialize the implementation contract", async () => { const factory = new ZNSAddressResolver__factory(deployer); - const impl = await getProxyImplAddress(zns.addressResolver.address); - const implContract = factory.attach(impl); + const impl = await getProxyImplAddress(await zns.addressResolver.getAddress()); + const implContract = factory.attach(impl) as ZNSAddressResolver; await expect( implContract.initialize( @@ -72,18 +77,18 @@ describe("ZNSAddressResolver", () => { it("Should get the AddressResolver", async () => { // Copy of registry tests // The domain exists const existResolver = await zns.registry.getDomainResolver(wilderDomainHash); - expect(existResolver).to.eq(zns.addressResolver.address); + expect(existResolver).to.eq(await zns.addressResolver.getAddress()); }); it("Returns 0 when the domain doesnt exist", async () => { // The domain does not exist const someDomainHash = hashDomainLabel("random-record"); const notExistResolver = await zns.registry.getDomainResolver(someDomainHash); - expect(notExistResolver).to.eq(hre.ethers.constants.AddressZero); + expect(notExistResolver).to.eq(hre.ethers.ZeroAddress); }); it("Should have registry address correctly set", async () => { - expect(await zns.addressResolver.registry()).to.equal(zns.registry.address); + expect(await zns.addressResolver.registry()).to.equal(await zns.registry.getAddress()); }); it("Should setRegistry() correctly with ADMIN_ROLE", async () => { @@ -154,13 +159,13 @@ describe("ZNSAddressResolver", () => { await expect( zns.addressResolver.connect(mockRegistrar) - .setAddress(wilderDomainHash, hre.ethers.constants.AddressZero) + .setAddress(wilderDomainHash, hre.ethers.ZeroAddress) ) .to.emit(zns.addressResolver, "AddressSet") - .withArgs(wilderDomainHash, hre.ethers.constants.AddressZero); + .withArgs(wilderDomainHash, hre.ethers.ZeroAddress); const address = await zns.addressResolver.resolveDomainAddress(wilderDomainHash); - expect(address).to.eq(hre.ethers.constants.AddressZero); + expect(address).to.eq(hre.ethers.ZeroAddress); }); @@ -179,8 +184,10 @@ describe("ZNSAddressResolver", () => { it("Should support the ERC-165 interface ID", async () => { const erc165Interface = ERC165__factory.createInterface(); - const interfaceId = erc165Interface.getSighash(erc165Interface.functions["supportsInterface(bytes4)"]); - const supported = await zns.addressResolver.supportsInterface(interfaceId); + + const fragment = erc165Interface.getFunction("supportsInterface"); + + const supported = await zns.addressResolver.supportsInterface(fragment.selector); expect(supported).to.be.true; }); @@ -193,7 +200,7 @@ describe("ZNSAddressResolver", () => { await zns.addressResolver.connect(deployer).setAddress(wilderDomainHash, user.address); const resolverAddress = await zns.registry.getDomainResolver(wilderDomainHash); - expect(resolverAddress).to.eq(zns.addressResolver.address); + expect(resolverAddress).to.eq(await zns.addressResolver.getAddress()); const resolvedAddress = await zns.addressResolver.resolveDomainAddress(wilderDomainHash); expect(resolvedAddress).to.eq(user.address); @@ -204,14 +211,14 @@ describe("ZNSAddressResolver", () => { // AddressResolver to upgrade to const factory = new ZNSAddressResolverUpgradeMock__factory(deployer); const newAddressResolver = await factory.deploy(); - await newAddressResolver.deployed(); + await newAddressResolver.waitForDeployment(); // Confirm the deployer is a governor expect( await zns.accessController.hasRole(GOVERNOR_ROLE, deployer.address) ).to.be.true; - const upgradeTx = zns.domainToken.connect(deployer).upgradeTo(newAddressResolver.address); + const upgradeTx = zns.domainToken.connect(deployer).upgradeTo(await newAddressResolver.getAddress()); await expect(upgradeTx).to.not.be.reverted; }); @@ -221,7 +228,7 @@ describe("ZNSAddressResolver", () => { // DomainToken to upgrade to const newAddressResolver = await factory.deploy(); - await newAddressResolver.deployed(); + await newAddressResolver.waitForDeployment(); // Confirm the operator is not a governor await expect( @@ -230,7 +237,7 @@ describe("ZNSAddressResolver", () => { getAccessRevertMsg(operator.address, GOVERNOR_ROLE) ); - const upgradeTx = zns.domainToken.connect(operator).upgradeTo(newAddressResolver.address); + const upgradeTx = zns.domainToken.connect(operator).upgradeTo(await newAddressResolver.getAddress()); await expect(upgradeTx).to.be.revertedWith( getAccessRevertMsg(operator.address, GOVERNOR_ROLE) @@ -241,7 +248,7 @@ describe("ZNSAddressResolver", () => { // AddressResolver to upgrade to const factory = new ZNSAddressResolverUpgradeMock__factory(deployer); const newResolver = await factory.deploy(); - await newResolver.deployed(); + await newResolver.waitForDeployment(); await zns.addressResolver.connect(mockRegistrar).setAddress(wilderDomainHash, user.address); diff --git a/test/ZNSCurvePricer.test.ts b/test/ZNSCurvePricer.test.ts index 2b73be8d9..976a7d69e 100644 --- a/test/ZNSCurvePricer.test.ts +++ b/test/ZNSCurvePricer.test.ts @@ -1,8 +1,7 @@ import * as hre from "hardhat"; import { expect } from "chai"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; -import { BigNumber, ethers } from "ethers"; -import { parseEther } from "ethers/lib/utils"; +import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; +import { ethers } from "ethers"; import { IZNSContracts } from "./helpers/types"; import { deployZNS, @@ -14,24 +13,25 @@ import { NOT_AUTHORIZED_REG_WIRED_ERR, CURVE_NO_ZERO_PRECISION_MULTIPLIER_ERR, INVALID_LENGTH_ERR, - INVALID_NAME_ERR, + INVALID_NAME_ERR, INITIALIZED_ERR, } from "./helpers"; import { AccessType, DEFAULT_DECIMALS, DEFAULT_PRICE_CONFIG, - DEFAULT_REGISTRATION_FEE_PERCENT, + DEFAULT_PROTOCOL_FEE_PERCENT, } from "./helpers/constants"; import { getAccessRevertMsg, } from "./helpers/errors"; import { ADMIN_ROLE, GOVERNOR_ROLE } from "../src/deploy/constants"; -import { ZNSCurvePricerUpgradeMock__factory, ZNSCurvePricer__factory } from "../typechain"; +import { ZNSCurvePricer, ZNSCurvePricerUpgradeMock__factory, ZNSCurvePricer__factory } from "../typechain"; import { registrationWithSetup } from "./helpers/register-setup"; +import { getProxyImplAddress } from "./helpers/utils"; require("@nomicfoundation/hardhat-chai-matchers"); -const { HashZero } = ethers.constants; +const { ZeroHash } = ethers; describe("ZNSCurvePricer", () => { let deployer : SignerWithAddress; @@ -58,17 +58,17 @@ describe("ZNSCurvePricer", () => { adminAddresses: [admin.address], }); - await zns.meowToken.connect(user).approve(zns.treasury.address, ethers.constants.MaxUint256); + await zns.meowToken.connect(user).approve(await zns.treasury.getAddress(), ethers.MaxUint256); await zns.meowToken.mint(user.address, DEFAULT_PRICE_CONFIG.maxPrice); const fullConfig = { distrConfig: { paymentType: PaymentType.DIRECT, - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), accessType: AccessType.OPEN, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: user.address, }, priceConfig: DEFAULT_PRICE_CONFIG, @@ -82,20 +82,19 @@ describe("ZNSCurvePricer", () => { }); }); - // TODO uncomment and resolve error after fixing merge conflict - // it("Should NOT let initialize the implementation contract", async () => { - // const factory = new ZNSCurvePricer__factory(deployer); - // const impl = await getProxyImplAddress(zns.curvePricer.address); - // const implContract = factory.attach(impl); - - // await expect( - // implContract.initialize( - // zns.accessController.address, - // zns.registry.address, - // priceConfigDefault - // ) - // ).to.be.revertedWith(INITIALIZED_ERR); - // }); + it("Should NOT let initialize the implementation contract", async () => { + const factory = new ZNSCurvePricer__factory(deployer); + const impl = await getProxyImplAddress(await zns.curvePricer.getAddress()); + const implContract = factory.attach(impl) as ZNSCurvePricer; + + await expect( + implContract.initialize( + await zns.accessController.getAddress(), + await zns.registry.getAddress(), + DEFAULT_PRICE_CONFIG + ) + ).to.be.revertedWith(INITIALIZED_ERR); + }); it("Confirms values were initially set correctly", async () => { const valueCalls = [ @@ -117,8 +116,8 @@ describe("ZNSCurvePricer", () => { const regFromSC = await zns.curvePricer.registry(); const acFromSC = await zns.curvePricer.getAccessController(); - expect(regFromSC).to.eq(zns.registry.address); - expect(acFromSC).to.eq(zns.accessController.address); + expect(regFromSC).to.eq(await zns.registry.getAddress()); + expect(acFromSC).to.eq(await zns.accessController.getAddress()); }); describe("#getPrice", async () => { @@ -168,8 +167,8 @@ describe("ZNSCurvePricer", () => { // these values have been calced separately to validate // that both forumlas: SC + helper are correct // this value has been calces with the default priceConfig - const domainOneRefValue = BigNumber.from("4545450000000000000000"); - const domainTwoRefValue = BigNumber.from("7692300000000000000000"); + const domainOneRefValue = BigInt("4545450000000000000000"); + const domainTwoRefValue = BigInt("7692300000000000000000"); const domainOneExpPrice = await getCurvePrice(domainOne, DEFAULT_PRICE_CONFIG); const domainTwoExpPrice = await getCurvePrice(domainTwo, DEFAULT_PRICE_CONFIG); @@ -234,7 +233,7 @@ describe("ZNSCurvePricer", () => { // eslint-disable-next-line max-len it.skip("Doesn't create price spikes with any valid combination of values (SLOW TEST, ONLY RUN LOCALLY)", async () => { // Start by expanding the search space to allow for domains that are up to 1000 characters - await zns.curvePricer.connect(user).setMaxLength(domainHash, BigNumber.from("1000")); + await zns.curvePricer.connect(user).setMaxLength(domainHash, BigInt("1000")); const promises = []; let config = await zns.curvePricer.priceConfigs(domainHash); @@ -248,14 +247,14 @@ describe("ZNSCurvePricer", () => { let outer = 1; let inner = outer; // Long-running loops here to iterate all the variations for baseLength and - while(config.maxLength.gt(outer)) { + while (config.maxLength > outer) { // Reset "domain" to a single character each outer loop domain = "a"; await zns.curvePricer.connect(user).setBaseLength(domainHash, outer); config = await zns.curvePricer.priceConfigs(domainHash); - while (config.maxLength.gt(inner)) { + while (config.maxLength > inner) { const priceTx = zns.curvePricer.getPrice(domainHash, domain, true); promises.push(priceTx); @@ -290,12 +289,12 @@ describe("ZNSCurvePricer", () => { it("Should set the config for any existing domain hash, including 0x0", async () => { const newConfig = { - baseLength: BigNumber.from("6"), - maxLength: BigNumber.from("35"), - maxPrice: parseEther("150"), - minPrice: parseEther("10"), + baseLength: BigInt("6"), + maxLength: BigInt("35"), + maxPrice: ethers.parseEther("150"), + minPrice: ethers.parseEther("10"), precisionMultiplier: DEFAULT_PRECISION_MULTIPLIER, - feePercentage: DEFAULT_REGISTRATION_FEE_PERCENT, + feePercentage: DEFAULT_PROTOCOL_FEE_PERCENT, isSet: true, }; @@ -303,7 +302,7 @@ describe("ZNSCurvePricer", () => { await zns.curvePricer.connect(user).setPriceConfig(domainHash, newConfig); // as a ZNS deployer who owns the 0x0 hash - await zns.curvePricer.connect(deployer).setPriceConfig(HashZero, newConfig); + await zns.curvePricer.connect(deployer).setPriceConfig(ZeroHash, newConfig); const configUser = await zns.curvePricer.priceConfigs(domainHash); @@ -314,7 +313,7 @@ describe("ZNSCurvePricer", () => { expect(configUser.precisionMultiplier).to.eq(newConfig.precisionMultiplier); expect(configUser.feePercentage).to.eq(newConfig.feePercentage); - const configDeployer = await zns.curvePricer.priceConfigs(HashZero); + const configDeployer = await zns.curvePricer.priceConfigs(ZeroHash); expect(configDeployer.baseLength).to.eq(newConfig.baseLength); expect(configDeployer.maxLength).to.eq(newConfig.maxLength); @@ -326,12 +325,12 @@ describe("ZNSCurvePricer", () => { it("Should revert if setting a price config where spike is created at maxLength", async () => { const newConfig = { - baseLength: BigNumber.from("6"), - maxLength: BigNumber.from("20"), - maxPrice: parseEther("10"), - minPrice: parseEther("6"), + baseLength: BigInt("6"), + maxLength: BigInt("20"), + maxPrice: ethers.parseEther("10"), + minPrice: ethers.parseEther("6"), precisionMultiplier: DEFAULT_PRECISION_MULTIPLIER, - feePercentage: DEFAULT_REGISTRATION_FEE_PERCENT, + feePercentage: DEFAULT_PROTOCOL_FEE_PERCENT, isSet: true, }; @@ -340,31 +339,31 @@ describe("ZNSCurvePricer", () => { ).to.be.revertedWith(CURVE_PRICE_CONFIG_ERR); }); - // TODO resolve after merge conflicts - // it("Cannot go below the set minPrice", async () => { - // // Using config numbers from audit - // const newConfig = { - // baseLength: BigNumber.from("5"), - // maxLength: BigNumber.from("10"), - // maxPrice: parseEther("10"), - // minPrice: parseEther("5.5"), - // precisionMultiplier: precisionMultiDefault, - // feePercentage: registrationFeePercDefault, - // }; + it("Cannot go below the set minPrice", async () => { + // Using config numbers from audit + const newConfig = { + baseLength: BigInt("5"), + maxLength: BigInt("10"), + maxPrice: ethers.parseEther("10"), + minPrice: ethers.parseEther("5.5"), + precisionMultiplier: DEFAULT_PRECISION_MULTIPLIER, + feePercentage: DEFAULT_PROTOCOL_FEE_PERCENT, + isSet: true, + }; - // await expect( - // zns.curvePricer.connect(user).setPriceConfig(domainHash, newConfig) - // ).to.be.revertedWith(CURVE_PRICE_CONFIG_ERR); - // }); + await expect( + zns.curvePricer.connect(user).setPriceConfig(domainHash, newConfig) + ).to.be.revertedWith(CURVE_PRICE_CONFIG_ERR); + }); it("Should revert if called by anyone other than owner or operator", async () => { const newConfig = { - baseLength: BigNumber.from("6"), - maxLength: BigNumber.from("20"), - maxPrice: parseEther("10"), - minPrice: parseEther("6"), + baseLength: BigInt("6"), + maxLength: BigInt("20"), + maxPrice: ethers.parseEther("10"), + minPrice: ethers.parseEther("6"), precisionMultiplier: DEFAULT_PRECISION_MULTIPLIER, - feePercentage: DEFAULT_REGISTRATION_FEE_PERCENT, + feePercentage: DEFAULT_PROTOCOL_FEE_PERCENT, isSet: true, }; @@ -373,18 +372,18 @@ describe("ZNSCurvePricer", () => { ).to.be.revertedWith(NOT_AUTHORIZED_REG_WIRED_ERR); await expect( - zns.curvePricer.connect(randomAcc).setPriceConfig(HashZero, newConfig) + zns.curvePricer.connect(randomAcc).setPriceConfig(ZeroHash, newConfig) ).to.be.revertedWith(NOT_AUTHORIZED_REG_WIRED_ERR); }); it("Should emit PriceConfigSet event with correct parameters", async () => { const newConfig = { - baseLength: BigNumber.from("6"), - maxLength: BigNumber.from("35"), - maxPrice: parseEther("150"), - minPrice: parseEther("10"), + baseLength: BigInt("6"), + maxLength: BigInt("35"), + maxPrice: ethers.parseEther("150"), + minPrice: ethers.parseEther("10"), precisionMultiplier: DEFAULT_PRECISION_MULTIPLIER, - feePercentage: DEFAULT_REGISTRATION_FEE_PERCENT, + feePercentage: DEFAULT_PROTOCOL_FEE_PERCENT, isSet: true, }; @@ -403,12 +402,12 @@ describe("ZNSCurvePricer", () => { it("Fails validation when maxPrice < minPrice", async () => { const newConfig = { - baseLength: BigNumber.from("3"), - maxLength: BigNumber.from("35"), - maxPrice: parseEther("1"), - minPrice: parseEther("2"), + baseLength: BigInt("3"), + maxLength: BigInt("35"), + maxPrice: ethers.parseEther("1"), + minPrice: ethers.parseEther("2"), precisionMultiplier: DEFAULT_PRECISION_MULTIPLIER, - feePercentage: DEFAULT_REGISTRATION_FEE_PERCENT, + feePercentage: DEFAULT_PROTOCOL_FEE_PERCENT, isSet: true, }; @@ -420,7 +419,7 @@ describe("ZNSCurvePricer", () => { describe("#setMaxPrice", () => { it("Allows an authorized user to set the max price", async () => { - const newMaxPrice = DEFAULT_PRICE_CONFIG.maxPrice.add(parseEther("10")); + const newMaxPrice = DEFAULT_PRICE_CONFIG.maxPrice + ethers.parseEther("10"); await zns.curvePricer.connect(user).setMaxPrice(domainHash, newMaxPrice); @@ -429,14 +428,14 @@ describe("ZNSCurvePricer", () => { }); it("Disallows an unauthorized user to set the max price", async () => { - const newMaxPrice = parseEther("0.7"); + const newMaxPrice = ethers.parseEther("0.7"); const tx = zns.curvePricer.connect(admin).setMaxPrice(domainHash, newMaxPrice); await expect(tx).to.be.revertedWith(NOT_AUTHORIZED_REG_WIRED_ERR); }); it("Allows setting the max price to zero", async () => { - const newMaxPrice = BigNumber.from("0"); + const newMaxPrice = BigInt("0"); await zns.curvePricer.connect(user).setMaxPrice(domainHash, newMaxPrice); const params = await zns.curvePricer.priceConfigs(domainHash); @@ -445,7 +444,7 @@ describe("ZNSCurvePricer", () => { }); it("Correctly sets max price", async () => { - const newMaxPrice = DEFAULT_PRICE_CONFIG.maxPrice.add(parseEther("553")); + const newMaxPrice = DEFAULT_PRICE_CONFIG.maxPrice + ethers.parseEther("553"); await zns.curvePricer.connect(user).setMaxPrice(domainHash, newMaxPrice); const params = await zns.curvePricer.priceConfigs(domainHash); @@ -453,14 +452,14 @@ describe("ZNSCurvePricer", () => { }); it("Should revert when setting maxPrice that causes a spike at maxLength", async () => { - const newMaxPrice = parseEther("500"); + const newMaxPrice = ethers.parseEther("500"); await expect( zns.curvePricer.connect(user).setMaxPrice(domainHash, newMaxPrice) ).to.be.revertedWith(CURVE_PRICE_CONFIG_ERR); }); it("Causes any length domain to have a price of 0 if the maxPrice is 0", async () => { - const newMaxPrice = BigNumber.from("0"); + const newMaxPrice = BigInt("0"); await zns.curvePricer.connect(user).setMaxPrice(domainHash, newMaxPrice); @@ -470,12 +469,12 @@ describe("ZNSCurvePricer", () => { const shortPrice = await zns.curvePricer.getPrice(domainHash, shortDomain, true); const longPrice = await zns.curvePricer.getPrice(domainHash, longDomain, true); - expect(shortPrice).to.eq(BigNumber.from("0")); - expect(longPrice).to.eq(BigNumber.from("0")); + expect(shortPrice).to.eq(BigInt("0")); + expect(longPrice).to.eq(BigInt("0")); }); it("The price of a domain is modified relatively when the basePrice is changed", async () => { - const newMaxPrice = DEFAULT_PRICE_CONFIG.maxPrice.add(parseEther("9")); + const newMaxPrice = DEFAULT_PRICE_CONFIG.maxPrice + ethers.parseEther("9"); const expectedPriceBefore = await getCurvePrice(defaultDomain, DEFAULT_PRICE_CONFIG); const priceBefore= await zns.curvePricer.getPrice(domainHash, defaultDomain, true); @@ -500,7 +499,7 @@ describe("ZNSCurvePricer", () => { describe("#setMinPrice", async () => { it("Allows an authorized user to set the min price", async () => { - const newMinPrice = parseEther("0.1"); + const newMinPrice = ethers.parseEther("0.1"); await zns.curvePricer.connect(user).setMinPrice(domainHash, newMinPrice); @@ -509,14 +508,14 @@ describe("ZNSCurvePricer", () => { }); it("Disallows an unauthorized user from setting the min price", async () => { - const newMinPrice = parseEther("0.1"); + const newMinPrice = ethers.parseEther("0.1"); const tx = zns.curvePricer.connect(admin).setMinPrice(domainHash, newMinPrice); await expect(tx).to.be.revertedWith(NOT_AUTHORIZED_REG_WIRED_ERR); }); it("Allows setting to zero", async () => { - const zeroPrice = BigNumber.from("0"); + const zeroPrice = BigInt("0"); await zns.curvePricer.connect(user).setMinPrice(domainHash, zeroPrice); const params = await zns.curvePricer.priceConfigs(domainHash); @@ -525,7 +524,7 @@ describe("ZNSCurvePricer", () => { }); it("Successfully sets the min price correctly", async () => { - const newMinPrice = parseEther("0.1"); + const newMinPrice = ethers.parseEther("0.1"); await zns.curvePricer.connect(user).setMinPrice(domainHash, newMinPrice); const params = await zns.curvePricer.priceConfigs(domainHash); @@ -536,7 +535,7 @@ describe("ZNSCurvePricer", () => { // All domains longer than 15 characters are the same price await zns.curvePricer.connect(user).setMaxLength(domainHash, "15"); - const minPrice = parseEther("50"); + const minPrice = ethers.parseEther("50"); await zns.curvePricer.connect(user).setMinPrice(domainHash, minPrice); // 16 characters @@ -564,7 +563,7 @@ describe("ZNSCurvePricer", () => { }); it("Should revert when setting minPrice that causes a spike at maxLength", async () => { - const newMinPrice = DEFAULT_PRICE_CONFIG.minPrice.add(parseEther("231")); + const newMinPrice = DEFAULT_PRICE_CONFIG.minPrice + ethers.parseEther("231"); await expect( zns.curvePricer.connect(user).setMinPrice(domainHash, newMinPrice) ).to.be.revertedWith(CURVE_PRICE_CONFIG_ERR); @@ -573,7 +572,7 @@ describe("ZNSCurvePricer", () => { describe("#setPrecisionMultiplier", () => { it("Allows an authorized user to set the precision multiplier", async () => { - const newMultiplier = BigNumber.from("1"); + const newMultiplier = BigInt("1"); await zns.curvePricer.connect(user).setPrecisionMultiplier(domainHash, newMultiplier); @@ -582,7 +581,7 @@ describe("ZNSCurvePricer", () => { }); it("Disallows an unauthorized user from setting the precision multiplier", async () => { - const newMultiplier = BigNumber.from("1"); + const newMultiplier = BigInt("1"); const tx = zns.curvePricer.connect(admin).setMinPrice(domainHash, newMultiplier); @@ -590,14 +589,14 @@ describe("ZNSCurvePricer", () => { }); it("Fails when setting to zero", async () => { - const zeroMultiplier = BigNumber.from("0"); + const zeroMultiplier = BigInt("0"); const tx = zns.curvePricer.connect(user).setPrecisionMultiplier(domainHash, zeroMultiplier); await expect(tx).to.be.revertedWith(CURVE_NO_ZERO_PRECISION_MULTIPLIER_ERR); }); it("Successfuly sets the precision multiplier when above 0", async () => { - const newMultiplier = BigNumber.from("3"); + const newMultiplier = BigInt("3"); await zns.curvePricer.connect(user).setPrecisionMultiplier(domainHash, newMultiplier); const params = await zns.curvePricer.priceConfigs(domainHash); @@ -614,8 +613,8 @@ describe("ZNSCurvePricer", () => { // Default precision is 2 decimals, so increasing this value should represent in prices // as a non-zero nect decimal place - const newPrecision = BigNumber.from(3); - const newPrecisionMultiplier = BigNumber.from(10).pow(DEFAULT_DECIMALS.sub(newPrecision)); + const newPrecision = BigInt(3); + const newPrecisionMultiplier = BigInt(10) ** DEFAULT_DECIMALS - newPrecision; await zns.curvePricer.connect(user).setPrecisionMultiplier(domainHash, newPrecisionMultiplier); @@ -627,7 +626,7 @@ describe("ZNSCurvePricer", () => { }); it("Should revert when setting precisionMultiplier higher than 10^18", async () => { - const newMultiplier = parseEther("100"); + const newMultiplier = ethers.parseEther("100"); await expect( zns.curvePricer.connect(user).setPrecisionMultiplier(domainHash, newMultiplier) ).to.be.revertedWith( @@ -664,12 +663,12 @@ describe("ZNSCurvePricer", () => { it("Always returns the minPrice if both baseLength and maxLength are their min values", async () => { const newConfig = { - baseLength: BigNumber.from(1), - maxLength: BigNumber.from(1), - maxPrice: BigNumber.from(100), - minPrice: BigNumber.from(10), + baseLength: BigInt(1), + maxLength: BigInt(1), + maxPrice: BigInt(100), + minPrice: BigInt(10), precisionMultiplier: DEFAULT_PRECISION_MULTIPLIER, - feePercentage: DEFAULT_REGISTRATION_FEE_PERCENT, + feePercentage: DEFAULT_PROTOCOL_FEE_PERCENT, isSet: true, }; @@ -724,7 +723,7 @@ describe("ZNSCurvePricer", () => { const newConfig = { ...DEFAULT_PRICE_CONFIG, - baseLength: BigNumber.from(newLength), + baseLength: BigInt(newLength), }; const expectedPriceAfter = await getCurvePrice(defaultDomain, newConfig); @@ -739,7 +738,7 @@ describe("ZNSCurvePricer", () => { const newConfig1 = { ...DEFAULT_PRICE_CONFIG, - baseLength: BigNumber.from(length), + baseLength: BigInt(length), }; const paramsBefore = await zns.curvePricer.priceConfigs(domainHash); @@ -754,7 +753,7 @@ describe("ZNSCurvePricer", () => { const newConfig2 = { ...DEFAULT_PRICE_CONFIG, - baseLength: BigNumber.from(newLength), + baseLength: BigInt(newLength), }; const paramsAfter = await zns.curvePricer.priceConfigs(domainHash); @@ -777,7 +776,7 @@ describe("ZNSCurvePricer", () => { // Modify the max price await zns.curvePricer.connect(user).setMaxPrice( domainHash, - DEFAULT_PRICE_CONFIG.maxPrice.add(15) + DEFAULT_PRICE_CONFIG.maxPrice + 15n ); config = await zns.curvePricer.priceConfigs(domainHash); @@ -791,7 +790,7 @@ describe("ZNSCurvePricer", () => { await zns.curvePricer.connect(user).setBaseLength(domainHash, newRootLength); const newConfig = { ...DEFAULT_PRICE_CONFIG, - baseLength: BigNumber.from(newRootLength), + baseLength: BigInt(newRootLength), }; const expectedRootPrice = await getCurvePrice(defaultDomain, newConfig); @@ -801,7 +800,7 @@ describe("ZNSCurvePricer", () => { }); it("Should revert when setting baseLength that causes a spike at maxLength", async () => { - const newBaseLength = DEFAULT_PRICE_CONFIG.baseLength.sub(1); + const newBaseLength = DEFAULT_PRICE_CONFIG.baseLength - 1n; await expect( zns.curvePricer.connect(user).setBaseLength(domainHash, newBaseLength) ).to.be.revertedWith(CURVE_PRICE_CONFIG_ERR); @@ -858,7 +857,7 @@ describe("ZNSCurvePricer", () => { }); it("Should revert when setting maxLength that causes a spike at maxLength", async () => { - const newMaxLength = DEFAULT_PRICE_CONFIG.maxLength.add(10); + const newMaxLength = DEFAULT_PRICE_CONFIG.maxLength + 10n; await expect( zns.curvePricer.connect(user).setMaxLength(domainHash, newMaxLength) ).to.be.revertedWith(CURVE_PRICE_CONFIG_ERR); @@ -867,7 +866,7 @@ describe("ZNSCurvePricer", () => { describe("#setFeePercentage", () => { it("Successfully sets the fee percentage", async () => { - const newFeePerc = BigNumber.from(222); + const newFeePerc = BigInt(222); await zns.curvePricer.connect(user).setFeePercentage(domainHash, newFeePerc); const { feePercentage: feeFromSC } = await zns.curvePricer.priceConfigs(domainHash); @@ -875,14 +874,14 @@ describe("ZNSCurvePricer", () => { }); it("Disallows an unauthorized user to set the fee percentage", async () => { - const newFeePerc = BigNumber.from(222); + const newFeePerc = BigInt(222); const tx = zns.curvePricer.connect(admin) .setFeePercentage(domainHash, newFeePerc); await expect(tx).to.be.revertedWith(NOT_AUTHORIZED_REG_WIRED_ERR); }); it("should revert when trying to set feePercentage higher than PERCENTAGE_BASIS", async () => { - const newFeePerc = BigNumber.from(10001); + const newFeePerc = BigInt(10001); await expect( zns.curvePricer.connect(user).setFeePercentage(domainHash, newFeePerc) ).to.be.revertedWith("ZNSCurvePricer: feePercentage cannot be greater than PERCENTAGE_BASIS"); @@ -891,9 +890,9 @@ describe("ZNSCurvePricer", () => { describe("#getRegistrationFee", () => { it("Successfully gets the fee for a price", async () => { - const stake = ethers.utils.parseEther("0.2"); + const stake = ethers.parseEther("0.2"); const fee = await zns.curvePricer.getFeeForPrice(domainHash, stake); - const expectedFee = stake.mul("222").div("10000"); + const expectedFee = stake * 222n / 10000n; expect(fee).to.eq(expectedFee); }); @@ -920,7 +919,7 @@ describe("ZNSCurvePricer", () => { }); it("Disallows setting the access controller to the zero address", async () => { - const tx = zns.curvePricer.connect(admin).setAccessController(ethers.constants.AddressZero); + const tx = zns.curvePricer.connect(admin).setAccessController(ethers.ZeroAddress); await expect(tx).to.be.revertedWith( "AC: _accessController is 0x0 address" ); @@ -950,7 +949,7 @@ describe("ZNSCurvePricer", () => { describe("Events", () => { it("Emits MaxPriceSet", async () => { - const newMaxPrice = DEFAULT_PRICE_CONFIG.maxPrice.add(1); + const newMaxPrice = DEFAULT_PRICE_CONFIG.maxPrice + 1n; const tx = zns.curvePricer.connect(user).setMaxPrice(domainHash, newMaxPrice); await expect(tx).to.emit(zns.curvePricer, "MaxPriceSet").withArgs(domainHash, newMaxPrice); @@ -969,12 +968,12 @@ describe("ZNSCurvePricer", () => { // CurvePricer to upgrade to const factory = new ZNSCurvePricer__factory(deployer); const newCurvePricer = await factory.deploy(); - await newCurvePricer.deployed(); + await newCurvePricer.waitForDeployment(); // Confirm the deployer is a governor, as set in `deployZNS` helper await expect(zns.accessController.checkGovernor(deployer.address)).to.not.be.reverted; - const tx = zns.curvePricer.connect(deployer).upgradeTo(newCurvePricer.address); + const tx = zns.curvePricer.connect(deployer).upgradeTo(await newCurvePricer.getAddress()); await expect(tx).to.not.be.reverted; }); @@ -982,12 +981,12 @@ describe("ZNSCurvePricer", () => { // CurvePricer to upgrade to const factory = new ZNSCurvePricerUpgradeMock__factory(deployer); const newCurvePricer = await factory.deploy(); - await newCurvePricer.deployed(); + await newCurvePricer.waitForDeployment(); // Confirm the account is not a governor await expect(zns.accessController.checkGovernor(randomAcc.address)).to.be.reverted; - const tx = zns.curvePricer.connect(randomAcc).upgradeTo(newCurvePricer.address); + const tx = zns.curvePricer.connect(randomAcc).upgradeTo(await newCurvePricer.getAddress()); await expect(tx).to.be.revertedWith( getAccessRevertMsg(randomAcc.address, GOVERNOR_ROLE) @@ -997,12 +996,12 @@ describe("ZNSCurvePricer", () => { it("Verifies that variable values are not changed in the upgrade process", async () => { const factory = new ZNSCurvePricerUpgradeMock__factory(deployer); const newCurvePricer = await factory.deploy(); - await newCurvePricer.deployed(); + await newCurvePricer.waitForDeployment(); await zns.curvePricer.connect(user).setBaseLength(domainHash, "7"); await zns.curvePricer.connect(user).setMaxPrice( domainHash, - DEFAULT_PRICE_CONFIG.maxPrice.add(15) + DEFAULT_PRICE_CONFIG.maxPrice + 15n ); const contractCalls = [ diff --git a/test/ZNSDomainToken.test.ts b/test/ZNSDomainToken.test.ts index 765c6fb72..b10b1cb42 100644 --- a/test/ZNSDomainToken.test.ts +++ b/test/ZNSDomainToken.test.ts @@ -1,11 +1,11 @@ import * as hre from "hardhat"; import { ZNSDomainTokenUpgradeMock__factory, - ZNSDomainToken__factory, ERC165__factory, + ZNSDomainToken__factory, ERC165__factory, ZNSDomainToken, } from "../typechain"; import { expect } from "chai"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; -import { BigNumber, ethers } from "ethers"; +import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; +import { ethers } from "ethers"; import { ADMIN_ROLE, REGISTRAR_ROLE, @@ -20,7 +20,6 @@ import { DEFAULT_PERCENTAGE_BASIS, DEFAULT_ROYALTY_FRACTION, } from "./helpers"; import { DeployZNSParams, IZNSContracts } from "./helpers/types"; -import { parseEther } from "ethers/lib/utils"; import { getProxyImplAddress } from "./helpers/utils"; @@ -50,12 +49,12 @@ describe("ZNSDomainToken", () => { }); it("should initialize correctly", async () => { - expect(await zns.domainToken.getAccessController()).to.equal(zns.accessController.address); + expect(await zns.domainToken.getAccessController()).to.equal(await zns.accessController.getAddress()); expect(await zns.domainToken.name()).to.equal(ZNS_DOMAIN_TOKEN_NAME); expect(await zns.domainToken.symbol()).to.equal(ZNS_DOMAIN_TOKEN_SYMBOL); - const royaltyInfo = await zns.domainToken.royaltyInfo("0", parseEther("100")); + const royaltyInfo = await zns.domainToken.royaltyInfo("0", ethers.parseEther("100")); expect(royaltyInfo[0]).to.equal(zns.zeroVaultAddress); - expect(royaltyInfo[1]).to.equal(parseEther("2")); + expect(royaltyInfo[1]).to.equal(ethers.parseEther("2")); }); it("should NOT initialize twice", async () => { @@ -70,8 +69,8 @@ describe("ZNSDomainToken", () => { it("Should NOT let initialize the implementation contract", async () => { const factory = new ZNSDomainToken__factory(deployer); - const impl = await getProxyImplAddress(zns.domainToken.address); - const implContract = factory.attach(impl); + const impl = await getProxyImplAddress(await zns.domainToken.getAddress()); + const implContract = factory.attach(impl) as ZNSDomainToken; await expect( implContract.initialize( @@ -86,13 +85,13 @@ describe("ZNSDomainToken", () => { describe("External functions", () => { it("Should register (mint) the token if caller has REGISTRAR_ROLE", async () => { - const tokenId = ethers.BigNumber.from("1"); + const tokenId = BigInt("1"); const tx = zns.domainToken .connect(mockRegistrar) .register(caller.address, tokenId, randomTokenURI); await expect(tx).to.emit(zns.domainToken, "Transfer").withArgs( - ethers.constants.AddressZero, + ethers.ZeroAddress, caller.address, tokenId ); @@ -102,7 +101,7 @@ describe("ZNSDomainToken", () => { }); it("Should revert when registering (minting) if caller does not have REGISTRAR_ROLE", async () => { - const tokenId = ethers.BigNumber.from("1"); + const tokenId = BigInt("1"); await expect( zns.domainToken .connect(caller) @@ -114,7 +113,7 @@ describe("ZNSDomainToken", () => { it("Revokes a token", async () => { // Mint domain - const tokenId = ethers.BigNumber.from("1"); + const tokenId = BigInt("1"); await zns.domainToken .connect(mockRegistrar) .register(caller.address, tokenId, randomTokenURI); @@ -129,7 +128,7 @@ describe("ZNSDomainToken", () => { // Verify Transfer event is emitted await expect(tx).to.emit(zns.domainToken, "Transfer").withArgs( caller.address, - ethers.constants.AddressZero, + ethers.ZeroAddress, tokenId ); @@ -140,7 +139,7 @@ describe("ZNSDomainToken", () => { describe("Require Statement Validation", () => { it("Only the registrar can call to register a token", async () => { - const tokenId = ethers.BigNumber.from("1"); + const tokenId = BigInt("1"); const registerTx = zns.domainToken .connect(caller) .register(caller.address, tokenId, randomTokenURI); @@ -151,7 +150,7 @@ describe("ZNSDomainToken", () => { }); it("Only authorized can revoke a token", async () => { - const tokenId = ethers.BigNumber.from("1"); + const tokenId = BigInt("1"); // Mint domain await zns.domainToken .connect(mockRegistrar) @@ -203,26 +202,26 @@ describe("ZNSDomainToken", () => { expect( await zns.domainToken.getAccessController() ).to.equal( - zns.accessController.address + await zns.accessController.getAddress() ); }); }); describe("Royalties", () => { it("should set and correctly retrieve default royalty", async () => { - const assetPrice = parseEther("164"); + const assetPrice = ethers.parseEther("164"); const initialRoyaltyInfo = await zns.domainToken.royaltyInfo("0", assetPrice); // mint token - const tokenId = ethers.BigNumber.from("1326548"); + const tokenId = BigInt("1326548"); await zns.domainToken.connect(mockRegistrar).register(deployer.address, tokenId, randomTokenURI); - const royaltyPerc = BigNumber.from("237"); // 2.37% + const royaltyPerc = BigInt("237"); // 2.37% await zns.domainToken.connect(deployer).setDefaultRoyalty(beneficiary.address, royaltyPerc); - const royaltyAmountExp = assetPrice.mul(royaltyPerc).div(DEFAULT_PERCENTAGE_BASIS); + const royaltyAmountExp = assetPrice * royaltyPerc / DEFAULT_PERCENTAGE_BASIS; // try pulling with incorrect tokenID - should still return the correct amount const royaltyInfoNoID = await zns.domainToken.royaltyInfo("0", assetPrice); @@ -243,21 +242,21 @@ describe("ZNSDomainToken", () => { it("should set and correctly retrieve royalty for a specific token", async () => { // mint token - const tokenId = ethers.BigNumber.from("777356"); + const tokenId = BigInt("777356"); await zns.domainToken.connect(mockRegistrar).register(deployer.address, tokenId, randomTokenURI); - const assetPrice = parseEther("19"); - const royaltyPerc = BigNumber.from("1013"); // 2.37% + const assetPrice = ethers.parseEther("19"); + const royaltyPerc = BigInt("1013"); // 2.37% await zns.domainToken.connect(deployer).setTokenRoyalty(tokenId, beneficiary.address, royaltyPerc); - const royaltyAmountExp = assetPrice.mul(royaltyPerc).div(DEFAULT_PERCENTAGE_BASIS); + const royaltyAmountExp = assetPrice * royaltyPerc / DEFAULT_PERCENTAGE_BASIS; // try pulling with incorrect tokenID - should return default values from initizlize() const royaltyInfoNoID = await zns.domainToken.royaltyInfo("0", assetPrice); expect(royaltyInfoNoID[0]).to.equal(zns.zeroVaultAddress); - expect(royaltyInfoNoID[1]).to.equal(assetPrice.mul(DEFAULT_ROYALTY_FRACTION).div(DEFAULT_PERCENTAGE_BASIS)); + expect(royaltyInfoNoID[1]).to.equal(assetPrice * DEFAULT_ROYALTY_FRACTION / DEFAULT_PERCENTAGE_BASIS); // try pulling with correct tokenID - should return correct amount const royaltyInfo = await zns.domainToken.royaltyInfo(tokenId, assetPrice); @@ -275,7 +274,7 @@ describe("ZNSDomainToken", () => { it("#setTokenRoyalty() should revert if called by anyone other than ADMIN_ROLE", async () => { // mint token - const tokenId = ethers.BigNumber.from("777356"); + const tokenId = BigInt("777356"); await zns.domainToken.connect(mockRegistrar).register(deployer.address, tokenId, randomTokenURI); await expect( @@ -289,7 +288,7 @@ describe("ZNSDomainToken", () => { describe("Token URIs", () => { it("should support individual tokenURIs", async () => { // mint a token - const tokenId = ethers.BigNumber.from("13354684"); + const tokenId = BigInt("13354684"); const tokenURI = "https://www.zNS.domains/1a3c2f5"; await zns.domainToken.connect(mockRegistrar).register(caller.address, tokenId, tokenURI); @@ -302,7 +301,7 @@ describe("ZNSDomainToken", () => { it("should support baseURI method with tokenURI as 0", async () => { // mint a token - const tokenId = BigNumber.from("13354684"); + const tokenId = BigInt("13354684"); const baseURI = "https://www.zNS.domains/"; const emptyTokenURI = ""; @@ -318,7 +317,7 @@ describe("ZNSDomainToken", () => { it("should support baseURI + tokenURI concatenation if both are set correctly", async () => { // mint a token - const tokenId = BigNumber.from("35226748"); + const tokenId = BigInt("35226748"); const baseURI = "https://www.zNS.domains/"; const tokenURI = "1a3c2f5"; @@ -338,7 +337,7 @@ describe("ZNSDomainToken", () => { // ! proper checks should be added to the app to not let this happen ! it("should return WRONG URI if both baseURI and tokenURI are set as separate links", async () => { // mint a token - const tokenId = BigNumber.from("777777"); + const tokenId = BigInt("777777"); const baseURI = "https://www.zNS.domains/"; const tokenURI = "https://www.wilderworld.io/1a3c2f5"; @@ -357,7 +356,7 @@ describe("ZNSDomainToken", () => { it("should be able to switch from tokenURI to baseURI if tokenURI is deleted", async () => { // mint a token - const tokenId = BigNumber.from("333355"); + const tokenId = BigInt("333355"); const baseURI = "https://www.zNS.domains/"; const tokenURI = "https://www.wilderworld.io/1a3c2f5"; @@ -383,7 +382,7 @@ describe("ZNSDomainToken", () => { it("#setTokenURI() should set tokenURI correctly", async () => { // mint a token - const tokenId = BigNumber.from("333355"); + const tokenId = BigInt("333355"); const tokenURI = "https://www.wilderworld.io/1a3c2f5"; const newTokenURI = "https://www.zNS.domains/33fa57cd8"; @@ -408,7 +407,7 @@ describe("ZNSDomainToken", () => { it("#setTokenURI() should revert if called by anyone other than ADMIN_ROLE", async () => { // mint a token - const tokenId = BigNumber.from("333355"); + const tokenId = BigInt("333355"); const tokenURI = "https://www.wilderworld.io/1a3c2f5"; const newTokenURI = "https://www.zNS.domains/33fa57cd8"; @@ -443,9 +442,9 @@ describe("ZNSDomainToken", () => { it("should support IERC165", async () => { const erc165Interface = ERC165__factory.createInterface(); - const interfaceId = erc165Interface.getSighash(erc165Interface.functions["supportsInterface(bytes4)"]); + const fragment = erc165Interface.getFunction("supportsInterface"); - expect(await zns.domainToken.supportsInterface(interfaceId)).to.be.true; + expect(await zns.domainToken.supportsInterface(fragment.selector)).to.be.true; }); it("should not support random interface", async () => { @@ -458,14 +457,14 @@ describe("ZNSDomainToken", () => { // DomainToken to upgrade to const factory = new ZNSDomainToken__factory(deployer); const newDomainToken = await factory.deploy(); - await newDomainToken.deployed(); + await newDomainToken.waitForDeployment(); // Confirm the deployer is a governor expect( await zns.accessController.hasRole(GOVERNOR_ROLE, deployer.address) ).to.be.true; - const upgradeTx = zns.domainToken.connect(deployer).upgradeTo(newDomainToken.address); + const upgradeTx = zns.domainToken.connect(deployer).upgradeTo(await newDomainToken.getAddress()); await expect(upgradeTx).to.not.be.reverted; }); @@ -474,10 +473,10 @@ describe("ZNSDomainToken", () => { // DomainToken to upgrade to const factory = new ZNSDomainTokenUpgradeMock__factory(deployer); const newDomainToken = await factory.deploy(); - await newDomainToken.deployed(); + await newDomainToken.waitForDeployment(); // Call to register a token - const tokenId = ethers.BigNumber.from("1"); + const tokenId = BigInt("1"); await zns.domainToken.connect(mockRegistrar).register(deployer.address, tokenId, randomTokenURI); await zns.domainToken.connect(deployer).approve(caller.address, tokenId); @@ -499,14 +498,14 @@ describe("ZNSDomainToken", () => { // DomainToken to upgrade to const newDomainToken = await factory.deploy(); - await newDomainToken.deployed(); + await newDomainToken.waitForDeployment(); // Confirm the caller is not a governor await expect(zns.accessController.checkGovernor(caller.address)).to.be.revertedWith( getAccessRevertMsg(caller.address, GOVERNOR_ROLE) ); - const upgradeTx = zns.domainToken.connect(caller).upgradeTo(newDomainToken.address); + const upgradeTx = zns.domainToken.connect(caller).upgradeTo(await newDomainToken.getAddress()); await expect(upgradeTx).to.be.revertedWith( getAccessRevertMsg(caller.address, GOVERNOR_ROLE) diff --git a/test/ZNSFixedPricer.test.ts b/test/ZNSFixedPricer.test.ts index b8190924a..6e802b401 100644 --- a/test/ZNSFixedPricer.test.ts +++ b/test/ZNSFixedPricer.test.ts @@ -9,17 +9,15 @@ import { PaymentType, DEFAULT_PERCENTAGE_BASIS, DEFAULT_PRICE_CONFIG, - validateUpgrade, - AccessType, + validateUpgrade, AccessType, } from "./helpers"; import * as hre from "hardhat"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { IZNSContracts } from "./helpers/types"; import * as ethers from "ethers"; import { registrationWithSetup } from "./helpers/register-setup"; import { expect } from "chai"; -import { BigNumber } from "ethers"; -import { ZNSFixedPricer__factory, ZNSFixedPricerUpgradeMock__factory } from "../typechain"; +import { ZNSFixedPricer__factory, ZNSFixedPricer, ZNSFixedPricerUpgradeMock__factory } from "../typechain"; import { getProxyImplAddress } from "./helpers/utils"; @@ -32,13 +30,13 @@ describe("ZNSFixedPricer", () => { let zns : IZNSContracts; let domainHash : string; - let parentPrice : BigNumber; - let parentFeePercentage : BigNumber; + let parentPrice : bigint; + let parentFeePercentage : bigint; before(async () => { [deployer, admin, user, zeroVault, random] = await hre.ethers.getSigners(); - parentPrice = ethers.utils.parseEther("2223"); - parentFeePercentage = BigNumber.from(2310); + parentPrice = ethers.parseEther("2223"); + parentFeePercentage = BigInt(2310); zns = await deployZNS({ deployer, @@ -48,17 +46,17 @@ describe("ZNSFixedPricer", () => { zeroVaultAddress: zeroVault.address, }); - await zns.meowToken.connect(user).approve(zns.treasury.address, ethers.constants.MaxUint256); - await zns.meowToken.mint(user.address, ethers.utils.parseEther("10000000000000")); + await zns.meowToken.connect(user).approve(await zns.treasury.getAddress(), ethers.MaxUint256); + await zns.meowToken.mint(user.address, ethers.parseEther("10000000000000")); const fullConfig = { distrConfig: { paymentType: PaymentType.DIRECT, - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), accessType: AccessType.OPEN, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: user.address, }, priceConfig: { @@ -76,21 +74,21 @@ describe("ZNSFixedPricer", () => { }); it("should deploy with correct parameters", async () => { - expect(await zns.fixedPricer.getAccessController()).to.equal(zns.accessController.address); - expect(await zns.fixedPricer.registry()).to.equal(zns.registry.address); + expect(await zns.fixedPricer.getAccessController()).to.equal(await zns.accessController.getAddress()); + expect(await zns.fixedPricer.registry()).to.equal(await zns.registry.getAddress()); }); it("should NOT initialize twice", async () => { await expect(zns.fixedPricer.initialize( - zns.accessController.address, - zns.registry.address, + await zns.accessController.getAddress(), + await zns.registry.getAddress(), )).to.be.revertedWith(INITIALIZED_ERR); }); it("Should NOT let initialize the implementation contract", async () => { const factory = new ZNSFixedPricer__factory(deployer); - const impl = await getProxyImplAddress(zns.fixedPricer.address); - const implContract = factory.attach(impl); + const impl = await getProxyImplAddress(await zns.fixedPricer.getAddress()); + const implContract = factory.attach(impl) as ZNSFixedPricer; await expect( implContract.initialize( @@ -104,17 +102,17 @@ describe("ZNSFixedPricer", () => { const { price, feePercentage, - } = await zns.fixedPricer.priceConfigs(ethers.constants.HashZero); + } = await zns.fixedPricer.priceConfigs(ethers.ZeroHash); expect(price).to.equal(0); expect(feePercentage).to.equal(0); - const newPrice = ethers.utils.parseEther("9182263"); - const newFee = BigNumber.from(2359); + const newPrice = ethers.parseEther("9182263"); + const newFee = BigInt(2359); // deployer owns 0x0 hash at initialization time await zns.fixedPricer.connect(deployer).setPriceConfig( - ethers.constants.HashZero, + ethers.ZeroHash, { price: newPrice, feePercentage: newFee, @@ -125,7 +123,7 @@ describe("ZNSFixedPricer", () => { const { price: newPriceAfter, feePercentage: newFeeAfter, - } = await zns.fixedPricer.priceConfigs(ethers.constants.HashZero); + } = await zns.fixedPricer.priceConfigs(ethers.ZeroHash); expect(newPriceAfter).to.equal(newPrice); expect(newFeeAfter).to.equal(newFee); @@ -135,8 +133,8 @@ describe("ZNSFixedPricer", () => { await expect( deployFixedPricer({ deployer: random, - acAddress: zns.accessController.address, - regAddress: zns.registry.address, + acAddress: await zns.accessController.getAddress(), + regAddress: await zns.registry.getAddress(), }), ).to.be.revertedWith( getAccessRevertMsg(random.address, ADMIN_ROLE) @@ -144,7 +142,7 @@ describe("ZNSFixedPricer", () => { }); it("#setPrice() should work correctly and emit #PriceSet event", async () => { - const newPrice = ethers.utils.parseEther("1823"); + const newPrice = ethers.parseEther("1823"); const tx = zns.fixedPricer.connect(user).setPrice(domainHash, newPrice); await expect(tx).to.emit(zns.fixedPricer, "PriceSet").withArgs(domainHash, newPrice); @@ -155,7 +153,7 @@ describe("ZNSFixedPricer", () => { }); it("#getPrice should return the correct price", async () => { - const newPrice = ethers.utils.parseEther("3213"); + const newPrice = ethers.parseEther("3213"); await zns.fixedPricer.connect(user).setPrice(domainHash, newPrice); expect( @@ -170,8 +168,8 @@ describe("ZNSFixedPricer", () => { }); it("#getPriceAndFee() should return the correct price and fee", async () => { - const newPrice = ethers.utils.parseEther("3213"); - const newFee = BigNumber.from(1234); + const newPrice = ethers.parseEther("3213"); + const newFee = BigInt(1234); await zns.fixedPricer.connect(user).setPrice(domainHash, newPrice); await zns.fixedPricer.connect(user).setFeePercentage(domainHash, newFee); @@ -181,19 +179,19 @@ describe("ZNSFixedPricer", () => { } = await zns.fixedPricer.getPriceAndFee(domainHash, "testname", false); expect(price).to.equal(newPrice); - expect(fee).to.equal(newPrice.mul(newFee).div(DEFAULT_PERCENTAGE_BASIS)); + expect(fee).to.equal(newPrice * newFee / DEFAULT_PERCENTAGE_BASIS); }); it("#setPrice() should revert if called by anyone other than domain owner", async () => { await expect( - zns.fixedPricer.connect(random).setPrice(domainHash, ethers.utils.parseEther("1")) + zns.fixedPricer.connect(random).setPrice(domainHash, ethers.parseEther("1")) ).to.be.revertedWith( NOT_AUTHORIZED_REG_WIRED_ERR ); }); it("#setFeePercentage() should set the fee correctly and emit #FeePercentageSet event", async () => { - const newFee = BigNumber.from(1234); + const newFee = BigInt(1234); const tx = zns.fixedPricer.connect(user).setFeePercentage(domainHash, newFee); await expect(tx).to.emit(zns.fixedPricer, "FeePercentageSet").withArgs(domainHash, newFee); @@ -206,7 +204,7 @@ describe("ZNSFixedPricer", () => { it("#setFeePercentage() should revert if called by anyone other than domain owner", async () => { await expect( - zns.fixedPricer.connect(random).setFeePercentage(domainHash, BigNumber.from(1)) + zns.fixedPricer.connect(random).setFeePercentage(domainHash, BigInt(1)) ).to.be.revertedWith( NOT_AUTHORIZED_REG_WIRED_ERR ); @@ -214,7 +212,7 @@ describe("ZNSFixedPricer", () => { it("#setFeePercentage() should revert when trying to set feePercentage higher than PERCENTAGE_BASIS", async () => { await expect( - zns.fixedPricer.connect(user).setFeePercentage(domainHash, DEFAULT_PERCENTAGE_BASIS.add(1)) + zns.fixedPricer.connect(user).setFeePercentage(domainHash, DEFAULT_PERCENTAGE_BASIS + 1n) ).to.be.revertedWith( "ZNSFixedPricer: feePercentage cannot be greater than PERCENTAGE_BASIS" ); @@ -222,8 +220,8 @@ describe("ZNSFixedPricer", () => { // eslint-disable-next-line max-len it("#setPriceConfig() should set the price config correctly and emit #PriceSet and #FeePercentageSet events", async () => { - const newPrice = ethers.utils.parseEther("1823"); - const newFee = BigNumber.from("12"); + const newPrice = ethers.parseEther("1823"); + const newFee = BigInt("12"); const tx = zns.fixedPricer.connect(user).setPriceConfig( domainHash, { @@ -249,8 +247,8 @@ describe("ZNSFixedPricer", () => { zns.fixedPricer.connect(random).setPriceConfig( domainHash, { - price: BigNumber.from(1), - feePercentage: BigNumber.from(1), + price: BigInt(1), + feePercentage: BigInt(1), isSet: true, } ) @@ -267,7 +265,7 @@ describe("ZNSFixedPricer", () => { ).to.equal(random.address); // set back for other tests - await zns.fixedPricer.connect(admin).setRegistry(zns.registry.address); + await zns.fixedPricer.connect(admin).setRegistry(await zns.registry.getAddress()); }); it("#setRegistry() should revert if called by anyone other than ADMIN_ROLE", async () => { @@ -305,17 +303,17 @@ describe("ZNSFixedPricer", () => { zeroVaultAddress: zeroVault.address, }); - await zns.meowToken.connect(user).approve(zns.treasury.address, ethers.constants.MaxUint256); - await zns.meowToken.mint(user.address, ethers.utils.parseEther("10000000000000")); + await zns.meowToken.connect(user).approve(await zns.treasury.getAddress(), ethers.MaxUint256); + await zns.meowToken.mint(user.address, ethers.parseEther("10000000000000")); const fullConfig = { distrConfig: { paymentType: PaymentType.DIRECT, - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), accessType: AccessType.OPEN, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: user.address, }, priceConfig: { @@ -336,18 +334,18 @@ describe("ZNSFixedPricer", () => { // FixedPricer to upgrade to const factory = new ZNSFixedPricerUpgradeMock__factory(deployer); const newFixedPricer = await factory.deploy(); - await newFixedPricer.deployed(); + await newFixedPricer.waitForDeployment(); // Confirm the deployer is a governor, as set in `deployZNS` helper await expect(zns.accessController.checkGovernor(deployer.address)).to.not.be.reverted; - const tx = zns.fixedPricer.connect(deployer).upgradeTo(newFixedPricer.address); + const tx = zns.fixedPricer.connect(deployer).upgradeTo(await newFixedPricer.getAddress()); await expect(tx).to.not.be.reverted; await expect( zns.fixedPricer.connect(deployer).initialize( - zns.accessController.address, - zns.registry.address, + await zns.accessController.getAddress(), + await zns.registry.getAddress(), ) ).to.be.revertedWith(INITIALIZED_ERR); }); @@ -356,12 +354,12 @@ describe("ZNSFixedPricer", () => { // FixedPricer to upgrade to const factory = new ZNSFixedPricerUpgradeMock__factory(deployer); const newFixedPricer = await factory.deploy(); - await newFixedPricer.deployed(); + await newFixedPricer.waitForDeployment(); // Confirm the account is not a governor await expect(zns.accessController.checkGovernor(random.address)).to.be.reverted; - const tx = zns.fixedPricer.connect(random).upgradeTo(newFixedPricer.address); + const tx = zns.fixedPricer.connect(random).upgradeTo(await newFixedPricer.getAddress()); await expect(tx).to.be.revertedWith( getAccessRevertMsg(random.address, GOVERNOR_ROLE) @@ -371,12 +369,12 @@ describe("ZNSFixedPricer", () => { it("Verifies that variable values are not changed in the upgrade process", async () => { const factory = new ZNSFixedPricerUpgradeMock__factory(deployer); const newFixedPricer = await factory.deploy(); - await newFixedPricer.deployed(); + await newFixedPricer.waitForDeployment(); await zns.fixedPricer.connect(user).setPrice(domainHash, "7"); await zns.fixedPricer.connect(user).setFeePercentage( domainHash, - BigNumber.from(12) + BigInt(12) ); const contractCalls = [ diff --git a/test/ZNSRegistry.test.ts b/test/ZNSRegistry.test.ts index 633f12393..7afdff16a 100644 --- a/test/ZNSRegistry.test.ts +++ b/test/ZNSRegistry.test.ts @@ -1,10 +1,10 @@ import * as hre from "hardhat"; import { expect } from "chai"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { deployZNS } from "./helpers/deploy/deploy-zns"; import { hashDomainLabel, hashSubdomainName } from "./helpers/hashing"; import { IZNSContracts, DeployZNSParams } from "./helpers/types"; -import { ZNSRegistry__factory, ZNSRegistryUpgradeMock__factory } from "../typechain"; +import { ZNSRegistry, ZNSRegistry__factory, ZNSRegistryUpgradeMock__factory } from "../typechain"; import { ethers } from "ethers"; import { ADMIN_ROLE, @@ -66,7 +66,7 @@ describe("ZNSRegistry", () => { it("Cannot be initialized twice", async () => { await expect( zns.registry.initialize( - zns.accessController.address + await zns.accessController.getAddress() ) ).to.be.revertedWith( INITIALIZED_ERR @@ -75,8 +75,8 @@ describe("ZNSRegistry", () => { it("Should NOT let initialize the implementation contract", async () => { const factory = new ZNSRegistry__factory(deployer); - const impl = await getProxyImplAddress(zns.registry.address); - const implContract = factory.attach(impl); + const impl = await getProxyImplAddress(await zns.registry.getAddress()); + const implContract = factory.attach(impl) as ZNSRegistry; await expect( implContract.initialize( @@ -91,20 +91,20 @@ describe("ZNSRegistry", () => { const { owner, resolver, - } = await zns.registry.getDomainRecord(ethers.constants.HashZero); + } = await zns.registry.getDomainRecord(ethers.ZeroHash); // check that the owner is the deployer expect(owner).to.eq(deployer.address); - expect(resolver).to.eq(ethers.constants.AddressZero); + expect(resolver).to.eq(ethers.ZeroAddress); // change the owner as deployer await zns.registry.connect(deployer).updateDomainOwner( - ethers.constants.HashZero, + ethers.ZeroHash, randomUser.address ); // validate - const newOwner = await zns.registry.getDomainOwner(ethers.constants.HashZero); + const newOwner = await zns.registry.getDomainOwner(ethers.ZeroHash); expect(newOwner).to.eq(randomUser.address); }); @@ -151,7 +151,7 @@ describe("ZNSRegistry", () => { it("Returns zero for a resolver type that doesn't exist", async () => { const resolver = await zns.registry.getResolverType("random-type"); - expect(resolver).to.eq(ethers.constants.AddressZero); + expect(resolver).to.eq(ethers.ZeroAddress); }); it("Adds a new resolver type", async () => { @@ -182,7 +182,7 @@ describe("ZNSRegistry", () => { await zns.registry.connect(deployer).deleteResolverType(resolverType); resolver = await zns.registry.getResolverType(resolverType); - expect(resolver).to.eq(hre.ethers.constants.AddressZero); + expect(resolver).to.eq(hre.ethers.ZeroAddress); }); }); @@ -271,7 +271,7 @@ describe("ZNSRegistry", () => { // Domain does not exist const domainHash = hashDomainLabel("random-record"); const record = await zns.registry.getDomainRecord(domainHash); - expect(record.owner).to.eq(ethers.constants.AddressZero); + expect(record.owner).to.eq(ethers.ZeroAddress); }); it("Gets a domain owner", async () => { @@ -282,7 +282,7 @@ describe("ZNSRegistry", () => { // The domain does not exist const domainHash = hashDomainLabel("random-record"); const notExistOwner = await zns.registry.getDomainOwner(domainHash); - expect(notExistOwner).to.eq(ethers.constants.AddressZero); + expect(notExistOwner).to.eq(ethers.ZeroAddress); }); it("Gets a domain resolver", async () => { @@ -293,7 +293,7 @@ describe("ZNSRegistry", () => { // The domain does not exist const domainHash = hashDomainLabel("random-record"); const notExistResolver = await zns.registry.getDomainResolver(domainHash); - expect(notExistResolver).to.eq(ethers.constants.AddressZero); + expect(notExistResolver).to.eq(ethers.ZeroAddress); }); it("Creates a new domain record successfully", async () => { @@ -392,7 +392,7 @@ describe("ZNSRegistry", () => { const domainHash = hashDomainLabel("world"); await zns.registry.connect(mockRegistrar).createDomainRecord(domainHash, deployer.address, DEFAULT_RESOLVER_TYPE); - const tx = zns.registry.updateDomainRecord(domainHash, ethers.constants.AddressZero, mockResolver.address); + const tx = zns.registry.updateDomainRecord(domainHash, ethers.ZeroAddress, mockResolver.address); await expect(tx).to.be.revertedWith(OWNER_NOT_ZERO_REG_ERR); }); @@ -401,7 +401,7 @@ describe("ZNSRegistry", () => { const domainHash = hashDomainLabel("world"); await zns.registry.connect(mockRegistrar).createDomainRecord(domainHash, deployer.address, DEFAULT_RESOLVER_TYPE); - const tx = zns.registry.updateDomainRecord(domainHash, mockResolver.address, ethers.constants.AddressZero); + const tx = zns.registry.updateDomainRecord(domainHash, mockResolver.address, ethers.ZeroAddress); await expect(tx).to.be.fulfilled; }); @@ -411,7 +411,7 @@ describe("ZNSRegistry", () => { .connect(deployer) .updateDomainOwner( wilderDomainHash, - ethers.constants.AddressZero + ethers.ZeroAddress ); await expect(tx).to.be.revertedWith(OWNER_NOT_ZERO_REG_ERR); @@ -422,12 +422,12 @@ describe("ZNSRegistry", () => { .connect(deployer) .updateDomainResolver( wilderDomainHash, - ethers.constants.AddressZero + ethers.ZeroAddress ); const zeroResolver = await zns.registry.getDomainResolver(wilderDomainHash); - expect(zeroResolver).to.be.eq(ethers.constants.AddressZero); + expect(zeroResolver).to.be.eq(ethers.ZeroAddress); }); it("Fails to update a record when caller is not owner or operator", async () => { @@ -482,7 +482,7 @@ describe("ZNSRegistry", () => { const record = await zns.registry.getDomainRecord(domainHash); - expect(record.owner).to.eq(ethers.constants.AddressZero); + expect(record.owner).to.eq(ethers.ZeroAddress); }); it("Cannot delete record without REGISTRAR_ROLE", async () => { @@ -528,24 +528,25 @@ describe("ZNSRegistry", () => { it("Emits an event when an existing domain is updated", async () => { const domainHash = hashDomainLabel("world"); - await zns.registry.connect(mockRegistrar).createDomainRecord(domainHash, deployer.address, DEFAULT_RESOLVER_TYPE); - const tx = await zns.registry - .connect(deployer) - .updateDomainRecord( - domainHash, - mockResolver.address, - DEFAULT_RESOLVER_TYPE - ); + await zns.registry.connect(mockRegistrar).createDomainRecord( + domainHash, + deployer.address, + DEFAULT_RESOLVER_TYPE + ); - const rec = await tx.wait(0); - const [ownerEvent, resolverEvent] = rec.events ?? []; - expect(ownerEvent.event).to.be.eq("DomainOwnerSet"); - expect(ownerEvent.args?.[0]).to.be.eq(domainHash); - expect(ownerEvent.args?.[1]).to.be.eq(mockResolver.address); + const tx = zns.registry.connect(deployer).updateDomainRecord( + domainHash, + mockResolver.address, + DEFAULT_RESOLVER_TYPE + ); - expect(resolverEvent.event).to.be.eq("DomainResolverSet"); - expect(resolverEvent.args?.[0]).to.be.eq(domainHash); - expect(resolverEvent.args?.[1]).to.be.eq(mockResolver.address); + await expect(tx).to.emit(zns.registry, "DomainOwnerSet").withArgs( + domainHash, + mockResolver.address, + ).to.emit(zns.registry, "DomainResolverSet").withArgs( + domainHash, + mockResolver.address, + ); }); it("Emits an event when a domain's owner is updated", async () => { @@ -591,27 +592,27 @@ describe("ZNSRegistry", () => { const registryFactory = new ZNSRegistryUpgradeMock__factory(deployer); const registry = await registryFactory.deploy(); - await registry.deployed(); + await registry.waitForDeployment(); // To control the signer we call manually here instead of through hardhat - const upgradeTx = zns.registry.connect(deployer).upgradeTo(registry.address); + const upgradeTx = zns.registry.connect(deployer).upgradeTo(await registry.getAddress()); await expect(upgradeTx).to.be.not.be.reverted; }); it("Fails when an unauthorized account tries to call to upgrade", async () => { const registryFactory = new ZNSRegistryUpgradeMock__factory(deployer); const registry = await registryFactory.deploy(); - await registry.deployed(); + await registry.waitForDeployment(); // To control the signer we call manually here instead of through hardhat - const upgradeTx = zns.registry.connect(randomUser).upgradeTo(registry.address); + const upgradeTx = zns.registry.connect(randomUser).upgradeTo(await registry.getAddress()); await expect(upgradeTx).to.be.revertedWith(getAccessRevertMsg(randomUser.address, GOVERNOR_ROLE)); }); it("Verifies that variable values are not changed in the upgrade process", async () => { const registryFactory = new ZNSRegistryUpgradeMock__factory(deployer); const registry = await registryFactory.deploy(); - await registry.deployed(); + await registry.waitForDeployment(); const domainHash = hashSubdomainName("world"); diff --git a/test/ZNSRootRegistrar.test.ts b/test/ZNSRootRegistrar.test.ts index 5fb01b6d2..587bf9d4c 100644 --- a/test/ZNSRootRegistrar.test.ts +++ b/test/ZNSRootRegistrar.test.ts @@ -1,1304 +1,1360 @@ -import * as hre from "hardhat"; -import { expect } from "chai"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; -import { - normalizeName, - validateUpgrade, - AccessType, - OwnerOf, - PaymentType, - getAccessRevertMsg, - hashDomainLabel, - DEFAULT_TOKEN_URI, - distrConfigEmpty, - INVALID_LENGTH_ERR, - INITIALIZED_ERR, - INVALID_TOKENID_ERC_ERR, - REGISTRAR_ROLE, - DEFAULT_PRECISION_MULTIPLIER, - DEFAULT_PRICE_CONFIG, - DEFAULT_REGISTRATION_FEE_PERCENT, - NOT_AUTHORIZED_REG_ERR, - NOT_BOTH_OWNER_RAR_ERR, - NOT_TOKEN_OWNER_RAR_ERR, - ONLY_NAME_OWNER_REG_ERR, - ONLY_OWNER_REGISTRAR_REG_ERR, - INVALID_NAME_ERR, - paymentConfigEmpty, -} from "./helpers"; -import { IDistributionConfig } from "./helpers/types"; -import * as ethers from "ethers"; -import { BigNumber } from "ethers"; -import { defaultRootRegistration } from "./helpers/register-setup"; -import { checkBalance } from "./helpers/balances"; -import { getPriceObject } from "./helpers/pricing"; -import { getDomainHashFromReceipt, getTokenIdFromReceipt } from "./helpers/events"; -import { IDeployCampaignConfig, TZNSContractState } from "../src/deploy/campaign/types"; -import { ADMIN_ROLE, GOVERNOR_ROLE } from "../src/deploy/constants"; -import { IERC20, ZNSRootRegistrar__factory, ZNSRootRegistrarUpgradeMock__factory } from "../typechain"; -import { PaymentConfigStruct } from "../typechain/contracts/treasury/IZNSTreasury"; -import { parseEther } from "ethers/lib/utils"; -import { runZnsCampaign } from "../src/deploy/zns-campaign"; -import { getProxyImplAddress } from "./helpers/utils"; -import { upgrades } from "hardhat"; -import { MongoDBAdapter } from "../src/deploy/db/mongo-adapter/mongo-adapter"; -import { getConfig } from "../src/deploy/campaign/environments"; -import { access } from "fs"; - -require("@nomicfoundation/hardhat-chai-matchers"); - - -// This is the only test converted to use the new Campaign, other -// contract specific tests are using `deployZNS()` helper -describe("ZNSRootRegistrar", () => { - let deployer : SignerWithAddress; - let user : SignerWithAddress; - let governor : SignerWithAddress; - let admin : SignerWithAddress; - let randomUser : SignerWithAddress; - - let zns : TZNSContractState; - let zeroVault : SignerWithAddress; - let operator : SignerWithAddress; - let userBalanceInitial : BigNumber; - - let mongoAdapter : MongoDBAdapter; - - const defaultDomain = normalizeName("wilder"); - - beforeEach(async () => { - // zeroVault address is used to hold the fee charged to the user when registering - [deployer, zeroVault, user, operator, governor, admin, randomUser] = await hre.ethers.getSigners(); - - const config : IDeployCampaignConfig = getConfig( - deployer, - zeroVault, - [deployer.address, governor.address], - [deployer.address, admin.address], - ); - - const campaign = await runZnsCampaign({ - config, - }); - - zns = campaign.state.contracts; - - mongoAdapter = campaign.dbAdapter; - - await zns.meowToken.connect(deployer).approve( - zns.treasury.address, - ethers.constants.MaxUint256 - ); - - userBalanceInitial = ethers.utils.parseEther("100000000000"); - // Give funds to user - await zns.meowToken.connect(user).approve(zns.treasury.address, ethers.constants.MaxUint256); - await zns.meowToken.mint(user.address, userBalanceInitial); - }); - - afterEach(async () => { - await mongoAdapter.dropDB(); - }); - - it("Sets the payment config when provided with the domain registration", async () => { - const tokenURI = "https://example.com/817c64af"; - const distrConfig : IDistributionConfig = { - pricerContract: zns.curvePricer.address, - paymentType: PaymentType.STAKE, - accessType: AccessType.OPEN, - }; - - await zns.rootRegistrar.connect(user).registerRootDomain( - defaultDomain, - zns.addressResolver.address, - tokenURI, - distrConfig, - { - token: zns.meowToken.address, - beneficiary: user.address, - } - ); - - const domainHash = hashDomainLabel(defaultDomain); - const config = await zns.treasury.paymentConfigs(domainHash); - expect(config.token).to.eq(zns.meowToken.address); - expect(config.beneficiary).to.eq(user.address); - }); - - it("Does not set the payment config when the beneficiary is the zero address", async () => { - const tokenURI = "https://example.com/817c64af"; - const distrConfig : IDistributionConfig = { - pricerContract: zns.curvePricer.address, - paymentType: PaymentType.STAKE, - accessType: AccessType.OPEN, - }; - - await zns.rootRegistrar.connect(user).registerRootDomain( - defaultDomain, - zns.addressResolver.address, - tokenURI, - distrConfig, - paymentConfigEmpty - ); - - const domainHash = hashDomainLabel(defaultDomain); - const config = await zns.treasury.paymentConfigs(domainHash); - expect(config.token).to.eq(ethers.constants.AddressZero); - expect(config.beneficiary).to.eq(ethers.constants.AddressZero); - }); - - it("Gas tests", async () => { - const tokenURI = "https://example.com/817c64af"; - const distrConfig : IDistributionConfig = { - pricerContract: zns.curvePricer.address, - paymentType: PaymentType.STAKE, - accessType: AccessType.OPEN, - }; - - const tx = await zns.rootRegistrar.connect(deployer).registerRootDomain( - defaultDomain, - deployer.address, - tokenURI, - distrConfig, - { - token: ethers.constants.AddressZero, - beneficiary: ethers.constants.AddressZero, - } - ); - - const receipt = await tx.wait(); - - const domainHash = await getDomainHashFromReceipt(receipt); - - // Registering as deployer (owner of parent) and user is different gas values - await zns.subRegistrar.connect(deployer).registerSubdomain( - domainHash, - "subdomain", - deployer.address, - tokenURI, - distrConfigEmpty, - paymentConfigEmpty, - ); - - const candidates = [ - deployer.address, - user.address, - governor.address, - admin.address, - randomUser.address, - ]; - - const allowed = [ - true, - true, - true, - true, - true, - ]; - - await zns.subRegistrar.updateMintlistForDomain( - domainHash, - candidates, - allowed - ); - }); - - it("Should NOT initialize the implementation contract", async () => { - const factory = new ZNSRootRegistrar__factory(deployer); - const impl = await getProxyImplAddress(zns.rootRegistrar.address); - const implContract = factory.attach(impl); - - await expect( - implContract.initialize( - operator.address, - operator.address, - operator.address, - operator.address, - operator.address, - ) - ).to.be.revertedWith(INITIALIZED_ERR); - }); - - it("Allows transfer of 0x0 domain ownership after deployment", async () => { - await zns.registry.updateDomainOwner(ethers.constants.HashZero, user.address); - expect(await zns.registry.getDomainOwner(ethers.constants.HashZero)).to.equal(user.address); - }); - - it("Confirms a new 0x0 owner can modify the configs in the treasury and curve pricer", async () => { - await zns.registry.updateDomainOwner(ethers.constants.HashZero, user.address); - - const newTreasuryConfig : PaymentConfigStruct = { - token: zeroVault.address, // Just needs to be a different address - beneficiary: user.address, - }; - - // Modify the treasury - const treasuryTx = await zns.treasury.connect(user).setPaymentConfig(ethers.constants.HashZero, newTreasuryConfig); - - await expect(treasuryTx).to.emit( - zns.treasury, - "BeneficiarySet" - ).withArgs( - ethers.constants.HashZero, - user.address - ); - await expect(treasuryTx).to.emit( - zns.treasury, - "PaymentTokenSet" - ).withArgs( - ethers.constants.HashZero, - zeroVault.address - ); - - // Modify the curve pricer - const newPricerConfig = { - baseLength: BigNumber.from("6"), - maxLength: BigNumber.from("35"), - maxPrice: parseEther("150"), - minPrice: parseEther("10"), - precisionMultiplier: DEFAULT_PRECISION_MULTIPLIER, - feePercentage: DEFAULT_REGISTRATION_FEE_PERCENT, - isSet: true, - }; - - const pricerTx = await zns.curvePricer.connect(user).setPriceConfig( - ethers.constants.HashZero, - newPricerConfig, - ); - - await expect(pricerTx).to.emit(zns.curvePricer, "PriceConfigSet").withArgs( - ethers.constants.HashZero, - newPricerConfig.maxPrice, - newPricerConfig.minPrice, - newPricerConfig.maxLength, - newPricerConfig.baseLength, - newPricerConfig.precisionMultiplier, - newPricerConfig.feePercentage, - ); - }); - - it("Confirms a user has funds and allowance for the Registrar", async () => { - const balance = await zns.meowToken.balanceOf(user.address); - expect(balance).to.eq(userBalanceInitial); - - const allowance = await zns.meowToken.allowance(user.address, zns.treasury.address); - expect(allowance).to.eq(ethers.constants.MaxUint256); - }); - - it("Should revert when initialize() without ADMIN_ROLE", async () => { - const userHasAdmin = await zns.accessController.hasRole(ADMIN_ROLE, user.address); - expect(userHasAdmin).to.be.false; - - const registrarFactory = new ZNSRootRegistrar__factory(user); - - const tx = upgrades.deployProxy( - registrarFactory, - [ - zns.accessController.address, - zns.registry.address, - zns.curvePricer.address, - zns.treasury.address, - zns.domainToken.address, - ], - { - kind: "uups", - } - ); - - await expect(tx).to.be.revertedWith(getAccessRevertMsg(user.address, ADMIN_ROLE)); - }); - - it("Should NOT initialize twice", async () => { - const tx = zns.rootRegistrar.connect(deployer).initialize( - zns.accessController.address, - randomUser.address, - randomUser.address, - randomUser.address, - randomUser.address, - ); - - await expect(tx).to.be.revertedWith("Initializable: contract is already initialized"); - }); - - describe("General functionality", () => { - it("#coreRegister() should revert if called by address without REGISTRAR_ROLE", async () => { - const isRegistrar = await zns.accessController.hasRole(REGISTRAR_ROLE, randomUser.address); - expect(isRegistrar).to.be.false; - - await expect( - zns.rootRegistrar.connect(randomUser).coreRegister({ - parentHash: ethers.constants.HashZero, - domainHash: ethers.constants.HashZero, - label: "randomname", - registrant: ethers.constants.AddressZero, - price: "0", - stakeFee: "0", - domainAddress: ethers.constants.AddressZero, - tokenURI: "", - isStakePayment: false, - paymentConfig: paymentConfigEmpty, - }) - ).to.be.revertedWith( - getAccessRevertMsg(randomUser.address, REGISTRAR_ROLE) - ); - }); - - it("#isOwnerOf() returns correct bools", async () => { - const topLevelTx = await defaultRootRegistration({ - user, - zns, - domainName: defaultDomain, - }); - const domainHash = await getDomainHashFromReceipt(topLevelTx); - const tokenId = BigNumber.from(domainHash); - - const isOwnerOfBothUser = await zns.rootRegistrar.isOwnerOf( - domainHash, - user.address, - OwnerOf.BOTH - ); - expect(isOwnerOfBothUser).to.be.true; - - const isOwnerOfBothRandom = await zns.rootRegistrar.isOwnerOf( - domainHash, - randomUser.address, - OwnerOf.BOTH - ); - expect(isOwnerOfBothRandom).to.be.false; - - // transfer token - await zns.domainToken.connect(user).transferFrom(user.address, randomUser.address, tokenId); - const isOwnerOfTokenUser = await zns.rootRegistrar.isOwnerOf( - domainHash, - user.address, - OwnerOf.TOKEN - ); - expect(isOwnerOfTokenUser).to.be.false; - - const isOwnerOfTokenRandom = await zns.rootRegistrar.isOwnerOf( - domainHash, - randomUser.address, - OwnerOf.TOKEN - ); - expect(isOwnerOfTokenRandom).to.be.true; - - const isOwnerOfNameUser = await zns.rootRegistrar.isOwnerOf( - domainHash, - user.address, - OwnerOf.NAME - ); - expect(isOwnerOfNameUser).to.be.true; - - const isOwnerOfNameRandom = await zns.rootRegistrar.isOwnerOf( - domainHash, - randomUser.address, - OwnerOf.NAME - ); - expect(isOwnerOfNameRandom).to.be.false; - - await expect( - zns.rootRegistrar.isOwnerOf(domainHash, user.address, 3) - ).to.be.reverted; - }); - - it("#setSubRegistrar() should revert if called by address without ADMIN_ROLE", async () => { - const isAdmin = await zns.accessController.hasRole(ADMIN_ROLE, randomUser.address); - expect(isAdmin).to.be.false; - - await expect( - zns.rootRegistrar.connect(randomUser).setSubRegistrar(randomUser.address) - ).to.be.revertedWith( - getAccessRevertMsg(randomUser.address, ADMIN_ROLE) - ); - }); - - it("#setSubRegistrar() should set the correct address", async () => { - await zns.rootRegistrar.connect(admin).setSubRegistrar(randomUser.address); - - expect( - await zns.rootRegistrar.subRegistrar() - ).to.equal(randomUser.address); - }); - - it("#setSubRegistrar() should NOT set the address to zero address", async () => { - await expect( - zns.rootRegistrar.connect(admin).setSubRegistrar(ethers.constants.AddressZero) - ).to.be.revertedWith( - "ZNSRootRegistrar: subRegistrar_ is 0x0 address" - ); - }); - }); - - describe("Registers a root domain", () => { - it("Can NOT register a TLD with an empty name", async () => { - const emptyName = ""; - - await expect( - defaultRootRegistration({ - user: deployer, - zns, - domainName: emptyName, - }) - ).to.be.revertedWith(INVALID_LENGTH_ERR); - }); - - it("Can register a TLD with characters [a-z0-9-]", async () => { - const letters = "world"; - const lettersHash = hashDomainLabel(letters); - - const alphaNumeric = "0x0dwidler0x0"; - const alphaNumericHash = hashDomainLabel(alphaNumeric); - - const withHyphen = "0x0-dwidler-0x0"; - const withHyphenHash = hashDomainLabel(withHyphen); - - const tx1 = zns.rootRegistrar.connect(deployer).registerRootDomain( - letters, - ethers.constants.AddressZero, - DEFAULT_TOKEN_URI, - distrConfigEmpty, - { - token: ethers.constants.AddressZero, - beneficiary: ethers.constants.AddressZero, - } - ); - - await expect(tx1).to.emit(zns.rootRegistrar, "DomainRegistered").withArgs( - ethers.constants.HashZero, - lettersHash, - BigNumber.from(lettersHash), - letters, - deployer.address, - ethers.constants.AddressZero, - ); - - const tx2 = zns.rootRegistrar.connect(deployer).registerRootDomain( - alphaNumeric, - ethers.constants.AddressZero, - DEFAULT_TOKEN_URI, - distrConfigEmpty, - { - token: ethers.constants.AddressZero, - beneficiary: ethers.constants.AddressZero, - } - ); - - await expect(tx2).to.emit(zns.rootRegistrar, "DomainRegistered").withArgs( - ethers.constants.HashZero, - alphaNumericHash, - BigNumber.from(alphaNumericHash), - alphaNumeric, - deployer.address, - ethers.constants.AddressZero, - ); - - const tx3 = zns.rootRegistrar.connect(deployer).registerRootDomain( - withHyphen, - ethers.constants.AddressZero, - DEFAULT_TOKEN_URI, - distrConfigEmpty, - { - token: ethers.constants.AddressZero, - beneficiary: ethers.constants.AddressZero, - } - ); - - await expect(tx3).to.emit(zns.rootRegistrar, "DomainRegistered").withArgs( - ethers.constants.HashZero, - withHyphenHash, - BigNumber.from(withHyphenHash), - withHyphen, - deployer.address, - ethers.constants.AddressZero, - ); - }); - - it("Fails for domains that use any invalid character", async () => { - // Valid names must match the pattern [a-z0-9] - const nameA = "WILDER"; - const nameB = "!?w1Id3r!?"; - const nameC = "!%$#^*?!#👍3^29"; - const nameD = "wo.rld"; - - await expect( - defaultRootRegistration({ - user: deployer, - zns, - domainName: nameA, - }) - ).to.be.revertedWith(INVALID_NAME_ERR); - - await expect( - defaultRootRegistration({ - user: deployer, - zns, - domainName: nameB, - }) - ).to.be.revertedWith(INVALID_NAME_ERR); - - await expect( - defaultRootRegistration({ - user: deployer, - zns, - domainName: nameC, - }) - ).to.be.revertedWith(INVALID_NAME_ERR); - - await expect( - defaultRootRegistration({ - user: deployer, - zns, - domainName: nameD, - }) - ).to.be.revertedWith(INVALID_NAME_ERR); - }); - - // eslint-disable-next-line max-len - it("Successfully registers a domain without a resolver or resolver content and fires a #DomainRegistered event", async () => { - const tokenURI = "https://example.com/817c64af"; - const tx = await zns.rootRegistrar.connect(user).registerRootDomain( - defaultDomain, - ethers.constants.AddressZero, - tokenURI, - distrConfigEmpty, - { - token: ethers.constants.AddressZero, - beneficiary: ethers.constants.AddressZero, - } - ); - - const hashFromTS = hashDomainLabel(defaultDomain); - - await expect(tx).to.emit(zns.rootRegistrar, "DomainRegistered").withArgs( - ethers.constants.HashZero, - hashFromTS, - BigNumber.from(hashFromTS), - defaultDomain, - user.address, - ethers.constants.AddressZero, - ); - - const tokenURISC = await zns.domainToken.tokenURI(hashFromTS); - expect(tokenURISC).to.eq(tokenURI); - }); - - it("Successfully registers a domain with distrConfig and adds it to state properly", async () => { - const distrConfig = { - pricerContract: zns.fixedPricer.address, - accessType: AccessType.OPEN, - paymentType: PaymentType.DIRECT, - }; - const tokenURI = "https://example.com/817c64af"; - - const tx = await zns.rootRegistrar.connect(user).registerRootDomain( - defaultDomain, - ethers.constants.AddressZero, - tokenURI, - distrConfig, - { - token: ethers.constants.AddressZero, - beneficiary: ethers.constants.AddressZero, - } - ); - - const receipt = await tx.wait(0); - - const domainHash = await getDomainHashFromReceipt(receipt); - - const { - pricerContract, - accessType, - paymentType, - } = await zns.subRegistrar.distrConfigs(domainHash); - - expect(pricerContract).to.eq(distrConfig.pricerContract); - expect(paymentType).to.eq(distrConfig.paymentType); - expect(accessType).to.eq(distrConfig.accessType); - - const tokenURISC = await zns.domainToken.tokenURI(domainHash); - expect(tokenURISC).to.eq(tokenURI); - }); - - it("Stakes and saves the correct amount and token, takes the correct fee and sends fee to Zero Vault", async () => { - const balanceBeforeUser = await zns.meowToken.balanceOf(user.address); - const balanceBeforeVault = await zns.meowToken.balanceOf(zeroVault.address); - - // Deploy "wilder" with default configuration - const tx = await defaultRootRegistration({ - user, - zns, - domainName: defaultDomain, - }); - const domainHash = await getDomainHashFromReceipt(tx); - const { - totalPrice, - expectedPrice, - stakeFee, - } = getPriceObject(defaultDomain, DEFAULT_PRICE_CONFIG); - - await checkBalance({ - token: zns.meowToken as IERC20, - balanceBefore: balanceBeforeUser, - userAddress: user.address, - target: totalPrice, - }); - - await checkBalance({ - token: zns.meowToken as IERC20, - balanceBefore: balanceBeforeVault, - userAddress: zeroVault.address, - target: stakeFee, - shouldDecrease: false, - }); - - const { amount: staked, token } = await zns.treasury.stakedForDomain(domainHash); - - expect(staked).to.eq(expectedPrice); - expect(token).to.eq(zns.meowToken.address); - }); - - it("Sets the correct data in Registry", async () => { - const tx = await defaultRootRegistration({ - user, - zns, - domainName: defaultDomain, - }); - - const namehashRef = hashDomainLabel(defaultDomain); - const domainHash = await getDomainHashFromReceipt(tx); - expect(domainHash).to.eq(namehashRef); - - const { - owner: ownerFromReg, - resolver: resolverFromReg, - } = await zns.registry.getDomainRecord(domainHash); - - expect(ownerFromReg).to.eq(user.address); - expect(resolverFromReg).to.eq(zns.addressResolver.address); - }); - - it("Fails when the user does not have enough funds", async () => { - const balance = await zns.meowToken.balanceOf(user.address); - await zns.meowToken.connect(user).transfer(randomUser.address, balance); - - const tx = defaultRootRegistration({ - user, - zns, - domainName: defaultDomain, - }); - await expect(tx).to.be.revertedWith("ERC20: transfer amount exceeds balance"); - }); - - it("Disallows creation of a duplicate domain", async () => { - await defaultRootRegistration({ - user, - zns, - domainName: defaultDomain, - }); - const failTx = defaultRootRegistration({ - user: deployer, - zns, - domainName: defaultDomain, - }); - - await expect(failTx).to.be.revertedWith("ZNSRootRegistrar: Domain already exists"); - }); - - it("Successfully registers a domain without resolver content", async () => { - const tx = zns.rootRegistrar.connect(user).registerRootDomain( - defaultDomain, - ethers.constants.AddressZero, - DEFAULT_TOKEN_URI, - distrConfigEmpty, - { - token: ethers.constants.AddressZero, - beneficiary: ethers.constants.AddressZero, - } - ); - - await expect(tx).to.not.be.reverted; - }); - - it("Records the correct domain hash", async () => { - const tx = await defaultRootRegistration({ - user, - zns, - domainName: defaultDomain, - }); - - const domainHash = await getDomainHashFromReceipt(tx); - - const exists = await zns.registry.exists(domainHash); - expect(exists).to.be.true; - expect(domainHash).to.eq(hashDomainLabel(defaultDomain)); - }); - - it("Creates and finds the correct tokenId", async () => { - const tx = await defaultRootRegistration({ - user, - zns, - domainName: defaultDomain, - }); - - const tokenId = await getTokenIdFromReceipt(tx); - const owner = await zns.domainToken.ownerOf(tokenId); - expect(owner).to.eq(user.address); - }); - - it("Resolves the correct address from the domain", async () => { - const tx = await defaultRootRegistration({ - user, - zns, - domainName: defaultDomain, - domainContent: zns.rootRegistrar.address, - }); - const domainHash = await getDomainHashFromReceipt(tx); - - const resolvedAddress = await zns.addressResolver.resolveDomainAddress(domainHash); - expect(resolvedAddress).to.eq(zns.rootRegistrar.address); - }); - - it("Should NOT charge any tokens if price and/or stake fee is 0", async () => { - // set config on CurvePricer for the price to be 0 - await zns.curvePricer.connect(deployer).setMaxPrice(ethers.constants.HashZero, "0"); - await zns.curvePricer.connect(deployer).setMinPrice(ethers.constants.HashZero, "0"); - - const userBalanceBefore = await zns.meowToken.balanceOf(user.address); - const vaultBalanceBefore = await zns.meowToken.balanceOf(zeroVault.address); - - // register a domain - await zns.rootRegistrar.connect(user).registerRootDomain( - defaultDomain, - ethers.constants.AddressZero, - DEFAULT_TOKEN_URI, - distrConfigEmpty, - { - token: ethers.constants.AddressZero, - beneficiary: ethers.constants.AddressZero, - } - ); - - const userBalanceAfter = await zns.meowToken.balanceOf(user.address); - const vaultBalanceAfter = await zns.meowToken.balanceOf(zeroVault.address); - - expect(userBalanceBefore).to.eq(userBalanceAfter); - expect(vaultBalanceBefore).to.eq(vaultBalanceAfter); - - // check existence in Registry - const domainHash = hashDomainLabel(defaultDomain); - const exists = await zns.registry.exists(domainHash); - expect(exists).to.be.true; - - // make sure no transfers happened - const transferEventFilter = zns.meowToken.filters.Transfer( - user.address, - ); - const events = await zns.meowToken.queryFilter(transferEventFilter); - expect(events.length).to.eq(0); - }); - }); - - describe("Reclaiming Domains", () => { - it("Can reclaim name/stake if Token is owned", async () => { - // Register Top level - const topLevelTx = await defaultRootRegistration({ user: deployer, zns, domainName: defaultDomain }); - const domainHash = await getDomainHashFromReceipt(topLevelTx); - const tokenId = await getTokenIdFromReceipt(topLevelTx); - const { amount: staked, token } = await zns.treasury.stakedForDomain(domainHash); - - // Transfer the domain token - await zns.domainToken.connect(deployer).transferFrom(deployer.address, user.address, tokenId); - - // Verify owner in registry - const originalOwner = await zns.registry.connect(deployer).getDomainOwner(domainHash); - expect(originalOwner).to.equal(deployer.address); - - // Reclaim the Domain - await zns.rootRegistrar.connect(user).reclaimDomain(domainHash); - - // Verify domain token is still owned - const owner = await zns.domainToken.connect(user).ownerOf(tokenId); - expect(owner).to.equal(user.address); - - // Verify domain is owned in registry - const registryOwner = await zns.registry.connect(user).getDomainOwner(domainHash); - expect(registryOwner).to.equal(user.address); - - // Verify same amount is staked - const { amount: stakedAfterReclaim, token: tokenAfterReclaim } = await zns.treasury.stakedForDomain(domainHash); - expect(staked).to.equal(stakedAfterReclaim); - expect(tokenAfterReclaim).to.equal(zns.meowToken.address); - expect(token).to.equal(tokenAfterReclaim); - }); - - it("Reclaiming domain token emits DomainReclaimed event", async () => { - const topLevelTx = await defaultRootRegistration({ user: deployer, zns, domainName: defaultDomain }); - const domainHash = await getDomainHashFromReceipt(topLevelTx); - const tokenId = await getTokenIdFromReceipt(topLevelTx); - - // Transfer the domain token - await zns.domainToken.connect(deployer).transferFrom(deployer.address, user.address, tokenId); - // Reclaim the Domain - const tx = await zns.rootRegistrar.connect(user).reclaimDomain(domainHash); - const receipt = await tx.wait(0); - - // Verify Transfer event is emitted - expect(receipt.events?.[1].event).to.eq("DomainReclaimed"); - expect(receipt.events?.[1].args?.domainHash).to.eq( - domainHash - ); - expect(receipt.events?.[1].args?.registrant).to.eq( - user.address - ); - }); - - it("Cannot reclaim name/stake if token is not owned", async () => { - const topLevelTx = await defaultRootRegistration({ user: deployer, zns, domainName: defaultDomain }); - const domainHash = await getDomainHashFromReceipt(topLevelTx); - // Reclaim the Domain - const tx = zns.rootRegistrar.connect(user).reclaimDomain(domainHash); - - // Verify Domain is not reclaimed - await expect(tx).to.be.revertedWith(NOT_TOKEN_OWNER_RAR_ERR); - - // Verify domain is not owned in registrar - const registryOwner = await zns.registry.connect(user).getDomainOwner(domainHash); - expect(registryOwner).to.equal(deployer.address); - }); - - it("Cannot reclaim if domain does not exist", async () => { - const domainHash = "0xd34cfa279afd55afc6aa9c00aa5d01df60179840a93d10eed730058b8dd4146c"; - // Reclaim the Domain - const tx = zns.rootRegistrar.connect(user).reclaimDomain(domainHash); - - // Verify Domain is not reclaimed - await expect(tx).to.be.revertedWith(INVALID_TOKENID_ERC_ERR); - }); - - it("Domain Token can be reclaimed, transferred, and then reclaimed again", async () => { - // Register Top level - const topLevelTx = await defaultRootRegistration({ user: deployer, zns, domainName: defaultDomain }); - const domainHash = await getDomainHashFromReceipt(topLevelTx); - const tokenId = await getTokenIdFromReceipt(topLevelTx); - const { amount: staked, token } = await zns.treasury.stakedForDomain(domainHash); - - // Transfer the domain token - await zns.domainToken.connect(deployer).transferFrom(deployer.address, user.address, tokenId); - - // Reclaim the Domain - await zns.rootRegistrar.connect(user).reclaimDomain(domainHash); - // Verify domain token is still owned - let owner = await zns.domainToken.connect(user).ownerOf(tokenId); - expect(owner).to.equal(user.address); - - // Transfer the domain token back - await zns.domainToken.connect(user).transferFrom(user.address, deployer.address, tokenId); - - // Reclaim the Domain again - await zns.rootRegistrar.connect(deployer).reclaimDomain(domainHash); - - // Verify domain token is owned - owner = await zns.domainToken.connect(deployer).ownerOf(tokenId); - expect(owner).to.equal(deployer.address); - - // Verify domain is owned in registrar - const registryOwner = await zns.registry.connect(deployer).getDomainOwner(domainHash); - expect(registryOwner).to.equal(deployer.address); - - // Verify same amount is staked - const { amount: stakedAfterReclaim, token: tokenAfterReclaim } = await zns.treasury.stakedForDomain(domainHash); - expect(staked).to.equal(stakedAfterReclaim); - expect(tokenAfterReclaim).to.equal(zns.meowToken.address); - expect(token).to.equal(tokenAfterReclaim); - }); - - it("Can revoke and unstake after reclaiming", async () => { - // Verify Balance - const balance = await zns.meowToken.balanceOf(user.address); - expect(balance).to.eq(userBalanceInitial); - - // Register Top level - const topLevelTx = await defaultRootRegistration({ user: deployer, zns, domainName: defaultDomain }); - const domainHash = await getDomainHashFromReceipt(topLevelTx); - const tokenId = await getTokenIdFromReceipt(topLevelTx); - - // Validated staked values - const { - expectedPrice: expectedStaked, - } = getPriceObject(defaultDomain, DEFAULT_PRICE_CONFIG); - const { amount: staked, token } = await zns.treasury.stakedForDomain(domainHash); - expect(staked).to.eq(expectedStaked); - expect(token).to.eq(zns.meowToken.address); - - // Transfer the domain token - await zns.domainToken.connect(deployer).transferFrom(deployer.address, user.address, tokenId); - - // Reclaim the Domain - await zns.rootRegistrar.connect(user).reclaimDomain(domainHash); - - // Revoke the Domain - await zns.rootRegistrar.connect(user).revokeDomain(domainHash); - - // Validated funds are unstaked - const { amount: finalstaked, token: finalToken } = await zns.treasury.stakedForDomain(domainHash); - expect(finalstaked).to.equal(ethers.BigNumber.from("0")); - expect(finalToken).to.equal(ethers.constants.AddressZero); - - // Verify final balances - const computedFinalBalance = balance.add(staked); - const finalBalance = await zns.meowToken.balanceOf(user.address); - expect(computedFinalBalance).to.equal(finalBalance); - }); - }); - - describe("Revoking Domains", () => { - it("Revokes a Top level Domain, locks distribution and removes mintlist", async () => { - // Register Top level - const topLevelTx = await defaultRootRegistration({ - user, - zns, - domainName: defaultDomain, - distrConfig: { - pricerContract: zns.fixedPricer.address, - paymentType: PaymentType.DIRECT, - accessType: AccessType.OPEN, - }, - }); - - const domainHash = await getDomainHashFromReceipt(topLevelTx); - - // add mintlist to check revocation - await zns.subRegistrar.connect(user).updateMintlistForDomain( - domainHash, - [user.address, zeroVault.address], - [true, true] - ); - - const ogPrice = BigNumber.from(135); - await zns.fixedPricer.connect(user).setPriceConfig( - domainHash, - { - price: ogPrice, - feePercentage: BigNumber.from(0), - isSet: true, - } - ); - expect(await zns.fixedPricer.getPrice(domainHash, defaultDomain, false)).to.eq(ogPrice); - - const tokenId = await getTokenIdFromReceipt(topLevelTx); - - // Revoke the domain and then verify - await zns.rootRegistrar.connect(user).revokeDomain(domainHash); - - // Verify token has been burned - const ownerOfTx = zns.domainToken.connect(user).ownerOf(tokenId); - await expect(ownerOfTx).to.be.revertedWith( - INVALID_TOKENID_ERC_ERR - ); - - // Verify Domain Record Deleted - const exists = await zns.registry.exists(domainHash); - expect(exists).to.be.false; - - // validate access type has been set to LOCKED - const { accessType } = await zns.subRegistrar.distrConfigs(domainHash); - expect(accessType).to.eq(AccessType.LOCKED); - - // validate mintlist has been removed - expect(await zns.subRegistrar.isMintlistedForDomain(domainHash, user.address)).to.be.false; - expect(await zns.subRegistrar.isMintlistedForDomain(domainHash, zeroVault.address)).to.be.false; - }); - - it("Cannot revoke a domain that doesnt exist", async () => { - // Register Top level - const fakeHash = "0xd34cfa279afd55afc6aa9c00aa5d01df60179840a93d10eed730058b8dd4146c"; - const exists = await zns.registry.exists(fakeHash); - expect(exists).to.be.false; - - // Verify transaction is reverted - const tx = zns.rootRegistrar.connect(user).revokeDomain(fakeHash); - await expect(tx).to.be.revertedWith(NOT_BOTH_OWNER_RAR_ERR); - }); - - it("Revoking domain unstakes", async () => { - // Verify Balance - const balance = await zns.meowToken.balanceOf(user.address); - expect(balance).to.eq(userBalanceInitial); - - // Register Top level - const tx = await defaultRootRegistration({ user, zns, domainName: defaultDomain }); - const domainHash = await getDomainHashFromReceipt(tx); - - // Validated staked values - const { - expectedPrice: expectedStaked, - stakeFee: expectedStakeFee, - } = getPriceObject(defaultDomain, DEFAULT_PRICE_CONFIG); - const { amount: staked, token } = await zns.treasury.stakedForDomain(domainHash); - expect(staked).to.eq(expectedStaked); - expect(token).to.eq(zns.meowToken.address); - - // Get balance after staking - const balanceAfterStaking = await zns.meowToken.balanceOf(user.address); - - // Revoke the domain - await zns.rootRegistrar.connect(user).revokeDomain(domainHash); - - // Validated funds are unstaked - const { amount: finalstaked, token: finalToken } = await zns.treasury.stakedForDomain(domainHash); - expect(finalstaked).to.equal(ethers.BigNumber.from("0")); - expect(finalToken).to.equal(ethers.constants.AddressZero); - - // Verify final balances - const computedBalanceAfterStaking = balanceAfterStaking.add(staked); - const balanceMinusFee = balance.sub(expectedStakeFee); - expect(computedBalanceAfterStaking).to.equal(balanceMinusFee); - const finalBalance = await zns.meowToken.balanceOf(user.address); - expect(computedBalanceAfterStaking).to.equal(finalBalance); - }); - - it("Cannot revoke if Name is owned by another user", async () => { - // Register Top level - const topLevelTx = await defaultRootRegistration({ user: deployer, zns, domainName: defaultDomain }); - const parentDomainHash = await getDomainHashFromReceipt(topLevelTx); - const owner = await zns.registry.connect(user).getDomainOwner(parentDomainHash); - expect(owner).to.not.equal(user.address); - - // Try to revoke domain - const tx = zns.rootRegistrar.connect(user).revokeDomain(parentDomainHash); - await expect(tx).to.be.revertedWith(NOT_BOTH_OWNER_RAR_ERR); - }); - - it("No one can revoke if Token and Name have different owners", async () => { - // Register Top level - const topLevelTx = await defaultRootRegistration({ user: deployer, zns, domainName: defaultDomain }); - const parentDomainHash = await getDomainHashFromReceipt(topLevelTx); - const owner = await zns.registry.connect(user).getDomainOwner(parentDomainHash); - expect(owner).to.not.equal(user.address); - - const tokenId = BigNumber.from(parentDomainHash); - - await zns.domainToken.transferFrom(deployer.address, user.address, tokenId); - - // Try to revoke domain as a new owner of the token - const tx = zns.rootRegistrar.connect(user).revokeDomain(parentDomainHash); - await expect(tx).to.be.revertedWith(NOT_BOTH_OWNER_RAR_ERR); - - const tx2 = zns.rootRegistrar.connect(deployer).revokeDomain(parentDomainHash); - await expect(tx2).to.be.revertedWith(NOT_BOTH_OWNER_RAR_ERR); - }); - - it("After domain has been revoked, an old operator can NOT access Registry", async () => { - // Register Top level - const tx = await defaultRootRegistration({ user, zns, domainName: defaultDomain }); - const domainHash = await getDomainHashFromReceipt(tx); - - // assign an operator - await zns.registry.connect(user).setOwnersOperator(operator.address, true); - - // Revoke the domain - await zns.rootRegistrar.connect(user).revokeDomain(domainHash); - - // check operator access to the revoked domain - const tx2 = zns.registry - .connect(operator) - .updateDomainOwner( - domainHash, - operator.address - ); - await expect(tx2).to.be.revertedWith( - ONLY_OWNER_REGISTRAR_REG_ERR - ); - - const tx3 = zns.registry - .connect(operator) - .updateDomainRecord( - domainHash, - user.address, - operator.address - ); - await expect(tx3).to.be.revertedWith( - ONLY_NAME_OWNER_REG_ERR - ); - - const tx4 = zns.registry - .connect(operator) - .updateDomainResolver( - domainHash, - zeroVault.address - ); - await expect(tx4).to.be.revertedWith( - NOT_AUTHORIZED_REG_ERR - ); - }); - }); - - describe("State Setters", () => { - describe("#setAccessController", () => { - it("Should set AccessController and fire AccessControllerSet event", async () => { - const currentAC = await zns.rootRegistrar.getAccessController(); - const tx = await zns.rootRegistrar.connect(deployer).setAccessController(randomUser.address); - const newAC = await zns.rootRegistrar.getAccessController(); - - await expect(tx).to.emit(zns.rootRegistrar, "AccessControllerSet").withArgs(randomUser.address); - - expect(newAC).to.equal(randomUser.address); - expect(currentAC).to.not.equal(newAC); - }); - - it("Should revert if not called by ADMIN", async () => { - const tx = zns.rootRegistrar.connect(user).setAccessController(randomUser.address); - await expect(tx).to.be.revertedWith( - getAccessRevertMsg(user.address, ADMIN_ROLE) - ); - }); - - it("Should revert if new AccessController is address zero", async () => { - const tx = zns.rootRegistrar.connect(deployer).setAccessController(ethers.constants.AddressZero); - await expect(tx).to.be.revertedWith("AC: _accessController is 0x0 address"); - }); - }); - - describe("#setRegistry", () => { - it("Should set ZNSRegistry and fire RegistrySet event", async () => { - const currentRegistry = await zns.rootRegistrar.registry(); - const tx = await zns.rootRegistrar.connect(deployer).setRegistry(randomUser.address); - const newRegistry = await zns.rootRegistrar.registry(); - - await expect(tx).to.emit(zns.rootRegistrar, "RegistrySet").withArgs(randomUser.address); - - expect(newRegistry).to.equal(randomUser.address); - expect(currentRegistry).to.not.equal(newRegistry); - }); - - it("Should revert if not called by ADMIN", async () => { - const tx = zns.rootRegistrar.connect(user).setRegistry(randomUser.address); - await expect(tx).to.be.revertedWith( - getAccessRevertMsg(user.address, ADMIN_ROLE) - ); - }); - - it("Should revert if ZNSRegistry is address zero", async () => { - const tx = zns.rootRegistrar.connect(deployer).setRegistry(ethers.constants.AddressZero); - await expect(tx).to.be.revertedWith("ARegistryWired: _registry can not be 0x0 address"); - }); - }); - - describe("#setTreasury", () => { - it("Should set Treasury and fire TreasurySet event", async () => { - const currentTreasury = await zns.rootRegistrar.treasury(); - const tx = await zns.rootRegistrar.connect(deployer).setTreasury(randomUser.address); - const newTreasury = await zns.rootRegistrar.treasury(); - - await expect(tx).to.emit(zns.rootRegistrar, "TreasurySet").withArgs(randomUser.address); - - expect(newTreasury).to.equal(randomUser.address); - expect(currentTreasury).to.not.equal(newTreasury); - }); - - it("Should revert if not called by ADMIN", async () => { - const tx = zns.rootRegistrar.connect(user).setTreasury(randomUser.address); - await expect(tx).to.be.revertedWith( - getAccessRevertMsg(user.address, ADMIN_ROLE) - ); - }); - - it("Should revert if Treasury is address zero", async () => { - const tx = zns.rootRegistrar.connect(deployer).setTreasury(ethers.constants.AddressZero); - await expect(tx).to.be.revertedWith("ZNSRootRegistrar: treasury_ is 0x0 address"); - }); - }); - - describe("#setDomainToken", () => { - it("Should set DomainToken and fire DomainTokenSet event", async () => { - const currentToken = await zns.rootRegistrar.domainToken(); - const tx = await zns.rootRegistrar.connect(deployer).setDomainToken(randomUser.address); - const newToken = await zns.rootRegistrar.domainToken(); - - await expect(tx).to.emit(zns.rootRegistrar, "DomainTokenSet").withArgs(randomUser.address); - - expect(newToken).to.equal(randomUser.address); - expect(currentToken).to.not.equal(newToken); - }); - - it("Should revert if not called by ADMIN", async () => { - const tx = zns.rootRegistrar.connect(user).setDomainToken(randomUser.address); - await expect(tx).to.be.revertedWith( - getAccessRevertMsg(user.address, ADMIN_ROLE) - ); - }); - - it("Should revert if DomainToken is address zero", async () => { - const tx = zns.rootRegistrar.connect(deployer).setDomainToken(ethers.constants.AddressZero); - await expect(tx).to.be.revertedWith("ZNSRootRegistrar: domainToken_ is 0x0 address"); - }); - }); - }); - - describe("UUPS", () => { - it("Allows an authorized user to upgrade the contract", async () => { - // Confirm deployer has the correct role first - await expect(zns.accessController.checkGovernor(deployer.address)).to.not.be.reverted; - - const registrarFactory = new ZNSRootRegistrar__factory(deployer); - const registrar = await registrarFactory.deploy(); - await registrar.deployed(); - - const upgradeTx = zns.rootRegistrar.connect(deployer).upgradeTo(registrar.address); - await expect(upgradeTx).to.not.be.reverted; - }); - - it("Fails to upgrade when an unauthorized users calls", async () => { - const registrarFactory = new ZNSRootRegistrar__factory(deployer); - const registrar = await registrarFactory.deploy(); - await registrar.deployed(); - - const tx = zns.rootRegistrar.connect(randomUser).upgradeTo(registrar.address); - - await expect(tx).to.be.revertedWith( - getAccessRevertMsg(randomUser.address, GOVERNOR_ROLE) - ); - }); - - it("Verifies that variable values are not changed in the upgrade process", async () => { - // Confirm deployer has the correct role first - await expect(zns.accessController.checkGovernor(deployer.address)).to.not.be.reverted; - - const registrarFactory = new ZNSRootRegistrarUpgradeMock__factory(deployer); - const registrar = await registrarFactory.deploy(); - await registrar.deployed(); - - const domainName = "world"; - const domainHash = hashDomainLabel(domainName); - - await zns.meowToken.connect(randomUser).approve(zns.treasury.address, ethers.constants.MaxUint256); - await zns.meowToken.mint(randomUser.address, DEFAULT_PRICE_CONFIG.maxPrice); - - await zns.rootRegistrar.connect(randomUser).registerRootDomain( - domainName, - randomUser.address, - DEFAULT_TOKEN_URI, - distrConfigEmpty, - { - token: ethers.constants.AddressZero, - beneficiary: ethers.constants.AddressZero, - } - ); - - - const contractCalls = [ - zns.rootRegistrar.getAccessController(), - zns.rootRegistrar.registry(), - zns.rootRegistrar.treasury(), - zns.rootRegistrar.domainToken(), - zns.registry.exists(domainHash), - zns.treasury.stakedForDomain(domainHash), - zns.domainToken.name(), - zns.domainToken.symbol(), - zns.curvePricer.getPrice(ethers.constants.HashZero, domainName, false), - ]; - - await validateUpgrade(deployer, zns.rootRegistrar, registrar, registrarFactory, contractCalls); - }); - }); -}); +import * as hre from "hardhat"; +import { expect } from "chai"; +import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; +import { + normalizeName, + validateUpgrade, + AccessType, + OwnerOf, + PaymentType, + getAccessRevertMsg, + hashDomainLabel, + DEFAULT_TOKEN_URI, + distrConfigEmpty, + INVALID_LENGTH_ERR, + INITIALIZED_ERR, + INVALID_TOKENID_ERC_ERR, + REGISTRAR_ROLE, + DEFAULT_PRECISION_MULTIPLIER, + DEFAULT_PRICE_CONFIG, + DEFAULT_PROTOCOL_FEE_PERCENT, + NOT_AUTHORIZED_REG_ERR, + NOT_BOTH_OWNER_RAR_ERR, + NOT_TOKEN_OWNER_RAR_ERR, + ONLY_NAME_OWNER_REG_ERR, + ONLY_OWNER_REGISTRAR_REG_ERR, + INVALID_NAME_ERR, + paymentConfigEmpty, +} from "./helpers"; +import { IDistributionConfig } from "./helpers/types"; +import * as ethers from "ethers"; +import { defaultRootRegistration } from "./helpers/register-setup"; +import { checkBalance } from "./helpers/balances"; +import { getPriceObject } from "./helpers/pricing"; +import { getDomainHashFromEvent } from "./helpers/events"; +import { IDeployCampaignConfig, TZNSContractState } from "../src/deploy/campaign/types"; +import { ADMIN_ROLE, GOVERNOR_ROLE } from "../src/deploy/constants"; +import { + IERC20, + ZNSRootRegistrar, + ZNSRootRegistrar__factory, + ZNSRootRegistrarUpgradeMock__factory, +} from "../typechain"; +import { PaymentConfigStruct } from "../typechain/contracts/treasury/IZNSTreasury"; +import { runZnsCampaign } from "../src/deploy/zns-campaign"; +import { getProxyImplAddress } from "./helpers/utils"; +import { upgrades } from "hardhat"; +import { MongoDBAdapter } from "../src/deploy/db/mongo-adapter/mongo-adapter"; +import { getConfig } from "../src/deploy/campaign/environments"; + +require("@nomicfoundation/hardhat-chai-matchers"); + + +// This is the only test converted to use the new Campaign, other +// contract specific tests are using `deployZNS()` helper +describe("ZNSRootRegistrar", () => { + let deployer : SignerWithAddress; + let user : SignerWithAddress; + let governor : SignerWithAddress; + let admin : SignerWithAddress; + let randomUser : SignerWithAddress; + + let zns : TZNSContractState; + let zeroVault : SignerWithAddress; + let operator : SignerWithAddress; + let userBalanceInitial : bigint; + + let mongoAdapter : MongoDBAdapter; + + const defaultDomain = normalizeName("wilder"); + + beforeEach(async () => { + // zeroVault address is used to hold the fee charged to the user when registering + [deployer, zeroVault, user, operator, governor, admin, randomUser] = await hre.ethers.getSigners(); + + const config : IDeployCampaignConfig = await getConfig({ + deployer, + zeroVaultAddress: zeroVault.address, + governors: [deployer.address, governor.address], + admins: [deployer.address, admin.address], + }); + + const campaign = await runZnsCampaign({ + config, + }); + + zns = campaign.state.contracts; + + mongoAdapter = campaign.dbAdapter; + + await zns.meowToken.connect(deployer).approve( + await zns.treasury.getAddress(), + ethers.MaxUint256 + ); + + userBalanceInitial = ethers.parseEther("100000000000"); + // Give funds to user + await zns.meowToken.connect(user).approve(await zns.treasury.getAddress(), ethers.MaxUint256); + await zns.meowToken.mint(user.address, userBalanceInitial); + }); + + afterEach(async () => { + await mongoAdapter.dropDB(); + }); + + it("Sets the payment config when provided with the domain registration", async () => { + const tokenURI = "https://example.com/817c64af"; + const distrConfig : IDistributionConfig = { + pricerContract: await zns.curvePricer.getAddress(), + paymentType: PaymentType.STAKE, + accessType: AccessType.OPEN, + }; + + await zns.rootRegistrar.connect(user).registerRootDomain( + defaultDomain, + await zns.addressResolver.getAddress(), + tokenURI, + distrConfig, + { + token: await zns.meowToken.getAddress(), + beneficiary: user.address, + } + ); + + const domainHash = hashDomainLabel(defaultDomain); + const config = await zns.treasury.paymentConfigs(domainHash); + expect(config.token).to.eq(await zns.meowToken.getAddress()); + expect(config.beneficiary).to.eq(user.address); + }); + + it("Does not set the payment config when the beneficiary is the zero address", async () => { + const tokenURI = "https://example.com/817c64af"; + const distrConfig : IDistributionConfig = { + pricerContract: await zns.curvePricer.getAddress(), + paymentType: PaymentType.STAKE, + accessType: AccessType.OPEN, + }; + + await zns.rootRegistrar.connect(user).registerRootDomain( + defaultDomain, + await zns.addressResolver.getAddress(), + tokenURI, + distrConfig, + paymentConfigEmpty + ); + + const domainHash = hashDomainLabel(defaultDomain); + const config = await zns.treasury.paymentConfigs(domainHash); + expect(config.token).to.eq(ethers.ZeroAddress); + expect(config.beneficiary).to.eq(ethers.ZeroAddress); + }); + + it("Gas tests", async () => { + const tokenURI = "https://example.com/817c64af"; + const distrConfig : IDistributionConfig = { + pricerContract: await zns.curvePricer.getAddress(), + paymentType: PaymentType.STAKE, + accessType: AccessType.OPEN, + }; + + await zns.rootRegistrar.connect(deployer).registerRootDomain( + defaultDomain, + deployer.address, + tokenURI, + distrConfig, + { + token: ethers.ZeroAddress, + beneficiary: ethers.ZeroAddress, + } + ); + + const domainHash = await getDomainHashFromEvent({ + zns, + user: deployer, + }); + + // Registering as deployer (owner of parent) and user is different gas values + await zns.subRegistrar.connect(deployer).registerSubdomain( + domainHash, + "subdomain", + deployer.address, + tokenURI, + distrConfigEmpty, + paymentConfigEmpty, + ); + + const candidates = [ + deployer.address, + user.address, + governor.address, + admin.address, + randomUser.address, + ]; + + const allowed = [ + true, + true, + true, + true, + true, + ]; + + await zns.subRegistrar.updateMintlistForDomain( + domainHash, + candidates, + allowed + ); + }); + + it("Should NOT initialize the implementation contract", async () => { + const factory = new ZNSRootRegistrar__factory(deployer); + const impl = await getProxyImplAddress(await zns.rootRegistrar.getAddress()); + // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + const implContract = factory.attach(impl) as ZNSRootRegistrar; + + await expect( + implContract.initialize( + operator.address, + operator.address, + operator.address, + operator.address, + operator.address, + ) + ).to.be.revertedWith(INITIALIZED_ERR); + }); + + it("Allows transfer of 0x0 domain ownership after deployment", async () => { + await zns.registry.updateDomainOwner(ethers.ZeroHash, user.address); + expect(await zns.registry.getDomainOwner(ethers.ZeroHash)).to.equal(user.address); + }); + + it("Confirms a new 0x0 owner can modify the configs in the treasury and curve pricer", async () => { + await zns.registry.updateDomainOwner(ethers.ZeroHash, user.address); + + const newTreasuryConfig : PaymentConfigStruct = { + token: zeroVault.address, // Just needs to be a different address + beneficiary: user.address, + }; + + // Modify the treasury + const treasuryTx = await zns.treasury.connect(user).setPaymentConfig(ethers.ZeroHash, newTreasuryConfig); + + await expect(treasuryTx).to.emit( + zns.treasury, + "BeneficiarySet" + ).withArgs( + ethers.ZeroHash, + user.address + ); + await expect(treasuryTx).to.emit( + zns.treasury, + "PaymentTokenSet" + ).withArgs( + ethers.ZeroHash, + zeroVault.address + ); + + // Modify the curve pricer + const newPricerConfig = { + baseLength: BigInt("6"), + maxLength: BigInt("35"), + maxPrice: ethers.parseEther("150"), + minPrice: ethers.parseEther("10"), + precisionMultiplier: DEFAULT_PRECISION_MULTIPLIER, + feePercentage: DEFAULT_PROTOCOL_FEE_PERCENT, + isSet: true, + }; + + const pricerTx = await zns.curvePricer.connect(user).setPriceConfig( + ethers.ZeroHash, + newPricerConfig, + ); + + await expect(pricerTx).to.emit(zns.curvePricer, "PriceConfigSet").withArgs( + ethers.ZeroHash, + newPricerConfig.maxPrice, + newPricerConfig.minPrice, + newPricerConfig.maxLength, + newPricerConfig.baseLength, + newPricerConfig.precisionMultiplier, + newPricerConfig.feePercentage, + ); + }); + + it("Confirms a user has funds and allowance for the Registrar", async () => { + const balance = await zns.meowToken.balanceOf(user.address); + expect(balance).to.eq(userBalanceInitial); + + const allowance = await zns.meowToken.allowance(user.address, await zns.treasury.getAddress()); + expect(allowance).to.eq(ethers.MaxUint256); + }); + + it("Should revert when initialize() without ADMIN_ROLE", async () => { + const userHasAdmin = await zns.accessController.hasRole(ADMIN_ROLE, user.address); + expect(userHasAdmin).to.be.false; + + const registrarFactory = new ZNSRootRegistrar__factory(user); + + const tx = upgrades.deployProxy( + registrarFactory, + [ + await zns.accessController.getAddress(), + await zns.registry.getAddress(), + await zns.curvePricer.getAddress(), + await zns.treasury.getAddress(), + await zns.domainToken.getAddress(), + ], + { + kind: "uups", + } + ); + + await expect(tx).to.be.revertedWith(getAccessRevertMsg(user.address, ADMIN_ROLE)); + }); + + it("Should NOT initialize twice", async () => { + const tx = zns.rootRegistrar.connect(deployer).initialize( + await zns.accessController.getAddress(), + randomUser.address, + randomUser.address, + randomUser.address, + randomUser.address, + ); + + await expect(tx).to.be.revertedWith("Initializable: contract is already initialized"); + }); + + describe("General functionality", () => { + it("#coreRegister() should revert if called by address without REGISTRAR_ROLE", async () => { + const isRegistrar = await zns.accessController.hasRole(REGISTRAR_ROLE, randomUser.address); + expect(isRegistrar).to.be.false; + + await expect( + zns.rootRegistrar.connect(randomUser).coreRegister({ + parentHash: ethers.ZeroHash, + domainHash: ethers.ZeroHash, + label: "randomname", + registrant: ethers.ZeroAddress, + price: "0", + stakeFee: "0", + domainAddress: ethers.ZeroAddress, + tokenURI: "", + isStakePayment: false, + paymentConfig: paymentConfigEmpty, + }) + ).to.be.revertedWith( + getAccessRevertMsg(randomUser.address, REGISTRAR_ROLE) + ); + }); + + it("#isOwnerOf() returns correct bools", async () => { + await defaultRootRegistration({ + user, + zns, + domainName: defaultDomain, + }); + const domainHash = await getDomainHashFromEvent({ + zns, + user, + }); + const tokenId = BigInt(domainHash); + + const isOwnerOfBothUser = await zns.rootRegistrar.isOwnerOf( + domainHash, + user.address, + OwnerOf.BOTH + ); + expect(isOwnerOfBothUser).to.be.true; + + const isOwnerOfBothRandom = await zns.rootRegistrar.isOwnerOf( + domainHash, + randomUser.address, + OwnerOf.BOTH + ); + expect(isOwnerOfBothRandom).to.be.false; + + // transfer token + await zns.domainToken.connect(user).transferFrom(user.address, randomUser.address, tokenId); + const isOwnerOfTokenUser = await zns.rootRegistrar.isOwnerOf( + domainHash, + user.address, + OwnerOf.TOKEN + ); + expect(isOwnerOfTokenUser).to.be.false; + + const isOwnerOfTokenRandom = await zns.rootRegistrar.isOwnerOf( + domainHash, + randomUser.address, + OwnerOf.TOKEN + ); + expect(isOwnerOfTokenRandom).to.be.true; + + const isOwnerOfNameUser = await zns.rootRegistrar.isOwnerOf( + domainHash, + user.address, + OwnerOf.NAME + ); + expect(isOwnerOfNameUser).to.be.true; + + const isOwnerOfNameRandom = await zns.rootRegistrar.isOwnerOf( + domainHash, + randomUser.address, + OwnerOf.NAME + ); + expect(isOwnerOfNameRandom).to.be.false; + + await expect( + zns.rootRegistrar.isOwnerOf(domainHash, user.address, 3) + ).to.be.reverted; + }); + + it("#setSubRegistrar() should revert if called by address without ADMIN_ROLE", async () => { + const isAdmin = await zns.accessController.hasRole(ADMIN_ROLE, randomUser.address); + expect(isAdmin).to.be.false; + + await expect( + zns.rootRegistrar.connect(randomUser).setSubRegistrar(randomUser.address) + ).to.be.revertedWith( + getAccessRevertMsg(randomUser.address, ADMIN_ROLE) + ); + }); + + it("#setSubRegistrar() should set the correct address", async () => { + await zns.rootRegistrar.connect(admin).setSubRegistrar(randomUser.address); + + expect( + await zns.rootRegistrar.subRegistrar() + ).to.equal(randomUser.address); + }); + + it("#setSubRegistrar() should NOT set the address to zero address", async () => { + await expect( + zns.rootRegistrar.connect(admin).setSubRegistrar(ethers.ZeroAddress) + ).to.be.revertedWith( + "ZNSRootRegistrar: subRegistrar_ is 0x0 address" + ); + }); + }); + + describe("Registers a root domain", () => { + it("Can NOT register a TLD with an empty name", async () => { + const emptyName = ""; + + await expect( + defaultRootRegistration({ + user: deployer, + zns, + domainName: emptyName, + }) + ).to.be.revertedWith(INVALID_LENGTH_ERR); + }); + + it("Can register a TLD with characters [a-z0-9-]", async () => { + const letters = "world"; + const lettersHash = hashDomainLabel(letters); + + const alphaNumeric = "0x0dwidler0x0"; + const alphaNumericHash = hashDomainLabel(alphaNumeric); + + const withHyphen = "0x0-dwidler-0x0"; + const withHyphenHash = hashDomainLabel(withHyphen); + + const tx1 = zns.rootRegistrar.connect(deployer).registerRootDomain( + letters, + ethers.ZeroAddress, + DEFAULT_TOKEN_URI, + distrConfigEmpty, + { + token: ethers.ZeroAddress, + beneficiary: ethers.ZeroAddress, + } + ); + + await expect(tx1).to.emit(zns.rootRegistrar, "DomainRegistered").withArgs( + ethers.ZeroHash, + lettersHash, + BigInt(lettersHash), + letters, + deployer.address, + ethers.ZeroAddress, + ); + + const tx2 = zns.rootRegistrar.connect(deployer).registerRootDomain( + alphaNumeric, + ethers.ZeroAddress, + DEFAULT_TOKEN_URI, + distrConfigEmpty, + { + token: ethers.ZeroAddress, + beneficiary: ethers.ZeroAddress, + } + ); + + await expect(tx2).to.emit(zns.rootRegistrar, "DomainRegistered").withArgs( + ethers.ZeroHash, + alphaNumericHash, + BigInt(alphaNumericHash), + alphaNumeric, + deployer.address, + ethers.ZeroAddress, + ); + + const tx3 = zns.rootRegistrar.connect(deployer).registerRootDomain( + withHyphen, + ethers.ZeroAddress, + DEFAULT_TOKEN_URI, + distrConfigEmpty, + { + token: ethers.ZeroAddress, + beneficiary: ethers.ZeroAddress, + } + ); + + await expect(tx3).to.emit(zns.rootRegistrar, "DomainRegistered").withArgs( + ethers.ZeroHash, + withHyphenHash, + BigInt(withHyphenHash), + withHyphen, + deployer.address, + ethers.ZeroAddress, + ); + }); + + it("Fails for domains that use any invalid character", async () => { + // Valid names must match the pattern [a-z0-9] + const nameA = "WILDER"; + const nameB = "!?w1Id3r!?"; + const nameC = "!%$#^*?!#👍3^29"; + const nameD = "wo.rld"; + + await expect( + defaultRootRegistration({ + user: deployer, + zns, + domainName: nameA, + }) + ).to.be.revertedWith(INVALID_NAME_ERR); + + await expect( + defaultRootRegistration({ + user: deployer, + zns, + domainName: nameB, + }) + ).to.be.revertedWith(INVALID_NAME_ERR); + + await expect( + defaultRootRegistration({ + user: deployer, + zns, + domainName: nameC, + }) + ).to.be.revertedWith(INVALID_NAME_ERR); + + await expect( + defaultRootRegistration({ + user: deployer, + zns, + domainName: nameD, + }) + ).to.be.revertedWith(INVALID_NAME_ERR); + }); + + // eslint-disable-next-line max-len + it("Successfully registers a domain without a resolver or resolver content and fires a #DomainRegistered event", async () => { + const tokenURI = "https://example.com/817c64af"; + const tx = await zns.rootRegistrar.connect(user).registerRootDomain( + defaultDomain, + ethers.ZeroAddress, + tokenURI, + distrConfigEmpty, + { + token: ethers.ZeroAddress, + beneficiary: ethers.ZeroAddress, + } + ); + + const hashFromTS = hashDomainLabel(defaultDomain); + + await expect(tx).to.emit(zns.rootRegistrar, "DomainRegistered").withArgs( + ethers.ZeroHash, + hashFromTS, + BigInt(hashFromTS), + defaultDomain, + user.address, + ethers.ZeroAddress, + ); + + const tokenURISC = await zns.domainToken.tokenURI(hashFromTS); + expect(tokenURISC).to.eq(tokenURI); + }); + + it("Successfully registers a domain with distrConfig and adds it to state properly", async () => { + const distrConfig = { + pricerContract: await zns.fixedPricer.getAddress(), + accessType: AccessType.OPEN, + paymentType: PaymentType.DIRECT, + }; + const tokenURI = "https://example.com/817c64af"; + + await zns.rootRegistrar.connect(user).registerRootDomain( + defaultDomain, + ethers.ZeroAddress, + tokenURI, + distrConfig, + { + token: ethers.ZeroAddress, + beneficiary: ethers.ZeroAddress, + } + ); + + const domainHash = await getDomainHashFromEvent({ + zns, + user, + }); + + const { + pricerContract, + accessType, + paymentType, + } = await zns.subRegistrar.distrConfigs(domainHash); + + expect(pricerContract).to.eq(distrConfig.pricerContract); + expect(paymentType).to.eq(distrConfig.paymentType); + expect(accessType).to.eq(distrConfig.accessType); + + const tokenURISC = await zns.domainToken.tokenURI(domainHash); + expect(tokenURISC).to.eq(tokenURI); + }); + + it("Stakes and saves the correct amount and token, takes the correct fee and sends fee to Zero Vault", async () => { + const balanceBeforeUser = await zns.meowToken.balanceOf(user.address); + const balanceBeforeVault = await zns.meowToken.balanceOf(zeroVault.address); + + // Deploy "wilder" with default configuration + await defaultRootRegistration({ + user, + zns, + domainName: defaultDomain, + }); + const domainHash = await getDomainHashFromEvent({ + zns, + user, + }); + + const { + totalPrice, + expectedPrice, + stakeFee, + } = getPriceObject(defaultDomain, DEFAULT_PRICE_CONFIG); + + await checkBalance({ + token: zns.meowToken as IERC20, + balanceBefore: balanceBeforeUser, + userAddress: user.address, + target: totalPrice, + }); + + await checkBalance({ + token: zns.meowToken as IERC20, + balanceBefore: balanceBeforeVault, + userAddress: zeroVault.address, + target: stakeFee, + shouldDecrease: false, + }); + + const { amount: staked, token } = await zns.treasury.stakedForDomain(domainHash); + + expect(staked).to.eq(expectedPrice); + expect(token).to.eq(await zns.meowToken.getAddress()); + }); + + it("Sets the correct data in Registry", async () => { + await defaultRootRegistration({ + user, + zns, + domainName: defaultDomain, + }); + + const namehashRef = hashDomainLabel(defaultDomain); + const domainHash = await getDomainHashFromEvent({ + zns, + user, + }); + + expect(domainHash).to.eq(namehashRef); + + const { + owner: ownerFromReg, + resolver: resolverFromReg, + } = await zns.registry.getDomainRecord(domainHash); + + expect(ownerFromReg).to.eq(user.address); + expect(resolverFromReg).to.eq(await zns.addressResolver.getAddress()); + }); + + it("Fails when the user does not have enough funds", async () => { + const balance = await zns.meowToken.balanceOf(user.address); + await zns.meowToken.connect(user).transfer(randomUser.address, balance); + + const tx = defaultRootRegistration({ + user, + zns, + domainName: defaultDomain, + }); + await expect(tx).to.be.revertedWith("ERC20: transfer amount exceeds balance"); + }); + + it("Disallows creation of a duplicate domain", async () => { + await defaultRootRegistration({ + user, + zns, + domainName: defaultDomain, + }); + const failTx = defaultRootRegistration({ + user: deployer, + zns, + domainName: defaultDomain, + }); + + await expect(failTx).to.be.revertedWith("ZNSRootRegistrar: Domain already exists"); + }); + + it("Successfully registers a domain without resolver content", async () => { + const tx = zns.rootRegistrar.connect(user).registerRootDomain( + defaultDomain, + ethers.ZeroAddress, + DEFAULT_TOKEN_URI, + distrConfigEmpty, + { + token: ethers.ZeroAddress, + beneficiary: ethers.ZeroAddress, + } + ); + + await expect(tx).to.not.be.reverted; + }); + + it("Records the correct domain hash", async () => { + await defaultRootRegistration({ + user, + zns, + domainName: defaultDomain, + }); + + const domainHash = await getDomainHashFromEvent({ + zns, + user, + }); + + const exists = await zns.registry.exists(domainHash); + expect(exists).to.be.true; + expect(domainHash).to.eq(hashDomainLabel(defaultDomain)); + }); + + it("Creates and finds the correct tokenId", async () => { + await defaultRootRegistration({ + user, + zns, + domainName: defaultDomain, + }); + + const tokenId = BigInt( + await getDomainHashFromEvent({ + zns, + user, + }) + ); + const owner = await zns.domainToken.ownerOf(tokenId); + expect(owner).to.eq(user.address); + }); + + it("Resolves the correct address from the domain", async () => { + await defaultRootRegistration({ + user, + zns, + domainName: defaultDomain, + domainContent: await zns.rootRegistrar.getAddress(), + }); + const domainHash = await getDomainHashFromEvent({ + zns, + user, + }); + + const resolvedAddress = await zns.addressResolver.resolveDomainAddress(domainHash); + expect(resolvedAddress).to.eq(await zns.rootRegistrar.getAddress()); + }); + + it("Should NOT charge any tokens if price and/or stake fee is 0", async () => { + // set config on CurvePricer for the price to be 0 + await zns.curvePricer.connect(deployer).setMaxPrice(ethers.ZeroHash, "0"); + await zns.curvePricer.connect(deployer).setMinPrice(ethers.ZeroHash, "0"); + + const userBalanceBefore = await zns.meowToken.balanceOf(user.address); + const vaultBalanceBefore = await zns.meowToken.balanceOf(zeroVault.address); + + // register a domain + await zns.rootRegistrar.connect(user).registerRootDomain( + defaultDomain, + ethers.ZeroAddress, + DEFAULT_TOKEN_URI, + distrConfigEmpty, + { + token: ethers.ZeroAddress, + beneficiary: ethers.ZeroAddress, + } + ); + + const userBalanceAfter = await zns.meowToken.balanceOf(user.address); + const vaultBalanceAfter = await zns.meowToken.balanceOf(zeroVault.address); + + expect(userBalanceBefore).to.eq(userBalanceAfter); + expect(vaultBalanceBefore).to.eq(vaultBalanceAfter); + + // check existence in Registry + const domainHash = hashDomainLabel(defaultDomain); + const exists = await zns.registry.exists(domainHash); + expect(exists).to.be.true; + + // make sure no transfers happened + const transferEventFilter = zns.meowToken.filters.Transfer( + user.address, + ); + const events = await zns.meowToken.queryFilter(transferEventFilter); + expect(events.length).to.eq(0); + }); + }); + + describe("Reclaiming Domains", () => { + it("Can reclaim name/stake if Token is owned", async () => { + // Register Top level + await defaultRootRegistration({ user: deployer, zns, domainName: defaultDomain }); + const domainHash = await getDomainHashFromEvent({ + zns, + user: deployer, + }); + const tokenId = BigInt(domainHash); + const { amount: staked, token } = await zns.treasury.stakedForDomain(domainHash); + + // Transfer the domain token + await zns.domainToken.connect(deployer).transferFrom(deployer.address, user.address, tokenId); + + // Verify owner in registry + const originalOwner = await zns.registry.connect(deployer).getDomainOwner(domainHash); + expect(originalOwner).to.equal(deployer.address); + + // Reclaim the Domain + await zns.rootRegistrar.connect(user).reclaimDomain(domainHash); + + // Verify domain token is still owned + const owner = await zns.domainToken.connect(user).ownerOf(tokenId); + expect(owner).to.equal(user.address); + + // Verify domain is owned in registry + const registryOwner = await zns.registry.connect(user).getDomainOwner(domainHash); + expect(registryOwner).to.equal(user.address); + + // Verify same amount is staked + const { amount: stakedAfterReclaim, token: tokenAfterReclaim } = await zns.treasury.stakedForDomain(domainHash); + expect(staked).to.equal(stakedAfterReclaim); + expect(tokenAfterReclaim).to.equal(await zns.meowToken.getAddress()); + expect(token).to.equal(tokenAfterReclaim); + }); + + it("Reclaiming domain token emits DomainReclaimed event", async () => { + await defaultRootRegistration({ user: deployer, zns, domainName: defaultDomain }); + const domainHash = await getDomainHashFromEvent({ + zns, + user: deployer, + }); + const tokenId = BigInt(domainHash); + + // Transfer the domain token + await zns.domainToken.connect(deployer).transferFrom(deployer.address, user.address, tokenId); + // Reclaim the Domain + const tx = zns.rootRegistrar.connect(user).reclaimDomain(domainHash); + await expect(tx).to.emit(zns.rootRegistrar, "DomainReclaimed").withArgs( + domainHash, + user.address + ); + }); + + it("Cannot reclaim name/stake if token is not owned", async () => { + await defaultRootRegistration({ user: deployer, zns, domainName: defaultDomain }); + const domainHash = await getDomainHashFromEvent({ + zns, + user: deployer, + }); + // Reclaim the Domain + const tx = zns.rootRegistrar.connect(user).reclaimDomain(domainHash); + + // Verify Domain is not reclaimed + await expect(tx).to.be.revertedWith(NOT_TOKEN_OWNER_RAR_ERR); + + // Verify domain is not owned in registrar + const registryOwner = await zns.registry.connect(user).getDomainOwner(domainHash); + expect(registryOwner).to.equal(deployer.address); + }); + + it("Cannot reclaim if domain does not exist", async () => { + const domainHash = "0xd34cfa279afd55afc6aa9c00aa5d01df60179840a93d10eed730058b8dd4146c"; + // Reclaim the Domain + const tx = zns.rootRegistrar.connect(user).reclaimDomain(domainHash); + + // Verify Domain is not reclaimed + await expect(tx).to.be.revertedWith(INVALID_TOKENID_ERC_ERR); + }); + + it("Domain Token can be reclaimed, transferred, and then reclaimed again", async () => { + // Register Top level + await defaultRootRegistration({ user: deployer, zns, domainName: defaultDomain }); + const domainHash = await getDomainHashFromEvent({ + zns, + user: deployer, + }); + const tokenId = BigInt(domainHash); + const { amount: staked, token } = await zns.treasury.stakedForDomain(domainHash); + + // Transfer the domain token + await zns.domainToken.connect(deployer).transferFrom(deployer.address, user.address, tokenId); + + // Reclaim the Domain + await zns.rootRegistrar.connect(user).reclaimDomain(domainHash); + // Verify domain token is still owned + let owner = await zns.domainToken.connect(user).ownerOf(tokenId); + expect(owner).to.equal(user.address); + + // Transfer the domain token back + await zns.domainToken.connect(user).transferFrom(user.address, deployer.address, tokenId); + + // Reclaim the Domain again + await zns.rootRegistrar.connect(deployer).reclaimDomain(domainHash); + + // Verify domain token is owned + owner = await zns.domainToken.connect(deployer).ownerOf(tokenId); + expect(owner).to.equal(deployer.address); + + // Verify domain is owned in registrar + const registryOwner = await zns.registry.connect(deployer).getDomainOwner(domainHash); + expect(registryOwner).to.equal(deployer.address); + + // Verify same amount is staked + const { amount: stakedAfterReclaim, token: tokenAfterReclaim } = await zns.treasury.stakedForDomain(domainHash); + expect(staked).to.equal(stakedAfterReclaim); + expect(tokenAfterReclaim).to.equal(await zns.meowToken.getAddress()); + expect(token).to.equal(tokenAfterReclaim); + }); + + it("Can revoke and unstake after reclaiming", async () => { + // Verify Balance + const balance = await zns.meowToken.balanceOf(user.address); + expect(balance).to.eq(userBalanceInitial); + + // Register Top level + await defaultRootRegistration({ user: deployer, zns, domainName: defaultDomain }); + const domainHash = await getDomainHashFromEvent({ + zns, + user: deployer, + }); + const tokenId = BigInt(domainHash); + + // Validated staked values + const { + expectedPrice: expectedStaked, + } = getPriceObject(defaultDomain, DEFAULT_PRICE_CONFIG); + const { amount: staked, token } = await zns.treasury.stakedForDomain(domainHash); + expect(staked).to.eq(expectedStaked); + expect(token).to.eq(await zns.meowToken.getAddress()); + + // Transfer the domain token + await zns.domainToken.connect(deployer).transferFrom(deployer.address, user.address, tokenId); + + // Reclaim the Domain + await zns.rootRegistrar.connect(user).reclaimDomain(domainHash); + + // Revoke the Domain + await zns.rootRegistrar.connect(user).revokeDomain(domainHash); + + // Validated funds are unstaked + const { amount: finalstaked, token: finalToken } = await zns.treasury.stakedForDomain(domainHash); + expect(finalstaked).to.equal(BigInt("0")); + expect(finalToken).to.equal(ethers.ZeroAddress); + + // Verify final balances + const computedFinalBalance = balance + staked; + const finalBalance = await zns.meowToken.balanceOf(user.address); + expect(computedFinalBalance).to.equal(finalBalance); + }); + }); + + describe("Revoking Domains", () => { + it("Revokes a Top level Domain, locks distribution and removes mintlist", async () => { + // Register Top level + await defaultRootRegistration({ + user, + zns, + domainName: defaultDomain, + distrConfig: { + pricerContract: await zns.fixedPricer.getAddress(), + paymentType: PaymentType.DIRECT, + accessType: AccessType.OPEN, + }, + }); + + const domainHash = await getDomainHashFromEvent({ + zns, + user, + }); + + // add mintlist to check revocation + await zns.subRegistrar.connect(user).updateMintlistForDomain( + domainHash, + [user.address, zeroVault.address], + [true, true] + ); + + const ogPrice = BigInt(135); + await zns.fixedPricer.connect(user).setPriceConfig( + domainHash, + { + price: ogPrice, + feePercentage: BigInt(0), + isSet: true, + } + ); + expect(await zns.fixedPricer.getPrice(domainHash, defaultDomain, false)).to.eq(ogPrice); + + const tokenId = BigInt( + await getDomainHashFromEvent({ + zns, + user, + }) + ); + + // Revoke the domain and then verify + await zns.rootRegistrar.connect(user).revokeDomain(domainHash); + + // Verify token has been burned + const ownerOfTx = zns.domainToken.connect(user).ownerOf(tokenId); + await expect(ownerOfTx).to.be.revertedWith( + INVALID_TOKENID_ERC_ERR + ); + + // Verify Domain Record Deleted + const exists = await zns.registry.exists(domainHash); + expect(exists).to.be.false; + + // validate access type has been set to LOCKED + const { accessType } = await zns.subRegistrar.distrConfigs(domainHash); + expect(accessType).to.eq(AccessType.LOCKED); + + // validate mintlist has been removed + expect(await zns.subRegistrar.isMintlistedForDomain(domainHash, user.address)).to.be.false; + expect(await zns.subRegistrar.isMintlistedForDomain(domainHash, zeroVault.address)).to.be.false; + }); + + it("Cannot revoke a domain that doesnt exist", async () => { + // Register Top level + const fakeHash = "0xd34cfa279afd55afc6aa9c00aa5d01df60179840a93d10eed730058b8dd4146c"; + const exists = await zns.registry.exists(fakeHash); + expect(exists).to.be.false; + + // Verify transaction is reverted + const tx = zns.rootRegistrar.connect(user).revokeDomain(fakeHash); + await expect(tx).to.be.revertedWith(NOT_BOTH_OWNER_RAR_ERR); + }); + + it("Revoking domain unstakes", async () => { + // Verify Balance + const balance = await zns.meowToken.balanceOf(user.address); + expect(balance).to.eq(userBalanceInitial); + + // Register Top level + await defaultRootRegistration({ user, zns, domainName: defaultDomain }); + const domainHash = await getDomainHashFromEvent({ + zns, + user, + }); + + // Validated staked values + const { + expectedPrice: expectedStaked, + stakeFee: expectedStakeFee, + } = getPriceObject(defaultDomain, DEFAULT_PRICE_CONFIG); + const { amount: staked, token } = await zns.treasury.stakedForDomain(domainHash); + expect(staked).to.eq(expectedStaked); + expect(token).to.eq(await zns.meowToken.getAddress()); + + // Get balance after staking + const balanceAfterStaking = await zns.meowToken.balanceOf(user.address); + + // Revoke the domain + await zns.rootRegistrar.connect(user).revokeDomain(domainHash); + + // Validated funds are unstaked + const { amount: finalstaked, token: finalToken } = await zns.treasury.stakedForDomain(domainHash); + expect(finalstaked).to.equal(BigInt("0")); + expect(finalToken).to.equal(ethers.ZeroAddress); + + // Verify final balances + const computedBalanceAfterStaking = balanceAfterStaking + staked; + const balanceMinusFee = balance - expectedStakeFee; + expect(computedBalanceAfterStaking).to.equal(balanceMinusFee); + const finalBalance = await zns.meowToken.balanceOf(user.address); + expect(computedBalanceAfterStaking).to.equal(finalBalance); + }); + + it("Cannot revoke if Name is owned by another user", async () => { + // Register Top level + await defaultRootRegistration({ user: deployer, zns, domainName: defaultDomain }); + const parentDomainHash = await getDomainHashFromEvent({ + zns, + user: deployer, + }); + const owner = await zns.registry.connect(user).getDomainOwner(parentDomainHash); + expect(owner).to.not.equal(user.address); + + // Try to revoke domain + const tx = zns.rootRegistrar.connect(user).revokeDomain(parentDomainHash); + await expect(tx).to.be.revertedWith(NOT_BOTH_OWNER_RAR_ERR); + }); + + it("No one can revoke if Token and Name have different owners", async () => { + // Register Top level + await defaultRootRegistration({ user: deployer, zns, domainName: defaultDomain }); + const parentDomainHash = await getDomainHashFromEvent({ + zns, + user: deployer, + }); + const owner = await zns.registry.connect(user).getDomainOwner(parentDomainHash); + expect(owner).to.not.equal(user.address); + + const tokenId = BigInt(parentDomainHash); + + await zns.domainToken.transferFrom(deployer.address, user.address, tokenId); + + // Try to revoke domain as a new owner of the token + const tx = zns.rootRegistrar.connect(user).revokeDomain(parentDomainHash); + await expect(tx).to.be.revertedWith(NOT_BOTH_OWNER_RAR_ERR); + + const tx2 = zns.rootRegistrar.connect(deployer).revokeDomain(parentDomainHash); + await expect(tx2).to.be.revertedWith(NOT_BOTH_OWNER_RAR_ERR); + }); + + it("After domain has been revoked, an old operator can NOT access Registry", async () => { + // Register Top level + await defaultRootRegistration({ user, zns, domainName: defaultDomain }); + const domainHash = await getDomainHashFromEvent({ + zns, + user, + }); + + // assign an operator + await zns.registry.connect(user).setOwnersOperator(operator.address, true); + + // Revoke the domain + await zns.rootRegistrar.connect(user).revokeDomain(domainHash); + + // check operator access to the revoked domain + const tx2 = zns.registry + .connect(operator) + .updateDomainOwner( + domainHash, + operator.address + ); + await expect(tx2).to.be.revertedWith( + ONLY_OWNER_REGISTRAR_REG_ERR + ); + + const tx3 = zns.registry + .connect(operator) + .updateDomainRecord( + domainHash, + user.address, + operator.address + ); + await expect(tx3).to.be.revertedWith( + ONLY_NAME_OWNER_REG_ERR + ); + + const tx4 = zns.registry + .connect(operator) + .updateDomainResolver( + domainHash, + zeroVault.address + ); + await expect(tx4).to.be.revertedWith( + NOT_AUTHORIZED_REG_ERR + ); + }); + }); + + describe("State Setters", () => { + describe("#setAccessController", () => { + it("Should set AccessController and fire AccessControllerSet event", async () => { + const currentAC = await zns.rootRegistrar.getAccessController(); + const tx = await zns.rootRegistrar.connect(deployer).setAccessController(randomUser.address); + const newAC = await zns.rootRegistrar.getAccessController(); + + await expect(tx).to.emit(zns.rootRegistrar, "AccessControllerSet").withArgs(randomUser.address); + + expect(newAC).to.equal(randomUser.address); + expect(currentAC).to.not.equal(newAC); + }); + + it("Should revert if not called by ADMIN", async () => { + const tx = zns.rootRegistrar.connect(user).setAccessController(randomUser.address); + await expect(tx).to.be.revertedWith( + getAccessRevertMsg(user.address, ADMIN_ROLE) + ); + }); + + it("Should revert if new AccessController is address zero", async () => { + const tx = zns.rootRegistrar.connect(deployer).setAccessController(ethers.ZeroAddress); + await expect(tx).to.be.revertedWith("AC: _accessController is 0x0 address"); + }); + }); + + describe("#setRegistry", () => { + it("Should set ZNSRegistry and fire RegistrySet event", async () => { + const currentRegistry = await zns.rootRegistrar.registry(); + const tx = await zns.rootRegistrar.connect(deployer).setRegistry(randomUser.address); + const newRegistry = await zns.rootRegistrar.registry(); + + await expect(tx).to.emit(zns.rootRegistrar, "RegistrySet").withArgs(randomUser.address); + + expect(newRegistry).to.equal(randomUser.address); + expect(currentRegistry).to.not.equal(newRegistry); + }); + + it("Should revert if not called by ADMIN", async () => { + const tx = zns.rootRegistrar.connect(user).setRegistry(randomUser.address); + await expect(tx).to.be.revertedWith( + getAccessRevertMsg(user.address, ADMIN_ROLE) + ); + }); + + it("Should revert if ZNSRegistry is address zero", async () => { + const tx = zns.rootRegistrar.connect(deployer).setRegistry(ethers.ZeroAddress); + await expect(tx).to.be.revertedWith("ARegistryWired: _registry can not be 0x0 address"); + }); + }); + + describe("#setTreasury", () => { + it("Should set Treasury and fire TreasurySet event", async () => { + const currentTreasury = await zns.rootRegistrar.treasury(); + const tx = await zns.rootRegistrar.connect(deployer).setTreasury(randomUser.address); + const newTreasury = await zns.rootRegistrar.treasury(); + + await expect(tx).to.emit(zns.rootRegistrar, "TreasurySet").withArgs(randomUser.address); + + expect(newTreasury).to.equal(randomUser.address); + expect(currentTreasury).to.not.equal(newTreasury); + }); + + it("Should revert if not called by ADMIN", async () => { + const tx = zns.rootRegistrar.connect(user).setTreasury(randomUser.address); + await expect(tx).to.be.revertedWith( + getAccessRevertMsg(user.address, ADMIN_ROLE) + ); + }); + + it("Should revert if Treasury is address zero", async () => { + const tx = zns.rootRegistrar.connect(deployer).setTreasury(ethers.ZeroAddress); + await expect(tx).to.be.revertedWith("ZNSRootRegistrar: treasury_ is 0x0 address"); + }); + }); + + describe("#setDomainToken", () => { + it("Should set DomainToken and fire DomainTokenSet event", async () => { + const currentToken = await zns.rootRegistrar.domainToken(); + const tx = await zns.rootRegistrar.connect(deployer).setDomainToken(randomUser.address); + const newToken = await zns.rootRegistrar.domainToken(); + + await expect(tx).to.emit(zns.rootRegistrar, "DomainTokenSet").withArgs(randomUser.address); + + expect(newToken).to.equal(randomUser.address); + expect(currentToken).to.not.equal(newToken); + }); + + it("Should revert if not called by ADMIN", async () => { + const tx = zns.rootRegistrar.connect(user).setDomainToken(randomUser.address); + await expect(tx).to.be.revertedWith( + getAccessRevertMsg(user.address, ADMIN_ROLE) + ); + }); + + it("Should revert if DomainToken is address zero", async () => { + const tx = zns.rootRegistrar.connect(deployer).setDomainToken(ethers.ZeroAddress); + await expect(tx).to.be.revertedWith("ZNSRootRegistrar: domainToken_ is 0x0 address"); + }); + }); + }); + + describe("UUPS", () => { + it("Allows an authorized user to upgrade the contract", async () => { + // Confirm deployer has the correct role first + await expect(zns.accessController.checkGovernor(deployer.address)).to.not.be.reverted; + + const registrarFactory = new ZNSRootRegistrar__factory(deployer); + const registrar = await registrarFactory.deploy(); + await registrar.waitForDeployment(); + + const upgradeTx = zns.rootRegistrar.connect(deployer).upgradeTo(await registrar.getAddress()); + await expect(upgradeTx).to.not.be.reverted; + }); + + it("Fails to upgrade when an unauthorized users calls", async () => { + const registrarFactory = new ZNSRootRegistrar__factory(deployer); + const registrar = await registrarFactory.deploy(); + await registrar.waitForDeployment(); + + const tx = zns.rootRegistrar.connect(randomUser).upgradeTo(await registrar.getAddress()); + + await expect(tx).to.be.revertedWith( + getAccessRevertMsg(randomUser.address, GOVERNOR_ROLE) + ); + }); + + it("Verifies that variable values are not changed in the upgrade process", async () => { + // Confirm deployer has the correct role first + await expect(zns.accessController.checkGovernor(deployer.address)).to.not.be.reverted; + + const registrarFactory = new ZNSRootRegistrarUpgradeMock__factory(deployer); + const registrar = await registrarFactory.deploy(); + await registrar.waitForDeployment(); + + const domainName = "world"; + const domainHash = hashDomainLabel(domainName); + + await zns.meowToken.connect(randomUser).approve(await zns.treasury.getAddress(), ethers.MaxUint256); + await zns.meowToken.mint(randomUser.address, DEFAULT_PRICE_CONFIG.maxPrice); + + await zns.rootRegistrar.connect(randomUser).registerRootDomain( + domainName, + randomUser.address, + DEFAULT_TOKEN_URI, + distrConfigEmpty, + { + token: ethers.ZeroAddress, + beneficiary: ethers.ZeroAddress, + } + ); + + + const contractCalls = [ + zns.rootRegistrar.getAccessController(), + zns.rootRegistrar.registry(), + zns.rootRegistrar.treasury(), + zns.rootRegistrar.domainToken(), + zns.registry.exists(domainHash), + zns.treasury.stakedForDomain(domainHash), + zns.domainToken.name(), + zns.domainToken.symbol(), + zns.curvePricer.getPrice(ethers.ZeroHash, domainName, false), + ]; + + await validateUpgrade(deployer, zns.rootRegistrar, registrar, registrarFactory, contractCalls); + }); + }); +}); diff --git a/test/ZNSSubRegistrar.test.ts b/test/ZNSSubRegistrar.test.ts index a2769e0cb..cf1592bd0 100644 --- a/test/ZNSSubRegistrar.test.ts +++ b/test/ZNSSubRegistrar.test.ts @@ -1,4 +1,4 @@ -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { IDomainConfigForTest, IFixedPriceConfig, IPathRegResult, IZNSContracts } from "./helpers/types"; import { AccessType, @@ -23,15 +23,19 @@ import { } from "./helpers"; import * as hre from "hardhat"; import * as ethers from "ethers"; -import { BigNumber } from "ethers"; import { expect } from "chai"; import { registerDomainPath, validatePathRegistration } from "./helpers/flows/registration"; import assert from "assert"; import { defaultSubdomainRegistration, registrationWithSetup } from "./helpers/register-setup"; import { getDomainHashFromEvent } from "./helpers/events"; -import { time } from "@nomicfoundation/hardhat-network-helpers"; -import { CustomDecimalTokenMock, ZNSSubRegistrar__factory, ZNSSubRegistrarUpgradeMock__factory } from "../typechain"; -import { parseEther, parseUnits } from "ethers/lib/utils"; +import { time } from "@nomicfoundation/hardhat-toolbox/network-helpers"; +import { + CustomDecimalTokenMock, + ZNSSubRegistrar, + ZNSSubRegistrar__factory, + ZNSSubRegistrarUpgradeMock, + ZNSSubRegistrarUpgradeMock__factory, +} from "../typechain"; import { deployCustomDecToken } from "./helpers/deploy/mocks"; import { getProxyImplAddress } from "./helpers/utils"; @@ -83,13 +87,13 @@ describe("ZNSSubRegistrar", () => { rootOwner, lvl2SubOwner, ].map(async ({ address }) => - zns.meowToken.mint(address, ethers.utils.parseEther("100000000000"))) + zns.meowToken.mint(address, ethers.parseEther("100000000000"))) ); - await zns.meowToken.connect(rootOwner).approve(zns.treasury.address, ethers.constants.MaxUint256); + await zns.meowToken.connect(rootOwner).approve(await zns.treasury.getAddress(), ethers.MaxUint256); rootPriceConfig = { - price: ethers.utils.parseEther("1375.612"), - feePercentage: BigNumber.from(0), + price: ethers.parseEther("1375.612"), + feePercentage: BigInt(0), }; // register root domain @@ -100,11 +104,11 @@ describe("ZNSSubRegistrar", () => { fullConfig: { distrConfig: { accessType: AccessType.OPEN, - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.DIRECT, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: rootOwner.address, }, priceConfig: rootPriceConfig, @@ -115,7 +119,7 @@ describe("ZNSSubRegistrar", () => { it("Sets the payment config when given", async () => { const subdomain = "world-subdomain"; - await zns.meowToken.connect(lvl2SubOwner).approve(zns.treasury.address, ethers.constants.MaxUint256); + await zns.meowToken.connect(lvl2SubOwner).approve(await zns.treasury.getAddress(), ethers.MaxUint256); await zns.subRegistrar.connect(lvl2SubOwner).registerSubdomain( rootHash, @@ -124,14 +128,14 @@ describe("ZNSSubRegistrar", () => { subTokenURI, distrConfigEmpty, { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: lvl2SubOwner.address, }, ); const subHash = await zns.subRegistrar.hashWithParent(rootHash, subdomain); const config = await zns.treasury.paymentConfigs(subHash); - expect(config.token).to.eq(zns.meowToken.address); + expect(config.token).to.eq(await zns.meowToken.getAddress()); expect(config.beneficiary).to.eq(lvl2SubOwner.address); }); @@ -150,8 +154,8 @@ describe("ZNSSubRegistrar", () => { const subHash = await zns.subRegistrar.hashWithParent(rootHash, subdomain); const config = await zns.treasury.paymentConfigs(subHash); - expect(config.token).to.eq(ethers.constants.AddressZero); - expect(config.beneficiary).to.eq(ethers.constants.AddressZero); + expect(config.token).to.eq(ethers.ZeroAddress); + expect(config.beneficiary).to.eq(ethers.ZeroAddress); }); // eslint-disable-next-line max-len @@ -165,16 +169,16 @@ describe("ZNSSubRegistrar", () => { fullConfig: { distrConfig: { accessType: AccessType.OPEN, - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.DIRECT, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: rootOwner.address, }, priceConfig: { - price: BigNumber.from(0), - feePercentage: BigNumber.from(0), + price: BigInt(0), + feePercentage: BigInt(0), }, }, }); @@ -187,7 +191,7 @@ describe("ZNSSubRegistrar", () => { subTokenURI, distrConfigEmpty, { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: rootOwner.address, }, ) @@ -207,11 +211,11 @@ describe("ZNSSubRegistrar", () => { fullConfig: { distrConfig: { accessType: AccessType.OPEN, - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), paymentType: PaymentType.DIRECT, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: rootOwner.address, }, priceConfig: DEFAULT_PRICE_CONFIG, @@ -242,21 +246,21 @@ describe("ZNSSubRegistrar", () => { fullConfig: { distrConfig: { accessType: AccessType.OPEN, - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.DIRECT, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: lvl2SubOwner.address, }, priceConfig: { - price: ethers.utils.parseEther("777.325"), - feePercentage: BigNumber.from(0), + price: ethers.parseEther("777.325"), + feePercentage: BigInt(0), }, }, }); - const tokenId = BigNumber.from(subHash).toString(); + const tokenId = BigInt(subHash).toString(); const tokenURI = await zns.domainToken.tokenURI(tokenId); expect(tokenURI).to.eq(subTokenURI); }); @@ -265,7 +269,7 @@ describe("ZNSSubRegistrar", () => { const alphaNumeric = "0x0dwidler0x0"; // Add allowance - await zns.meowToken.connect(lvl2SubOwner).approve(zns.treasury.address, ethers.constants.MaxUint256); + await zns.meowToken.connect(lvl2SubOwner).approve(await zns.treasury.getAddress(), ethers.MaxUint256); // While "to.not.be.reverted" isn't really a full "test" // we don't emit a custom event here, only in the `rootRegistrar.coreRegister` @@ -342,7 +346,7 @@ describe("ZNSSubRegistrar", () => { // check that 0x0 hash can NOT be passed as parentHash await expect( zns.subRegistrar.connect(lvl2SubOwner).registerSubdomain( - ethers.constants.HashZero, + ethers.ZeroHash, "sub", lvl2SubOwner.address, subTokenURI, @@ -354,7 +358,7 @@ describe("ZNSSubRegistrar", () => { ); // check that a random non-existent hash can NOT be passed as parentHash - const randomHash = ethers.utils.keccak256(ethers.utils.toUtf8Bytes("random")); + const randomHash = ethers.keccak256(ethers.toUtf8Bytes("random")); await expect( zns.subRegistrar.connect(lvl2SubOwner).registerSubdomain( randomHash, @@ -379,28 +383,28 @@ describe("ZNSSubRegistrar", () => { fullConfig: { distrConfig: { accessType: AccessType.OPEN, - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.DIRECT, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: lvl2SubOwner.address, }, priceConfig: { - price: ethers.utils.parseEther("777.325"), - feePercentage: BigNumber.from(0), + price: ethers.parseEther("777.325"), + feePercentage: BigInt(0), }, }, }); - const tokenId = BigNumber.from(subHash).toString(); + const tokenId = BigInt(subHash).toString(); const tokenURI = await zns.domainToken.tokenURI(tokenId); expect(tokenURI).to.eq(subTokenURI); // check registry const dataFromReg = await zns.registry.getDomainRecord(subHash); expect(dataFromReg.owner).to.eq(lvl2SubOwner.address); - expect(dataFromReg.resolver).to.eq(zns.addressResolver.address); + expect(dataFromReg.resolver).to.eq(await zns.addressResolver.getAddress()); }); // ! this value can change based on the block gas limit ! @@ -414,25 +418,25 @@ describe("ZNSSubRegistrar", () => { fullConfig: fullDistrConfigEmpty, }); - const tokenId = BigNumber.from(subHash).toString(); + const tokenId = BigInt(subHash).toString(); const tokenURI = await zns.domainToken.tokenURI(tokenId); expect(tokenURI).to.eq(subTokenURI); // check registry const dataFromReg = await zns.registry.getDomainRecord(subHash); expect(dataFromReg.owner).to.eq(lvl2SubOwner.address); - expect(dataFromReg.resolver).to.eq(zns.addressResolver.address); + expect(dataFromReg.resolver).to.eq(await zns.addressResolver.getAddress()); }); it("should revert when user has insufficient funds", async () => { const label = "subinsufficientfunds"; const { expectedPrice } = getPriceObject(label, rootPriceConfig); const userBalanceBefore = await zns.meowToken.balanceOf(lvl2SubOwner.address); - const userBalanceAfter = userBalanceBefore.sub(expectedPrice); + const userBalanceAfter = userBalanceBefore - expectedPrice; await zns.meowToken.connect(lvl2SubOwner).transfer(deployer.address, userBalanceAfter); // add allowance - await zns.meowToken.connect(lvl2SubOwner).approve(zns.treasury.address, ethers.constants.MaxUint256); + await zns.meowToken.connect(lvl2SubOwner).approve(await zns.treasury.getAddress(), ethers.MaxUint256); await expect( zns.subRegistrar.connect(lvl2SubOwner).registerSubdomain( @@ -456,7 +460,7 @@ describe("ZNSSubRegistrar", () => { const { expectedPrice } = getPriceObject(label, rootPriceConfig); // add allowance - await zns.meowToken.connect(lvl2SubOwner).approve(zns.treasury.address, expectedPrice.sub(1)); + await zns.meowToken.connect(lvl2SubOwner).approve(await zns.treasury.getAddress(), expectedPrice - 1n); await expect( zns.subRegistrar.connect(lvl2SubOwner).registerSubdomain( @@ -481,7 +485,7 @@ describe("ZNSSubRegistrar", () => { fullConfig: { distrConfig: { accessType: AccessType.OPEN, - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.DIRECT, }, paymentConfig: paymentConfigEmpty, @@ -490,7 +494,7 @@ describe("ZNSSubRegistrar", () => { }); // set the token address - await zns.treasury.connect(rootOwner).setPaymentToken(parentHash1, zns.meowToken.address); + await zns.treasury.connect(rootOwner).setPaymentToken(parentHash1, await zns.meowToken.getAddress()); // register a new parent with stake payment and no payment config const parentHash2 = await registrationWithSetup({ @@ -500,7 +504,7 @@ describe("ZNSSubRegistrar", () => { fullConfig: { distrConfig: { accessType: AccessType.OPEN, - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), paymentType: PaymentType.STAKE, }, paymentConfig: paymentConfigEmpty, @@ -509,7 +513,7 @@ describe("ZNSSubRegistrar", () => { }); // set the token address - await zns.treasury.connect(rootOwner).setPaymentToken(parentHash2, zns.meowToken.address); + await zns.treasury.connect(rootOwner).setPaymentToken(parentHash2, await zns.meowToken.getAddress()); // register subdomains under new parents await expect( @@ -533,19 +537,16 @@ describe("ZNSSubRegistrar", () => { // change stakeFee to 0 await zns.curvePricer.connect(rootOwner).setFeePercentage( parentHash2, - BigNumber.from(0) + BigInt(0) ); - let subHash; // try register a subdomain again - await expect( - subHash = registrationWithSetup({ - zns, - user: lvl2SubOwner, - parentHash: parentHash2, - domainLabel: "sub2", - }) - ).to.be.fulfilled; + const subHash = await registrationWithSetup({ + zns, + user: lvl2SubOwner, + parentHash: parentHash2, + domainLabel: "sub2", + }); await zns.registry.exists(subHash); }); @@ -555,8 +556,8 @@ describe("ZNSSubRegistrar", () => { let domainConfigs : Array; let regResults : Array; - const fixedPrice = ethers.utils.parseEther("1375.612"); - const fixedFeePercentage = BigNumber.from(200); + const fixedPrice = ethers.parseEther("1375.612"); + const fixedFeePercentage = BigInt(200); before(async () => { [ @@ -596,9 +597,9 @@ describe("ZNSSubRegistrar", () => { branchLvl2Owner, multiOwner, ].map(async ({ address }) => - zns.meowToken.mint(address, ethers.utils.parseEther("1000000"))) + zns.meowToken.mint(address, ethers.parseEther("1000000"))) ); - await zns.meowToken.connect(rootOwner).approve(zns.treasury.address, ethers.constants.MaxUint256); + await zns.meowToken.connect(rootOwner).approve(await zns.treasury.getAddress(), ethers.MaxUint256); domainConfigs = [ { @@ -606,15 +607,15 @@ describe("ZNSSubRegistrar", () => { domainLabel: "root", fullConfig: { distrConfig: { - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.DIRECT, accessType: AccessType.OPEN, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: rootOwner.address, }, - priceConfig: { price: fixedPrice, feePercentage: BigNumber.from(0) }, + priceConfig: { price: fixedPrice, feePercentage: BigInt(0) }, }, }, { @@ -622,12 +623,12 @@ describe("ZNSSubRegistrar", () => { domainLabel: "lvltwo", fullConfig: { distrConfig: { - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), paymentType: PaymentType.STAKE, accessType: AccessType.OPEN, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: lvl2SubOwner.address, }, priceConfig: DEFAULT_PRICE_CONFIG, @@ -638,12 +639,12 @@ describe("ZNSSubRegistrar", () => { domainLabel: "lvlthree", fullConfig: { distrConfig: { - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), paymentType: PaymentType.DIRECT, accessType: AccessType.OPEN, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: lvl3SubOwner.address, }, priceConfig: DEFAULT_PRICE_CONFIG, @@ -654,12 +655,12 @@ describe("ZNSSubRegistrar", () => { domainLabel: "lvlfour", fullConfig: { distrConfig: { - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), paymentType: PaymentType.STAKE, accessType: AccessType.OPEN, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: lvl4SubOwner.address, }, priceConfig: DEFAULT_PRICE_CONFIG, @@ -671,12 +672,12 @@ describe("ZNSSubRegistrar", () => { domainLabel: "lvlfive", fullConfig: { distrConfig: { - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.DIRECT, accessType: AccessType.OPEN, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: lvl5SubOwner.address, }, priceConfig: { price: fixedPrice, feePercentage: fixedFeePercentage }, @@ -688,12 +689,12 @@ describe("ZNSSubRegistrar", () => { domainLabel: "lvlsix", fullConfig: { distrConfig: { - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), paymentType: PaymentType.STAKE, accessType: AccessType.OPEN, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: lvl6SubOwner.address, }, priceConfig: DEFAULT_PRICE_CONFIG, @@ -724,15 +725,15 @@ describe("ZNSSubRegistrar", () => { domainLabel: "multiownerdomone", fullConfig: { distrConfig: { - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), accessType: AccessType.OPEN, paymentType: PaymentType.DIRECT, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: multiOwner.address, }, - priceConfig: { price: fixedPrice, feePercentage: BigNumber.from(0) }, + priceConfig: { price: fixedPrice, feePercentage: BigInt(0) }, }, }, { @@ -741,12 +742,12 @@ describe("ZNSSubRegistrar", () => { parentHash: regResults[0].domainHash, fullConfig: { distrConfig: { - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), accessType: AccessType.LOCKED, paymentType: PaymentType.STAKE, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: zeroVault.address, }, priceConfig: DEFAULT_PRICE_CONFIG, @@ -758,12 +759,12 @@ describe("ZNSSubRegistrar", () => { parentHash: regResults[1].domainHash, fullConfig: { distrConfig: { - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), accessType: AccessType.MINTLIST, paymentType: PaymentType.DIRECT, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: multiOwner.address, }, priceConfig: DEFAULT_PRICE_CONFIG, @@ -775,15 +776,15 @@ describe("ZNSSubRegistrar", () => { parentHash: regResults[2].domainHash, fullConfig: { distrConfig: { - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), accessType: AccessType.OPEN, paymentType: PaymentType.STAKE, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: zeroVault.address, }, - priceConfig: { price: fixedPrice, feePercentage: BigNumber.from(0) }, + priceConfig: { price: fixedPrice, feePercentage: BigInt(0) }, }, }, { @@ -792,12 +793,12 @@ describe("ZNSSubRegistrar", () => { parentHash: regResults[3].domainHash, fullConfig: { distrConfig: { - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), accessType: AccessType.OPEN, paymentType: PaymentType.DIRECT, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: multiOwner.address, }, priceConfig: DEFAULT_PRICE_CONFIG, @@ -809,12 +810,12 @@ describe("ZNSSubRegistrar", () => { parentHash: regResults[4].domainHash, fullConfig: { distrConfig: { - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), accessType: AccessType.OPEN, paymentType: PaymentType.STAKE, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: zeroVault.address, }, priceConfig: DEFAULT_PRICE_CONFIG, @@ -826,12 +827,12 @@ describe("ZNSSubRegistrar", () => { parentHash: regResults[5].domainHash, fullConfig: { distrConfig: { - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), accessType: AccessType.OPEN, paymentType: PaymentType.DIRECT, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: multiOwner.address, }, priceConfig: { price: fixedPrice, feePercentage: fixedFeePercentage }, @@ -840,7 +841,7 @@ describe("ZNSSubRegistrar", () => { ]; // prep - await zns.meowToken.connect(multiOwner).approve(zns.treasury.address, ethers.constants.MaxUint256); + await zns.meowToken.connect(multiOwner).approve(await zns.treasury.getAddress(), ethers.MaxUint256); // register const domainHashes = await configs.reduce( @@ -872,9 +873,9 @@ describe("ZNSSubRegistrar", () => { await acc; const { owner, resolver } = await zns.registry.getDomainRecord(domainHash); expect(owner).to.eq(multiOwner.address); - expect(resolver).to.eq(zns.addressResolver.address); + expect(resolver).to.eq(await zns.addressResolver.getAddress()); - const tokenId = BigNumber.from(domainHash).toString(); + const tokenId = BigInt(domainHash).toString(); const tokenOwner = await zns.domainToken.ownerOf(tokenId); expect(tokenOwner).to.eq(multiOwner.address); @@ -918,7 +919,7 @@ describe("ZNSSubRegistrar", () => { const userBalAfter = await zns.meowToken.balanceOf(lvl6SubOwner.address); - expect(userBalAfter.sub(userBalBefore)).to.eq(0); + expect(userBalAfter - userBalBefore).to.eq(0); // make sure that accessType has been set to LOCKED // and nobody can register a subdomain under this domain @@ -943,10 +944,10 @@ describe("ZNSSubRegistrar", () => { ); const dataFromReg = await zns.registry.getDomainRecord(domainHash); - expect(dataFromReg.owner).to.eq(ethers.constants.AddressZero); - expect(dataFromReg.resolver).to.eq(ethers.constants.AddressZero); + expect(dataFromReg.owner).to.eq(ethers.ZeroAddress); + expect(dataFromReg.resolver).to.eq(ethers.ZeroAddress); - const tokenId = BigNumber.from(domainHash).toString(); + const tokenId = BigInt(domainHash).toString(); await expect( zns.domainToken.ownerOf(tokenId) ).to.be.revertedWith( @@ -963,28 +964,28 @@ describe("ZNSSubRegistrar", () => { const userBalanceBefore = await zns.meowToken.balanceOf(lvl5SubOwner.address); const parentBalBefore = await zns.meowToken.balanceOf(lvl4SubOwner.address); - const paymentContractBalBefore = await zns.meowToken.balanceOf(zns.treasury.address); + const paymentContractBalBefore = await zns.meowToken.balanceOf(await zns.treasury.getAddress()); await zns.rootRegistrar.connect(lvl5SubOwner).revokeDomain(domainHash); const userBalAfter = await zns.meowToken.balanceOf(lvl5SubOwner.address); const parentBalAfter = await zns.meowToken.balanceOf(lvl4SubOwner.address); - const paymentContractBalAfter = await zns.meowToken.balanceOf(zns.treasury.address); + const paymentContractBalAfter = await zns.meowToken.balanceOf(await zns.treasury.getAddress()); const { expectedPrice } = getPriceObject(domainConfigs[4].domainLabel); expect( - userBalAfter.sub(userBalanceBefore) + userBalAfter - userBalanceBefore ).to.eq( expectedPrice ); expect( - parentBalBefore.sub(parentBalAfter) + parentBalBefore - parentBalAfter ).to.eq( - BigNumber.from(0) + BigInt(0) ); expect( - paymentContractBalBefore.sub(paymentContractBalAfter) + paymentContractBalBefore - paymentContractBalAfter ).to.eq( expectedPrice ); @@ -1008,10 +1009,10 @@ describe("ZNSSubRegistrar", () => { ); const dataFromReg = await zns.registry.getDomainRecord(domainHash); - expect(dataFromReg.owner).to.eq(ethers.constants.AddressZero); - expect(dataFromReg.resolver).to.eq(ethers.constants.AddressZero); + expect(dataFromReg.owner).to.eq(ethers.ZeroAddress); + expect(dataFromReg.resolver).to.eq(ethers.ZeroAddress); - const tokenId = BigNumber.from(domainHash).toString(); + const tokenId = BigInt(domainHash).toString(); await expect( zns.domainToken.ownerOf(tokenId) ).to.be.revertedWith( @@ -1031,12 +1032,12 @@ describe("ZNSSubRegistrar", () => { parentHash: regResults[2].domainHash, fullConfig: { distrConfig: { - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.DIRECT, accessType: AccessType.OPEN, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: branchLvl1Owner.address, }, priceConfig: { price: fixedPrice, feePercentage: fixedFeePercentage }, @@ -1047,12 +1048,12 @@ describe("ZNSSubRegistrar", () => { domainLabel: "lvlfournew", fullConfig: { distrConfig: { - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), paymentType: PaymentType.STAKE, accessType: AccessType.OPEN, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: branchLvl2Owner.address, }, priceConfig: DEFAULT_PRICE_CONFIG, @@ -1104,7 +1105,7 @@ describe("ZNSSubRegistrar", () => { domainConfigs[1].fullConfig.paymentConfig.beneficiary ); - expect(parentDistrConfig.pricerContract).to.eq(zns.curvePricer.address); + expect(parentDistrConfig.pricerContract).to.eq(await zns.curvePricer.getAddress()); // check a couple of fields from price config const priceConfig = await zns.curvePricer.priceConfigs(lvl2Hash); @@ -1132,7 +1133,7 @@ describe("ZNSSubRegistrar", () => { const userBalAfter = await zns.meowToken.balanceOf(lvl3SubOwner.address); - expect(userBalAfter.sub(userBalBefore)).to.eq(expectedPrice); + expect(userBalAfter - userBalBefore).to.eq(expectedPrice); const childExistsAfter = await zns.registry.exists(lvl3Hash); assert.ok(!childExistsAfter); @@ -1141,10 +1142,10 @@ describe("ZNSSubRegistrar", () => { expect(stakedAfterRevoke).to.eq(0); const dataFromReg = await zns.registry.getDomainRecord(lvl3Hash); - expect(dataFromReg.owner).to.eq(ethers.constants.AddressZero); - expect(dataFromReg.resolver).to.eq(ethers.constants.AddressZero); + expect(dataFromReg.owner).to.eq(ethers.ZeroAddress); + expect(dataFromReg.resolver).to.eq(ethers.ZeroAddress); - const tokenId = BigNumber.from(lvl3Hash).toString(); + const tokenId = BigInt(lvl3Hash).toString(); await expect( zns.domainToken.ownerOf(tokenId) ).to.be.revertedWith( @@ -1186,12 +1187,12 @@ describe("ZNSSubRegistrar", () => { parentHash, fullConfig: { distrConfig: { - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.DIRECT, accessType: AccessType.OPEN, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: branchLvl1Owner.address, }, priceConfig: { price: fixedPrice, feePercentage: fixedFeePercentage }, @@ -1237,7 +1238,7 @@ describe("ZNSSubRegistrar", () => { await registrationWithSetup({ zns, user: rootOwner, - parentHash: ethers.constants.HashZero, + parentHash: ethers.ZeroHash, domainLabel: domainConfigs[0].domainLabel, fullConfig: domainConfigs[0].fullConfig, }); @@ -1291,15 +1292,15 @@ describe("ZNSSubRegistrar", () => { domainLabel: domainConfigs[1].domainLabel, fullConfig: { distrConfig: { - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.DIRECT, accessType: AccessType.MINTLIST, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: branchLvl1Owner.address, }, - priceConfig: { price: fixedPrice, feePercentage: BigNumber.from(0) }, + priceConfig: { price: fixedPrice, feePercentage: BigInt(0) }, }, }); @@ -1335,14 +1336,14 @@ describe("ZNSSubRegistrar", () => { const protocolFee = getStakingOrProtocolFee(fixedPrice); // make sure child payed based on the new parent config - expect(childBalBefore.sub(childBalAfter)).to.eq(fixedPrice.add(protocolFee)); + expect(childBalBefore - childBalAfter).to.eq(fixedPrice + protocolFee); }); }); describe("Token movements with different distr setups", () => { let rootHash : string; - let fixedPrice : BigNumber; - let feePercentage : BigNumber; + let fixedPrice : bigint; + let feePercentage : bigint; let token2 : CustomDecimalTokenMock; let token5 : CustomDecimalTokenMock; let token8 : CustomDecimalTokenMock; @@ -1350,11 +1351,11 @@ describe("ZNSSubRegistrar", () => { let token18 : CustomDecimalTokenMock; const decimalValues = { - two: BigNumber.from(2), - five: BigNumber.from(5), - eight: BigNumber.from(8), - thirteen: BigNumber.from(13), - eighteen: BigNumber.from(18), + two: BigInt(2), + five: BigInt(5), + eight: BigInt(8), + thirteen: BigInt(13), + eighteen: BigInt(18), }; before(async () => { @@ -1409,9 +1410,9 @@ describe("ZNSSubRegistrar", () => { branchLvl1Owner, branchLvl2Owner, ].map(async ({ address }) => - zns.meowToken.mint(address, ethers.utils.parseEther("1000000"))) + zns.meowToken.mint(address, ethers.parseEther("1000000"))) ); - await zns.meowToken.connect(rootOwner).approve(zns.treasury.address, ethers.constants.MaxUint256); + await zns.meowToken.connect(rootOwner).approve(await zns.treasury.getAddress(), ethers.MaxUint256); // register root domain rootHash = await registrationWithSetup({ @@ -1421,16 +1422,16 @@ describe("ZNSSubRegistrar", () => { fullConfig: { distrConfig: { accessType: AccessType.OPEN, - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.DIRECT, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: rootOwner.address, }, priceConfig: { - price: ethers.utils.parseEther("1375.612"), - feePercentage: BigNumber.from(0), + price: ethers.parseEther("1375.612"), + feePercentage: BigInt(0), }, }, }); @@ -1440,8 +1441,8 @@ describe("ZNSSubRegistrar", () => { const decimals = await token5.decimals(); expect(decimals).to.eq(decimalValues.five); - fixedPrice = parseUnits("1375.17", decimalValues.five); - feePercentage = BigNumber.from(200); + fixedPrice = ethers.parseUnits("1375.17", decimalValues.five); + feePercentage = BigInt(200); const priceConfig = { price: fixedPrice, @@ -1455,12 +1456,12 @@ describe("ZNSSubRegistrar", () => { domainLabel: "fixedstake", fullConfig: { distrConfig: { - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.STAKE, accessType: AccessType.OPEN, }, paymentConfig: { - token: token5.address, + token: await token5.getAddress(), beneficiary: lvl2SubOwner.address, }, priceConfig, @@ -1474,13 +1475,13 @@ describe("ZNSSubRegistrar", () => { stakeFee: stakeFee, } = getPriceObject(label, priceConfig); const protocolFee = getStakingOrProtocolFee( - expectedPrice.add(stakeFee) + expectedPrice + stakeFee ); // send future child some tokens - await token5.connect(deployer).transfer(lvl3SubOwner.address, expectedPrice.add(stakeFee).add(protocolFee)); + await token5.connect(deployer).transfer(lvl3SubOwner.address, expectedPrice + stakeFee + protocolFee); - const contractBalBefore = await token5.balanceOf(zns.treasury.address); + const contractBalBefore = await token5.balanceOf(await zns.treasury.getAddress()); const parentBalBefore = await token5.balanceOf(lvl2SubOwner.address); const childBalBefore = await token5.balanceOf(lvl3SubOwner.address); const zeroVaultBalanceBefore = await token5.balanceOf(zeroVault.address); @@ -1495,13 +1496,13 @@ describe("ZNSSubRegistrar", () => { const parentBalAfter = await token5.balanceOf(lvl2SubOwner.address); const childBalAfter = await token5.balanceOf(lvl3SubOwner.address); - const contractBalAfter = await token5.balanceOf(zns.treasury.address); + const contractBalAfter = await token5.balanceOf(await zns.treasury.getAddress()); const zeroVaultBalanceAfter = await token5.balanceOf(zeroVault.address); - expect(parentBalAfter.sub(parentBalBefore)).to.eq(stakeFee); - expect(childBalBefore.sub(childBalAfter)).to.eq(expectedPrice.add(stakeFee).add(protocolFee)); - expect(contractBalAfter.sub(contractBalBefore)).to.eq(expectedPrice); - expect(zeroVaultBalanceAfter.sub(zeroVaultBalanceBefore)).to.eq(protocolFee); + expect(parentBalAfter - parentBalBefore).to.eq(stakeFee); + expect(childBalBefore - childBalAfter).to.eq(expectedPrice + stakeFee + protocolFee); + expect(contractBalAfter - contractBalBefore).to.eq(expectedPrice); + expect(zeroVaultBalanceAfter - zeroVaultBalanceBefore).to.eq(protocolFee); // revoke await zns.rootRegistrar.connect(lvl3SubOwner).revokeDomain( @@ -1509,21 +1510,21 @@ describe("ZNSSubRegistrar", () => { ); // should offer refund ! - const contractBalAfterRevoke = await token5.balanceOf(zns.treasury.address); + const contractBalAfterRevoke = await token5.balanceOf(await zns.treasury.getAddress()); const childBalAfterRevoke = await token5.balanceOf(lvl3SubOwner.address); const parentBalAfterRevoke = await token5.balanceOf(lvl2SubOwner.address); const zeroVaultBalanceAfterRevoke = await token5.balanceOf(zeroVault.address); - expect(contractBalAfter.sub(contractBalAfterRevoke)).to.eq(expectedPrice); - expect(childBalAfterRevoke.sub(childBalAfter)).to.eq(expectedPrice); - expect(parentBalAfterRevoke.sub(parentBalAfter)).to.eq(0); - expect(zeroVaultBalanceAfterRevoke.sub(zeroVaultBalanceAfter)).to.eq(0); + expect(contractBalAfter - contractBalAfterRevoke).to.eq(expectedPrice); + expect(childBalAfterRevoke - childBalAfter).to.eq(expectedPrice); + expect(parentBalAfterRevoke - parentBalAfter).to.eq(0); + expect(zeroVaultBalanceAfterRevoke - zeroVaultBalanceAfter).to.eq(0); }); it("FixedPricer - StakePayment - no fee - 18 decimals", async () => { const priceConfig = { - price: parseUnits("397.77", decimalValues.eighteen), - feePercentage: BigNumber.from(0), + price: ethers.parseUnits("397.77", decimalValues.eighteen), + feePercentage: BigInt(0), }; const subdomainParentHash = await registrationWithSetup({ @@ -1533,12 +1534,12 @@ describe("ZNSSubRegistrar", () => { domainLabel: "fixedstakenofee", fullConfig: { distrConfig: { - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), accessType: AccessType.OPEN, paymentType: PaymentType.STAKE, }, paymentConfig: { - token: token18.address, + token: await token18.getAddress(), beneficiary: lvl2SubOwner.address, }, priceConfig, @@ -1553,10 +1554,10 @@ describe("ZNSSubRegistrar", () => { // send future child some tokens await token18.connect(deployer).transfer( lvl3SubOwner.address, - expectedPrice.add(protocolFee) + expectedPrice + protocolFee ); - const contractBalBefore = await token18.balanceOf(zns.treasury.address); + const contractBalBefore = await token18.balanceOf(await zns.treasury.getAddress()); const parentBalBefore = await token18.balanceOf(lvl2SubOwner.address); const childBalBefore = await token18.balanceOf(lvl3SubOwner.address); const zeroVaultBalanceBefore = await token18.balanceOf(zeroVault.address); @@ -1570,13 +1571,13 @@ describe("ZNSSubRegistrar", () => { const parentBalAfter = await token18.balanceOf(lvl2SubOwner.address); const childBalAfter = await token18.balanceOf(lvl3SubOwner.address); - const contractBalAfter = await token18.balanceOf(zns.treasury.address); + const contractBalAfter = await token18.balanceOf(await zns.treasury.getAddress()); const zeroVaultBalanceAfter = await token18.balanceOf(zeroVault.address); - expect(parentBalAfter.sub(parentBalBefore)).to.eq(0); - expect(childBalBefore.sub(childBalAfter)).to.eq(expectedPrice.add(protocolFee)); - expect(contractBalAfter.sub(contractBalBefore)).to.eq(expectedPrice); - expect(zeroVaultBalanceAfter.sub(zeroVaultBalanceBefore)).to.eq(protocolFee); + expect(parentBalAfter - parentBalBefore).to.eq(0); + expect(childBalBefore - childBalAfter).to.eq(expectedPrice + protocolFee); + expect(contractBalAfter - contractBalBefore).to.eq(expectedPrice); + expect(zeroVaultBalanceAfter - zeroVaultBalanceBefore).to.eq(protocolFee); // revoke await zns.rootRegistrar.connect(lvl3SubOwner).revokeDomain( @@ -1584,21 +1585,21 @@ describe("ZNSSubRegistrar", () => { ); // should offer refund ! - const contractBalAfterRevoke = await token18.balanceOf(zns.treasury.address); + const contractBalAfterRevoke = await token18.balanceOf(await zns.treasury.getAddress()); const childBalAfterRevoke = await token18.balanceOf(lvl3SubOwner.address); const parentBalAfterRevoke = await token18.balanceOf(lvl2SubOwner.address); const zeroVaultBalanceAfterRevoke = await token18.balanceOf(zeroVault.address); - expect(contractBalAfter.sub(contractBalAfterRevoke)).to.eq(expectedPrice); - expect(childBalAfterRevoke.sub(childBalAfter)).to.eq(expectedPrice); - expect(parentBalAfterRevoke.sub(parentBalAfter)).to.eq(0); - expect(zeroVaultBalanceAfterRevoke.sub(zeroVaultBalanceAfter)).to.eq(0); + expect(contractBalAfter - contractBalAfterRevoke).to.eq(expectedPrice); + expect(childBalAfterRevoke - childBalAfter).to.eq(expectedPrice); + expect(parentBalAfterRevoke - parentBalAfter).to.eq(0); + expect(zeroVaultBalanceAfterRevoke - zeroVaultBalanceAfter).to.eq(0); }); it("FixedPricer - DirectPayment - no fee - 8 decimals", async () => { const priceConfig = { - price: parseUnits("11.371", decimalValues.eight), - feePercentage: BigNumber.from(0), + price: ethers.parseUnits("11.371", decimalValues.eight), + feePercentage: BigInt(0), }; const subdomainParentHash = await registrationWithSetup({ @@ -1609,11 +1610,11 @@ describe("ZNSSubRegistrar", () => { fullConfig: { distrConfig: { paymentType: PaymentType.DIRECT, - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), accessType: AccessType.OPEN, }, paymentConfig: { - token: token8.address, + token: await token8.getAddress(), beneficiary: lvl2SubOwner.address, }, priceConfig, @@ -1627,12 +1628,12 @@ describe("ZNSSubRegistrar", () => { // send future child some tokens await token8.connect(deployer).transfer( lvl3SubOwner.address, - expectedPrice.add(protocolFee) + expectedPrice + protocolFee ); const parentBalBefore = await token8.balanceOf(lvl2SubOwner.address); const childBalBefore = await token8.balanceOf(lvl3SubOwner.address); - const contractBalBefore = await token8.balanceOf(zns.treasury.address); + const contractBalBefore = await token8.balanceOf(await zns.treasury.getAddress()); const zeroVaultBalanceBefore = await token8.balanceOf(zeroVault.address); @@ -1646,14 +1647,14 @@ describe("ZNSSubRegistrar", () => { const parentBalAfter = await token8.balanceOf(lvl2SubOwner.address); const childBalAfter = await token8.balanceOf(lvl3SubOwner.address); - const contractBalAfter = await token8.balanceOf(zns.treasury.address); + const contractBalAfter = await token8.balanceOf(await zns.treasury.getAddress()); const zeroVaultBalanceAfter = await token8.balanceOf(zeroVault.address); - expect(parentBalAfter.sub(parentBalBefore)).to.eq(expectedPrice); - expect(childBalBefore.sub(childBalAfter)).to.eq(expectedPrice.add(protocolFee)); - expect(contractBalAfter.sub(contractBalBefore)).to.eq(0); - expect(zeroVaultBalanceAfter.sub(zeroVaultBalanceBefore)).to.eq(protocolFee); + expect(parentBalAfter - parentBalBefore).to.eq(expectedPrice); + expect(childBalBefore - childBalAfter).to.eq(expectedPrice + protocolFee); + expect(contractBalAfter - contractBalBefore).to.eq(0); + expect(zeroVaultBalanceAfter - zeroVaultBalanceBefore).to.eq(protocolFee); // revoke await zns.rootRegistrar.connect(lvl3SubOwner).revokeDomain( @@ -1663,26 +1664,25 @@ describe("ZNSSubRegistrar", () => { // should NOT offer refund ! const parentBalAfterRevoke = await token8.balanceOf(lvl2SubOwner.address); const childBalAfterRevoke = await token8.balanceOf(lvl3SubOwner.address); - const contractBalAfterRevoke = await token8.balanceOf(zns.treasury.address); + const contractBalAfterRevoke = await token8.balanceOf(await zns.treasury.getAddress()); const zeroVaultBalanceAfterRevoke = await token8.balanceOf(zeroVault.address); - expect(parentBalAfterRevoke.sub(parentBalAfter)).to.eq(0); - expect(childBalAfterRevoke.sub(childBalAfter)).to.eq(0); - expect(contractBalAfterRevoke.sub(contractBalAfter)).to.eq(0); - expect(zeroVaultBalanceAfterRevoke.sub(zeroVaultBalanceAfter)).to.eq(0); + expect(parentBalAfterRevoke - parentBalAfter).to.eq(0); + expect(childBalAfterRevoke - childBalAfter).to.eq(0); + expect(contractBalAfterRevoke - contractBalAfter).to.eq(0); + expect(zeroVaultBalanceAfterRevoke - zeroVaultBalanceAfter).to.eq(0); }); it("CurvePricer - StakePayment - stake fee - 13 decimals", async () => { const priceConfig = { - maxPrice: parseUnits("30000.93", decimalValues.thirteen), - minPrice: parseUnits("2000.11", decimalValues.thirteen), - maxLength: BigNumber.from(50), - baseLength: BigNumber.from(4), - precisionMultiplier: BigNumber.from(10).pow( - decimalValues.thirteen - .sub(DECAULT_PRECISION) + maxPrice: ethers.parseUnits("30000.93", decimalValues.thirteen), + minPrice: ethers.parseUnits("2000.11", decimalValues.thirteen), + maxLength: BigInt(50), + baseLength: BigInt(4), + precisionMultiplier: BigInt(10) ** ( + decimalValues.thirteen - DECAULT_PRECISION ), - feePercentage: BigNumber.from(185), + feePercentage: BigInt(185), isSet: true, }; @@ -1694,11 +1694,11 @@ describe("ZNSSubRegistrar", () => { fullConfig: { distrConfig: { paymentType: PaymentType.STAKE, - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), accessType: AccessType.OPEN, }, paymentConfig: { - token: token13.address, + token: await token13.getAddress(), beneficiary: lvl2SubOwner.address, }, priceConfig, @@ -1712,16 +1712,16 @@ describe("ZNSSubRegistrar", () => { stakeFee: stakeFee, } = getPriceObject(label, priceConfig); const protocolFee = getStakingOrProtocolFee( - expectedPrice.add(stakeFee) + expectedPrice + stakeFee ); // send future child some tokens await token13.connect(deployer).transfer( lvl3SubOwner.address, - expectedPrice.add(stakeFee).add(protocolFee) + expectedPrice + stakeFee + protocolFee ); - const contractBalBefore = await token13.balanceOf(zns.treasury.address); + const contractBalBefore = await token13.balanceOf(await zns.treasury.getAddress()); const parentBalBefore = await token13.balanceOf(lvl2SubOwner.address); const childBalBefore = await token13.balanceOf(lvl3SubOwner.address); const zeroVaultBalanceBefore = await token13.balanceOf(zeroVault.address); @@ -1734,15 +1734,15 @@ describe("ZNSSubRegistrar", () => { fullConfig: fullDistrConfigEmpty, }); - const contractBalAfter = await token13.balanceOf(zns.treasury.address); + const contractBalAfter = await token13.balanceOf(await zns.treasury.getAddress()); const parentBalAfter = await token13.balanceOf(lvl2SubOwner.address); const childBalAfter = await token13.balanceOf(lvl3SubOwner.address); const zeroVaultBalanceAfter = await token13.balanceOf(zeroVault.address); - expect(parentBalAfter.sub(parentBalBefore)).to.eq(stakeFee); - expect(childBalBefore.sub(childBalAfter)).to.eq(expectedPrice.add(protocolFee).add(stakeFee)); - expect(contractBalAfter.sub(contractBalBefore)).to.eq(expectedPrice); - expect(zeroVaultBalanceAfter.sub(zeroVaultBalanceBefore)).to.eq(protocolFee); + expect(parentBalAfter - parentBalBefore).to.eq(stakeFee); + expect(childBalBefore - childBalAfter).to.eq(expectedPrice + protocolFee + stakeFee); + expect(contractBalAfter - contractBalBefore).to.eq(expectedPrice); + expect(zeroVaultBalanceAfter - zeroVaultBalanceBefore).to.eq(protocolFee); // revoke await zns.rootRegistrar.connect(lvl3SubOwner).revokeDomain( @@ -1750,25 +1750,25 @@ describe("ZNSSubRegistrar", () => { ); // should offer refund ! - const contractBalAfterRevoke = await token13.balanceOf(zns.treasury.address); + const contractBalAfterRevoke = await token13.balanceOf(await zns.treasury.getAddress()); const childBalAfterRevoke = await token13.balanceOf(lvl3SubOwner.address); const parentBalAfterRevoke = await token13.balanceOf(lvl2SubOwner.address); const zeroVaultBalanceAfterRevoke = await token13.balanceOf(zeroVault.address); - expect(contractBalAfter.sub(contractBalAfterRevoke)).to.eq(expectedPrice); - expect(childBalAfterRevoke.sub(childBalAfter)).to.eq(expectedPrice); - expect(parentBalAfterRevoke.sub(parentBalAfter)).to.eq(0); - expect(zeroVaultBalanceAfterRevoke.sub(zeroVaultBalanceAfter)).to.eq(0); + expect(contractBalAfter - contractBalAfterRevoke).to.eq(expectedPrice); + expect(childBalAfterRevoke - childBalAfter).to.eq(expectedPrice); + expect(parentBalAfterRevoke - parentBalAfter).to.eq(0); + expect(zeroVaultBalanceAfterRevoke - zeroVaultBalanceAfter).to.eq(0); }); it("CurvePricer - StakePayment - no fee - 2 decimals", async () => { const priceConfig = { - maxPrice: parseUnits("234.46", decimalValues.two), - minPrice: parseUnits("3.37", decimalValues.two), - maxLength: BigNumber.from(20), - baseLength: BigNumber.from(2), - precisionMultiplier: BigNumber.from(1), - feePercentage: BigNumber.from(0), + maxPrice: ethers.parseUnits("234.46", decimalValues.two), + minPrice: ethers.parseUnits("3.37", decimalValues.two), + maxLength: BigInt(20), + baseLength: BigInt(2), + precisionMultiplier: BigInt(1), + feePercentage: BigInt(0), isSet: true, }; @@ -1779,12 +1779,12 @@ describe("ZNSSubRegistrar", () => { domainLabel: "curvestakenofee", fullConfig: { distrConfig: { - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), accessType: AccessType.OPEN, paymentType: PaymentType.STAKE, }, paymentConfig: { - token: token2.address, + token: await token2.getAddress(), beneficiary: lvl2SubOwner.address, }, priceConfig, @@ -1799,10 +1799,10 @@ describe("ZNSSubRegistrar", () => { // send future child some tokens await token2.connect(deployer).transfer( lvl3SubOwner.address, - expectedPrice.add(protocolFee) + expectedPrice + protocolFee ); - const contractBalBefore = await token2.balanceOf(zns.treasury.address); + const contractBalBefore = await token2.balanceOf(await zns.treasury.getAddress()); const parentBalBefore = await token2.balanceOf(lvl2SubOwner.address); const childBalBefore = await token2.balanceOf(lvl3SubOwner.address); const zeroVaultBalanceBefore = await token2.balanceOf(zeroVault.address); @@ -1814,15 +1814,15 @@ describe("ZNSSubRegistrar", () => { domainLabel: label, }); - const contractBalAfter = await token2.balanceOf(zns.treasury.address); + const contractBalAfter = await token2.balanceOf(await zns.treasury.getAddress()); const parentBalAfter = await token2.balanceOf(lvl2SubOwner.address); const childBalAfter = await token2.balanceOf(lvl3SubOwner.address); const zeroVaultBalanceAfter = await token2.balanceOf(zeroVault.address); - expect(parentBalAfter.sub(parentBalBefore)).to.eq(0); - expect(childBalBefore.sub(childBalAfter)).to.eq(expectedPrice.add(protocolFee)); - expect(contractBalAfter.sub(contractBalBefore)).to.eq(expectedPrice); - expect(zeroVaultBalanceAfter.sub(zeroVaultBalanceBefore)).to.eq(protocolFee); + expect(parentBalAfter - parentBalBefore).to.eq(0); + expect(childBalBefore - childBalAfter).to.eq(expectedPrice + protocolFee); + expect(contractBalAfter - contractBalBefore).to.eq(expectedPrice); + expect(zeroVaultBalanceAfter - zeroVaultBalanceBefore).to.eq(protocolFee); // revoke await zns.rootRegistrar.connect(lvl3SubOwner).revokeDomain( @@ -1830,21 +1830,21 @@ describe("ZNSSubRegistrar", () => { ); // should offer refund ! - const contractBalAfterRevoke = await token2.balanceOf(zns.treasury.address); + const contractBalAfterRevoke = await token2.balanceOf(await zns.treasury.getAddress()); const childBalAfterRevoke = await token2.balanceOf(lvl3SubOwner.address); const parentBalAfterRevoke = await token2.balanceOf(lvl2SubOwner.address); const zeroVaultBalanceAfterRevoke = await token2.balanceOf(zeroVault.address); - expect(contractBalAfter.sub(contractBalAfterRevoke)).to.eq(expectedPrice); - expect(childBalAfterRevoke.sub(childBalAfter)).to.eq(expectedPrice); - expect(parentBalAfterRevoke.sub(parentBalAfter)).to.eq(0); - expect(zeroVaultBalanceAfterRevoke.sub(zeroVaultBalanceAfter)).to.eq(0); + expect(contractBalAfter - contractBalAfterRevoke).to.eq(expectedPrice); + expect(childBalAfterRevoke - childBalAfter).to.eq(expectedPrice); + expect(parentBalAfterRevoke - parentBalAfter).to.eq(0); + expect(zeroVaultBalanceAfterRevoke - zeroVaultBalanceAfter).to.eq(0); }); it("CurvePricer - DirectPayment - no fee - 18 decimals", async () => { const priceConfig = { ...DEFAULT_PRICE_CONFIG, - feePercentage: BigNumber.from(0), + feePercentage: BigInt(0), }; const subdomainParentHash = await registrationWithSetup({ @@ -1854,13 +1854,13 @@ describe("ZNSSubRegistrar", () => { domainLabel: "curvedirectnofee", fullConfig: { distrConfig: { - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), accessType: AccessType.OPEN, paymentType: PaymentType.DIRECT, }, paymentConfig: { // zero has 18 decimals - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: lvl2SubOwner.address, }, priceConfig, @@ -1869,7 +1869,7 @@ describe("ZNSSubRegistrar", () => { const label = "asdirectnofeechild"; - const contractBalBefore = await zns.meowToken.balanceOf(zns.treasury.address); + const contractBalBefore = await zns.meowToken.balanceOf(await zns.treasury.getAddress()); const parentBalBefore = await zns.meowToken.balanceOf(lvl2SubOwner.address); const childBalBefore = await zns.meowToken.balanceOf(lvl3SubOwner.address); const zeroVaultBalanceBefore = await zns.meowToken.balanceOf(zeroVault.address); @@ -1883,16 +1883,16 @@ describe("ZNSSubRegistrar", () => { const parentBalAfter = await zns.meowToken.balanceOf(lvl2SubOwner.address); const childBalAfter = await zns.meowToken.balanceOf(lvl3SubOwner.address); - const contractBalAfter = await zns.meowToken.balanceOf(zns.treasury.address); + const contractBalAfter = await zns.meowToken.balanceOf(await zns.treasury.getAddress()); const zeroVaultBalanceAfter = await zns.meowToken.balanceOf(zeroVault.address); const { expectedPrice } = getPriceObject(label, priceConfig); const protocolFee = getStakingOrProtocolFee(expectedPrice); - expect(parentBalAfter.sub(parentBalBefore)).to.eq(expectedPrice); - expect(childBalBefore.sub(childBalAfter)).to.eq(expectedPrice.add(protocolFee)); - expect(contractBalAfter.sub(contractBalBefore)).to.eq(0); - expect(zeroVaultBalanceAfter.sub(zeroVaultBalanceBefore)).to.eq(protocolFee); + expect(parentBalAfter - parentBalBefore).to.eq(expectedPrice); + expect(childBalBefore - childBalAfter).to.eq(expectedPrice + protocolFee); + expect(contractBalAfter - contractBalBefore).to.eq(0); + expect(zeroVaultBalanceAfter - zeroVaultBalanceBefore).to.eq(protocolFee); // revoke await zns.rootRegistrar.connect(lvl3SubOwner).revokeDomain( @@ -1902,19 +1902,19 @@ describe("ZNSSubRegistrar", () => { // should NOT offer refund ! const parentBalAfterRevoke = await zns.meowToken.balanceOf(lvl2SubOwner.address); const childBalAfterRevoke = await zns.meowToken.balanceOf(lvl3SubOwner.address); - const contractBalAfterRevoke = await zns.meowToken.balanceOf(zns.treasury.address); + const contractBalAfterRevoke = await zns.meowToken.balanceOf(await zns.treasury.getAddress()); const zeroVaultBalanceAfterRevoke = await zns.meowToken.balanceOf(zeroVault.address); - expect(parentBalAfterRevoke.sub(parentBalAfter)).to.eq(0); - expect(childBalAfterRevoke.sub(childBalAfter)).to.eq(0); - expect(contractBalAfterRevoke.sub(contractBalAfter)).to.eq(0); - expect(zeroVaultBalanceAfterRevoke.sub(zeroVaultBalanceAfter)).to.eq(0); + expect(parentBalAfterRevoke - parentBalAfter).to.eq(0); + expect(childBalAfterRevoke - childBalAfter).to.eq(0); + expect(contractBalAfterRevoke - contractBalAfter).to.eq(0); + expect(zeroVaultBalanceAfterRevoke - zeroVaultBalanceAfter).to.eq(0); }); it("FixedPricer + DirectPayment with price = 0 - should NOT perform any transfers", async () => { const priceConfig = { - price: BigNumber.from(0), - feePercentage: BigNumber.from(0), + price: BigInt(0), + feePercentage: BigInt(0), }; const subdomainParentHash = await registrationWithSetup({ @@ -1924,19 +1924,19 @@ describe("ZNSSubRegistrar", () => { domainLabel: "zeroprice", fullConfig: { distrConfig: { - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), accessType: AccessType.OPEN, paymentType: PaymentType.DIRECT, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: lvl2SubOwner.address, }, priceConfig, }, }); - const contractBalBefore = await zns.meowToken.balanceOf(zns.treasury.address); + const contractBalBefore = await zns.meowToken.balanceOf(await zns.treasury.getAddress()); const parentBalBefore = await zns.meowToken.balanceOf(lvl2SubOwner.address); const childBalBefore = await zns.meowToken.balanceOf(lvl3SubOwner.address); const zeroVaultBalanceBefore = await zns.meowToken.balanceOf(zeroVault.address); @@ -1951,18 +1951,21 @@ describe("ZNSSubRegistrar", () => { const parentBalAfter = await zns.meowToken.balanceOf(lvl2SubOwner.address); const childBalAfter = await zns.meowToken.balanceOf(lvl3SubOwner.address); - const contractBalAfter = await zns.meowToken.balanceOf(zns.treasury.address); + const contractBalAfter = await zns.meowToken.balanceOf(await zns.treasury.getAddress()); const zeroVaultBalanceAfter = await zns.meowToken.balanceOf(zeroVault.address); - expect(parentBalAfter.sub(parentBalBefore)).to.eq(0); - expect(childBalBefore.sub(childBalAfter)).to.eq(0); - expect(contractBalAfter.sub(contractBalBefore)).to.eq(0); - expect(zeroVaultBalanceAfter.sub(zeroVaultBalanceBefore)).to.eq(0); + expect(parentBalAfter - parentBalBefore).to.eq(0); + expect(childBalBefore - childBalAfter).to.eq(0); + expect(contractBalAfter - contractBalBefore).to.eq(0); + expect(zeroVaultBalanceAfter - zeroVaultBalanceBefore).to.eq(0); // validate transfer events are not happenning const latestBlock = await time.latestBlock(); const transferFilterToParent = zns.meowToken.filters.Transfer(lvl3SubOwner.address, lvl2SubOwner.address); - const transferFilterToTreasury = zns.meowToken.filters.Transfer(lvl3SubOwner.address, zns.treasury.address); + const transferFilterToTreasury = zns.meowToken.filters.Transfer( + lvl3SubOwner.address, + await zns.treasury.getAddress() + ); const transfersToParent = await zns.meowToken.queryFilter( transferFilterToParent, latestBlock - 3, @@ -1984,20 +1987,20 @@ describe("ZNSSubRegistrar", () => { // should NOT offer refund ! const parentBalAfterRevoke = await zns.meowToken.balanceOf(lvl2SubOwner.address); const childBalAfterRevoke = await zns.meowToken.balanceOf(lvl3SubOwner.address); - const contractBalAfterRevoke = await zns.meowToken.balanceOf(zns.treasury.address); + const contractBalAfterRevoke = await zns.meowToken.balanceOf(await zns.treasury.getAddress()); const zeroVaultBalanceAfterRevoke = await zns.meowToken.balanceOf(zeroVault.address); - expect(parentBalAfterRevoke.sub(parentBalAfter)).to.eq(0); - expect(childBalAfterRevoke.sub(childBalAfter)).to.eq(0); - expect(contractBalAfterRevoke.sub(contractBalAfter)).to.eq(0); - expect(zeroVaultBalanceAfterRevoke.sub(zeroVaultBalanceAfter)).to.eq(0); + expect(parentBalAfterRevoke - parentBalAfter).to.eq(0); + expect(childBalAfterRevoke - childBalAfter).to.eq(0); + expect(contractBalAfterRevoke - contractBalAfter).to.eq(0); + expect(zeroVaultBalanceAfterRevoke - zeroVaultBalanceAfter).to.eq(0); }); it("CurvePricer + DirectPayment with price = 0 - should NOT perform any transfers", async () => { const priceConfig = { ...DEFAULT_PRICE_CONFIG, - maxPrice: BigNumber.from(0), - minPrice: BigNumber.from(0), + maxPrice: BigInt(0), + minPrice: BigInt(0), }; const subdomainParentHash = await registrationWithSetup({ @@ -2007,19 +2010,19 @@ describe("ZNSSubRegistrar", () => { domainLabel: "zeropricead", fullConfig: { distrConfig: { - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), accessType: AccessType.OPEN, paymentType: PaymentType.DIRECT, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: lvl2SubOwner.address, }, priceConfig, }, }); - const contractBalBefore = await zns.meowToken.balanceOf(zns.treasury.address); + const contractBalBefore = await zns.meowToken.balanceOf(await zns.treasury.getAddress()); const parentBalBefore = await zns.meowToken.balanceOf(lvl2SubOwner.address); const childBalBefore = await zns.meowToken.balanceOf(lvl3SubOwner.address); const zeroVaultBalanceBefore = await zns.meowToken.balanceOf(zeroVault.address); @@ -2034,18 +2037,24 @@ describe("ZNSSubRegistrar", () => { const parentBalAfter = await zns.meowToken.balanceOf(lvl2SubOwner.address); const childBalAfter = await zns.meowToken.balanceOf(lvl3SubOwner.address); - const contractBalAfter = await zns.meowToken.balanceOf(zns.treasury.address); + const contractBalAfter = await zns.meowToken.balanceOf(await zns.treasury.getAddress()); const zeroVaultBalanceAfter = await zns.meowToken.balanceOf(zeroVault.address); - expect(parentBalAfter.sub(parentBalBefore)).to.eq(0); - expect(childBalBefore.sub(childBalAfter)).to.eq(0); - expect(contractBalAfter.sub(contractBalBefore)).to.eq(0); - expect(zeroVaultBalanceAfter.sub(zeroVaultBalanceBefore)).to.eq(0); + expect(parentBalAfter - parentBalBefore).to.eq(0); + expect(childBalBefore - childBalAfter).to.eq(0); + expect(contractBalAfter - contractBalBefore).to.eq(0); + expect(zeroVaultBalanceAfter - zeroVaultBalanceBefore).to.eq(0); // validate transfer events are not happenning const latestBlock = await time.latestBlock(); - const transferFilterToParent = zns.meowToken.filters.Transfer(lvl3SubOwner.address, lvl2SubOwner.address); - const transferFilterToTreasury = zns.meowToken.filters.Transfer(lvl3SubOwner.address, zns.treasury.address); + const transferFilterToParent = zns.meowToken.filters.Transfer( + lvl3SubOwner.address, + lvl2SubOwner.address + ); + const transferFilterToTreasury = zns.meowToken.filters.Transfer( + lvl3SubOwner.address, + await zns.treasury.getAddress() + ); const transfersToParent = await zns.meowToken.queryFilter( transferFilterToParent, latestBlock - 3, @@ -2067,20 +2076,20 @@ describe("ZNSSubRegistrar", () => { // should NOT offer refund ! const parentBalAfterRevoke = await zns.meowToken.balanceOf(lvl2SubOwner.address); const childBalAfterRevoke = await zns.meowToken.balanceOf(lvl3SubOwner.address); - const contractBalAfterRevoke = await zns.meowToken.balanceOf(zns.treasury.address); + const contractBalAfterRevoke = await zns.meowToken.balanceOf(await zns.treasury.getAddress()); const zeroVaultBalanceAfterRevoke = await zns.meowToken.balanceOf(zeroVault.address); - expect(parentBalAfterRevoke.sub(parentBalAfter)).to.eq(0); - expect(childBalAfterRevoke.sub(childBalAfter)).to.eq(0); - expect(contractBalAfterRevoke.sub(contractBalAfter)).to.eq(0); - expect(zeroVaultBalanceAfterRevoke.sub(zeroVaultBalanceAfter)).to.eq(0); + expect(parentBalAfterRevoke - parentBalAfter).to.eq(0); + expect(childBalAfterRevoke - childBalAfter).to.eq(0); + expect(contractBalAfterRevoke - contractBalAfter).to.eq(0); + expect(zeroVaultBalanceAfterRevoke - zeroVaultBalanceAfter).to.eq(0); }); it("CurvePricer + StakePayment with price = 0 - should NOT perform any transfers", async () => { const priceConfig = { ...DEFAULT_PRICE_CONFIG, - maxPrice: BigNumber.from(0), - minPrice: BigNumber.from(0), + maxPrice: BigInt(0), + minPrice: BigInt(0), }; const subdomainParentHash = await registrationWithSetup({ @@ -2090,19 +2099,19 @@ describe("ZNSSubRegistrar", () => { domainLabel: "zeropriceas", fullConfig: { distrConfig: { - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), accessType: AccessType.OPEN, paymentType: PaymentType.STAKE, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: lvl2SubOwner.address, }, priceConfig, }, }); - const contractBalBefore = await zns.meowToken.balanceOf(zns.treasury.address); + const contractBalBefore = await zns.meowToken.balanceOf(await zns.treasury.getAddress()); const parentBalBefore = await zns.meowToken.balanceOf(lvl2SubOwner.address); const childBalBefore = await zns.meowToken.balanceOf(lvl3SubOwner.address); const zeroVaultBalanceBefore = await zns.meowToken.balanceOf(zeroVault.address); @@ -2117,18 +2126,21 @@ describe("ZNSSubRegistrar", () => { const parentBalAfter = await zns.meowToken.balanceOf(lvl2SubOwner.address); const childBalAfter = await zns.meowToken.balanceOf(lvl3SubOwner.address); - const contractBalAfter = await zns.meowToken.balanceOf(zns.treasury.address); + const contractBalAfter = await zns.meowToken.balanceOf(await zns.treasury.getAddress()); const zeroVaultBalanceAfter = await zns.meowToken.balanceOf(zeroVault.address); - expect(parentBalAfter.sub(parentBalBefore)).to.eq(0); - expect(childBalBefore.sub(childBalAfter)).to.eq(0); - expect(contractBalAfter.sub(contractBalBefore)).to.eq(0); - expect(zeroVaultBalanceAfter.sub(zeroVaultBalanceBefore)).to.eq(0); + expect(parentBalAfter - parentBalBefore).to.eq(0); + expect(childBalBefore - childBalAfter).to.eq(0); + expect(contractBalAfter - contractBalBefore).to.eq(0); + expect(zeroVaultBalanceAfter - zeroVaultBalanceBefore).to.eq(0); // validate transfer events are not happenning const latestBlock = await time.latestBlock(); const transferFilterToParent = zns.meowToken.filters.Transfer(lvl3SubOwner.address, lvl2SubOwner.address); - const transferFilterToTreasury = zns.meowToken.filters.Transfer(lvl3SubOwner.address, zns.treasury.address); + const transferFilterToTreasury = zns.meowToken.filters.Transfer( + lvl3SubOwner.address, + await zns.treasury.getAddress() + ); const transfersToParent = await zns.meowToken.queryFilter( transferFilterToParent, latestBlock - 3, @@ -2150,21 +2162,21 @@ describe("ZNSSubRegistrar", () => { // should NOT offer refund ! const parentBalAfterRevoke = await zns.meowToken.balanceOf(lvl2SubOwner.address); const childBalAfterRevoke = await zns.meowToken.balanceOf(lvl3SubOwner.address); - const contractBalAfterRevoke = await zns.meowToken.balanceOf(zns.treasury.address); + const contractBalAfterRevoke = await zns.meowToken.balanceOf(await zns.treasury.getAddress()); const zeroVaultBalanceAfterRevoke = await zns.meowToken.balanceOf(zeroVault.address); - expect(parentBalAfterRevoke.sub(parentBalAfter)).to.eq(0); - expect(childBalAfterRevoke.sub(childBalAfter)).to.eq(0); - expect(contractBalAfterRevoke.sub(contractBalAfter)).to.eq(0); - expect(zeroVaultBalanceAfterRevoke.sub(zeroVaultBalanceAfter)).to.eq(0); + expect(parentBalAfterRevoke - parentBalAfter).to.eq(0); + expect(childBalAfterRevoke - childBalAfter).to.eq(0); + expect(contractBalAfterRevoke - contractBalAfter).to.eq(0); + expect(zeroVaultBalanceAfterRevoke - zeroVaultBalanceAfter).to.eq(0); }); it("FixedPricer + StakePayment with price = 0 - should NOT perform any transfers", async () => { const priceConfig = { - price: BigNumber.from(0), + price: BigInt(0), // we are trying to set a feePercentage, but that should still result to 0 fee // since fee is based on price - feePercentage: BigNumber.from(5), + feePercentage: BigInt(5), }; const subdomainParentHash = await registrationWithSetup({ @@ -2174,19 +2186,19 @@ describe("ZNSSubRegistrar", () => { domainLabel: "zeropricefs", fullConfig: { distrConfig: { - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), accessType: AccessType.OPEN, paymentType: PaymentType.STAKE, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: lvl2SubOwner.address, }, priceConfig, }, }); - const contractBalBefore = await zns.meowToken.balanceOf(zns.treasury.address); + const contractBalBefore = await zns.meowToken.balanceOf(await zns.treasury.getAddress()); const parentBalBefore = await zns.meowToken.balanceOf(lvl2SubOwner.address); const childBalBefore = await zns.meowToken.balanceOf(lvl3SubOwner.address); const zeroVaultBalanceBefore = await zns.meowToken.balanceOf(zeroVault.address); @@ -2201,18 +2213,21 @@ describe("ZNSSubRegistrar", () => { const parentBalAfter = await zns.meowToken.balanceOf(lvl2SubOwner.address); const childBalAfter = await zns.meowToken.balanceOf(lvl3SubOwner.address); - const contractBalAfter = await zns.meowToken.balanceOf(zns.treasury.address); + const contractBalAfter = await zns.meowToken.balanceOf(await zns.treasury.getAddress()); const zeroVaultBalanceAfter = await zns.meowToken.balanceOf(zeroVault.address); - expect(parentBalAfter.sub(parentBalBefore)).to.eq(0); - expect(childBalBefore.sub(childBalAfter)).to.eq(0); - expect(contractBalAfter.sub(contractBalBefore)).to.eq(0); - expect(zeroVaultBalanceAfter.sub(zeroVaultBalanceBefore)).to.eq(0); + expect(parentBalAfter - parentBalBefore).to.eq(0); + expect(childBalBefore - childBalAfter).to.eq(0); + expect(contractBalAfter - contractBalBefore).to.eq(0); + expect(zeroVaultBalanceAfter - zeroVaultBalanceBefore).to.eq(0); // validate transfer events are not happenning const latestBlock = await time.latestBlock(); const transferFilterToParent = zns.meowToken.filters.Transfer(lvl3SubOwner.address, lvl2SubOwner.address); - const transferFilterToTreasury = zns.meowToken.filters.Transfer(lvl3SubOwner.address, zns.treasury.address); + const transferFilterToTreasury = zns.meowToken.filters.Transfer( + lvl3SubOwner.address, + await zns.treasury.getAddress() + ); const transfersToParent = await zns.meowToken.queryFilter( transferFilterToParent, latestBlock - 3, @@ -2234,24 +2249,24 @@ describe("ZNSSubRegistrar", () => { // should NOT offer refund ! const parentBalAfterRevoke = await zns.meowToken.balanceOf(lvl2SubOwner.address); const childBalAfterRevoke = await zns.meowToken.balanceOf(lvl3SubOwner.address); - const contractBalAfterRevoke = await zns.meowToken.balanceOf(zns.treasury.address); + const contractBalAfterRevoke = await zns.meowToken.balanceOf(await zns.treasury.getAddress()); const zeroVaultBalanceAfterRevoke = await zns.meowToken.balanceOf(zeroVault.address); - expect(parentBalAfterRevoke.sub(parentBalAfter)).to.eq(0); - expect(childBalAfterRevoke.sub(childBalAfter)).to.eq(0); - expect(contractBalAfterRevoke.sub(contractBalAfter)).to.eq(0); - expect(zeroVaultBalanceAfterRevoke.sub(zeroVaultBalanceAfter)).to.eq(0); + expect(parentBalAfterRevoke - parentBalAfter).to.eq(0); + expect(childBalAfterRevoke - childBalAfter).to.eq(0); + expect(contractBalAfterRevoke - contractBalAfter).to.eq(0); + expect(zeroVaultBalanceAfterRevoke - zeroVaultBalanceAfter).to.eq(0); }); it("Setting price config in incorrect decimals triggers incorrect pricing", async () => { // we will use token with 5 decimals, but set prices in 18 decimals const priceConfigIncorrect = { - maxPrice: parseUnits("234.46", decimalValues.eighteen), - minPrice: parseUnits("3.37", decimalValues.eighteen), - maxLength: BigNumber.from(20), - baseLength: BigNumber.from(2), - precisionMultiplier: BigNumber.from(1), - feePercentage: BigNumber.from(111), + maxPrice: ethers.parseUnits("234.46", decimalValues.eighteen), + minPrice: ethers.parseUnits("3.37", decimalValues.eighteen), + maxLength: BigInt(20), + baseLength: BigInt(2), + precisionMultiplier: BigInt(1), + feePercentage: BigInt(111), isSet: true, }; @@ -2263,13 +2278,13 @@ describe("ZNSSubRegistrar", () => { domainLabel: "incorrectparent", fullConfig: { distrConfig: { - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), accessType: AccessType.OPEN, paymentType: PaymentType.STAKE, }, paymentConfig: { // ! this token has 5 decimals ! - token: token5.address, + token: await token5.getAddress(), beneficiary: lvl2SubOwner.address, }, priceConfig: priceConfigIncorrect, @@ -2280,8 +2295,8 @@ describe("ZNSSubRegistrar", () => { const priceConfigCorrect = { ...priceConfigIncorrect, - maxPrice: parseUnits("234.46", decimalValues.five), - minPrice: parseUnits("3.37", decimalValues.five), + maxPrice: ethers.parseUnits("234.46", decimalValues.five), + minPrice: ethers.parseUnits("3.37", decimalValues.five), }; // calc prices off-chain @@ -2289,13 +2304,13 @@ describe("ZNSSubRegistrar", () => { expectedPrice: priceIncorrect, stakeFee: stakeFeeIncorrect, } = getPriceObject(label, priceConfigIncorrect); - const protocolFeeIncorrect = getStakingOrProtocolFee(priceIncorrect.add(stakeFeeIncorrect)); + const protocolFeeIncorrect = getStakingOrProtocolFee(priceIncorrect + stakeFeeIncorrect); const { expectedPrice: priceCorrect, stakeFee: stakeFeeCorrect, } = getPriceObject(label, priceConfigCorrect); - const protocolFeeCorrect = getStakingOrProtocolFee(priceCorrect.add(stakeFeeCorrect)); + const protocolFeeCorrect = getStakingOrProtocolFee(priceCorrect + stakeFeeCorrect); // get prices from SC const { @@ -2307,8 +2322,8 @@ describe("ZNSSubRegistrar", () => { true ); const protocolFeeFromSC = await zns.curvePricer.getFeeForPrice( - ethers.constants.HashZero, - priceFromSC.add(feeFromSC) + ethers.ZeroHash, + priceFromSC + feeFromSC ); expect(priceFromSC).to.not.eq(priceCorrect); @@ -2318,10 +2333,10 @@ describe("ZNSSubRegistrar", () => { expect(protocolFeeFromSC).to.not.eq(protocolFeeCorrect); expect(protocolFeeFromSC).to.eq(protocolFeeIncorrect); - const priceDiff = priceIncorrect.sub(priceCorrect); + const priceDiff = priceIncorrect - priceCorrect; // the difference should be very large expect(priceDiff).to.be.gt( - BigNumber.from(10).pow(decimalValues.eighteen) + BigInt(10) ** decimalValues.eighteen ); // let's see how much a user actually paid @@ -2329,13 +2344,13 @@ describe("ZNSSubRegistrar", () => { // we sending him 10^20 tokens await token5.connect(deployer).transfer( lvl3SubOwner.address, - parseUnits("10000000000000000000", decimalValues.five) + ethers.parseUnits("10000000000000000000", decimalValues.five) ); // client tx approving the correct price will fail await token5.connect(lvl3SubOwner).approve( - zns.treasury.address, - priceCorrect.add(stakeFeeCorrect).add(protocolFeeCorrect) + await zns.treasury.getAddress(), + priceCorrect + stakeFeeCorrect + protocolFeeCorrect ); await expect( @@ -2362,17 +2377,17 @@ describe("ZNSSubRegistrar", () => { const userBalanceAfter = await token5.balanceOf(lvl3SubOwner.address); // user should have paid the incorrect price - expect(userBalanceBefore.sub(userBalanceAfter)).to.eq( - priceIncorrect.add(stakeFeeIncorrect).add(protocolFeeIncorrect) + expect(userBalanceBefore - userBalanceAfter).to.eq( + priceIncorrect + stakeFeeIncorrect + protocolFeeIncorrect ); }); }); describe("Registration access", () => { - let fixedPrice : BigNumber; + let fixedPrice : bigint; let domainConfigs : Array; let regResults : Array; - let fixedFeePercentage : BigNumber; + let fixedFeePercentage : bigint; before(async () => { [ @@ -2397,8 +2412,8 @@ describe("ZNSSubRegistrar", () => { zeroVaultAddress: zeroVault.address, }); - fixedPrice = ethers.utils.parseEther("397"); - fixedFeePercentage = BigNumber.from(200); + fixedPrice = ethers.parseEther("397"); + fixedFeePercentage = BigInt(200); await Promise.all( [ @@ -2409,9 +2424,9 @@ describe("ZNSSubRegistrar", () => { lvl5SubOwner, lvl6SubOwner, ].map(async ({ address }) => - zns.meowToken.mint(address, ethers.utils.parseEther("1000000"))) + zns.meowToken.mint(address, ethers.parseEther("1000000"))) ); - await zns.meowToken.connect(rootOwner).approve(zns.treasury.address, ethers.constants.MaxUint256); + await zns.meowToken.connect(rootOwner).approve(await zns.treasury.getAddress(), ethers.MaxUint256); // register root domain and 1 subdomain domainConfigs = [ @@ -2420,12 +2435,12 @@ describe("ZNSSubRegistrar", () => { domainLabel: "root", fullConfig: { distrConfig: { - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.DIRECT, accessType: AccessType.OPEN, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: rootOwner.address, }, priceConfig: { price: fixedPrice, feePercentage: fixedFeePercentage }, @@ -2436,12 +2451,12 @@ describe("ZNSSubRegistrar", () => { domainLabel: "levelone", fullConfig: { distrConfig: { - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.DIRECT, accessType: AccessType.OPEN, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: lvl2SubOwner.address, }, priceConfig: { price: fixedPrice, feePercentage: fixedFeePercentage }, @@ -2483,15 +2498,15 @@ describe("ZNSSubRegistrar", () => { const balAfter = await zns.meowToken.balanceOf(lvl2SubOwner.address); // the diff is 0 because user should not pay himself - expect(balAfter.sub(balBefore)).to.eq(0); + expect(balAfter - balBefore).to.eq(0); // check registry const dataFromReg = await zns.registry.getDomainRecord(hash); expect(dataFromReg.owner).to.eq(lvl2SubOwner.address); - expect(dataFromReg.resolver).to.eq(zns.addressResolver.address); + expect(dataFromReg.resolver).to.eq(await zns.addressResolver.getAddress()); // check domain token - const tokenId = BigNumber.from(hash).toString(); + const tokenId = BigInt(hash).toString(); const tokenOwner = await zns.domainToken.ownerOf(tokenId); expect(tokenOwner).to.eq(lvl2SubOwner.address); @@ -2523,7 +2538,7 @@ describe("ZNSSubRegistrar", () => { zns.subRegistrar.connect(lvl5SubOwner).registerSubdomain( res[0].domainHash, "tobedenied", - ethers.constants.AddressZero, + ethers.ZeroAddress, DEFAULT_TOKEN_URI, distrConfigEmpty, paymentConfigEmpty, @@ -2547,14 +2562,14 @@ describe("ZNSSubRegistrar", () => { const protocolFee = getStakingOrProtocolFee(expectedPrice); // approve direct payment await zns.meowToken.connect(lvl5SubOwner).approve( - zns.treasury.address, - expectedPrice.add(protocolFee) + await zns.treasury.getAddress(), + expectedPrice + protocolFee ); await zns.subRegistrar.connect(lvl5SubOwner).registerSubdomain( parentHash, domainLabel, - ethers.constants.AddressZero, + ethers.ZeroAddress, DEFAULT_TOKEN_URI, distrConfigEmpty, paymentConfigEmpty, @@ -2568,10 +2583,10 @@ describe("ZNSSubRegistrar", () => { // check registry const dataFromReg = await zns.registry.getDomainRecord(hash); expect(dataFromReg.owner).to.eq(lvl5SubOwner.address); - expect(dataFromReg.resolver).to.eq(ethers.constants.AddressZero); + expect(dataFromReg.resolver).to.eq(ethers.ZeroAddress); // check domain token - const tokenId = BigNumber.from(hash).toString(); + const tokenId = BigInt(hash).toString(); const tokenOwner = await zns.domainToken.ownerOf(tokenId); expect(tokenOwner).to.eq(lvl5SubOwner.address); }); @@ -2579,7 +2594,7 @@ describe("ZNSSubRegistrar", () => { // eslint-disable-next-line max-len it("should ONLY allow mintlisted addresses and NOT allow other ones to register a domain when parent's accessType is MINTLIST", async () => { // approve direct payment - await zns.meowToken.connect(lvl3SubOwner).approve(zns.treasury.address, fixedPrice); + await zns.meowToken.connect(lvl3SubOwner).approve(await zns.treasury.getAddress(), fixedPrice); // register parent with mintlisted access const parentHash = await registrationWithSetup({ zns, @@ -2588,12 +2603,12 @@ describe("ZNSSubRegistrar", () => { domainLabel: "mintlistparent", fullConfig: { distrConfig: { - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.DIRECT, accessType: AccessType.MINTLIST, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: lvl3SubOwner.address, }, priceConfig: { price: fixedPrice, feePercentage: fixedFeePercentage }, @@ -2618,10 +2633,10 @@ describe("ZNSSubRegistrar", () => { // check registry const dataFromReg = await zns.registry.getDomainRecord(hash); expect(dataFromReg.owner).to.eq(lvl4SubOwner.address); - expect(dataFromReg.resolver).to.eq(zns.addressResolver.address); + expect(dataFromReg.resolver).to.eq(await zns.addressResolver.getAddress()); // check domain token - const tokenId = BigNumber.from(hash).toString(); + const tokenId = BigInt(hash).toString(); const tokenOwner = await zns.domainToken.ownerOf(tokenId); expect(tokenOwner).to.eq(lvl4SubOwner.address); @@ -2630,7 +2645,7 @@ describe("ZNSSubRegistrar", () => { zns.subRegistrar.connect(lvl5SubOwner).registerSubdomain( parentHash, "notmintlisted", - ethers.constants.AddressZero, + ethers.ZeroAddress, DEFAULT_TOKEN_URI, distrConfigEmpty, paymentConfigEmpty, @@ -2651,7 +2666,7 @@ describe("ZNSSubRegistrar", () => { zns.subRegistrar.connect(lvl4SubOwner).registerSubdomain( parentHash, "notmintlistednow", - ethers.constants.AddressZero, + ethers.ZeroAddress, DEFAULT_TOKEN_URI, distrConfigEmpty, paymentConfigEmpty, @@ -2747,7 +2762,7 @@ describe("ZNSSubRegistrar", () => { zns.subRegistrar.connect(lvl5SubOwner).registerSubdomain( regResults[1].domainHash, "notallowed", - ethers.constants.AddressZero, + ethers.ZeroAddress, DEFAULT_TOKEN_URI, distrConfigEmpty, paymentConfigEmpty, @@ -2780,20 +2795,20 @@ describe("ZNSSubRegistrar", () => { domainConfigs[1].fullConfig.priceConfig ); const paymentToParent = domainConfigs[1].fullConfig.distrConfig.paymentType === PaymentType.STAKE - ? expectedPrice.add(stakeFee) + ? expectedPrice + stakeFee : expectedPrice; const protocolFee = getStakingOrProtocolFee(paymentToParent); await zns.meowToken.connect(lvl5SubOwner).approve( - zns.treasury.address, - paymentToParent.add(protocolFee) + await zns.treasury.getAddress(), + paymentToParent + protocolFee ); // register await zns.subRegistrar.connect(lvl5SubOwner).registerSubdomain( regResults[1].domainHash, "alloweddddd", - ethers.constants.AddressZero, + ethers.ZeroAddress, DEFAULT_TOKEN_URI, distrConfigEmpty, paymentConfigEmpty, @@ -2829,7 +2844,7 @@ describe("ZNSSubRegistrar", () => { zns.subRegistrar.connect(lvl4SubOwner).registerSubdomain( parentHash, "notallowed", - ethers.constants.AddressZero, + ethers.ZeroAddress, DEFAULT_TOKEN_URI, distrConfigEmpty, paymentConfigEmpty, @@ -2841,10 +2856,10 @@ describe("ZNSSubRegistrar", () => { }); describe("Existing subdomain ops", () => { - let fixedPrice : BigNumber; + let fixedPrice : bigint; let domainConfigs : Array; let regResults : Array; - let fixedFeePercentage : BigNumber; + let fixedFeePercentage : bigint; before(async () => { [ @@ -2869,8 +2884,8 @@ describe("ZNSSubRegistrar", () => { zeroVaultAddress: zeroVault.address, }); - fixedPrice = ethers.utils.parseEther("397"); - fixedFeePercentage = BigNumber.from(200); + fixedPrice = ethers.parseEther("397"); + fixedFeePercentage = BigInt(200); await Promise.all( [ @@ -2881,9 +2896,9 @@ describe("ZNSSubRegistrar", () => { lvl5SubOwner, lvl6SubOwner, ].map(async ({ address }) => - zns.meowToken.mint(address, ethers.utils.parseEther("1000000"))) + zns.meowToken.mint(address, ethers.parseEther("1000000"))) ); - await zns.meowToken.connect(rootOwner).approve(zns.treasury.address, ethers.constants.MaxUint256); + await zns.meowToken.connect(rootOwner).approve(await zns.treasury.getAddress(), ethers.MaxUint256); // register root domain and 1 subdomain domainConfigs = [ @@ -2892,12 +2907,12 @@ describe("ZNSSubRegistrar", () => { domainLabel: "root", fullConfig: { distrConfig: { - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.STAKE, accessType: AccessType.OPEN, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: rootOwner.address, }, priceConfig: { price: fixedPrice, feePercentage: fixedFeePercentage }, @@ -2909,12 +2924,12 @@ describe("ZNSSubRegistrar", () => { tokenURI: "http://example.com/leveltwo", fullConfig: { distrConfig: { - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.DIRECT, accessType: AccessType.OPEN, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: lvl2SubOwner.address, }, priceConfig: { price: fixedPrice, feePercentage: fixedFeePercentage }, @@ -2926,12 +2941,12 @@ describe("ZNSSubRegistrar", () => { tokenURI: "http://example.com/lvlthree", fullConfig: { distrConfig: { - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), paymentType: PaymentType.DIRECT, accessType: AccessType.OPEN, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: lvl3SubOwner.address, }, priceConfig: DEFAULT_PRICE_CONFIG, @@ -3009,17 +3024,17 @@ describe("ZNSSubRegistrar", () => { it("should allow to UPDATE domain data for subdomain", async () => { const dataFromReg = await zns.registry.getDomainRecord(regResults[1].domainHash); expect(dataFromReg.owner).to.eq(lvl2SubOwner.address); - expect(dataFromReg.resolver).to.eq(zns.addressResolver.address); + expect(dataFromReg.resolver).to.eq(await zns.addressResolver.getAddress()); await zns.registry.connect(lvl2SubOwner).updateDomainRecord( regResults[1].domainHash, lvl3SubOwner.address, - ethers.constants.AddressZero, + ethers.ZeroAddress, ); const dataFromRegAfter = await zns.registry.getDomainRecord(regResults[1].domainHash); expect(dataFromRegAfter.owner).to.eq(lvl3SubOwner.address); - expect(dataFromRegAfter.resolver).to.eq(ethers.constants.AddressZero); + expect(dataFromRegAfter.resolver).to.eq(ethers.ZeroAddress); // reclaim to switch ownership back to original owner await zns.rootRegistrar.connect(lvl2SubOwner).reclaimDomain( @@ -3028,7 +3043,7 @@ describe("ZNSSubRegistrar", () => { const dataFromRegAfterReclaim = await zns.registry.getDomainRecord(regResults[1].domainHash); expect(dataFromRegAfterReclaim.owner).to.eq(lvl2SubOwner.address); - expect(dataFromRegAfterReclaim.resolver).to.eq(ethers.constants.AddressZero); + expect(dataFromRegAfterReclaim.resolver).to.eq(ethers.ZeroAddress); }); describe("#setDistributionConfigForDomain()", () => { @@ -3037,7 +3052,7 @@ describe("ZNSSubRegistrar", () => { const distrConfigBefore = await zns.subRegistrar.distrConfigs(domainHash); expect(distrConfigBefore.accessType).to.not.eq(AccessType.MINTLIST); - expect(distrConfigBefore.pricerContract).to.not.eq(zns.fixedPricer.address); + expect(distrConfigBefore.pricerContract).to.not.eq(await zns.fixedPricer.getAddress()); expect( distrConfigBefore.paymentType ).to.not.eq( @@ -3045,7 +3060,7 @@ describe("ZNSSubRegistrar", () => { ); const newConfig = { - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.STAKE, accessType: AccessType.MINTLIST, }; @@ -3091,7 +3106,7 @@ describe("ZNSSubRegistrar", () => { const domainHash = regResults[1].domainHash; const newConfig = { - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), paymentType: PaymentType.STAKE, accessType: AccessType.MINTLIST, }; @@ -3110,7 +3125,7 @@ describe("ZNSSubRegistrar", () => { const domainHash = regResults[2].domainHash; const newConfig = { - pricerContract: ethers.constants.AddressZero, + pricerContract: ethers.ZeroAddress, paymentType: PaymentType.STAKE, accessType: AccessType.MINTLIST, }; @@ -3135,11 +3150,11 @@ describe("ZNSSubRegistrar", () => { await zns.subRegistrar.connect(lvl3SubOwner).setPricerContractForDomain( domainHash, - zns.curvePricer.address, + await zns.curvePricer.getAddress(), ); const pricerContractAfter = await zns.subRegistrar.distrConfigs(domainHash); - expect(pricerContractAfter.pricerContract).to.eq(zns.curvePricer.address); + expect(pricerContractAfter.pricerContract).to.eq(await zns.curvePricer.getAddress()); // reset it back await zns.subRegistrar.connect(lvl3SubOwner).setPricerContractForDomain( @@ -3154,7 +3169,7 @@ describe("ZNSSubRegistrar", () => { await expect( zns.subRegistrar.connect(lvl2SubOwner).setPricerContractForDomain( domainHash, - zns.curvePricer.address, + await zns.curvePricer.getAddress(), ) ).to.be.revertedWith( "ZNSSubRegistrar: Not authorized" @@ -3167,7 +3182,7 @@ describe("ZNSSubRegistrar", () => { await expect( zns.subRegistrar.connect(lvl3SubOwner).setPricerContractForDomain( domainHash, - ethers.constants.AddressZero, + ethers.ZeroAddress, ) ).to.be.revertedWith( "ZNSSubRegistrar: pricerContract can not be 0x0 address" @@ -3233,7 +3248,7 @@ describe("ZNSSubRegistrar", () => { // eslint-disable-next-line max-len it("should TRANSFER ownership of a subdomain and let the receiver RECLAIM and then revoke with REFUND", async () => { - const tokenId = BigNumber.from(regResults[1].domainHash).toString(); + const tokenId = BigInt(regResults[1].domainHash).toString(); const { amount: stakedBefore } = await zns.treasury.stakedForDomain(regResults[1].domainHash); @@ -3273,7 +3288,7 @@ describe("ZNSSubRegistrar", () => { // verify that refund has been acquired by the new owner const userBalAfter = await zns.meowToken.balanceOf(lvl3SubOwner.address); - expect(userBalAfter.sub(userBalbefore)).to.eq(fixedPrice); + expect(userBalAfter - userBalbefore).to.eq(fixedPrice); }); }); @@ -3294,8 +3309,8 @@ describe("ZNSSubRegistrar", () => { it("Should NOT let initialize the implementation contract", async () => { const factory = new ZNSSubRegistrar__factory(deployer); - const impl = await getProxyImplAddress(zns.subRegistrar.address); - const implContract = factory.attach(impl); + const impl = await getProxyImplAddress(await zns.subRegistrar.getAddress()); + const implContract = factory.attach(impl) as ZNSSubRegistrar; await expect( implContract.initialize( @@ -3324,7 +3339,7 @@ describe("ZNSSubRegistrar", () => { it("#setRootRegistrar should NOT set registrar as 0x0 address", async () => { await expect( - zns.subRegistrar.connect(admin).setRootRegistrar(ethers.constants.AddressZero), + zns.subRegistrar.connect(admin).setRootRegistrar(ethers.ZeroAddress), ).to.be.revertedWith( "ZNSSubRegistrar: _registrar can not be 0x0 address", ); @@ -3357,7 +3372,7 @@ describe("ZNSSubRegistrar", () => { it("#getAccessController() should return the correct access controller", async () => { expect( await zns.subRegistrar.getAccessController() - ).to.equal(zns.accessController.address); + ).to.equal(await zns.accessController.getAddress()); }); // eslint-disable-next-line max-len @@ -3371,7 +3386,7 @@ describe("ZNSSubRegistrar", () => { }); describe("UUPS", () => { - let fixedPrice : BigNumber; + let fixedPrice : bigint; let rootHash : string; beforeEach(async () => { @@ -3398,11 +3413,11 @@ describe("ZNSSubRegistrar", () => { rootOwner, lvl2SubOwner, ].map(async ({ address }) => - zns.meowToken.mint(address, ethers.utils.parseEther("1000000"))) + zns.meowToken.mint(address, ethers.parseEther("1000000"))) ); - await zns.meowToken.connect(rootOwner).approve(zns.treasury.address, ethers.constants.MaxUint256); + await zns.meowToken.connect(rootOwner).approve(await zns.treasury.getAddress(), ethers.MaxUint256); - fixedPrice = ethers.utils.parseEther("397.13"); + fixedPrice = ethers.parseEther("397.13"); // register root domain rootHash = await registrationWithSetup({ zns, @@ -3411,16 +3426,16 @@ describe("ZNSSubRegistrar", () => { fullConfig: { distrConfig: { accessType: AccessType.OPEN, - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.DIRECT, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: rootOwner.address, }, priceConfig: { price: fixedPrice, - feePercentage: BigNumber.from(0), + feePercentage: BigInt(0), }, }, }); @@ -3430,19 +3445,19 @@ describe("ZNSSubRegistrar", () => { // SubRegistrar to upgrade to const factory = new ZNSSubRegistrarUpgradeMock__factory(deployer); const newRegistrar = await factory.deploy(); - await newRegistrar.deployed(); + await newRegistrar.waitForDeployment(); // Confirm the deployer is a governor, as set in `deployZNS` helper await expect(zns.accessController.checkGovernor(deployer.address)).to.not.be.reverted; - const tx = zns.subRegistrar.connect(deployer).upgradeTo(newRegistrar.address); + const tx = zns.subRegistrar.connect(deployer).upgradeTo(await newRegistrar.getAddress()); await expect(tx).to.not.be.reverted; await expect( zns.subRegistrar.connect(deployer).initialize( - zns.accessController.address, - zns.registry.address, - zns.rootRegistrar.address, + await zns.accessController.getAddress(), + await zns.registry.getAddress(), + await zns.rootRegistrar.getAddress(), ) ).to.be.revertedWith(INITIALIZED_ERR); }); @@ -3451,12 +3466,12 @@ describe("ZNSSubRegistrar", () => { // SubRegistrar to upgrade to const factory = new ZNSSubRegistrarUpgradeMock__factory(deployer); const newRegistrar = await factory.deploy(); - await newRegistrar.deployed(); + await newRegistrar.waitForDeployment(); // Confirm the account is not a governor await expect(zns.accessController.checkGovernor(lvl2SubOwner.address)).to.be.reverted; - const tx = zns.subRegistrar.connect(lvl2SubOwner).upgradeTo(newRegistrar.address); + const tx = zns.subRegistrar.connect(lvl2SubOwner).upgradeTo(await newRegistrar.getAddress()); await expect(tx).to.be.revertedWith( getAccessRevertMsg(lvl2SubOwner.address, GOVERNOR_ROLE) @@ -3469,12 +3484,12 @@ describe("ZNSSubRegistrar", () => { const registrarFactory = new ZNSSubRegistrarUpgradeMock__factory(deployer); const registrar = await registrarFactory.deploy(); - await registrar.deployed(); + await registrar.waitForDeployment(); const domainLabel = "world"; - await zns.meowToken.connect(lvl2SubOwner).approve(zns.treasury.address, ethers.constants.MaxUint256); - await zns.meowToken.mint(lvl2SubOwner.address, parseEther("1000000")); + await zns.meowToken.connect(lvl2SubOwner).approve(await zns.treasury.getAddress(), ethers.MaxUint256); + await zns.meowToken.mint(lvl2SubOwner.address, ethers.parseEther("1000000")); const domainHash = await registrationWithSetup({ zns, @@ -3484,15 +3499,15 @@ describe("ZNSSubRegistrar", () => { fullConfig: { distrConfig: { accessType: AccessType.OPEN, - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.DIRECT, }, priceConfig: { price: fixedPrice, - feePercentage: BigNumber.from(0), + feePercentage: BigInt(0), }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: lvl2SubOwner.address, }, }, @@ -3518,29 +3533,29 @@ describe("ZNSSubRegistrar", () => { // SubRegistrar to upgrade to const factory = new ZNSSubRegistrarUpgradeMock__factory(deployer); const newRegistrar = await factory.deploy(); - await newRegistrar.deployed(); + await newRegistrar.waitForDeployment(); - const tx = zns.subRegistrar.connect(deployer).upgradeTo(newRegistrar.address); + const tx = zns.subRegistrar.connect(deployer).upgradeTo(await newRegistrar.getAddress()); await expect(tx).to.not.be.reverted; // create new proxy object - const newRegistrarProxy = factory.attach(zns.subRegistrar.address); + const newRegistrarProxy = factory.attach(await zns.subRegistrar.getAddress()) as ZNSSubRegistrarUpgradeMock; // check values in storage const rootConfigBefore = await newRegistrarProxy.distrConfigs(rootHash); expect(rootConfigBefore.accessType).to.eq(AccessType.OPEN); - expect(rootConfigBefore.pricerContract).to.eq(zns.fixedPricer.address); + expect(rootConfigBefore.pricerContract).to.eq(await zns.fixedPricer.getAddress()); expect(rootConfigBefore.paymentType).to.eq(PaymentType.DIRECT); - await zns.meowToken.mint(lvl2SubOwner.address, parseEther("1000000")); - await zns.meowToken.connect(lvl2SubOwner).approve(zns.treasury.address, parseEther("1000000")); + await zns.meowToken.mint(lvl2SubOwner.address, ethers.parseEther("1000000")); + await zns.meowToken.connect(lvl2SubOwner).approve(await zns.treasury.getAddress(), ethers.parseEther("1000000")); const subConfigToSet = { accessType: AccessType.MINTLIST, - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), paymentType: PaymentType.STAKE, newAddress: lvl2SubOwner.address, - newUint: BigNumber.from(1912171236), + newUint: BigInt(1912171236), }; // register a subdomain with new logic @@ -3566,10 +3581,10 @@ describe("ZNSSubRegistrar", () => { const updatedStructConfig = { accessType: AccessType.OPEN, - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.DIRECT, newAddress: lvl2SubOwner.address, - newUint: BigNumber.from(123), + newUint: BigInt(123), }; // try setting new fields to the new struct @@ -3597,9 +3612,9 @@ describe("ZNSSubRegistrar", () => { expect(rootConfigFinal.newUint).to.eq(updatedStructConfig.newUint); // check that crucial state vars stayed the same - expect(await newRegistrarProxy.getAccessController()).to.eq(zns.accessController.address); - expect(await newRegistrarProxy.registry()).to.eq(zns.registry.address); - expect(await newRegistrarProxy.rootRegistrar()).to.eq(zns.rootRegistrar.address); + expect(await newRegistrarProxy.getAccessController()).to.eq(await zns.accessController.getAddress()); + expect(await newRegistrarProxy.registry()).to.eq(await zns.registry.getAddress()); + expect(await newRegistrarProxy.rootRegistrar()).to.eq(await zns.rootRegistrar.getAddress()); }); }); }); diff --git a/test/ZNSTreasury.test.ts b/test/ZNSTreasury.test.ts index 673953a37..a223487dd 100644 --- a/test/ZNSTreasury.test.ts +++ b/test/ZNSTreasury.test.ts @@ -1,6 +1,6 @@ import * as hre from "hardhat"; import { expect } from "chai"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { checkBalance, DEFAULT_TOKEN_URI, deployTreasury, deployZNS, @@ -10,15 +10,14 @@ import { NOT_AUTHORIZED_REG_WIRED_ERR, INITIALIZED_ERR, DEFAULT_PRICE_CONFIG, - validateUpgrade, + validateUpgrade, NOT_AUTHORIZED_TREASURY_ERR, } from "./helpers"; import { DeployZNSParams, IZNSContracts } from "./helpers/types"; import * as ethers from "ethers"; import { hashDomainLabel, hashSubdomainName } from "./helpers/hashing"; import { ADMIN_ROLE, REGISTRAR_ROLE, GOVERNOR_ROLE } from "../src/deploy/constants"; -import { NOT_AUTHORIZED_TREASURY_ERR, getAccessRevertMsg } from "./helpers/errors"; -import { ZNSTreasury__factory, ZNSTreasuryUpgradeMock__factory } from "../typechain"; -import { parseEther } from "ethers/lib/utils"; +import { getAccessRevertMsg } from "./helpers/errors"; +import { ZNSTreasury, ZNSTreasury__factory, ZNSTreasuryUpgradeMock__factory } from "../typechain"; import { getProxyImplAddress } from "./helpers/utils"; require("@nomicfoundation/hardhat-chai-matchers"); @@ -36,6 +35,10 @@ describe("ZNSTreasury", () => { const domainName = "wilderrr"; const domainHash = hashDomainLabel(domainName); + let paymentConfig : { + token : string; + beneficiary : string; + }; beforeEach(async () => { [ @@ -57,8 +60,8 @@ describe("ZNSTreasury", () => { zns = await deployZNS(params); - const paymentConfig = { - token: zns.meowToken.address, + paymentConfig = { + token: await zns.meowToken.getAddress(), beneficiary: user.address, }; @@ -66,8 +69,8 @@ describe("ZNSTreasury", () => { await zns.accessController.connect(admin).grantRole(REGISTRAR_ROLE, mockRegistrar.address); // Give funds to user - await zns.meowToken.connect(user).approve(zns.treasury.address, ethers.constants.MaxUint256); - await zns.meowToken.mint(user.address, ethers.utils.parseEther("50000")); + await zns.meowToken.connect(user).approve(await zns.treasury.getAddress(), ethers.MaxUint256); + await zns.meowToken.mint(user.address, ethers.parseEther("50000")); // register random domain await zns.rootRegistrar.connect(user).registerRootDomain( @@ -84,36 +87,36 @@ describe("ZNSTreasury", () => { const { token, beneficiary, - } = await zns.treasury.paymentConfigs(ethers.constants.HashZero); + } = await zns.treasury.paymentConfigs(ethers.ZeroHash); const accessController = await zns.treasury.getAccessController(); - expect(registry).to.eq(zns.registry.address); - expect(token).to.eq(zns.meowToken.address); + expect(registry).to.eq(await zns.registry.getAddress()); + expect(token).to.eq(await zns.meowToken.getAddress()); expect(beneficiary).to.eq(zns.zeroVaultAddress); - expect(accessController).to.eq(zns.accessController.address); + expect(accessController).to.eq(await zns.accessController.getAddress()); }); it("should NOT initialize twice", async () => { const tx = zns.treasury.initialize( - zns.registry.address, - zns.meowToken.address, + await zns.registry.getAddress(), + await zns.meowToken.getAddress(), zns.zeroVaultAddress, - zns.accessController.address + await zns.accessController.getAddress() ); await expect(tx).to.be.revertedWith("Initializable: contract is already initialized"); }); it("Should NOT let initialize the implementation contract", async () => { const factory = new ZNSTreasury__factory(deployer); - const impl = await getProxyImplAddress(zns.treasury.address); - const implContract = factory.attach(impl); + const impl = await getProxyImplAddress(await zns.treasury.getAddress()); + const implContract = factory.attach(impl) as ZNSTreasury; await expect( implContract.initialize( - zns.registry.address, - zns.meowToken.address, + await zns.registry.getAddress(), + await zns.meowToken.getAddress(), zns.zeroVaultAddress, - zns.accessController.address + await zns.accessController.getAddress() ) ).to.be.revertedWith(INITIALIZED_ERR); }); @@ -121,9 +124,9 @@ describe("ZNSTreasury", () => { it("should NOT deploy/initialize with 0x0 addresses as args", async () => { const args = { deployer, - accessControllerAddress: zns.accessController.address, - registryAddress: zns.registry.address, - zTokenMockAddress: zns.meowToken.address, + accessControllerAddress: await zns.accessController.getAddress(), + registryAddress: await zns.registry.getAddress(), + zTokenMockAddress: await zns.meowToken.getAddress(), zeroVaultAddress: zns.zeroVaultAddress, isTenderlyRun: false, }; @@ -136,7 +139,7 @@ describe("ZNSTreasury", () => { await expect( deployTreasury({ ...args, - [key]: ethers.constants.AddressZero, + [key]: ethers.ZeroAddress, }) ).to.be.reverted; } @@ -150,14 +153,14 @@ describe("ZNSTreasury", () => { const zeroVaultBalanceBeforeStake = await zns.meowToken.balanceOf(zeroVault.address); const expectedStake = await zns.curvePricer.getPrice( - ethers.constants.HashZero, + ethers.ZeroHash, domainName, false ); - const fee = await zns.curvePricer.getFeeForPrice(ethers.constants.HashZero, expectedStake); + const fee = await zns.curvePricer.getFeeForPrice(ethers.ZeroHash, expectedStake); await zns.treasury.connect(mockRegistrar).stakeForDomain( - ethers.constants.HashZero, + ethers.ZeroHash, domainHash, user.address, expectedStake, @@ -172,23 +175,23 @@ describe("ZNSTreasury", () => { token: zns.meowToken, balanceBefore: balanceBeforeStake, userAddress: user.address, - target: stake.add(fee), + target: stake + fee, shouldDecrease: true, }); const zeroVaultBalanceAfterStake = await zns.meowToken.balanceOf(zeroVault.address); - expect(zeroVaultBalanceAfterStake).to.eq(zeroVaultBalanceBeforeStake.add(fee)); + expect(zeroVaultBalanceAfterStake).to.eq(zeroVaultBalanceBeforeStake + fee); }); it("Should revert if called from an address without REGISTRAR_ROLE", async () => { await expect( zns.treasury.connect(randomAcc).stakeForDomain( - ethers.constants.HashZero, + ethers.ZeroHash, domainHash, user.address, - ethers.constants.Zero, - ethers.constants.Zero, - ethers.constants.Zero + BigInt(0), + BigInt(0), + BigInt(0) ) ).to.be.revertedWith( getAccessRevertMsg(randomAcc.address, REGISTRAR_ROLE) @@ -205,23 +208,23 @@ describe("ZNSTreasury", () => { ); const tx = zns.treasury.connect(mockRegistrar).stakeForDomain( - ethers.constants.HashZero, + ethers.ZeroHash, domainHash, user.address, expectedPrice, - ethers.constants.Zero, + BigInt(0), protocolFee ); await expect(tx) .to.emit(zns.treasury, "StakeDeposited") .withArgs( - ethers.constants.HashZero, + ethers.ZeroHash, domainHash, user.address, - zns.meowToken.address, + await zns.meowToken.getAddress(), expectedPrice, - ethers.constants.Zero, + BigInt(0), protocolFee ); }); @@ -229,15 +232,15 @@ describe("ZNSTreasury", () => { describe("#unstakeForDomain()", () => { it("Unstakes the correct amount and saves the correct token", async () => { - const stakeAmt = ethers.utils.parseEther("173"); - const protocolFee = ethers.utils.parseEther("3.112"); + const stakeAmt = ethers.parseEther("173"); + const protocolFee = ethers.parseEther("3.112"); await zns.treasury.connect(mockRegistrar).stakeForDomain( - ethers.constants.HashZero, + ethers.ZeroHash, domainHash, user.address, stakeAmt, - ethers.constants.Zero, + BigInt(0), protocolFee ); @@ -253,7 +256,7 @@ describe("ZNSTreasury", () => { target: stake, shouldDecrease: false, }); - expect(token).to.eq(zns.meowToken.address); + expect(token).to.eq(await zns.meowToken.getAddress()); }); it("Should revert if called from an address without REGISTRAR_ROLE", async () => { @@ -272,14 +275,14 @@ describe("ZNSTreasury", () => { it("should process payment correctly with paymentConfig set", async () => { const randomHash = hashDomainLabel("randommmmmmmm2342342"); const config = { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: user.address, }; await zns.registry.connect(mockRegistrar).createDomainRecord( randomHash, user.address, - ethers.constants.AddressZero, + ethers.ZeroAddress, ); await zns.treasury.connect(user).setPaymentConfig( @@ -287,11 +290,11 @@ describe("ZNSTreasury", () => { config ); - const paymentAmt = parseEther("1000"); - const protocolFee = parseEther("10"); + const paymentAmt = ethers.parseEther("1000"); + const protocolFee = ethers.parseEther("10"); // give tokens to mock registrar - await zns.meowToken.connect(user).transfer(mockRegistrar.address, paymentAmt.add(protocolFee)); - await zns.meowToken.connect(mockRegistrar).approve(zns.treasury.address, paymentAmt.add(protocolFee)); + await zns.meowToken.connect(user).transfer(mockRegistrar.address, paymentAmt + protocolFee); + await zns.meowToken.connect(mockRegistrar).approve(await zns.treasury.getAddress(), paymentAmt + protocolFee); const userBalanceBefore = await zns.meowToken.balanceOf(user.address); const payerBalanceBefore = await zns.meowToken.balanceOf(mockRegistrar.address); @@ -309,9 +312,9 @@ describe("ZNSTreasury", () => { const payerBalanceAfter = await zns.meowToken.balanceOf(mockRegistrar.address); const zeroVaultBalanceAfter = await zns.meowToken.balanceOf(zeroVault.address); - expect(userBalanceAfter.sub(userBalanceBefore)).to.eq(paymentAmt); - expect(payerBalanceBefore.sub(payerBalanceAfter)).to.eq(paymentAmt.add(protocolFee)); - expect(zeroVaultBalanceAfter.sub(zeroVaultBalanceBefore)).to.eq(protocolFee); + expect(userBalanceAfter - userBalanceBefore).to.eq(paymentAmt); + expect(payerBalanceBefore - payerBalanceAfter).to.eq(paymentAmt + protocolFee); + expect(zeroVaultBalanceAfter - zeroVaultBalanceBefore).to.eq(protocolFee); }); it("should revert if paymentConfig not set", async () => { @@ -321,11 +324,11 @@ describe("ZNSTreasury", () => { token, beneficiary, } = await zns.treasury.paymentConfigs(randomHash); - expect(token).to.eq(ethers.constants.AddressZero); - expect(beneficiary).to.eq(ethers.constants.AddressZero); + expect(token).to.eq(ethers.ZeroAddress); + expect(beneficiary).to.eq(ethers.ZeroAddress); - const paymentAmt = parseEther("100"); - const protocolFee = parseEther("7"); + const paymentAmt = ethers.parseEther("100"); + const protocolFee = ethers.parseEther("7"); await expect( zns.treasury.connect(mockRegistrar).processDirectPayment( @@ -341,7 +344,7 @@ describe("ZNSTreasury", () => { it("should revert if called by anyone other than REGISTRAR_ROLE", async () => { await expect( zns.treasury.connect(randomAcc).processDirectPayment( - ethers.constants.HashZero, + ethers.ZeroHash, domainHash, mockRegistrar.address, "0", @@ -353,22 +356,22 @@ describe("ZNSTreasury", () => { }); it("should emit DirectPaymentProcessed event with correct params", async () => { - const paymentAmt = parseEther("100"); - const protocolFee = parseEther("7"); + const paymentAmt = ethers.parseEther("100"); + const protocolFee = ethers.parseEther("7"); // give tokens to mock registrar - await zns.meowToken.connect(user).transfer(mockRegistrar.address, paymentAmt.add(protocolFee)); - await zns.meowToken.connect(mockRegistrar).approve(zns.treasury.address, paymentAmt.add(protocolFee)); + await zns.meowToken.connect(user).transfer(mockRegistrar.address, paymentAmt + protocolFee); + await zns.meowToken.connect(mockRegistrar).approve(await zns.treasury.getAddress(), paymentAmt + protocolFee); await expect( zns.treasury.connect(mockRegistrar).processDirectPayment( - ethers.constants.HashZero, + ethers.ZeroHash, domainHash, mockRegistrar.address, paymentAmt, protocolFee ) ).to.emit(zns.treasury, "DirectPaymentProcessed").withArgs( - ethers.constants.HashZero, + ethers.ZeroHash, domainHash, mockRegistrar.address, zeroVault.address, @@ -384,8 +387,8 @@ describe("ZNSTreasury", () => { token: paymentTokenBefore, beneficiary: beneficiaryBefore, } = await zns.treasury.paymentConfigs(domainHash); - expect(paymentTokenBefore).to.eq(zns.meowToken.address); - expect(beneficiaryBefore).to.eq(user.address); + expect(paymentTokenBefore).to.eq(paymentConfig.token); + expect(beneficiaryBefore).to.eq(paymentConfig.beneficiary); const configToSet = { token: randomAcc.address, @@ -432,7 +435,7 @@ describe("ZNSTreasury", () => { it("should NOT set token or beneficiary to 0x0 address", async () => { const zeroBeneficiaryConf = { - beneficiary: ethers.constants.AddressZero, + beneficiary: ethers.ZeroAddress, token: randomAcc.address, }; @@ -446,7 +449,7 @@ describe("ZNSTreasury", () => { ); const meowTokenConf = { - token: ethers.constants.AddressZero, + token: ethers.ZeroAddress, beneficiary: randomAcc.address, }; @@ -465,26 +468,26 @@ describe("ZNSTreasury", () => { it("Should set the correct address of Zero Vault", async () => { const { beneficiary: currentZeroVault, - } = await zns.treasury.paymentConfigs(ethers.constants.HashZero); + } = await zns.treasury.paymentConfigs(ethers.ZeroHash); expect(currentZeroVault).to.not.eq(mockRegistrar.address); const tx = await zns.treasury.setBeneficiary( - ethers.constants.HashZero, + ethers.ZeroHash, mockRegistrar.address ); - const { beneficiary: newZeroVault } = await zns.treasury.paymentConfigs(ethers.constants.HashZero); + const { beneficiary: newZeroVault } = await zns.treasury.paymentConfigs(ethers.ZeroHash); expect(newZeroVault).to.eq(mockRegistrar.address); await expect(tx).to.emit(zns.treasury, "BeneficiarySet").withArgs( - ethers.constants.HashZero, + ethers.ZeroHash, mockRegistrar.address ); }); it("Should revert when called by anyone other than owner or operator", async () => { const tx = zns.treasury.connect(randomAcc).setBeneficiary( - ethers.constants.HashZero, + ethers.ZeroHash, mockRegistrar.address ); await expect(tx).to.be.revertedWith( @@ -494,8 +497,8 @@ describe("ZNSTreasury", () => { it("Should revert when beneficiary is address 0", async () => { const tx = zns.treasury.setBeneficiary( - ethers.constants.HashZero, - ethers.constants.AddressZero + ethers.ZeroHash, + ethers.ZeroAddress ); await expect(tx).to.be.revertedWith("ZNSTreasury: beneficiary passed as 0x0 address"); }); @@ -531,7 +534,7 @@ describe("ZNSTreasury", () => { }); it("Should revert when paymentToken is address 0", async () => { - const tx = zns.treasury.connect(user).setPaymentToken(domainHash, ethers.constants.AddressZero); + const tx = zns.treasury.connect(user).setPaymentToken(domainHash, ethers.ZeroAddress); await expect(tx).to.be.revertedWith("ZNSTreasury: paymentToken passed as 0x0 address"); }); }); @@ -557,7 +560,7 @@ describe("ZNSTreasury", () => { }); it("Should revert when accessController is address 0", async () => { - const tx = zns.treasury.setAccessController(ethers.constants.AddressZero); + const tx = zns.treasury.setAccessController(ethers.ZeroAddress); await expect(tx).to.be.revertedWith("AC: _accessController is 0x0 address"); }); }); @@ -583,7 +586,7 @@ describe("ZNSTreasury", () => { }); it("Should revert when registry is address 0", async () => { - const tx = zns.treasury.setRegistry(ethers.constants.AddressZero); + const tx = zns.treasury.setRegistry(ethers.ZeroAddress); await expect(tx).to.be.revertedWith("ARegistryWired: _registry can not be 0x0 address"); }); }); @@ -597,9 +600,9 @@ describe("ZNSTreasury", () => { const treasuryFactory = new ZNSTreasuryUpgradeMock__factory(deployer); const treasury = await treasuryFactory.deploy(); - await treasury.deployed(); + await treasury.waitForDeployment(); - await expect(zns.treasury.connect(deployer).upgradeTo(treasury.address)).to.not.be.reverted; + await expect(zns.treasury.connect(deployer).upgradeTo(await treasury.getAddress())).to.not.be.reverted; }); it("Fails when an unauthorized user tries to upgrade the contract", async () => { @@ -609,16 +612,16 @@ describe("ZNSTreasury", () => { const treasuryFactory = new ZNSTreasuryUpgradeMock__factory(deployer); const treasury = await treasuryFactory.deploy(); - await treasury.deployed(); + await treasury.waitForDeployment(); - const deployTx = zns.treasury.connect(user).upgradeTo(treasury.address); + const deployTx = zns.treasury.connect(user).upgradeTo(await treasury.getAddress()); await expect(deployTx).to.be.revertedWith(getAccessRevertMsg(user.address, GOVERNOR_ROLE)); }); it("Verifies that variable values are not changed in the upgrade process", async () => { const treasuryFactory = new ZNSTreasuryUpgradeMock__factory(deployer); const treasury = await treasuryFactory.deploy(); - await treasury.deployed(); + await treasury.waitForDeployment(); // Confirm deployer has the correct role first await expect(zns.accessController.checkGovernor(deployer.address)).to.not.be.reverted; @@ -628,18 +631,18 @@ describe("ZNSTreasury", () => { const { expectedPrice, stakeFee } = getPriceObject(newLabel, DEFAULT_PRICE_CONFIG); await zns.treasury.connect(mockRegistrar).stakeForDomain( - ethers.constants.HashZero, + ethers.ZeroHash, newHash, deployer.address, expectedPrice, - ethers.constants.Zero, + BigInt(0), stakeFee ); const calls = [ treasury.registry(), treasury.getAccessController(), - treasury.paymentConfigs(ethers.constants.HashZero), + treasury.paymentConfigs(ethers.ZeroHash), treasury.stakedForDomain(newHash), ]; diff --git a/test/gas/TransactionGasCosts.test.ts b/test/gas/TransactionGasCosts.test.ts index 306387d32..7ef814a67 100644 --- a/test/gas/TransactionGasCosts.test.ts +++ b/test/gas/TransactionGasCosts.test.ts @@ -3,17 +3,13 @@ import * as hre from "hardhat"; import { AccessType, DEFAULT_TOKEN_URI, deployZNS, PaymentType, DEFAULT_PRICE_CONFIG } from "../helpers"; import * as ethers from "ethers"; import { registrationWithSetup } from "../helpers/register-setup"; -import { BigNumber } from "ethers"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import fs from "fs"; const gasCostFile = `${process.cwd()}/test/gas/gas-costs.json`; -// TODO sub: add more tests here for each tx with different configs -// so we can track gas changes better when developing -// OR just use hardhat gas profiler and remove these tests describe("Transaction Gas Costs Test", () => { let deployer : SignerWithAddress; let rootOwner : SignerWithAddress; @@ -46,10 +42,10 @@ describe("Transaction Gas Costs Test", () => { zeroVaultAddress: zeroVault.address, }); - await zns.curvePricer.connect(deployer).setPriceConfig(ethers.constants.HashZero, DEFAULT_PRICE_CONFIG); + await zns.curvePricer.connect(deployer).setPriceConfig(ethers.ZeroHash, DEFAULT_PRICE_CONFIG); config = { - pricerContract: zns.fixedPricer.address, + pricerContract: await zns.fixedPricer.getAddress(), paymentType: PaymentType.DIRECT, accessType: AccessType.OPEN, }; @@ -60,9 +56,9 @@ describe("Transaction Gas Costs Test", () => { rootOwner, lvl2SubOwner, ].map(async ({ address }) => - zns.meowToken.mint(address, ethers.utils.parseEther("1000000"))) + zns.meowToken.mint(address, ethers.parseEther("1000000"))) ); - await zns.meowToken.connect(rootOwner).approve(zns.treasury.address, ethers.constants.MaxUint256); + await zns.meowToken.connect(rootOwner).approve(await zns.treasury.getAddress(), ethers.MaxUint256); rootHashDirect = await registrationWithSetup({ zns, @@ -71,48 +67,26 @@ describe("Transaction Gas Costs Test", () => { fullConfig: { distrConfig: { accessType: AccessType.OPEN, - pricerContract: zns.curvePricer.address, + pricerContract: await zns.curvePricer.getAddress(), paymentType: PaymentType.DIRECT, }, paymentConfig: { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: rootOwner.address, }, priceConfig: DEFAULT_PRICE_CONFIG, }, }); - // TODO sub fee: add cases for subs under this ! - // rootHashStake = await registrationWithSetup({ - // zns, - // user: rootOwner, - // domainLabel: "rootstake", - // fullConfig: { - // distrConfig: { - // accessType: AccessType.OPEN, - // pricerContract: zns.curvePricer.address, - // paymentConfig: { - // token: zns.zeroToken.address, - // beneficiary: rootOwner.address, - // paymentType: PaymentType.STAKE, - // }, - // }, - // priceConfig: { - // price: BigNumber.from(ethers.utils.parseEther("1375.612")), - // feePercentage: BigNumber.from(0), - // }, - // }, - // }); - fs.existsSync(gasCostFile) || fs.writeFileSync(gasCostFile, JSON.stringify({})); }); it("Root Domain Price", async function () { // approve - await zns.meowToken.connect(rootOwner).approve(zns.treasury.address, ethers.constants.MaxUint256); + await zns.meowToken.connect(rootOwner).approve(await zns.treasury.getAddress(), ethers.MaxUint256); // register root domain const paymentConfig = { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: rootOwner.address, }; @@ -124,7 +98,8 @@ describe("Transaction Gas Costs Test", () => { paymentConfig ); - const { gasUsed } = await tx.wait(); + const receipt = await tx.wait(); + const gasUsed = receipt?.gasUsed as bigint; const previous = JSON.parse( fs.readFileSync(gasCostFile, "utf8") @@ -133,9 +108,9 @@ describe("Transaction Gas Costs Test", () => { const title = this.test ? this.test.title : "! Title Not Found - Check Test Context !"; const prevGas = previous[title]; - let gasDiff = BigNumber.from(0); + let gasDiff = BigInt(0); if (prevGas) { - gasDiff = gasUsed.sub(BigNumber.from(prevGas)); + gasDiff = gasUsed - BigInt(prevGas); } console.log(` @@ -144,7 +119,7 @@ describe("Transaction Gas Costs Test", () => { Gas Diff: ${gasDiff.toString()} `); - if (gasDiff.gt(1000) || gasDiff.lt(-1000)) { + if (gasDiff > 1000 || gasDiff < -1000) { fs.writeFileSync( gasCostFile, JSON.stringify({ @@ -158,10 +133,10 @@ describe("Transaction Gas Costs Test", () => { it("Subdomain Price", async function () { // approve - await zns.meowToken.connect(lvl2SubOwner).approve(zns.treasury.address, ethers.constants.MaxUint256); + await zns.meowToken.connect(lvl2SubOwner).approve(await zns.treasury.getAddress(), ethers.MaxUint256); // register subdomain const paymentConfig = { - token: zns.meowToken.address, + token: await zns.meowToken.getAddress(), beneficiary: rootOwner.address, }; @@ -173,7 +148,8 @@ describe("Transaction Gas Costs Test", () => { config, paymentConfig ); - const { gasUsed } = await tx.wait(); + const receipt = await tx.wait(); + const gasUsed = receipt?.gasUsed as bigint; const previous = JSON.parse( fs.readFileSync(gasCostFile, "utf8") @@ -182,9 +158,9 @@ describe("Transaction Gas Costs Test", () => { const title = this.test ? this.test.title : "! Title Not Found - Check Test Context !"; const prevGas = previous[title]; - let gasDiff = BigNumber.from(0); + let gasDiff = BigInt(0); if (prevGas) { - gasDiff = gasUsed.sub(BigNumber.from(prevGas)); + gasDiff = gasUsed - BigInt(prevGas); } console.log(` @@ -193,7 +169,7 @@ describe("Transaction Gas Costs Test", () => { Gas Diff: ${gasDiff.toString()} `); - if (gasDiff.gt(1000) || gasDiff.lt(-1000)) { + if (gasDiff > 1000 || gasDiff < -1000) { fs.writeFileSync( gasCostFile, JSON.stringify({ diff --git a/test/gas/gas-costs.json b/test/gas/gas-costs.json index 216ec18ad..f47257900 100644 --- a/test/gas/gas-costs.json +++ b/test/gas/gas-costs.json @@ -1,4 +1,4 @@ { - "Root Domain Price": "413444", - "Subdomain Price": "406832" + "Root Domain Price": "469205", + "Subdomain Price": "462907" } \ No newline at end of file diff --git a/test/helpers/balances.ts b/test/helpers/balances.ts index e95e47586..6be8c7fdc 100644 --- a/test/helpers/balances.ts +++ b/test/helpers/balances.ts @@ -1,4 +1,3 @@ -import { BigNumber } from "ethers"; import { IERC20 } from "../../typechain"; import { expect } from "chai"; @@ -10,15 +9,15 @@ export const checkBalance = async ({ shouldDecrease = true, } : { token : IERC20; - balanceBefore : BigNumber; + balanceBefore : bigint; userAddress : string; - target : BigNumber; + target : bigint; shouldDecrease ?: boolean; }) => { const balanceAfter = await token.balanceOf(userAddress); const diff = shouldDecrease - ? balanceBefore.sub(balanceAfter) - : balanceAfter.sub(balanceBefore); + ? balanceBefore - balanceAfter + : balanceAfter - balanceBefore; expect(diff).to.eq(target); }; diff --git a/test/helpers/constants.ts b/test/helpers/constants.ts index bbf7f37e5..994f4ebbb 100644 --- a/test/helpers/constants.ts +++ b/test/helpers/constants.ts @@ -1,4 +1,3 @@ -import { BigNumber } from "ethers"; import { ethers } from "hardhat"; import { ICurvePriceConfig } from "../../src/deploy/missions/types"; @@ -6,62 +5,62 @@ export const DEFAULT_RESOLVER_TYPE = "address"; export const ZNS_DOMAIN_TOKEN_NAME = "ZERO NAME ADDRESS"; export const ZNS_DOMAIN_TOKEN_SYMBOL = "ZNA"; -export const DEFAULT_ROYALTY_FRACTION = BigNumber.from("200"); +export const DEFAULT_ROYALTY_FRACTION = BigInt("200"); export const DEFAULT_TOKEN_URI = "https://www.zns.domains/7c654a5f"; -export const DEFAULT_REGISTRATION_FEE_PERCENT = BigNumber.from("222"); -export const DEFAULT_PERCENTAGE_BASIS = BigNumber.from("10000"); +export const DEFAULT_PROTOCOL_FEE_PERCENT = BigInt("222"); +export const DEFAULT_PERCENTAGE_BASIS = BigInt("10000"); -export const DEFAULT_DECIMALS = BigNumber.from(18); -export const DECAULT_PRECISION = BigNumber.from(2); -export const DEFAULT_PRECISION_MULTIPLIER = BigNumber.from(10).pow(DEFAULT_DECIMALS.sub(DECAULT_PRECISION)); +export const DEFAULT_DECIMALS = BigInt(18); +export const DECAULT_PRECISION = BigInt(2); +export const DEFAULT_PRECISION_MULTIPLIER = BigInt(10) ** (DEFAULT_DECIMALS - DECAULT_PRECISION); // eslint-disable-next-line no-shadow -export enum AccessType { - LOCKED, - OPEN, - MINTLIST, -} +export const AccessType = { + LOCKED: 0n, + OPEN: 1n, + MINTLIST: 2n, +}; // eslint-disable-next-line no-shadow -export enum OwnerOf { - NAME, - TOKEN, - BOTH, -} +export const OwnerOf = { + NAME: 0n, + TOKEN: 1n, + BOTH: 2n, +}; // eslint-disable-next-line no-shadow -export enum PaymentType { - DIRECT, - STAKE, -} +export const PaymentType = { + DIRECT: 0n, + STAKE: 1n, +}; export const DEFAULT_PRICE_CONFIG : ICurvePriceConfig = { - maxPrice: ethers.utils.parseEther("25000"), - minPrice: ethers.utils.parseEther("2000"), - maxLength: BigNumber.from(50), - baseLength: BigNumber.from(4), + maxPrice: ethers.parseEther("25000"), + minPrice: ethers.parseEther("2000"), + maxLength: BigInt(50), + baseLength: BigInt(4), precisionMultiplier: DEFAULT_PRECISION_MULTIPLIER, - feePercentage: DEFAULT_REGISTRATION_FEE_PERCENT, + feePercentage: DEFAULT_PROTOCOL_FEE_PERCENT, isSet: true, }; export const curvePriceConfigEmpty : ICurvePriceConfig = { - maxPrice: ethers.constants.Zero, - minPrice: ethers.constants.Zero, - maxLength: BigNumber.from(0), - baseLength: BigNumber.from(0), - precisionMultiplier: BigNumber.from(0), - feePercentage: BigNumber.from(0), + maxPrice: BigInt(0), + minPrice: BigInt(0), + maxLength: BigInt(0), + baseLength: BigInt(0), + precisionMultiplier: BigInt(0), + feePercentage: BigInt(0), isSet: true, }; export const paymentConfigEmpty = { - token: ethers.constants.AddressZero, - beneficiary: ethers.constants.AddressZero, + token: ethers.ZeroAddress, + beneficiary: ethers.ZeroAddress, }; export const distrConfigEmpty = { - pricerContract: ethers.constants.AddressZero, + pricerContract: ethers.ZeroAddress, paymentType: PaymentType.DIRECT, accessType: AccessType.LOCKED, }; diff --git a/test/helpers/deploy-helpers.ts b/test/helpers/deploy-helpers.ts index 89c90192b..5484981ab 100644 --- a/test/helpers/deploy-helpers.ts +++ b/test/helpers/deploy-helpers.ts @@ -1,133 +1,176 @@ - -// For use in inegration test of deployment campaign - -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; -import { TZNSContractState } from "../../src/deploy/campaign/types"; -import { BigNumber, ethers } from "ethers"; -import { ICurvePriceConfig, IDistributionConfig } from "./types"; -import { expect } from "chai"; -import { hashDomainLabel, paymentConfigEmpty } from "."; -import { getDomainHashFromEvent } from "./events"; - -export const approveBulk = async ( - signers : Array, - zns : TZNSContractState, -) => { - for (const signer of signers) { - const tx = await zns.meowToken.connect(signer).approve( - zns.treasury.address, - ethers.constants.MaxUint256, - ); - - await tx.wait(); // hang on hardhat? - } -}; - -export const mintBulk = async ( - signers : Array, - amount : BigNumber, - zns : TZNSContractState, -) => { - for (const signer of signers) { - await zns.meowToken.connect(signer).mint( - signer.address, - amount - ); - } -}; - -export const getPriceBulk = async ( - domains : Array, - zns : TZNSContractState, - parentHashes : Array = [], - includeProtocolFee = false, -) => { - let index = 0; - const prices = []; - - for (const domain of domains) { - const parent = parentHashes[index] ? parentHashes[index] : ethers.constants.HashZero; - - const { price, stakeFee } = await zns.curvePricer.getPriceAndFee( - parent, - domain, - true, - ); - - const priceWithFee = price.add(stakeFee); - - if (includeProtocolFee) { - const protocolFee = await zns.curvePricer.getFeeForPrice(ethers.constants.HashZero, priceWithFee); - - prices.push(priceWithFee.add(protocolFee)); - } else { - prices.push(priceWithFee); - } - - - index++; - } - - return prices; -}; - -export const registerRootDomainBulk = async ( - signers : Array, - domains : Array, - domainAddress : string, - tokenUri : string, - distConfig : IDistributionConfig, - priceConfig : ICurvePriceConfig, - zns : TZNSContractState, -) : Promise => { - let index = 0; - - for(const domain of domains) { - await zns.rootRegistrar.connect(signers[index]).registerRootDomain( - domain, - domainAddress, - `${tokenUri}${index}`, - distConfig, - { - token: zns.meowToken.address, - beneficiary: signers[index].address, - } - ); - - const domainHash = hashDomainLabel(domain); - expect(await zns.registry.exists(domainHash)).to.be.true; - - // To mint subdomains from this domain we must first set the price config and the payment config - await zns.curvePricer.connect(signers[index]).setPriceConfig(domainHash, priceConfig); - - index++; - } -}; - -export const registerSubdomainBulk = async ( - signers : Array, - parents : Array, - subdomains : Array, - domainAddress : string, - tokenUri : string, - distConfig : IDistributionConfig, - zns : TZNSContractState, -) => { - let index = 0; - - for (const subdomain of subdomains) { - await zns.subRegistrar.connect(signers[index]).registerSubdomain( - parents[index], - subdomain, - domainAddress, - `${tokenUri}${index}`, - distConfig, - paymentConfigEmpty - ); - - const subdomainHash = await getDomainHashFromEvent({ zns, user: signers[index] }); - expect(await zns.registry.exists(subdomainHash)).to.be.true; - - index++; - } + +// For use in inegration test of deployment campaign +import * as hre from "hardhat"; +import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; +import { IDeployCampaignConfig, TLogger, TZNSContractState } from "../../src/deploy/campaign/types"; +import { ethers } from "ethers"; +import { IDistributionConfig } from "./types"; +import { expect } from "chai"; +import { hashDomainLabel, paymentConfigEmpty } from "."; +import { ICurvePriceConfig } from "../../src/deploy/missions/types"; + +export const approveBulk = async ( + signers : Array, + zns : TZNSContractState, +) => { + for (const signer of signers) { + // if (hre.network.name === "hardhat") { + const hasApproval = await zns.meowToken.allowance(signer.address, await zns.treasury.getAddress()); + + // To avoid resending the approval repeatedly we first check the allowance + if (hasApproval === BigInt(0)) { + const tx = await zns.meowToken.connect(signer).approve( + await zns.treasury.getAddress(), + ethers.MaxUint256, + ); + + await tx.wait(); + } + } +}; + +export const mintBulk = async ( + signers : Array, + amount : bigint, + zns : TZNSContractState, +) => { + for (const signer of signers) { + await zns.meowToken.connect(signer).mint( + signer.address, + amount + ); + } +}; + +export const getPriceBulk = async ( + domains : Array, + zns : TZNSContractState, + parentHashes ?: Array, +) => { + let index = 0; + const prices = []; + + for (const domain of domains) { + let parent; + if (parentHashes) { + parent = parentHashes[index]; + } else { + parent = ethers.ZeroHash; + } + + // temp, can do one call `getPRiceAndFee` but debugging where failure occurs + const price = await zns.curvePricer.getPrice(parent, domain, true); + const stakeFee = await zns.curvePricer.getFeeForPrice(parent, price); + + // TODO fix this to be one if statement + if (parentHashes) { + const protocolFee = await zns.curvePricer.getFeeForPrice(ethers.ZeroHash, price + stakeFee); + + prices.push(price + stakeFee + protocolFee); + } else { + const protocolFee = await zns.curvePricer.getFeeForPrice(ethers.ZeroHash, price); + + prices.push(price + protocolFee); + } + + + index++; + } + + return prices; +}; + +export const registerRootDomainBulk = async ( + signers : Array, + domains : Array, + config : IDeployCampaignConfig, + tokenUri : string, + distConfig : IDistributionConfig, + priceConfig : ICurvePriceConfig, + zns : TZNSContractState, + logger : TLogger, +) : Promise => { + let index = 0; + + for(const domain of domains) { + const balanceBefore = await zns.meowToken.balanceOf(signers[index].address); + const tx = await zns.rootRegistrar.connect(signers[index]).registerRootDomain( + domain, + config.zeroVaultAddress, + `${tokenUri}${index}`, + distConfig, + { + token: await zns.meowToken.getAddress(), + beneficiary: config.zeroVaultAddress, + } + ); + logger.info("Deploy transaction submitted, waiting..."); + if (hre.network.name !== "hardhat") { + await tx.wait(3); + logger.info(`Registered '${domain}' for ${signers[index].address} at tx: ${tx.hash}`); + } + + const balanceAfter = await zns.meowToken.balanceOf(signers[index].address); + const [price, protocolFee] = await zns.curvePricer.getPriceAndFee(ethers.ZeroHash, domain, true); + expect(balanceAfter).to.be.eq(balanceBefore - price - protocolFee); + + const domainHash = hashDomainLabel(domain); + expect(await zns.registry.exists(domainHash)).to.be.true; + + // TODO figure out if we want to do this on prod? + // To mint subdomains from this domain we must first set the price config and the payment config + await zns.curvePricer.connect(signers[index]).setPriceConfig(domainHash, priceConfig); + + index++; + } +}; + +export const registerSubdomainBulk = async ( + signers : Array, + parents : Array, + subdomains : Array, + subdomainHashes : Array, + domainAddress : string, + tokenUri : string, + distConfig : IDistributionConfig, + zns : TZNSContractState, + logger : TLogger, +) => { + let index = 0; + + for (const subdomain of subdomains) { + const balanceBefore = await zns.meowToken.balanceOf(signers[index].address); + const tx = await zns.subRegistrar.connect(signers[index]).registerSubdomain( + parents[index], + subdomain, + domainAddress, + `${tokenUri}${index}`, + distConfig, + paymentConfigEmpty + ); + + logger.info("Deploy transaction submitted, waiting..."); + + if (hre.network.name !== "hardhat") { + await tx.wait(3); + logger.info(`registered '${subdomain}' for ${signers[index].address} at tx: ${tx.hash}`); + } + + const balanceAfter = await zns.meowToken.balanceOf(signers[index].address); + + const owner = await zns.registry.getDomainOwner(parents[index]); + if (signers[index].address === owner) { + expect(balanceAfter).to.be.eq(balanceBefore); + } else { + const [price, stakeFee] = await zns.curvePricer.getPriceAndFee(parents[index], subdomain, true); + const protocolFee = await zns.curvePricer.getFeeForPrice(ethers.ZeroHash, price + stakeFee); + + expect(balanceAfter).to.be.eq(balanceBefore - price - stakeFee - protocolFee); + } + + + expect(await zns.registry.exists(subdomainHashes[index])).to.be.true; + + index++; + } }; \ No newline at end of file diff --git a/test/helpers/deploy/deploy-zns.ts b/test/helpers/deploy/deploy-zns.ts index d5615c39e..21f361720 100644 --- a/test/helpers/deploy/deploy-zns.ts +++ b/test/helpers/deploy/deploy-zns.ts @@ -23,7 +23,7 @@ import { import { DeployZNSParams, RegistrarConfig, IZNSContracts } from "../types"; import * as hre from "hardhat"; import { ethers, upgrades } from "hardhat"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { accessControllerName, addressResolverName, @@ -44,7 +44,6 @@ import { } from "../constants"; import { REGISTRAR_ROLE } from "../../../src/deploy/constants"; import { getProxyImplAddress } from "../utils"; -import { BigNumber } from "ethers"; import { ICurvePriceConfig } from "../../../src/deploy/missions/types"; import { meowTokenName, meowTokenSymbol } from "../../../src/deploy/missions/contracts"; import { transparentProxyName } from "../../../src/deploy/missions/contracts/names"; @@ -64,18 +63,19 @@ export const deployAccessController = async ({ const accessControllerFactory = new ZNSAccessController__factory(deployer); const controller = await accessControllerFactory.deploy(governorAddresses, adminAddresses); - await controller.deployed(); + await controller.waitForDeployment(); + const proxyAddress = await controller.getAddress(); if (isTenderlyRun) { await hre.tenderly.verify({ name: accessControllerName, - address: controller.address, + address: proxyAddress, }); - console.log(`AccessController deployed at: ${controller.address}`); + console.log(`AccessController deployed at: ${proxyAddress}`); } - return controller; + return controller as unknown as ZNSAccessController; }; export const deployRegistry = async ( @@ -91,17 +91,18 @@ export const deployRegistry = async ( ], { kind: "uups", - }) as ZNSRegistry; + }); - await registry.deployed(); + await registry.waitForDeployment(); + const proxyAddress = await registry.getAddress(); if (isTenderlyRun) { await hre.tenderly.verify({ name: erc1967ProxyName, - address: registry.address, + address: proxyAddress, }); - const impl = await getProxyImplAddress(registry.address); + const impl = await getProxyImplAddress(proxyAddress); await hre.tenderly.verify({ name: registryName, @@ -109,18 +110,18 @@ export const deployRegistry = async ( }); console.log(`ZNSRegistry deployed at: - proxy: ${registry.address} + proxy: ${proxyAddress} implementation: ${impl}`); } - return registry; + return registry as unknown as ZNSRegistry; }; export const deployDomainToken = async ( deployer : SignerWithAddress, accessControllerAddress : string, royaltyReceiverAddress : string, - royaltyFraction : BigNumber, + royaltyFraction : bigint, isTenderlyRun : boolean ) : Promise => { const domainTokenFactory = new ZNSDomainToken__factory(deployer); @@ -136,17 +137,19 @@ export const deployDomainToken = async ( { kind: "uups", } - ) as ZNSDomainToken; + ) as unknown as ZNSDomainToken; + + await domainToken.waitForDeployment(); - await domainToken.deployed(); + const proxyAddress = await domainToken.getAddress(); if (isTenderlyRun) { await hre.tenderly.verify({ name: erc1967ProxyName, - address: domainToken.address, + address: proxyAddress, }); - const impl = await getProxyImplAddress(domainToken.address); + const impl = await getProxyImplAddress(proxyAddress); await hre.tenderly.verify({ name: domainTokenName, @@ -154,17 +157,17 @@ export const deployDomainToken = async ( }); console.log(`ZNSDomainToken deployed at: - proxy: ${domainToken.address} + proxy: ${proxyAddress} implementation: ${impl}`); } - return domainToken; + return domainToken as unknown as ZNSDomainToken; }; export const deployMeowToken = async ( deployer : SignerWithAddress, isTenderlyRun : boolean -) => { +) : Promise => { const factory = new MeowTokenMock__factory(deployer); const meowToken = await hre.upgrades.deployProxy( @@ -176,17 +179,18 @@ export const deployMeowToken = async ( { kind: "transparent", } - ) as MeowTokenMock; + ) as unknown as MeowTokenMock; - await meowToken.deployed(); + await meowToken.waitForDeployment(); + const proxyAddress = await meowToken.getAddress(); if (isTenderlyRun) { await hre.tenderly.verify({ name: transparentProxyName, - address: meowToken.address, + address: proxyAddress, }); - const impl = await getProxyImplAddress(meowToken.address); + const impl = await getProxyImplAddress(proxyAddress); await hre.tenderly.verify({ name: meowTokenMockName, @@ -194,14 +198,14 @@ export const deployMeowToken = async ( }); console.log(`${meowTokenMockName} deployed at: - proxy: ${meowToken.address} + proxy: ${proxyAddress} implementation: ${impl}`); } // Mint 10,000 ZERO for self - await meowToken.mint(meowToken.address, ethers.utils.parseEther("10000")); + await meowToken.mint(proxyAddress, ethers.parseEther("10000")); - return meowToken; + return meowToken as unknown as MeowTokenMock; }; export const deployAddressResolver = async ( @@ -221,17 +225,19 @@ export const deployAddressResolver = async ( { kind: "uups", } - ) as ZNSAddressResolver; + ); + + await resolver.waitForDeployment(); - await resolver.deployed(); + const proxyAddress = await resolver.getAddress(); if (isTenderlyRun) { await hre.tenderly.verify({ name: erc1967ProxyName, - address: resolver.address, + address: proxyAddress, }); - const impl = await getProxyImplAddress(resolver.address); + const impl = await getProxyImplAddress(proxyAddress); await hre.tenderly.verify({ name: addressResolverName, @@ -239,11 +245,11 @@ export const deployAddressResolver = async ( }); console.log(`ZNSAddressResolver deployed at: - proxy: ${resolver.address} + proxy: ${proxyAddress} implementation: ${impl}`); } - return resolver; + return resolver as unknown as ZNSAddressResolver; }; export const deployCurvePricer = async ({ @@ -271,17 +277,19 @@ export const deployCurvePricer = async ({ { kind: "uups", } - ) as ZNSCurvePricer; + ); + + await curvePricer.waitForDeployment(); - await curvePricer.deployed(); + const proxyAddress = await curvePricer.getAddress(); if (isTenderlyRun) { await hre.tenderly.verify({ name: erc1967ProxyName, - address: curvePricer.address, + address: proxyAddress, }); - const impl = await getProxyImplAddress(curvePricer.address); + const impl = await getProxyImplAddress(proxyAddress); await hre.tenderly.verify({ name: curvePricerName, @@ -289,11 +297,11 @@ export const deployCurvePricer = async ({ }); console.log(`${curvePricerName} deployed at: - proxy: ${curvePricer.address} + proxy: ${proxyAddress} implementation: ${impl}`); } - return curvePricer; + return curvePricer as unknown as ZNSCurvePricer; }; export const deployTreasury = async ({ @@ -312,7 +320,7 @@ export const deployTreasury = async ({ isTenderlyRun : boolean; }) : Promise => { const treasuryFactory = new ZNSTreasury__factory(deployer); - const treasury : ZNSTreasury = await upgrades.deployProxy(treasuryFactory, + const treasury = await upgrades.deployProxy(treasuryFactory, [ accessControllerAddress, registryAddress, @@ -322,17 +330,18 @@ export const deployTreasury = async ({ { kind: "uups", } - ) as ZNSTreasury; + ); - await treasury.deployed(); + await treasury.waitForDeployment(); + const proxyAddress = await treasury.getAddress(); if (isTenderlyRun) { await hre.tenderly.verify({ name: erc1967ProxyName, - address: treasury.address, + address: proxyAddress, }); - const impl = await getProxyImplAddress(treasury.address); + const impl = await getProxyImplAddress(proxyAddress); await hre.tenderly.verify({ name: treasuryName, @@ -340,11 +349,11 @@ export const deployTreasury = async ({ }); console.log(`ZNSTreasury deployed at: - proxy: ${treasury.address} + proxy: ${proxyAddress} implementation: ${impl}`); } - return treasury; + return treasury as unknown as ZNSTreasury; }; export const deployRootRegistrar = async ( @@ -358,28 +367,29 @@ export const deployRootRegistrar = async ( const registrar = await upgrades.deployProxy( registrarFactory, [ - accessController.address, + await accessController.getAddress(), config.registryAddress, config.curvePricerAddress, - config.treasury.address, + config.treasuryAddress, config.domainTokenAddress, ], { kind: "uups", } - ) as ZNSRootRegistrar; + ); - await registrar.deployed(); + await registrar.waitForDeployment(); + const proxyAddress = await registrar.getAddress(); - await accessController.connect(deployer).grantRole(REGISTRAR_ROLE, registrar.address); + await accessController.connect(deployer).grantRole(REGISTRAR_ROLE, proxyAddress); if (isTenderlyRun) { await hre.tenderly.verify({ name: erc1967ProxyName, - address: registrar.address, + address: proxyAddress, }); - const impl = await getProxyImplAddress(registrar.address); + const impl = await getProxyImplAddress(proxyAddress); await hre.tenderly.verify({ name: registrarName, @@ -387,11 +397,11 @@ export const deployRootRegistrar = async ( }); console.log(`ZNSRootRegistrar deployed at: - proxy: ${registrar.address} + proxy: ${proxyAddress} implementation: ${impl}`); } - return registrar; + return registrar as unknown as ZNSRootRegistrar; }; export const deployFixedPricer = async ({ @@ -415,17 +425,18 @@ export const deployFixedPricer = async ({ { kind: "uups", } - ) as ZNSFixedPricer; + ); - await fixedPricer.deployed(); + await fixedPricer.waitForDeployment(); + const proxyAddress = await fixedPricer.getAddress(); if (isTenderlyRun) { await hre.tenderly.verify({ name: erc1967ProxyName, - address: fixedPricer.address, + address: proxyAddress, }); - const impl = await getProxyImplAddress(fixedPricer.address); + const impl = await getProxyImplAddress(proxyAddress); await hre.tenderly.verify({ name: fixedPricerName, @@ -433,11 +444,11 @@ export const deployFixedPricer = async ({ }); console.log(`${fixedPricerName} deployed at: - proxy: ${fixedPricer.address} + proxy: ${proxyAddress} implementation: ${impl}`); } - return fixedPricer; + return fixedPricer as unknown as ZNSFixedPricer; }; export const deploySubRegistrar = async ({ @@ -459,30 +470,31 @@ export const deploySubRegistrar = async ({ const subRegistrar = await upgrades.deployProxy( subRegistrarFactory, [ - accessController.address, - registry.address, - rootRegistrar.address, + await accessController.getAddress(), + await registry.getAddress(), + await rootRegistrar.getAddress(), ], { kind: "uups", } - ) as ZNSSubRegistrar; + ); - await subRegistrar.deployed(); + await subRegistrar.waitForDeployment(); + const proxyAddress = await subRegistrar.getAddress(); // set SubRegistrar on RootRegistrar - await rootRegistrar.setSubRegistrar(subRegistrar.address); + await rootRegistrar.setSubRegistrar(proxyAddress); // give SubRegistrar REGISTRAR_ROLE - await accessController.connect(admin).grantRole(REGISTRAR_ROLE, subRegistrar.address); + await accessController.connect(admin).grantRole(REGISTRAR_ROLE, proxyAddress); if (isTenderlyRun) { await hre.tenderly.verify({ name: erc1967ProxyName, - address: subRegistrar.address, + address: proxyAddress, }); - const impl = await getProxyImplAddress(subRegistrar.address); + const impl = await getProxyImplAddress(proxyAddress); await hre.tenderly.verify({ name: subRegistrarName, @@ -490,11 +502,11 @@ export const deploySubRegistrar = async ({ }); console.log(`${subRegistrarName} deployed at: - proxy: ${subRegistrar.address} + proxy: ${proxyAddress} implementation: ${impl}`); } - return subRegistrar; + return subRegistrar as unknown as ZNSSubRegistrar; }; /** @@ -518,6 +530,10 @@ export const deployZNS = async ({ // to not clog the test output. await hre.upgrades.silenceWarnings(); + if (!zeroVaultAddress) { + zeroVaultAddress = deployer.address; + } + const accessController = await deployAccessController({ deployer, governorAddresses: [deployer.address, ...governorAddresses], @@ -527,13 +543,13 @@ export const deployZNS = async ({ const registry = await deployRegistry( deployer, - accessController.address, + await accessController.getAddress(), isTenderlyRun ); const domainToken = await deployDomainToken( deployer, - accessController.address, + await accessController.getAddress(), zeroVaultAddress, DEFAULT_ROYALTY_FRACTION, isTenderlyRun @@ -546,33 +562,33 @@ export const deployZNS = async ({ const addressResolver = await deployAddressResolver( deployer, - accessController.address, - registry.address, + await accessController.getAddress(), + await registry.getAddress(), isTenderlyRun ); const curvePricer = await deployCurvePricer({ deployer, - accessControllerAddress: accessController.address, - registryAddress: registry.address, + accessControllerAddress: await accessController.getAddress(), + registryAddress: await registry.getAddress(), priceConfig, isTenderlyRun, }); const treasury = await deployTreasury({ deployer, - accessControllerAddress: accessController.address, - registryAddress: registry.address, - zTokenMockAddress: meowTokenMock.address, + accessControllerAddress: await accessController.getAddress(), + registryAddress: await registry.getAddress(), + zTokenMockAddress: await meowTokenMock.getAddress(), zeroVaultAddress, isTenderlyRun, }); const config : RegistrarConfig = { - treasury, - registryAddress: registry.address, - curvePricerAddress: curvePricer.address, - domainTokenAddress: domainToken.address, + treasuryAddress: await treasury.getAddress(), + registryAddress: await registry.getAddress(), + curvePricerAddress: await curvePricer.getAddress(), + domainTokenAddress: await domainToken.getAddress(), }; const rootRegistrar = await deployRootRegistrar( @@ -584,8 +600,8 @@ export const deployZNS = async ({ const fixedPricer = await deployFixedPricer({ deployer, - acAddress: accessController.address, - regAddress: registry.address, + acAddress: await accessController.getAddress(), + regAddress: await registry.getAddress(), isTenderlyRun, }); @@ -613,9 +629,10 @@ export const deployZNS = async ({ }; // Give 15 ZERO to the deployer and allowance to the treasury - await meowTokenMock.connect(deployer).approve(treasury.address, ethers.constants.MaxUint256); - await meowTokenMock.mint(deployer.address, ethers.utils.parseEther("5000000")); - await registry.connect(deployer).addResolverType(DEFAULT_RESOLVER_TYPE, addressResolver.address); + await meowTokenMock.connect(deployer).approve(await treasury.getAddress(), ethers.MaxUint256); + await meowTokenMock.mint(await deployer.getAddress(), ethers.parseEther("5000000")); + + await registry.connect(deployer).addResolverType(DEFAULT_RESOLVER_TYPE, await addressResolver.getAddress()); return znsContracts; }; diff --git a/test/helpers/deploy/mocks.ts b/test/helpers/deploy/mocks.ts index 36d3f5731..b1a81e96e 100644 --- a/test/helpers/deploy/mocks.ts +++ b/test/helpers/deploy/mocks.ts @@ -1,16 +1,15 @@ -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { CustomDecimalTokenMock__factory } from "../../../typechain"; -import { BigNumber } from "ethers"; export const deployCustomDecToken = async ( deployer : SignerWithAddress, - decimals : number | string | BigNumber = 18 + decimals : number | string | bigint = 18 ) => { const tokenFact = new CustomDecimalTokenMock__factory(deployer); const token = await tokenFact.deploy(deployer.address, decimals); - await token.deployed(); + await token.waitForDeployment(); return token; }; diff --git a/test/helpers/errors.ts b/test/helpers/errors.ts index 5cc456770..2d6cdf0e9 100644 --- a/test/helpers/errors.ts +++ b/test/helpers/errors.ts @@ -46,3 +46,4 @@ export const NO_MOCK_PROD_ERR = "Cannot mock MEOW token in production"; export const STAKING_TOKEN_ERR = "Must use MEOW token in production"; export const INVALID_CURVE_ERR = "Must use a valid price configuration"; export const MONGO_URI_ERR = "Cannot use local mongo URI in production"; +export const NO_ZERO_VAULT_ERR = "Must provide ZERO_VAULT_ADDRESS for 'prod' or 'test' environments"; diff --git a/test/helpers/events.ts b/test/helpers/events.ts index 9d19e7e0d..73822d17d 100644 --- a/test/helpers/events.ts +++ b/test/helpers/events.ts @@ -1,74 +1,28 @@ -import { BigNumber, ContractReceipt, Event } from "ethers"; import { IZNSContracts } from "./types"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; -import { time } from "@nomicfoundation/hardhat-network-helpers"; +import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; +import { time } from "@nomicfoundation/hardhat-toolbox/network-helpers"; +import { TypedContractEvent, TypedEventLog } from "../../typechain/common"; -/** - * Get a specific named event from a transaction log - * - * @param txReceipt The transaction receipt - * @param eventName The name of the event to get - * @returns The event data, if found - */ -export const getEvent = async ( - txReceipt : ContractReceipt, - eventName : string, -) : Promise | undefined> => { - const customEvent = txReceipt.events?.filter(event => { - if (event.event === eventName) return event; - }); - - return customEvent; -}; - -export const getDomainHashFromReceipt = async ( - txReceipt : ContractReceipt, - eventName = "DomainRegistered", -) : Promise => { - const customEvent = txReceipt.events?.find(event => { - if (event.event === eventName) return event; - }); - - if (!customEvent) throw Error("Event not found"); - - let domainHash = customEvent.args?.domainHash; - - if (!domainHash) { - domainHash = customEvent.args?.subdomainHash; - } - - if (!domainHash) throw Error("Domain hash not found"); - - return domainHash; -}; - -export const getTokenIdFromReceipt = async ( - txReceipt : ContractReceipt, - eventName = "DomainRegistered", -) : Promise => { - const tokenId = await getDomainHashFromReceipt(txReceipt, eventName); - return BigNumber.from(tokenId); -}; export const getDomainRegisteredEvents = async ({ zns, - domainHash = null, - tokenId = null, - registrant = null, + domainHash = undefined, + tokenId = undefined, + registrant = undefined, blockRange = 50, } : { zns : IZNSContracts; - domainHash ?: string | null; - tokenId ?: BigNumber | null; - registrant ?: string | null; + domainHash ?: string | undefined; + tokenId ?: bigint | undefined; + registrant ?: string | undefined; blockRange ?: number; -}) : Promise> => { +}) : Promise>> => { const latestBlock = await time.latestBlock(); const filter = zns.rootRegistrar.filters.DomainRegistered( - null, + undefined, domainHash, tokenId, - null, + undefined, registrant ); @@ -84,10 +38,10 @@ export const getDomainHashFromEvent = async ({ }) : Promise => { const latestBlock = await time.latestBlock(); const filter = zns.rootRegistrar.filters.DomainRegistered( - null, - null, - null, - null, + undefined, + undefined, + undefined, + undefined, user.address ); diff --git a/test/helpers/flows/registration.ts b/test/helpers/flows/registration.ts index bc6b21829..58954e683 100644 --- a/test/helpers/flows/registration.ts +++ b/test/helpers/flows/registration.ts @@ -1,6 +1,6 @@ import { IDomainConfigForTest, IZNSContracts, IPathRegResult } from "../types"; import { registrationWithSetup } from "../register-setup"; -import { BigNumber, ethers } from "ethers"; +import { ethers } from "ethers"; import { getPriceObject, getStakingOrProtocolFee } from "../pricing"; import { expect } from "chai"; import { getDomainRegisteredEvents } from "../events"; @@ -8,7 +8,6 @@ import { PaymentType } from "../constants"; import { getTokenContract } from "../tokens"; -// TODO sub: make these helpers better export const registerDomainPath = async ({ zns, domainConfigs, @@ -27,10 +26,10 @@ export const registerDomainPath = async ({ if (!parentHash) { parentHash = !!newAcc[idx - 1] ? newAcc[idx - 1].domainHash - : ethers.constants.HashZero; + : ethers.ZeroHash; } - const isRootDomain = parentHash === ethers.constants.HashZero; + const isRootDomain = parentHash === ethers.ZeroHash; // and get the necessary contracts based on parent config let paymentTokenContract; @@ -39,14 +38,14 @@ export const registerDomainPath = async ({ if (isRootDomain) { paymentTokenContract = zns.meowToken; // no beneficiary for root domain - beneficiary = ethers.constants.AddressZero; + beneficiary = ethers.ZeroAddress; } else { // grab all the important data of the parent const paymentConfig = await zns.treasury.paymentConfigs(parentHash); const { token: paymentTokenAddress } = paymentConfig; ({ beneficiary } = paymentConfig); - if (paymentTokenAddress === zns.meowToken.address) { + if (paymentTokenAddress === await zns.meowToken.getAddress()) { paymentTokenContract = zns.meowToken; } else { paymentTokenContract = getTokenContract(paymentTokenAddress, config.user); @@ -54,10 +53,10 @@ export const registerDomainPath = async ({ } const parentBalanceBefore = isRootDomain - ? BigNumber.from(0) + ? BigInt(0) : await paymentTokenContract.balanceOf(beneficiary); const userBalanceBefore = await paymentTokenContract.balanceOf(config.user.address); - const treasuryBalanceBefore = await paymentTokenContract.balanceOf(zns.treasury.address); + const treasuryBalanceBefore = await paymentTokenContract.balanceOf(await zns.treasury.getAddress()); const zeroVaultBalanceBefore = await paymentTokenContract.balanceOf(zns.zeroVaultAddress); const domainHash = await registrationWithSetup({ @@ -67,10 +66,10 @@ export const registerDomainPath = async ({ }); const parentBalanceAfter = isRootDomain - ? BigNumber.from(0) + ? BigInt(0) : await paymentTokenContract.balanceOf(beneficiary); const userBalanceAfter = await paymentTokenContract.balanceOf(config.user.address); - const treasuryBalanceAfter = await paymentTokenContract.balanceOf(zns.treasury.address); + const treasuryBalanceAfter = await paymentTokenContract.balanceOf(await zns.treasury.getAddress()); const zeroVaultBalanceAfter = await paymentTokenContract.balanceOf(zns.zeroVaultAddress); const domainObj = { @@ -109,13 +108,13 @@ export const validatePathRegistration = async ({ ) => { await acc; - let expectedPrice : BigNumber; - let stakeFee = BigNumber.from(0); + let expectedPrice : bigint; + let stakeFee = BigInt(0); // calc only needed for asymptotic pricing, otherwise it is fixed let parentHashFound = parentHash; if (!parentHashFound) { - parentHashFound = !!regResults[idx - 1] ? regResults[idx - 1].domainHash : ethers.constants.HashZero; + parentHashFound = !!regResults[idx - 1] ? regResults[idx - 1].domainHash : ethers.ZeroHash; } const { @@ -125,12 +124,12 @@ export const validatePathRegistration = async ({ baseLength: curveBaseLength, precisionMultiplier: curvePrecisionMultiplier, feePercentage: curveFeePercentage, - } = await zns.curvePricer.priceConfigs(ethers.constants.HashZero); + } = await zns.curvePricer.priceConfigs(ethers.ZeroHash); let expParentBalDiff; let expTreasuryBalDiff; let paymentType; - if (parentHashFound === ethers.constants.HashZero) { + if (parentHashFound === ethers.ZeroHash) { ({ expectedPrice, } = getPriceObject( @@ -144,7 +143,7 @@ export const validatePathRegistration = async ({ feePercentage: curveFeePercentage, }, )); - expParentBalDiff = BigNumber.from(0); + expParentBalDiff = BigInt(0); expTreasuryBalDiff = expectedPrice; } else { const config = await zns.subRegistrar.distrConfigs(parentHashFound); @@ -153,7 +152,7 @@ export const validatePathRegistration = async ({ } = config; ({ paymentType } = config); - if (pricerContract === zns.fixedPricer.address) { + if (pricerContract === await zns.fixedPricer.getAddress()) { ({ price: expectedPrice, fee: stakeFee, @@ -188,16 +187,16 @@ export const validatePathRegistration = async ({ if (paymentType === PaymentType.STAKE) { expParentBalDiff = stakeFee; } else { - stakeFee = BigNumber.from(0); + stakeFee = BigInt(0); expParentBalDiff = expectedPrice; } expTreasuryBalDiff = paymentType === PaymentType.STAKE - ? expectedPrice : BigNumber.from(0); + ? expectedPrice : BigInt(0); } const protocolFee = getStakingOrProtocolFee( - expectedPrice.add(stakeFee), + expectedPrice + stakeFee, curveFeePercentage ); @@ -214,22 +213,22 @@ export const validatePathRegistration = async ({ } = regResults[idx]; // fee can be 0 - const expUserBalDiff = expectedPrice.add(stakeFee).add(protocolFee); + const expUserBalDiff = expectedPrice + stakeFee + protocolFee; // check user balance - expect(userBalanceBefore.sub(userBalanceAfter)).to.eq(expUserBalDiff); + expect(userBalanceBefore - userBalanceAfter).to.eq(expUserBalDiff); // check parent balance - expect(parentBalanceAfter.sub(parentBalanceBefore)).to.eq(expParentBalDiff); + expect(parentBalanceAfter - parentBalanceBefore).to.eq(expParentBalDiff); // check treasury stakes - expect(treasuryBalanceAfter.sub(treasuryBalanceBefore)).to.eq(expTreasuryBalDiff); + expect(treasuryBalanceAfter - treasuryBalanceBefore).to.eq(expTreasuryBalDiff); // check zero vault exempt fees - expect(zeroVaultBalanceAfter.sub(zeroVaultBalanceBefore)).to.eq(protocolFee); + expect(zeroVaultBalanceAfter - zeroVaultBalanceBefore).to.eq(protocolFee); const dataFromReg = await zns.registry.getDomainRecord(domainHash); expect(dataFromReg.owner).to.eq(user.address); - expect(dataFromReg.resolver).to.eq(zns.addressResolver.address); + expect(dataFromReg.resolver).to.eq(await zns.addressResolver.getAddress()); - const tokenId = BigNumber.from(domainHash).toString(); + const tokenId = BigInt(domainHash).toString(); const tokenOwner = await zns.domainToken.ownerOf(tokenId); expect(tokenOwner).to.eq(user.address); diff --git a/test/helpers/pricing.ts b/test/helpers/pricing.ts index 30ae987b8..7afae8a9b 100644 --- a/test/helpers/pricing.ts +++ b/test/helpers/pricing.ts @@ -1,4 +1,3 @@ -import { BigNumber } from "ethers"; import { DEFAULT_PERCENTAGE_BASIS, DEFAULT_PRICE_CONFIG } from "./constants"; import { IFixedPriceConfig } from "./types"; import { ICurvePriceConfig } from "../../src/deploy/missions/types"; @@ -15,7 +14,7 @@ import { ICurvePriceConfig } from "../../src/deploy/missions/types"; export const getCurvePrice = ( name : string, priceConfig = DEFAULT_PRICE_CONFIG, -) : BigNumber => { +) : bigint => { // Get price configuration for contract const { maxPrice, @@ -25,27 +24,25 @@ export const getCurvePrice = ( precisionMultiplier, } = priceConfig; - if (baseLength.eq(0)) return maxPrice; + if (baseLength === 0n) return maxPrice; - if (BigNumber.from(name.length).lte(baseLength)) { + if (BigInt(name.length) <= baseLength) { return maxPrice; } - if (BigNumber.from(name.length).gt(maxLength)) { + if (BigInt(name.length) > maxLength) { return minPrice; } - const base = baseLength.mul(maxPrice).div(name.length); + const base = baseLength * maxPrice / BigInt(name.length); - return base.div(precisionMultiplier).mul(precisionMultiplier); + return base / precisionMultiplier * precisionMultiplier; }; export const getStakingOrProtocolFee = ( - forAmount : BigNumber, - feePercentage : BigNumber = DEFAULT_PRICE_CONFIG.feePercentage, -) => forAmount - .mul(feePercentage) - .div(DEFAULT_PERCENTAGE_BASIS); + forAmount : bigint, + feePercentage : bigint = DEFAULT_PRICE_CONFIG.feePercentage, +) => forAmount * feePercentage / DEFAULT_PERCENTAGE_BASIS; /** * Get the domain name price, the registration fee and the total @@ -59,9 +56,9 @@ export const getPriceObject = ( name : string, priceConfig : Partial | Partial = DEFAULT_PRICE_CONFIG, ) : { - totalPrice : BigNumber; - expectedPrice : BigNumber; - stakeFee : BigNumber; + totalPrice : bigint; + expectedPrice : bigint; + stakeFee : bigint; } => { let expectedPrice; const configLen = Object.keys(priceConfig).length; @@ -77,7 +74,7 @@ export const getPriceObject = ( const stakeFee = getStakingOrProtocolFee(expectedPrice, feePercentage); - const totalPrice = expectedPrice.add(stakeFee); + const totalPrice = expectedPrice + stakeFee; return { totalPrice, diff --git a/test/helpers/register-setup.ts b/test/helpers/register-setup.ts index bff7a099f..51c9e0a3d 100644 --- a/test/helpers/register-setup.ts +++ b/test/helpers/register-setup.ts @@ -1,17 +1,17 @@ -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { - ICurvePriceConfig, IDistributionConfig, IFixedPriceConfig, IFullDistributionConfig, IZNSContracts, } from "./types"; -import { BigNumber, ContractReceipt, ethers } from "ethers"; +import { ContractTransactionReceipt, ethers } from "ethers"; import { getDomainHashFromEvent } from "./events"; import { distrConfigEmpty, fullDistrConfigEmpty, DEFAULT_TOKEN_URI, paymentConfigEmpty } from "./constants"; import { getTokenContract } from "./tokens"; +import { ICurvePriceConfig } from "../../src/deploy/missions/types"; -const { AddressZero } = ethers.constants; +const { ZeroAddress } = ethers; export const defaultRootRegistration = async ({ @@ -28,7 +28,7 @@ export const defaultRootRegistration = async ({ domainContent ?: string; tokenURI ?: string; distrConfig ?: IDistributionConfig; -}) : Promise => { +}) : Promise => { const tx = await zns.rootRegistrar.connect(user).registerRootDomain( domainName, domainContent, // Arbitrary address value @@ -52,21 +52,21 @@ export const approveForParent = async ({ domainLabel : string; }) => { const { pricerContract } = await zns.subRegistrar.distrConfigs(parentHash); - let price = BigNumber.from(0); - let parentFee = BigNumber.from(0); - if (pricerContract === zns.curvePricer.address) { + let price = BigInt(0); + let parentFee = BigInt(0); + if (pricerContract === await zns.curvePricer.getAddress()) { [price, parentFee] = await zns.curvePricer.getPriceAndFee(parentHash, domainLabel, false); - } else if (pricerContract === zns.fixedPricer.address) { + } else if (pricerContract === await zns.fixedPricer.getAddress()) { [price, parentFee] = await zns.fixedPricer.getPriceAndFee(parentHash, domainLabel, false); } const { token: tokenAddress } = await zns.treasury.paymentConfigs(parentHash); const tokenContract = getTokenContract(tokenAddress, user); - const protocolFee = await zns.curvePricer.getFeeForPrice(ethers.constants.HashZero, price.add(parentFee)); - const toApprove = price.add(parentFee).add(protocolFee); + const protocolFee = await zns.curvePricer.getFeeForPrice(ethers.ZeroHash, price + parentFee); + const toApprove = price + parentFee + protocolFee; - return tokenContract.connect(user).approve(zns.treasury.address, toApprove); + return tokenContract.connect(user).approve(await zns.treasury.getAddress(), toApprove); }; /** @@ -129,7 +129,7 @@ export const registrationWithSetup = async ({ : distrConfigEmpty; // register domain - if (!parentHash || parentHash === ethers.constants.HashZero) { + if (!parentHash || parentHash === ethers.ZeroHash) { await defaultRootRegistration({ user, zns, @@ -165,11 +165,8 @@ export const registrationWithSetup = async ({ if (!hasConfig) return domainHash; - // TODO sub: do we want to set these up upon registration or make a user call these separately? - // optimize for the best UX! - // maybe add API to SubReg to set these up in one tx? // set up prices - if (fullConfig.distrConfig.pricerContract === zns.fixedPricer.address && setConfigs) { + if (fullConfig.distrConfig.pricerContract === await zns.fixedPricer.getAddress() && setConfigs) { await zns.fixedPricer.connect(user).setPriceConfig( domainHash, { @@ -177,7 +174,7 @@ export const registrationWithSetup = async ({ isSet: true, }, ); - } else if (fullConfig.distrConfig.pricerContract === zns.curvePricer.address && setConfigs) { + } else if (fullConfig.distrConfig.pricerContract === await zns.curvePricer.getAddress() && setConfigs) { await zns.curvePricer.connect(user).setPriceConfig( domainHash, { @@ -187,7 +184,7 @@ export const registrationWithSetup = async ({ ); } - if (fullConfig.paymentConfig.token !== AddressZero && setConfigs) { + if (fullConfig.paymentConfig.token !== ZeroAddress && setConfigs) { // set up payment config await zns.treasury.connect(user).setPaymentConfig( domainHash, diff --git a/test/helpers/tokens.ts b/test/helpers/tokens.ts index b3d37b588..15b723f1d 100644 --- a/test/helpers/tokens.ts +++ b/test/helpers/tokens.ts @@ -1,24 +1,11 @@ -import { BigNumber } from "ethers"; -import { IERC20__factory } from "../../typechain"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { ERC20, IERC20__factory } from "../../typechain"; +import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; -export const ETH_MULTIPLIER = BigNumber.from(10).pow(BigNumber.from(18)); - -export const toTokenValue = ( - value : number | string | BigNumber, - decimals : number | string | BigNumber = 18 -) => BigNumber.from(value) - .mul( - BigNumber.from(10) - .pow( - BigNumber.from(decimals) - ) - ); export const getTokenContract = ( address : string, signer : SignerWithAddress -) => { +) : ERC20 => { const ierc20 = IERC20__factory.connect(address, signer); - return ierc20.attach(address); + return ierc20.attach(address) as ERC20; }; diff --git a/test/helpers/types.ts b/test/helpers/types.ts index 046bc1757..1d7dfd997 100644 --- a/test/helpers/types.ts +++ b/test/helpers/types.ts @@ -1,4 +1,3 @@ -import { BigNumber } from "ethers"; import { ZNSAccessController, ZNSAddressResolver, @@ -27,10 +26,8 @@ import { ZNSTreasuryUpgradeMock__factory, MeowTokenMock, } from "../../typechain"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; -import { AccessType, PaymentType } from "./constants"; +import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { ICurvePriceConfig } from "../../src/deploy/missions/types"; -export { ICurvePriceConfig } from "../../src/deploy/missions/types"; export type Maybe = T | undefined; @@ -38,10 +35,10 @@ export type Maybe = T | undefined; export type GeneralContractGetter = Promise< string | boolean -| BigNumber -| Array -| [string, BigNumber] -& { token : string; amount : BigNumber; } +| bigint +| Array +| [string, bigint] +& { token : string; amount : bigint; } | [string, string] & { token : string; beneficiary : string; } | ICurvePriceConfig @@ -79,12 +76,12 @@ export type ZNSContract = ZNSDomainToken; export interface IFixedPriceConfig { - price : BigNumber; - feePercentage : BigNumber; + price : bigint; + feePercentage : bigint; } export interface RegistrarConfig { - treasury : ZNSTreasury; + treasuryAddress : string; registryAddress : string; curvePricerAddress : string; domainTokenAddress : string; @@ -109,15 +106,15 @@ export interface DeployZNSParams { governorAddresses : Array; adminAddresses : Array; priceConfig ?: ICurvePriceConfig; - registrationFeePerc ?: BigNumber; + registrationFeePerc ?: bigint; zeroVaultAddress ?: string; isTenderlyRun ?: boolean; } export interface IDistributionConfig { pricerContract : string; - paymentType : PaymentType; - accessType : AccessType; + paymentType : bigint; + accessType : bigint; } export interface IPaymentConfig { @@ -142,13 +139,13 @@ export interface IDomainConfigForTest { export interface IPathRegResult { domainHash : string; - userBalanceBefore : BigNumber; - userBalanceAfter : BigNumber; - parentBalanceBefore : BigNumber; - parentBalanceAfter : BigNumber; - treasuryBalanceBefore : BigNumber; - treasuryBalanceAfter : BigNumber; - zeroVaultBalanceBefore : BigNumber; - zeroVaultBalanceAfter : BigNumber; + userBalanceBefore : bigint; + userBalanceAfter : bigint; + parentBalanceBefore : bigint; + parentBalanceAfter : bigint; + treasuryBalanceBefore : bigint; + treasuryBalanceAfter : bigint; + zeroVaultBalanceBefore : bigint; + zeroVaultBalanceAfter : bigint; } diff --git a/test/helpers/utils.ts b/test/helpers/utils.ts index d9fb7b8b2..ff18b4789 100644 --- a/test/helpers/utils.ts +++ b/test/helpers/utils.ts @@ -7,8 +7,8 @@ export const getProxyImplAddress = async (proxyAddress : string) => { try { impl = await upgrades.erc1967.getImplementationAddress(proxyAddress); } catch (e) { - const padded = await ethers.provider.getStorageAt(proxyAddress, implSlotErc1967); - impl = ethers.utils.hexStripZeros(padded); + const padded = await ethers.provider.getStorage(proxyAddress, implSlotErc1967); + impl = ethers.toBeHex(ethers.stripZerosLeft(padded)); } return impl; diff --git a/test/helpers/validate-upgrade.ts b/test/helpers/validate-upgrade.ts index 4747218bf..d0db5bfd9 100644 --- a/test/helpers/validate-upgrade.ts +++ b/test/helpers/validate-upgrade.ts @@ -1,7 +1,6 @@ import { expect } from "chai"; -import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers"; +import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers"; import { ZNSContract, ZNSContractMock, ZNSContractMockFactory, GeneralContractGetter } from "./types"; -import { BigNumber } from "ethers"; export const validateUpgrade = async ( @@ -13,23 +12,23 @@ export const validateUpgrade = async ( ) => { const preVals = await Promise.all(getters); - await contract.connect(deployer).upgradeTo(upgradeContract.address); + await contract.connect(deployer).upgradeTo(await upgradeContract.getAddress()); // Typechain doesn't update the generated interface for the contract after upgrading // so we use the new factory to attach to the existing address instead - const upgradedContract = upgradeContractFactory.attach(contract.address); + const upgradedContract = upgradeContractFactory.attach(await contract.getAddress()) as ZNSContractMock; // Because every upgraded contract will have the same additions to it, // we can be sure these functions exist - const newNumber = BigNumber.from("123"); + const newNumber = BigInt("123"); await upgradedContract.connect(deployer).setNewMapping(newNumber); - await upgradedContract.setNewMappingSpecific(newNumber.add(1), deployer.address); + await upgradedContract.setNewMappingSpecific(newNumber + 1n, deployer.address); await upgradedContract.setNewNumber(newNumber); await upgradedContract.setNewAddress(deployer.address); const postUpgradeCalls = [ upgradedContract.connect(deployer).newMapping(newNumber), - upgradedContract.newMapping(newNumber.add(1)), + upgradedContract.newMapping(newNumber + 1n), upgradedContract.newNumber(), upgradedContract.newAddress(), ]; @@ -54,4 +53,4 @@ export const validateUpgrade = async ( expect(mappingCallSpecific).to.eq(deployer.address); expect(numberCall).to.eq(newNumber); expect(addressCall).to.eq(deployer.address); -}; \ No newline at end of file +}; diff --git a/yarn.lock b/yarn.lock index 49235a25b..eed7a46a1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,6 +7,11 @@ resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== +"@adraffy/ens-normalize@1.10.0": + version "1.10.0" + resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.0.tgz#d2a39395c587e092d77cbbc80acf956a54f38bf7" + integrity sha512-nA9XHtlAkYfJxY7bce8DcN7eKxWWCWkU+1GR9d+U6MbNpfwQp8TI7vqOsBsMcHoT4mBu2kypKoSKnghEzOOq5Q== + "@aws-crypto/sha256-js@1.2.2": version "1.2.2" resolved "https://registry.yarnpkg.com/@aws-crypto/sha256-js/-/sha256-js-1.2.2.tgz#02acd1a1fda92896fc5a28ec7c6e164644ea32fc" @@ -26,11 +31,11 @@ tslib "^1.11.1" "@aws-sdk/types@^3.1.0": - version "3.449.0" - resolved "https://registry.yarnpkg.com/@aws-sdk/types/-/types-3.449.0.tgz#0da2f8cdb344fbe9846de371a04c6dde1bcaf83f" - integrity sha512-tSQPAvknheB6XnRoc+AuEgdzn2KhY447hddeVW0Mbg8Yl9es4u4TKVINloKDEyUrCKhB/1f93Hb5uJkPe/e/Ww== + version "3.468.0" + resolved "https://registry.yarnpkg.com/@aws-sdk/types/-/types-3.468.0.tgz#f97b34fc92a800d1d8b866f47693ae8f3d46517b" + integrity sha512-rx/9uHI4inRbp2tw3Y4Ih4PNZkVj32h7WneSg3MVgVjAoVD5Zti9KhS5hkvsBxfgmQmg0AQbE+b1sy5WGAgntA== dependencies: - "@smithy/types" "^2.4.0" + "@smithy/types" "^2.7.0" tslib "^2.5.0" "@aws-sdk/util-utf8-browser@^3.0.0": @@ -41,11 +46,11 @@ tslib "^2.3.1" "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.21.4": - version "7.22.13" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e" - integrity sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w== + version "7.23.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.23.5.tgz#9009b69a8c602293476ad598ff53e4562e15c244" + integrity sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA== dependencies: - "@babel/highlight" "^7.22.13" + "@babel/highlight" "^7.23.4" chalk "^2.4.2" "@babel/helper-validator-identifier@^7.22.20": @@ -53,22 +58,58 @@ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== -"@babel/highlight@^7.22.13": - version "7.22.20" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.20.tgz#4ca92b71d80554b01427815e06f2df965b9c1f54" - integrity sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg== +"@babel/highlight@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b" + integrity sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A== dependencies: "@babel/helper-validator-identifier" "^7.22.20" chalk "^2.4.2" js-tokens "^4.0.0" "@babel/runtime@^7.4.4": - version "7.23.2" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.2.tgz#062b0ac103261d68a966c4c7baf2ae3e62ec3885" - integrity sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg== + version "7.23.6" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.6.tgz#c05e610dc228855dc92ef1b53d07389ed8ab521d" + integrity sha512-zHd0eUrf5GZoOWVCXp6koAKQTfZV07eit6bGPmJgnZdnSAvvZee6zniW2XMF7Cmc4ISOOnPy3QaSiIJGJkVEDQ== dependencies: regenerator-runtime "^0.14.0" +"@chainsafe/as-sha256@^0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@chainsafe/as-sha256/-/as-sha256-0.3.1.tgz#3639df0e1435cab03f4d9870cc3ac079e57a6fc9" + integrity sha512-hldFFYuf49ed7DAakWVXSJODuq3pzJEguD8tQ7h+sGkM18vja+OFoJI9krnGmgzyuZC2ETX0NOIcCTy31v2Mtg== + +"@chainsafe/persistent-merkle-tree@^0.4.2": + version "0.4.2" + resolved "https://registry.yarnpkg.com/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.4.2.tgz#4c9ee80cc57cd3be7208d98c40014ad38f36f7ff" + integrity sha512-lLO3ihKPngXLTus/L7WHKaw9PnNJWizlOF1H9NNzHP6Xvh82vzg9F2bzkXhYIFshMZ2gTCEz8tq6STe7r5NDfQ== + dependencies: + "@chainsafe/as-sha256" "^0.3.1" + +"@chainsafe/persistent-merkle-tree@^0.5.0": + version "0.5.0" + resolved "https://registry.yarnpkg.com/@chainsafe/persistent-merkle-tree/-/persistent-merkle-tree-0.5.0.tgz#2b4a62c9489a5739dedd197250d8d2f5427e9f63" + integrity sha512-l0V1b5clxA3iwQLXP40zYjyZYospQLZXzBVIhhr9kDg/1qHZfzzHw0jj4VPBijfYCArZDlPkRi1wZaV2POKeuw== + dependencies: + "@chainsafe/as-sha256" "^0.3.1" + +"@chainsafe/ssz@^0.10.0": + version "0.10.2" + resolved "https://registry.yarnpkg.com/@chainsafe/ssz/-/ssz-0.10.2.tgz#c782929e1bb25fec66ba72e75934b31fd087579e" + integrity sha512-/NL3Lh8K+0q7A3LsiFq09YXS9fPE+ead2rr7vM2QK8PLzrNsw3uqrif9bpRX5UxgeRjM+vYi+boCM3+GM4ovXg== + dependencies: + "@chainsafe/as-sha256" "^0.3.1" + "@chainsafe/persistent-merkle-tree" "^0.5.0" + +"@chainsafe/ssz@^0.9.2": + version "0.9.4" + resolved "https://registry.yarnpkg.com/@chainsafe/ssz/-/ssz-0.9.4.tgz#696a8db46d6975b600f8309ad3a12f7c0e310497" + integrity sha512-77Qtg2N1ayqs4Bg/wvnWfg5Bta7iy7IRh8XqXh7oNMeP2HBbBwx8m6yTpA8p0EHItWPEBkgZd5S5/LSlp3GXuQ== + dependencies: + "@chainsafe/as-sha256" "^0.3.1" + "@chainsafe/persistent-merkle-tree" "^0.4.2" + case "^1.6.3" + "@colors/colors@1.5.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" @@ -159,10 +200,10 @@ resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63" integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA== -"@eslint/eslintrc@^2.1.3": - version "2.1.3" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.3.tgz#797470a75fe0fbd5a53350ee715e85e87baff22d" - integrity sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA== +"@eslint/eslintrc@^2.1.4": + version "2.1.4" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.1.4.tgz#388a269f0f25c1b6adc317b5a2c55714894c70ad" + integrity sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ== dependencies: ajv "^6.12.4" debug "^4.3.2" @@ -174,10 +215,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.53.0": - version "8.53.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.53.0.tgz#bea56f2ed2b5baea164348ff4d5a879f6f81f20d" - integrity sha512-Kn7K8dx/5U6+cT1yEhpX1w4PCSg0M+XyRILPgvwcEBjerFWCwQj5sbr3/VmxqV0JGHCBCzyd6LxypEuehypY1w== +"@eslint/js@8.55.0": + version "8.55.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.55.0.tgz#b721d52060f369aa259cf97392403cb9ce892ec6" + integrity sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA== "@ethereumjs/rlp@^4.0.1": version "4.0.1" @@ -193,22 +234,7 @@ ethereum-cryptography "^2.0.0" micro-ftch "^0.3.1" -"@ethersproject/abi@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.5.0.tgz#fb52820e22e50b854ff15ce1647cc508d6660613" - integrity sha512-loW7I4AohP5KycATvc0MgujU6JyCHPqHdeoo9z3Nr9xEiNioxa65ccdm1+fsoJhkuhdRtfcL8cfyGamz2AxZ5w== - dependencies: - "@ethersproject/address" "^5.5.0" - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/constants" "^5.5.0" - "@ethersproject/hash" "^5.5.0" - "@ethersproject/keccak256" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/strings" "^5.5.0" - -"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.0.9", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.5.0", "@ethersproject/abi@^5.6.3", "@ethersproject/abi@^5.7.0": +"@ethersproject/abi@5.7.0", "@ethersproject/abi@^5.0.9", "@ethersproject/abi@^5.1.2", "@ethersproject/abi@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== @@ -223,20 +249,7 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@ethersproject/abstract-provider@5.5.1": - version "5.5.1" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.5.1.tgz#2f1f6e8a3ab7d378d8ad0b5718460f85649710c5" - integrity sha512-m+MA/ful6eKbxpr99xUYeRvLkfnlqzrF8SZ46d/xFB1A7ZVknYc/sXJG0RcufF52Qn2jeFj1hhcoQ7IXjNKUqg== - dependencies: - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/networks" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/transactions" "^5.5.0" - "@ethersproject/web" "^5.5.0" - -"@ethersproject/abstract-provider@5.7.0", "@ethersproject/abstract-provider@^5.5.0", "@ethersproject/abstract-provider@^5.7.0": +"@ethersproject/abstract-provider@5.7.0", "@ethersproject/abstract-provider@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz#b0a8550f88b6bf9d51f90e4795d48294630cb9ef" integrity sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw== @@ -249,18 +262,7 @@ "@ethersproject/transactions" "^5.7.0" "@ethersproject/web" "^5.7.0" -"@ethersproject/abstract-signer@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.5.0.tgz#590ff6693370c60ae376bf1c7ada59eb2a8dd08d" - integrity sha512-lj//7r250MXVLKI7sVarXAbZXbv9P50lgmJQGr2/is82EwEb8r7HrxsmMqAjTsztMYy7ohrIhGMIml+Gx4D3mA== - dependencies: - "@ethersproject/abstract-provider" "^5.5.0" - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - -"@ethersproject/abstract-signer@5.7.0", "@ethersproject/abstract-signer@^5.5.0", "@ethersproject/abstract-signer@^5.7.0": +"@ethersproject/abstract-signer@5.7.0", "@ethersproject/abstract-signer@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" integrity sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ== @@ -271,18 +273,7 @@ "@ethersproject/logger" "^5.7.0" "@ethersproject/properties" "^5.7.0" -"@ethersproject/address@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.5.0.tgz#bcc6f576a553f21f3dd7ba17248f81b473c9c78f" - integrity sha512-l4Nj0eWlTUh6ro5IbPTgbpT4wRbdH5l8CQf7icF7sb/SI3Nhd9Y9HzhonTSTi6CefI0necIw7LJqQPopPLZyWw== - dependencies: - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/keccak256" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/rlp" "^5.5.0" - -"@ethersproject/address@5.7.0", "@ethersproject/address@^5.0.2", "@ethersproject/address@^5.5.0", "@ethersproject/address@^5.7.0": +"@ethersproject/address@5.7.0", "@ethersproject/address@^5.0.2", "@ethersproject/address@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== @@ -293,29 +284,14 @@ "@ethersproject/logger" "^5.7.0" "@ethersproject/rlp" "^5.7.0" -"@ethersproject/base64@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.5.0.tgz#881e8544e47ed976930836986e5eb8fab259c090" - integrity sha512-tdayUKhU1ljrlHzEWbStXazDpsx4eg1dBXUSI6+mHlYklOXoXF6lZvw8tnD6oVaWfnMxAgRSKROg3cVKtCcppA== - dependencies: - "@ethersproject/bytes" "^5.5.0" - -"@ethersproject/base64@5.7.0", "@ethersproject/base64@^5.5.0", "@ethersproject/base64@^5.7.0": +"@ethersproject/base64@5.7.0", "@ethersproject/base64@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.7.0.tgz#ac4ee92aa36c1628173e221d0d01f53692059e1c" integrity sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ== dependencies: "@ethersproject/bytes" "^5.7.0" -"@ethersproject/basex@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.5.0.tgz#e40a53ae6d6b09ab4d977bd037010d4bed21b4d3" - integrity sha512-ZIodwhHpVJ0Y3hUCfUucmxKsWQA5TMnavp5j/UOuDdzZWzJlRmuOjcTMIGgHCYuZmHt36BfiSyQPSRskPxbfaQ== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - -"@ethersproject/basex@5.7.0", "@ethersproject/basex@^5.5.0", "@ethersproject/basex@^5.7.0": +"@ethersproject/basex@5.7.0", "@ethersproject/basex@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/basex/-/basex-5.7.0.tgz#97034dc7e8938a8ca943ab20f8a5e492ece4020b" integrity sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw== @@ -323,16 +299,7 @@ "@ethersproject/bytes" "^5.7.0" "@ethersproject/properties" "^5.7.0" -"@ethersproject/bignumber@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.5.0.tgz#875b143f04a216f4f8b96245bde942d42d279527" - integrity sha512-6Xytlwvy6Rn3U3gKEc1vP7nR92frHkv6wtVr95LFR3jREXiCPzdWxKQ1cx4JGQBXxcguAwjA8murlYN2TSiEbg== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - bn.js "^4.11.9" - -"@ethersproject/bignumber@5.7.0", "@ethersproject/bignumber@^5.5.0", "@ethersproject/bignumber@^5.7.0": +"@ethersproject/bignumber@5.7.0", "@ethersproject/bignumber@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== @@ -341,50 +308,20 @@ "@ethersproject/logger" "^5.7.0" bn.js "^5.2.1" -"@ethersproject/bytes@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.5.0.tgz#cb11c526de657e7b45d2e0f0246fb3b9d29a601c" - integrity sha512-ABvc7BHWhZU9PNM/tANm/Qx4ostPGadAuQzWTr3doklZOhDlmcBqclrQe/ZXUIj3K8wC28oYeuRa+A37tX9kog== - dependencies: - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/bytes@5.7.0", "@ethersproject/bytes@^5.5.0", "@ethersproject/bytes@^5.7.0": +"@ethersproject/bytes@5.7.0", "@ethersproject/bytes@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== dependencies: "@ethersproject/logger" "^5.7.0" -"@ethersproject/constants@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.5.0.tgz#d2a2cd7d94bd1d58377d1d66c4f53c9be4d0a45e" - integrity sha512-2MsRRVChkvMWR+GyMGY4N1sAX9Mt3J9KykCsgUFd/1mwS0UH1qw+Bv9k1UJb3X3YJYFco9H20pjSlOIfCG5HYQ== - dependencies: - "@ethersproject/bignumber" "^5.5.0" - -"@ethersproject/constants@5.7.0", "@ethersproject/constants@^5.5.0", "@ethersproject/constants@^5.7.0": +"@ethersproject/constants@5.7.0", "@ethersproject/constants@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.7.0.tgz#df80a9705a7e08984161f09014ea012d1c75295e" integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA== dependencies: "@ethersproject/bignumber" "^5.7.0" -"@ethersproject/contracts@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.5.0.tgz#b735260d4bd61283a670a82d5275e2a38892c197" - integrity sha512-2viY7NzyvJkh+Ug17v7g3/IJC8HqZBDcOjYARZLdzRxrfGlRgmYgl6xPRKVbEzy1dWKw/iv7chDcS83pg6cLxg== - dependencies: - "@ethersproject/abi" "^5.5.0" - "@ethersproject/abstract-provider" "^5.5.0" - "@ethersproject/abstract-signer" "^5.5.0" - "@ethersproject/address" "^5.5.0" - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/constants" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/transactions" "^5.5.0" - "@ethersproject/contracts@5.7.0", "@ethersproject/contracts@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/contracts/-/contracts-5.7.0.tgz#c305e775abd07e48aa590e1a877ed5c316f8bd1e" @@ -401,21 +338,7 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/transactions" "^5.7.0" -"@ethersproject/hash@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.5.0.tgz#7cee76d08f88d1873574c849e0207dcb32380cc9" - integrity sha512-dnGVpK1WtBjmnp3mUT0PlU2MpapnwWI0PibldQEq1408tQBAbZpPidkWoVVuNMOl/lISO3+4hXZWCL3YV7qzfg== - dependencies: - "@ethersproject/abstract-signer" "^5.5.0" - "@ethersproject/address" "^5.5.0" - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/keccak256" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/strings" "^5.5.0" - -"@ethersproject/hash@5.7.0", "@ethersproject/hash@^5.5.0", "@ethersproject/hash@^5.7.0": +"@ethersproject/hash@5.7.0", "@ethersproject/hash@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== @@ -430,25 +353,7 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@ethersproject/hdnode@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.5.0.tgz#4a04e28f41c546f7c978528ea1575206a200ddf6" - integrity sha512-mcSOo9zeUg1L0CoJH7zmxwUG5ggQHU1UrRf8jyTYy6HxdZV+r0PBoL1bxr+JHIPXRzS6u/UW4mEn43y0tmyF8Q== - dependencies: - "@ethersproject/abstract-signer" "^5.5.0" - "@ethersproject/basex" "^5.5.0" - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/pbkdf2" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/sha2" "^5.5.0" - "@ethersproject/signing-key" "^5.5.0" - "@ethersproject/strings" "^5.5.0" - "@ethersproject/transactions" "^5.5.0" - "@ethersproject/wordlists" "^5.5.0" - -"@ethersproject/hdnode@5.7.0", "@ethersproject/hdnode@^5.5.0", "@ethersproject/hdnode@^5.7.0": +"@ethersproject/hdnode@5.7.0", "@ethersproject/hdnode@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/hdnode/-/hdnode-5.7.0.tgz#e627ddc6b466bc77aebf1a6b9e47405ca5aef9cf" integrity sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg== @@ -466,26 +371,7 @@ "@ethersproject/transactions" "^5.7.0" "@ethersproject/wordlists" "^5.7.0" -"@ethersproject/json-wallets@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.5.0.tgz#dd522d4297e15bccc8e1427d247ec8376b60e325" - integrity sha512-9lA21XQnCdcS72xlBn1jfQdj2A1VUxZzOzi9UkNdnokNKke/9Ya2xA9aIK1SC3PQyBDLt4C+dfps7ULpkvKikQ== - dependencies: - "@ethersproject/abstract-signer" "^5.5.0" - "@ethersproject/address" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/hdnode" "^5.5.0" - "@ethersproject/keccak256" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/pbkdf2" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/random" "^5.5.0" - "@ethersproject/strings" "^5.5.0" - "@ethersproject/transactions" "^5.5.0" - aes-js "3.0.0" - scrypt-js "3.0.1" - -"@ethersproject/json-wallets@5.7.0", "@ethersproject/json-wallets@^5.5.0", "@ethersproject/json-wallets@^5.7.0": +"@ethersproject/json-wallets@5.7.0", "@ethersproject/json-wallets@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz#5e3355287b548c32b368d91014919ebebddd5360" integrity sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g== @@ -504,15 +390,7 @@ aes-js "3.0.0" scrypt-js "3.0.1" -"@ethersproject/keccak256@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.5.0.tgz#e4b1f9d7701da87c564ffe336f86dcee82983492" - integrity sha512-5VoFCTjo2rYbBe1l2f4mccaRFN/4VQEYFwwn04aJV2h7qf4ZvI2wFxUE1XOX+snbwCLRzIeikOqtAoPwMza9kg== - dependencies: - "@ethersproject/bytes" "^5.5.0" - js-sha3 "0.8.0" - -"@ethersproject/keccak256@5.7.0", "@ethersproject/keccak256@^5.5.0", "@ethersproject/keccak256@^5.7.0": +"@ethersproject/keccak256@5.7.0", "@ethersproject/keccak256@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== @@ -520,39 +398,19 @@ "@ethersproject/bytes" "^5.7.0" js-sha3 "0.8.0" -"@ethersproject/logger@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.5.0.tgz#0c2caebeff98e10aefa5aef27d7441c7fd18cf5d" - integrity sha512-rIY/6WPm7T8n3qS2vuHTUBPdXHl+rGxWxW5okDfo9J4Z0+gRRZT0msvUdIJkE4/HS29GUMziwGaaKO2bWONBrg== - -"@ethersproject/logger@5.7.0", "@ethersproject/logger@^5.5.0", "@ethersproject/logger@^5.7.0": +"@ethersproject/logger@5.7.0", "@ethersproject/logger@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== -"@ethersproject/networks@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.5.0.tgz#babec47cab892c51f8dd652ce7f2e3e14283981a" - integrity sha512-KWfP3xOnJeF89Uf/FCJdV1a2aDJe5XTN2N52p4fcQ34QhDqQFkgQKZ39VGtiqUgHcLI8DfT0l9azC3KFTunqtA== - dependencies: - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/networks@5.7.1", "@ethersproject/networks@^5.5.0", "@ethersproject/networks@^5.7.0": +"@ethersproject/networks@5.7.1", "@ethersproject/networks@^5.7.0", "@ethersproject/networks@^5.7.1": version "5.7.1" resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.1.tgz#118e1a981d757d45ccea6bb58d9fd3d9db14ead6" integrity sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ== dependencies: "@ethersproject/logger" "^5.7.0" -"@ethersproject/pbkdf2@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.5.0.tgz#e25032cdf02f31505d47afbf9c3e000d95c4a050" - integrity sha512-SaDvQFvXPnz1QGpzr6/HToLifftSXGoXrbpZ6BvoZhmx4bNLHrxDe8MZisuecyOziP1aVEwzC2Hasj+86TgWVg== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/sha2" "^5.5.0" - -"@ethersproject/pbkdf2@5.7.0", "@ethersproject/pbkdf2@^5.5.0", "@ethersproject/pbkdf2@^5.7.0": +"@ethersproject/pbkdf2@5.7.0", "@ethersproject/pbkdf2@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz#d2267d0a1f6e123f3771007338c47cccd83d3102" integrity sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw== @@ -560,46 +418,14 @@ "@ethersproject/bytes" "^5.7.0" "@ethersproject/sha2" "^5.7.0" -"@ethersproject/properties@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.5.0.tgz#61f00f2bb83376d2071baab02245f92070c59995" - integrity sha512-l3zRQg3JkD8EL3CPjNK5g7kMx4qSwiR60/uk5IVjd3oq1MZR5qUg40CNOoEJoX5wc3DyY5bt9EbMk86C7x0DNA== - dependencies: - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/properties@5.7.0", "@ethersproject/properties@^5.5.0", "@ethersproject/properties@^5.7.0": +"@ethersproject/properties@5.7.0", "@ethersproject/properties@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.7.0.tgz#a6e12cb0439b878aaf470f1902a176033067ed30" integrity sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw== dependencies: "@ethersproject/logger" "^5.7.0" -"@ethersproject/providers@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.5.0.tgz#bc2876a8fe5e0053ed9828b1f3767ae46e43758b" - integrity sha512-xqMbDnS/FPy+J/9mBLKddzyLLAQFjrVff5g00efqxPzcAwXiR+SiCGVy6eJ5iAIirBOATjx7QLhDNPGV+AEQsw== - dependencies: - "@ethersproject/abstract-provider" "^5.5.0" - "@ethersproject/abstract-signer" "^5.5.0" - "@ethersproject/address" "^5.5.0" - "@ethersproject/basex" "^5.5.0" - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/constants" "^5.5.0" - "@ethersproject/hash" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/networks" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/random" "^5.5.0" - "@ethersproject/rlp" "^5.5.0" - "@ethersproject/sha2" "^5.5.0" - "@ethersproject/strings" "^5.5.0" - "@ethersproject/transactions" "^5.5.0" - "@ethersproject/web" "^5.5.0" - bech32 "1.1.4" - ws "7.4.6" - -"@ethersproject/providers@5.7.2", "@ethersproject/providers@^5.7.2": +"@ethersproject/providers@5.7.2", "@ethersproject/providers@^5.7.1", "@ethersproject/providers@^5.7.2": version "5.7.2" resolved "https://registry.yarnpkg.com/@ethersproject/providers/-/providers-5.7.2.tgz#f8b1a4f275d7ce58cf0a2eec222269a08beb18cb" integrity sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg== @@ -625,15 +451,7 @@ bech32 "1.1.4" ws "7.4.6" -"@ethersproject/random@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.5.0.tgz#305ed9e033ca537735365ac12eed88580b0f81f9" - integrity sha512-egGYZwZ/YIFKMHcoBUo8t3a8Hb/TKYX8BCBoLjudVCZh892welR3jOxgOmb48xznc9bTcMm7Tpwc1gHC1PFNFQ== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/random@5.7.0", "@ethersproject/random@^5.5.0", "@ethersproject/random@^5.7.0": +"@ethersproject/random@5.7.0", "@ethersproject/random@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/random/-/random-5.7.0.tgz#af19dcbc2484aae078bb03656ec05df66253280c" integrity sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ== @@ -641,15 +459,7 @@ "@ethersproject/bytes" "^5.7.0" "@ethersproject/logger" "^5.7.0" -"@ethersproject/rlp@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.5.0.tgz#530f4f608f9ca9d4f89c24ab95db58ab56ab99a0" - integrity sha512-hLv8XaQ8PTI9g2RHoQGf/WSxBfTB/NudRacbzdxmst5VHAqd1sMibWG7SENzT5Dj3yZ3kJYx+WiRYEcQTAkcYA== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/rlp@5.7.0", "@ethersproject/rlp@^5.5.0", "@ethersproject/rlp@^5.7.0": +"@ethersproject/rlp@5.7.0", "@ethersproject/rlp@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== @@ -657,16 +467,7 @@ "@ethersproject/bytes" "^5.7.0" "@ethersproject/logger" "^5.7.0" -"@ethersproject/sha2@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.5.0.tgz#a40a054c61f98fd9eee99af2c3cc6ff57ec24db7" - integrity sha512-B5UBoglbCiHamRVPLA110J+2uqsifpZaTmid2/7W5rbtYVz6gus6/hSDieIU/6gaKIDcOj12WnOdiymEUHIAOA== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - hash.js "1.1.7" - -"@ethersproject/sha2@5.7.0", "@ethersproject/sha2@^5.5.0", "@ethersproject/sha2@^5.7.0": +"@ethersproject/sha2@5.7.0", "@ethersproject/sha2@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/sha2/-/sha2-5.7.0.tgz#9a5f7a7824ef784f7f7680984e593a800480c9fb" integrity sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw== @@ -675,19 +476,7 @@ "@ethersproject/logger" "^5.7.0" hash.js "1.1.7" -"@ethersproject/signing-key@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.5.0.tgz#2aa37169ce7e01e3e80f2c14325f624c29cedbe0" - integrity sha512-5VmseH7qjtNmDdZBswavhotYbWB0bOwKIlOTSlX14rKn5c11QmJwGt4GHeo7NrL/Ycl7uo9AHvEqs5xZgFBTng== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - bn.js "^4.11.9" - elliptic "6.5.4" - hash.js "1.1.7" - -"@ethersproject/signing-key@5.7.0", "@ethersproject/signing-key@^5.5.0", "@ethersproject/signing-key@^5.7.0": +"@ethersproject/signing-key@5.7.0", "@ethersproject/signing-key@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.7.0.tgz#06b2df39411b00bc57c7c09b01d1e41cf1b16ab3" integrity sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q== @@ -699,18 +488,6 @@ elliptic "6.5.4" hash.js "1.1.7" -"@ethersproject/solidity@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.5.0.tgz#2662eb3e5da471b85a20531e420054278362f93f" - integrity sha512-9NgZs9LhGMj6aCtHXhtmFQ4AN4sth5HuFXVvAQtzmm0jpSCNOTGtrHZJAeYTh7MBjRR8brylWZxBZR9zDStXbw== - dependencies: - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/keccak256" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/sha2" "^5.5.0" - "@ethersproject/strings" "^5.5.0" - "@ethersproject/solidity@5.7.0", "@ethersproject/solidity@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/solidity/-/solidity-5.7.0.tgz#5e9c911d8a2acce2a5ebb48a5e2e0af20b631cb8" @@ -723,16 +500,7 @@ "@ethersproject/sha2" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@ethersproject/strings@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.5.0.tgz#e6784d00ec6c57710755699003bc747e98c5d549" - integrity sha512-9fy3TtF5LrX/wTrBaT8FGE6TDJyVjOvXynXJz5MT5azq+E6D92zuKNx7i29sWW2FjVOaWjAsiZ1ZWznuduTIIQ== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/constants" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - -"@ethersproject/strings@5.7.0", "@ethersproject/strings@^5.5.0", "@ethersproject/strings@^5.7.0": +"@ethersproject/strings@5.7.0", "@ethersproject/strings@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== @@ -741,22 +509,7 @@ "@ethersproject/constants" "^5.7.0" "@ethersproject/logger" "^5.7.0" -"@ethersproject/transactions@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.5.0.tgz#7e9bf72e97bcdf69db34fe0d59e2f4203c7a2908" - integrity sha512-9RZYSKX26KfzEd/1eqvv8pLauCKzDTub0Ko4LfIgaERvRuwyaNV78mJs7cpIgZaDl6RJui4o49lHwwCM0526zA== - dependencies: - "@ethersproject/address" "^5.5.0" - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/constants" "^5.5.0" - "@ethersproject/keccak256" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/rlp" "^5.5.0" - "@ethersproject/signing-key" "^5.5.0" - -"@ethersproject/transactions@5.7.0", "@ethersproject/transactions@^5.5.0", "@ethersproject/transactions@^5.7.0": +"@ethersproject/transactions@5.7.0", "@ethersproject/transactions@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== @@ -771,15 +524,6 @@ "@ethersproject/rlp" "^5.7.0" "@ethersproject/signing-key" "^5.7.0" -"@ethersproject/units@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.5.0.tgz#104d02db5b5dc42cc672cc4587bafb87a95ee45e" - integrity sha512-7+DpjiZk4v6wrikj+TCyWWa9dXLNU73tSTa7n0TSJDxkYbV3Yf1eRh9ToMLlZtuctNYu9RDNNy2USq3AdqSbag== - dependencies: - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/constants" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/units@5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/units/-/units-5.7.0.tgz#637b563d7e14f42deeee39245275d477aae1d8b1" @@ -789,27 +533,6 @@ "@ethersproject/constants" "^5.7.0" "@ethersproject/logger" "^5.7.0" -"@ethersproject/wallet@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.5.0.tgz#322a10527a440ece593980dca6182f17d54eae75" - integrity sha512-Mlu13hIctSYaZmUOo7r2PhNSd8eaMPVXe1wxrz4w4FCE4tDYBywDH+bAR1Xz2ADyXGwqYMwstzTrtUVIsKDO0Q== - dependencies: - "@ethersproject/abstract-provider" "^5.5.0" - "@ethersproject/abstract-signer" "^5.5.0" - "@ethersproject/address" "^5.5.0" - "@ethersproject/bignumber" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/hash" "^5.5.0" - "@ethersproject/hdnode" "^5.5.0" - "@ethersproject/json-wallets" "^5.5.0" - "@ethersproject/keccak256" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/random" "^5.5.0" - "@ethersproject/signing-key" "^5.5.0" - "@ethersproject/transactions" "^5.5.0" - "@ethersproject/wordlists" "^5.5.0" - "@ethersproject/wallet@5.7.0", "@ethersproject/wallet@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/wallet/-/wallet-5.7.0.tgz#4e5d0790d96fe21d61d38fb40324e6c7ef350b2d" @@ -831,18 +554,7 @@ "@ethersproject/transactions" "^5.7.0" "@ethersproject/wordlists" "^5.7.0" -"@ethersproject/web@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.5.0.tgz#0e5bb21a2b58fb4960a705bfc6522a6acf461e28" - integrity sha512-BEgY0eL5oH4mAo37TNYVrFeHsIXLRxggCRG/ksRIxI2X5uj5IsjGmcNiRN/VirQOlBxcUhCgHhaDLG4m6XAVoA== - dependencies: - "@ethersproject/base64" "^5.5.0" - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/strings" "^5.5.0" - -"@ethersproject/web@5.7.1", "@ethersproject/web@^5.5.0", "@ethersproject/web@^5.7.0": +"@ethersproject/web@5.7.1", "@ethersproject/web@^5.7.0": version "5.7.1" resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.1.tgz#de1f285b373149bee5928f4eb7bcb87ee5fbb4ae" integrity sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w== @@ -853,18 +565,7 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@ethersproject/wordlists@5.5.0": - version "5.5.0" - resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.5.0.tgz#aac74963aa43e643638e5172353d931b347d584f" - integrity sha512-bL0UTReWDiaQJJYOC9sh/XcRu/9i2jMrzf8VLRmPKx58ckSlOJiohODkECCO50dtLZHcGU6MLXQ4OOrgBwP77Q== - dependencies: - "@ethersproject/bytes" "^5.5.0" - "@ethersproject/hash" "^5.5.0" - "@ethersproject/logger" "^5.5.0" - "@ethersproject/properties" "^5.5.0" - "@ethersproject/strings" "^5.5.0" - -"@ethersproject/wordlists@5.7.0", "@ethersproject/wordlists@^5.5.0", "@ethersproject/wordlists@^5.7.0": +"@ethersproject/wordlists@5.7.0", "@ethersproject/wordlists@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/wordlists/-/wordlists-5.7.0.tgz#8fb2c07185d68c3e09eb3bfd6e779ba2774627f5" integrity sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA== @@ -964,6 +665,13 @@ dependencies: "@noble/hashes" "1.3.1" +"@noble/curves@1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" + integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== + dependencies: + "@noble/hashes" "1.3.2" + "@noble/hashes@1.2.0", "@noble/hashes@~1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.2.0.tgz#a3150eeb09cc7ab207ebf6d7b9ad311a9bdbed12" @@ -974,11 +682,16 @@ resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.1.tgz#8831ef002114670c603c458ab8b11328406953a9" integrity sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA== -"@noble/hashes@~1.3.0", "@noble/hashes@~1.3.1": +"@noble/hashes@1.3.2": version "1.3.2" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== +"@noble/hashes@~1.3.0", "@noble/hashes@~1.3.1": + version "1.3.3" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.3.tgz#39908da56a4adc270147bb07968bf3b16cfe1699" + integrity sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA== + "@noble/secp256k1@1.7.1", "@noble/secp256k1@~1.7.0": version "1.7.1" resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.1.tgz#b251c70f824ce3ca7f8dc3df08d58f005cc0507c" @@ -1005,29 +718,31 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@nomicfoundation/ethereumjs-block@4.2.2", "@nomicfoundation/ethereumjs-block@^4.0.0": - version "4.2.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-4.2.2.tgz#f317078c810a54381c682d0c12e1e81acfc11599" - integrity sha512-atjpt4gc6ZGZUPHBAQaUJsm1l/VCo7FmyQ780tMGO8QStjLdhz09dXynmhwVTy5YbRr0FOh/uX3QaEM0yIB2Zg== - dependencies: - "@nomicfoundation/ethereumjs-common" "3.1.2" - "@nomicfoundation/ethereumjs-rlp" "4.0.3" - "@nomicfoundation/ethereumjs-trie" "5.0.5" - "@nomicfoundation/ethereumjs-tx" "4.1.2" - "@nomicfoundation/ethereumjs-util" "8.0.6" +"@nomicfoundation/ethereumjs-block@5.0.2": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-5.0.2.tgz#13a7968f5964f1697da941281b7f7943b0465d04" + integrity sha512-hSe6CuHI4SsSiWWjHDIzWhSiAVpzMUcDRpWYzN0T9l8/Rz7xNn3elwVOJ/tAyS0LqL6vitUD78Uk7lQDXZun7Q== + dependencies: + "@nomicfoundation/ethereumjs-common" "4.0.2" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + "@nomicfoundation/ethereumjs-trie" "6.0.2" + "@nomicfoundation/ethereumjs-tx" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" ethereum-cryptography "0.1.3" + ethers "^5.7.1" -"@nomicfoundation/ethereumjs-blockchain@6.2.2", "@nomicfoundation/ethereumjs-blockchain@^6.0.0": - version "6.2.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-6.2.2.tgz#9f79dd2b3dc73f5d5a220f7d8a734330c4c26320" - integrity sha512-6AIB2MoTEPZJLl6IRKcbd8mUmaBAQ/NMe3O7OsAOIiDjMNPPH5KaUQiLfbVlegT4wKIg/GOsFH7XlH2KDVoJNg== - dependencies: - "@nomicfoundation/ethereumjs-block" "4.2.2" - "@nomicfoundation/ethereumjs-common" "3.1.2" - "@nomicfoundation/ethereumjs-ethash" "2.0.5" - "@nomicfoundation/ethereumjs-rlp" "4.0.3" - "@nomicfoundation/ethereumjs-trie" "5.0.5" - "@nomicfoundation/ethereumjs-util" "8.0.6" +"@nomicfoundation/ethereumjs-blockchain@7.0.2": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-7.0.2.tgz#45323b673b3d2fab6b5008535340d1b8fea7d446" + integrity sha512-8UUsSXJs+MFfIIAKdh3cG16iNmWzWC/91P40sazNvrqhhdR/RtGDlFk2iFTGbBAZPs2+klZVzhRX8m2wvuvz3w== + dependencies: + "@nomicfoundation/ethereumjs-block" "5.0.2" + "@nomicfoundation/ethereumjs-common" "4.0.2" + "@nomicfoundation/ethereumjs-ethash" "3.0.2" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + "@nomicfoundation/ethereumjs-trie" "6.0.2" + "@nomicfoundation/ethereumjs-tx" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" abstract-level "^1.0.3" debug "^4.3.3" ethereum-cryptography "0.1.3" @@ -1035,130 +750,152 @@ lru-cache "^5.1.1" memory-level "^1.0.0" -"@nomicfoundation/ethereumjs-common@3.1.2", "@nomicfoundation/ethereumjs-common@^3.0.0": - version "3.1.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-3.1.2.tgz#041086da66ed40f2bf2a2116a1f2f0fcf33fb80d" - integrity sha512-JAEBpIua62dyObHM9KI2b4wHZcRQYYge9gxiygTWa3lNCr2zo+K0TbypDpgiNij5MCGNWP1eboNfNfx1a3vkvA== +"@nomicfoundation/ethereumjs-common@4.0.2": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.2.tgz#a15d1651ca36757588fdaf2a7d381a150662a3c3" + integrity sha512-I2WGP3HMGsOoycSdOTSqIaES0ughQTueOsddJ36aYVpI3SN8YSusgRFLwzDJwRFVIYDKx/iJz0sQ5kBHVgdDwg== dependencies: - "@nomicfoundation/ethereumjs-util" "8.0.6" + "@nomicfoundation/ethereumjs-util" "9.0.2" crc-32 "^1.2.0" -"@nomicfoundation/ethereumjs-ethash@2.0.5": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-2.0.5.tgz#0c605812f6f4589a9f6d597db537bbf3b86469db" - integrity sha512-xlLdcICGgAYyYmnI3r1t0R5fKGBJNDQSOQxXNjVO99JmxJIdXR5MgPo5CSJO1RpyzKOgzi3uIFn8agv564dZEQ== +"@nomicfoundation/ethereumjs-ethash@3.0.2": + version "3.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-3.0.2.tgz#da77147f806401ee996bfddfa6487500118addca" + integrity sha512-8PfoOQCcIcO9Pylq0Buijuq/O73tmMVURK0OqdjhwqcGHYC2PwhbajDh7GZ55ekB0Px197ajK3PQhpKoiI/UPg== dependencies: - "@nomicfoundation/ethereumjs-block" "4.2.2" - "@nomicfoundation/ethereumjs-rlp" "4.0.3" - "@nomicfoundation/ethereumjs-util" "8.0.6" + "@nomicfoundation/ethereumjs-block" "5.0.2" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" abstract-level "^1.0.3" bigint-crypto-utils "^3.0.23" ethereum-cryptography "0.1.3" -"@nomicfoundation/ethereumjs-evm@1.3.2", "@nomicfoundation/ethereumjs-evm@^1.0.0": - version "1.3.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-1.3.2.tgz#f9d6bafd5c23d07ab75b8649d589af1a43b60bfc" - integrity sha512-I00d4MwXuobyoqdPe/12dxUQxTYzX8OckSaWsMcWAfQhgVDvBx6ffPyP/w1aL0NW7MjyerySPcSVfDJAMHjilw== +"@nomicfoundation/ethereumjs-evm@2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-2.0.2.tgz#4c2f4b84c056047102a4fa41c127454e3f0cfcf6" + integrity sha512-rBLcUaUfANJxyOx9HIdMX6uXGin6lANCulIm/pjMgRqfiCRMZie3WKYxTSd8ZE/d+qT+zTedBF4+VHTdTSePmQ== dependencies: - "@nomicfoundation/ethereumjs-common" "3.1.2" - "@nomicfoundation/ethereumjs-util" "8.0.6" - "@types/async-eventemitter" "^0.2.1" - async-eventemitter "^0.2.4" + "@ethersproject/providers" "^5.7.1" + "@nomicfoundation/ethereumjs-common" "4.0.2" + "@nomicfoundation/ethereumjs-tx" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" debug "^4.3.3" ethereum-cryptography "0.1.3" mcl-wasm "^0.7.1" rustbn.js "~0.2.0" -"@nomicfoundation/ethereumjs-rlp@4.0.3", "@nomicfoundation/ethereumjs-rlp@^4.0.0": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-4.0.3.tgz#8d9147fbd0d49e8f4c5ce729d226694a8fe03eb8" - integrity sha512-DZMzB/lqPK78T6MluyXqtlRmOMcsZbTTbbEyAjo0ncaff2mqu/k8a79PBcyvpgAhWD/R59Fjq/x3ro5Lof0AtA== +"@nomicfoundation/ethereumjs-rlp@5.0.2": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.2.tgz#4fee8dc58a53ac6ae87fb1fca7c15dc06c6b5dea" + integrity sha512-QwmemBc+MMsHJ1P1QvPl8R8p2aPvvVcKBbvHnQOKBpBztEo0omN0eaob6FeZS/e3y9NSe+mfu3nNFBHszqkjTA== -"@nomicfoundation/ethereumjs-statemanager@1.0.5", "@nomicfoundation/ethereumjs-statemanager@^1.0.0": - version "1.0.5" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-1.0.5.tgz#951cc9ff2c421d40233d2e9d0fe033db2391ee44" - integrity sha512-CAhzpzTR5toh/qOJIZUUOnWekUXuRqkkzaGAQrVcF457VhtCmr+ddZjjK50KNZ524c1XP8cISguEVNqJ6ij1sA== +"@nomicfoundation/ethereumjs-statemanager@2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-2.0.2.tgz#3ba4253b29b1211cafe4f9265fee5a0d780976e0" + integrity sha512-dlKy5dIXLuDubx8Z74sipciZnJTRSV/uHG48RSijhgm1V7eXYFC567xgKtsKiVZB1ViTP9iFL4B6Je0xD6X2OA== dependencies: - "@nomicfoundation/ethereumjs-common" "3.1.2" - "@nomicfoundation/ethereumjs-rlp" "4.0.3" - "@nomicfoundation/ethereumjs-trie" "5.0.5" - "@nomicfoundation/ethereumjs-util" "8.0.6" + "@nomicfoundation/ethereumjs-common" "4.0.2" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" debug "^4.3.3" ethereum-cryptography "0.1.3" - functional-red-black-tree "^1.0.1" + ethers "^5.7.1" + js-sdsl "^4.1.4" -"@nomicfoundation/ethereumjs-trie@5.0.5", "@nomicfoundation/ethereumjs-trie@^5.0.0": - version "5.0.5" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-5.0.5.tgz#bf31c9306dcbba2007fad668e96109ddb147040c" - integrity sha512-+8sNZrXkzvA1NH5F4kz5RSYl1I6iaRz7mAZRsyxOm0IVY4UaP43Ofvfp/TwOalFunurQrYB5pRO40+8FBcxFMA== +"@nomicfoundation/ethereumjs-trie@6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-6.0.2.tgz#9a6dbd28482dca1bc162d12b3733acab8cd12835" + integrity sha512-yw8vg9hBeLYk4YNg5MrSJ5H55TLOv2FSWUTROtDtTMMmDGROsAu+0tBjiNGTnKRi400M6cEzoFfa89Fc5k8NTQ== dependencies: - "@nomicfoundation/ethereumjs-rlp" "4.0.3" - "@nomicfoundation/ethereumjs-util" "8.0.6" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" + "@types/readable-stream" "^2.3.13" ethereum-cryptography "0.1.3" readable-stream "^3.6.0" -"@nomicfoundation/ethereumjs-tx@4.1.2", "@nomicfoundation/ethereumjs-tx@^4.0.0": - version "4.1.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-4.1.2.tgz#8659fad7f9094b7eb82aa6cc3c8097cb1c42ff31" - integrity sha512-emJBJZpmTdUa09cqxQqHaysbBI9Od353ZazeH7WgPb35miMgNY6mb7/3vBA98N5lUW/rgkiItjX0KZfIzihSoQ== +"@nomicfoundation/ethereumjs-tx@5.0.2": + version "5.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.2.tgz#117813b69c0fdc14dd0446698a64be6df71d7e56" + integrity sha512-T+l4/MmTp7VhJeNloMkM+lPU3YMUaXdcXgTGCf8+ZFvV9NYZTRLFekRwlG6/JMmVfIfbrW+dRRJ9A6H5Q/Z64g== dependencies: - "@nomicfoundation/ethereumjs-common" "3.1.2" - "@nomicfoundation/ethereumjs-rlp" "4.0.3" - "@nomicfoundation/ethereumjs-util" "8.0.6" + "@chainsafe/ssz" "^0.9.2" + "@ethersproject/providers" "^5.7.2" + "@nomicfoundation/ethereumjs-common" "4.0.2" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" ethereum-cryptography "0.1.3" -"@nomicfoundation/ethereumjs-util@8.0.6", "@nomicfoundation/ethereumjs-util@^8.0.0": - version "8.0.6" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-8.0.6.tgz#dbce5d258b017b37aa58b3a7c330ad59d10ccf0b" - integrity sha512-jOQfF44laa7xRfbfLXojdlcpkvxeHrE2Xu7tSeITsWFgoII163MzjOwFEzSNozHYieFysyoEMhCdP+NY5ikstw== +"@nomicfoundation/ethereumjs-util@9.0.2": + version "9.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.2.tgz#16bdc1bb36f333b8a3559bbb4b17dac805ce904d" + integrity sha512-4Wu9D3LykbSBWZo8nJCnzVIYGvGCuyiYLIJa9XXNVt1q1jUzHdB+sJvx95VGCpPkCT+IbLecW6yfzy3E1bQrwQ== dependencies: - "@nomicfoundation/ethereumjs-rlp" "4.0.3" + "@chainsafe/ssz" "^0.10.0" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" ethereum-cryptography "0.1.3" -"@nomicfoundation/ethereumjs-vm@^6.0.0": - version "6.4.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-6.4.2.tgz#af1cf62e6c0054bc2b7febc8556d032433d1b18c" - integrity sha512-PRTyxZMP6kx+OdAzBhuH1LD2Yw+hrSpaytftvaK//thDy2OI07S0nrTdbrdk7b8ZVPAc9H9oTwFBl3/wJ3w15g== - dependencies: - "@nomicfoundation/ethereumjs-block" "4.2.2" - "@nomicfoundation/ethereumjs-blockchain" "6.2.2" - "@nomicfoundation/ethereumjs-common" "3.1.2" - "@nomicfoundation/ethereumjs-evm" "1.3.2" - "@nomicfoundation/ethereumjs-rlp" "4.0.3" - "@nomicfoundation/ethereumjs-statemanager" "1.0.5" - "@nomicfoundation/ethereumjs-trie" "5.0.5" - "@nomicfoundation/ethereumjs-tx" "4.1.2" - "@nomicfoundation/ethereumjs-util" "8.0.6" - "@types/async-eventemitter" "^0.2.1" - async-eventemitter "^0.2.4" +"@nomicfoundation/ethereumjs-vm@7.0.2": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-7.0.2.tgz#3b0852cb3584df0e18c182d0672a3596c9ca95e6" + integrity sha512-Bj3KZT64j54Tcwr7Qm/0jkeZXJMfdcAtRBedou+Hx0dPOSIgqaIr0vvLwP65TpHbak2DmAq+KJbW2KNtIoFwvA== + dependencies: + "@nomicfoundation/ethereumjs-block" "5.0.2" + "@nomicfoundation/ethereumjs-blockchain" "7.0.2" + "@nomicfoundation/ethereumjs-common" "4.0.2" + "@nomicfoundation/ethereumjs-evm" "2.0.2" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + "@nomicfoundation/ethereumjs-statemanager" "2.0.2" + "@nomicfoundation/ethereumjs-trie" "6.0.2" + "@nomicfoundation/ethereumjs-tx" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" debug "^4.3.3" ethereum-cryptography "0.1.3" - functional-red-black-tree "^1.0.1" mcl-wasm "^0.7.1" rustbn.js "~0.2.0" -"@nomicfoundation/hardhat-chai-matchers@1.0.6": - version "1.0.6" - resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-1.0.6.tgz#72a2e312e1504ee5dd73fe302932736432ba96bc" - integrity sha512-f5ZMNmabZeZegEfuxn/0kW+mm7+yV7VNDxLpMOMGXWFJ2l/Ct3QShujzDRF9cOkK9Ui/hbDeOWGZqyQALDXVCQ== +"@nomicfoundation/hardhat-chai-matchers@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-2.0.2.tgz#a0e5dbca43ba9560c096da162c0e3245303479d1" + integrity sha512-9Wu9mRtkj0U9ohgXYFbB/RQDa+PcEdyBm2suyEtsJf3PqzZEEjLUZgWnMjlFhATMk/fp3BjmnYVPrwl+gr8oEw== dependencies: - "@ethersproject/abi" "^5.1.2" "@types/chai-as-promised" "^7.1.3" chai-as-promised "^7.1.1" deep-eql "^4.0.1" ordinal "^1.0.3" -"@nomicfoundation/hardhat-network-helpers@^1.0.8": - version "1.0.9" - resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-network-helpers/-/hardhat-network-helpers-1.0.9.tgz#767449e8a2acda79306ac84626117583d95d25aa" - integrity sha512-OXWCv0cHpwLUO2u7bFxBna6dQtCC2Gg/aN/KtJLO7gmuuA28vgmVKYFRCDUqrbjujzgfwQ2aKyZ9Y3vSmDqS7Q== +"@nomicfoundation/hardhat-ethers@^3.0.4", "@nomicfoundation/hardhat-ethers@^3.0.5": + version "3.0.5" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-ethers/-/hardhat-ethers-3.0.5.tgz#0422c2123dec7c42e7fb2be8e1691f1d9708db56" + integrity sha512-RNFe8OtbZK6Ila9kIlHp0+S80/0Bu/3p41HUpaRIoHLm6X3WekTd83vob3rE54Duufu1edCiBDxspBzi2rxHHw== + dependencies: + debug "^4.1.1" + lodash.isequal "^4.5.0" + +"@nomicfoundation/hardhat-network-helpers@^1.0.9": + version "1.0.10" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-network-helpers/-/hardhat-network-helpers-1.0.10.tgz#c61042ceb104fdd6c10017859fdef6529c1d6585" + integrity sha512-R35/BMBlx7tWN5V6d/8/19QCwEmIdbnA4ZrsuXgvs8i2qFx5i7h6mH5pBS4Pwi4WigLH+upl6faYusrNPuzMrQ== dependencies: ethereumjs-util "^7.1.4" -"@nomicfoundation/hardhat-toolbox@2.0.2": +"@nomicfoundation/hardhat-toolbox@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-4.0.0.tgz#eb1f619218dd1414fa161dfec92d3e5e53a2f407" + integrity sha512-jhcWHp0aHaL0aDYj8IJl80v4SZXWMS1A2XxXa1CA6pBiFfJKuZinCkO6wb+POAt0LIfXB3gA3AgdcOccrcwBwA== + +"@nomicfoundation/hardhat-verify@^2.0.0": version "2.0.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-2.0.2.tgz#ec95f23b53cb4e71a1a7091380fa223aad18f156" - integrity sha512-vnN1AzxbvpSx9pfdRHbUzTRIXpMLPXnUlkW855VaDk6N1pwRaQ2gNzEmFAABk4lWf11E00PKwFd/q27HuwYrYg== + resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.0.2.tgz#085f8509a335db44ea3bf39a8561f1ce0462fea2" + integrity sha512-SXmLPHrfh801m0Dj/8v4stAM6OI0tFktDlWe1pn3k43bCCjn5TGqcVy7hCtauG8/AlQWNZhR+01qTovSSVTvXQ== + dependencies: + "@ethersproject/abi" "^5.1.2" + "@ethersproject/address" "^5.0.2" + cbor "^8.1.0" + chalk "^2.4.2" + debug "^4.1.1" + lodash.clonedeep "^4.5.0" + semver "^6.3.0" + table "^6.8.0" + undici "^5.14.0" "@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.1": version "0.1.1" @@ -1226,32 +963,6 @@ "@nomicfoundation/solidity-analyzer-win32-ia32-msvc" "0.1.1" "@nomicfoundation/solidity-analyzer-win32-x64-msvc" "0.1.1" -"@nomiclabs/hardhat-ethers@2.2.2": - version "2.2.2" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.2.2.tgz#812d48929c3bf8fe840ec29eab4b613693467679" - integrity sha512-NLDlDFL2us07C0jB/9wzvR0kuLivChJWCXTKcj3yqjZqMoYp7g7wwS157F70VHx/+9gHIBGzak5pKDwG8gEefA== - -"@nomiclabs/hardhat-ethers@^2.1.1": - version "2.2.3" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-ethers/-/hardhat-ethers-2.2.3.tgz#b41053e360c31a32c2640c9a45ee981a7e603fe0" - integrity sha512-YhzPdzb612X591FOe68q+qXVXGG2ANZRvDo0RRUtimev85rCrAlv/TLMEZw5c+kq9AbzocLTVX/h2jVIFPL9Xg== - -"@nomiclabs/hardhat-etherscan@3.1.7": - version "3.1.7" - resolved "https://registry.yarnpkg.com/@nomiclabs/hardhat-etherscan/-/hardhat-etherscan-3.1.7.tgz#72e3d5bd5d0ceb695e097a7f6f5ff6fcbf062b9a" - integrity sha512-tZ3TvSgpvsQ6B6OGmo1/Au6u8BrAkvs1mIC/eURA3xgIfznUZBhmpne8hv7BXUzw9xNL3fXdpOYgOQlVMTcoHQ== - dependencies: - "@ethersproject/abi" "^5.1.2" - "@ethersproject/address" "^5.0.2" - cbor "^8.1.0" - chalk "^2.4.2" - debug "^4.1.1" - fs-extra "^7.0.1" - lodash "^4.17.11" - semver "^6.3.0" - table "^6.8.0" - undici "^5.14.0" - "@npmcli/arborist@^6.5.0": version "6.5.0" resolved "https://registry.yarnpkg.com/@npmcli/arborist/-/arborist-6.5.0.tgz#ee24ecc56e4c387d78c3bce66918b386df6bd560" @@ -1431,9 +1142,9 @@ integrity sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA== "@octokit/core@^5.0.0": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@octokit/core/-/core-5.0.1.tgz#865da2b30d54354cccb6e30861ddfa0e24494780" - integrity sha512-lyeeeZyESFo+ffI801SaBKmCfsvarO+dgV8/0gD8u1d87clbEdWsP5yC+dSj3zLhb2eIf5SJrn6vDz9AheETHw== + version "5.0.2" + resolved "https://registry.yarnpkg.com/@octokit/core/-/core-5.0.2.tgz#ae7c5d61fdd98ba348a27c3cc510879a130b1234" + integrity sha512-cZUy1gUvd4vttMic7C0lwPed8IYXWYp8kHIMatyhY8t8n3Cpw2ILczkV5pGMPqef7v0bLo0pOHrEHarsau2Ydg== dependencies: "@octokit/auth-token" "^4.0.0" "@octokit/graphql" "^7.0.0" @@ -1444,12 +1155,11 @@ universal-user-agent "^6.0.0" "@octokit/endpoint@^9.0.0": - version "9.0.2" - resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-9.0.2.tgz#f9098bf15b893ac30c144c5e77da0322ad41b008" - integrity sha512-qhKW8YLIi+Kmc92FQUFGr++DYtkx/1fBv+Thua6baqnjnOsgBYJDCvWZR1YcINuHGOEQt416WOfE+A/oG60NBQ== + version "9.0.4" + resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-9.0.4.tgz#8afda5ad1ffc3073d08f2b450964c610b821d1ea" + integrity sha512-DWPLtr1Kz3tv8L0UvXTDP1fNwM0S+z6EJpRcvH66orY6Eld4XBMCSYsaWp4xIm61jTWxK68BrR7ibO+vSDnZqw== dependencies: "@octokit/types" "^12.0.0" - is-plain-object "^5.0.0" universal-user-agent "^6.0.0" "@octokit/graphql@^7.0.0": @@ -1461,17 +1171,17 @@ "@octokit/types" "^12.0.0" universal-user-agent "^6.0.0" -"@octokit/openapi-types@^19.0.2": - version "19.0.2" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-19.0.2.tgz#d72778fe2f6151314b6f0201fbc771bb741276fc" - integrity sha512-8li32fUDUeml/ACRp/njCWTsk5t17cfTM1jp9n08pBrqs5cDFJubtjsSnuz56r5Tad6jdEPJld7LxNp9dNcyjQ== +"@octokit/openapi-types@^19.1.0": + version "19.1.0" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-19.1.0.tgz#75ec7e64743870fc73e1ab4bc6ec252ecdd624dc" + integrity sha512-6G+ywGClliGQwRsjvqVYpklIfa7oRPA0vyhPQG/1Feh+B+wU0vGH1JiJ5T25d3g1JZYBHzR2qefLi9x8Gt+cpw== "@octokit/plugin-paginate-rest@^9.0.0": - version "9.1.4" - resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-9.1.4.tgz#9eca55e3e88f15b574e072732769e933bfa88d8b" - integrity sha512-MvZx4WvfhBnt7PtH5XE7HORsO7bBk4er1FgRIUr1qJ89NR2I6bWjGyKsxk8z42FPQ34hFQm0Baanh4gzdZR4gQ== + version "9.1.5" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-9.1.5.tgz#1705bcef4dcde1f4015ee58a63dc61b68648f480" + integrity sha512-WKTQXxK+bu49qzwv4qKbMMRXej1DU2gq017euWyKVudA6MldaSSQuxtz+vGbhxV4CjxpUxjZu6rM2wfc1FiWVg== dependencies: - "@octokit/types" "^12.3.0" + "@octokit/types" "^12.4.0" "@octokit/plugin-retry@^6.0.0": version "6.0.1" @@ -1483,11 +1193,11 @@ bottleneck "^2.15.3" "@octokit/plugin-throttling@^8.0.0": - version "8.1.2" - resolved "https://registry.yarnpkg.com/@octokit/plugin-throttling/-/plugin-throttling-8.1.2.tgz#8f1ca739bc5f00cf59ced81a7ae53037f9b1b4ef" - integrity sha512-oFba+ioR6HGb0fgqxMta7Kpk/MdffUTuUxNY856l1nXPvh7Qggp8w4AksRx1SDA8SGd+4cbrpkY4k1J/Xz8nZQ== + version "8.1.3" + resolved "https://registry.yarnpkg.com/@octokit/plugin-throttling/-/plugin-throttling-8.1.3.tgz#7fb0e001c0cb9383c6be07740b8ec326ed990f6b" + integrity sha512-pfyqaqpc0EXh5Cn4HX9lWYsZ4gGbjnSmUILeu4u2gnuM50K/wIk9s1Pxt3lVeVwekmITgN/nJdoh43Ka+vye8A== dependencies: - "@octokit/types" "^12.0.0" + "@octokit/types" "^12.2.0" bottleneck "^2.15.3" "@octokit/request-error@^5.0.0": @@ -1500,22 +1210,21 @@ once "^1.4.0" "@octokit/request@^8.0.1", "@octokit/request@^8.0.2": - version "8.1.5" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-8.1.5.tgz#902ae9565117a1dc410d10b5dbc44c4d27a89b71" - integrity sha512-zVKbNbX1xUluD9ZR4/tPs1yuYrK9xeh5fGZUXA6u04XGsTvomg0YO8/ZUC0FqAd49hAOEMFPAVUTh+2lBhOhLA== + version "8.1.6" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-8.1.6.tgz#a76a859c30421737a3918b40973c2ff369009571" + integrity sha512-YhPaGml3ncZC1NfXpP3WZ7iliL1ap6tLkAp6MvbK2fTTPytzVUyUesBBogcdMm86uRYO5rHaM1xIWxigWZ17MQ== dependencies: "@octokit/endpoint" "^9.0.0" "@octokit/request-error" "^5.0.0" "@octokit/types" "^12.0.0" - is-plain-object "^5.0.0" universal-user-agent "^6.0.0" -"@octokit/types@^12.0.0", "@octokit/types@^12.3.0": - version "12.3.0" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-12.3.0.tgz#e3f8bc53f65ef551e19cc1a0fea15adadec17d2d" - integrity sha512-nJ8X2HRr234q3w/FcovDlA+ttUU4m1eJAourvfUUtwAWeqL8AsyRqfnLvVnYn3NFbUnsmzQCzLNdFerPwdmcDQ== +"@octokit/types@^12.0.0", "@octokit/types@^12.2.0", "@octokit/types@^12.4.0": + version "12.4.0" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-12.4.0.tgz#8f97b601e91ce6b9776ed8152217e77a71be7aac" + integrity sha512-FLWs/AvZllw/AGVs+nJ+ELCDZZJk+kY0zMen118xhL2zD0s1etIUHm1odgjP7epxYU1ln7SZxEUWYop5bhsdgQ== dependencies: - "@octokit/openapi-types" "^19.0.2" + "@octokit/openapi-types" "^19.1.0" "@openzeppelin/contracts-400@npm:@openzeppelin/contracts@4.0.0": version "4.0.0" @@ -1537,22 +1246,169 @@ resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.3.tgz#00d7a8cf35a475b160b3f0293a6403c511099364" integrity sha512-He3LieZ1pP2TNt5JbkPA4PNT9WC3gOTOlDcFGJW4Le4QKqwmiNJCRt44APfxMxvq7OugU/cqYuPcSBzOw38DAg== -"@openzeppelin/hardhat-upgrades@1.26.0": - version "1.26.0" - resolved "https://registry.yarnpkg.com/@openzeppelin/hardhat-upgrades/-/hardhat-upgrades-1.26.0.tgz#a1c667c6fd59fa90d026bab461486ea2bffb948f" - integrity sha512-ggCvdIf7A9QcMedCaswecgt3N7hacx3qYOn+4bNPqMAwslo/SJ9vN4AhV0VWkDcY4CqFFou3RFQmDWNeLMBX9A== +"@openzeppelin/defender-admin-client@^1.52.0": + version "1.54.1" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-admin-client/-/defender-admin-client-1.54.1.tgz#b877972992b95a0dc3787f2ade2f044586621357" + integrity sha512-kRpSUdTsnSqntp4FOXIm95t+6VKHc8CUY2Si71VDuxs0q7HSPZkdpRPSntcolwEzWy9L4a8NS/QMwDF5NJ4X1g== + dependencies: + "@openzeppelin/defender-base-client" "1.54.1" + axios "^1.4.0" + ethers "^5.7.2" + lodash "^4.17.19" + node-fetch "^2.6.0" + +"@openzeppelin/defender-base-client@1.54.1", "@openzeppelin/defender-base-client@^1.52.0": + version "1.54.1" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-base-client/-/defender-base-client-1.54.1.tgz#ed777ae56908d5a920e1f72ac735c63694e65b30" + integrity sha512-DRGz/7KN3ZQwu28YWMOaojrC7jjPkz/uCwkC8/C8B11qwZhA5qIVvyhYHhhFOCl0J84+E3TNdvkPD2q3p2WaJw== dependencies: - "@openzeppelin/upgrades-core" "^1.26.2" + amazon-cognito-identity-js "^6.0.1" + async-retry "^1.3.3" + axios "^1.4.0" + lodash "^4.17.19" + node-fetch "^2.6.0" + +"@openzeppelin/defender-sdk-account-client@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-account-client/-/defender-sdk-account-client-1.7.0.tgz#843daab11b88f64e66b7bf869136bd38a78e01f3" + integrity sha512-U63V3MQjKlu72xch8isDNt14WFef+nazzBD92IspmZXFh/Pw82678vBAiR6IR1ZF7uKvTvPw3VKxxhXlJyAebg== + dependencies: + "@openzeppelin/defender-sdk-base-client" "^1.7.0" + axios "^1.4.0" + lodash "^4.17.21" + +"@openzeppelin/defender-sdk-action-client@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-action-client/-/defender-sdk-action-client-1.7.0.tgz#d0e425afb28d2f9d4974e26f8be18d99b7bb37a5" + integrity sha512-fSUr4yeU8J8BSai3Geg6nxjHexe23xt/QMsHvdqJHh5oyTy6XI1ePuy1n5La1JDE5p8P3mEIV0y/yg12TPG1kg== + dependencies: + "@openzeppelin/defender-sdk-base-client" "^1.7.0" + axios "^1.4.0" + glob "^7.1.6" + jszip "^3.10.1" + lodash "^4.17.21" + +"@openzeppelin/defender-sdk-base-client@^1.5.0", "@openzeppelin/defender-sdk-base-client@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-base-client/-/defender-sdk-base-client-1.7.0.tgz#2e170fb6361f72a955a570819ae984ef28beebcf" + integrity sha512-tNT/uaAS37I+EZUVcH6AyM6gfvxiiBQ+tdY8Jk73XKtEdiYd0pJnKyaeeUHIlvKCNS/wyxX6hlPVjeC4hy59Nw== + dependencies: + amazon-cognito-identity-js "^6.3.6" + async-retry "^1.3.3" + +"@openzeppelin/defender-sdk-deploy-client@^1.5.0", "@openzeppelin/defender-sdk-deploy-client@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-deploy-client/-/defender-sdk-deploy-client-1.7.0.tgz#4df169c4bbdc9704b2a2b70075731205f55615d6" + integrity sha512-eu/1khO5R0IdHio3BXlzUWZdr0Rgodoi49Djqtl3N78G8yN7t4RijfGrJm9rSqjrDFsjM41eWNHYGjc+KKyhKg== + dependencies: + "@ethersproject/abi" "^5.7.0" + "@openzeppelin/defender-sdk-base-client" "^1.7.0" + axios "^1.4.0" + lodash "^4.17.21" + +"@openzeppelin/defender-sdk-monitor-client@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-monitor-client/-/defender-sdk-monitor-client-1.7.0.tgz#dbd6a959c58f1840886142ab9e8470170288980a" + integrity sha512-+mMcPVrCeDiGvD8UUBZhDATawlXWlFmi+Pxie3k5CB9GrdUsrTOSNTe3FaSNyAM7YUViTvTwSW8BC9c6NIu3Gg== + dependencies: + "@ethersproject/abi" "^5.7.0" + "@openzeppelin/defender-sdk-base-client" "^1.7.0" + axios "^1.4.0" + lodash "^4.17.21" + +"@openzeppelin/defender-sdk-network-client@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-network-client/-/defender-sdk-network-client-1.7.0.tgz#028395c4fda0932492f7b867f8aa45d6aea03aa9" + integrity sha512-sGvY/6A8kRcYnXiDb/BTExRTRpTXsFlbQYm4+f9NAW9xJdFn3mHICbUmbVs5OfCpiHBrXVBAiho1pZVF8Vf/Xg== + dependencies: + "@ethersproject/abi" "^5.7.0" + "@openzeppelin/defender-sdk-base-client" "^1.7.0" + axios "^1.4.0" + lodash "^4.17.21" + +"@openzeppelin/defender-sdk-notification-channel-client@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-notification-channel-client/-/defender-sdk-notification-channel-client-1.7.0.tgz#72a371b6b964a24fce16af3636d63da773518861" + integrity sha512-jfHG9kGM3WPWj5A3/6B8KeU2D0gEeS4Fw385JFp/4d5lqudRa1zxujzrnOgI69vhM49tkUJMMqaD4XIlkbvLkQ== + dependencies: + "@ethersproject/abi" "^5.7.0" + "@openzeppelin/defender-sdk-base-client" "^1.7.0" + axios "^1.4.0" + lodash "^4.17.21" + +"@openzeppelin/defender-sdk-proposal-client@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-proposal-client/-/defender-sdk-proposal-client-1.7.0.tgz#83cfb83d921576d5ec36de3b42c05045d378d840" + integrity sha512-0fagDw5oEkcg3ykzK8+FEWZKQ7bS8bQ+aVn5h8EBt3ymcXBHIRdTiBvBTubsMNSsD/r2d3PXZJPO66o9Dahh5Q== + dependencies: + "@openzeppelin/defender-sdk-base-client" "^1.7.0" + axios "^1.4.0" + ethers "^6.9.0" + lodash "^4.17.21" + +"@openzeppelin/defender-sdk-relay-client@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-relay-client/-/defender-sdk-relay-client-1.7.0.tgz#be02253d22ef1a78078bf1c006680c639a9d2409" + integrity sha512-w6W8lhrXTbF+UwtT20cuaedFG7dNKHAU5Cs9XmcgMQsmsDN+Qw32g+4SJCbplr30yx51o0Y7jCGKV13dR6x93w== + dependencies: + "@openzeppelin/defender-sdk-base-client" "^1.7.0" + axios "^1.4.0" + lodash "^4.17.21" + +"@openzeppelin/defender-sdk-relay-signer-client@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk-relay-signer-client/-/defender-sdk-relay-signer-client-1.7.0.tgz#c8c2677efa4d25ec9c52081deb8345d454a8a2d5" + integrity sha512-iDZUc21gjkE3/bBP+jRSV+xckEqBp2ftOF5Y2aqWAbY98lK4FWY0p/BJPqoS7Hi0LBLG2RJoskRTs7ShDMPk5g== + dependencies: + "@ethersproject/bignumber" "^5.7.0" + "@ethersproject/bytes" "^5.7.0" + "@ethersproject/contracts" "^5.7.0" + "@ethersproject/logger" "^5.7.0" + "@ethersproject/networks" "^5.7.1" + "@ethersproject/properties" "^5.7.0" + "@ethersproject/random" "^5.7.0" + "@ethersproject/strings" "^5.7.0" + "@openzeppelin/defender-sdk-base-client" "^1.7.0" + amazon-cognito-identity-js "^6.3.6" + axios "^1.4.0" + lodash "^4.17.21" + +"@openzeppelin/defender-sdk@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sdk/-/defender-sdk-1.7.0.tgz#9012fe2e16192977f348bc59407a36d7a9d5a436" + integrity sha512-oDO2u9rxFp9emAk3yDNjU6wTDpfv3+qMy3/8KCWJtozMXm7gNFxDOBnB2K6HH28+jw+l76Cp6hfkii5MJcuQrQ== + dependencies: + "@openzeppelin/defender-sdk-account-client" "^1.7.0" + "@openzeppelin/defender-sdk-action-client" "^1.7.0" + "@openzeppelin/defender-sdk-base-client" "^1.7.0" + "@openzeppelin/defender-sdk-deploy-client" "^1.7.0" + "@openzeppelin/defender-sdk-monitor-client" "^1.7.0" + "@openzeppelin/defender-sdk-network-client" "^1.7.0" + "@openzeppelin/defender-sdk-notification-channel-client" "^1.7.0" + "@openzeppelin/defender-sdk-proposal-client" "^1.7.0" + "@openzeppelin/defender-sdk-relay-client" "^1.7.0" + "@openzeppelin/defender-sdk-relay-signer-client" "^1.7.0" + +"@openzeppelin/hardhat-upgrades@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@openzeppelin/hardhat-upgrades/-/hardhat-upgrades-2.4.3.tgz#4ddacec2d175e035fd4c66338820ae59130fedea" + integrity sha512-MYLbG6E3llFOOfphDSrFtjGmSRelfWc1hW0wcK1ANR2t0ZEetahGx4dAARPKev5R4WsckKT1wlxb8pmabczc2Q== + dependencies: + "@openzeppelin/defender-admin-client" "^1.52.0" + "@openzeppelin/defender-base-client" "^1.52.0" + "@openzeppelin/defender-sdk-base-client" "^1.5.0" + "@openzeppelin/defender-sdk-deploy-client" "^1.5.0" + "@openzeppelin/upgrades-core" "^1.31.2" chalk "^4.1.0" debug "^4.1.1" - defender-base-client "^1.44.0" - platform-deploy-client "^0.6.0" + ethereumjs-util "^7.1.5" proper-lockfile "^4.1.1" + undici "^5.14.0" -"@openzeppelin/upgrades-core@^1.26.2": - version "1.31.1" - resolved "https://registry.yarnpkg.com/@openzeppelin/upgrades-core/-/upgrades-core-1.31.1.tgz#d4f9ff703c4006d45c02e08819357a4f92860b8b" - integrity sha512-BdkTZwvBxgZ9BYYfhOhuivmqZLOZ/bm6mK5eEDZ36I3Fy64a9BDL/NusaDV5XAoGn4La/j9dZSbTtgP/6d8jAQ== +"@openzeppelin/upgrades-core@^1.31.2": + version "1.32.1" + resolved "https://registry.yarnpkg.com/@openzeppelin/upgrades-core/-/upgrades-core-1.32.1.tgz#77d5590df6c3a4c8c9b6c47355a6f246ec47e1f5" + integrity sha512-LlaWp2UX5BYT6BXs6OxJc1eSGMR0pz7DOltj6WCAJ038NdqdEIoItP5p9VOrw7ZdUdvUYHKHY4IinLY+ITxaig== dependencies: cbor "^9.0.0" chalk "^4.1.0" @@ -1590,9 +1446,9 @@ config-chain "^1.1.11" "@scure/base@~1.1.0": - version "1.1.3" - resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.3.tgz#8584115565228290a6c6c4961973e0903bb3df2f" - integrity sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q== + version "1.1.5" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.5.tgz#1d85d17269fe97694b9c592552dd9e5e33552157" + integrity sha512-Brj9FiG2W1MRQSTB212YVPRrcbjkv48FoZi/u4l/zds/ieRrqsh7aUf6CLwkAq61oKXr/ZlTzlY66gLIj3TFTQ== "@scure/bip32@1.1.5": version "1.1.5" @@ -1666,9 +1522,9 @@ p-reduce "^2.0.0" "@semantic-release/github@^9.0.0": - version "9.2.3" - resolved "https://registry.yarnpkg.com/@semantic-release/github/-/github-9.2.3.tgz#d8eeba7c00bf3145cee1bb9b60940d475af3e9f9" - integrity sha512-FAjXb1F84CVI6IG8fWi+XS9ErYD+s3MHkP03zBa3+GyUrV4kqwYu/WPppIciHxujGFR51SAWPkOY5rnH6ZlrxA== + version "9.2.5" + resolved "https://registry.yarnpkg.com/@semantic-release/github/-/github-9.2.5.tgz#69fd50759a2bb80dc1c38fded7f79e524a32c546" + integrity sha512-XWumFEOHiWllekymZjeVgkQCJ4YnD8020ZspAHYIIBNX8O4d/1ldeU5iNXu6NGkKlOCokyXh13KwVP0UEMm5kw== dependencies: "@octokit/core" "^5.0.0" "@octokit/plugin-paginate-rest" "^9.0.0" @@ -1683,7 +1539,7 @@ https-proxy-agent "^7.0.0" issue-parser "^6.0.0" lodash-es "^4.17.21" - mime "^3.0.0" + mime "^4.0.0" p-filter "^3.0.0" url-join "^5.0.0" @@ -1829,10 +1685,10 @@ resolved "https://registry.yarnpkg.com/@sindresorhus/merge-streams/-/merge-streams-1.0.0.tgz#9cd84cc15bc865a5ca35fcaae198eb899f7b5c90" integrity sha512-rUV5WyJrJLoloD4NDN1V1+LDMDWOa4OTsT4yYJwQNpTU6FWxkxHpL7eu4w+DmiH8x/EAM1otkPE1+LaspIbplw== -"@smithy/types@^2.4.0": - version "2.4.0" - resolved "https://registry.yarnpkg.com/@smithy/types/-/types-2.4.0.tgz#ed35e429e3ea3d089c68ed1bf951d0ccbdf2692e" - integrity sha512-iH1Xz68FWlmBJ9vvYeHifVMWJf82ONx+OybPW8ZGf5wnEv2S0UXcU4zwlwJkRXuLKpcSLHrraHbn2ucdVXLb4g== +"@smithy/types@^2.7.0": + version "2.7.0" + resolved "https://registry.yarnpkg.com/@smithy/types/-/types-2.7.0.tgz#6ed9ba5bff7c4d28c980cff967e6d8456840a4f3" + integrity sha512-1OIFyhK+vOkMbu4aN2HZz/MomREkrAC/HqY5mlJMUJfGrPRwijJDTeiN8Rnj9zUaB8ogXAfIOtZrrgqZ4w7Wnw== dependencies: tslib "^2.5.0" @@ -1857,20 +1713,21 @@ dependencies: defer-to-connect "^2.0.1" -"@tenderly/hardhat-tenderly@^1.7.4": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@tenderly/hardhat-tenderly/-/hardhat-tenderly-1.8.0.tgz#3c77f3a8bba4d801cd3d6a98dfec2abc9359fbc2" - integrity sha512-HzyYsFZEXVALz+vDn1XesvaqrSDr3vYqlMd/A+r6pi6er1dFRlbUPW5mdalPQsbPOsBIO+PXjOlrM7mGgBdYEQ== +"@tenderly/hardhat-tenderly@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@tenderly/hardhat-tenderly/-/hardhat-tenderly-2.0.1.tgz#a5e8a9aaeacd973ee006ed3b857f7808e71d4247" + integrity sha512-MaVq7UuWvsyqstya5wVwDc5ml5xo1pAS9PRQQZWhg/f6ats3KFboi9BP18Yhypjh4bPw2NPZOBip9u1lV0oaGw== dependencies: "@ethersproject/bignumber" "^5.7.0" - "@nomiclabs/hardhat-ethers" "^2.1.1" + "@nomicfoundation/hardhat-ethers" "^3.0.4" axios "^0.27.2" - ethers "^5.7.0" + ethers "^6.8.1" fs-extra "^10.1.0" - hardhat-deploy "^0.11.14" - js-yaml "^4.1.0" - tenderly "^0.6.0" + hardhat-deploy "^0.11.43" + tenderly "^0.7.0" + ts-node "^10.9.1" tslog "^4.3.1" + typescript "^5.2.2" "@tootallnate/once@2": version "2.0.0" @@ -1910,28 +1767,20 @@ "@tufjs/canonical-json" "1.0.0" minimatch "^9.0.0" -"@typechain/ethers-v5@10.1.0": - version "10.1.0" - resolved "https://registry.yarnpkg.com/@typechain/ethers-v5/-/ethers-v5-10.1.0.tgz#068d7dc7014502354696dab59590a7841091e951" - integrity sha512-3LIb+eUpV3mNCrjUKT5oqp8PBsZYSnVrkfk6pY/ZM0boRs2mKxjFZ7bktx42vfDye8PPz3NxtW4DL5NsNsFqlg== +"@typechain/ethers-v6@^0.5.1": + version "0.5.1" + resolved "https://registry.yarnpkg.com/@typechain/ethers-v6/-/ethers-v6-0.5.1.tgz#42fe214a19a8b687086c93189b301e2b878797ea" + integrity sha512-F+GklO8jBWlsaVV+9oHaPh5NJdd6rAKN4tklGfInX1Q7h0xPgVLP39Jl3eCulPB5qexI71ZFHwbljx4ZXNfouA== dependencies: lodash "^4.17.15" ts-essentials "^7.0.1" -"@typechain/hardhat@6.1.2": - version "6.1.2" - resolved "https://registry.yarnpkg.com/@typechain/hardhat/-/hardhat-6.1.2.tgz#d3beccc6937d93f9b437616b741f839a8b953693" - integrity sha512-k4Ea3pVITKB2DH8p1a5U38cyy7KZPD04Spo4q5b4wO+n2mT+uAz5dxckPtbczn/Kk5wiFq+ZkuOtw5ZKFhL/+w== +"@typechain/hardhat@^9.1.0": + version "9.1.0" + resolved "https://registry.yarnpkg.com/@typechain/hardhat/-/hardhat-9.1.0.tgz#6985015f01dfb37ef2ca8a29c742d05890351ddc" + integrity sha512-mtaUlzLlkqTlfPwB3FORdejqBskSnh+Jl8AIJGjXNAQfRQ4ofHADPl1+oU7Z3pAJzmZbUXII8MhOLQltcHgKnA== dependencies: fs-extra "^9.1.0" - lodash "^4.17.15" - -"@types/async-eventemitter@^0.2.1": - version "0.2.4" - resolved "https://registry.yarnpkg.com/@types/async-eventemitter/-/async-eventemitter-0.2.4.tgz#2f26d81e515a30ec32aa31a53da0469948f5f00b" - integrity sha512-2Bq61VD01kgLf1XkK2xPtoBcu7fgn/km5JyEX9v0BlG5VQBzA+BlF9umFk+8gR8S4+eK7MgDY2oyVZCu6ar3Jw== - dependencies: - "@types/events" "*" "@types/bn.js@^4.11.3": version "4.11.6" @@ -1954,15 +1803,10 @@ dependencies: "@types/chai" "*" -"@types/chai@*": - version "4.3.10" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.10.tgz#2ad2959d1767edee5b0e4efb1a0cd2b500747317" - integrity sha512-of+ICnbqjmFCiixUnqRulbylyXQrPqIGf/B3Jax1wIF3DvSheysQxAWvqHhZiW3IQrycvokcLcFQlveGp+vyNg== - -"@types/chai@4.2.0": - version "4.2.0" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.2.0.tgz#2478260021408dec32c123a7cad3414beb811a07" - integrity sha512-zw8UvoBEImn392tLjxoavuonblX/4Yb9ha4KBU10FirCfwgzhKO0dvyJSF9ByxV1xK1r2AgnAi/tvQaLgxQqxA== +"@types/chai@*", "@types/chai@^4.3.11": + version "4.3.11" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.11.tgz#e95050bf79a932cb7305dd130254ccdf9bde671c" + integrity sha512-qQR1dr2rGIHYlJulmr8Ioq3De0Le9E4MJ5AiaeAETJJpndT1uUNHsGFK3L/UIu+rbkQSdj8J/w2bCsBZc/Y5fQ== "@types/concat-stream@^1.6.0": version "1.6.1" @@ -1971,11 +1815,6 @@ dependencies: "@types/node" "*" -"@types/events@*": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.3.tgz#a8ef894305af28d1fc6d2dfdfc98e899591ea529" - integrity sha512-trOc4AAUThEz9hapPtSd7wf5tiQKvTtu5b371UxXdTuqzIh0ArcRspRP0i0Viu+LXstIQ1z96t1nsPxT9ol01g== - "@types/form-data@0.0.33": version "0.0.33" resolved "https://registry.yarnpkg.com/@types/form-data/-/form-data-0.0.33.tgz#c9ac85b2a5fd18435b8c85d9ecb50e6d6c893ff8" @@ -2021,27 +1860,32 @@ resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.5.tgz#ec10755e871497bcd83efe927e43ec46e8c0747e" integrity sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag== -"@types/mocha@9.1.0": - version "9.1.0" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.1.0.tgz#baf17ab2cca3fcce2d322ebc30454bff487efad5" - integrity sha512-QCWHkbMv4Y5U9oW10Uxbr45qMMSzl4OzijsozynUAgx3kEHUdXB00udx2dWDQ7f2TU2a2uuiFaRZjCe3unPpeg== +"@types/mocha@^9.1.0": + version "9.1.1" + resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-9.1.1.tgz#e7c4f1001eefa4b8afbd1eee27a237fee3bf29c4" + integrity sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw== "@types/node@*": - version "20.9.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.9.0.tgz#bfcdc230583aeb891cf51e73cfdaacdd8deae298" - integrity sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw== + version "20.10.4" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.4.tgz#b246fd84d55d5b1b71bf51f964bd514409347198" + integrity sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg== dependencies: undici-types "~5.26.4" +"@types/node@18.15.13": + version "18.15.13" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469" + integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q== + "@types/node@^10.0.3": version "10.17.60" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.60.tgz#35f3d6213daed95da7f0f73e75bcc6980e90597b" integrity sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw== "@types/node@^18.15.11": - version "18.18.9" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.18.9.tgz#5527ea1832db3bba8eb8023ce8497b7d3f299592" - integrity sha512-0f5klcuImLnG4Qreu9hPj/rEfFq6YRc5n2mAjSsH+ec/mJL+3voBH0+8T7o8RpFjH7ovc+TRsL/c7OYIQsPTfQ== + version "18.19.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.3.tgz#e4723c4cb385641d61b983f6fe0b716abd5f8fc0" + integrity sha512-k5fggr14DwAytoA/t8rPrIz++lXK7/DqckthCmoZOKNsEbJkId4Z//BqgApXBUGrGddrigYa1oqheo/7YmW4rg== dependencies: undici-types "~5.26.4" @@ -2072,6 +1916,14 @@ resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.10.tgz#0af26845b5067e1c9a622658a51f60a3934d51e8" integrity sha512-3Gnx08Ns1sEoCrWssEgTSJs/rsT2vhGP+Ja9cnnk9k4ALxinORlQneLXFeFKOTJMOeZUFD1s7w+w2AphTpvzZw== +"@types/readable-stream@^2.3.13": + version "2.3.15" + resolved "https://registry.yarnpkg.com/@types/readable-stream/-/readable-stream-2.3.15.tgz#3d79c9ceb1b6a57d5f6e6976f489b9b5384321ae" + integrity sha512-oM5JSKQCcICF1wvGgmecmHldZ48OZamtMxcGGVICOJA8o8cahXC1zEVAif8iwoc5j8etxFaRFnf095+CDsuoFQ== + dependencies: + "@types/node" "*" + safe-buffer "~5.1.1" + "@types/secp256k1@^4.0.1": version "4.0.6" resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.6.tgz#d60ba2349a51c2cbc5e816dcd831a42029d376bf" @@ -2080,9 +1932,9 @@ "@types/node" "*" "@types/semver@^7.3.12": - version "7.5.5" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.5.tgz#deed5ab7019756c9c90ea86139106b0346223f35" - integrity sha512-+d+WYC1BxJ6yVOgUgzK8gWvp5qF8ssV5r4nsDcZWKRWcDQLQ619tvWAxJQYGgBrO1MnLJC7a5GtiYsAoQ47dJg== + version "7.5.6" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.6.tgz#c65b2bfce1bec346582c07724e3f8c1017a20339" + integrity sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A== "@types/triple-beam@^1.3.2": version "1.3.5" @@ -2094,12 +1946,11 @@ resolved "https://registry.yarnpkg.com/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz#1306dbfa53768bcbcfc95a1c8cde367975581859" integrity sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA== -"@types/whatwg-url@^8.2.1": - version "8.2.2" - resolved "https://registry.yarnpkg.com/@types/whatwg-url/-/whatwg-url-8.2.2.tgz#749d5b3873e845897ada99be4448041d4cc39e63" - integrity sha512-FtQu10RWgn3D9U4aazdwIE2yzphmTJREDqNdODHrbrZmmMqI0vMheC/6NE/J1Yveaj8H+ela+YwWTjq5PGmuhA== +"@types/whatwg-url@^11.0.2": + version "11.0.3" + resolved "https://registry.yarnpkg.com/@types/whatwg-url/-/whatwg-url-11.0.3.tgz#9f584c9a9421f0971029ee504dd62a831cb8f3aa" + integrity sha512-z1ELvMijRL1QmU7QuzDkeYXSF2+dXI0ITKoQsIoVKcNBOiK5RMmWy+pYYxJTHFt8vkpZe7UsvRErQwcxZkjoUw== dependencies: - "@types/node" "*" "@types/webidl-conversions" "*" "@typescript-eslint/eslint-plugin@^5.57.1": @@ -2254,23 +2105,15 @@ abstract-level@^1.0.0, abstract-level@^1.0.2, abstract-level@^1.0.3: module-error "^1.0.1" queue-microtask "^1.2.3" -accepts@~1.3.8: - version "1.3.8" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" - integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== - dependencies: - mime-types "~2.1.34" - negotiator "0.6.3" - acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== acorn-walk@^8.1.1: - version "8.3.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.0.tgz#2097665af50fd0cf7a2dfccd2b9368964e66540f" - integrity sha512-FS7hV565M5l1R08MXqo8odwMTB02C2UqzB17RVgu9EyuYFBqJZ3/ZY97sQD5FewVu1UyDFc1yztUDrAwT0EypA== + version "8.3.1" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.1.tgz#2f10f5b69329d90ae18c58bf1fa8fccd8b959a43" + integrity sha512-TgUZgYvqZprrl7YldZNoa9OciCAyZR+Ejm9eXzKCmjsF5IKp/wgQ7Z/ZpjpGTIUPwrHQIcYeI8qDh4PsEwxMbw== acorn@^8.4.1, acorn@^8.9.0: version "8.11.2" @@ -2292,6 +2135,11 @@ aes-js@3.0.0: resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-3.0.0.tgz#e21df10ad6c2053295bcbb8dab40b09dbea87e4d" integrity sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw== +aes-js@4.0.0-beta.5: + version "4.0.0-beta.5" + resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-4.0.0-beta.5.tgz#8d2452c52adedebc3a3e28465d858c11ca315873" + integrity sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q== + agent-base@6, agent-base@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" @@ -2357,7 +2205,7 @@ ajv@^8.0.1: require-from-string "^2.0.2" uri-js "^4.2.2" -amazon-cognito-identity-js@^6.0.1: +amazon-cognito-identity-js@^6.0.1, amazon-cognito-identity-js@^6.3.6: version "6.3.7" resolved "https://registry.yarnpkg.com/amazon-cognito-identity-js/-/amazon-cognito-identity-js-6.3.7.tgz#65c3d7ee4e0c0a1ffea01927248989c5bd1d1868" integrity sha512-tSjnM7KyAeOZ7UMah+oOZ6cW4Gf64FFcc7BE2l7MTcp7ekAPrXaCbpcW2xEpH1EiDS4cPcAouHzmCuc2tr72vQ== @@ -2525,11 +2373,6 @@ array-buffer-byte-length@^1.0.0: call-bind "^1.0.2" is-array-buffer "^3.0.1" -array-flatten@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== - array-ify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-ify/-/array-ify-1.0.0.tgz#9e528762b4a9066ad163a6962a364418e9626ece" @@ -2636,13 +2479,6 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== -async-eventemitter@^0.2.4: - version "0.2.4" - resolved "https://registry.yarnpkg.com/async-eventemitter/-/async-eventemitter-0.2.4.tgz#f5e7c8ca7d3e46aab9ec40a292baf686a0bafaca" - integrity sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw== - dependencies: - async "^2.4.0" - async-retry@^1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.3.3.tgz#0e7f36c04d8478e7a58bdbed80cedf977785f280" @@ -2655,13 +2491,6 @@ async@1.x: resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" integrity sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w== -async@^2.4.0: - version "2.6.4" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.4.tgz#706b7ff6084664cd7eae713f6f965433b5504221" - integrity sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA== - dependencies: - lodash "^4.17.14" - async@^3.2.3: version "3.2.5" resolved "https://registry.yarnpkg.com/async/-/async-3.2.5.tgz#ebd52a8fdaf7a2289a24df399f8d8485c8a46b66" @@ -2682,7 +2511,7 @@ available-typed-arrays@^1.0.5: resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== -axios@^0.21.1, axios@^0.21.2: +axios@^0.21.1: version "0.21.4" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== @@ -2698,9 +2527,9 @@ axios@^0.27.2: form-data "^4.0.0" axios@^1.4.0, axios@^1.5.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.1.tgz#76550d644bf0a2d469a01f9244db6753208397d7" - integrity sha512-vfBmhDpKafglh0EldBEbVuoe7DyAavGSLWhuSm5ZSEKQnHhBf0xAAwybbNH1IkrJNGnS/VG4I5yxig1pCEXE4g== + version "1.6.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.2.tgz#de67d42c755b571d3e698df1b6504cde9b0ee9f2" + integrity sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A== dependencies: follow-redirects "^1.15.0" form-data "^4.0.0" @@ -2783,24 +2612,6 @@ bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== -body-parser@1.20.1: - version "1.20.1" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" - integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== - dependencies: - bytes "3.1.2" - content-type "~1.0.4" - debug "2.6.9" - depd "2.0.0" - destroy "1.2.0" - http-errors "2.0.0" - iconv-lite "0.4.24" - on-finished "2.4.1" - qs "6.11.0" - raw-body "2.5.1" - type-is "~1.6.18" - unpipe "1.0.0" - bottleneck@^2.15.3: version "2.19.5" resolved "https://registry.yarnpkg.com/bottleneck/-/bottleneck-2.19.5.tgz#5df0b90f59fd47656ebe63c78a98419205cadd91" @@ -3034,6 +2845,11 @@ cardinal@^2.1.1: ansicolors "~0.3.2" redeyed "~2.1.0" +case@^1.6.3: + version "1.6.3" + resolved "https://registry.yarnpkg.com/case/-/case-1.6.3.tgz#0a4386e3e9825351ca2e6216c60467ff5f1ea1c9" + integrity sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ== + caseless@^0.12.0, caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" @@ -3065,17 +2881,18 @@ chai-as-promised@^7.1.1: dependencies: check-error "^1.0.2" -chai@4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.2.0.tgz#760aa72cf20e3795e84b12877ce0e83737aa29e5" - integrity sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw== +chai@^4.3.10: + version "4.3.10" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.10.tgz#d784cec635e3b7e2ffb66446a63b4e33bd390384" + integrity sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g== dependencies: assertion-error "^1.1.0" - check-error "^1.0.2" - deep-eql "^3.0.1" - get-func-name "^2.0.0" - pathval "^1.1.0" - type-detect "^4.0.5" + check-error "^1.0.3" + deep-eql "^4.1.3" + get-func-name "^2.0.2" + loupe "^2.3.6" + pathval "^1.1.1" + type-detect "^4.0.8" chalk@^2.3.2, chalk@^2.4.2: version "2.4.2" @@ -3104,7 +2921,7 @@ chalk@^5.2.0, chalk@^5.3.0: resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" integrity sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA== -check-error@^1.0.2: +check-error@^1.0.2, check-error@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.3.tgz#a6502e4312a7ee969f646e83bb3ddd56281bd694" integrity sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg== @@ -3440,13 +3257,6 @@ console-control-strings@^1.1.0: resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== -content-disposition@0.5.4: - version "0.5.4" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" - integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== - dependencies: - safe-buffer "5.2.1" - content-hash@^2.5.2: version "2.5.2" resolved "https://registry.yarnpkg.com/content-hash/-/content-hash-2.5.2.tgz#bbc2655e7c21f14fd3bfc7b7d4bfe6e454c9e211" @@ -3456,11 +3266,6 @@ content-hash@^2.5.2: multicodec "^0.5.5" multihashes "^0.4.15" -content-type@~1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.5.tgz#8b773162656d1d1086784c8f23a54ce6d73d7918" - integrity sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA== - conventional-changelog-angular@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/conventional-changelog-angular/-/conventional-changelog-angular-6.0.0.tgz#a9a9494c28b7165889144fd5b91573c4aa9ca541" @@ -3504,16 +3309,6 @@ conventional-commits-parser@^5.0.0: meow "^12.0.1" split2 "^4.0.0" -cookie-signature@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== - -cookie@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" - integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== - cookie@^0.4.1: version "0.4.2" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" @@ -3616,13 +3411,6 @@ death@^1.1.0: resolved "https://registry.yarnpkg.com/death/-/death-1.1.0.tgz#01aa9c401edd92750514470b8266390c66c67318" integrity sha512-vsV6S4KVHvTGxbEcij7hkWRv0It+sGGWVOM67dQde/o5Xjnr+KmLjxWJii2uEObIrt1CcM9w0Yaovx+iOlIL+w== -debug@2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - debug@4, debug@4.3.4, debug@^4.0.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" @@ -3662,14 +3450,7 @@ decompress-response@^6.0.0: dependencies: mimic-response "^3.1.0" -deep-eql@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" - integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw== - dependencies: - type-detect "^4.0.0" - -deep-eql@^4.0.1: +deep-eql@^4.0.1, deep-eql@^4.1.3: version "4.1.3" resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== @@ -3693,17 +3474,6 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" -defender-base-client@^1.44.0: - version "1.44.0" - resolved "https://registry.yarnpkg.com/defender-base-client/-/defender-base-client-1.44.0.tgz#afe724447c0f9177b999b70b9f14dd70d61d5a7a" - integrity sha512-8ZgGA93+FlxNwG9LN1nu/Au5AyCKwAWJGNf0VLiPmh4GX/Nali/7kv72K+OtZgGxTLtKDKfgN4cnhEZwfrc8dg== - dependencies: - amazon-cognito-identity-js "^6.0.1" - async-retry "^1.3.3" - axios "^0.21.2" - lodash "^4.17.19" - node-fetch "^2.6.0" - defer-to-connect@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" @@ -3723,7 +3493,7 @@ define-lazy-prop@^2.0.0: resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og== -define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0: +define-properties@^1.1.3, define-properties@^1.2.0, define-properties@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== @@ -3752,11 +3522,6 @@ deprecation@^2.0.0: resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== -destroy@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" - integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== - detect-port@^1.3.0: version "1.5.1" resolved "https://registry.yarnpkg.com/detect-port/-/detect-port-1.5.1.tgz#451ca9b6eaf20451acb0799b8ab40dff7718727b" @@ -3832,11 +3597,6 @@ eastasianwidth@^0.2.0: resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== - elliptic@6.5.4, elliptic@^6.5.2, elliptic@^6.5.4: version "6.5.4" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" @@ -3870,11 +3630,6 @@ encode-utf8@^1.0.2: resolved "https://registry.yarnpkg.com/encode-utf8/-/encode-utf8-1.0.3.tgz#f30fdd31da07fb596f281beb2f6b027851994cda" integrity sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw== -encodeurl@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== - encoding@^0.1.13: version "0.1.13" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" @@ -3990,11 +3745,6 @@ escalade@^3.1.1: resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== - escape-string-regexp@4.0.0, escape-string-regexp@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" @@ -4058,9 +3808,9 @@ eslint-module-utils@^2.8.0: debug "^3.2.7" eslint-plugin-import@^2.27.5: - version "2.29.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.29.0.tgz#8133232e4329ee344f2f612885ac3073b0b7e155" - integrity sha512-QPOO5NO6Odv5lpoTkddtutccQjysJuFxoPS7fAHO+9m9udNHvTCPSAMW9zGAYj8lAIdr40I8yPCdUYrncXtrwg== + version "2.29.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz#d45b37b5ef5901d639c15270d74d46d161150643" + integrity sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw== dependencies: array-includes "^3.1.7" array.prototype.findlastindex "^1.2.3" @@ -4078,7 +3828,7 @@ eslint-plugin-import@^2.27.5: object.groupby "^1.0.1" object.values "^1.1.7" semver "^6.3.1" - tsconfig-paths "^3.14.2" + tsconfig-paths "^3.15.0" eslint-plugin-jsdoc@^40.1.1: version "40.3.0" @@ -4120,14 +3870,14 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4 integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== eslint@^8.37.0: - version "8.53.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.53.0.tgz#14f2c8244298fcae1f46945459577413ba2697ce" - integrity sha512-N4VuiPjXDUa4xVeV/GC/RV3hQW9Nw+Y463lkWaKKXKYMvmRiRDAtfpuPFLN+E1/6ZhyR8J2ig+eVREnYgUsiag== + version "8.55.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.55.0.tgz#078cb7b847d66f2c254ea1794fa395bf8e7e03f8" + integrity sha512-iyUUAM0PCKj5QpwGfmCAG9XXbZCWsqP/eWAWrG/W0umvjuLRBECwSFdt+rCntju0xEH7teIABPwXpahftIaTdA== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.6.1" - "@eslint/eslintrc" "^2.1.3" - "@eslint/js" "8.53.0" + "@eslint/eslintrc" "^2.1.4" + "@eslint/js" "8.55.0" "@humanwhocodes/config-array" "^0.11.13" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" @@ -4216,11 +3966,6 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -etag@~1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== - eth-ens-namehash@^2.0.8: version "2.0.8" resolved "https://registry.yarnpkg.com/eth-ens-namehash/-/eth-ens-namehash-2.0.8.tgz#229ac46eca86d52e0c991e7cb2aef83ff0f68bcf" @@ -4229,7 +3974,7 @@ eth-ens-namehash@^2.0.8: idna-uts46-hx "^2.3.1" js-sha3 "^0.5.7" -eth-gas-reporter@^0.2.24: +eth-gas-reporter@^0.2.25: version "0.2.27" resolved "https://registry.yarnpkg.com/eth-gas-reporter/-/eth-gas-reporter-0.2.27.tgz#928de8548a674ed64c7ba0bf5795e63079150d4e" integrity sha512-femhvoAM7wL0GcI8ozTdxfuBtBFJ9qsyIAsmKVjlWAHUbdnnXHt+lKzz/kmldM5lA9jLuNHGwuIxorNpLbR1Zw== @@ -4317,7 +4062,7 @@ ethereumjs-util@^6.0.0, ethereumjs-util@^6.2.1: ethjs-util "0.1.6" rlp "^2.2.3" -ethereumjs-util@^7.0.3, ethereumjs-util@^7.1.4: +ethereumjs-util@^7.0.3, ethereumjs-util@^7.1.4, ethereumjs-util@^7.1.5: version "7.1.5" resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz#9ecf04861e4fbbeed7465ece5f23317ad1129181" integrity sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg== @@ -4328,43 +4073,7 @@ ethereumjs-util@^7.0.3, ethereumjs-util@^7.1.4: ethereum-cryptography "^0.1.3" rlp "^2.2.4" -ethers@5.5.1: - version "5.5.1" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.5.1.tgz#d3259a95a42557844aa543906c537106c0406fbf" - integrity sha512-RodEvUFZI+EmFcE6bwkuJqpCYHazdzeR1nMzg+YWQSmQEsNtfl1KHGfp/FWZYl48bI/g7cgBeP2IlPthjiVngw== - dependencies: - "@ethersproject/abi" "5.5.0" - "@ethersproject/abstract-provider" "5.5.1" - "@ethersproject/abstract-signer" "5.5.0" - "@ethersproject/address" "5.5.0" - "@ethersproject/base64" "5.5.0" - "@ethersproject/basex" "5.5.0" - "@ethersproject/bignumber" "5.5.0" - "@ethersproject/bytes" "5.5.0" - "@ethersproject/constants" "5.5.0" - "@ethersproject/contracts" "5.5.0" - "@ethersproject/hash" "5.5.0" - "@ethersproject/hdnode" "5.5.0" - "@ethersproject/json-wallets" "5.5.0" - "@ethersproject/keccak256" "5.5.0" - "@ethersproject/logger" "5.5.0" - "@ethersproject/networks" "5.5.0" - "@ethersproject/pbkdf2" "5.5.0" - "@ethersproject/properties" "5.5.0" - "@ethersproject/providers" "5.5.0" - "@ethersproject/random" "5.5.0" - "@ethersproject/rlp" "5.5.0" - "@ethersproject/sha2" "5.5.0" - "@ethersproject/signing-key" "5.5.0" - "@ethersproject/solidity" "5.5.0" - "@ethersproject/strings" "5.5.0" - "@ethersproject/transactions" "5.5.0" - "@ethersproject/units" "5.5.0" - "@ethersproject/wallet" "5.5.0" - "@ethersproject/web" "5.5.0" - "@ethersproject/wordlists" "5.5.0" - -ethers@^5.0.13, ethers@^5.7.0, ethers@^5.7.2: +ethers@^5.0.13, ethers@^5.7.0, ethers@^5.7.1, ethers@^5.7.2: version "5.7.2" resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== @@ -4400,6 +4109,19 @@ ethers@^5.0.13, ethers@^5.7.0, ethers@^5.7.2: "@ethersproject/web" "5.7.1" "@ethersproject/wordlists" "5.7.0" +ethers@^6.8.1, ethers@^6.9.0: + version "6.9.0" + resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.9.0.tgz#a4534bdcdfde306aee94ef32f3d5c70d7e33fcb9" + integrity sha512-pmfNyQzc2mseLe91FnT2vmNaTt8dDzhxZ/xItAV7uGsF4dI4ek2ufMu3rAkgQETL/TIs0GS5A+U05g9QyWnv3Q== + dependencies: + "@adraffy/ens-normalize" "1.10.0" + "@noble/curves" "1.2.0" + "@noble/hashes" "1.3.2" + "@types/node" "18.15.13" + aes-js "4.0.0-beta.5" + tslib "2.4.0" + ws "8.5.0" + ethjs-unit@0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-unit/-/ethjs-unit-0.1.6.tgz#c665921e476e87bce2a9d588a6fe0405b2c41699" @@ -4484,43 +4206,6 @@ exponential-backoff@^3.1.1: resolved "https://registry.yarnpkg.com/exponential-backoff/-/exponential-backoff-3.1.1.tgz#64ac7526fe341ab18a39016cd22c787d01e00bf6" integrity sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw== -express@^4.18.1: - version "4.18.2" - resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" - integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== - dependencies: - accepts "~1.3.8" - array-flatten "1.1.1" - body-parser "1.20.1" - content-disposition "0.5.4" - content-type "~1.0.4" - cookie "0.5.0" - cookie-signature "1.0.6" - debug "2.6.9" - depd "2.0.0" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - finalhandler "1.2.0" - fresh "0.5.2" - http-errors "2.0.0" - merge-descriptors "1.0.1" - methods "~1.1.2" - on-finished "2.4.1" - parseurl "~1.3.3" - path-to-regexp "0.1.7" - proxy-addr "~2.0.7" - qs "6.11.0" - range-parser "~1.2.1" - safe-buffer "5.2.1" - send "0.18.0" - serve-static "1.15.0" - setprototypeof "1.2.0" - statuses "2.0.1" - type-is "~1.6.18" - utils-merge "1.0.1" - vary "~1.1.2" - fast-base64-decode@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fast-base64-decode/-/fast-base64-decode-1.0.0.tgz#b434a0dd7d92b12b43f26819300d2dafb83ee418" @@ -4603,19 +4288,6 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" -finalhandler@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" - integrity sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg== - dependencies: - debug "2.6.9" - encodeurl "~1.0.2" - escape-html "~1.0.3" - on-finished "2.4.1" - parseurl "~1.3.3" - statuses "2.0.1" - unpipe "~1.0.0" - find-replace@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-3.0.0.tgz#3e7e23d3b05167a76f770c9fbd5258b0def68c38" @@ -4743,11 +4415,6 @@ form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" -forwarded@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" - integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== - fp-ts@1.19.3: version "1.19.3" resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.3.tgz#261a60d1088fbff01f91256f91d21d0caaaaa96f" @@ -4758,11 +4425,6 @@ fp-ts@^1.0.0: resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.5.tgz#3da865e585dfa1fdfd51785417357ac50afc520a" integrity sha512-wDNqTimnzs8QqpldiId9OavWK2NptormjXnRJTQecNjzwfyp6P/8s/zG8e4h3ja3oqkKaY72UlTjQYt/1yXf9A== -fresh@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== - from2@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/from2/-/from2-2.3.0.tgz#8bfb5502bde4a4d36cfdeea007fcca21d7e382af" @@ -4792,9 +4454,9 @@ fs-extra@^10.0.0, fs-extra@^10.1.0: universalify "^2.0.0" fs-extra@^11.0.0: - version "11.1.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.1.1.tgz#da69f7c39f3b002378b0954bb6ae7efdc0876e2d" - integrity sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ== + version "11.2.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.2.0.tgz#e70e17dfad64232287d01929399e0ea7c86b0e5b" + integrity sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw== dependencies: graceful-fs "^4.2.0" jsonfile "^6.0.1" @@ -4920,7 +4582,7 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-func-name@^2.0.0, get-func-name@^2.0.2: +get-func-name@^2.0.1, get-func-name@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.2.tgz#0d7cf20cd13fda808669ffa88f4ffc7a3943fc41" integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== @@ -5043,7 +4705,7 @@ glob@^5.0.15: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.0, glob@^7.1.3, glob@^7.1.4: +glob@^7.0.0, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== @@ -5083,9 +4745,9 @@ global-prefix@^3.0.0: which "^1.3.1" globals@^13.19.0: - version "13.23.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.23.0.tgz#ef31673c926a0976e1f61dab4dca57e0c0a8af02" - integrity sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA== + version "13.24.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.24.0.tgz#8432a19d78ce0c1e833949c36adb345400bb1171" + integrity sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ== dependencies: type-fest "^0.20.2" @@ -5190,10 +4852,10 @@ hard-rejection@^2.1.0: resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== -hardhat-deploy@^0.11.14: - version "0.11.43" - resolved "https://registry.yarnpkg.com/hardhat-deploy/-/hardhat-deploy-0.11.43.tgz#b22ff15b3ea201b72ba0f17f4b2e182cc950e73e" - integrity sha512-D760CjDtinwjOCpKOvdyRtIJYLQIYXmhfgkFe+AkxlYM9bPZ/T4tZ/xIB2tR89ZT+z0hF1YuZFBXIL3/G/9T5g== +hardhat-deploy@^0.11.43: + version "0.11.44" + resolved "https://registry.yarnpkg.com/hardhat-deploy/-/hardhat-deploy-0.11.44.tgz#a7a771a675a3837ce4c321f2c18d4b6fa1ed03a0" + integrity sha512-kAkCvTYPpdIvnWCc3F0xg3AbVsa/SgH9aePPO7e7nHUOkg07LGKuknU/UaVAfWwHe7Zs57pQIAolAQyKI+mnXw== dependencies: "@ethersproject/abi" "^5.7.0" "@ethersproject/abstract-signer" "^5.7.0" @@ -5220,37 +4882,36 @@ hardhat-deploy@^0.11.14: qs "^6.9.4" zksync-web3 "^0.14.3" -hardhat-gas-reporter@1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/hardhat-gas-reporter/-/hardhat-gas-reporter-1.0.8.tgz#93ce271358cd748d9c4185dbb9d1d5525ec145e0" - integrity sha512-1G5thPnnhcwLHsFnl759f2tgElvuwdkzxlI65fC9PwxYMEe9cmjkVAAWTf3/3y8uP6ZSPiUiOW8PgZnykmZe0g== +hardhat-gas-reporter@^1.0.9: + version "1.0.9" + resolved "https://registry.yarnpkg.com/hardhat-gas-reporter/-/hardhat-gas-reporter-1.0.9.tgz#9a2afb354bc3b6346aab55b1c02ca556d0e16450" + integrity sha512-INN26G3EW43adGKBNzYWOlI3+rlLnasXTwW79YNnUhXPDa+yHESgt639dJEs37gCjhkbNKcRRJnomXEuMFBXJg== dependencies: array-uniq "1.0.3" - eth-gas-reporter "^0.2.24" + eth-gas-reporter "^0.2.25" sha1 "^1.1.1" -hardhat@2.13.0: - version "2.13.0" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.13.0.tgz#d52a0ec9b733a651687e5b1c1b0ee9a11a30f3d0" - integrity sha512-ZlzBOLML1QGlm6JWyVAG8lVTEAoOaVm1in/RU2zoGAnYEoD1Rp4T+ZMvrLNhHaaeS9hfjJ1gJUBfiDr4cx+htQ== +hardhat@^2.19.1: + version "2.19.2" + resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.19.2.tgz#815819e4efd234941d495decb718b358d572e2c8" + integrity sha512-CRU3+0Cc8Qh9UpxKd8cLADDPes7ZDtKj4dTK+ERtLBomEzhRPLWklJn4VKOwjre9/k8GNd/e9DYxpfuzcxbXPQ== dependencies: "@ethersproject/abi" "^5.1.2" "@metamask/eth-sig-util" "^4.0.0" - "@nomicfoundation/ethereumjs-block" "^4.0.0" - "@nomicfoundation/ethereumjs-blockchain" "^6.0.0" - "@nomicfoundation/ethereumjs-common" "^3.0.0" - "@nomicfoundation/ethereumjs-evm" "^1.0.0" - "@nomicfoundation/ethereumjs-rlp" "^4.0.0" - "@nomicfoundation/ethereumjs-statemanager" "^1.0.0" - "@nomicfoundation/ethereumjs-trie" "^5.0.0" - "@nomicfoundation/ethereumjs-tx" "^4.0.0" - "@nomicfoundation/ethereumjs-util" "^8.0.0" - "@nomicfoundation/ethereumjs-vm" "^6.0.0" + "@nomicfoundation/ethereumjs-block" "5.0.2" + "@nomicfoundation/ethereumjs-blockchain" "7.0.2" + "@nomicfoundation/ethereumjs-common" "4.0.2" + "@nomicfoundation/ethereumjs-evm" "2.0.2" + "@nomicfoundation/ethereumjs-rlp" "5.0.2" + "@nomicfoundation/ethereumjs-statemanager" "2.0.2" + "@nomicfoundation/ethereumjs-trie" "6.0.2" + "@nomicfoundation/ethereumjs-tx" "5.0.2" + "@nomicfoundation/ethereumjs-util" "9.0.2" + "@nomicfoundation/ethereumjs-vm" "7.0.2" "@nomicfoundation/solidity-analyzer" "^0.1.0" "@sentry/node" "^5.18.1" "@types/bn.js" "^5.1.0" "@types/lru-cache" "^5.1.0" - abort-controller "^3.0.0" adm-zip "^0.4.16" aggregate-error "^3.0.0" ansi-escapes "^4.3.0" @@ -5273,7 +4934,6 @@ hardhat@2.13.0: mnemonist "^0.38.0" mocha "^10.0.0" p-map "^4.0.0" - qs "^6.7.0" raw-body "^2.4.1" resolve "1.17.0" semver "^6.3.0" @@ -5504,11 +5164,6 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" -hyperlinker@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/hyperlinker/-/hyperlinker-1.0.0.tgz#23dc9e38a206b208ee49bc2d6c8ef47027df0c0e" - integrity sha512-Ty8UblRWFEcfSuIaajM34LdPXIhbs1ajEX/BBPv24J+enSVaEVY63xQ6lTO9VRYS5LAoghIG0IDJ+p+IPzKUQQ== - iconv-lite@0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" @@ -5536,16 +5191,21 @@ ieee754@^1.1.13, ieee754@^1.1.4, ieee754@^1.2.1: integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== ignore-walk@^6.0.0: - version "6.0.3" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-6.0.3.tgz#0fcdb6decaccda35e308a7b0948645dd9523b7bb" - integrity sha512-C7FfFoTA+bI10qfeydT8aZbvr91vAEU+2W5BZUlzPec47oNb07SsOfwYrtxuvOYdUApPP/Qlh4DtAO51Ekk2QA== + version "6.0.4" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-6.0.4.tgz#89950be94b4f522225eb63a13c56badb639190e9" + integrity sha512-t7sv42WkwFkyKbivUCglsQW5YWMskWtbEf4MNKX5u/CCWHKSPzN4FtBQGsQZgCLbxOzpVlcbWVK5KB3auIOjSw== dependencies: minimatch "^9.0.0" ignore@^5.1.1, ignore@^5.2.0, ignore@^5.2.4: - version "5.2.4" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" - integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== + version "5.3.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.0.tgz#67418ae40d34d6999c95ff56016759c718c82f78" + integrity sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg== + +immediate@~3.0.5: + version "3.0.6" + resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" + integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ== immutable@^4.0.0-rc.12: version "4.3.4" @@ -5670,11 +5330,6 @@ ip@^2.0.0: resolved "https://registry.yarnpkg.com/ip/-/ip-2.0.0.tgz#4cf4ab182fee2314c75ede1276f8c80b479936da" integrity sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ== -ipaddr.js@1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" - integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== - is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.2.tgz#f2653ced8412081638ecb0ebbd0c41c6e0aecbbe" @@ -5828,11 +5483,6 @@ is-plain-obj@^2.1.0: resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== -is-plain-object@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" - integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== - is-regex@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" @@ -5968,6 +5618,11 @@ js-cookie@^2.2.1: resolved "https://registry.yarnpkg.com/js-cookie/-/js-cookie-2.2.1.tgz#69e106dc5d5806894562902aa5baec3744e9b2b8" integrity sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ== +js-sdsl@^4.1.4: + version "4.4.2" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.4.2.tgz#2e3c031b1f47d3aca8b775532e3ebb0818e7f847" + integrity sha512-dwXFwByc/ajSV6m5bcKAPwe4yDDF6D614pxmIi5odytzxRlwqF6nwoiCek80Ixc7Cvma5awClxrzFtxCQvcM8w== + js-sha3@0.8.0, js-sha3@^0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" @@ -6019,9 +5674,9 @@ json-parse-even-better-errors@^2.3.0: integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== json-parse-even-better-errors@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.0.tgz#2cb2ee33069a78870a0c7e3da560026b89669cf7" - integrity sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA== + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.1.tgz#02bb29fb5da90b5444581749c22cedd3597c6cb0" + integrity sha512-aatBvbL26wVUCLmbWdCpeu9iF5wOyWpagiKkInA+kfws3sWdBrTnsvN2CKcyCYyUrc7rebNBlK6+kteg7ksecg== json-schema-traverse@^0.4.1: version "0.4.1" @@ -6088,6 +5743,16 @@ jsonschema@^1.2.4: resolved "https://registry.yarnpkg.com/jsonschema/-/jsonschema-1.4.1.tgz#cc4c3f0077fb4542982973d8a083b6b34f482dab" integrity sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ== +jszip@^3.10.1: + version "3.10.1" + resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.10.1.tgz#34aee70eb18ea1faec2f589208a157d1feb091c2" + integrity sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g== + dependencies: + lie "~3.3.0" + pako "~1.0.2" + readable-stream "~2.3.6" + setimmediate "^1.0.5" + just-diff-apply@^5.2.0: version "5.5.0" resolved "https://registry.yarnpkg.com/just-diff-apply/-/just-diff-apply-5.5.0.tgz#771c2ca9fa69f3d2b54e7c3f5c1dfcbcc47f9f0f" @@ -6260,10 +5925,10 @@ libnpmpack@^5.0.20: npm-package-arg "^10.1.0" pacote "^15.0.8" -libnpmpublish@^7.5.0: - version "7.5.0" - resolved "https://registry.yarnpkg.com/libnpmpublish/-/libnpmpublish-7.5.0.tgz#a118c8fdc680947c960648ed8b4c94d15e42e0ab" - integrity sha512-zctH6QcTJ093lpxmkufr2zr3AJ9V90hcRilDFNin6n91ODj+S28RdyMFFJpa9NwyztmyV2hlWLyZv0GaOQBDyA== +libnpmpublish@^7.5.1: + version "7.5.1" + resolved "https://registry.yarnpkg.com/libnpmpublish/-/libnpmpublish-7.5.1.tgz#80f0b5d30210156af7a1b98b1a7bff06bd868684" + integrity sha512-z/7HYMtuRrNgcftrI9ILXezZWHYHG0RaIZFfUvcLktE75vrScE3zOO+qvAbvQodQi4YvYoOGF1ySQ8tdbDCYQQ== dependencies: ci-info "^3.6.1" normalize-package-data "^5.0.0" @@ -6300,6 +5965,13 @@ libnpmversion@^4.0.2: proc-log "^3.0.0" semver "^7.3.7" +lie@~3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/lie/-/lie-3.3.0.tgz#dcf82dee545f46074daf200c7c1c5a08e0f40f6a" + integrity sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ== + dependencies: + immediate "~3.0.5" + lines-and-columns@^1.1.6: version "1.2.4" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" @@ -6380,11 +6052,21 @@ lodash.capitalize@^4.2.1: resolved "https://registry.yarnpkg.com/lodash.capitalize/-/lodash.capitalize-4.2.1.tgz#f826c9b4e2a8511d84e3aca29db05e1a4f3b72a9" integrity sha512-kZzYOKspf8XVX5AvmQF94gQW0lejFVgb80G85bU4ZWzoJ6C03PQg3coYAUpSTpQWelrZELd3XWgHzw4Ck5kaIw== +lodash.clonedeep@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + integrity sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ== + lodash.escaperegexp@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz#64762c48618082518ac3df4ccf5d5886dae20347" integrity sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw== +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== + lodash.ismatch@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37" @@ -6440,17 +6122,22 @@ logform@^2.3.2, logform@^2.4.0: safe-stable-stringify "^2.3.1" triple-beam "^1.3.0" +loupe@^2.3.6: + version "2.3.7" + resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.7.tgz#6e69b7d4db7d3ab436328013d37d1c8c3540c697" + integrity sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA== + dependencies: + get-func-name "^2.0.1" + lowercase-keys@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-3.0.0.tgz#c5e7d442e37ead247ae9db117a9d0a467c89d4f2" integrity sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ== lru-cache@^10.0.1, "lru-cache@^9.1.1 || ^10.0.0": - version "10.0.2" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.0.2.tgz#34504678cc3266b09b8dfd6fab4e1515258271b7" - integrity sha512-Yj9mA8fPiVgOUpByoTZO5pNrcl5Yk37FcSHsUINpAsaBIEZIuqcCclDZJCVxqQShDsmYX8QG63svJiTbOATZwg== - dependencies: - semver "^7.3.5" + version "10.1.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.1.0.tgz#2098d41c2dc56500e6c88584aa656c84de7d0484" + integrity sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag== lru-cache@^5.1.1: version "5.1.1" @@ -6575,11 +6262,6 @@ md5.js@^1.3.4: inherits "^2.0.1" safe-buffer "^5.1.2" -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== - memory-level@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/memory-level/-/memory-level-1.0.0.tgz#7323c3fd368f9af2f71c3cd76ba403a17ac41692" @@ -6621,11 +6303,6 @@ meow@^8.1.2: type-fest "^0.18.0" yargs-parser "^20.2.3" -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== - merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" @@ -6636,11 +6313,6 @@ merge2@^1.2.3, merge2@^1.3.0, merge2@^1.4.1: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -methods@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== - micro-ftch@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/micro-ftch/-/micro-ftch-0.3.1.tgz#6cb83388de4c1f279a034fb0cf96dfc050853c5f" @@ -6659,22 +6331,17 @@ mime-db@1.52.0: resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-types@^2.1.12, mime-types@~2.1.24, mime-types@~2.1.34: +mime-types@^2.1.12: version "2.1.35" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: mime-db "1.52.0" -mime@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" - integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== - -mime@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-3.0.0.tgz#b374550dca3a0c18443b0c950a6a58f1931cf7a7" - integrity sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A== +mime@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-4.0.0.tgz#ae999669db9568c31a8da18dff6c696663f65486" + integrity sha512-pzhgdeqU5pJ9t5WK9m4RT4GgGWqYJylxUf62Yb9datXRwdcw5MjiD1BYI5evF8AgTXN9gtKX3CFLvCUL5fAhEA== mimic-fn@^2.1.0: version "2.1.0" @@ -6892,27 +6559,22 @@ module-error@^1.0.1, module-error@^1.0.2: resolved "https://registry.yarnpkg.com/module-error/-/module-error-1.0.2.tgz#8d1a48897ca883f47a45816d4fb3e3c6ba404d86" integrity sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA== -mongodb-connection-string-url@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/mongodb-connection-string-url/-/mongodb-connection-string-url-2.6.0.tgz#57901bf352372abdde812c81be47b75c6b2ec5cf" - integrity sha512-WvTZlI9ab0QYtTYnuMLgobULWhokRjtC7db9LtcVfJ+Hsnyr5eo6ZtNAt3Ly24XZScGMelOcGtm7lSn0332tPQ== +mongodb-connection-string-url@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.0.tgz#b4f87f92fd8593f3b9365f592515a06d304a1e9c" + integrity sha512-t1Vf+m1I5hC2M5RJx/7AtxgABy1cZmIPQRMXw+gEIPn/cZNF3Oiy+l0UIypUwVB5trcWHq3crg2g3uAR9aAwsQ== dependencies: - "@types/whatwg-url" "^8.2.1" - whatwg-url "^11.0.0" + "@types/whatwg-url" "^11.0.2" + whatwg-url "^13.0.0" mongodb@^6.1.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-6.2.0.tgz#2c9dcb3eeaf528ed850e94b3df392de6c6b0d7ab" - integrity sha512-d7OSuGjGWDZ5usZPqfvb36laQ9CPhnWkAGHT61x5P95p/8nMVeH8asloMwW6GcYFeB0Vj4CB/1wOTDG2RA9BFA== + version "6.3.0" + resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-6.3.0.tgz#ec9993b19f7ed2ea715b903fcac6171c9d1d38ca" + integrity sha512-tt0KuGjGtLUhLoU263+xvQmPHEGTw5LbcNC73EoFRYgSHwZt5tsoJC110hDyO1kjQzpgNrpdcSza9PknWN4LrA== dependencies: "@mongodb-js/saslprep" "^1.1.0" bson "^6.2.0" - mongodb-connection-string-url "^2.6.0" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== + mongodb-connection-string-url "^3.0.0" ms@2.1.2: version "2.1.2" @@ -7003,7 +6665,7 @@ natural-compare@^1.4.0: resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== -negotiator@0.6.3, negotiator@^0.6.3: +negotiator@^0.6.3: version "0.6.3" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== @@ -7038,9 +6700,9 @@ node-fetch@^2.6.0, node-fetch@^2.6.1: whatwg-url "^5.0.0" node-gyp-build@^4.2.0, node-gyp-build@^4.3.0: - version "4.6.1" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.1.tgz#24b6d075e5e391b8d5539d98c7fc5c210cac8a3e" - integrity sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ== + version "4.7.1" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.7.1.tgz#cd7d2eb48e594874053150a9418ac85af83ca8f7" + integrity sha512-wTSrZ+8lsRRa3I3H8Xr65dLWSgCvY2l4AOnaeKdPA9TB/WYMPaTcrzf3rXvFoVvjKNVnu0CcWSx54qq9GKRUYg== node-gyp@^9.0.0, node-gyp@^9.4.0: version "9.4.1" @@ -7227,9 +6889,9 @@ npm-user-validate@^2.0.0: integrity sha512-sSWeqAYJ2dUPStJB+AEj0DyLRltr/f6YNcvCA7phkB8/RMLMnVsQ41GMwHo/ERZLYNDsyB2wPm7pZo1mqPOl7Q== npm@^9.5.0: - version "9.9.1" - resolved "https://registry.yarnpkg.com/npm/-/npm-9.9.1.tgz#55fd293a86a877b6aacfca3021ec4e94fcc0b930" - integrity sha512-D3YZ1ZTxPGDHLLiFU9q3sVrPfYnn6BaJ1hogm3vdWi8oOmHGtTlPUPXAM0iG22UT0JRkBnMDOh6oUhpbEYgg2A== + version "9.9.2" + resolved "https://registry.yarnpkg.com/npm/-/npm-9.9.2.tgz#28133f81643bce36c1c8bcb57b51e1ee53583df7" + integrity sha512-D3tV+W0PzJOlwo8YmO6fNzaB1CrMVYd1V+2TURF6lbCbmZKqMsYgeQfPVvqiM3zbNSJPhFEnmlEXIogH2Vq7PQ== dependencies: "@isaacs/string-locale-compare" "^1.1.0" "@npmcli/arborist" "^6.5.0" @@ -7263,7 +6925,7 @@ npm@^9.5.0: libnpmhook "^9.0.3" libnpmorg "^5.0.4" libnpmpack "^5.0.20" - libnpmpublish "^7.5.0" + libnpmpublish "^7.5.1" libnpmsearch "^6.0.2" libnpmteam "^5.0.3" libnpmversion "^4.0.2" @@ -7351,12 +7013,12 @@ object-keys@^1.1.1: integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== object.assign@^4.1.2, object.assign@^4.1.4: - version "4.1.4" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" - integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ== + version "4.1.5" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.5.tgz#3a833f9ab7fdb80fc9e8d2300c803d216d8fdbb0" + integrity sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ== dependencies: - call-bind "^1.0.2" - define-properties "^1.1.4" + call-bind "^1.0.5" + define-properties "^1.2.1" has-symbols "^1.0.3" object-keys "^1.1.1" @@ -7402,13 +7064,6 @@ obliterator@^2.0.0: resolved "https://registry.yarnpkg.com/obliterator/-/obliterator-2.0.4.tgz#fa650e019b2d075d745e44f1effeb13a2adbe816" integrity sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ== -on-finished@2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" - integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== - dependencies: - ee-first "1.1.1" - once@1.x, once@^1.3.0, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -7633,6 +7288,11 @@ pacote@^15.0.0, pacote@^15.0.8, pacote@^15.2.0: ssri "^10.0.0" tar "^6.1.11" +pako@~1.0.2: + version "1.0.11" + resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" + integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== + parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -7690,11 +7350,6 @@ parse-json@^7.0.0: lines-and-columns "^2.0.3" type-fest "^3.8.0" -parseurl@~1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" - integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== - path-exists@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" @@ -7745,11 +7400,6 @@ path-scurry@^1.10.1: lru-cache "^9.1.1 || ^10.0.0" minipass "^5.0.0 || ^6.0.2 || ^7.0.0" -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== - path-type@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" @@ -7769,7 +7419,7 @@ path-type@^5.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-5.0.0.tgz#14b01ed7aea7ddf9c7c3f46181d4d04f9c785bb8" integrity sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg== -pathval@^1.1.0: +pathval@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== @@ -7825,17 +7475,6 @@ pkg-conf@^2.1.0: find-up "^2.0.0" load-json-file "^4.0.0" -platform-deploy-client@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/platform-deploy-client/-/platform-deploy-client-0.6.0.tgz#1f7a59d0cbae2e78f65ad253d7cc1aff67e3de0e" - integrity sha512-mBfnOvF2gb9acGJjlXBQ6VOAkKFRdljsNKHUVY5xKqzKP2PNh/RqCIvi5AR5NqLMrQ3XaMIwRvmwAjtGw7JhYg== - dependencies: - "@ethersproject/abi" "^5.6.3" - axios "^0.21.2" - defender-base-client "^1.44.0" - lodash "^4.17.19" - node-fetch "^2.6.0" - pluralize@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1" @@ -7938,14 +7577,6 @@ proto-list@~1.2.1: resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" integrity sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA== -proxy-addr@~2.0.7: - version "2.0.7" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" - integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== - dependencies: - forwarded "0.2.0" - ipaddr.js "1.9.1" - proxy-from-env@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" @@ -7956,7 +7587,7 @@ punycode@2.1.0: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" integrity sha512-Yxz2kRwT90aPiWEMHVYnEf4+rhwF1tBmmZ4KepCP+Wkium9JxtWnUm1nqGwpiAHr/tnTSeHqr3wb++jgSkXjhA== -punycode@^2.1.0, punycode@^2.1.1: +punycode@^2.1.0, punycode@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== @@ -7966,14 +7597,7 @@ qrcode-terminal@^0.12.0: resolved "https://registry.yarnpkg.com/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz#bb5b699ef7f9f0505092a3748be4464fe71b5819" integrity sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ== -qs@6.11.0: - version "6.11.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" - integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== - dependencies: - side-channel "^1.0.4" - -qs@^6.4.0, qs@^6.7.0, qs@^6.9.4: +qs@^6.4.0, qs@^6.9.4: version "6.11.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.2.tgz#64bea51f12c1f5da1bc01496f48ffcff7c69d7d9" integrity sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA== @@ -8002,21 +7626,6 @@ randombytes@^2.1.0: dependencies: safe-buffer "^5.1.0" -range-parser@~1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" - integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== - -raw-body@2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" - integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== - dependencies: - bytes "3.1.2" - http-errors "2.0.0" - iconv-lite "0.4.24" - unpipe "1.0.0" - raw-body@^2.4.1: version "2.5.2" resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" @@ -8384,7 +7993,7 @@ safe-array-concat@^1.0.1: has-symbols "^1.0.3" isarray "^2.0.5" -safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -8510,25 +8119,6 @@ semver@^7.0.0, semver@^7.1.1, semver@^7.1.2, semver@^7.3.2, semver@^7.3.4, semve dependencies: lru-cache "^6.0.0" -send@0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" - integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== - dependencies: - debug "2.6.9" - depd "2.0.0" - destroy "1.2.0" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "2.0.0" - mime "1.6.0" - ms "2.1.3" - on-finished "2.4.1" - range-parser "~1.2.1" - statuses "2.0.1" - serialize-javascript@6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" @@ -8536,16 +8126,6 @@ serialize-javascript@6.0.0: dependencies: randombytes "^2.1.0" -serve-static@1.15.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" - integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== - dependencies: - encodeurl "~1.0.2" - escape-html "~1.0.3" - parseurl "~1.3.3" - send "0.18.0" - set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -8742,7 +8322,7 @@ solc@^0.4.20: semver "^5.3.0" yargs "^4.7.1" -solhint@4.0.0: +solhint@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/solhint/-/solhint-4.0.0.tgz#fbd27ec9c8348b4fea90b5b469a5c95d625d2e59" integrity sha512-bFViMcFvhqVd/HK3Roo7xZXX5nbujS7Bxeg5vnZc9QvH0yCWCrQ38Yrn1pbAY9tlKROc6wFr+rK1mxYgYrjZgA== @@ -8769,13 +8349,13 @@ solhint@4.0.0: prettier "^2.8.3" solidity-ast@^0.4.38, solidity-ast@^0.4.51: - version "0.4.53" - resolved "https://registry.yarnpkg.com/solidity-ast/-/solidity-ast-0.4.53.tgz#098259472fccd234ff00f050afaf7843a7ccd635" - integrity sha512-/7xYF//mAt4iP9S21fCFSLMouYXzXJqrd84jbI1LHL1rq7XhyFLUXxVcRkl9KqEEQmI+DmDbTeS6W5cEwcJ2wQ== + version "0.4.55" + resolved "https://registry.yarnpkg.com/solidity-ast/-/solidity-ast-0.4.55.tgz#00b685e6eefb2e8dfb67df1fe0afbe3b3bfb4b28" + integrity sha512-qeEU/r/K+V5lrAw8iswf2/yfWAnSGs3WKPHI+zAFKFjX0dIBVXEU/swQ8eJQYHf6PJWUZFO2uWV4V1wEOkeQbA== dependencies: array.prototype.findlast "^1.2.2" -solidity-coverage@^0.8.2: +solidity-coverage@^0.8.5: version "0.8.5" resolved "https://registry.yarnpkg.com/solidity-coverage/-/solidity-coverage-0.8.5.tgz#64071c3a0c06a0cecf9a7776c35f49edc961e875" integrity sha512-6C6N6OV2O8FQA0FWA95FdzVH+L16HU94iFgg5wAFZ29UpLFkgNI/DRR2HotG1bC0F4gAc/OMs2BJI44Q/DYlKQ== @@ -8801,7 +8381,7 @@ solidity-coverage@^0.8.2: shelljs "^0.8.3" web3-utils "^1.3.6" -solidity-docgen@^0.6.0-beta.35: +solidity-docgen@^0.6.0-beta.36: version "0.6.0-beta.36" resolved "https://registry.yarnpkg.com/solidity-docgen/-/solidity-docgen-0.6.0-beta.36.tgz#9c76eda58580fb52e2db318c22fe3154e0c09dd1" integrity sha512-f/I5G2iJgU1h0XrrjRD0hHMr7C10u276vYvm//rw1TzFcYQ4xTOyAoi9oNAHRU0JU4mY9eTuxdVc2zahdMuhaQ== @@ -9195,16 +8775,14 @@ tempy@^3.0.0: type-fest "^2.12.2" unique-string "^3.0.0" -tenderly@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tenderly/-/tenderly-0.6.0.tgz#fb74e672a3b6dcfe66c8fd44c79ab91a9233f3eb" - integrity sha512-uPnR5ujR1j0Aay4nuqymTY2nu3e0yDjl6dHBqkTTIYEDzyzaDLx2+PkVxjT5RWseAbWORsa6GYetletATf1zmQ== +tenderly@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/tenderly/-/tenderly-0.7.0.tgz#70fb9aa78fe9b738df38fdf76c72f083a6bd18d1" + integrity sha512-yA5KEYRRgT5lva1o8mhAU+zwpVc5f6+HJ+lVxPhdmK3LeTrm+ZEW7FYKM8WwM2HHgVugwKja+7wuS7gRhnZ/ug== dependencies: axios "^0.27.2" cli-table3 "^0.6.2" commander "^9.4.0" - express "^4.18.1" - hyperlinker "^1.0.0" js-yaml "^4.1.0" open "^8.4.0" prompts "^2.4.2" @@ -9284,12 +8862,12 @@ toidentifier@1.0.1: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== -tr46@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-3.0.0.tgz#555c4e297a950617e8eeddef633c87d4d9d6cbf9" - integrity sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA== +tr46@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-4.1.1.tgz#281a758dcc82aeb4fe38c7dfe4d11a395aac8469" + integrity sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw== dependencies: - punycode "^2.1.1" + punycode "^2.3.0" tr46@~0.0.3: version "0.0.3" @@ -9350,16 +8928,40 @@ ts-node@10.9.1: v8-compile-cache-lib "^3.0.1" yn "3.1.1" -tsconfig-paths@^3.14.2: - version "3.14.2" - resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz#6e32f1f79412decd261f92d633a9dc1cfa99f088" - integrity sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g== +ts-node@^10.9.1: + version "10.9.2" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f" + integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" + arg "^4.1.0" + create-require "^1.1.0" + diff "^4.0.1" + make-error "^1.1.1" + v8-compile-cache-lib "^3.0.1" + yn "3.1.1" + +tsconfig-paths@^3.15.0: + version "3.15.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz#5299ec605e55b1abb23ec939ef15edaf483070d4" + integrity sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg== dependencies: "@types/json5" "^0.0.29" json5 "^1.0.2" minimist "^1.2.6" strip-bom "^3.0.0" +tslib@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" + integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== + tslib@^1.11.1, tslib@^1.8.1, tslib@^1.9.3: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" @@ -9420,7 +9022,7 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -type-detect@^4.0.0, type-detect@^4.0.5: +type-detect@^4.0.0, type-detect@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== @@ -9471,22 +9073,14 @@ type-fest@^3.0.0, type-fest@^3.8.0: integrity sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g== type-fest@^4.2.0: - version "4.7.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.7.1.tgz#dbe462c5f350d708ec6ca6fe8925b5b6541ca9a7" - integrity sha512-iWr8RUmzAJRfhZugX9O7nZE6pCxDU8CZ3QxsLuTnGcBLJpCaP2ll3s4eMTBoFnU/CeXY/5rfQSuAEsTGJO4y8A== - -type-is@~1.6.18: - version "1.6.18" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" - integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.24" + version "4.8.3" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.8.3.tgz#6db08d9f44d596cd953f83020c7c56310c368d1c" + integrity sha512-//BaTm14Q/gHBn09xlnKNqfI8t6bmdzx2DXYfPBNofN0WUybCEUDcbCWcTa0oF09lzLjZgPphXAsvRiMK0V6Bw== -typechain@8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/typechain/-/typechain-8.1.0.tgz#fc4902ce596519cb2ccfd012e4ddf92a9945b569" - integrity sha512-5jToLgKTjHdI1VKqs/K8BLYy42Sr3o8bV5ojh4MnR9ExHO83cyyUdw+7+vMJCpKXUiVUvARM4qmHTFuyaCMAZQ== +typechain@^8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/typechain/-/typechain-8.3.2.tgz#1090dd8d9c57b6ef2aed3640a516bdbf01b00d73" + integrity sha512-x/sQYr5w9K7yv3es7jo4KTX05CLxOf7TRWwoHlrjRh8H82G64g+k7VuWPJlgMo6qrjfCulOdfBjiaDtmhFYD/Q== dependencies: "@types/prettier" "^2.1.1" debug "^4.3.1" @@ -9543,10 +9137,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== -typescript@^5.0.2: - version "5.2.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78" - integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w== +typescript@^5.0.2, typescript@^5.2.2: + version "5.3.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37" + integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw== typical@^4.0.0: version "4.0.0" @@ -9579,9 +9173,9 @@ undici-types@~5.26.4: integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== undici@^5.14.0: - version "5.27.2" - resolved "https://registry.yarnpkg.com/undici/-/undici-5.27.2.tgz#a270c563aea5b46cc0df2550523638c95c5d4411" - integrity sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ== + version "5.28.2" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.2.tgz#fea200eac65fc7ecaff80a023d1a0543423b4c91" + integrity sha512-wh1pHJHnUeQV5Xa8/kyQhO7WFa8M34l026L5P/+2TYiakvGy5Rdc8jWZVyG7ieht/0WgJLEd3kcU5gKx+6GC8w== dependencies: "@fastify/busboy" "^2.0.0" @@ -9645,7 +9239,7 @@ universalify@^2.0.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d" integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw== -unpipe@1.0.0, unpipe@~1.0.0: +unpipe@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== @@ -9672,11 +9266,6 @@ util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== - uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" @@ -9707,11 +9296,6 @@ varint@^5.0.0: resolved "https://registry.yarnpkg.com/varint/-/varint-5.0.2.tgz#5b47f8a947eb668b848e034dcfa87d0ff8a7f7a4" integrity sha512-lKxKYG6H03yCZUpAGOPOsMcGxd1RHCu1iKvEHYDPmTyq2HueGhD73ssNBqqQWfvYs04G9iUFRvmAVLW20Jw6ow== -vary@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== - walk-up-path@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/walk-up-path/-/walk-up-path-3.0.1.tgz#c8d78d5375b4966c717eb17ada73dbd41490e886" @@ -9748,12 +9332,12 @@ webidl-conversions@^7.0.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== -whatwg-url@^11.0.0: - version "11.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-11.0.0.tgz#0a849eebb5faf2119b901bb76fd795c2848d4018" - integrity sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ== +whatwg-url@^13.0.0: + version "13.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-13.0.0.tgz#b7b536aca48306394a34e44bda8e99f332410f8f" + integrity sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig== dependencies: - tr46 "^3.0.0" + tr46 "^4.1.1" webidl-conversions "^7.0.0" whatwg-url@^5.0.0: @@ -9917,6 +9501,11 @@ ws@7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c" integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A== +ws@8.5.0: + version "8.5.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.5.0.tgz#bfb4be96600757fe5382de12c670dab984a1ed4f" + integrity sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg== + ws@^7.4.6: version "7.5.9" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591"