diff --git a/.circleci/config.yml b/.circleci/config.yml index ad3b1d6d19..92ed4dc105 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -346,9 +346,9 @@ jobs: # if there are no tests, terminate execution after this step if [ -s "/tmp/tests.txt" ]; then echo cat "/tmp/tests.txt" - cat "/tmp/tests.txt" + cat "/tmp/tests.txt" else - echo "SKIP: No tests found" + echo "SKIP: No tests found" circleci-agent step halt fi @@ -428,8 +428,12 @@ jobs: - install-foundry - yarn-install - run: yarn build:ts - - run: yarn storage:verify + - run: yarn storage:dump - run: yarn check:storage + # pull the storage dumps from main so that we can compare against them + - run: for f in $(find . -name 'storage.dump.json'); do git checkout $(git merge-base HEAD FETCH_HEAD) -- $f || true; done + # todo: next step may be removable/optimizable, but it only takes like 20 seconds + - run: yarn storage:verify lint: docker: diff --git a/.gitignore b/.gitignore index d46791accc..ced8750bfb 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ typechain-types lerna-debug.log docs/ junit +storage.new.dump.json # Yarn v3 .pnp.* diff --git a/.prettierignore b/.prettierignore index b5c55891ef..ea7a7d7a7f 100644 --- a/.prettierignore +++ b/.prettierignore @@ -27,6 +27,8 @@ lerna.json **/tests/.latest.json **/lib **/out +storage.dump.json +storage.new.dump.json utils/docgen/deployments/ utils/docgen/abis/ diff --git a/.solhintignore b/.solhintignore index e2bcbb9e64..da4fd10d27 100644 --- a/.solhintignore +++ b/.solhintignore @@ -1,4 +1,5 @@ \*.dump.sol +\*.dump.json artifacts/ node_modules/ **/contracts/generated @@ -17,8 +18,6 @@ utils/core-modules/contracts/modules/UpgradeModule.sol utils/core-contracts/contracts/ownership/Ownable.sol utils/core-contracts/contracts/ownership/OwnableStorage.sol -storage.dump.sol - # Immutable InitialProxy markets/legacy-market/contracts/InitialModuleBundle.sol markets/perps-market/contracts/modules/CoreModule.sol diff --git a/.yarn/cache/@types-lodash.memoize-npm-4.1.9-57da73777b-d11efe6049.zip b/.yarn/cache/@types-lodash.memoize-npm-4.1.9-57da73777b-d11efe6049.zip new file mode 100644 index 0000000000..f4c9c769e4 Binary files /dev/null and b/.yarn/cache/@types-lodash.memoize-npm-4.1.9-57da73777b-d11efe6049.zip differ diff --git a/.yarn/cache/cli-table3-npm-0.6.5-c3f24f9c39-8dca71256f.zip b/.yarn/cache/cli-table3-npm-0.6.5-c3f24f9c39-8dca71256f.zip new file mode 100644 index 0000000000..4f64f79369 Binary files /dev/null and b/.yarn/cache/cli-table3-npm-0.6.5-c3f24f9c39-8dca71256f.zip differ diff --git a/auxiliary/ArbitrumGasPriceOracle/package.json b/auxiliary/ArbitrumGasPriceOracle/package.json index a21eb50356..0f380fd9e5 100644 --- a/auxiliary/ArbitrumGasPriceOracle/package.json +++ b/auxiliary/ArbitrumGasPriceOracle/package.json @@ -8,10 +8,11 @@ "scripts": { "clean": "hardhat clean", "build": "yarn build:contracts", - "storage:verify": "hardhat compile --force && hardhat storage:verify", - "build:contracts": "hardhat compile --force && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", "build-testable": "CANNON_REGISTRY_PRIORITY=local hardhat cannon:build cannonfile.test.toml", - "check:storage": "git diff --exit-code storage.dump.sol", + "build:contracts": "hardhat compile --force && yarn storage:dump && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "storage:dump": "hardhat storage:dump --output storage.new.dump.json", + "check:storage": "diff -uw storage.dump.json storage.new.dump.json", + "storage:verify": " hardhat storage:verify", "test": "CANNON_REGISTRY_PRIORITY=local hardhat test", "coverage": "hardhat coverage --network hardhat", "compile-contracts": "hardhat compile", diff --git a/auxiliary/ArbitrumGasPriceOracle/storage.dump.json b/auxiliary/ArbitrumGasPriceOracle/storage.dump.json new file mode 100644 index 0000000000..34aa2caae8 --- /dev/null +++ b/auxiliary/ArbitrumGasPriceOracle/storage.dump.json @@ -0,0 +1,66 @@ +{ + "contracts/ArbGasPriceOracle.sol:ArbGasPriceOracle": { + "name": "ArbGasPriceOracle", + "kind": "contract", + "structs": { + "RuntimeParams": [ + { + "type": "uint256", + "name": "l1SettleGasUnits", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "l2SettleGasUnits", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "uint256", + "name": "l1FlagGasUnits", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "uint256", + "name": "l2FlagGasUnits", + "size": 32, + "slot": "3", + "offset": 0 + }, + { + "type": "uint256", + "name": "l1LiquidateGasUnits", + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "uint256", + "name": "l2LiquidateGasUnits", + "size": 32, + "slot": "5", + "offset": 0 + }, + { + "type": "uint256", + "name": "numberOfUpdatedFeeds", + "size": 32, + "slot": "6", + "offset": 0 + }, + { + "type": "uint256", + "name": "executionKind", + "size": 32, + "slot": "7", + "offset": 0 + } + ] + } + } +} diff --git a/auxiliary/ArbitrumGasPriceOracle/storage.dump.sol b/auxiliary/ArbitrumGasPriceOracle/storage.dump.sol deleted file mode 100644 index 4236af12c8..0000000000 --- a/auxiliary/ArbitrumGasPriceOracle/storage.dump.sol +++ /dev/null @@ -1,126 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.8.11<0.9.0; - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/DecimalMath.sol:DecimalMath -library DecimalMath { - uint256 public constant UNIT = 1e18; - int256 public constant UNIT_INT = int256(UNIT); - uint128 public constant UNIT_UINT128 = uint128(UNIT); - int128 public constant UNIT_INT128 = int128(UNIT_INT); - uint256 public constant UNIT_PRECISE = 1e27; - int256 public constant UNIT_PRECISE_INT = int256(UNIT_PRECISE); - int128 public constant UNIT_PRECISE_INT128 = int128(UNIT_PRECISE_INT); - uint256 public constant PRECISION_FACTOR = 9; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/interfaces/external/IPyth.sol:PythStructs -contract PythStructs { - struct Price { - int64 price; - uint64 conf; - int32 expo; - uint256 publishTime; - } - struct PriceFeed { - bytes32 id; - Price price; - Price emaPrice; - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/ChainlinkNode.sol:ChainlinkNode -library ChainlinkNode { - uint256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/ReducerNode.sol:ReducerNode -library ReducerNode { - enum Operations { - RECENT, - MIN, - MAX, - MEAN, - MEDIAN, - MUL, - DIV, - MULDECIMAL, - DIVDECIMAL - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/UniswapNode.sol:UniswapNode -library UniswapNode { - uint8 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/pyth/PythNode.sol:PythNode -library PythNode { - int256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/pyth/PythOffchainLookupNode.sol:PythOffchainLookupNode -library PythOffchainLookupNode { - int256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/storage/NodeDefinition.sol:NodeDefinition -library NodeDefinition { - enum NodeType { - NONE, - REDUCER, - EXTERNAL, - CHAINLINK, - UNISWAP, - PYTH, - PRICE_DEVIATION_CIRCUIT_BREAKER, - STALENESS_CIRCUIT_BREAKER, - CONSTANT, - PYTH_OFFCHAIN_LOOKUP - } - struct Data { - NodeType nodeType; - bytes parameters; - bytes32[] parents; - } - function load(bytes32 id) internal pure returns (Data storage node) { - bytes32 s = keccak256(abi.encode("io.synthetix.oracle-manager.Node", id)); - assembly { - node.slot := s - } - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/storage/NodeOutput.sol:NodeOutput -library NodeOutput { - struct Data { - int256 price; - uint256 timestamp; - uint256 __slotAvailableForFutureUse1; - uint256 __slotAvailableForFutureUse2; - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/utils/TickMath.sol:TickMath -library TickMath { - int24 internal constant MIN_TICK = -887272; - int24 internal constant MAX_TICK = -MIN_TICK; - uint160 internal constant MIN_SQRT_RATIO = 4295128739; - uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342; -} - -// @custom:artifact contracts/ArbGasPriceOracle.sol:ArbGasPriceOracle -contract ArbGasPriceOracle { - uint256 public constant KIND_SETTLEMENT = 0; - uint256 public constant KIND_FLAG = 1; - uint256 public constant KIND_LIQUIDATE = 2; - struct RuntimeParams { - uint256 l1SettleGasUnits; - uint256 l2SettleGasUnits; - uint256 l1FlagGasUnits; - uint256 l2FlagGasUnits; - uint256 l1LiquidateGasUnits; - uint256 l2LiquidateGasUnits; - uint256 numberOfUpdatedFeeds; - uint256 executionKind; - } -} diff --git a/auxiliary/BuybackSnx/package.json b/auxiliary/BuybackSnx/package.json index 2501b11235..1b3726c0e1 100644 --- a/auxiliary/BuybackSnx/package.json +++ b/auxiliary/BuybackSnx/package.json @@ -10,10 +10,11 @@ "coverage": "hardhat coverage --network hardhat", "clean": "hardhat clean", "build": "yarn build:contracts", - "storage:verify": "hardhat compile --force && hardhat storage:verify", - "build:contracts": "hardhat compile --force && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "build:contracts": "hardhat compile --force && yarn storage:dump && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "storage:dump": "hardhat storage:dump --output storage.new.dump.json", + "storage:verify": " hardhat storage:verify", "build-testable": "CANNON_REGISTRY_PRIORITY=local hardhat cannon:build cannonfile.test.toml", - "check:storage": "git diff --exit-code storage.dump.sol", + "check:storage": "diff -uw storage.dump.json storage.new.dump.json", "compile-contracts": "hardhat compile", "size-contracts": "hardhat compile && hardhat size-contracts", "publish-contracts": "cannon publish buyback-snx:$(node -p 'require(`./package.json`).version') --chain-id 13370 --quiet --tags $(node -p '/^\\d+\\.\\d+\\.\\d+$/.test(require(`./package.json`).version) ? `latest` : `dev`')", diff --git a/auxiliary/BuybackSnx/storage.dump.json b/auxiliary/BuybackSnx/storage.dump.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/auxiliary/BuybackSnx/storage.dump.json @@ -0,0 +1 @@ +{} diff --git a/auxiliary/BuybackSnx/storage.dump.sol b/auxiliary/BuybackSnx/storage.dump.sol deleted file mode 100644 index 6b0a2e7867..0000000000 --- a/auxiliary/BuybackSnx/storage.dump.sol +++ /dev/null @@ -1,114 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.8.11<0.9.0; - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/DecimalMath.sol:DecimalMath -library DecimalMath { - uint256 public constant UNIT = 1e18; - int256 public constant UNIT_INT = int256(UNIT); - uint128 public constant UNIT_UINT128 = uint128(UNIT); - int128 public constant UNIT_INT128 = int128(UNIT_INT); - uint256 public constant UNIT_PRECISE = 1e27; - int256 public constant UNIT_PRECISE_INT = int256(UNIT_PRECISE); - int128 public constant UNIT_PRECISE_INT128 = int128(UNIT_PRECISE_INT); - uint256 public constant PRECISION_FACTOR = 9; -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/ERC2771Context.sol:ERC2771Context -library ERC2771Context { - address private constant TRUSTED_FORWARDER = 0xE2C5658cC5C448B48141168f3e475dF8f65A1e3e; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/interfaces/external/IPyth.sol:PythStructs -contract PythStructs { - struct Price { - int64 price; - uint64 conf; - int32 expo; - uint256 publishTime; - } - struct PriceFeed { - bytes32 id; - Price price; - Price emaPrice; - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/ChainlinkNode.sol:ChainlinkNode -library ChainlinkNode { - uint256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/ReducerNode.sol:ReducerNode -library ReducerNode { - enum Operations { - RECENT, - MIN, - MAX, - MEAN, - MEDIAN, - MUL, - DIV, - MULDECIMAL, - DIVDECIMAL - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/UniswapNode.sol:UniswapNode -library UniswapNode { - uint8 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/pyth/PythNode.sol:PythNode -library PythNode { - int256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/pyth/PythOffchainLookupNode.sol:PythOffchainLookupNode -library PythOffchainLookupNode { - int256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/storage/NodeDefinition.sol:NodeDefinition -library NodeDefinition { - enum NodeType { - NONE, - REDUCER, - EXTERNAL, - CHAINLINK, - UNISWAP, - PYTH, - PRICE_DEVIATION_CIRCUIT_BREAKER, - STALENESS_CIRCUIT_BREAKER, - CONSTANT, - PYTH_OFFCHAIN_LOOKUP - } - struct Data { - NodeType nodeType; - bytes parameters; - bytes32[] parents; - } - function load(bytes32 id) internal pure returns (Data storage node) { - bytes32 s = keccak256(abi.encode("io.synthetix.oracle-manager.Node", id)); - assembly { - node.slot := s - } - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/storage/NodeOutput.sol:NodeOutput -library NodeOutput { - struct Data { - int256 price; - uint256 timestamp; - uint256 __slotAvailableForFutureUse1; - uint256 __slotAvailableForFutureUse2; - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/utils/TickMath.sol:TickMath -library TickMath { - int24 internal constant MIN_TICK = -887272; - int24 internal constant MAX_TICK = -MIN_TICK; - uint160 internal constant MIN_SQRT_RATIO = 4295128739; - uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342; -} diff --git a/auxiliary/ERC4626ToAssetsRatioOracle/package.json b/auxiliary/ERC4626ToAssetsRatioOracle/package.json index d5c1fd93a2..7505e82fca 100644 --- a/auxiliary/ERC4626ToAssetsRatioOracle/package.json +++ b/auxiliary/ERC4626ToAssetsRatioOracle/package.json @@ -10,10 +10,11 @@ "coverage": "hardhat coverage --network hardhat", "clean": "hardhat clean", "build": "yarn build:contracts", - "storage:verify": "hardhat compile --force && hardhat storage:verify", - "build:contracts": "hardhat compile --force && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "build:contracts": "hardhat compile --force && yarn storage:dump && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "storage:dump": "hardhat storage:dump --output storage.new.dump.json", + "storage:verify": " hardhat storage:verify", "build-testable": "CANNON_REGISTRY_PRIORITY=local hardhat cannon:build cannonfile.test.toml", - "check:storage": "git diff --exit-code storage.dump.sol", + "check:storage": "diff -uw storage.dump.json storage.new.dump.json", "compile-contracts": "hardhat compile", "size-contracts": "hardhat compile && hardhat size-contracts", "publish-contracts": "cannon publish erc-4626-to-assets-ratio-oracle:$(node -p 'require(`./package.json`).version') --chain-id 13370 --quiet --tags $(node -p '/^\\d+\\.\\d+\\.\\d+$/.test(require(`./package.json`).version) ? `latest` : `dev`')", diff --git a/auxiliary/ERC4626ToAssetsRatioOracle/storage.dump.json b/auxiliary/ERC4626ToAssetsRatioOracle/storage.dump.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/auxiliary/ERC4626ToAssetsRatioOracle/storage.dump.json @@ -0,0 +1 @@ +{} diff --git a/auxiliary/ERC4626ToAssetsRatioOracle/storage.dump.sol b/auxiliary/ERC4626ToAssetsRatioOracle/storage.dump.sol deleted file mode 100644 index eb58233a66..0000000000 --- a/auxiliary/ERC4626ToAssetsRatioOracle/storage.dump.sol +++ /dev/null @@ -1,109 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.20; - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/DecimalMath.sol:DecimalMath -library DecimalMath { - uint256 public constant UNIT = 1e18; - int256 public constant UNIT_INT = int256(UNIT); - uint128 public constant UNIT_UINT128 = uint128(UNIT); - int128 public constant UNIT_INT128 = int128(UNIT_INT); - uint256 public constant UNIT_PRECISE = 1e27; - int256 public constant UNIT_PRECISE_INT = int256(UNIT_PRECISE); - int128 public constant UNIT_PRECISE_INT128 = int128(UNIT_PRECISE_INT); - uint256 public constant PRECISION_FACTOR = 9; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/interfaces/external/IPyth.sol:PythStructs -contract PythStructs { - struct Price { - int64 price; - uint64 conf; - int32 expo; - uint256 publishTime; - } - struct PriceFeed { - bytes32 id; - Price price; - Price emaPrice; - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/ChainlinkNode.sol:ChainlinkNode -library ChainlinkNode { - uint256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/ReducerNode.sol:ReducerNode -library ReducerNode { - enum Operations { - RECENT, - MIN, - MAX, - MEAN, - MEDIAN, - MUL, - DIV, - MULDECIMAL, - DIVDECIMAL - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/UniswapNode.sol:UniswapNode -library UniswapNode { - uint8 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/pyth/PythNode.sol:PythNode -library PythNode { - int256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/pyth/PythOffchainLookupNode.sol:PythOffchainLookupNode -library PythOffchainLookupNode { - int256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/storage/NodeDefinition.sol:NodeDefinition -library NodeDefinition { - enum NodeType { - NONE, - REDUCER, - EXTERNAL, - CHAINLINK, - UNISWAP, - PYTH, - PRICE_DEVIATION_CIRCUIT_BREAKER, - STALENESS_CIRCUIT_BREAKER, - CONSTANT, - PYTH_OFFCHAIN_LOOKUP - } - struct Data { - NodeType nodeType; - bytes parameters; - bytes32[] parents; - } - function load(bytes32 id) internal pure returns (Data storage node) { - bytes32 s = keccak256(abi.encode("io.synthetix.oracle-manager.Node", id)); - assembly { - node.slot := s - } - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/storage/NodeOutput.sol:NodeOutput -library NodeOutput { - struct Data { - int256 price; - uint256 timestamp; - uint256 __slotAvailableForFutureUse1; - uint256 __slotAvailableForFutureUse2; - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/utils/TickMath.sol:TickMath -library TickMath { - int24 internal constant MIN_TICK = -887272; - int24 internal constant MAX_TICK = -MIN_TICK; - uint160 internal constant MIN_SQRT_RATIO = 4295128739; - uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342; -} diff --git a/auxiliary/OpGasPriceOracle/package.json b/auxiliary/OpGasPriceOracle/package.json index 5a497388b1..14dc1e9dca 100644 --- a/auxiliary/OpGasPriceOracle/package.json +++ b/auxiliary/OpGasPriceOracle/package.json @@ -10,10 +10,11 @@ "coverage": "hardhat coverage --network hardhat", "clean": "hardhat clean", "build": "yarn build:contracts", - "storage:verify": "hardhat compile --force && hardhat storage:verify", - "build:contracts": "hardhat compile --force && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "build:contracts": "hardhat compile --force && yarn storage:dump && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "storage:dump": "hardhat storage:dump --output storage.new.dump.json", + "storage:verify": " hardhat storage:verify", "build-testable": "CANNON_REGISTRY_PRIORITY=local hardhat cannon:build cannonfile.test.toml", - "check:storage": "git diff --exit-code storage.dump.sol", + "check:storage": "diff -uw storage.dump.json storage.new.dump.json", "compile-contracts": "hardhat compile", "size-contracts": "hardhat compile && hardhat size-contracts", "publish-contracts": "cannon publish op-gas-price-oracle:$(node -p 'require(`./package.json`).version') --chain-id 13370 --quiet --tags $(node -p '/^\\d+\\.\\d+\\.\\d+$/.test(require(`./package.json`).version) ? `latest` : `dev`')", diff --git a/auxiliary/OpGasPriceOracle/storage.dump.json b/auxiliary/OpGasPriceOracle/storage.dump.json new file mode 100644 index 0000000000..1891804b6c --- /dev/null +++ b/auxiliary/OpGasPriceOracle/storage.dump.json @@ -0,0 +1,87 @@ +{ + "contracts/OpGasPriceOracle.sol:OpGasPriceOracle": { + "name": "OpGasPriceOracle", + "kind": "contract", + "structs": { + "RuntimeParams": [ + { + "type": "uint256", + "name": "l1SettleGasUnits", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "l2SettleGasUnits", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "uint256", + "name": "l1FlagGasUnits", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "uint256", + "name": "l2FlagGasUnits", + "size": 32, + "slot": "3", + "offset": 0 + }, + { + "type": "uint256", + "name": "l1LiquidateGasUnits", + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "uint256", + "name": "l2LiquidateGasUnits", + "size": 32, + "slot": "5", + "offset": 0 + }, + { + "type": "uint256", + "name": "settleTxSize", + "size": 32, + "slot": "6", + "offset": 0 + }, + { + "type": "uint256", + "name": "flagTxSize", + "size": 32, + "slot": "7", + "offset": 0 + }, + { + "type": "uint256", + "name": "liquidateTxSize", + "size": 32, + "slot": "8", + "offset": 0 + }, + { + "type": "uint256", + "name": "numberOfUpdatedFeeds", + "size": 32, + "slot": "9", + "offset": 0 + }, + { + "type": "uint256", + "name": "executionKind", + "size": 32, + "slot": "10", + "offset": 0 + } + ] + } + } +} diff --git a/auxiliary/OpGasPriceOracle/storage.dump.sol b/auxiliary/OpGasPriceOracle/storage.dump.sol deleted file mode 100644 index 136feb32ed..0000000000 --- a/auxiliary/OpGasPriceOracle/storage.dump.sol +++ /dev/null @@ -1,135 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.8.11<0.9.0; - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/DecimalMath.sol:DecimalMath -library DecimalMath { - uint256 public constant UNIT = 1e18; - int256 public constant UNIT_INT = int256(UNIT); - uint128 public constant UNIT_UINT128 = uint128(UNIT); - int128 public constant UNIT_INT128 = int128(UNIT_INT); - uint256 public constant UNIT_PRECISE = 1e27; - int256 public constant UNIT_PRECISE_INT = int256(UNIT_PRECISE); - int128 public constant UNIT_PRECISE_INT128 = int128(UNIT_PRECISE_INT); - uint256 public constant PRECISION_FACTOR = 9; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/interfaces/external/IPyth.sol:PythStructs -contract PythStructs { - struct Price { - int64 price; - uint64 conf; - int32 expo; - uint256 publishTime; - } - struct PriceFeed { - bytes32 id; - Price price; - Price emaPrice; - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/ChainlinkNode.sol:ChainlinkNode -library ChainlinkNode { - uint256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/ReducerNode.sol:ReducerNode -library ReducerNode { - enum Operations { - RECENT, - MIN, - MAX, - MEAN, - MEDIAN, - MUL, - DIV, - MULDECIMAL, - DIVDECIMAL - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/UniswapNode.sol:UniswapNode -library UniswapNode { - uint8 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/pyth/PythNode.sol:PythNode -library PythNode { - int256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/pyth/PythOffchainLookupNode.sol:PythOffchainLookupNode -library PythOffchainLookupNode { - int256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/storage/NodeDefinition.sol:NodeDefinition -library NodeDefinition { - enum NodeType { - NONE, - REDUCER, - EXTERNAL, - CHAINLINK, - UNISWAP, - PYTH, - PRICE_DEVIATION_CIRCUIT_BREAKER, - STALENESS_CIRCUIT_BREAKER, - CONSTANT, - PYTH_OFFCHAIN_LOOKUP - } - struct Data { - NodeType nodeType; - bytes parameters; - bytes32[] parents; - } - function load(bytes32 id) internal pure returns (Data storage node) { - bytes32 s = keccak256(abi.encode("io.synthetix.oracle-manager.Node", id)); - assembly { - node.slot := s - } - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/storage/NodeOutput.sol:NodeOutput -library NodeOutput { - struct Data { - int256 price; - uint256 timestamp; - uint256 __slotAvailableForFutureUse1; - uint256 __slotAvailableForFutureUse2; - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/utils/TickMath.sol:TickMath -library TickMath { - int24 internal constant MIN_TICK = -887272; - int24 internal constant MAX_TICK = -MIN_TICK; - uint160 internal constant MIN_SQRT_RATIO = 4295128739; - uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342; -} - -// @custom:artifact contracts/OpGasPriceOracle.sol:OpGasPriceOracle -contract OpGasPriceOracle { - uint256 public constant KIND_SETTLEMENT = 0; - uint256 public constant KIND_FLAG = 1; - uint256 public constant KIND_LIQUIDATE = 2; - enum OvmGasPriceOracleMode { - BEDROCK, - ECOTONE, - FJORD, - UNDEFINED - } - struct RuntimeParams { - uint256 l1SettleGasUnits; - uint256 l2SettleGasUnits; - uint256 l1FlagGasUnits; - uint256 l2FlagGasUnits; - uint256 l1LiquidateGasUnits; - uint256 l2LiquidateGasUnits; - uint256 settleTxSize; - uint256 flagTxSize; - uint256 liquidateTxSize; - uint256 numberOfUpdatedFeeds; - uint256 executionKind; - } -} diff --git a/auxiliary/PythERC7412Wrapper/package.json b/auxiliary/PythERC7412Wrapper/package.json index a84a41d948..0dff10f9da 100644 --- a/auxiliary/PythERC7412Wrapper/package.json +++ b/auxiliary/PythERC7412Wrapper/package.json @@ -8,11 +8,12 @@ "scripts": { "clean": "hardhat clean && rm -rf contracts/generated", "build": "yarn build:contracts", - "storage:verify": "hardhat compile --force && hardhat storage:verify", - "build:contracts": "hardhat compile --force && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", - "generate-testable": "rm -rf contracts/generated && hardhat generate-testable", + "build:contracts": "hardhat compile --force && yarn storage:dump && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "storage:dump": "hardhat storage:dump --output storage.new.dump.json", "build-testable": "CANNON_REGISTRY_PRIORITY=local hardhat cannon:build cannonfile.test.toml", - "check:storage": "git diff --exit-code storage.dump.sol", + "check:storage": "diff -uw storage.dump.json storage.new.dump.json", + "storage:verify": " hardhat storage:verify", + "generate-testable": "rm -rf contracts/generated && hardhat generate-testable", "test": "CANNON_REGISTRY_PRIORITY=local hardhat test", "coverage": "hardhat coverage --network hardhat", "compile-contracts": "hardhat compile", diff --git a/auxiliary/PythERC7412Wrapper/storage.dump.json b/auxiliary/PythERC7412Wrapper/storage.dump.json new file mode 100644 index 0000000000..1a0498de4a --- /dev/null +++ b/auxiliary/PythERC7412Wrapper/storage.dump.json @@ -0,0 +1,41 @@ +{ + "contracts/storage/Price.sol:Price": { + "name": "Price", + "kind": "library", + "structs": { + "Data": [ + { + "type": "mapping", + "name": "benchmarkPrices", + "key": { + "type": "uint64" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "int64", + "name": "price" + }, + { + "type": "uint64", + "name": "conf" + }, + { + "type": "int32", + "name": "expo" + }, + { + "type": "uint256", + "name": "publishTime" + } + ] + }, + "size": 32, + "slot": "0", + "offset": 0 + } + ] + } + } +} diff --git a/auxiliary/PythERC7412Wrapper/storage.dump.sol b/auxiliary/PythERC7412Wrapper/storage.dump.sol deleted file mode 100644 index 764bc450fd..0000000000 --- a/auxiliary/PythERC7412Wrapper/storage.dump.sol +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.8.11<0.9.0; - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/DecimalMath.sol:DecimalMath -library DecimalMath { - uint256 public constant UNIT = 1e18; - int256 public constant UNIT_INT = int256(UNIT); - uint128 public constant UNIT_UINT128 = uint128(UNIT); - int128 public constant UNIT_INT128 = int128(UNIT_INT); - uint256 public constant UNIT_PRECISE = 1e27; - int256 public constant UNIT_PRECISE_INT = int256(UNIT_PRECISE); - int128 public constant UNIT_PRECISE_INT128 = int128(UNIT_PRECISE_INT); - uint256 public constant PRECISION_FACTOR = 9; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/interfaces/external/IPyth.sol:PythStructs -contract PythStructs { - struct Price { - int64 price; - uint64 conf; - int32 expo; - uint256 publishTime; - } - struct PriceFeed { - bytes32 id; - Price price; - Price emaPrice; - } -} - -// @custom:artifact contracts/PythERC7412Wrapper.sol:PythERC7412Wrapper -contract PythERC7412Wrapper { - int256 private constant PRECISION = 18; -} - -// @custom:artifact contracts/storage/Price.sol:Price -library Price { - struct Data { - mapping(uint64 => PythStructs.Price) benchmarkPrices; - } - function load(bytes32 priceId) internal pure returns (Data storage price) { - bytes32 s = keccak256(abi.encode("io.synthetix.pyth-erc7412-wrapper.price", priceId)); - assembly { - price.slot := s - } - } -} diff --git a/auxiliary/SpotMarketOracle/package.json b/auxiliary/SpotMarketOracle/package.json index 06b035efcb..f0ce78b44d 100644 --- a/auxiliary/SpotMarketOracle/package.json +++ b/auxiliary/SpotMarketOracle/package.json @@ -10,10 +10,11 @@ "coverage": "hardhat coverage --network hardhat", "clean": "hardhat clean", "build": "yarn build:contracts", - "storage:verify": "hardhat compile --force && hardhat storage:verify", - "build:contracts": "hardhat compile --force && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "build:contracts": "hardhat compile --force && yarn storage:dump && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "storage:dump": "hardhat storage:dump --output storage.new.dump.json", + "storage:verify": " hardhat storage:verify", "build-testable": "CANNON_REGISTRY_PRIORITY=local hardhat cannon:build cannonfile.test.toml", - "check:storage": "git diff --exit-code storage.dump.sol", + "check:storage": "diff -uw storage.dump.json storage.new.dump.json", "compile-contracts": "hardhat compile", "size-contracts": "hardhat compile && hardhat size-contracts", "publish-contracts": "cannon publish spot-market-oracle:$(node -p 'require(`./package.json`).version') --chain-id 13370 --quiet --tags $(node -p '/^\\d+\\.\\d+\\.\\d+$/.test(require(`./package.json`).version) ? `latest` : `dev`')", diff --git a/auxiliary/SpotMarketOracle/storage.dump.json b/auxiliary/SpotMarketOracle/storage.dump.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/auxiliary/SpotMarketOracle/storage.dump.json @@ -0,0 +1 @@ +{} diff --git a/auxiliary/SpotMarketOracle/storage.dump.sol b/auxiliary/SpotMarketOracle/storage.dump.sol deleted file mode 100644 index 7fde9fdb2a..0000000000 --- a/auxiliary/SpotMarketOracle/storage.dump.sol +++ /dev/null @@ -1,180 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.8.11<0.9.0; - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/DecimalMath.sol:DecimalMath -library DecimalMath { - uint256 public constant UNIT = 1e18; - int256 public constant UNIT_INT = int256(UNIT); - uint128 public constant UNIT_UINT128 = uint128(UNIT); - int128 public constant UNIT_INT128 = int128(UNIT_INT); - uint256 public constant UNIT_PRECISE = 1e27; - int256 public constant UNIT_PRECISE_INT = int256(UNIT_PRECISE); - int128 public constant UNIT_PRECISE_INT128 = int128(UNIT_PRECISE_INT); - uint256 public constant PRECISION_FACTOR = 9; -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/ERC2771Context.sol:ERC2771Context -library ERC2771Context { - address private constant TRUSTED_FORWARDER = 0xE2C5658cC5C448B48141168f3e475dF8f65A1e3e; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/interfaces/external/IPyth.sol:PythStructs -contract PythStructs { - struct Price { - int64 price; - uint64 conf; - int32 expo; - uint256 publishTime; - } - struct PriceFeed { - bytes32 id; - Price price; - Price emaPrice; - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/ChainlinkNode.sol:ChainlinkNode -library ChainlinkNode { - uint256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/ReducerNode.sol:ReducerNode -library ReducerNode { - enum Operations { - RECENT, - MIN, - MAX, - MEAN, - MEDIAN, - MUL, - DIV, - MULDECIMAL, - DIVDECIMAL - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/UniswapNode.sol:UniswapNode -library UniswapNode { - uint8 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/pyth/PythNode.sol:PythNode -library PythNode { - int256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/pyth/PythOffchainLookupNode.sol:PythOffchainLookupNode -library PythOffchainLookupNode { - int256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/storage/NodeDefinition.sol:NodeDefinition -library NodeDefinition { - enum NodeType { - NONE, - REDUCER, - EXTERNAL, - CHAINLINK, - UNISWAP, - PYTH, - PRICE_DEVIATION_CIRCUIT_BREAKER, - STALENESS_CIRCUIT_BREAKER, - CONSTANT, - PYTH_OFFCHAIN_LOOKUP - } - struct Data { - NodeType nodeType; - bytes parameters; - bytes32[] parents; - } - function load(bytes32 id) internal pure returns (Data storage node) { - bytes32 s = keccak256(abi.encode("io.synthetix.oracle-manager.Node", id)); - assembly { - node.slot := s - } - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/storage/NodeOutput.sol:NodeOutput -library NodeOutput { - struct Data { - int256 price; - uint256 timestamp; - uint256 __slotAvailableForFutureUse1; - uint256 __slotAvailableForFutureUse2; - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/utils/TickMath.sol:TickMath -library TickMath { - int24 internal constant MIN_TICK = -887272; - int24 internal constant MAX_TICK = -MIN_TICK; - uint160 internal constant MIN_SQRT_RATIO = 4295128739; - uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342; -} - -// @custom:artifact @synthetixio/spot-market/contracts/storage/OrderFees.sol:OrderFees -library OrderFees { - struct Data { - uint256 fixedFees; - uint256 utilizationFees; - int256 skewFees; - int256 wrapperFees; - } -} - -// @custom:artifact @synthetixio/spot-market/contracts/storage/Price.sol:Price -library Price { - enum Tolerance { - DEFAULT, - STRICT - } - struct Data { - bytes32 buyFeedId; - bytes32 sellFeedId; - uint256 strictStalenessTolerance; - } - function load(uint128 marketId) internal pure returns (Data storage price) { - bytes32 s = keccak256(abi.encode("io.synthetix.spot-market.Price", marketId)); - assembly { - price.slot := s - } - } -} - -// @custom:artifact @synthetixio/spot-market/contracts/storage/SpotMarketFactory.sol:SpotMarketFactory -library SpotMarketFactory { - bytes32 private constant _SLOT_SPOT_MARKET_FACTORY = keccak256(abi.encode("io.synthetix.spot-market.SpotMarketFactory")); - struct Data { - address usdToken; - address oracle; - address synthetix; - address synthImplementation; - mapping(uint128 => address) marketOwners; - mapping(uint128 => address) nominatedMarketOwners; - } - function load() internal pure returns (Data storage spotMarketFactory) { - bytes32 s = _SLOT_SPOT_MARKET_FACTORY; - assembly { - spotMarketFactory.slot := s - } - } -} - -// @custom:artifact @synthetixio/spot-market/contracts/utils/TransactionUtil.sol:Transaction -library Transaction { - enum Type { - NULL, - BUY, - SELL, - ASYNC_BUY, - ASYNC_SELL, - WRAP, - UNWRAP - } -} - -// @custom:artifact contracts/SpotMarketOracle.sol:SpotMarketOracle -contract SpotMarketOracle { - int256 public constant PRECISION = 18; -} diff --git a/auxiliary/WstEthToStEthRatioOracle/package.json b/auxiliary/WstEthToStEthRatioOracle/package.json index 213767a01a..174ce36e63 100644 --- a/auxiliary/WstEthToStEthRatioOracle/package.json +++ b/auxiliary/WstEthToStEthRatioOracle/package.json @@ -10,10 +10,11 @@ "coverage": "hardhat coverage --network hardhat", "clean": "hardhat clean", "build": "yarn build:contracts", - "storage:verify": "hardhat compile --force && hardhat storage:verify", - "build:contracts": "hardhat compile --force && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "build:contracts": "hardhat compile --force && yarn storage:dump && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "storage:dump": "hardhat storage:dump --output storage.new.dump.json", + "storage:verify": " hardhat storage:verify", "build-testable": "CANNON_REGISTRY_PRIORITY=local hardhat cannon:build cannonfile.test.toml", - "check:storage": "git diff --exit-code storage.dump.sol", + "check:storage": "diff -uw storage.dump.json storage.new.dump.json", "compile-contracts": "hardhat compile", "size-contracts": "hardhat compile && hardhat size-contracts", "publish-contracts": "cannon publish wsteth-to-steth-ratio-oracle:$(node -p 'require(`./package.json`).version') --chain-id 13370 --quiet --tags $(node -p '/^\\d+\\.\\d+\\.\\d+$/.test(require(`./package.json`).version) ? `latest` : `dev`')", diff --git a/auxiliary/WstEthToStEthRatioOracle/storage.dump.json b/auxiliary/WstEthToStEthRatioOracle/storage.dump.json new file mode 100644 index 0000000000..0967ef424b --- /dev/null +++ b/auxiliary/WstEthToStEthRatioOracle/storage.dump.json @@ -0,0 +1 @@ +{} diff --git a/auxiliary/WstEthToStEthRatioOracle/storage.dump.sol b/auxiliary/WstEthToStEthRatioOracle/storage.dump.sol deleted file mode 100644 index 5a16ae117f..0000000000 --- a/auxiliary/WstEthToStEthRatioOracle/storage.dump.sol +++ /dev/null @@ -1,109 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.8.11<0.9.0; - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/DecimalMath.sol:DecimalMath -library DecimalMath { - uint256 public constant UNIT = 1e18; - int256 public constant UNIT_INT = int256(UNIT); - uint128 public constant UNIT_UINT128 = uint128(UNIT); - int128 public constant UNIT_INT128 = int128(UNIT_INT); - uint256 public constant UNIT_PRECISE = 1e27; - int256 public constant UNIT_PRECISE_INT = int256(UNIT_PRECISE); - int128 public constant UNIT_PRECISE_INT128 = int128(UNIT_PRECISE_INT); - uint256 public constant PRECISION_FACTOR = 9; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/interfaces/external/IPyth.sol:PythStructs -contract PythStructs { - struct Price { - int64 price; - uint64 conf; - int32 expo; - uint256 publishTime; - } - struct PriceFeed { - bytes32 id; - Price price; - Price emaPrice; - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/ChainlinkNode.sol:ChainlinkNode -library ChainlinkNode { - uint256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/ReducerNode.sol:ReducerNode -library ReducerNode { - enum Operations { - RECENT, - MIN, - MAX, - MEAN, - MEDIAN, - MUL, - DIV, - MULDECIMAL, - DIVDECIMAL - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/UniswapNode.sol:UniswapNode -library UniswapNode { - uint8 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/pyth/PythNode.sol:PythNode -library PythNode { - int256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/pyth/PythOffchainLookupNode.sol:PythOffchainLookupNode -library PythOffchainLookupNode { - int256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/storage/NodeDefinition.sol:NodeDefinition -library NodeDefinition { - enum NodeType { - NONE, - REDUCER, - EXTERNAL, - CHAINLINK, - UNISWAP, - PYTH, - PRICE_DEVIATION_CIRCUIT_BREAKER, - STALENESS_CIRCUIT_BREAKER, - CONSTANT, - PYTH_OFFCHAIN_LOOKUP - } - struct Data { - NodeType nodeType; - bytes parameters; - bytes32[] parents; - } - function load(bytes32 id) internal pure returns (Data storage node) { - bytes32 s = keccak256(abi.encode("io.synthetix.oracle-manager.Node", id)); - assembly { - node.slot := s - } - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/storage/NodeOutput.sol:NodeOutput -library NodeOutput { - struct Data { - int256 price; - uint256 timestamp; - uint256 __slotAvailableForFutureUse1; - uint256 __slotAvailableForFutureUse2; - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/utils/TickMath.sol:TickMath -library TickMath { - int24 internal constant MIN_TICK = -887272; - int24 internal constant MAX_TICK = -MIN_TICK; - uint160 internal constant MIN_SQRT_RATIO = 4295128739; - uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342; -} diff --git a/eslint.config.js b/eslint.config.js index 3ca61711ca..7862e6d38d 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -28,6 +28,8 @@ module.exports = [ '**/subgraph/**/deployments', '**/subgraph/build', '**/subgraph/.bin', + '**/storage.dump.json', + '**/storage.new.dump.json', 'markets/legacy-market/contracts/InitialModuleBundle.sol', 'markets/perps-market/contracts/modules/CoreModule.sol', 'markets/spot-market/contracts/modules/CoreModule.sol', diff --git a/markets/bfp-market/hardhat.config.ts b/markets/bfp-market/hardhat.config.ts index 3c526a3c14..b5eaee2f9c 100644 --- a/markets/bfp-market/hardhat.config.ts +++ b/markets/bfp-market/hardhat.config.ts @@ -22,10 +22,9 @@ const config = { timeout: 30_000, }, storage: { - artifacts: [...commonConfig.storage.artifacts, '!contracts/external/**/*'], - skip: [ - ...commonConfig.storage.skip, - 'contracts/modules/PerpRewardDistributorModule/PerpRewardDistributor.sol:PerpRewardDistributor', + artifacts: [ + ...commonConfig.storage.artifacts, + '!contracts/modules/PerpRewardDistributorModule/PerpRewardDistributor.sol:PerpRewardDistributor', ], }, }; diff --git a/markets/bfp-market/package.json b/markets/bfp-market/package.json index 9a8ec453e7..32ea93e986 100644 --- a/markets/bfp-market/package.json +++ b/markets/bfp-market/package.json @@ -4,11 +4,12 @@ "description": "L1 perp market implementation", "scripts": { "build": "yarn build:contracts", - "storage:verify": "hardhat compile --force && hardhat storage:verify", - "build:contracts": "hardhat compile --force && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "build:contracts": "hardhat compile --force && yarn storage:dump && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "storage:dump": "hardhat storage:dump --output storage.new.dump.json", + "storage:verify": " hardhat storage:verify", "SKIP.generate-testable": "rm -rf contracts/generated && hardhat generate-testable", "build-testable": "CANNON_REGISTRY_PRIORITY=local hardhat cannon:build cannonfile.test.toml", - "check:storage": "git diff --exit-code storage.dump.sol", + "check:storage": "diff -uw storage.dump.json storage.new.dump.json", "start": "yarn build && yarn cannon-build", "clean": "hardhat clean && rm -rf contracts/generated", "cannon-build": "hardhat cannon:build", diff --git a/markets/bfp-market/storage.dump.json b/markets/bfp-market/storage.dump.json new file mode 100644 index 0000000000..61d7ea5c8f --- /dev/null +++ b/markets/bfp-market/storage.dump.json @@ -0,0 +1,1580 @@ +{ + "contracts/modules/LiquidationModule.sol:LiquidationModule": { + "name": "LiquidationModule", + "kind": "contract", + "structs": { + "Runtime_liquidateCollateral": [ + { + "type": "uint256", + "name": "availableSusd", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "supportedCollateralsLength", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "address", + "name": "collateralAddress", + "size": 20, + "slot": "2", + "offset": 0 + }, + { + "type": "uint256", + "name": "availableAccountCollateral", + "size": 32, + "slot": "3", + "offset": 0 + }, + { + "type": "uint128", + "name": "poolId", + "size": 16, + "slot": "4", + "offset": 0 + }, + { + "type": "uint256", + "name": "poolCollateralTypesLength", + "size": 32, + "slot": "5", + "offset": 0 + } + ] + } + }, + "contracts/modules/MarginModule.sol:MarginModule": { + "name": "MarginModule", + "kind": "contract", + "structs": { + "Runtime_setMarginCollateralConfiguration": [ + { + "type": "uint256", + "name": "lengthBefore", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "lengthAfter", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "uint256", + "name": "maxApproveAmount", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "array", + "name": "previousSupportedCollaterals", + "value": { + "type": "address" + }, + "size": 32, + "slot": "3", + "offset": 0 + } + ] + } + }, + "contracts/modules/OrderModule.sol:OrderModule": { + "name": "OrderModule", + "kind": "contract", + "structs": { + "Runtime_commitOrder": [ + { + "type": "uint256", + "name": "oraclePrice", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint64", + "name": "commitmentTime", + "size": 8, + "slot": "1", + "offset": 0 + }, + { + "type": "struct", + "name": "addresses", + "members": [ + { + "type": "address", + "name": "synthetix" + }, + { + "type": "address", + "name": "sUsd" + }, + { + "type": "address", + "name": "oracleManager" + } + ], + "size": 96, + "slot": "2", + "offset": 0 + } + ], + "Runtime_settleOrder": [ + { + "type": "uint256", + "name": "pythPrice", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "int128", + "name": "accruedFunding", + "size": 16, + "slot": "1", + "offset": 0 + }, + { + "type": "uint128", + "name": "accruedUtilization", + "size": 16, + "slot": "1", + "offset": 16 + }, + { + "type": "int256", + "name": "pricePnl", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "uint256", + "name": "fillPrice", + "size": 32, + "slot": "3", + "offset": 0 + }, + { + "type": "uint128", + "name": "updatedMarketSize", + "size": 16, + "slot": "4", + "offset": 0 + }, + { + "type": "int128", + "name": "updatedMarketSkew", + "size": 16, + "slot": "4", + "offset": 16 + }, + { + "type": "uint128", + "name": "totalFees", + "size": 16, + "slot": "5", + "offset": 0 + }, + { + "type": "struct", + "name": "tradeParams", + "members": [ + { + "type": "int128", + "name": "sizeDelta" + }, + { + "type": "uint256", + "name": "oraclePrice" + }, + { + "type": "uint256", + "name": "pythPrice" + }, + { + "type": "uint256", + "name": "fillPrice" + }, + { + "type": "uint128", + "name": "makerFee" + }, + { + "type": "uint128", + "name": "takerFee" + }, + { + "type": "uint256", + "name": "limitPrice" + }, + { + "type": "uint128", + "name": "keeperFeeBufferUsd" + } + ], + "size": 224, + "slot": "6", + "offset": 0 + } + ] + } + }, + "contracts/modules/PerpAccountModule.sol:PerpAccountModule": { + "name": "PerpAccountModule", + "kind": "contract", + "structs": { + "Runtime_splitAccount": [ + { + "type": "uint256", + "name": "oraclePrice", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "toIm", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "uint256", + "name": "fromIm", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "uint128", + "name": "debtToMove", + "size": 16, + "slot": "3", + "offset": 0 + }, + { + "type": "int128", + "name": "sizeToMove", + "size": 16, + "slot": "3", + "offset": 16 + }, + { + "type": "uint256", + "name": "supportedCollateralsLength", + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "address", + "name": "collateralAddress", + "size": 20, + "slot": "5", + "offset": 0 + }, + { + "type": "uint256", + "name": "collateralToMove", + "size": 32, + "slot": "6", + "offset": 0 + }, + { + "type": "uint256", + "name": "newFromAmountCollateral", + "size": 32, + "slot": "7", + "offset": 0 + }, + { + "type": "uint256", + "name": "fromAccountCollateral", + "size": 32, + "slot": "8", + "offset": 0 + }, + { + "type": "uint256", + "name": "toCollateralUsd", + "size": 32, + "slot": "9", + "offset": 0 + }, + { + "type": "uint256", + "name": "fromCollateralUsd", + "size": 32, + "slot": "10", + "offset": 0 + }, + { + "type": "uint256", + "name": "toDiscountedCollateralUsd", + "size": 32, + "slot": "11", + "offset": 0 + }, + { + "type": "uint256", + "name": "fromDiscountedCollateralUsd", + "size": 32, + "slot": "12", + "offset": 0 + }, + { + "type": "uint256", + "name": "collateralPrice", + "size": 32, + "slot": "13", + "offset": 0 + }, + { + "type": "uint256", + "name": "fromAccountCollateralUsd", + "size": 32, + "slot": "14", + "offset": 0 + } + ], + "Runtime_mergeAccounts": [ + { + "type": "uint256", + "name": "oraclePrice", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "im", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "uint256", + "name": "fromCollateralUsd", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "uint256", + "name": "fromMarginUsd", + "size": 32, + "slot": "3", + "offset": 0 + }, + { + "type": "uint256", + "name": "toMarginUsd", + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "uint256", + "name": "mergedCollateralUsd", + "size": 32, + "slot": "5", + "offset": 0 + }, + { + "type": "uint256", + "name": "mergedDiscountedCollateralUsd", + "size": 32, + "slot": "6", + "offset": 0 + }, + { + "type": "uint256", + "name": "supportedCollateralsLength", + "size": 32, + "slot": "7", + "offset": 0 + }, + { + "type": "address", + "name": "collateralAddress", + "size": 20, + "slot": "8", + "offset": 0 + }, + { + "type": "uint256", + "name": "fromAccountCollateral", + "size": 32, + "slot": "9", + "offset": 0 + }, + { + "type": "int256", + "name": "fromSize", + "size": 32, + "slot": "10", + "offset": 0 + } + ] + } + }, + "contracts/storage/AddressRegistry.sol:AddressRegistry": { + "name": "AddressRegistry", + "kind": "library", + "structs": { + "Data": [ + { + "type": "address", + "name": "synthetix", + "size": 20, + "slot": "0", + "offset": 0 + }, + { + "type": "address", + "name": "sUsd", + "size": 20, + "slot": "1", + "offset": 0 + }, + { + "type": "address", + "name": "oracleManager", + "size": 20, + "slot": "2", + "offset": 0 + } + ] + } + }, + "contracts/storage/Margin.sol:Margin": { + "name": "Margin", + "kind": "library", + "structs": { + "CollateralType": [ + { + "type": "bytes32", + "name": "oracleNodeId", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint128", + "name": "maxAllowable", + "size": 16, + "slot": "1", + "offset": 0 + }, + { + "type": "uint128", + "name": "skewScale", + "size": 16, + "slot": "1", + "offset": 16 + }, + { + "type": "address", + "name": "rewardDistributor", + "size": 20, + "slot": "2", + "offset": 0 + }, + { + "type": "bool", + "name": "exists", + "size": 1, + "slot": "2", + "offset": 20 + } + ], + "MarginValues": [ + { + "type": "uint256", + "name": "discountedMarginUsd", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "marginUsd", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "uint256", + "name": "discountedCollateralUsd", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "uint256", + "name": "collateralUsd", + "size": 32, + "slot": "3", + "offset": 0 + } + ], + "GlobalData": [ + { + "type": "mapping", + "name": "supported", + "key": { + "type": "address" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "bytes32", + "name": "oracleNodeId" + }, + { + "type": "uint128", + "name": "maxAllowable" + }, + { + "type": "uint128", + "name": "skewScale" + }, + { + "type": "address", + "name": "rewardDistributor" + }, + { + "type": "bool", + "name": "exists" + } + ] + }, + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "array", + "name": "supportedCollaterals", + "value": { + "type": "address" + }, + "size": 32, + "slot": "1", + "offset": 0 + } + ], + "Data": [ + { + "type": "uint128", + "name": "debtUsd", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "mapping", + "name": "collaterals", + "key": { + "type": "address" + }, + "value": { + "type": "uint256" + }, + "size": 32, + "slot": "1", + "offset": 0 + } + ] + } + }, + "contracts/storage/Order.sol:Order": { + "name": "Order", + "kind": "library", + "structs": { + "Data": [ + { + "type": "int128", + "name": "sizeDelta", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "uint64", + "name": "commitmentTime", + "size": 8, + "slot": "0", + "offset": 16 + }, + { + "type": "uint256", + "name": "limitPrice", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "uint128", + "name": "keeperFeeBufferUsd", + "size": 16, + "slot": "2", + "offset": 0 + }, + { + "type": "array", + "name": "hooks", + "value": { + "type": "address" + }, + "size": 32, + "slot": "3", + "offset": 0 + } + ] + } + }, + "contracts/storage/PerpMarket.sol:PerpMarket": { + "name": "PerpMarket", + "kind": "library", + "structs": { + "GlobalData": [ + { + "type": "array", + "name": "activeMarketIds", + "value": { + "type": "uint128" + }, + "size": 32, + "slot": "0", + "offset": 0 + } + ], + "Data": [ + { + "type": "bytes32", + "name": "name", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint128", + "name": "id", + "size": 16, + "slot": "1", + "offset": 0 + }, + { + "type": "uint64", + "name": "__unused1", + "size": 8, + "slot": "1", + "offset": 16 + }, + { + "type": "uint64", + "name": "__unused2", + "size": 8, + "slot": "1", + "offset": 24 + }, + { + "type": "int128", + "name": "skew", + "size": 16, + "slot": "2", + "offset": 0 + }, + { + "type": "uint128", + "name": "size", + "size": 16, + "slot": "2", + "offset": 16 + }, + { + "type": "uint64", + "name": "lastFundingTime", + "size": 8, + "slot": "3", + "offset": 0 + }, + { + "type": "uint64", + "name": "lastUtilizationTime", + "size": 8, + "slot": "3", + "offset": 8 + }, + { + "type": "uint64", + "name": "__unused3", + "size": 8, + "slot": "3", + "offset": 16 + }, + { + "type": "uint64", + "name": "__unused4", + "size": 8, + "slot": "3", + "offset": 24 + }, + { + "type": "int128", + "name": "currentFundingRateComputed", + "size": 16, + "slot": "4", + "offset": 0 + }, + { + "type": "int128", + "name": "currentFundingAccruedComputed", + "size": 16, + "slot": "4", + "offset": 16 + }, + { + "type": "uint128", + "name": "currentUtilizationRateComputed", + "size": 16, + "slot": "5", + "offset": 0 + }, + { + "type": "uint128", + "name": "currentUtilizationAccruedComputed", + "size": 16, + "slot": "5", + "offset": 16 + }, + { + "type": "uint128", + "name": "totalTraderDebtUsd", + "size": 16, + "slot": "6", + "offset": 0 + }, + { + "type": "int128", + "name": "debtCorrection", + "size": 16, + "slot": "6", + "offset": 16 + }, + { + "type": "mapping", + "name": "orders", + "key": { + "type": "uint128" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "int128", + "name": "sizeDelta" + }, + { + "type": "uint64", + "name": "commitmentTime" + }, + { + "type": "uint256", + "name": "limitPrice" + }, + { + "type": "uint128", + "name": "keeperFeeBufferUsd" + }, + { + "type": "array", + "name": "hooks", + "value": { + "type": "address" + } + } + ] + }, + "size": 32, + "slot": "7", + "offset": 0 + }, + { + "type": "mapping", + "name": "positions", + "key": { + "type": "uint128" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "int128", + "name": "size" + }, + { + "type": "int128", + "name": "entryFundingAccrued" + }, + { + "type": "uint128", + "name": "entryUtilizationAccrued" + }, + { + "type": "uint256", + "name": "entryPythPrice" + }, + { + "type": "uint256", + "name": "entryPrice" + } + ] + }, + "size": 32, + "slot": "8", + "offset": 0 + }, + { + "type": "mapping", + "name": "flaggedLiquidations", + "key": { + "type": "uint128" + }, + "value": { + "type": "address" + }, + "size": 32, + "slot": "9", + "offset": 0 + }, + { + "type": "mapping", + "name": "depositedCollateral", + "key": { + "type": "address" + }, + "value": { + "type": "uint256" + }, + "size": 32, + "slot": "10", + "offset": 0 + }, + { + "type": "array", + "name": "pastLiquidations", + "value": { + "type": "array", + "value": { + "type": "uint128" + }, + "length": 2 + }, + "size": 32, + "slot": "11", + "offset": 0 + } + ] + } + }, + "contracts/storage/PerpMarketConfiguration.sol:PerpMarketConfiguration": { + "name": "PerpMarketConfiguration", + "kind": "library", + "structs": { + "GlobalData": [ + { + "type": "address", + "name": "pyth", + "size": 20, + "slot": "0", + "offset": 0 + }, + { + "type": "bytes32", + "name": "ethOracleNodeId", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "address", + "name": "rewardDistributorImplementation", + "size": 20, + "slot": "2", + "offset": 0 + }, + { + "type": "uint64", + "name": "pythPublishTimeMin", + "size": 8, + "slot": "2", + "offset": 20 + }, + { + "type": "uint64", + "name": "pythPublishTimeMax", + "size": 8, + "slot": "3", + "offset": 0 + }, + { + "type": "uint64", + "name": "minOrderAge", + "size": 8, + "slot": "3", + "offset": 8 + }, + { + "type": "uint64", + "name": "maxOrderAge", + "size": 8, + "slot": "3", + "offset": 16 + }, + { + "type": "uint256", + "name": "minKeeperFeeUsd", + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "uint256", + "name": "maxKeeperFeeUsd", + "size": 32, + "slot": "5", + "offset": 0 + }, + { + "type": "uint128", + "name": "keeperProfitMarginUsd", + "size": 16, + "slot": "6", + "offset": 0 + }, + { + "type": "uint128", + "name": "keeperProfitMarginPercent", + "size": 16, + "slot": "6", + "offset": 16 + }, + { + "type": "uint128", + "name": "keeperSettlementGasUnits", + "size": 16, + "slot": "7", + "offset": 0 + }, + { + "type": "uint128", + "name": "keeperCancellationGasUnits", + "size": 16, + "slot": "7", + "offset": 16 + }, + { + "type": "uint128", + "name": "keeperLiquidationGasUnits", + "size": 16, + "slot": "8", + "offset": 0 + }, + { + "type": "uint128", + "name": "keeperFlagGasUnits", + "size": 16, + "slot": "8", + "offset": 16 + }, + { + "type": "uint128", + "name": "keeperLiquidateMarginGasUnits", + "size": 16, + "slot": "9", + "offset": 0 + }, + { + "type": "address", + "name": "keeperLiquidationEndorsed", + "size": 20, + "slot": "10", + "offset": 0 + }, + { + "type": "uint128", + "name": "collateralDiscountScalar", + "size": 16, + "slot": "11", + "offset": 0 + }, + { + "type": "uint128", + "name": "minCollateralDiscount", + "size": 16, + "slot": "11", + "offset": 16 + }, + { + "type": "uint128", + "name": "maxCollateralDiscount", + "size": 16, + "slot": "12", + "offset": 0 + }, + { + "type": "uint128", + "name": "utilizationBreakpointPercent", + "size": 16, + "slot": "12", + "offset": 16 + }, + { + "type": "uint128", + "name": "lowUtilizationSlopePercent", + "size": 16, + "slot": "13", + "offset": 0 + }, + { + "type": "uint128", + "name": "highUtilizationSlopePercent", + "size": 16, + "slot": "13", + "offset": 16 + } + ], + "Data": [ + { + "type": "bytes32", + "name": "oracleNodeId", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "bytes32", + "name": "pythPriceFeedId", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "uint128", + "name": "makerFee", + "size": 16, + "slot": "2", + "offset": 0 + }, + { + "type": "uint128", + "name": "takerFee", + "size": 16, + "slot": "2", + "offset": 16 + }, + { + "type": "uint128", + "name": "maxMarketSize", + "size": 16, + "slot": "3", + "offset": 0 + }, + { + "type": "uint128", + "name": "maxFundingVelocity", + "size": 16, + "slot": "3", + "offset": 16 + }, + { + "type": "uint128", + "name": "skewScale", + "size": 16, + "slot": "4", + "offset": 0 + }, + { + "type": "uint128", + "name": "fundingVelocityClamp", + "size": 16, + "slot": "4", + "offset": 16 + }, + { + "type": "uint128", + "name": "minCreditPercent", + "size": 16, + "slot": "5", + "offset": 0 + }, + { + "type": "uint256", + "name": "minMarginUsd", + "size": 32, + "slot": "6", + "offset": 0 + }, + { + "type": "uint256", + "name": "minMarginRatio", + "size": 32, + "slot": "7", + "offset": 0 + }, + { + "type": "uint256", + "name": "incrementalMarginScalar", + "size": 32, + "slot": "8", + "offset": 0 + }, + { + "type": "uint256", + "name": "maintenanceMarginScalar", + "size": 32, + "slot": "9", + "offset": 0 + }, + { + "type": "uint256", + "name": "maxInitialMarginRatio", + "size": 32, + "slot": "10", + "offset": 0 + }, + { + "type": "uint256", + "name": "liquidationRewardPercent", + "size": 32, + "slot": "11", + "offset": 0 + }, + { + "type": "uint128", + "name": "liquidationLimitScalar", + "size": 16, + "slot": "12", + "offset": 0 + }, + { + "type": "uint128", + "name": "liquidationWindowDuration", + "size": 16, + "slot": "12", + "offset": 16 + }, + { + "type": "uint128", + "name": "liquidationMaxPd", + "size": 16, + "slot": "13", + "offset": 0 + } + ] + } + }, + "contracts/storage/Position.sol:Position": { + "name": "Position", + "kind": "library", + "structs": { + "TradeParams": [ + { + "type": "int128", + "name": "sizeDelta", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "oraclePrice", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "uint256", + "name": "pythPrice", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "uint256", + "name": "fillPrice", + "size": 32, + "slot": "3", + "offset": 0 + }, + { + "type": "uint128", + "name": "makerFee", + "size": 16, + "slot": "4", + "offset": 0 + }, + { + "type": "uint128", + "name": "takerFee", + "size": 16, + "slot": "4", + "offset": 16 + }, + { + "type": "uint256", + "name": "limitPrice", + "size": 32, + "slot": "5", + "offset": 0 + }, + { + "type": "uint128", + "name": "keeperFeeBufferUsd", + "size": 16, + "slot": "6", + "offset": 0 + } + ], + "ValidatedTrade": [ + { + "type": "struct", + "name": "newPosition", + "members": [ + { + "type": "int128", + "name": "size" + }, + { + "type": "int128", + "name": "entryFundingAccrued" + }, + { + "type": "uint128", + "name": "entryUtilizationAccrued" + }, + { + "type": "uint256", + "name": "entryPythPrice" + }, + { + "type": "uint256", + "name": "entryPrice" + } + ], + "size": 128, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "orderFee", + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "uint256", + "name": "keeperFee", + "size": 32, + "slot": "5", + "offset": 0 + }, + { + "type": "uint256", + "name": "newMarginUsd", + "size": 32, + "slot": "6", + "offset": 0 + }, + { + "type": "uint256", + "name": "collateralUsd", + "size": 32, + "slot": "7", + "offset": 0 + } + ], + "HealthData": [ + { + "type": "uint256", + "name": "healthFactor", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "int128", + "name": "accruedFunding", + "size": 16, + "slot": "1", + "offset": 0 + }, + { + "type": "uint128", + "name": "accruedUtilization", + "size": 16, + "slot": "1", + "offset": 16 + }, + { + "type": "int256", + "name": "pnl", + "size": 32, + "slot": "2", + "offset": 0 + } + ], + "Runtime_validateLiquidation": [ + { + "type": "address", + "name": "flagger", + "size": 20, + "slot": "0", + "offset": 0 + }, + { + "type": "uint128", + "name": "oldPositionSizeAbs", + "size": 16, + "slot": "1", + "offset": 0 + }, + { + "type": "uint128", + "name": "maxLiquidatableCapacity", + "size": 16, + "slot": "1", + "offset": 16 + }, + { + "type": "uint128", + "name": "remainingCapacity", + "size": 16, + "slot": "2", + "offset": 0 + }, + { + "type": "uint128", + "name": "lastLiquidationTime", + "size": 16, + "slot": "2", + "offset": 16 + } + ], + "Runtime_validateTrade": [ + { + "type": "uint256", + "name": "orderFee", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "keeperFee", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "bool", + "name": "positionDecreasing", + "size": 1, + "slot": "2", + "offset": 0 + }, + { + "type": "uint256", + "name": "discountedNextMarginUsd", + "size": 32, + "slot": "3", + "offset": 0 + }, + { + "type": "uint256", + "name": "im", + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "uint256", + "name": "mm", + "size": 32, + "slot": "5", + "offset": 0 + }, + { + "type": "uint256", + "name": "ethPrice", + "size": 32, + "slot": "6", + "offset": 0 + }, + { + "type": "int256", + "name": "fillPremium", + "size": 32, + "slot": "7", + "offset": 0 + }, + { + "type": "int128", + "name": "sizeDelta", + "size": 16, + "slot": "8", + "offset": 0 + } + ], + "Data": [ + { + "type": "int128", + "name": "size", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "int128", + "name": "entryFundingAccrued", + "size": 16, + "slot": "0", + "offset": 16 + }, + { + "type": "uint128", + "name": "entryUtilizationAccrued", + "size": 16, + "slot": "1", + "offset": 0 + }, + { + "type": "uint256", + "name": "entryPythPrice", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "uint256", + "name": "entryPrice", + "size": 32, + "slot": "3", + "offset": 0 + } + ] + } + }, + "contracts/storage/SettlementHookConfiguration.sol:SettlementHookConfiguration": { + "name": "SettlementHookConfiguration", + "kind": "library", + "structs": { + "GlobalData": [ + { + "type": "uint32", + "name": "maxHooksPerOrder", + "size": 4, + "slot": "0", + "offset": 0 + }, + { + "type": "uint32", + "name": "__unused1", + "size": 4, + "slot": "0", + "offset": 4 + }, + { + "type": "uint64", + "name": "__unused2", + "size": 8, + "slot": "0", + "offset": 8 + }, + { + "type": "uint64", + "name": "__unused3", + "size": 8, + "slot": "0", + "offset": 16 + }, + { + "type": "uint64", + "name": "__unused4", + "size": 8, + "slot": "0", + "offset": 24 + }, + { + "type": "mapping", + "name": "whitelisted", + "key": { + "type": "address" + }, + "value": { + "type": "bool" + }, + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "array", + "name": "whitelistedHookAddresses", + "value": { + "type": "address" + }, + "size": 32, + "slot": "2", + "offset": 0 + } + ] + } + }, + "contracts/storage/SplitAccountConfiguration.sol:SplitAccountConfiguration": { + "name": "SplitAccountConfiguration", + "kind": "library", + "structs": { + "GlobalData": [ + { + "type": "mapping", + "name": "whitelisted", + "key": { + "type": "address" + }, + "value": { + "type": "bool" + }, + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "array", + "name": "whitelistedAddresses", + "value": { + "type": "address" + }, + "size": 32, + "slot": "1", + "offset": 0 + } + ] + } + } +} diff --git a/markets/bfp-market/storage.dump.sol b/markets/bfp-market/storage.dump.sol deleted file mode 100644 index 9e1762929b..0000000000 --- a/markets/bfp-market/storage.dump.sol +++ /dev/null @@ -1,998 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.8.11<0.9.0; - -// @custom:artifact @synthetixio/core-contracts/contracts/ownership/OwnableStorage.sol:OwnableStorage -library OwnableStorage { - bytes32 private constant _SLOT_OWNABLE_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.Ownable")); - struct Data { - address owner; - address nominatedOwner; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_OWNABLE_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/proxy/ProxyStorage.sol:ProxyStorage -contract ProxyStorage { - bytes32 private constant _SLOT_PROXY_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.Proxy")); - struct ProxyStore { - address implementation; - bool simulatingUpgrade; - } - function _proxyStore() internal pure returns (ProxyStore storage store) { - bytes32 s = _SLOT_PROXY_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/token/ERC20Storage.sol:ERC20Storage -library ERC20Storage { - bytes32 private constant _SLOT_ERC20_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.ERC20")); - struct Data { - string name; - string symbol; - uint8 decimals; - mapping(address => uint256) balanceOf; - mapping(address => mapping(address => uint256)) allowance; - uint256 totalSupply; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_ERC20_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/DecimalMath.sol:DecimalMath -library DecimalMath { - uint256 public constant UNIT = 1e18; - int256 public constant UNIT_INT = int256(UNIT); - uint128 public constant UNIT_UINT128 = uint128(UNIT); - int128 public constant UNIT_INT128 = int128(UNIT_INT); - uint256 public constant UNIT_PRECISE = 1e27; - int256 public constant UNIT_PRECISE_INT = int256(UNIT_PRECISE); - int128 public constant UNIT_PRECISE_INT128 = int128(UNIT_PRECISE_INT); - uint256 public constant PRECISION_FACTOR = 9; -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/ERC2771Context.sol:ERC2771Context -library ERC2771Context { - address private constant TRUSTED_FORWARDER = 0xE2C5658cC5C448B48141168f3e475dF8f65A1e3e; -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/HeapUtil.sol:HeapUtil -library HeapUtil { - uint256 private constant _ROOT_INDEX = 1; - struct Data { - uint128 idCount; - Node[] nodes; - mapping(uint128 => uint256) indices; - } - struct Node { - uint128 id; - int128 priority; - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/SetUtil.sol:SetUtil -library SetUtil { - struct UintSet { - Bytes32Set raw; - } - struct AddressSet { - Bytes32Set raw; - } - struct Bytes32Set { - bytes32[] _values; - mapping(bytes32 => uint256) _positions; - } -} - -// @custom:artifact @synthetixio/core-modules/contracts/storage/FeatureFlag.sol:FeatureFlag -library FeatureFlag { - struct Data { - bytes32 name; - bool allowAll; - bool denyAll; - SetUtil.AddressSet permissionedAddresses; - address[] deniers; - } - function load(bytes32 featureName) internal pure returns (Data storage store) { - bytes32 s = keccak256(abi.encode("io.synthetix.core-modules.FeatureFlag", featureName)); - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/Account.sol:Account -library Account { - struct Data { - uint128 id; - AccountRBAC.Data rbac; - uint64 lastInteraction; - uint64 __slotAvailableForFutureUse; - uint128 __slot2AvailableForFutureUse; - mapping(address => Collateral.Data) collaterals; - } - function load(uint128 id) internal pure returns (Data storage account) { - bytes32 s = keccak256(abi.encode("io.synthetix.synthetix.Account", id)); - assembly { - account.slot := s - } - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/AccountRBAC.sol:AccountRBAC -library AccountRBAC { - bytes32 internal constant _ADMIN_PERMISSION = "ADMIN"; - bytes32 internal constant _WITHDRAW_PERMISSION = "WITHDRAW"; - bytes32 internal constant _DELEGATE_PERMISSION = "DELEGATE"; - bytes32 internal constant _MINT_PERMISSION = "MINT"; - bytes32 internal constant _REWARDS_PERMISSION = "REWARDS"; - bytes32 internal constant _PERPS_MODIFY_COLLATERAL_PERMISSION = "PERPS_MODIFY_COLLATERAL"; - bytes32 internal constant _PERPS_COMMIT_ASYNC_ORDER_PERMISSION = "PERPS_COMMIT_ASYNC_ORDER"; - bytes32 internal constant _BURN_PERMISSION = "BURN"; - bytes32 internal constant _BFP_PERPS_PAY_DEBT_PERMISSION = "BFP_PERPS_PAY_DEBT"; - bytes32 internal constant _BFP_PERPS_SPLIT_ACCOUNT_PERMISSION = "BFP_PERPS_SPLIT_ACCOUNT"; - struct Data { - address owner; - mapping(address => SetUtil.Bytes32Set) permissions; - SetUtil.AddressSet permissionAddresses; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/Collateral.sol:Collateral -library Collateral { - struct Data { - uint256 amountAvailableForDelegationD18; - SetUtil.UintSet pools; - CollateralLock.Data[] locks; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/CollateralConfiguration.sol:CollateralConfiguration -library CollateralConfiguration { - bytes32 private constant _SLOT_AVAILABLE_COLLATERALS = keccak256(abi.encode("io.synthetix.synthetix.CollateralConfiguration_availableCollaterals")); - struct Data { - bool depositingEnabled; - uint256 issuanceRatioD18; - uint256 liquidationRatioD18; - uint256 liquidationRewardD18; - bytes32 oracleNodeId; - address tokenAddress; - uint256 minDelegationD18; - } - function load(address token) internal pure returns (Data storage collateralConfiguration) { - bytes32 s = keccak256(abi.encode("io.synthetix.synthetix.CollateralConfiguration", token)); - assembly { - collateralConfiguration.slot := s - } - } - function loadAvailableCollaterals() internal pure returns (SetUtil.AddressSet storage availableCollaterals) { - bytes32 s = _SLOT_AVAILABLE_COLLATERALS; - assembly { - availableCollaterals.slot := s - } - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/CollateralLock.sol:CollateralLock -library CollateralLock { - struct Data { - uint128 amountD18; - uint64 lockExpirationTime; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/Config.sol:Config -library Config { - struct Data { - uint256 __unused; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/Distribution.sol:Distribution -library Distribution { - struct Data { - uint128 totalSharesD18; - int128 valuePerShareD27; - mapping(bytes32 => DistributionActor.Data) actorInfo; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/DistributionActor.sol:DistributionActor -library DistributionActor { - struct Data { - uint128 sharesD18; - int128 lastValuePerShareD27; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/Market.sol:Market -library Market { - struct Data { - uint128 id; - address marketAddress; - int128 netIssuanceD18; - int128 creditCapacityD18; - int128 lastDistributedMarketBalanceD18; - HeapUtil.Data inRangePools; - HeapUtil.Data outRangePools; - Distribution.Data poolsDebtDistribution; - mapping(uint128 => MarketPoolInfo.Data) pools; - DepositedCollateral[] depositedCollateral; - mapping(address => uint256) maximumDepositableD18; - uint32 minDelegateTime; - uint32 __reservedForLater1; - uint64 __reservedForLater2; - uint64 __reservedForLater3; - uint64 __reservedForLater4; - uint256 minLiquidityRatioD18; - } - struct DepositedCollateral { - address collateralType; - uint256 amountD18; - } - function load(uint128 id) internal pure returns (Data storage market) { - bytes32 s = keccak256(abi.encode("io.synthetix.synthetix.Market", id)); - assembly { - market.slot := s - } - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/MarketConfiguration.sol:MarketConfiguration -library MarketConfiguration { - struct Data { - uint128 marketId; - uint128 weightD18; - int128 maxDebtShareValueD18; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/MarketPoolInfo.sol:MarketPoolInfo -library MarketPoolInfo { - struct Data { - uint128 creditCapacityAmountD18; - uint128 pendingDebtD18; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/OracleManager.sol:OracleManager -library OracleManager { - bytes32 private constant _SLOT_ORACLE_MANAGER = keccak256(abi.encode("io.synthetix.synthetix.OracleManager")); - struct Data { - address oracleManagerAddress; - } - function load() internal pure returns (Data storage oracleManager) { - bytes32 s = _SLOT_ORACLE_MANAGER; - assembly { - oracleManager.slot := s - } - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/Pool.sol:Pool -library Pool { - bytes32 private constant _CONFIG_SET_MARKET_MIN_DELEGATE_MAX = "setMarketMinDelegateTime_max"; - struct Data { - uint128 id; - string name; - address owner; - address nominatedOwner; - uint128 totalWeightsD18; - int128 totalVaultDebtsD18; - MarketConfiguration.Data[] marketConfigurations; - Distribution.Data vaultsDebtDistribution; - mapping(address => Vault.Data) vaults; - uint64 lastConfigurationTime; - uint64 __reserved1; - uint64 __reserved2; - uint64 __reserved3; - mapping(address => PoolCollateralConfiguration.Data) collateralConfigurations; - bool collateralDisabledByDefault; - SetUtil.Bytes32Set rewardIds; - mapping(bytes32 => RewardDistribution.Data) rewardsToVaults; - } - function load(uint128 id) internal pure returns (Data storage pool) { - bytes32 s = keccak256(abi.encode("io.synthetix.synthetix.Pool", id)); - assembly { - pool.slot := s - } - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/PoolCollateralConfiguration.sol:PoolCollateralConfiguration -library PoolCollateralConfiguration { - bytes32 private constant _SLOT = keccak256(abi.encode("io.synthetix.synthetix.PoolCollateralConfiguration")); - struct Data { - uint256 collateralLimitD18; - uint256 issuanceRatioD18; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/RewardDistribution.sol:RewardDistribution -library RewardDistribution { - struct Data { - address distributor; - uint128 __slotAvailableForFutureUse; - uint128 rewardPerShareD18; - mapping(uint256 => RewardDistributionClaimStatus.Data) claimStatus; - int128 scheduledValueD18; - uint64 start; - uint32 duration; - uint32 lastUpdate; - int128 nextScheduledValueD18; - uint64 nextStart; - uint32 nextDuration; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/RewardDistributionClaimStatus.sol:RewardDistributionClaimStatus -library RewardDistributionClaimStatus { - struct Data { - uint128 lastRewardPerShareD18; - uint128 pendingSendD18; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/ScalableMapping.sol:ScalableMapping -library ScalableMapping { - struct Data { - uint128 totalSharesD18; - int128 scaleModifierD27; - mapping(bytes32 => uint256) sharesD18; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/SystemPoolConfiguration.sol:SystemPoolConfiguration -library SystemPoolConfiguration { - bytes32 private constant _SLOT_SYSTEM_POOL_CONFIGURATION = keccak256(abi.encode("io.synthetix.synthetix.SystemPoolConfiguration")); - struct Data { - uint256 minLiquidityRatioD18; - uint128 __reservedForFutureUse; - uint128 preferredPool; - SetUtil.UintSet approvedPools; - } - function load() internal pure returns (Data storage systemPoolConfiguration) { - bytes32 s = _SLOT_SYSTEM_POOL_CONFIGURATION; - assembly { - systemPoolConfiguration.slot := s - } - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/Vault.sol:Vault -library Vault { - struct Data { - uint256 epoch; - bytes32 __slotAvailableForFutureUse; - int128 _unused_prevTotalDebtD18; - mapping(uint256 => VaultEpoch.Data) epochData; - mapping(bytes32 => RewardDistribution.Data) rewards; - SetUtil.Bytes32Set rewardIds; - } - struct PositionSelector { - uint128 accountId; - uint128 poolId; - address collateralType; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/VaultEpoch.sol:VaultEpoch -library VaultEpoch { - struct Data { - int128 unconsolidatedDebtD18; - int128 totalConsolidatedDebtD18; - Distribution.Data accountsDebtDistribution; - ScalableMapping.Data collateralAmounts; - mapping(uint256 => int256) consolidatedDebtAmountsD18; - mapping(uint128 => uint64) lastDelegationTime; - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/interfaces/external/IPyth.sol:PythStructs -contract PythStructs { - struct Price { - int64 price; - uint64 conf; - int32 expo; - uint256 publishTime; - } - struct PriceFeed { - bytes32 id; - Price price; - Price emaPrice; - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/ChainlinkNode.sol:ChainlinkNode -library ChainlinkNode { - uint256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/ReducerNode.sol:ReducerNode -library ReducerNode { - enum Operations { - RECENT, - MIN, - MAX, - MEAN, - MEDIAN, - MUL, - DIV, - MULDECIMAL, - DIVDECIMAL - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/UniswapNode.sol:UniswapNode -library UniswapNode { - uint8 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/pyth/PythNode.sol:PythNode -library PythNode { - int256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/pyth/PythOffchainLookupNode.sol:PythOffchainLookupNode -library PythOffchainLookupNode { - int256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/storage/NodeDefinition.sol:NodeDefinition -library NodeDefinition { - enum NodeType { - NONE, - REDUCER, - EXTERNAL, - CHAINLINK, - UNISWAP, - PYTH, - PRICE_DEVIATION_CIRCUIT_BREAKER, - STALENESS_CIRCUIT_BREAKER, - CONSTANT, - PYTH_OFFCHAIN_LOOKUP - } - struct Data { - NodeType nodeType; - bytes parameters; - bytes32[] parents; - } - function load(bytes32 id) internal pure returns (Data storage node) { - bytes32 s = keccak256(abi.encode("io.synthetix.oracle-manager.Node", id)); - assembly { - node.slot := s - } - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/storage/NodeOutput.sol:NodeOutput -library NodeOutput { - struct Data { - int256 price; - uint256 timestamp; - uint256 __slotAvailableForFutureUse1; - uint256 __slotAvailableForFutureUse2; - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/utils/TickMath.sol:TickMath -library TickMath { - int24 internal constant MIN_TICK = -887272; - int24 internal constant MAX_TICK = -MIN_TICK; - uint160 internal constant MIN_SQRT_RATIO = 4295128739; - uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342; -} - -// @custom:artifact contracts/interfaces/IMarginModule.sol:IMarginModule -interface IMarginModule { - struct ConfiguredCollateral { - address collateralAddress; - bytes32 oracleNodeId; - uint128 maxAllowable; - uint128 skewScale; - address rewardDistributor; - } -} - -// @custom:artifact contracts/interfaces/IMarketConfigurationModule.sol:IMarketConfigurationModule -interface IMarketConfigurationModule { - struct GlobalMarketConfigureParameters { - uint64 pythPublishTimeMin; - uint64 pythPublishTimeMax; - uint64 minOrderAge; - uint64 maxOrderAge; - uint256 minKeeperFeeUsd; - uint256 maxKeeperFeeUsd; - uint128 keeperProfitMarginPercent; - uint128 keeperProfitMarginUsd; - uint128 keeperSettlementGasUnits; - uint128 keeperCancellationGasUnits; - uint128 keeperLiquidationGasUnits; - uint128 keeperFlagGasUnits; - uint128 keeperLiquidateMarginGasUnits; - address keeperLiquidationEndorsed; - uint128 collateralDiscountScalar; - uint128 minCollateralDiscount; - uint128 maxCollateralDiscount; - uint128 utilizationBreakpointPercent; - uint128 lowUtilizationSlopePercent; - uint128 highUtilizationSlopePercent; - } - struct ConfigureByMarketParameters { - uint128 marketId; - bytes32 oracleNodeId; - bytes32 pythPriceFeedId; - uint128 makerFee; - uint128 takerFee; - uint128 maxMarketSize; - uint128 maxFundingVelocity; - uint128 skewScale; - uint128 fundingVelocityClamp; - uint128 minCreditPercent; - uint256 minMarginUsd; - uint256 minMarginRatio; - uint256 incrementalMarginScalar; - uint256 maintenanceMarginScalar; - uint256 maxInitialMarginRatio; - uint256 liquidationRewardPercent; - uint128 liquidationLimitScalar; - uint128 liquidationWindowDuration; - uint128 liquidationMaxPd; - } -} - -// @custom:artifact contracts/interfaces/IOrderModule.sol:IOrderModule -interface IOrderModule { - struct OrderDigest { - int128 sizeDelta; - uint64 commitmentTime; - uint256 limitPrice; - uint128 keeperFeeBufferUsd; - address[] hooks; - bool isStale; - bool isReady; - } -} - -// @custom:artifact contracts/interfaces/IPerpAccountModule.sol:IPerpAccountModule -interface IPerpAccountModule { - struct DepositedCollateral { - address collateralAddress; - uint256 available; - uint256 oraclePrice; - } - struct AccountDigest { - IPerpAccountModule.DepositedCollateral[] depositedCollaterals; - uint256 collateralUsd; - uint128 debtUsd; - PositionDigest position; - } - struct PositionDigest { - uint128 accountId; - uint128 marketId; - uint256 remainingMarginUsd; - uint256 healthFactor; - uint256 notionalValueUsd; - int256 pnl; - int128 accruedFunding; - uint128 accruedUtilization; - uint256 entryPythPrice; - uint256 entryPrice; - uint256 oraclePrice; - int128 size; - uint256 im; - uint256 mm; - } -} - -// @custom:artifact contracts/interfaces/IPerpMarketFactoryModule.sol:IPerpMarketFactoryModule -interface IPerpMarketFactoryModule { - struct CreatePerpMarketParameters { - bytes32 name; - uint32 minDelegateTime; - } - struct DepositedCollateral { - address collateralAddress; - uint256 available; - } - struct UtilizationDigest { - uint128 lastComputedUtilizationRate; - uint64 lastComputedTimestamp; - uint128 currentUtilizationRate; - uint256 utilization; - } - struct MarketDigest { - IPerpMarketFactoryModule.DepositedCollateral[] depositedCollaterals; - bytes32 name; - int128 skew; - uint128 size; - uint256 oraclePrice; - int128 fundingVelocity; - int128 fundingRate; - uint128 utilizationRate; - uint128 remainingLiquidatableSizeCapacity; - uint128 lastLiquidationTime; - uint128 totalTraderDebtUsd; - uint256 totalCollateralValueUsd; - int128 debtCorrection; - } -} - -// @custom:artifact contracts/interfaces/IPerpRewardDistributorFactoryModule.sol:IPerpRewardDistributorFactoryModule -interface IPerpRewardDistributorFactoryModule { - struct CreatePerpRewardDistributorParameters { - uint128 poolId; - address[] collateralTypes; - string name; - address token; - } -} - -// @custom:artifact contracts/interfaces/ISettlementHookModule.sol:ISettlementHookModule -interface ISettlementHookModule { - struct SettlementHookConfigureParameters { - address[] whitelistedHookAddresses; - uint32 maxHooksPerOrder; - } -} - -// @custom:artifact contracts/modules/LiquidationModule.sol:LiquidationModule -contract LiquidationModule { - struct Runtime_liquidateCollateral { - uint256 availableSusd; - uint256 supportedCollateralsLength; - address collateralAddress; - uint256 availableAccountCollateral; - uint128 poolId; - uint256 poolCollateralTypesLength; - } -} - -// @custom:artifact contracts/modules/MarginModule.sol:MarginModule -contract MarginModule { - uint256 private constant MAX_SUPPORTED_MARGIN_COLLATERALS = 10; - struct Runtime_setMarginCollateralConfiguration { - uint256 lengthBefore; - uint256 lengthAfter; - uint256 maxApproveAmount; - address[] previousSupportedCollaterals; - } -} - -// @custom:artifact contracts/modules/OrderModule.sol:OrderModule -contract OrderModule { - struct Runtime_commitOrder { - uint256 oraclePrice; - uint64 commitmentTime; - AddressRegistry.Data addresses; - } - struct Runtime_settleOrder { - uint256 pythPrice; - int128 accruedFunding; - uint128 accruedUtilization; - int256 pricePnl; - uint256 fillPrice; - uint128 updatedMarketSize; - int128 updatedMarketSkew; - uint128 totalFees; - Position.TradeParams tradeParams; - } -} - -// @custom:artifact contracts/modules/PerpAccountModule.sol:PerpAccountModule -contract PerpAccountModule { - struct Runtime_splitAccount { - uint256 oraclePrice; - uint256 toIm; - uint256 fromIm; - uint128 debtToMove; - int128 sizeToMove; - uint256 supportedCollateralsLength; - address collateralAddress; - uint256 collateralToMove; - uint256 newFromAmountCollateral; - uint256 fromAccountCollateral; - uint256 toCollateralUsd; - uint256 fromCollateralUsd; - uint256 toDiscountedCollateralUsd; - uint256 fromDiscountedCollateralUsd; - uint256 collateralPrice; - uint256 fromAccountCollateralUsd; - } - struct Runtime_mergeAccounts { - uint256 oraclePrice; - uint256 im; - uint256 fromCollateralUsd; - uint256 fromMarginUsd; - uint256 toMarginUsd; - uint256 mergedCollateralUsd; - uint256 mergedDiscountedCollateralUsd; - uint256 supportedCollateralsLength; - address collateralAddress; - uint256 fromAccountCollateral; - int256 fromSize; - } -} - -// @custom:artifact contracts/modules/PerpMarketFactoryModule.sol:PerpMarketFactoryModule -contract PerpMarketFactoryModule { - uint32 internal constant DEFAULT_MIN_DELEGATE_TIME = 24; -} - -// @custom:artifact contracts/storage/AddressRegistry.sol:AddressRegistry -library AddressRegistry { - struct Data { - address synthetix; - address sUsd; - address oracleManager; - } -} - -// @custom:artifact contracts/storage/Margin.sol:Margin -library Margin { - bytes32 internal constant GLOBAL_DATA_SLOT_NAME = keccak256(abi.encode("io.synthetix.bfp-market.GlobalMargin")); - struct CollateralType { - bytes32 oracleNodeId; - uint128 maxAllowable; - uint128 skewScale; - address rewardDistributor; - bool exists; - } - struct MarginValues { - uint256 discountedMarginUsd; - uint256 marginUsd; - uint256 discountedCollateralUsd; - uint256 collateralUsd; - } - struct GlobalData { - mapping(address => CollateralType) supported; - address[] supportedCollaterals; - } - struct Data { - uint128 debtUsd; - mapping(address => uint256) collaterals; - } - function load() internal pure returns (Margin.GlobalData storage d) { - bytes32 s = GLOBAL_DATA_SLOT_NAME; - assembly { - d.slot := s - } - } - function load(uint128 accountId, uint128 marketId) internal pure returns (Margin.Data storage d) { - bytes32 s = keccak256(abi.encode("io.synthetix.bfp-market.Margin", accountId, marketId)); - assembly { - d.slot := s - } - } -} - -// @custom:artifact contracts/storage/Order.sol:Order -library Order { - struct Data { - int128 sizeDelta; - uint64 commitmentTime; - uint256 limitPrice; - uint128 keeperFeeBufferUsd; - address[] hooks; - } -} - -// @custom:artifact contracts/storage/PerpMarket.sol:PerpMarket -library PerpMarket { - bytes32 internal constant GLOBAL_DATA_SLOT_NAME = keccak256(abi.encode("io.synthetix.bfp-market.GlobalPerpMarket")); - uint256 internal constant AVG_SECONDS_PER_YEAR = 31556952; - struct GlobalData { - uint128[] activeMarketIds; - } - struct Data { - bytes32 name; - uint128 id; - uint64 __unused1; - uint64 __unused2; - int128 skew; - uint128 size; - uint64 lastFundingTime; - uint64 lastUtilizationTime; - uint64 __unused3; - uint64 __unused4; - int128 currentFundingRateComputed; - int128 currentFundingAccruedComputed; - uint128 currentUtilizationRateComputed; - uint128 currentUtilizationAccruedComputed; - uint128 totalTraderDebtUsd; - int128 debtCorrection; - mapping(uint128 => Order.Data) orders; - mapping(uint128 => Position.Data) positions; - mapping(uint128 => address) flaggedLiquidations; - mapping(address => uint256) depositedCollateral; - uint128[][] pastLiquidations; - } - function load() internal pure returns (GlobalData storage d) { - bytes32 s = GLOBAL_DATA_SLOT_NAME; - assembly { - d.slot := s - } - } - function load(uint128 id) internal pure returns (Data storage d) { - bytes32 s = keccak256(abi.encode("io.synthetix.bfp-market.PerpMarket", id)); - assembly { - d.slot := s - } - } -} - -// @custom:artifact contracts/storage/PerpMarketConfiguration.sol:PerpMarketConfiguration -library PerpMarketConfiguration { - bytes32 internal constant GLOBAL_DATA_SLOT_NAME = keccak256(abi.encode("io.synthetix.bfp-market.GlobalPerpMarketConfiguration")); - struct GlobalData { - address pyth; - bytes32 ethOracleNodeId; - address rewardDistributorImplementation; - uint64 pythPublishTimeMin; - uint64 pythPublishTimeMax; - uint64 minOrderAge; - uint64 maxOrderAge; - uint256 minKeeperFeeUsd; - uint256 maxKeeperFeeUsd; - uint128 keeperProfitMarginUsd; - uint128 keeperProfitMarginPercent; - uint128 keeperSettlementGasUnits; - uint128 keeperCancellationGasUnits; - uint128 keeperLiquidationGasUnits; - uint128 keeperFlagGasUnits; - uint128 keeperLiquidateMarginGasUnits; - address keeperLiquidationEndorsed; - uint128 collateralDiscountScalar; - uint128 minCollateralDiscount; - uint128 maxCollateralDiscount; - uint128 utilizationBreakpointPercent; - uint128 lowUtilizationSlopePercent; - uint128 highUtilizationSlopePercent; - } - struct Data { - bytes32 oracleNodeId; - bytes32 pythPriceFeedId; - uint128 makerFee; - uint128 takerFee; - uint128 maxMarketSize; - uint128 maxFundingVelocity; - uint128 skewScale; - uint128 fundingVelocityClamp; - uint128 minCreditPercent; - uint256 minMarginUsd; - uint256 minMarginRatio; - uint256 incrementalMarginScalar; - uint256 maintenanceMarginScalar; - uint256 maxInitialMarginRatio; - uint256 liquidationRewardPercent; - uint128 liquidationLimitScalar; - uint128 liquidationWindowDuration; - uint128 liquidationMaxPd; - } - function load() internal pure returns (PerpMarketConfiguration.GlobalData storage d) { - bytes32 s = GLOBAL_DATA_SLOT_NAME; - assembly { - d.slot := s - } - } - function load(uint128 marketId) internal pure returns (PerpMarketConfiguration.Data storage d) { - bytes32 s = keccak256(abi.encode("io.synthetix.bfp-market.PerpMarketConfiguration", marketId)); - assembly { - d.slot := s - } - } -} - -// @custom:artifact contracts/storage/Position.sol:Position -library Position { - struct TradeParams { - int128 sizeDelta; - uint256 oraclePrice; - uint256 pythPrice; - uint256 fillPrice; - uint128 makerFee; - uint128 takerFee; - uint256 limitPrice; - uint128 keeperFeeBufferUsd; - } - struct ValidatedTrade { - Position.Data newPosition; - uint256 orderFee; - uint256 keeperFee; - uint256 newMarginUsd; - uint256 collateralUsd; - } - struct HealthData { - uint256 healthFactor; - int128 accruedFunding; - uint128 accruedUtilization; - int256 pnl; - } - struct Runtime_validateLiquidation { - address flagger; - uint128 oldPositionSizeAbs; - uint128 maxLiquidatableCapacity; - uint128 remainingCapacity; - uint128 lastLiquidationTime; - } - struct Runtime_validateTrade { - uint256 orderFee; - uint256 keeperFee; - bool positionDecreasing; - uint256 discountedNextMarginUsd; - uint256 im; - uint256 mm; - uint256 ethPrice; - int256 fillPremium; - int128 sizeDelta; - } - struct Data { - int128 size; - int128 entryFundingAccrued; - uint128 entryUtilizationAccrued; - uint256 entryPythPrice; - uint256 entryPrice; - } -} - -// @custom:artifact contracts/storage/SettlementHookConfiguration.sol:SettlementHookConfiguration -library SettlementHookConfiguration { - bytes32 private constant GLOBAL_DATA_SLOT_NAME = keccak256(abi.encode("io.synthetix.bfp-market.SettlementHookConfiguration")); - struct GlobalData { - uint32 maxHooksPerOrder; - uint32 __unused1; - uint64 __unused2; - uint64 __unused3; - uint64 __unused4; - mapping(address => bool) whitelisted; - address[] whitelistedHookAddresses; - } - function load() internal pure returns (SettlementHookConfiguration.GlobalData storage d) { - bytes32 s = GLOBAL_DATA_SLOT_NAME; - assembly { - d.slot := s - } - } -} - -// @custom:artifact contracts/storage/SplitAccountConfiguration.sol:SplitAccountConfiguration -library SplitAccountConfiguration { - bytes32 private constant GLOBAL_DATA_SLOT_NAME = keccak256(abi.encode("io.synthetix.bfp-market.SplitAccountConfiguration")); - struct GlobalData { - mapping(address => bool) whitelisted; - address[] whitelistedAddresses; - } - function load() internal pure returns (SplitAccountConfiguration.GlobalData storage d) { - bytes32 s = GLOBAL_DATA_SLOT_NAME; - assembly { - d.slot := s - } - } -} - -// @custom:artifact contracts/utils/Flags.sol:Flags -library Flags { - bytes32 public constant CREATE_ACCOUNT = "createAccount"; - bytes32 public constant DEPOSIT = "deposit"; - bytes32 public constant WITHDRAW = "withdraw"; - bytes32 public constant COMMIT_ORDER = "commitOrder"; - bytes32 public constant SETTLE_ORDER = "settleOrder"; - bytes32 public constant CANCEL_ORDER = "cancelOrder"; - bytes32 public constant FLAG_POSITION = "flagPosition"; - bytes32 public constant LIQUIDATE_POSITION = "liquidatePosition"; - bytes32 public constant PAY_DEBT = "payDebt"; - bytes32 public constant LIQUIDATE_MARGIN_ONLY = "liquidateMarginOnly"; - bytes32 public constant MERGE_ACCOUNT = "mergeAccount"; - bytes32 public constant SPLIT_ACCOUNT = "splitAccount"; -} diff --git a/markets/legacy-market/package.json b/markets/legacy-market/package.json index ca47fb69b1..d3b49e865c 100644 --- a/markets/legacy-market/package.json +++ b/markets/legacy-market/package.json @@ -4,9 +4,10 @@ "description": "Contract for migration from v2x to v3", "private": true, "scripts": { + "build:contracts": "hardhat compile --force && yarn storage:dump && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "storage:dump": "hardhat storage:dump --output storage.new.dump.json", "build": "yarn build:contracts", - "SKIP:storage:verify": "hardhat compile --force && hardhat storage:verify", - "build:contracts": "hardhat compile --force && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "storage:verify": " hardhat storage:verify", "test": "hardhat test", "coverage": "hardhat coverage --network hardhat", "clean": "hardhat clean", diff --git a/markets/legacy-market/storage.dump.json b/markets/legacy-market/storage.dump.json new file mode 100644 index 0000000000..7237882487 --- /dev/null +++ b/markets/legacy-market/storage.dump.json @@ -0,0 +1,47 @@ +{ + "contracts/interfaces/external/IRewardEscrowV2.sol:VestingEntries": { + "name": "VestingEntries", + "kind": "library", + "structs": { + "VestingEntry": [ + { + "type": "uint64", + "name": "endTime", + "size": 8, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "escrowAmount", + "size": 32, + "slot": "1", + "offset": 0 + } + ], + "VestingEntryWithID": [ + { + "type": "uint64", + "name": "endTime", + "size": 8, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "escrowAmount", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "uint256", + "name": "entryID", + "size": 32, + "slot": "2", + "offset": 0 + } + ] + } + } +} diff --git a/markets/perps-market/package.json b/markets/perps-market/package.json index 1cf4271509..f8f2298b6c 100644 --- a/markets/perps-market/package.json +++ b/markets/perps-market/package.json @@ -5,10 +5,11 @@ "scripts": { "clean": "hardhat clean && rm -rf contracts/generated", "build": "yarn build:contracts", - "storage:verify": "hardhat compile --force && hardhat storage:verify", - "build:contracts": "hardhat compile --force && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "build:contracts": "hardhat compile --force && yarn storage:dump && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "storage:dump": "hardhat storage:dump --output storage.new.dump.json", + "storage:verify": " hardhat storage:verify", "build-testable": "CANNON_REGISTRY_PRIORITY=local hardhat cannon:build cannonfile.test.toml", - "check:storage": "git diff --exit-code storage.dump.sol", + "check:storage": "diff -uw storage.dump.json storage.new.dump.json", "start": "yarn build && yarn cannon-build", "cannon-build": "hardhat cannon:build", "test": "CANNON_REGISTRY_PRIORITY=local hardhat test", diff --git a/markets/perps-market/storage.dump.json b/markets/perps-market/storage.dump.json new file mode 100644 index 0000000000..984b728925 --- /dev/null +++ b/markets/perps-market/storage.dump.json @@ -0,0 +1,1608 @@ +{ + "contracts/modules/LiquidationModule.sol:LiquidationModule": { + "name": "LiquidationModule", + "kind": "contract", + "structs": { + "LiquidateAccountRuntime": [ + { + "type": "uint128", + "name": "accountId", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "totalFlaggingRewards", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "uint256", + "name": "totalLiquidated", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "bool", + "name": "accountFullyLiquidated", + "size": 1, + "slot": "3", + "offset": 0 + }, + { + "type": "uint256", + "name": "totalLiquidationCost", + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "uint256", + "name": "price", + "size": 32, + "slot": "5", + "offset": 0 + }, + { + "type": "uint128", + "name": "positionMarketId", + "size": 16, + "slot": "6", + "offset": 0 + }, + { + "type": "uint256", + "name": "loopIterator", + "size": 32, + "slot": "7", + "offset": 0 + } + ] + } + }, + "contracts/storage/AsyncOrder.sol:AsyncOrder": { + "name": "AsyncOrder", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint256", + "name": "commitmentTime", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "struct", + "name": "request", + "members": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "int128", + "name": "sizeDelta" + }, + { + "type": "uint128", + "name": "settlementStrategyId" + }, + { + "type": "uint256", + "name": "acceptablePrice" + }, + { + "type": "bytes32", + "name": "trackingCode" + }, + { + "type": "address", + "name": "referrer" + } + ], + "size": 160, + "slot": "1", + "offset": 0 + } + ], + "OrderCommitmentRequest": [ + { + "type": "uint128", + "name": "marketId", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "uint128", + "name": "accountId", + "size": 16, + "slot": "0", + "offset": 16 + }, + { + "type": "int128", + "name": "sizeDelta", + "size": 16, + "slot": "1", + "offset": 0 + }, + { + "type": "uint128", + "name": "settlementStrategyId", + "size": 16, + "slot": "1", + "offset": 16 + }, + { + "type": "uint256", + "name": "acceptablePrice", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "bytes32", + "name": "trackingCode", + "size": 32, + "slot": "3", + "offset": 0 + }, + { + "type": "address", + "name": "referrer", + "size": 20, + "slot": "4", + "offset": 0 + } + ], + "SimulateDataRuntime": [ + { + "type": "bool", + "name": "isEligible", + "size": 1, + "slot": "0", + "offset": 0 + }, + { + "type": "int128", + "name": "sizeDelta", + "size": 16, + "slot": "0", + "offset": 1 + }, + { + "type": "uint128", + "name": "accountId", + "size": 16, + "slot": "1", + "offset": 0 + }, + { + "type": "uint128", + "name": "marketId", + "size": 16, + "slot": "1", + "offset": 16 + }, + { + "type": "uint256", + "name": "fillPrice", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "uint256", + "name": "orderFees", + "size": 32, + "slot": "3", + "offset": 0 + }, + { + "type": "uint256", + "name": "availableMargin", + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "uint256", + "name": "currentLiquidationMargin", + "size": 32, + "slot": "5", + "offset": 0 + }, + { + "type": "uint256", + "name": "accumulatedLiquidationRewards", + "size": 32, + "slot": "6", + "offset": 0 + }, + { + "type": "uint256", + "name": "currentLiquidationReward", + "size": 32, + "slot": "7", + "offset": 0 + }, + { + "type": "int128", + "name": "newPositionSize", + "size": 16, + "slot": "8", + "offset": 0 + }, + { + "type": "uint256", + "name": "newNotionalValue", + "size": 32, + "slot": "9", + "offset": 0 + }, + { + "type": "int256", + "name": "currentAvailableMargin", + "size": 32, + "slot": "10", + "offset": 0 + }, + { + "type": "uint256", + "name": "requiredInitialMargin", + "size": 32, + "slot": "11", + "offset": 0 + }, + { + "type": "uint256", + "name": "initialRequiredMargin", + "size": 32, + "slot": "12", + "offset": 0 + }, + { + "type": "uint256", + "name": "totalRequiredMargin", + "size": 32, + "slot": "13", + "offset": 0 + }, + { + "type": "struct", + "name": "newPosition", + "members": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "int128", + "name": "size" + }, + { + "type": "uint128", + "name": "latestInteractionPrice" + }, + { + "type": "int128", + "name": "latestInteractionFunding" + }, + { + "type": "uint256", + "name": "latestInterestAccrued" + } + ], + "size": 96, + "slot": "14", + "offset": 0 + }, + { + "type": "bytes32", + "name": "trackingCode", + "size": 32, + "slot": "17", + "offset": 0 + } + ], + "RequiredMarginWithNewPositionRuntime": [ + { + "type": "uint256", + "name": "newRequiredMargin", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "oldRequiredMargin", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "uint256", + "name": "requiredMarginForNewPosition", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "uint256", + "name": "accumulatedLiquidationRewards", + "size": 32, + "slot": "3", + "offset": 0 + }, + { + "type": "uint256", + "name": "maxNumberOfWindows", + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "uint256", + "name": "numberOfWindows", + "size": 32, + "slot": "5", + "offset": 0 + }, + { + "type": "uint256", + "name": "requiredRewardMargin", + "size": 32, + "slot": "6", + "offset": 0 + } + ] + } + }, + "contracts/storage/GlobalPerpsMarket.sol:GlobalPerpsMarket": { + "name": "GlobalPerpsMarket", + "kind": "library", + "structs": { + "Data": [ + { + "type": "struct", + "name": "liquidatableAccounts", + "members": [ + { + "type": "struct", + "name": "raw", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + } + ], + "size": 96, + "slot": "0", + "offset": 0 + }, + { + "type": "mapping", + "name": "collateralAmounts", + "key": { + "type": "uint128" + }, + "value": { + "type": "uint256" + }, + "size": 32, + "slot": "3", + "offset": 0 + }, + { + "type": "struct", + "name": "activeCollateralTypes", + "members": [ + { + "type": "struct", + "name": "raw", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + } + ], + "size": 96, + "slot": "4", + "offset": 0 + }, + { + "type": "struct", + "name": "activeMarkets", + "members": [ + { + "type": "struct", + "name": "raw", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + } + ], + "size": 96, + "slot": "7", + "offset": 0 + }, + { + "type": "uint256", + "name": "totalAccountsDebt", + "size": 32, + "slot": "10", + "offset": 0 + } + ] + } + }, + "contracts/storage/GlobalPerpsMarketConfiguration.sol:GlobalPerpsMarketConfiguration": { + "name": "GlobalPerpsMarketConfiguration", + "kind": "library", + "structs": { + "Data": [ + { + "type": "address", + "name": "feeCollector", + "size": 20, + "slot": "0", + "offset": 0 + }, + { + "type": "mapping", + "name": "referrerShare", + "key": { + "type": "address" + }, + "value": { + "type": "uint256" + }, + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "mapping", + "name": "__unused_1", + "key": { + "type": "uint128" + }, + "value": { + "type": "uint256" + }, + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "array", + "name": "__unused_2", + "value": { + "type": "uint128" + }, + "size": 32, + "slot": "3", + "offset": 0 + }, + { + "type": "uint256", + "name": "minKeeperRewardUsd", + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "uint256", + "name": "maxKeeperRewardUsd", + "size": 32, + "slot": "5", + "offset": 0 + }, + { + "type": "uint128", + "name": "maxPositionsPerAccount", + "size": 16, + "slot": "6", + "offset": 0 + }, + { + "type": "uint128", + "name": "maxCollateralsPerAccount", + "size": 16, + "slot": "6", + "offset": 16 + }, + { + "type": "uint256", + "name": "minKeeperProfitRatioD18", + "size": 32, + "slot": "7", + "offset": 0 + }, + { + "type": "uint256", + "name": "maxKeeperScalingRatioD18", + "size": 32, + "slot": "8", + "offset": 0 + }, + { + "type": "struct", + "name": "supportedCollateralTypes", + "members": [ + { + "type": "struct", + "name": "raw", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + } + ], + "size": 96, + "slot": "9", + "offset": 0 + }, + { + "type": "uint128", + "name": "lowUtilizationInterestRateGradient", + "size": 16, + "slot": "12", + "offset": 0 + }, + { + "type": "uint128", + "name": "interestRateGradientBreakpoint", + "size": 16, + "slot": "12", + "offset": 16 + }, + { + "type": "uint128", + "name": "highUtilizationInterestRateGradient", + "size": 16, + "slot": "13", + "offset": 0 + }, + { + "type": "uint128", + "name": "collateralLiquidateRewardRatioD18", + "size": 16, + "slot": "13", + "offset": 16 + }, + { + "type": "address", + "name": "rewardDistributorImplementation", + "size": 20, + "slot": "14", + "offset": 0 + } + ] + } + }, + "contracts/storage/InterestRate.sol:InterestRate": { + "name": "InterestRate", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint256", + "name": "interestAccrued", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint128", + "name": "interestRate", + "size": 16, + "slot": "1", + "offset": 0 + }, + { + "type": "uint256", + "name": "lastTimestamp", + "size": 32, + "slot": "2", + "offset": 0 + } + ] + } + }, + "contracts/storage/KeeperCosts.sol:KeeperCosts": { + "name": "KeeperCosts", + "kind": "library", + "structs": { + "Data": [ + { + "type": "bytes32", + "name": "keeperCostNodeId", + "size": 32, + "slot": "0", + "offset": 0 + } + ] + } + }, + "contracts/storage/Liquidation.sol:Liquidation": { + "name": "Liquidation", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint128", + "name": "amount", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "timestamp", + "size": 32, + "slot": "1", + "offset": 0 + } + ] + } + }, + "contracts/storage/LiquidationAssetManager.sol:LiquidationAssetManager": { + "name": "LiquidationAssetManager", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint128", + "name": "id", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "address", + "name": "distributor", + "size": 20, + "slot": "1", + "offset": 0 + }, + { + "type": "array", + "name": "poolDelegatedCollateralTypes", + "value": { + "type": "address" + }, + "size": 32, + "slot": "2", + "offset": 0 + } + ] + } + }, + "contracts/storage/MarketUpdate.sol:MarketUpdate": { + "name": "MarketUpdate", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint128", + "name": "marketId", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "uint128", + "name": "interestRate", + "size": 16, + "slot": "0", + "offset": 16 + }, + { + "type": "int256", + "name": "skew", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "uint256", + "name": "size", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "int256", + "name": "currentFundingRate", + "size": 32, + "slot": "3", + "offset": 0 + }, + { + "type": "int256", + "name": "currentFundingVelocity", + "size": 32, + "slot": "4", + "offset": 0 + } + ] + } + }, + "contracts/storage/OrderFee.sol:OrderFee": { + "name": "OrderFee", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint256", + "name": "makerFee", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "takerFee", + "size": 32, + "slot": "1", + "offset": 0 + } + ] + } + }, + "contracts/storage/PerpsAccount.sol:PerpsAccount": { + "name": "PerpsAccount", + "kind": "library", + "structs": { + "Data": [ + { + "type": "mapping", + "name": "collateralAmounts", + "key": { + "type": "uint128" + }, + "value": { + "type": "uint256" + }, + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint128", + "name": "id", + "size": 16, + "slot": "1", + "offset": 0 + }, + { + "type": "struct", + "name": "activeCollateralTypes", + "members": [ + { + "type": "struct", + "name": "raw", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + } + ], + "size": 96, + "slot": "2", + "offset": 0 + }, + { + "type": "struct", + "name": "openPositionMarketIds", + "members": [ + { + "type": "struct", + "name": "raw", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + } + ], + "size": 96, + "slot": "5", + "offset": 0 + }, + { + "type": "uint256", + "name": "debt", + "size": 32, + "slot": "8", + "offset": 0 + } + ] + } + }, + "contracts/storage/PerpsCollateralConfiguration.sol:PerpsCollateralConfiguration": { + "name": "PerpsCollateralConfiguration", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint128", + "name": "id", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "maxAmount", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "uint256", + "name": "upperLimitDiscount", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "uint256", + "name": "lowerLimitDiscount", + "size": 32, + "slot": "3", + "offset": 0 + }, + { + "type": "uint256", + "name": "discountScalar", + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "struct", + "name": "lam", + "members": [ + { + "type": "uint128", + "name": "id" + }, + { + "type": "address", + "name": "distributor" + }, + { + "type": "array", + "name": "poolDelegatedCollateralTypes", + "value": { + "type": "address" + } + } + ], + "size": 96, + "slot": "5", + "offset": 0 + } + ] + } + }, + "contracts/storage/PerpsMarket.sol:PerpsMarket": { + "name": "PerpsMarket", + "kind": "library", + "structs": { + "Data": [ + { + "type": "string", + "name": "name", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "string", + "name": "symbol", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "uint128", + "name": "id", + "size": 16, + "slot": "2", + "offset": 0 + }, + { + "type": "int256", + "name": "skew", + "size": 32, + "slot": "3", + "offset": 0 + }, + { + "type": "uint256", + "name": "size", + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "int256", + "name": "lastFundingRate", + "size": 32, + "slot": "5", + "offset": 0 + }, + { + "type": "int256", + "name": "lastFundingValue", + "size": 32, + "slot": "6", + "offset": 0 + }, + { + "type": "uint256", + "name": "lastFundingTime", + "size": 32, + "slot": "7", + "offset": 0 + }, + { + "type": "uint128", + "name": "__unused_1", + "size": 16, + "slot": "8", + "offset": 0 + }, + { + "type": "uint128", + "name": "__unused_2", + "size": 16, + "slot": "8", + "offset": 16 + }, + { + "type": "int256", + "name": "debtCorrectionAccumulator", + "size": 32, + "slot": "9", + "offset": 0 + }, + { + "type": "mapping", + "name": "asyncOrders", + "key": { + "type": "uint256" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "uint256", + "name": "commitmentTime" + }, + { + "type": "struct", + "name": "request", + "members": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint128", + "name": "accountId" + }, + { + "type": "int128", + "name": "sizeDelta" + }, + { + "type": "uint128", + "name": "settlementStrategyId" + }, + { + "type": "uint256", + "name": "acceptablePrice" + }, + { + "type": "bytes32", + "name": "trackingCode" + }, + { + "type": "address", + "name": "referrer" + } + ] + } + ] + }, + "size": 32, + "slot": "10", + "offset": 0 + }, + { + "type": "mapping", + "name": "positions", + "key": { + "type": "uint256" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "int128", + "name": "size" + }, + { + "type": "uint128", + "name": "latestInteractionPrice" + }, + { + "type": "int128", + "name": "latestInteractionFunding" + }, + { + "type": "uint256", + "name": "latestInterestAccrued" + } + ] + }, + "size": 32, + "slot": "11", + "offset": 0 + }, + { + "type": "array", + "name": "liquidationData", + "value": { + "type": "struct", + "name": "Liquidation.Data", + "members": [ + { + "type": "uint128", + "name": "amount" + }, + { + "type": "uint256", + "name": "timestamp" + } + ] + }, + "size": 32, + "slot": "12", + "offset": 0 + } + ], + "PositionDataRuntime": [ + { + "type": "uint256", + "name": "currentPrice", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "int256", + "name": "sizeDelta", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "int256", + "name": "fundingDelta", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "int256", + "name": "notionalDelta", + "size": 32, + "slot": "3", + "offset": 0 + } + ] + } + }, + "contracts/storage/PerpsMarketConfiguration.sol:PerpsMarketConfiguration": { + "name": "PerpsMarketConfiguration", + "kind": "library", + "structs": { + "Data": [ + { + "type": "struct", + "name": "orderFees", + "members": [ + { + "type": "uint256", + "name": "makerFee" + }, + { + "type": "uint256", + "name": "takerFee" + } + ], + "size": 64, + "slot": "0", + "offset": 0 + }, + { + "type": "array", + "name": "settlementStrategies", + "value": { + "type": "struct", + "name": "SettlementStrategy.Data", + "members": [ + { + "type": "enum", + "name": "strategyType", + "members": [ + "PYTH" + ] + }, + { + "type": "uint256", + "name": "settlementDelay" + }, + { + "type": "uint256", + "name": "settlementWindowDuration" + }, + { + "type": "address", + "name": "priceVerificationContract" + }, + { + "type": "bytes32", + "name": "feedId" + }, + { + "type": "uint256", + "name": "settlementReward" + }, + { + "type": "bool", + "name": "disabled" + }, + { + "type": "uint256", + "name": "commitmentPriceDelay" + } + ] + }, + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "uint256", + "name": "maxMarketSize", + "size": 32, + "slot": "3", + "offset": 0 + }, + { + "type": "uint256", + "name": "maxFundingVelocity", + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "uint256", + "name": "skewScale", + "size": 32, + "slot": "5", + "offset": 0 + }, + { + "type": "uint256", + "name": "initialMarginRatioD18", + "size": 32, + "slot": "6", + "offset": 0 + }, + { + "type": "uint256", + "name": "maintenanceMarginScalarD18", + "size": 32, + "slot": "7", + "offset": 0 + }, + { + "type": "uint256", + "name": "lockedOiRatioD18", + "size": 32, + "slot": "8", + "offset": 0 + }, + { + "type": "uint256", + "name": "maxLiquidationLimitAccumulationMultiplier", + "size": 32, + "slot": "9", + "offset": 0 + }, + { + "type": "uint256", + "name": "maxSecondsInLiquidationWindow", + "size": 32, + "slot": "10", + "offset": 0 + }, + { + "type": "uint256", + "name": "flagRewardRatioD18", + "size": 32, + "slot": "11", + "offset": 0 + }, + { + "type": "uint256", + "name": "minimumPositionMargin", + "size": 32, + "slot": "12", + "offset": 0 + }, + { + "type": "uint256", + "name": "minimumInitialMarginRatioD18", + "size": 32, + "slot": "13", + "offset": 0 + }, + { + "type": "uint256", + "name": "maxLiquidationPd", + "size": 32, + "slot": "14", + "offset": 0 + }, + { + "type": "address", + "name": "endorsedLiquidator", + "size": 20, + "slot": "15", + "offset": 0 + }, + { + "type": "uint256", + "name": "maxMarketValue", + "size": 32, + "slot": "16", + "offset": 0 + } + ] + } + }, + "contracts/storage/PerpsMarketFactory.sol:PerpsMarketFactory": { + "name": "PerpsMarketFactory", + "kind": "library", + "structs": { + "Data": [ + { + "type": "address", + "name": "oracle", + "size": 20, + "slot": "0", + "offset": 0 + }, + { + "type": "address", + "name": "usdToken", + "size": 20, + "slot": "1", + "offset": 0 + }, + { + "type": "address", + "name": "synthetix", + "size": 20, + "slot": "2", + "offset": 0 + }, + { + "type": "address", + "name": "spotMarket", + "size": 20, + "slot": "3", + "offset": 0 + }, + { + "type": "uint128", + "name": "perpsMarketId", + "size": 16, + "slot": "4", + "offset": 0 + }, + { + "type": "string", + "name": "name", + "size": 32, + "slot": "5", + "offset": 0 + }, + { + "type": "address", + "name": "liquidationAssetManager", + "size": 20, + "slot": "6", + "offset": 0 + } + ] + } + }, + "contracts/storage/PerpsPrice.sol:PerpsPrice": { + "name": "PerpsPrice", + "kind": "library", + "structs": { + "Data": [ + { + "type": "bytes32", + "name": "feedId", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "strictStalenessTolerance", + "size": 32, + "slot": "1", + "offset": 0 + } + ] + } + }, + "contracts/storage/Position.sol:Position": { + "name": "Position", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint128", + "name": "marketId", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "int128", + "name": "size", + "size": 16, + "slot": "0", + "offset": 16 + }, + { + "type": "uint128", + "name": "latestInteractionPrice", + "size": 16, + "slot": "1", + "offset": 0 + }, + { + "type": "int128", + "name": "latestInteractionFunding", + "size": 16, + "slot": "1", + "offset": 16 + }, + { + "type": "uint256", + "name": "latestInterestAccrued", + "size": 32, + "slot": "2", + "offset": 0 + } + ] + } + }, + "contracts/storage/SettlementStrategy.sol:SettlementStrategy": { + "name": "SettlementStrategy", + "kind": "library", + "structs": { + "Data": [ + { + "type": "enum", + "name": "strategyType", + "members": [ + "PYTH" + ], + "size": 1, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "settlementDelay", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "uint256", + "name": "settlementWindowDuration", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "address", + "name": "priceVerificationContract", + "size": 20, + "slot": "3", + "offset": 0 + }, + { + "type": "bytes32", + "name": "feedId", + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "uint256", + "name": "settlementReward", + "size": 32, + "slot": "5", + "offset": 0 + }, + { + "type": "bool", + "name": "disabled", + "size": 1, + "slot": "6", + "offset": 0 + }, + { + "type": "uint256", + "name": "commitmentPriceDelay", + "size": 32, + "slot": "7", + "offset": 0 + } + ] + } + }, + "contracts/utils/BigNumber.sol:BigNumber": { + "name": "BigNumber", + "kind": "library", + "structs": { + "Data": [ + { + "type": "array", + "name": "chunks", + "value": { + "type": "uint256" + }, + "size": 32, + "slot": "0", + "offset": 0 + } + ], + "Snapshot": [ + { + "type": "uint256", + "name": "currentChunkId", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "valueAtChunk", + "size": 32, + "slot": "1", + "offset": 0 + } + ] + } + } +} diff --git a/markets/perps-market/storage.dump.sol b/markets/perps-market/storage.dump.sol deleted file mode 100644 index e71f5aa0a8..0000000000 --- a/markets/perps-market/storage.dump.sol +++ /dev/null @@ -1,977 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.8.11<0.9.0; - -// @custom:artifact @synthetixio/core-contracts/contracts/ownership/OwnableStorage.sol:OwnableStorage -library OwnableStorage { - bytes32 private constant _SLOT_OWNABLE_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.Ownable")); - struct Data { - address owner; - address nominatedOwner; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_OWNABLE_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/proxy/ProxyStorage.sol:ProxyStorage -contract ProxyStorage { - bytes32 private constant _SLOT_PROXY_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.Proxy")); - struct ProxyStore { - address implementation; - bool simulatingUpgrade; - } - function _proxyStore() internal pure returns (ProxyStore storage store) { - bytes32 s = _SLOT_PROXY_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/DecimalMath.sol:DecimalMath -library DecimalMath { - uint256 public constant UNIT = 1e18; - int256 public constant UNIT_INT = int256(UNIT); - uint128 public constant UNIT_UINT128 = uint128(UNIT); - int128 public constant UNIT_INT128 = int128(UNIT_INT); - uint256 public constant UNIT_PRECISE = 1e27; - int256 public constant UNIT_PRECISE_INT = int256(UNIT_PRECISE); - int128 public constant UNIT_PRECISE_INT128 = int128(UNIT_PRECISE_INT); - uint256 public constant PRECISION_FACTOR = 9; -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/ERC2771Context.sol:ERC2771Context -library ERC2771Context { - address private constant TRUSTED_FORWARDER = 0xE2C5658cC5C448B48141168f3e475dF8f65A1e3e; -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/HeapUtil.sol:HeapUtil -library HeapUtil { - uint256 private constant _ROOT_INDEX = 1; - struct Data { - uint128 idCount; - Node[] nodes; - mapping(uint128 => uint256) indices; - } - struct Node { - uint128 id; - int128 priority; - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/SetUtil.sol:SetUtil -library SetUtil { - struct UintSet { - Bytes32Set raw; - } - struct AddressSet { - Bytes32Set raw; - } - struct Bytes32Set { - bytes32[] _values; - mapping(bytes32 => uint256) _positions; - } -} - -// @custom:artifact @synthetixio/core-modules/contracts/storage/AssociatedSystem.sol:AssociatedSystem -library AssociatedSystem { - bytes32 public constant KIND_ERC20 = "erc20"; - bytes32 public constant KIND_ERC721 = "erc721"; - bytes32 public constant KIND_UNMANAGED = "unmanaged"; - struct Data { - address proxy; - address impl; - bytes32 kind; - } - function load(bytes32 id) internal pure returns (Data storage store) { - bytes32 s = keccak256(abi.encode("io.synthetix.core-modules.AssociatedSystem", id)); - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-modules/contracts/storage/FeatureFlag.sol:FeatureFlag -library FeatureFlag { - struct Data { - bytes32 name; - bool allowAll; - bool denyAll; - SetUtil.AddressSet permissionedAddresses; - address[] deniers; - } - function load(bytes32 featureName) internal pure returns (Data storage store) { - bytes32 s = keccak256(abi.encode("io.synthetix.core-modules.FeatureFlag", featureName)); - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/Account.sol:Account -library Account { - struct Data { - uint128 id; - AccountRBAC.Data rbac; - uint64 lastInteraction; - uint64 __slotAvailableForFutureUse; - uint128 __slot2AvailableForFutureUse; - mapping(address => Collateral.Data) collaterals; - } - function load(uint128 id) internal pure returns (Data storage account) { - bytes32 s = keccak256(abi.encode("io.synthetix.synthetix.Account", id)); - assembly { - account.slot := s - } - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/AccountRBAC.sol:AccountRBAC -library AccountRBAC { - bytes32 internal constant _ADMIN_PERMISSION = "ADMIN"; - bytes32 internal constant _WITHDRAW_PERMISSION = "WITHDRAW"; - bytes32 internal constant _DELEGATE_PERMISSION = "DELEGATE"; - bytes32 internal constant _MINT_PERMISSION = "MINT"; - bytes32 internal constant _REWARDS_PERMISSION = "REWARDS"; - bytes32 internal constant _PERPS_MODIFY_COLLATERAL_PERMISSION = "PERPS_MODIFY_COLLATERAL"; - bytes32 internal constant _PERPS_COMMIT_ASYNC_ORDER_PERMISSION = "PERPS_COMMIT_ASYNC_ORDER"; - bytes32 internal constant _BURN_PERMISSION = "BURN"; - bytes32 internal constant _BFP_PERPS_PAY_DEBT_PERMISSION = "BFP_PERPS_PAY_DEBT"; - bytes32 internal constant _BFP_PERPS_SPLIT_ACCOUNT_PERMISSION = "BFP_PERPS_SPLIT_ACCOUNT"; - struct Data { - address owner; - mapping(address => SetUtil.Bytes32Set) permissions; - SetUtil.AddressSet permissionAddresses; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/Collateral.sol:Collateral -library Collateral { - struct Data { - uint256 amountAvailableForDelegationD18; - SetUtil.UintSet pools; - CollateralLock.Data[] locks; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/CollateralConfiguration.sol:CollateralConfiguration -library CollateralConfiguration { - bytes32 private constant _SLOT_AVAILABLE_COLLATERALS = keccak256(abi.encode("io.synthetix.synthetix.CollateralConfiguration_availableCollaterals")); - struct Data { - bool depositingEnabled; - uint256 issuanceRatioD18; - uint256 liquidationRatioD18; - uint256 liquidationRewardD18; - bytes32 oracleNodeId; - address tokenAddress; - uint256 minDelegationD18; - } - function load(address token) internal pure returns (Data storage collateralConfiguration) { - bytes32 s = keccak256(abi.encode("io.synthetix.synthetix.CollateralConfiguration", token)); - assembly { - collateralConfiguration.slot := s - } - } - function loadAvailableCollaterals() internal pure returns (SetUtil.AddressSet storage availableCollaterals) { - bytes32 s = _SLOT_AVAILABLE_COLLATERALS; - assembly { - availableCollaterals.slot := s - } - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/CollateralLock.sol:CollateralLock -library CollateralLock { - struct Data { - uint128 amountD18; - uint64 lockExpirationTime; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/Config.sol:Config -library Config { - struct Data { - uint256 __unused; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/Distribution.sol:Distribution -library Distribution { - struct Data { - uint128 totalSharesD18; - int128 valuePerShareD27; - mapping(bytes32 => DistributionActor.Data) actorInfo; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/DistributionActor.sol:DistributionActor -library DistributionActor { - struct Data { - uint128 sharesD18; - int128 lastValuePerShareD27; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/Market.sol:Market -library Market { - struct Data { - uint128 id; - address marketAddress; - int128 netIssuanceD18; - int128 creditCapacityD18; - int128 lastDistributedMarketBalanceD18; - HeapUtil.Data inRangePools; - HeapUtil.Data outRangePools; - Distribution.Data poolsDebtDistribution; - mapping(uint128 => MarketPoolInfo.Data) pools; - DepositedCollateral[] depositedCollateral; - mapping(address => uint256) maximumDepositableD18; - uint32 minDelegateTime; - uint32 __reservedForLater1; - uint64 __reservedForLater2; - uint64 __reservedForLater3; - uint64 __reservedForLater4; - uint256 minLiquidityRatioD18; - } - struct DepositedCollateral { - address collateralType; - uint256 amountD18; - } - function load(uint128 id) internal pure returns (Data storage market) { - bytes32 s = keccak256(abi.encode("io.synthetix.synthetix.Market", id)); - assembly { - market.slot := s - } - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/MarketConfiguration.sol:MarketConfiguration -library MarketConfiguration { - struct Data { - uint128 marketId; - uint128 weightD18; - int128 maxDebtShareValueD18; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/MarketPoolInfo.sol:MarketPoolInfo -library MarketPoolInfo { - struct Data { - uint128 creditCapacityAmountD18; - uint128 pendingDebtD18; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/OracleManager.sol:OracleManager -library OracleManager { - bytes32 private constant _SLOT_ORACLE_MANAGER = keccak256(abi.encode("io.synthetix.synthetix.OracleManager")); - struct Data { - address oracleManagerAddress; - } - function load() internal pure returns (Data storage oracleManager) { - bytes32 s = _SLOT_ORACLE_MANAGER; - assembly { - oracleManager.slot := s - } - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/Pool.sol:Pool -library Pool { - bytes32 private constant _CONFIG_SET_MARKET_MIN_DELEGATE_MAX = "setMarketMinDelegateTime_max"; - struct Data { - uint128 id; - string name; - address owner; - address nominatedOwner; - uint128 totalWeightsD18; - int128 totalVaultDebtsD18; - MarketConfiguration.Data[] marketConfigurations; - Distribution.Data vaultsDebtDistribution; - mapping(address => Vault.Data) vaults; - uint64 lastConfigurationTime; - uint64 __reserved1; - uint64 __reserved2; - uint64 __reserved3; - mapping(address => PoolCollateralConfiguration.Data) collateralConfigurations; - bool collateralDisabledByDefault; - SetUtil.Bytes32Set rewardIds; - mapping(bytes32 => RewardDistribution.Data) rewardsToVaults; - } - function load(uint128 id) internal pure returns (Data storage pool) { - bytes32 s = keccak256(abi.encode("io.synthetix.synthetix.Pool", id)); - assembly { - pool.slot := s - } - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/PoolCollateralConfiguration.sol:PoolCollateralConfiguration -library PoolCollateralConfiguration { - bytes32 private constant _SLOT = keccak256(abi.encode("io.synthetix.synthetix.PoolCollateralConfiguration")); - struct Data { - uint256 collateralLimitD18; - uint256 issuanceRatioD18; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/RewardDistribution.sol:RewardDistribution -library RewardDistribution { - struct Data { - address distributor; - uint128 __slotAvailableForFutureUse; - uint128 rewardPerShareD18; - mapping(uint256 => RewardDistributionClaimStatus.Data) claimStatus; - int128 scheduledValueD18; - uint64 start; - uint32 duration; - uint32 lastUpdate; - int128 nextScheduledValueD18; - uint64 nextStart; - uint32 nextDuration; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/RewardDistributionClaimStatus.sol:RewardDistributionClaimStatus -library RewardDistributionClaimStatus { - struct Data { - uint128 lastRewardPerShareD18; - uint128 pendingSendD18; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/ScalableMapping.sol:ScalableMapping -library ScalableMapping { - struct Data { - uint128 totalSharesD18; - int128 scaleModifierD27; - mapping(bytes32 => uint256) sharesD18; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/SystemPoolConfiguration.sol:SystemPoolConfiguration -library SystemPoolConfiguration { - bytes32 private constant _SLOT_SYSTEM_POOL_CONFIGURATION = keccak256(abi.encode("io.synthetix.synthetix.SystemPoolConfiguration")); - struct Data { - uint256 minLiquidityRatioD18; - uint128 __reservedForFutureUse; - uint128 preferredPool; - SetUtil.UintSet approvedPools; - } - function load() internal pure returns (Data storage systemPoolConfiguration) { - bytes32 s = _SLOT_SYSTEM_POOL_CONFIGURATION; - assembly { - systemPoolConfiguration.slot := s - } - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/Vault.sol:Vault -library Vault { - struct Data { - uint256 epoch; - bytes32 __slotAvailableForFutureUse; - int128 _unused_prevTotalDebtD18; - mapping(uint256 => VaultEpoch.Data) epochData; - mapping(bytes32 => RewardDistribution.Data) rewards; - SetUtil.Bytes32Set rewardIds; - } - struct PositionSelector { - uint128 accountId; - uint128 poolId; - address collateralType; - } -} - -// @custom:artifact @synthetixio/main/contracts/storage/VaultEpoch.sol:VaultEpoch -library VaultEpoch { - struct Data { - int128 unconsolidatedDebtD18; - int128 totalConsolidatedDebtD18; - Distribution.Data accountsDebtDistribution; - ScalableMapping.Data collateralAmounts; - mapping(uint256 => int256) consolidatedDebtAmountsD18; - mapping(uint128 => uint64) lastDelegationTime; - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/interfaces/external/IPyth.sol:PythStructs -contract PythStructs { - struct Price { - int64 price; - uint64 conf; - int32 expo; - uint256 publishTime; - } - struct PriceFeed { - bytes32 id; - Price price; - Price emaPrice; - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/ChainlinkNode.sol:ChainlinkNode -library ChainlinkNode { - uint256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/ReducerNode.sol:ReducerNode -library ReducerNode { - enum Operations { - RECENT, - MIN, - MAX, - MEAN, - MEDIAN, - MUL, - DIV, - MULDECIMAL, - DIVDECIMAL - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/UniswapNode.sol:UniswapNode -library UniswapNode { - uint8 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/pyth/PythNode.sol:PythNode -library PythNode { - int256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/pyth/PythOffchainLookupNode.sol:PythOffchainLookupNode -library PythOffchainLookupNode { - int256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/storage/NodeDefinition.sol:NodeDefinition -library NodeDefinition { - enum NodeType { - NONE, - REDUCER, - EXTERNAL, - CHAINLINK, - UNISWAP, - PYTH, - PRICE_DEVIATION_CIRCUIT_BREAKER, - STALENESS_CIRCUIT_BREAKER, - CONSTANT, - PYTH_OFFCHAIN_LOOKUP - } - struct Data { - NodeType nodeType; - bytes parameters; - bytes32[] parents; - } - function load(bytes32 id) internal pure returns (Data storage node) { - bytes32 s = keccak256(abi.encode("io.synthetix.oracle-manager.Node", id)); - assembly { - node.slot := s - } - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/storage/NodeOutput.sol:NodeOutput -library NodeOutput { - struct Data { - int256 price; - uint256 timestamp; - uint256 __slotAvailableForFutureUse1; - uint256 __slotAvailableForFutureUse2; - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/utils/TickMath.sol:TickMath -library TickMath { - int24 internal constant MIN_TICK = -887272; - int24 internal constant MAX_TICK = -MIN_TICK; - uint160 internal constant MIN_SQRT_RATIO = 4295128739; - uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342; -} - -// @custom:artifact @synthetixio/rewards-distributor/src/RewardsDistributor.sol:RewardsDistributor -contract RewardsDistributor { - uint256 public constant SYSTEM_PRECISION = 10 ** 18; -} - -// @custom:artifact @synthetixio/spot-market/contracts/storage/OrderFees.sol:OrderFees -library OrderFees { - struct Data { - uint256 fixedFees; - uint256 utilizationFees; - int256 skewFees; - int256 wrapperFees; - } -} - -// @custom:artifact @synthetixio/spot-market/contracts/storage/Price.sol:Price -library Price { - enum Tolerance { - DEFAULT, - STRICT - } - struct Data { - bytes32 buyFeedId; - bytes32 sellFeedId; - uint256 strictStalenessTolerance; - } - function load(uint128 marketId) internal pure returns (Data storage price) { - bytes32 s = keccak256(abi.encode("io.synthetix.spot-market.Price", marketId)); - assembly { - price.slot := s - } - } -} - -// @custom:artifact @synthetixio/spot-market/contracts/storage/SpotMarketFactory.sol:SpotMarketFactory -library SpotMarketFactory { - bytes32 private constant _SLOT_SPOT_MARKET_FACTORY = keccak256(abi.encode("io.synthetix.spot-market.SpotMarketFactory")); - struct Data { - address usdToken; - address oracle; - address synthetix; - address synthImplementation; - mapping(uint128 => address) marketOwners; - mapping(uint128 => address) nominatedMarketOwners; - } - function load() internal pure returns (Data storage spotMarketFactory) { - bytes32 s = _SLOT_SPOT_MARKET_FACTORY; - assembly { - spotMarketFactory.slot := s - } - } -} - -// @custom:artifact @synthetixio/spot-market/contracts/utils/TransactionUtil.sol:Transaction -library Transaction { - enum Type { - NULL, - BUY, - SELL, - ASYNC_BUY, - ASYNC_SELL, - WRAP, - UNWRAP - } -} - -// @custom:artifact contracts/interfaces/IAsyncOrderCancelModule.sol:IAsyncOrderCancelModule -interface IAsyncOrderCancelModule { - struct CancelOrderRuntime { - uint128 marketId; - uint128 accountId; - int128 sizeDelta; - uint256 settlementReward; - uint256 fillPrice; - uint256 acceptablePrice; - } -} - -// @custom:artifact contracts/interfaces/IAsyncOrderSettlementPythModule.sol:IAsyncOrderSettlementPythModule -interface IAsyncOrderSettlementPythModule { - struct SettleOrderRuntime { - uint128 marketId; - uint128 accountId; - int128 sizeDelta; - int256 pnl; - uint256 chargedInterest; - int256 accruedFunding; - uint256 settlementReward; - uint256 fillPrice; - uint256 totalFees; - uint256 referralFees; - uint256 feeCollectorFees; - Position.Data newPosition; - MarketUpdate.Data updateData; - uint256 synthDeductionIterator; - uint128[] deductedSynthIds; - uint256[] deductedAmount; - int256 chargedAmount; - uint256 newAccountDebt; - } -} - -// @custom:artifact contracts/interfaces/IPerpsMarketModule.sol:IPerpsMarketModule -interface IPerpsMarketModule { - struct MarketSummary { - int256 skew; - uint256 size; - uint256 maxOpenInterest; - int256 currentFundingRate; - int256 currentFundingVelocity; - uint256 indexPrice; - } -} - -// @custom:artifact contracts/modules/LiquidationModule.sol:LiquidationModule -contract LiquidationModule { - struct LiquidateAccountRuntime { - uint128 accountId; - uint256 totalFlaggingRewards; - uint256 totalLiquidated; - bool accountFullyLiquidated; - uint256 totalLiquidationCost; - uint256 price; - uint128 positionMarketId; - uint256 loopIterator; - } -} - -// @custom:artifact contracts/modules/PerpsMarketFactoryModule.sol:PerpsMarketFactoryModule -contract PerpsMarketFactoryModule { - bytes32 private constant _ACCOUNT_TOKEN_SYSTEM = "accountNft"; -} - -// @custom:artifact contracts/storage/AsyncOrder.sol:AsyncOrder -library AsyncOrder { - struct Data { - uint256 commitmentTime; - OrderCommitmentRequest request; - } - struct OrderCommitmentRequest { - uint128 marketId; - uint128 accountId; - int128 sizeDelta; - uint128 settlementStrategyId; - uint256 acceptablePrice; - bytes32 trackingCode; - address referrer; - } - struct SimulateDataRuntime { - bool isEligible; - int128 sizeDelta; - uint128 accountId; - uint128 marketId; - uint256 fillPrice; - uint256 orderFees; - uint256 availableMargin; - uint256 currentLiquidationMargin; - uint256 accumulatedLiquidationRewards; - uint256 currentLiquidationReward; - int128 newPositionSize; - uint256 newNotionalValue; - int256 currentAvailableMargin; - uint256 requiredInitialMargin; - uint256 initialRequiredMargin; - uint256 totalRequiredMargin; - Position.Data newPosition; - bytes32 trackingCode; - } - struct RequiredMarginWithNewPositionRuntime { - uint256 newRequiredMargin; - uint256 oldRequiredMargin; - uint256 requiredMarginForNewPosition; - uint256 accumulatedLiquidationRewards; - uint256 maxNumberOfWindows; - uint256 numberOfWindows; - uint256 requiredRewardMargin; - } - function load(uint128 accountId) internal pure returns (Data storage order) { - bytes32 s = keccak256(abi.encode("io.synthetix.perps-market.AsyncOrder", accountId)); - assembly { - order.slot := s - } - } -} - -// @custom:artifact contracts/storage/GlobalPerpsMarket.sol:GlobalPerpsMarket -library GlobalPerpsMarket { - bytes32 private constant _SLOT_GLOBAL_PERPS_MARKET = keccak256(abi.encode("io.synthetix.perps-market.GlobalPerpsMarket")); - struct Data { - SetUtil.UintSet liquidatableAccounts; - mapping(uint128 => uint256) collateralAmounts; - SetUtil.UintSet activeCollateralTypes; - SetUtil.UintSet activeMarkets; - uint256 totalAccountsDebt; - } - function load() internal pure returns (Data storage marketData) { - bytes32 s = _SLOT_GLOBAL_PERPS_MARKET; - assembly { - marketData.slot := s - } - } -} - -// @custom:artifact contracts/storage/GlobalPerpsMarketConfiguration.sol:GlobalPerpsMarketConfiguration -library GlobalPerpsMarketConfiguration { - bytes32 private constant _SLOT_GLOBAL_PERPS_MARKET_CONFIGURATION = keccak256(abi.encode("io.synthetix.perps-market.GlobalPerpsMarketConfiguration")); - struct Data { - address feeCollector; - mapping(address => uint256) referrerShare; - mapping(uint128 => uint256) __unused_1; - uint128[] __unused_2; - uint256 minKeeperRewardUsd; - uint256 maxKeeperRewardUsd; - uint128 maxPositionsPerAccount; - uint128 maxCollateralsPerAccount; - uint256 minKeeperProfitRatioD18; - uint256 maxKeeperScalingRatioD18; - SetUtil.UintSet supportedCollateralTypes; - uint128 lowUtilizationInterestRateGradient; - uint128 interestRateGradientBreakpoint; - uint128 highUtilizationInterestRateGradient; - uint128 collateralLiquidateRewardRatioD18; - address rewardDistributorImplementation; - } - function load() internal pure returns (Data storage globalMarketConfig) { - bytes32 s = _SLOT_GLOBAL_PERPS_MARKET_CONFIGURATION; - assembly { - globalMarketConfig.slot := s - } - } -} - -// @custom:artifact contracts/storage/InterestRate.sol:InterestRate -library InterestRate { - uint256 private constant AVERAGE_SECONDS_PER_YEAR = 31557600; - bytes32 private constant _SLOT_INTEREST_RATE = keccak256(abi.encode("io.synthetix.perps-market.InterestRate")); - struct Data { - uint256 interestAccrued; - uint128 interestRate; - uint256 lastTimestamp; - } - function load() internal pure returns (Data storage interestRate) { - bytes32 s = _SLOT_INTEREST_RATE; - assembly { - interestRate.slot := s - } - } -} - -// @custom:artifact contracts/storage/KeeperCosts.sol:KeeperCosts -library KeeperCosts { - uint256 private constant KIND_SETTLEMENT = 0; - uint256 private constant KIND_FLAG = 1; - uint256 private constant KIND_LIQUIDATE = 2; - struct Data { - bytes32 keeperCostNodeId; - } - function load() internal pure returns (Data storage price) { - bytes32 s = keccak256(abi.encode("io.synthetix.perps-market.KeeperCosts")); - assembly { - price.slot := s - } - } -} - -// @custom:artifact contracts/storage/Liquidation.sol:Liquidation -library Liquidation { - struct Data { - uint128 amount; - uint256 timestamp; - } -} - -// @custom:artifact contracts/storage/LiquidationAssetManager.sol:LiquidationAssetManager -library LiquidationAssetManager { - struct Data { - uint128 id; - address distributor; - address[] poolDelegatedCollateralTypes; - } -} - -// @custom:artifact contracts/storage/MarketUpdate.sol:MarketUpdate -library MarketUpdate { - struct Data { - uint128 marketId; - uint128 interestRate; - int256 skew; - uint256 size; - int256 currentFundingRate; - int256 currentFundingVelocity; - } -} - -// @custom:artifact contracts/storage/OrderFee.sol:OrderFee -library OrderFee { - struct Data { - uint256 makerFee; - uint256 takerFee; - } -} - -// @custom:artifact contracts/storage/PerpsAccount.sol:PerpsAccount -library PerpsAccount { - struct Data { - mapping(uint128 => uint256) collateralAmounts; - uint128 id; - SetUtil.UintSet activeCollateralTypes; - SetUtil.UintSet openPositionMarketIds; - uint256 debt; - } - function load(uint128 id) internal pure returns (Data storage account) { - bytes32 s = keccak256(abi.encode("io.synthetix.perps-market.Account", id)); - assembly { - account.slot := s - } - } -} - -// @custom:artifact contracts/storage/PerpsCollateralConfiguration.sol:PerpsCollateralConfiguration -library PerpsCollateralConfiguration { - struct Data { - uint128 id; - uint256 maxAmount; - uint256 upperLimitDiscount; - uint256 lowerLimitDiscount; - uint256 discountScalar; - LiquidationAssetManager.Data lam; - } - function load(uint128 collateralId) internal pure returns (Data storage collateralConfig) { - bytes32 s = keccak256(abi.encode("io.synthetix.perps-market.CollateralConfiguration", collateralId)); - assembly { - collateralConfig.slot := s - } - } -} - -// @custom:artifact contracts/storage/PerpsMarket.sol:PerpsMarket -library PerpsMarket { - struct Data { - string name; - string symbol; - uint128 id; - int256 skew; - uint256 size; - int256 lastFundingRate; - int256 lastFundingValue; - uint256 lastFundingTime; - uint128 __unused_1; - uint128 __unused_2; - int256 debtCorrectionAccumulator; - mapping(uint256 => AsyncOrder.Data) asyncOrders; - mapping(uint256 => Position.Data) positions; - Liquidation.Data[] liquidationData; - } - struct PositionDataRuntime { - uint256 currentPrice; - int256 sizeDelta; - int256 fundingDelta; - int256 notionalDelta; - } - function load(uint128 marketId) internal pure returns (Data storage market) { - bytes32 s = keccak256(abi.encode("io.synthetix.perps-market.PerpsMarket", marketId)); - assembly { - market.slot := s - } - } -} - -// @custom:artifact contracts/storage/PerpsMarketConfiguration.sol:PerpsMarketConfiguration -library PerpsMarketConfiguration { - struct Data { - OrderFee.Data orderFees; - SettlementStrategy.Data[] settlementStrategies; - uint256 maxMarketSize; - uint256 maxFundingVelocity; - uint256 skewScale; - uint256 initialMarginRatioD18; - uint256 maintenanceMarginScalarD18; - uint256 lockedOiRatioD18; - uint256 maxLiquidationLimitAccumulationMultiplier; - uint256 maxSecondsInLiquidationWindow; - uint256 flagRewardRatioD18; - uint256 minimumPositionMargin; - uint256 minimumInitialMarginRatioD18; - uint256 maxLiquidationPd; - address endorsedLiquidator; - uint256 maxMarketValue; - } - function load(uint128 marketId) internal pure returns (Data storage store) { - bytes32 s = keccak256(abi.encode("io.synthetix.perps-market.PerpsMarketConfiguration", marketId)); - assembly { - store.slot := s - } - } -} - -// @custom:artifact contracts/storage/PerpsMarketFactory.sol:PerpsMarketFactory -library PerpsMarketFactory { - bytes32 private constant _SLOT_PERPS_MARKET_FACTORY = keccak256(abi.encode("io.synthetix.perps-market.PerpsMarketFactory")); - struct Data { - address oracle; - address usdToken; - address synthetix; - address spotMarket; - uint128 perpsMarketId; - string name; - address liquidationAssetManager; - } - function load() internal pure returns (Data storage perpsMarketFactory) { - bytes32 s = _SLOT_PERPS_MARKET_FACTORY; - assembly { - perpsMarketFactory.slot := s - } - } -} - -// @custom:artifact contracts/storage/PerpsPrice.sol:PerpsPrice -library PerpsPrice { - uint256 private constant ONE_MONTH = 2592000; - enum Tolerance { - DEFAULT, - STRICT, - ONE_MONTH - } - struct Data { - bytes32 feedId; - uint256 strictStalenessTolerance; - } - function load(uint128 marketId) internal pure returns (Data storage price) { - bytes32 s = keccak256(abi.encode("io.synthetix.perps-market.Price", marketId)); - assembly { - price.slot := s - } - } -} - -// @custom:artifact contracts/storage/Position.sol:Position -library Position { - struct Data { - uint128 marketId; - int128 size; - uint128 latestInteractionPrice; - int128 latestInteractionFunding; - uint256 latestInterestAccrued; - } -} - -// @custom:artifact contracts/storage/SettlementStrategy.sol:SettlementStrategy -library SettlementStrategy { - enum Type { - PYTH - } - struct Data { - Type strategyType; - uint256 settlementDelay; - uint256 settlementWindowDuration; - address priceVerificationContract; - bytes32 feedId; - uint256 settlementReward; - bool disabled; - uint256 commitmentPriceDelay; - } -} - -// @custom:artifact contracts/utils/BigNumber.sol:BigNumber -library BigNumber { - uint256 internal constant CHUNK_SIZE = 2 ** 255; - struct Data { - uint256[] chunks; - } - struct Snapshot { - uint256 currentChunkId; - uint256 valueAtChunk; - } -} - -// @custom:artifact contracts/utils/Flags.sol:Flags -library Flags { - bytes32 public constant PERPS_SYSTEM = "perpsSystem"; - bytes32 public constant CREATE_MARKET = "createMarket"; -} diff --git a/markets/spot-market/package.json b/markets/spot-market/package.json index 675a76e77e..b1213736a9 100644 --- a/markets/spot-market/package.json +++ b/markets/spot-market/package.json @@ -5,10 +5,11 @@ "scripts": { "clean": "hardhat clean && rm -rf contracts/generated", "build": "yarn build:contracts", - "storage:verify": "hardhat compile --force && hardhat storage:verify", - "build:contracts": "hardhat compile --force && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "build:contracts": "hardhat compile --force && yarn storage:dump && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "storage:dump": "hardhat storage:dump --output storage.new.dump.json", + "storage:verify": " hardhat storage:verify", "build-testable": "CANNON_REGISTRY_PRIORITY=local hardhat cannon:build cannonfile.test.toml", - "check:storage": "git diff --exit-code storage.dump.sol", + "check:storage": "diff -uw storage.dump.json storage.new.dump.json", "start": "yarn build && yarn cannon-build", "cannon-build": "hardhat cannon:build", "test": "CANNON_REGISTRY_PRIORITY=local hardhat test", diff --git a/markets/spot-market/storage.dump.json b/markets/spot-market/storage.dump.json new file mode 100644 index 0000000000..a6a2a198d9 --- /dev/null +++ b/markets/spot-market/storage.dump.json @@ -0,0 +1,501 @@ +{ + "contracts/storage/AsyncOrder.sol:AsyncOrder": { + "name": "AsyncOrder", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint256", + "name": "totalEscrowedSynthShares", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint128", + "name": "totalClaims", + "size": 16, + "slot": "1", + "offset": 0 + } + ] + } + }, + "contracts/storage/AsyncOrderClaim.sol:AsyncOrderClaim": { + "name": "AsyncOrderClaim", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint128", + "name": "id", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "address", + "name": "owner", + "size": 20, + "slot": "1", + "offset": 0 + }, + { + "type": "enum", + "name": "orderType", + "members": [ + "NULL", + "BUY", + "SELL", + "ASYNC_BUY", + "ASYNC_SELL", + "WRAP", + "UNWRAP" + ], + "size": 1, + "slot": "1", + "offset": 20 + }, + { + "type": "uint256", + "name": "amountEscrowed", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "uint256", + "name": "settlementStrategyId", + "size": 32, + "slot": "3", + "offset": 0 + }, + { + "type": "uint256", + "name": "commitmentTime", + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "uint256", + "name": "minimumSettlementAmount", + "size": 32, + "slot": "5", + "offset": 0 + }, + { + "type": "uint256", + "name": "settledAt", + "size": 32, + "slot": "6", + "offset": 0 + }, + { + "type": "address", + "name": "referrer", + "size": 20, + "slot": "7", + "offset": 0 + } + ] + } + }, + "contracts/storage/AsyncOrderConfiguration.sol:AsyncOrderConfiguration": { + "name": "AsyncOrderConfiguration", + "kind": "library", + "structs": { + "Data": [ + { + "type": "array", + "name": "settlementStrategies", + "value": { + "type": "struct", + "name": "SettlementStrategy.Data", + "members": [ + { + "type": "enum", + "name": "strategyType", + "members": [ + "ONCHAIN", + "PYTH" + ] + }, + { + "type": "uint256", + "name": "settlementDelay" + }, + { + "type": "uint256", + "name": "settlementWindowDuration" + }, + { + "type": "address", + "name": "priceVerificationContract" + }, + { + "type": "bytes32", + "name": "feedId" + }, + { + "type": "string", + "name": "url" + }, + { + "type": "uint256", + "name": "settlementReward" + }, + { + "type": "uint256", + "name": "priceDeviationTolerance" + }, + { + "type": "uint256", + "name": "minimumUsdExchangeAmount" + }, + { + "type": "uint256", + "name": "maxRoundingLoss" + }, + { + "type": "bool", + "name": "disabled" + } + ] + }, + "size": 32, + "slot": "0", + "offset": 0 + } + ] + } + }, + "contracts/storage/MarketConfiguration.sol:MarketConfiguration": { + "name": "MarketConfiguration", + "kind": "library", + "structs": { + "Data": [ + { + "type": "mapping", + "name": "fixedFeeOverrides", + "key": { + "type": "address" + }, + "value": { + "type": "uint256" + }, + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "atomicFixedFee", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "uint256", + "name": "asyncFixedFee", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "uint256", + "name": "utilizationFeeRate", + "size": 32, + "slot": "3", + "offset": 0 + }, + { + "type": "uint256", + "name": "collateralLeverage", + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "int256", + "name": "wrapFixedFee", + "size": 32, + "slot": "5", + "offset": 0 + }, + { + "type": "int256", + "name": "unwrapFixedFee", + "size": 32, + "slot": "6", + "offset": 0 + }, + { + "type": "uint256", + "name": "skewScale", + "size": 32, + "slot": "7", + "offset": 0 + }, + { + "type": "address", + "name": "feeCollector", + "size": 20, + "slot": "8", + "offset": 0 + }, + { + "type": "mapping", + "name": "referrerShare", + "key": { + "type": "address" + }, + "value": { + "type": "uint256" + }, + "size": 32, + "slot": "9", + "offset": 0 + } + ] + } + }, + "contracts/storage/OrderFees.sol:OrderFees": { + "name": "OrderFees", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint256", + "name": "fixedFees", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "utilizationFees", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "int256", + "name": "skewFees", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "int256", + "name": "wrapperFees", + "size": 32, + "slot": "3", + "offset": 0 + } + ] + } + }, + "contracts/storage/Price.sol:Price": { + "name": "Price", + "kind": "library", + "structs": { + "Data": [ + { + "type": "bytes32", + "name": "buyFeedId", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "bytes32", + "name": "sellFeedId", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "uint256", + "name": "strictStalenessTolerance", + "size": 32, + "slot": "2", + "offset": 0 + } + ] + } + }, + "contracts/storage/SettlementStrategy.sol:SettlementStrategy": { + "name": "SettlementStrategy", + "kind": "library", + "structs": { + "Data": [ + { + "type": "enum", + "name": "strategyType", + "members": [ + "ONCHAIN", + "PYTH" + ], + "size": 1, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "settlementDelay", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "uint256", + "name": "settlementWindowDuration", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "address", + "name": "priceVerificationContract", + "size": 20, + "slot": "3", + "offset": 0 + }, + { + "type": "bytes32", + "name": "feedId", + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "string", + "name": "url", + "size": 32, + "slot": "5", + "offset": 0 + }, + { + "type": "uint256", + "name": "settlementReward", + "size": 32, + "slot": "6", + "offset": 0 + }, + { + "type": "uint256", + "name": "priceDeviationTolerance", + "size": 32, + "slot": "7", + "offset": 0 + }, + { + "type": "uint256", + "name": "minimumUsdExchangeAmount", + "size": 32, + "slot": "8", + "offset": 0 + }, + { + "type": "uint256", + "name": "maxRoundingLoss", + "size": 32, + "slot": "9", + "offset": 0 + }, + { + "type": "bool", + "name": "disabled", + "size": 1, + "slot": "10", + "offset": 0 + } + ] + } + }, + "contracts/storage/SpotMarketFactory.sol:SpotMarketFactory": { + "name": "SpotMarketFactory", + "kind": "library", + "structs": { + "Data": [ + { + "type": "address", + "name": "usdToken", + "size": 20, + "slot": "0", + "offset": 0 + }, + { + "type": "address", + "name": "oracle", + "size": 20, + "slot": "1", + "offset": 0 + }, + { + "type": "address", + "name": "synthetix", + "size": 20, + "slot": "2", + "offset": 0 + }, + { + "type": "address", + "name": "synthImplementation", + "size": 20, + "slot": "3", + "offset": 0 + }, + { + "type": "mapping", + "name": "marketOwners", + "key": { + "type": "uint128" + }, + "value": { + "type": "address" + }, + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "mapping", + "name": "nominatedMarketOwners", + "key": { + "type": "uint128" + }, + "value": { + "type": "address" + }, + "size": 32, + "slot": "5", + "offset": 0 + } + ] + } + }, + "contracts/storage/Wrapper.sol:Wrapper": { + "name": "Wrapper", + "kind": "library", + "structs": { + "Data": [ + { + "type": "address", + "name": "wrapCollateralType", + "size": 20, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "maxWrappableAmount", + "size": 32, + "slot": "1", + "offset": 0 + } + ] + } + } +} diff --git a/markets/spot-market/storage.dump.sol b/markets/spot-market/storage.dump.sol deleted file mode 100644 index 8e0a632976..0000000000 --- a/markets/spot-market/storage.dump.sol +++ /dev/null @@ -1,423 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.8.11<0.9.0; - -// @custom:artifact @synthetixio/core-contracts/contracts/ownership/OwnableStorage.sol:OwnableStorage -library OwnableStorage { - bytes32 private constant _SLOT_OWNABLE_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.Ownable")); - struct Data { - address owner; - address nominatedOwner; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_OWNABLE_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/proxy/ProxyStorage.sol:ProxyStorage -contract ProxyStorage { - bytes32 private constant _SLOT_PROXY_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.Proxy")); - struct ProxyStore { - address implementation; - bool simulatingUpgrade; - } - function _proxyStore() internal pure returns (ProxyStore storage store) { - bytes32 s = _SLOT_PROXY_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/token/ERC20Storage.sol:ERC20Storage -library ERC20Storage { - bytes32 private constant _SLOT_ERC20_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.ERC20")); - struct Data { - string name; - string symbol; - uint8 decimals; - mapping(address => uint256) balanceOf; - mapping(address => mapping(address => uint256)) allowance; - uint256 totalSupply; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_ERC20_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/DecimalMath.sol:DecimalMath -library DecimalMath { - uint256 public constant UNIT = 1e18; - int256 public constant UNIT_INT = int256(UNIT); - uint128 public constant UNIT_UINT128 = uint128(UNIT); - int128 public constant UNIT_INT128 = int128(UNIT_INT); - uint256 public constant UNIT_PRECISE = 1e27; - int256 public constant UNIT_PRECISE_INT = int256(UNIT_PRECISE); - int128 public constant UNIT_PRECISE_INT128 = int128(UNIT_PRECISE_INT); - uint256 public constant PRECISION_FACTOR = 9; -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/ERC2771Context.sol:ERC2771Context -library ERC2771Context { - address private constant TRUSTED_FORWARDER = 0xE2C5658cC5C448B48141168f3e475dF8f65A1e3e; -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/SetUtil.sol:SetUtil -library SetUtil { - struct UintSet { - Bytes32Set raw; - } - struct AddressSet { - Bytes32Set raw; - } - struct Bytes32Set { - bytes32[] _values; - mapping(bytes32 => uint256) _positions; - } -} - -// @custom:artifact @synthetixio/core-modules/contracts/modules/DecayTokenModule.sol:DecayTokenModule -contract DecayTokenModule { - uint256 private constant SECONDS_PER_YEAR = 31536000; -} - -// @custom:artifact @synthetixio/core-modules/contracts/modules/TokenModule.sol:TokenModule -contract TokenModule { - bytes32 internal constant _INITIALIZED_NAME = "TokenModule"; -} - -// @custom:artifact @synthetixio/core-modules/contracts/storage/AssociatedSystem.sol:AssociatedSystem -library AssociatedSystem { - bytes32 public constant KIND_ERC20 = "erc20"; - bytes32 public constant KIND_ERC721 = "erc721"; - bytes32 public constant KIND_UNMANAGED = "unmanaged"; - struct Data { - address proxy; - address impl; - bytes32 kind; - } - function load(bytes32 id) internal pure returns (Data storage store) { - bytes32 s = keccak256(abi.encode("io.synthetix.core-modules.AssociatedSystem", id)); - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-modules/contracts/storage/DecayToken.sol:DecayToken -library DecayToken { - bytes32 private constant _SLOT_DECAY_TOKEN_STORAGE = keccak256(abi.encode("io.synthetix.core-modules.DecayToken")); - struct Data { - uint256 decayRate; - uint256 epochStart; - uint256 totalSupplyAtEpochStart; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_DECAY_TOKEN_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-modules/contracts/storage/FeatureFlag.sol:FeatureFlag -library FeatureFlag { - struct Data { - bytes32 name; - bool allowAll; - bool denyAll; - SetUtil.AddressSet permissionedAddresses; - address[] deniers; - } - function load(bytes32 featureName) internal pure returns (Data storage store) { - bytes32 s = keccak256(abi.encode("io.synthetix.core-modules.FeatureFlag", featureName)); - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-modules/contracts/storage/Initialized.sol:Initialized -library Initialized { - struct Data { - bool initialized; - } - function load(bytes32 id) internal pure returns (Data storage store) { - bytes32 s = keccak256(abi.encode("io.synthetix.code-modules.Initialized", id)); - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/interfaces/external/IPyth.sol:PythStructs -contract PythStructs { - struct Price { - int64 price; - uint64 conf; - int32 expo; - uint256 publishTime; - } - struct PriceFeed { - bytes32 id; - Price price; - Price emaPrice; - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/ChainlinkNode.sol:ChainlinkNode -library ChainlinkNode { - uint256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/ReducerNode.sol:ReducerNode -library ReducerNode { - enum Operations { - RECENT, - MIN, - MAX, - MEAN, - MEDIAN, - MUL, - DIV, - MULDECIMAL, - DIVDECIMAL - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/UniswapNode.sol:UniswapNode -library UniswapNode { - uint8 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/pyth/PythNode.sol:PythNode -library PythNode { - int256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/pyth/PythOffchainLookupNode.sol:PythOffchainLookupNode -library PythOffchainLookupNode { - int256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/storage/NodeDefinition.sol:NodeDefinition -library NodeDefinition { - enum NodeType { - NONE, - REDUCER, - EXTERNAL, - CHAINLINK, - UNISWAP, - PYTH, - PRICE_DEVIATION_CIRCUIT_BREAKER, - STALENESS_CIRCUIT_BREAKER, - CONSTANT, - PYTH_OFFCHAIN_LOOKUP - } - struct Data { - NodeType nodeType; - bytes parameters; - bytes32[] parents; - } - function load(bytes32 id) internal pure returns (Data storage node) { - bytes32 s = keccak256(abi.encode("io.synthetix.oracle-manager.Node", id)); - assembly { - node.slot := s - } - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/storage/NodeOutput.sol:NodeOutput -library NodeOutput { - struct Data { - int256 price; - uint256 timestamp; - uint256 __slotAvailableForFutureUse1; - uint256 __slotAvailableForFutureUse2; - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/utils/TickMath.sol:TickMath -library TickMath { - int24 internal constant MIN_TICK = -887272; - int24 internal constant MAX_TICK = -MIN_TICK; - uint160 internal constant MIN_SQRT_RATIO = 4295128739; - uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342; -} - -// @custom:artifact contracts/modules/SpotMarketFactoryModule.sol:SpotMarketFactoryModule -contract SpotMarketFactoryModule { - bytes32 private constant _CREATE_SYNTH_FEATURE_FLAG = "createSynth"; - uint8 private constant _SYNTH_IMPLEMENTATION_DECIMALS = 18; -} - -// @custom:artifact contracts/storage/AsyncOrder.sol:AsyncOrder -library AsyncOrder { - struct Data { - uint256 totalEscrowedSynthShares; - uint128 totalClaims; - } - function load(uint128 marketId) internal pure returns (Data storage store) { - bytes32 s = keccak256(abi.encode("io.synthetix.spot-market.AsyncOrder", marketId)); - assembly { - store.slot := s - } - } -} - -// @custom:artifact contracts/storage/AsyncOrderClaim.sol:AsyncOrderClaim -library AsyncOrderClaim { - struct Data { - uint128 id; - address owner; - Transaction.Type orderType; - uint256 amountEscrowed; - uint256 settlementStrategyId; - uint256 commitmentTime; - uint256 minimumSettlementAmount; - uint256 settledAt; - address referrer; - } - function load(uint128 marketId, uint128 claimId) internal pure returns (Data storage store) { - bytes32 s = keccak256(abi.encode("io.synthetix.spot-market.AsyncOrderClaim", marketId, claimId)); - assembly { - store.slot := s - } - } -} - -// @custom:artifact contracts/storage/AsyncOrderConfiguration.sol:AsyncOrderConfiguration -library AsyncOrderConfiguration { - struct Data { - SettlementStrategy.Data[] settlementStrategies; - } - function load(uint128 marketId) internal pure returns (Data storage asyncOrderConfiguration) { - bytes32 s = keccak256(abi.encode("io.synthetix.spot-market.AsyncOrderConfiguration", marketId)); - assembly { - asyncOrderConfiguration.slot := s - } - } -} - -// @custom:artifact contracts/storage/MarketConfiguration.sol:MarketConfiguration -library MarketConfiguration { - struct Data { - mapping(address => uint256) fixedFeeOverrides; - uint256 atomicFixedFee; - uint256 asyncFixedFee; - uint256 utilizationFeeRate; - uint256 collateralLeverage; - int256 wrapFixedFee; - int256 unwrapFixedFee; - uint256 skewScale; - address feeCollector; - mapping(address => uint256) referrerShare; - } - function load(uint128 marketId) internal pure returns (Data storage marketConfig) { - bytes32 s = keccak256(abi.encode("io.synthetix.spot-market.Fee", marketId)); - assembly { - marketConfig.slot := s - } - } -} - -// @custom:artifact contracts/storage/OrderFees.sol:OrderFees -library OrderFees { - struct Data { - uint256 fixedFees; - uint256 utilizationFees; - int256 skewFees; - int256 wrapperFees; - } -} - -// @custom:artifact contracts/storage/Price.sol:Price -library Price { - enum Tolerance { - DEFAULT, - STRICT - } - struct Data { - bytes32 buyFeedId; - bytes32 sellFeedId; - uint256 strictStalenessTolerance; - } - function load(uint128 marketId) internal pure returns (Data storage price) { - bytes32 s = keccak256(abi.encode("io.synthetix.spot-market.Price", marketId)); - assembly { - price.slot := s - } - } -} - -// @custom:artifact contracts/storage/SettlementStrategy.sol:SettlementStrategy -library SettlementStrategy { - enum Type { - ONCHAIN, - PYTH - } - struct Data { - Type strategyType; - uint256 settlementDelay; - uint256 settlementWindowDuration; - address priceVerificationContract; - bytes32 feedId; - string url; - uint256 settlementReward; - uint256 priceDeviationTolerance; - uint256 minimumUsdExchangeAmount; - uint256 maxRoundingLoss; - bool disabled; - } -} - -// @custom:artifact contracts/storage/SpotMarketFactory.sol:SpotMarketFactory -library SpotMarketFactory { - bytes32 private constant _SLOT_SPOT_MARKET_FACTORY = keccak256(abi.encode("io.synthetix.spot-market.SpotMarketFactory")); - struct Data { - address usdToken; - address oracle; - address synthetix; - address synthImplementation; - mapping(uint128 => address) marketOwners; - mapping(uint128 => address) nominatedMarketOwners; - } - function load() internal pure returns (Data storage spotMarketFactory) { - bytes32 s = _SLOT_SPOT_MARKET_FACTORY; - assembly { - spotMarketFactory.slot := s - } - } -} - -// @custom:artifact contracts/storage/Wrapper.sol:Wrapper -library Wrapper { - struct Data { - address wrapCollateralType; - uint256 maxWrappableAmount; - } - function load(uint128 marketId) internal pure returns (Data storage wrapper) { - bytes32 s = keccak256(abi.encode("io.synthetix.spot-market.Wrapper", marketId)); - assembly { - wrapper.slot := s - } - } -} - -// @custom:artifact contracts/utils/TransactionUtil.sol:Transaction -library Transaction { - enum Type { - NULL, - BUY, - SELL, - ASYNC_BUY, - ASYNC_SELL, - WRAP, - UNWRAP - } -} diff --git a/package.json b/package.json index 0910dfa9fa..e897f08170 100644 --- a/package.json +++ b/package.json @@ -21,9 +21,10 @@ "build:ts": "yarn workspaces foreach --all --topological-dev --verbose run build:ts", "build": "CANNON_REGISTRY_PRIORITY=local yarn workspaces foreach --all --topological-dev --verbose run build", "size-contracts": "yarn workspaces foreach --all --verbose run size-contracts", + "storage:dump": "yarn workspaces foreach --all --verbose run storage:dump", "storage:verify": "yarn workspaces foreach --all --verbose run storage:verify", "build:contracts": "yarn workspaces foreach --all --topological-dev --verbose run build:contracts", - "check:storage": "yarn workspaces foreach --all --verbose run check:storage", + "check:storage": "yarn workspaces foreach --all --topological-dev --verbose run check:storage", "test": "CANNON_REGISTRY_PRIORITY=local yarn workspaces foreach --all --parallel --verbose run test", "coverage": "yarn workspaces foreach --all --verbose run coverage", "lint:progress": "ESLINT_PROGRESS=true eslint --max-warnings=0 .", @@ -47,6 +48,7 @@ "docgen:contracts": "yarn clean && yarn workspaces foreach --all --verbose run docgen && yarn workspace @synthetixio/docgen run docgen:contracts", "subgraphgen": "yarn workspaces foreach --all --verbose run subgraphgen", "check-staged": "lint-staged", + "copy-storage": "bash -c 'for f in $(find . -name 'storage.new.dump.json'); do cp $f $(dirname $f)/storage.dump.json; git add $(dirname $f)/storage.dump.json; done'", "changed": "lerna changed --long", "audit": "yarn npm audit --all --recursive --severity high" }, @@ -85,7 +87,8 @@ "hardhat-gas-reporter/eth-gas-reporter": "git://github.com/dbeal-eth/eth-gas-reporter.git#fix-catch-errors" }, "pre-commit": [ - "check-staged" + "check-staged", + "copy-storage" ], "lint-staged": { "*.js": [ diff --git a/protocol/governance/package.json b/protocol/governance/package.json index 074f3ad381..281ba536ef 100644 --- a/protocol/governance/package.json +++ b/protocol/governance/package.json @@ -6,11 +6,12 @@ "scripts": { "clean": "hardhat clean && rm -rf contracts/generated", "build": "yarn build:contracts", - "storage:verify": "hardhat compile --force && hardhat storage:verify", - "build:contracts": "hardhat compile --force && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "build:contracts": "hardhat compile --force && yarn storage:dump && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "storage:dump": "hardhat storage:dump --output storage.new.dump.json", + "storage:verify": " hardhat storage:verify", "generate-testable": "rm -rf contracts/generated && hardhat generate-testable", "build-testable": "CANNON_REGISTRY_PRIORITY=local hardhat cannon:build cannonfile.test.toml", - "check:storage": "git diff --exit-code storage.dump.sol", + "check:storage": "diff -uw storage.dump.json storage.new.dump.json", "test": "yarn build-testable && hardhat test", "coverage": "yarn build && hardhat coverage --network hardhat", "compile-contracts": "hardhat compile", diff --git a/protocol/governance/storage.dump.json b/protocol/governance/storage.dump.json new file mode 100644 index 0000000000..d7763f8ff0 --- /dev/null +++ b/protocol/governance/storage.dump.json @@ -0,0 +1,443 @@ +{ + "contracts/storage/Ballot.sol:Ballot": { + "name": "Ballot", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint256", + "name": "votingPower", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "array", + "name": "votedCandidates", + "value": { + "type": "address" + }, + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "array", + "name": "amounts", + "value": { + "type": "uint256" + }, + "size": 32, + "slot": "2", + "offset": 0 + } + ] + } + }, + "contracts/storage/Council.sol:Council": { + "name": "Council", + "kind": "library", + "structs": { + "Data": [ + { + "type": "bool", + "name": "initialized", + "size": 1, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "currentElectionId", + "size": 32, + "slot": "1", + "offset": 0 + } + ] + } + }, + "contracts/storage/CouncilMembers.sol:CouncilMembers": { + "name": "CouncilMembers", + "kind": "library", + "structs": { + "Data": [ + { + "type": "address", + "name": "councilToken", + "size": 20, + "slot": "0", + "offset": 0 + }, + { + "type": "struct", + "name": "councilMembers", + "members": [ + { + "type": "struct", + "name": "raw", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + } + ], + "size": 96, + "slot": "1", + "offset": 0 + } + ] + } + }, + "contracts/storage/CrossChainDebtShare.sol:CrossChainDebtShare": { + "name": "CrossChainDebtShare", + "kind": "library", + "structs": { + "Data": [ + { + "type": "bytes32", + "name": "merkleRoot", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "merkleRootBlockNumber", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "mapping", + "name": "debtShares", + "key": { + "type": "address" + }, + "value": { + "type": "uint256" + }, + "size": 32, + "slot": "2", + "offset": 0 + } + ] + } + }, + "contracts/storage/Election.sol:Election": { + "name": "Election", + "kind": "library", + "structs": { + "Data": [ + { + "type": "bool", + "name": "evaluated", + "size": 1, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "numEvaluatedBallots", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "struct", + "name": "nominees", + "members": [ + { + "type": "struct", + "name": "raw", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + } + ], + "size": 96, + "slot": "2", + "offset": 0 + }, + { + "type": "struct", + "name": "winners", + "members": [ + { + "type": "struct", + "name": "raw", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + } + ], + "size": 96, + "slot": "5", + "offset": 0 + }, + { + "type": "struct", + "name": "ballotPtrs", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ], + "size": 64, + "slot": "8", + "offset": 0 + }, + { + "type": "mapping", + "name": "candidateVoteTotals", + "key": { + "type": "address" + }, + "value": { + "type": "uint256" + }, + "size": 32, + "slot": "10", + "offset": 0 + } + ] + } + }, + "contracts/storage/ElectionSettings.sol:ElectionSettings": { + "name": "ElectionSettings", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint8", + "name": "epochSeatCount", + "size": 1, + "slot": "0", + "offset": 0 + }, + { + "type": "uint8", + "name": "minimumActiveMembers", + "size": 1, + "slot": "0", + "offset": 1 + }, + { + "type": "uint64", + "name": "epochDuration", + "size": 8, + "slot": "0", + "offset": 2 + }, + { + "type": "uint64", + "name": "nominationPeriodDuration", + "size": 8, + "slot": "0", + "offset": 10 + }, + { + "type": "uint64", + "name": "votingPeriodDuration", + "size": 8, + "slot": "0", + "offset": 18 + }, + { + "type": "uint64", + "name": "maxDateAdjustmentTolerance", + "size": 8, + "slot": "1", + "offset": 0 + } + ] + } + }, + "contracts/storage/Epoch.sol:Epoch": { + "name": "Epoch", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint64", + "name": "startDate", + "size": 8, + "slot": "0", + "offset": 0 + }, + { + "type": "uint64", + "name": "nominationPeriodStartDate", + "size": 8, + "slot": "0", + "offset": 8 + }, + { + "type": "uint64", + "name": "votingPeriodStartDate", + "size": 8, + "slot": "0", + "offset": 16 + }, + { + "type": "uint64", + "name": "endDate", + "size": 8, + "slot": "0", + "offset": 24 + } + ] + } + }, + "contracts/storage/SnapshotVotePower.sol:SnapshotVotePower": { + "name": "SnapshotVotePower", + "kind": "library", + "structs": { + "Data": [ + { + "type": "bool", + "name": "enabled", + "size": 1, + "slot": "0", + "offset": 0 + }, + { + "type": "enum", + "name": "weight", + "members": [ + "Sqrt", + "Linear", + "Scaled" + ], + "size": 1, + "slot": "0", + "offset": 1 + }, + { + "type": "uint256", + "name": "scale", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "mapping", + "name": "epochs", + "key": { + "type": "uint128" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "uint128", + "name": "snapshotId" + }, + { + "type": "mapping", + "name": "recordedVotingPower", + "key": { + "type": "address" + }, + "value": { + "type": "uint256" + } + } + ] + }, + "size": 32, + "slot": "2", + "offset": 0 + } + ] + } + }, + "contracts/storage/SnapshotVotePowerEpoch.sol:SnapshotVotePowerEpoch": { + "name": "SnapshotVotePowerEpoch", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint128", + "name": "snapshotId", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "mapping", + "name": "recordedVotingPower", + "key": { + "type": "address" + }, + "value": { + "type": "uint256" + }, + "size": 32, + "slot": "1", + "offset": 0 + } + ] + } + } +} diff --git a/protocol/governance/storage.dump.sol b/protocol/governance/storage.dump.sol deleted file mode 100644 index ba95f84e44..0000000000 --- a/protocol/governance/storage.dump.sol +++ /dev/null @@ -1,380 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.0; - -// @custom:artifact @synthetixio/core-contracts/contracts/ownership/OwnableStorage.sol:OwnableStorage -library OwnableStorage { - bytes32 private constant _SLOT_OWNABLE_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.Ownable")); - struct Data { - address owner; - address nominatedOwner; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_OWNABLE_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/proxy/ProxyStorage.sol:ProxyStorage -contract ProxyStorage { - bytes32 private constant _SLOT_PROXY_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.Proxy")); - struct ProxyStore { - address implementation; - bool simulatingUpgrade; - } - function _proxyStore() internal pure returns (ProxyStore storage store) { - bytes32 s = _SLOT_PROXY_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/token/ERC721EnumerableStorage.sol:ERC721EnumerableStorage -library ERC721EnumerableStorage { - bytes32 private constant _SLOT_ERC721_ENUMERABLE_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.ERC721Enumerable")); - struct Data { - mapping(uint256 => uint256) ownedTokensIndex; - mapping(uint256 => uint256) allTokensIndex; - mapping(address => mapping(uint256 => uint256)) ownedTokens; - uint256[] allTokens; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_ERC721_ENUMERABLE_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/token/ERC721Storage.sol:ERC721Storage -library ERC721Storage { - bytes32 private constant _SLOT_ERC721_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.ERC721")); - struct Data { - string name; - string symbol; - string baseTokenURI; - mapping(uint256 => address) ownerOf; - mapping(address => uint256) balanceOf; - mapping(uint256 => address) tokenApprovals; - mapping(address => mapping(address => bool)) operatorApprovals; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_ERC721_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/ERC2771Context.sol:ERC2771Context -library ERC2771Context { - address private constant TRUSTED_FORWARDER = 0xE2C5658cC5C448B48141168f3e475dF8f65A1e3e; -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/SetUtil.sol:SetUtil -library SetUtil { - struct UintSet { - Bytes32Set raw; - } - struct AddressSet { - Bytes32Set raw; - } - struct Bytes32Set { - bytes32[] _values; - mapping(bytes32 => uint256) _positions; - } -} - -// @custom:artifact @synthetixio/core-modules/contracts/interfaces/IWormhole.sol:IWormhole -interface IWormhole { - struct GuardianSet { - address[] keys; - uint32 expirationTime; - } - struct Signature { - bytes32 r; - bytes32 s; - uint8 v; - uint8 guardianIndex; - } - struct VM { - uint8 version; - uint32 timestamp; - uint32 nonce; - uint16 emitterChainId; - bytes32 emitterAddress; - uint64 sequence; - uint8 consistencyLevel; - bytes payload; - uint32 guardianSetIndex; - Signature[] signatures; - bytes32 hash; - } - struct ContractUpgrade { - bytes32 module; - uint8 action; - uint16 chain; - address newContract; - } - struct GuardianSetUpgrade { - bytes32 module; - uint8 action; - uint16 chain; - GuardianSet newGuardianSet; - uint32 newGuardianSetIndex; - } - struct SetMessageFee { - bytes32 module; - uint8 action; - uint16 chain; - uint256 messageFee; - } - struct TransferFees { - bytes32 module; - uint8 action; - uint16 chain; - uint256 amount; - bytes32 recipient; - } - struct RecoverChainId { - bytes32 module; - uint8 action; - uint256 evmChainId; - uint16 newChainId; - } -} - -// @custom:artifact @synthetixio/core-modules/contracts/interfaces/IWormholeRelayer.sol:IWormholeRelayerDelivery -interface IWormholeRelayerDelivery { - enum DeliveryStatus { - SUCCESS, - RECEIVER_FAILURE - } - enum RefundStatus { - REFUND_SENT, - REFUND_FAIL, - CROSS_CHAIN_REFUND_SENT, - CROSS_CHAIN_REFUND_FAIL_PROVIDER_NOT_SUPPORTED, - CROSS_CHAIN_REFUND_FAIL_NOT_ENOUGH, - NO_REFUND_REQUESTED - } -} - -// @custom:artifact @synthetixio/core-modules/contracts/modules/NftModule.sol:NftModule -contract NftModule { - bytes32 internal constant _INITIALIZED_NAME = "NftModule"; -} - -// @custom:artifact @synthetixio/core-modules/contracts/storage/AssociatedSystem.sol:AssociatedSystem -library AssociatedSystem { - bytes32 public constant KIND_ERC20 = "erc20"; - bytes32 public constant KIND_ERC721 = "erc721"; - bytes32 public constant KIND_UNMANAGED = "unmanaged"; - struct Data { - address proxy; - address impl; - bytes32 kind; - } - function load(bytes32 id) internal pure returns (Data storage store) { - bytes32 s = keccak256(abi.encode("io.synthetix.core-modules.AssociatedSystem", id)); - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-modules/contracts/storage/Initialized.sol:Initialized -library Initialized { - struct Data { - bool initialized; - } - function load(bytes32 id) internal pure returns (Data storage store) { - bytes32 s = keccak256(abi.encode("io.synthetix.code-modules.Initialized", id)); - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-modules/contracts/storage/WormholeCrossChain.sol:WormholeCrossChain -library WormholeCrossChain { - bytes32 private constant _SLOT_WORMHOLE_CROSS_CHAIN = keccak256(abi.encode("io.synthetix.core-modules.WormholeCrossChain")); - struct Data { - address wormholeCore; - address wormholeRelayer; - uint256 gasLimit; - SetUtil.UintSet supportedNetworks; - mapping(uint16 => bytes32) registeredEmitters; - mapping(bytes32 => bool) hasProcessedMessage; - } - function load() internal pure returns (Data storage crossChain) { - bytes32 s = _SLOT_WORMHOLE_CROSS_CHAIN; - assembly { - crossChain.slot := s - } - } -} - -// @custom:artifact contracts/modules/core/ElectionModule.sol:ElectionModule -contract ElectionModule { - uint8 private constant _MAX_BALLOT_SIZE = 1; -} - -// @custom:artifact contracts/modules/core/ElectionModuleSatellite.sol:ElectionModuleSatellite -contract ElectionModuleSatellite { - uint64 internal constant _MOTHERSHIP_CHAIN_ID = 0; -} - -// @custom:artifact contracts/storage/Ballot.sol:Ballot -library Ballot { - struct Data { - uint256 votingPower; - address[] votedCandidates; - uint256[] amounts; - } - function load(uint256 electionId, address voter, uint256 chainId) internal pure returns (Data storage self) { - bytes32 s = keccak256(abi.encode("io.synthetix.governance.Ballot", electionId, voter, chainId)); - assembly { - self.slot := s - } - } -} - -// @custom:artifact contracts/storage/Council.sol:Council -library Council { - bytes32 private constant _SLOT_COUNCIL_STORAGE = keccak256(abi.encode("io.synthetix.governance.Council")); - struct Data { - bool initialized; - uint256 currentElectionId; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_COUNCIL_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact contracts/storage/CouncilMembers.sol:CouncilMembers -library CouncilMembers { - bytes32 private constant _STORAGE_SLOT = keccak256(abi.encode("io.synthetix.governance.CouncilMembers")); - struct Data { - address councilToken; - SetUtil.AddressSet councilMembers; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _STORAGE_SLOT; - assembly { - store.slot := s - } - } -} - -// @custom:artifact contracts/storage/CrossChainDebtShare.sol:CrossChainDebtShare -library CrossChainDebtShare { - struct Data { - bytes32 merkleRoot; - uint256 merkleRootBlockNumber; - mapping(address => uint256) debtShares; - } -} - -// @custom:artifact contracts/storage/Election.sol:Election -library Election { - struct Data { - bool evaluated; - uint256 numEvaluatedBallots; - SetUtil.AddressSet nominees; - SetUtil.AddressSet winners; - SetUtil.Bytes32Set ballotPtrs; - mapping(address => uint256) candidateVoteTotals; - } - function load(uint256 epochIndex) internal pure returns (Data storage election) { - bytes32 s = keccak256(abi.encode("io.synthetix.governance.Election", epochIndex)); - assembly { - election.slot := s - } - } -} - -// @custom:artifact contracts/storage/ElectionSettings.sol:ElectionSettings -library ElectionSettings { - uint64 private constant _MIN_ELECTION_PERIOD_DURATION = 1; - struct Data { - uint8 epochSeatCount; - uint8 minimumActiveMembers; - uint64 epochDuration; - uint64 nominationPeriodDuration; - uint64 votingPeriodDuration; - uint64 maxDateAdjustmentTolerance; - } - function load(uint256 epochIndex) internal pure returns (Data storage settings) { - bytes32 s = keccak256(abi.encode("io.synthetix.governance.ElectionSettings", epochIndex)); - assembly { - settings.slot := s - } - } -} - -// @custom:artifact contracts/storage/Epoch.sol:Epoch -library Epoch { - enum ElectionPeriod { - Administration, - Nomination, - Vote, - Evaluation - } - struct Data { - uint64 startDate; - uint64 nominationPeriodStartDate; - uint64 votingPeriodStartDate; - uint64 endDate; - } - function load(uint256 epochIndex) internal pure returns (Data storage epoch) { - bytes32 s = keccak256(abi.encode("io.synthetix.governance.Epoch", epochIndex)); - assembly { - epoch.slot := s - } - } -} - -// @custom:artifact contracts/storage/SnapshotVotePower.sol:SnapshotVotePower -library SnapshotVotePower { - enum WeightType { - Sqrt, - Linear, - Scaled - } - struct Data { - bool enabled; - SnapshotVotePower.WeightType weight; - uint256 scale; - mapping(uint128 => SnapshotVotePowerEpoch.Data) epochs; - } - function load(address snapshotContract) internal pure returns (Data storage self) { - bytes32 s = keccak256(abi.encode("io.synthetix.governance.SnapshotVotePower", snapshotContract)); - assembly { - self.slot := s - } - } -} - -// @custom:artifact contracts/storage/SnapshotVotePowerEpoch.sol:SnapshotVotePowerEpoch -library SnapshotVotePowerEpoch { - struct Data { - uint128 snapshotId; - mapping(address => uint256) recordedVotingPower; - } -} - -// @custom:artifact contracts/submodules/election/ElectionCredentials.sol:ElectionCredentials -contract ElectionCredentials { - bytes32 internal constant _COUNCIL_NFT_SYSTEM = "councilToken"; -} - -// @custom:artifact contracts/submodules/election/ElectionTally.sol:ElectionTally -contract ElectionTally { - uint16 private constant _DEFAULT_EVALUATION_BATCH_SIZE = 500; -} diff --git a/protocol/oracle-manager/package.json b/protocol/oracle-manager/package.json index 8097f4635d..07f2276d28 100644 --- a/protocol/oracle-manager/package.json +++ b/protocol/oracle-manager/package.json @@ -8,11 +8,12 @@ "scripts": { "clean": "hardhat clean && rm -rf contracts/generated", "build": "yarn build:contracts", - "storage:verify": "hardhat compile --force && hardhat storage:verify", - "build:contracts": "hardhat compile --force && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", - "generate-testable": "rm -rf contracts/generated && hardhat generate-testable", + "build:contracts": "hardhat compile --force && yarn storage:dump && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "storage:dump": "hardhat storage:dump --output storage.new.dump.json", "build-testable": "CANNON_REGISTRY_PRIORITY=local hardhat cannon:build cannonfile.test.toml", - "check:storage": "git diff --exit-code storage.dump.sol", + "check:storage": "diff -uw storage.dump.json storage.new.dump.json", + "storage:verify": " hardhat storage:verify", + "generate-testable": "rm -rf contracts/generated && hardhat generate-testable", "test": "CANNON_REGISTRY_PRIORITY=local hardhat test", "coverage": "hardhat coverage --network hardhat", "compile-contracts": "hardhat compile", diff --git a/protocol/oracle-manager/storage.dump.json b/protocol/oracle-manager/storage.dump.json new file mode 100644 index 0000000000..15ecd82031 --- /dev/null +++ b/protocol/oracle-manager/storage.dump.json @@ -0,0 +1,177 @@ +{ + "contracts/interfaces/external/IPyth.sol:PythStructs": { + "name": "PythStructs", + "kind": "contract", + "structs": { + "Price": [ + { + "type": "int64", + "name": "price", + "size": 8, + "slot": "0", + "offset": 0 + }, + { + "type": "uint64", + "name": "conf", + "size": 8, + "slot": "0", + "offset": 8 + }, + { + "type": "int32", + "name": "expo", + "size": 4, + "slot": "0", + "offset": 16 + }, + { + "type": "uint256", + "name": "publishTime", + "size": 32, + "slot": "1", + "offset": 0 + } + ], + "PriceFeed": [ + { + "type": "bytes32", + "name": "id", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "struct", + "name": "price", + "members": [ + { + "type": "int64", + "name": "price" + }, + { + "type": "uint64", + "name": "conf" + }, + { + "type": "int32", + "name": "expo" + }, + { + "type": "uint256", + "name": "publishTime" + } + ], + "size": 64, + "slot": "1", + "offset": 0 + }, + { + "type": "struct", + "name": "emaPrice", + "members": [ + { + "type": "int64", + "name": "price" + }, + { + "type": "uint64", + "name": "conf" + }, + { + "type": "int32", + "name": "expo" + }, + { + "type": "uint256", + "name": "publishTime" + } + ], + "size": 64, + "slot": "3", + "offset": 0 + } + ] + } + }, + "contracts/storage/NodeDefinition.sol:NodeDefinition": { + "name": "NodeDefinition", + "kind": "library", + "structs": { + "Data": [ + { + "type": "enum", + "name": "nodeType", + "members": [ + "NONE", + "REDUCER", + "EXTERNAL", + "CHAINLINK", + "UNISWAP", + "PYTH", + "PRICE_DEVIATION_CIRCUIT_BREAKER", + "STALENESS_CIRCUIT_BREAKER", + "CONSTANT", + "PYTH_OFFCHAIN_LOOKUP" + ], + "size": 1, + "slot": "0", + "offset": 0 + }, + { + "type": "bytes", + "name": "parameters", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "array", + "name": "parents", + "value": { + "type": "bytes32" + }, + "size": 32, + "slot": "2", + "offset": 0 + } + ] + } + }, + "contracts/storage/NodeOutput.sol:NodeOutput": { + "name": "NodeOutput", + "kind": "library", + "structs": { + "Data": [ + { + "type": "int256", + "name": "price", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "timestamp", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "uint256", + "name": "__slotAvailableForFutureUse1", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "uint256", + "name": "__slotAvailableForFutureUse2", + "size": 32, + "slot": "3", + "offset": 0 + } + ] + } + } +} diff --git a/protocol/oracle-manager/storage.dump.sol b/protocol/oracle-manager/storage.dump.sol deleted file mode 100644 index 2f4e620a11..0000000000 --- a/protocol/oracle-manager/storage.dump.sol +++ /dev/null @@ -1,139 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.8.11<0.9.0; - -// @custom:artifact @synthetixio/core-contracts/contracts/ownership/OwnableStorage.sol:OwnableStorage -library OwnableStorage { - bytes32 private constant _SLOT_OWNABLE_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.Ownable")); - struct Data { - address owner; - address nominatedOwner; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_OWNABLE_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/proxy/ProxyStorage.sol:ProxyStorage -contract ProxyStorage { - bytes32 private constant _SLOT_PROXY_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.Proxy")); - struct ProxyStore { - address implementation; - bool simulatingUpgrade; - } - function _proxyStore() internal pure returns (ProxyStore storage store) { - bytes32 s = _SLOT_PROXY_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/DecimalMath.sol:DecimalMath -library DecimalMath { - uint256 public constant UNIT = 1e18; - int256 public constant UNIT_INT = int256(UNIT); - uint128 public constant UNIT_UINT128 = uint128(UNIT); - int128 public constant UNIT_INT128 = int128(UNIT_INT); - uint256 public constant UNIT_PRECISE = 1e27; - int256 public constant UNIT_PRECISE_INT = int256(UNIT_PRECISE); - int128 public constant UNIT_PRECISE_INT128 = int128(UNIT_PRECISE_INT); - uint256 public constant PRECISION_FACTOR = 9; -} - -// @custom:artifact contracts/interfaces/external/IPyth.sol:PythStructs -contract PythStructs { - struct Price { - int64 price; - uint64 conf; - int32 expo; - uint256 publishTime; - } - struct PriceFeed { - bytes32 id; - Price price; - Price emaPrice; - } -} - -// @custom:artifact contracts/nodes/ChainlinkNode.sol:ChainlinkNode -library ChainlinkNode { - uint256 public constant PRECISION = 18; -} - -// @custom:artifact contracts/nodes/ReducerNode.sol:ReducerNode -library ReducerNode { - enum Operations { - RECENT, - MIN, - MAX, - MEAN, - MEDIAN, - MUL, - DIV, - MULDECIMAL, - DIVDECIMAL - } -} - -// @custom:artifact contracts/nodes/UniswapNode.sol:UniswapNode -library UniswapNode { - uint8 public constant PRECISION = 18; -} - -// @custom:artifact contracts/nodes/pyth/PythNode.sol:PythNode -library PythNode { - int256 public constant PRECISION = 18; -} - -// @custom:artifact contracts/nodes/pyth/PythOffchainLookupNode.sol:PythOffchainLookupNode -library PythOffchainLookupNode { - int256 public constant PRECISION = 18; -} - -// @custom:artifact contracts/storage/NodeDefinition.sol:NodeDefinition -library NodeDefinition { - enum NodeType { - NONE, - REDUCER, - EXTERNAL, - CHAINLINK, - UNISWAP, - PYTH, - PRICE_DEVIATION_CIRCUIT_BREAKER, - STALENESS_CIRCUIT_BREAKER, - CONSTANT, - PYTH_OFFCHAIN_LOOKUP - } - struct Data { - NodeType nodeType; - bytes parameters; - bytes32[] parents; - } - function load(bytes32 id) internal pure returns (Data storage node) { - bytes32 s = keccak256(abi.encode("io.synthetix.oracle-manager.Node", id)); - assembly { - node.slot := s - } - } -} - -// @custom:artifact contracts/storage/NodeOutput.sol:NodeOutput -library NodeOutput { - struct Data { - int256 price; - uint256 timestamp; - uint256 __slotAvailableForFutureUse1; - uint256 __slotAvailableForFutureUse2; - } -} - -// @custom:artifact contracts/utils/TickMath.sol:TickMath -library TickMath { - int24 internal constant MIN_TICK = -887272; - int24 internal constant MAX_TICK = -MIN_TICK; - uint160 internal constant MIN_SQRT_RATIO = 4295128739; - uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342; -} diff --git a/protocol/synthetix/package.json b/protocol/synthetix/package.json index 66eb32e983..d725acf483 100644 --- a/protocol/synthetix/package.json +++ b/protocol/synthetix/package.json @@ -8,11 +8,12 @@ "scripts": { "clean": "hardhat clean && rm -rf contracts/generated", "build": "yarn build:contracts", - "storage:verify": "hardhat compile --force && hardhat storage:verify", - "build:contracts": "hardhat compile --force && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "build:contracts": "hardhat compile --force && yarn storage:dump && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "storage:dump": "hardhat storage:dump --output storage.new.dump.json", + "storage:verify": " hardhat storage:verify", "generate-testable": "rm -rf contracts/generated && hardhat generate-testable", "build-testable": "CANNON_REGISTRY_PRIORITY=local hardhat cannon:build cannonfile.test.toml", - "check:storage": "git diff --exit-code storage.dump.sol", + "check:storage": "diff -uw storage.dump.json storage.new.dump.json", "test": "CANNON_REGISTRY_PRIORITY=local hardhat test", "coverage": "hardhat coverage --network hardhat", "compile-contracts": "hardhat compile", diff --git a/protocol/synthetix/storage.dump.json b/protocol/synthetix/storage.dump.json new file mode 100644 index 0000000000..a4fcb1bdf7 --- /dev/null +++ b/protocol/synthetix/storage.dump.json @@ -0,0 +1,2183 @@ +{ + "contracts/storage/Account.sol:Account": { + "name": "Account", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint128", + "name": "id", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "struct", + "name": "rbac", + "members": [ + { + "type": "address", + "name": "owner" + }, + { + "type": "mapping", + "name": "permissions", + "key": { + "type": "address" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + } + }, + { + "type": "struct", + "name": "permissionAddresses", + "members": [ + { + "type": "struct", + "name": "raw", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + } + ] + } + ], + "size": 192, + "slot": "1", + "offset": 0 + }, + { + "type": "uint64", + "name": "lastInteraction", + "size": 8, + "slot": "7", + "offset": 0 + }, + { + "type": "uint64", + "name": "__slotAvailableForFutureUse", + "size": 8, + "slot": "7", + "offset": 8 + }, + { + "type": "uint128", + "name": "__slot2AvailableForFutureUse", + "size": 16, + "slot": "7", + "offset": 16 + }, + { + "type": "mapping", + "name": "collaterals", + "key": { + "type": "address" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "uint256", + "name": "amountAvailableForDelegationD18" + }, + { + "type": "struct", + "name": "pools", + "members": [ + { + "type": "struct", + "name": "raw", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + } + ] + }, + { + "type": "array", + "name": "locks", + "value": { + "type": "struct", + "name": "CollateralLock.Data", + "members": [ + { + "type": "uint128", + "name": "amountD18" + }, + { + "type": "uint64", + "name": "lockExpirationTime" + } + ] + } + } + ] + }, + "size": 32, + "slot": "8", + "offset": 0 + } + ] + } + }, + "contracts/storage/AccountRBAC.sol:AccountRBAC": { + "name": "AccountRBAC", + "kind": "library", + "structs": { + "Data": [ + { + "type": "address", + "name": "owner", + "size": 20, + "slot": "0", + "offset": 0 + }, + { + "type": "mapping", + "name": "permissions", + "key": { + "type": "address" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + }, + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "struct", + "name": "permissionAddresses", + "members": [ + { + "type": "struct", + "name": "raw", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + } + ], + "size": 96, + "slot": "2", + "offset": 0 + } + ] + } + }, + "contracts/storage/Collateral.sol:Collateral": { + "name": "Collateral", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint256", + "name": "amountAvailableForDelegationD18", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "struct", + "name": "pools", + "members": [ + { + "type": "struct", + "name": "raw", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + } + ], + "size": 96, + "slot": "1", + "offset": 0 + }, + { + "type": "array", + "name": "locks", + "value": { + "type": "struct", + "name": "CollateralLock.Data", + "members": [ + { + "type": "uint128", + "name": "amountD18" + }, + { + "type": "uint64", + "name": "lockExpirationTime" + } + ] + }, + "size": 32, + "slot": "4", + "offset": 0 + } + ] + } + }, + "contracts/storage/CollateralConfiguration.sol:CollateralConfiguration": { + "name": "CollateralConfiguration", + "kind": "library", + "structs": { + "Data": [ + { + "type": "bool", + "name": "depositingEnabled", + "size": 1, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "issuanceRatioD18", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "uint256", + "name": "liquidationRatioD18", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "uint256", + "name": "liquidationRewardD18", + "size": 32, + "slot": "3", + "offset": 0 + }, + { + "type": "bytes32", + "name": "oracleNodeId", + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "address", + "name": "tokenAddress", + "size": 20, + "slot": "5", + "offset": 0 + }, + { + "type": "uint256", + "name": "minDelegationD18", + "size": 32, + "slot": "6", + "offset": 0 + } + ] + } + }, + "contracts/storage/CollateralLock.sol:CollateralLock": { + "name": "CollateralLock", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint128", + "name": "amountD18", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "uint64", + "name": "lockExpirationTime", + "size": 8, + "slot": "0", + "offset": 16 + } + ] + } + }, + "contracts/storage/Config.sol:Config": { + "name": "Config", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint256", + "name": "__unused", + "size": 32, + "slot": "0", + "offset": 0 + } + ] + } + }, + "contracts/storage/CrossChain.sol:CrossChain": { + "name": "CrossChain", + "kind": "library", + "structs": { + "Data": [ + { + "type": "address", + "name": "ccipRouter", + "size": 20, + "slot": "0", + "offset": 0 + }, + { + "type": "struct", + "name": "supportedNetworks", + "members": [ + { + "type": "struct", + "name": "raw", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + } + ], + "size": 96, + "slot": "1", + "offset": 0 + }, + { + "type": "mapping", + "name": "ccipChainIdToSelector", + "key": { + "type": "uint64" + }, + "value": { + "type": "uint64" + }, + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "mapping", + "name": "ccipSelectorToChainId", + "key": { + "type": "uint64" + }, + "value": { + "type": "uint64" + }, + "size": 32, + "slot": "5", + "offset": 0 + } + ] + } + }, + "contracts/storage/Distribution.sol:Distribution": { + "name": "Distribution", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint128", + "name": "totalSharesD18", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "int128", + "name": "valuePerShareD27", + "size": 16, + "slot": "0", + "offset": 16 + }, + { + "type": "mapping", + "name": "actorInfo", + "key": { + "type": "bytes32" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "uint128", + "name": "sharesD18" + }, + { + "type": "int128", + "name": "lastValuePerShareD27" + } + ] + }, + "size": 32, + "slot": "1", + "offset": 0 + } + ] + } + }, + "contracts/storage/DistributionActor.sol:DistributionActor": { + "name": "DistributionActor", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint128", + "name": "sharesD18", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "int128", + "name": "lastValuePerShareD27", + "size": 16, + "slot": "0", + "offset": 16 + } + ] + } + }, + "contracts/storage/Market.sol:Market": { + "name": "Market", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint128", + "name": "id", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "address", + "name": "marketAddress", + "size": 20, + "slot": "1", + "offset": 0 + }, + { + "type": "int128", + "name": "netIssuanceD18", + "size": 16, + "slot": "2", + "offset": 0 + }, + { + "type": "int128", + "name": "creditCapacityD18", + "size": 16, + "slot": "2", + "offset": 16 + }, + { + "type": "int128", + "name": "lastDistributedMarketBalanceD18", + "size": 16, + "slot": "3", + "offset": 0 + }, + { + "type": "struct", + "name": "inRangePools", + "members": [ + { + "type": "uint128", + "name": "idCount" + }, + { + "type": "array", + "name": "nodes", + "value": { + "type": "struct", + "name": "Node", + "members": [ + { + "type": "uint128", + "name": "id" + }, + { + "type": "int128", + "name": "priority" + } + ] + } + }, + { + "type": "mapping", + "name": "indices", + "key": { + "type": "uint128" + }, + "value": { + "type": "uint256" + } + } + ], + "size": 96, + "slot": "4", + "offset": 0 + }, + { + "type": "struct", + "name": "outRangePools", + "members": [ + { + "type": "uint128", + "name": "idCount" + }, + { + "type": "array", + "name": "nodes", + "value": { + "type": "struct", + "name": "Node", + "members": [ + { + "type": "uint128", + "name": "id" + }, + { + "type": "int128", + "name": "priority" + } + ] + } + }, + { + "type": "mapping", + "name": "indices", + "key": { + "type": "uint128" + }, + "value": { + "type": "uint256" + } + } + ], + "size": 96, + "slot": "7", + "offset": 0 + }, + { + "type": "struct", + "name": "poolsDebtDistribution", + "members": [ + { + "type": "uint128", + "name": "totalSharesD18" + }, + { + "type": "int128", + "name": "valuePerShareD27" + }, + { + "type": "mapping", + "name": "actorInfo", + "key": { + "type": "bytes32" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "uint128", + "name": "sharesD18" + }, + { + "type": "int128", + "name": "lastValuePerShareD27" + } + ] + } + } + ], + "size": 64, + "slot": "10", + "offset": 0 + }, + { + "type": "mapping", + "name": "pools", + "key": { + "type": "uint128" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "uint128", + "name": "creditCapacityAmountD18" + }, + { + "type": "uint128", + "name": "pendingDebtD18" + } + ] + }, + "size": 32, + "slot": "12", + "offset": 0 + }, + { + "type": "array", + "name": "depositedCollateral", + "value": { + "type": "struct", + "name": "DepositedCollateral", + "members": [ + { + "type": "address", + "name": "collateralType" + }, + { + "type": "uint256", + "name": "amountD18" + } + ] + }, + "size": 32, + "slot": "13", + "offset": 0 + }, + { + "type": "mapping", + "name": "maximumDepositableD18", + "key": { + "type": "address" + }, + "value": { + "type": "uint256" + }, + "size": 32, + "slot": "14", + "offset": 0 + }, + { + "type": "uint32", + "name": "minDelegateTime", + "size": 4, + "slot": "15", + "offset": 0 + }, + { + "type": "uint32", + "name": "__reservedForLater1", + "size": 4, + "slot": "15", + "offset": 4 + }, + { + "type": "uint64", + "name": "__reservedForLater2", + "size": 8, + "slot": "15", + "offset": 8 + }, + { + "type": "uint64", + "name": "__reservedForLater3", + "size": 8, + "slot": "15", + "offset": 16 + }, + { + "type": "uint64", + "name": "__reservedForLater4", + "size": 8, + "slot": "15", + "offset": 24 + }, + { + "type": "uint256", + "name": "minLiquidityRatioD18", + "size": 32, + "slot": "16", + "offset": 0 + } + ], + "DepositedCollateral": [ + { + "type": "address", + "name": "collateralType", + "size": 20, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "amountD18", + "size": 32, + "slot": "1", + "offset": 0 + } + ] + } + }, + "contracts/storage/MarketConfiguration.sol:MarketConfiguration": { + "name": "MarketConfiguration", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint128", + "name": "marketId", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "uint128", + "name": "weightD18", + "size": 16, + "slot": "0", + "offset": 16 + }, + { + "type": "int128", + "name": "maxDebtShareValueD18", + "size": 16, + "slot": "1", + "offset": 0 + } + ] + } + }, + "contracts/storage/MarketCreator.sol:MarketCreator": { + "name": "MarketCreator", + "kind": "library", + "structs": { + "Data": [ + { + "type": "mapping", + "name": "marketIdsForAddress", + "key": { + "type": "address" + }, + "value": { + "type": "array", + "value": { + "type": "uint128" + } + }, + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint128", + "name": "lastCreatedMarketId", + "size": 16, + "slot": "1", + "offset": 0 + } + ] + } + }, + "contracts/storage/MarketPoolInfo.sol:MarketPoolInfo": { + "name": "MarketPoolInfo", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint128", + "name": "creditCapacityAmountD18", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "uint128", + "name": "pendingDebtD18", + "size": 16, + "slot": "0", + "offset": 16 + } + ] + } + }, + "contracts/storage/OracleManager.sol:OracleManager": { + "name": "OracleManager", + "kind": "library", + "structs": { + "Data": [ + { + "type": "address", + "name": "oracleManagerAddress", + "size": 20, + "slot": "0", + "offset": 0 + } + ] + } + }, + "contracts/storage/Pool.sol:Pool": { + "name": "Pool", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint128", + "name": "id", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "string", + "name": "name", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "address", + "name": "owner", + "size": 20, + "slot": "2", + "offset": 0 + }, + { + "type": "address", + "name": "nominatedOwner", + "size": 20, + "slot": "3", + "offset": 0 + }, + { + "type": "uint128", + "name": "totalWeightsD18", + "size": 16, + "slot": "4", + "offset": 0 + }, + { + "type": "int128", + "name": "totalVaultDebtsD18", + "size": 16, + "slot": "4", + "offset": 16 + }, + { + "type": "array", + "name": "marketConfigurations", + "value": { + "type": "struct", + "name": "MarketConfiguration.Data", + "members": [ + { + "type": "uint128", + "name": "marketId" + }, + { + "type": "uint128", + "name": "weightD18" + }, + { + "type": "int128", + "name": "maxDebtShareValueD18" + } + ] + }, + "size": 32, + "slot": "5", + "offset": 0 + }, + { + "type": "struct", + "name": "vaultsDebtDistribution", + "members": [ + { + "type": "uint128", + "name": "totalSharesD18" + }, + { + "type": "int128", + "name": "valuePerShareD27" + }, + { + "type": "mapping", + "name": "actorInfo", + "key": { + "type": "bytes32" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "uint128", + "name": "sharesD18" + }, + { + "type": "int128", + "name": "lastValuePerShareD27" + } + ] + } + } + ], + "size": 64, + "slot": "6", + "offset": 0 + }, + { + "type": "mapping", + "name": "vaults", + "key": { + "type": "address" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "uint256", + "name": "epoch" + }, + { + "type": "bytes32", + "name": "__slotAvailableForFutureUse" + }, + { + "type": "int128", + "name": "_unused_prevTotalDebtD18" + }, + { + "type": "mapping", + "name": "epochData", + "key": { + "type": "uint256" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "int128", + "name": "unconsolidatedDebtD18" + }, + { + "type": "int128", + "name": "totalConsolidatedDebtD18" + }, + { + "type": "struct", + "name": "accountsDebtDistribution", + "members": [ + { + "type": "uint128", + "name": "totalSharesD18" + }, + { + "type": "int128", + "name": "valuePerShareD27" + }, + { + "type": "mapping", + "name": "actorInfo", + "key": { + "type": "bytes32" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "uint128", + "name": "sharesD18" + }, + { + "type": "int128", + "name": "lastValuePerShareD27" + } + ] + } + } + ] + }, + { + "type": "struct", + "name": "collateralAmounts", + "members": [ + { + "type": "uint128", + "name": "totalSharesD18" + }, + { + "type": "int128", + "name": "scaleModifierD27" + }, + { + "type": "mapping", + "name": "sharesD18", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + }, + { + "type": "mapping", + "name": "consolidatedDebtAmountsD18", + "key": { + "type": "uint256" + }, + "value": { + "type": "int256" + } + }, + { + "type": "mapping", + "name": "lastDelegationTime", + "key": { + "type": "uint128" + }, + "value": { + "type": "uint64" + } + } + ] + } + }, + { + "type": "mapping", + "name": "rewards", + "key": { + "type": "bytes32" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "address", + "name": "distributor" + }, + { + "type": "uint128", + "name": "__slotAvailableForFutureUse" + }, + { + "type": "uint128", + "name": "rewardPerShareD18" + }, + { + "type": "mapping", + "name": "claimStatus", + "key": { + "type": "uint256" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "uint128", + "name": "lastRewardPerShareD18" + }, + { + "type": "uint128", + "name": "pendingSendD18" + } + ] + } + }, + { + "type": "int128", + "name": "scheduledValueD18" + }, + { + "type": "uint64", + "name": "start" + }, + { + "type": "uint32", + "name": "duration" + }, + { + "type": "uint32", + "name": "lastUpdate" + }, + { + "type": "int128", + "name": "nextScheduledValueD18" + }, + { + "type": "uint64", + "name": "nextStart" + }, + { + "type": "uint32", + "name": "nextDuration" + } + ] + } + }, + { + "type": "struct", + "name": "rewardIds", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + } + ] + }, + "size": 32, + "slot": "8", + "offset": 0 + }, + { + "type": "uint64", + "name": "lastConfigurationTime", + "size": 8, + "slot": "9", + "offset": 0 + }, + { + "type": "uint64", + "name": "__reserved1", + "size": 8, + "slot": "9", + "offset": 8 + }, + { + "type": "uint64", + "name": "__reserved2", + "size": 8, + "slot": "9", + "offset": 16 + }, + { + "type": "uint64", + "name": "__reserved3", + "size": 8, + "slot": "9", + "offset": 24 + }, + { + "type": "mapping", + "name": "collateralConfigurations", + "key": { + "type": "address" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "uint256", + "name": "collateralLimitD18" + }, + { + "type": "uint256", + "name": "issuanceRatioD18" + } + ] + }, + "size": 32, + "slot": "10", + "offset": 0 + }, + { + "type": "bool", + "name": "collateralDisabledByDefault", + "size": 1, + "slot": "11", + "offset": 0 + }, + { + "type": "struct", + "name": "rewardIds", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ], + "size": 64, + "slot": "12", + "offset": 0 + }, + { + "type": "mapping", + "name": "rewardsToVaults", + "key": { + "type": "bytes32" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "address", + "name": "distributor" + }, + { + "type": "uint128", + "name": "__slotAvailableForFutureUse" + }, + { + "type": "uint128", + "name": "rewardPerShareD18" + }, + { + "type": "mapping", + "name": "claimStatus", + "key": { + "type": "uint256" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "uint128", + "name": "lastRewardPerShareD18" + }, + { + "type": "uint128", + "name": "pendingSendD18" + } + ] + } + }, + { + "type": "int128", + "name": "scheduledValueD18" + }, + { + "type": "uint64", + "name": "start" + }, + { + "type": "uint32", + "name": "duration" + }, + { + "type": "uint32", + "name": "lastUpdate" + }, + { + "type": "int128", + "name": "nextScheduledValueD18" + }, + { + "type": "uint64", + "name": "nextStart" + }, + { + "type": "uint32", + "name": "nextDuration" + } + ] + }, + "size": 32, + "slot": "14", + "offset": 0 + } + ] + } + }, + "contracts/storage/PoolCollateralConfiguration.sol:PoolCollateralConfiguration": { + "name": "PoolCollateralConfiguration", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint256", + "name": "collateralLimitD18", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "issuanceRatioD18", + "size": 32, + "slot": "1", + "offset": 0 + } + ] + } + }, + "contracts/storage/RewardDistribution.sol:RewardDistribution": { + "name": "RewardDistribution", + "kind": "library", + "structs": { + "Data": [ + { + "type": "address", + "name": "distributor", + "size": 20, + "slot": "0", + "offset": 0 + }, + { + "type": "uint128", + "name": "__slotAvailableForFutureUse", + "size": 16, + "slot": "1", + "offset": 0 + }, + { + "type": "uint128", + "name": "rewardPerShareD18", + "size": 16, + "slot": "1", + "offset": 16 + }, + { + "type": "mapping", + "name": "claimStatus", + "key": { + "type": "uint256" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "uint128", + "name": "lastRewardPerShareD18" + }, + { + "type": "uint128", + "name": "pendingSendD18" + } + ] + }, + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "int128", + "name": "scheduledValueD18", + "size": 16, + "slot": "3", + "offset": 0 + }, + { + "type": "uint64", + "name": "start", + "size": 8, + "slot": "3", + "offset": 16 + }, + { + "type": "uint32", + "name": "duration", + "size": 4, + "slot": "3", + "offset": 24 + }, + { + "type": "uint32", + "name": "lastUpdate", + "size": 4, + "slot": "3", + "offset": 28 + }, + { + "type": "int128", + "name": "nextScheduledValueD18", + "size": 16, + "slot": "4", + "offset": 0 + }, + { + "type": "uint64", + "name": "nextStart", + "size": 8, + "slot": "4", + "offset": 16 + }, + { + "type": "uint32", + "name": "nextDuration", + "size": 4, + "slot": "4", + "offset": 24 + } + ] + } + }, + "contracts/storage/RewardDistributionClaimStatus.sol:RewardDistributionClaimStatus": { + "name": "RewardDistributionClaimStatus", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint128", + "name": "lastRewardPerShareD18", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "uint128", + "name": "pendingSendD18", + "size": 16, + "slot": "0", + "offset": 16 + } + ] + } + }, + "contracts/storage/ScalableMapping.sol:ScalableMapping": { + "name": "ScalableMapping", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint128", + "name": "totalSharesD18", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "int128", + "name": "scaleModifierD27", + "size": 16, + "slot": "0", + "offset": 16 + }, + { + "type": "mapping", + "name": "sharesD18", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + }, + "size": 32, + "slot": "1", + "offset": 0 + } + ] + } + }, + "contracts/storage/SystemAccountConfiguration.sol:SystemAccountConfiguration": { + "name": "SystemAccountConfiguration", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint64", + "name": "accountIdOffset", + "size": 8, + "slot": "0", + "offset": 0 + } + ] + } + }, + "contracts/storage/SystemPoolConfiguration.sol:SystemPoolConfiguration": { + "name": "SystemPoolConfiguration", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint256", + "name": "minLiquidityRatioD18", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint128", + "name": "__reservedForFutureUse", + "size": 16, + "slot": "1", + "offset": 0 + }, + { + "type": "uint128", + "name": "preferredPool", + "size": 16, + "slot": "1", + "offset": 16 + }, + { + "type": "struct", + "name": "approvedPools", + "members": [ + { + "type": "struct", + "name": "raw", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + } + ], + "size": 96, + "slot": "2", + "offset": 0 + } + ] + } + }, + "contracts/storage/Vault.sol:Vault": { + "name": "Vault", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint256", + "name": "epoch", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "bytes32", + "name": "__slotAvailableForFutureUse", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "int128", + "name": "_unused_prevTotalDebtD18", + "size": 16, + "slot": "2", + "offset": 0 + }, + { + "type": "mapping", + "name": "epochData", + "key": { + "type": "uint256" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "int128", + "name": "unconsolidatedDebtD18" + }, + { + "type": "int128", + "name": "totalConsolidatedDebtD18" + }, + { + "type": "struct", + "name": "accountsDebtDistribution", + "members": [ + { + "type": "uint128", + "name": "totalSharesD18" + }, + { + "type": "int128", + "name": "valuePerShareD27" + }, + { + "type": "mapping", + "name": "actorInfo", + "key": { + "type": "bytes32" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "uint128", + "name": "sharesD18" + }, + { + "type": "int128", + "name": "lastValuePerShareD27" + } + ] + } + } + ] + }, + { + "type": "struct", + "name": "collateralAmounts", + "members": [ + { + "type": "uint128", + "name": "totalSharesD18" + }, + { + "type": "int128", + "name": "scaleModifierD27" + }, + { + "type": "mapping", + "name": "sharesD18", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + }, + { + "type": "mapping", + "name": "consolidatedDebtAmountsD18", + "key": { + "type": "uint256" + }, + "value": { + "type": "int256" + } + }, + { + "type": "mapping", + "name": "lastDelegationTime", + "key": { + "type": "uint128" + }, + "value": { + "type": "uint64" + } + } + ] + }, + "size": 32, + "slot": "3", + "offset": 0 + }, + { + "type": "mapping", + "name": "rewards", + "key": { + "type": "bytes32" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "address", + "name": "distributor" + }, + { + "type": "uint128", + "name": "__slotAvailableForFutureUse" + }, + { + "type": "uint128", + "name": "rewardPerShareD18" + }, + { + "type": "mapping", + "name": "claimStatus", + "key": { + "type": "uint256" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "uint128", + "name": "lastRewardPerShareD18" + }, + { + "type": "uint128", + "name": "pendingSendD18" + } + ] + } + }, + { + "type": "int128", + "name": "scheduledValueD18" + }, + { + "type": "uint64", + "name": "start" + }, + { + "type": "uint32", + "name": "duration" + }, + { + "type": "uint32", + "name": "lastUpdate" + }, + { + "type": "int128", + "name": "nextScheduledValueD18" + }, + { + "type": "uint64", + "name": "nextStart" + }, + { + "type": "uint32", + "name": "nextDuration" + } + ] + }, + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "struct", + "name": "rewardIds", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ], + "size": 64, + "slot": "5", + "offset": 0 + } + ], + "PositionSelector": [ + { + "type": "uint128", + "name": "accountId", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "uint128", + "name": "poolId", + "size": 16, + "slot": "0", + "offset": 16 + }, + { + "type": "address", + "name": "collateralType", + "size": 20, + "slot": "1", + "offset": 0 + } + ] + } + }, + "contracts/storage/VaultEpoch.sol:VaultEpoch": { + "name": "VaultEpoch", + "kind": "library", + "structs": { + "Data": [ + { + "type": "int128", + "name": "unconsolidatedDebtD18", + "size": 16, + "slot": "0", + "offset": 0 + }, + { + "type": "int128", + "name": "totalConsolidatedDebtD18", + "size": 16, + "slot": "0", + "offset": 16 + }, + { + "type": "struct", + "name": "accountsDebtDistribution", + "members": [ + { + "type": "uint128", + "name": "totalSharesD18" + }, + { + "type": "int128", + "name": "valuePerShareD27" + }, + { + "type": "mapping", + "name": "actorInfo", + "key": { + "type": "bytes32" + }, + "value": { + "type": "struct", + "members": [ + { + "type": "uint128", + "name": "sharesD18" + }, + { + "type": "int128", + "name": "lastValuePerShareD27" + } + ] + } + } + ], + "size": 64, + "slot": "1", + "offset": 0 + }, + { + "type": "struct", + "name": "collateralAmounts", + "members": [ + { + "type": "uint128", + "name": "totalSharesD18" + }, + { + "type": "int128", + "name": "scaleModifierD27" + }, + { + "type": "mapping", + "name": "sharesD18", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ], + "size": 64, + "slot": "3", + "offset": 0 + }, + { + "type": "mapping", + "name": "consolidatedDebtAmountsD18", + "key": { + "type": "uint256" + }, + "value": { + "type": "int256" + }, + "size": 32, + "slot": "5", + "offset": 0 + }, + { + "type": "mapping", + "name": "lastDelegationTime", + "key": { + "type": "uint128" + }, + "value": { + "type": "uint64" + }, + "size": 32, + "slot": "6", + "offset": 0 + } + ] + } + }, + "contracts/utils/CcipClient.sol:CcipClient": { + "name": "CcipClient", + "kind": "library", + "structs": { + "EVMTokenAmount": [ + { + "type": "address", + "name": "token", + "size": 20, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "amount", + "size": 32, + "slot": "1", + "offset": 0 + } + ], + "Any2EVMMessage": [ + { + "type": "bytes32", + "name": "messageId", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint64", + "name": "sourceChainSelector", + "size": 8, + "slot": "1", + "offset": 0 + }, + { + "type": "bytes", + "name": "sender", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "bytes", + "name": "data", + "size": 32, + "slot": "3", + "offset": 0 + }, + { + "type": "array", + "name": "tokenAmounts", + "value": { + "type": "struct", + "name": "EVMTokenAmount", + "members": [ + { + "type": "address", + "name": "token" + }, + { + "type": "uint256", + "name": "amount" + } + ] + }, + "size": 32, + "slot": "4", + "offset": 0 + } + ], + "EVM2AnyMessage": [ + { + "type": "bytes", + "name": "receiver", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "bytes", + "name": "data", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "array", + "name": "tokenAmounts", + "value": { + "type": "struct", + "name": "EVMTokenAmount", + "members": [ + { + "type": "address", + "name": "token" + }, + { + "type": "uint256", + "name": "amount" + } + ] + }, + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "address", + "name": "feeToken", + "size": 20, + "slot": "3", + "offset": 0 + }, + { + "type": "bytes", + "name": "extraArgs", + "size": 32, + "slot": "4", + "offset": 0 + } + ], + "EVMExtraArgsV1": [ + { + "type": "uint256", + "name": "gasLimit", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "bool", + "name": "strict", + "size": 1, + "slot": "1", + "offset": 0 + } + ] + } + } +} diff --git a/protocol/synthetix/storage.dump.sol b/protocol/synthetix/storage.dump.sol deleted file mode 100644 index 358c85733e..0000000000 --- a/protocol/synthetix/storage.dump.sol +++ /dev/null @@ -1,745 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.4; - -// @custom:artifact @synthetixio/core-contracts/contracts/ownership/OwnableStorage.sol:OwnableStorage -library OwnableStorage { - bytes32 private constant _SLOT_OWNABLE_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.Ownable")); - struct Data { - address owner; - address nominatedOwner; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_OWNABLE_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/proxy/ProxyStorage.sol:ProxyStorage -contract ProxyStorage { - bytes32 private constant _SLOT_PROXY_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.Proxy")); - struct ProxyStore { - address implementation; - bool simulatingUpgrade; - } - function _proxyStore() internal pure returns (ProxyStore storage store) { - bytes32 s = _SLOT_PROXY_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/token/ERC20Storage.sol:ERC20Storage -library ERC20Storage { - bytes32 private constant _SLOT_ERC20_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.ERC20")); - struct Data { - string name; - string symbol; - uint8 decimals; - mapping(address => uint256) balanceOf; - mapping(address => mapping(address => uint256)) allowance; - uint256 totalSupply; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_ERC20_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/token/ERC721EnumerableStorage.sol:ERC721EnumerableStorage -library ERC721EnumerableStorage { - bytes32 private constant _SLOT_ERC721_ENUMERABLE_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.ERC721Enumerable")); - struct Data { - mapping(uint256 => uint256) ownedTokensIndex; - mapping(uint256 => uint256) allTokensIndex; - mapping(address => mapping(uint256 => uint256)) ownedTokens; - uint256[] allTokens; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_ERC721_ENUMERABLE_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/token/ERC721Storage.sol:ERC721Storage -library ERC721Storage { - bytes32 private constant _SLOT_ERC721_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.ERC721")); - struct Data { - string name; - string symbol; - string baseTokenURI; - mapping(uint256 => address) ownerOf; - mapping(address => uint256) balanceOf; - mapping(uint256 => address) tokenApprovals; - mapping(address => mapping(address => bool)) operatorApprovals; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_ERC721_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/DecimalMath.sol:DecimalMath -library DecimalMath { - uint256 public constant UNIT = 1e18; - int256 public constant UNIT_INT = int256(UNIT); - uint128 public constant UNIT_UINT128 = uint128(UNIT); - int128 public constant UNIT_INT128 = int128(UNIT_INT); - uint256 public constant UNIT_PRECISE = 1e27; - int256 public constant UNIT_PRECISE_INT = int256(UNIT_PRECISE); - int128 public constant UNIT_PRECISE_INT128 = int128(UNIT_PRECISE_INT); - uint256 public constant PRECISION_FACTOR = 9; -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/ERC2771Context.sol:ERC2771Context -library ERC2771Context { - address private constant TRUSTED_FORWARDER = 0xE2C5658cC5C448B48141168f3e475dF8f65A1e3e; -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/HeapUtil.sol:HeapUtil -library HeapUtil { - uint256 private constant _ROOT_INDEX = 1; - struct Data { - uint128 idCount; - Node[] nodes; - mapping(uint128 => uint256) indices; - } - struct Node { - uint128 id; - int128 priority; - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/SetUtil.sol:SetUtil -library SetUtil { - struct UintSet { - Bytes32Set raw; - } - struct AddressSet { - Bytes32Set raw; - } - struct Bytes32Set { - bytes32[] _values; - mapping(bytes32 => uint256) _positions; - } -} - -// @custom:artifact @synthetixio/core-modules/contracts/modules/NftModule.sol:NftModule -contract NftModule { - bytes32 internal constant _INITIALIZED_NAME = "NftModule"; -} - -// @custom:artifact @synthetixio/core-modules/contracts/storage/AssociatedSystem.sol:AssociatedSystem -library AssociatedSystem { - bytes32 public constant KIND_ERC20 = "erc20"; - bytes32 public constant KIND_ERC721 = "erc721"; - bytes32 public constant KIND_UNMANAGED = "unmanaged"; - struct Data { - address proxy; - address impl; - bytes32 kind; - } - function load(bytes32 id) internal pure returns (Data storage store) { - bytes32 s = keccak256(abi.encode("io.synthetix.core-modules.AssociatedSystem", id)); - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-modules/contracts/storage/FeatureFlag.sol:FeatureFlag -library FeatureFlag { - struct Data { - bytes32 name; - bool allowAll; - bool denyAll; - SetUtil.AddressSet permissionedAddresses; - address[] deniers; - } - function load(bytes32 featureName) internal pure returns (Data storage store) { - bytes32 s = keccak256(abi.encode("io.synthetix.core-modules.FeatureFlag", featureName)); - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-modules/contracts/storage/Initialized.sol:Initialized -library Initialized { - struct Data { - bool initialized; - } - function load(bytes32 id) internal pure returns (Data storage store) { - bytes32 s = keccak256(abi.encode("io.synthetix.code-modules.Initialized", id)); - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/interfaces/external/IPyth.sol:PythStructs -contract PythStructs { - struct Price { - int64 price; - uint64 conf; - int32 expo; - uint256 publishTime; - } - struct PriceFeed { - bytes32 id; - Price price; - Price emaPrice; - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/ChainlinkNode.sol:ChainlinkNode -library ChainlinkNode { - uint256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/ReducerNode.sol:ReducerNode -library ReducerNode { - enum Operations { - RECENT, - MIN, - MAX, - MEAN, - MEDIAN, - MUL, - DIV, - MULDECIMAL, - DIVDECIMAL - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/UniswapNode.sol:UniswapNode -library UniswapNode { - uint8 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/pyth/PythNode.sol:PythNode -library PythNode { - int256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/nodes/pyth/PythOffchainLookupNode.sol:PythOffchainLookupNode -library PythOffchainLookupNode { - int256 public constant PRECISION = 18; -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/storage/NodeDefinition.sol:NodeDefinition -library NodeDefinition { - enum NodeType { - NONE, - REDUCER, - EXTERNAL, - CHAINLINK, - UNISWAP, - PYTH, - PRICE_DEVIATION_CIRCUIT_BREAKER, - STALENESS_CIRCUIT_BREAKER, - CONSTANT, - PYTH_OFFCHAIN_LOOKUP - } - struct Data { - NodeType nodeType; - bytes parameters; - bytes32[] parents; - } - function load(bytes32 id) internal pure returns (Data storage node) { - bytes32 s = keccak256(abi.encode("io.synthetix.oracle-manager.Node", id)); - assembly { - node.slot := s - } - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/storage/NodeOutput.sol:NodeOutput -library NodeOutput { - struct Data { - int256 price; - uint256 timestamp; - uint256 __slotAvailableForFutureUse1; - uint256 __slotAvailableForFutureUse2; - } -} - -// @custom:artifact @synthetixio/oracle-manager/contracts/utils/TickMath.sol:TickMath -library TickMath { - int24 internal constant MIN_TICK = -887272; - int24 internal constant MAX_TICK = -MIN_TICK; - uint160 internal constant MIN_SQRT_RATIO = 4295128739; - uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342; -} - -// @custom:artifact contracts/interfaces/IAccountModule.sol:IAccountModule -interface IAccountModule { - struct AccountPermissions { - address user; - bytes32[] permissions; - } -} - -// @custom:artifact contracts/interfaces/ILiquidationModule.sol:ILiquidationModule -interface ILiquidationModule { - struct LiquidationData { - uint256 debtLiquidated; - uint256 collateralLiquidated; - uint256 amountRewarded; - } -} - -// @custom:artifact contracts/modules/core/AccountModule.sol:AccountModule -contract AccountModule { - bytes32 private constant _ACCOUNT_SYSTEM = "accountNft"; - bytes32 private constant _CREATE_ACCOUNT_FEATURE_FLAG = "createAccount"; -} - -// @custom:artifact contracts/modules/core/AssociateDebtModule.sol:AssociateDebtModule -contract AssociateDebtModule { - bytes32 private constant _USD_TOKEN = "USDToken"; - bytes32 private constant _ASSOCIATE_DEBT_FEATURE_FLAG = "associateDebt"; -} - -// @custom:artifact contracts/modules/core/CollateralModule.sol:CollateralModule -contract CollateralModule { - bytes32 private constant _DEPOSIT_FEATURE_FLAG = "deposit"; - bytes32 private constant _WITHDRAW_FEATURE_FLAG = "withdraw"; - bytes32 private constant _CONFIG_TIMEOUT_WITHDRAW = "accountTimeoutWithdraw"; -} - -// @custom:artifact contracts/modules/core/CrossChainUSDModule.sol:CrossChainUSDModule -contract CrossChainUSDModule { - uint256 private constant _TRANSFER_GAS_LIMIT = 100000; - bytes32 private constant _USD_TOKEN = "USDToken"; - bytes32 private constant _TRANSFER_CROSS_CHAIN_FEATURE_FLAG = "transferCrossChain"; -} - -// @custom:artifact contracts/modules/core/IssueUSDModule.sol:IssueUSDModule -contract IssueUSDModule { - bytes32 private constant _USD_TOKEN = "USDToken"; - bytes32 private constant _MINT_FEATURE_FLAG = "mintUsd"; - bytes32 private constant _BURN_FEATURE_FLAG = "burnUsd"; - bytes32 private constant _CONFIG_MINT_FEE_RATIO = "mintUsd_feeRatio"; - bytes32 private constant _CONFIG_BURN_FEE_RATIO = "burnUsd_feeRatio"; - bytes32 private constant _CONFIG_MINT_FEE_ADDRESS = "mintUsd_feeAddress"; - bytes32 private constant _CONFIG_BURN_FEE_ADDRESS = "burnUsd_feeAddress"; -} - -// @custom:artifact contracts/modules/core/LiquidationModule.sol:LiquidationModule -contract LiquidationModule { - bytes32 private constant _USD_TOKEN = "USDToken"; - bytes32 private constant _LIQUIDATE_FEATURE_FLAG = "liquidate"; - bytes32 private constant _LIQUIDATE_VAULT_FEATURE_FLAG = "liquidateVault"; -} - -// @custom:artifact contracts/modules/core/MarketCollateralModule.sol:MarketCollateralModule -contract MarketCollateralModule { - bytes32 private constant _DEPOSIT_MARKET_COLLATERAL_FEATURE_FLAG = "depositMarketCollateral"; - bytes32 private constant _WITHDRAW_MARKET_COLLATERAL_FEATURE_FLAG = "withdrawMarketCollateral"; -} - -// @custom:artifact contracts/modules/core/MarketManagerModule.sol:MarketManagerModule -contract MarketManagerModule { - bytes32 private constant _USD_TOKEN = "USDToken"; - bytes32 private constant _MARKET_FEATURE_FLAG = "registerMarket"; - bytes32 private constant _DEPOSIT_MARKET_FEATURE_FLAG = "depositMarketUsd"; - bytes32 private constant _WITHDRAW_MARKET_FEATURE_FLAG = "withdrawMarketUsd"; - bytes32 private constant _CONFIG_SET_MARKET_MIN_DELEGATE_MAX = "setMarketMinDelegateTime_max"; -} - -// @custom:artifact contracts/modules/core/PoolModule.sol:PoolModule -contract PoolModule { - bytes32 private constant _POOL_FEATURE_FLAG = "createPool"; -} - -// @custom:artifact contracts/modules/core/RewardsManagerModule.sol:RewardsManagerModule -contract RewardsManagerModule { - bytes32 private constant _CLAIM_FEATURE_FLAG = "claimRewards"; -} - -// @custom:artifact contracts/modules/core/UtilsModule.sol:UtilsModule -contract UtilsModule { - bytes32 private constant _USD_TOKEN = "USDToken"; - bytes32 private constant _CCIP_CHAINLINK_SEND = "ccipChainlinkSend"; - bytes32 private constant _CCIP_CHAINLINK_RECV = "ccipChainlinkRecv"; - bytes32 private constant _CCIP_CHAINLINK_TOKEN_POOL = "ccipChainlinkTokenPool"; -} - -// @custom:artifact contracts/modules/core/VaultModule.sol:VaultModule -contract VaultModule { - bytes32 private constant _DELEGATE_FEATURE_FLAG = "delegateCollateral"; -} - -// @custom:artifact contracts/modules/usd/USDTokenModule.sol:USDTokenModule -contract USDTokenModule { - bytes32 private constant _CCIP_CHAINLINK_TOKEN_POOL = "ccipChainlinkTokenPool"; -} - -// @custom:artifact contracts/storage/Account.sol:Account -library Account { - struct Data { - uint128 id; - AccountRBAC.Data rbac; - uint64 lastInteraction; - uint64 __slotAvailableForFutureUse; - uint128 __slot2AvailableForFutureUse; - mapping(address => Collateral.Data) collaterals; - } - function load(uint128 id) internal pure returns (Data storage account) { - bytes32 s = keccak256(abi.encode("io.synthetix.synthetix.Account", id)); - assembly { - account.slot := s - } - } -} - -// @custom:artifact contracts/storage/AccountRBAC.sol:AccountRBAC -library AccountRBAC { - bytes32 internal constant _ADMIN_PERMISSION = "ADMIN"; - bytes32 internal constant _WITHDRAW_PERMISSION = "WITHDRAW"; - bytes32 internal constant _DELEGATE_PERMISSION = "DELEGATE"; - bytes32 internal constant _MINT_PERMISSION = "MINT"; - bytes32 internal constant _REWARDS_PERMISSION = "REWARDS"; - bytes32 internal constant _PERPS_MODIFY_COLLATERAL_PERMISSION = "PERPS_MODIFY_COLLATERAL"; - bytes32 internal constant _PERPS_COMMIT_ASYNC_ORDER_PERMISSION = "PERPS_COMMIT_ASYNC_ORDER"; - bytes32 internal constant _BURN_PERMISSION = "BURN"; - bytes32 internal constant _BFP_PERPS_PAY_DEBT_PERMISSION = "BFP_PERPS_PAY_DEBT"; - bytes32 internal constant _BFP_PERPS_SPLIT_ACCOUNT_PERMISSION = "BFP_PERPS_SPLIT_ACCOUNT"; - struct Data { - address owner; - mapping(address => SetUtil.Bytes32Set) permissions; - SetUtil.AddressSet permissionAddresses; - } -} - -// @custom:artifact contracts/storage/Collateral.sol:Collateral -library Collateral { - struct Data { - uint256 amountAvailableForDelegationD18; - SetUtil.UintSet pools; - CollateralLock.Data[] locks; - } -} - -// @custom:artifact contracts/storage/CollateralConfiguration.sol:CollateralConfiguration -library CollateralConfiguration { - bytes32 private constant _SLOT_AVAILABLE_COLLATERALS = keccak256(abi.encode("io.synthetix.synthetix.CollateralConfiguration_availableCollaterals")); - struct Data { - bool depositingEnabled; - uint256 issuanceRatioD18; - uint256 liquidationRatioD18; - uint256 liquidationRewardD18; - bytes32 oracleNodeId; - address tokenAddress; - uint256 minDelegationD18; - } - function load(address token) internal pure returns (Data storage collateralConfiguration) { - bytes32 s = keccak256(abi.encode("io.synthetix.synthetix.CollateralConfiguration", token)); - assembly { - collateralConfiguration.slot := s - } - } - function loadAvailableCollaterals() internal pure returns (SetUtil.AddressSet storage availableCollaterals) { - bytes32 s = _SLOT_AVAILABLE_COLLATERALS; - assembly { - availableCollaterals.slot := s - } - } -} - -// @custom:artifact contracts/storage/CollateralLock.sol:CollateralLock -library CollateralLock { - struct Data { - uint128 amountD18; - uint64 lockExpirationTime; - } -} - -// @custom:artifact contracts/storage/Config.sol:Config -library Config { - struct Data { - uint256 __unused; - } -} - -// @custom:artifact contracts/storage/CrossChain.sol:CrossChain -library CrossChain { - bytes32 private constant _SLOT_CROSS_CHAIN = keccak256(abi.encode("io.synthetix.synthetix.CrossChain")); - struct Data { - address ccipRouter; - SetUtil.UintSet supportedNetworks; - mapping(uint64 => uint64) ccipChainIdToSelector; - mapping(uint64 => uint64) ccipSelectorToChainId; - } - function load() internal pure returns (Data storage crossChain) { - bytes32 s = _SLOT_CROSS_CHAIN; - assembly { - crossChain.slot := s - } - } -} - -// @custom:artifact contracts/storage/Distribution.sol:Distribution -library Distribution { - struct Data { - uint128 totalSharesD18; - int128 valuePerShareD27; - mapping(bytes32 => DistributionActor.Data) actorInfo; - } -} - -// @custom:artifact contracts/storage/DistributionActor.sol:DistributionActor -library DistributionActor { - struct Data { - uint128 sharesD18; - int128 lastValuePerShareD27; - } -} - -// @custom:artifact contracts/storage/Market.sol:Market -library Market { - struct Data { - uint128 id; - address marketAddress; - int128 netIssuanceD18; - int128 creditCapacityD18; - int128 lastDistributedMarketBalanceD18; - HeapUtil.Data inRangePools; - HeapUtil.Data outRangePools; - Distribution.Data poolsDebtDistribution; - mapping(uint128 => MarketPoolInfo.Data) pools; - DepositedCollateral[] depositedCollateral; - mapping(address => uint256) maximumDepositableD18; - uint32 minDelegateTime; - uint32 __reservedForLater1; - uint64 __reservedForLater2; - uint64 __reservedForLater3; - uint64 __reservedForLater4; - uint256 minLiquidityRatioD18; - } - struct DepositedCollateral { - address collateralType; - uint256 amountD18; - } - function load(uint128 id) internal pure returns (Data storage market) { - bytes32 s = keccak256(abi.encode("io.synthetix.synthetix.Market", id)); - assembly { - market.slot := s - } - } -} - -// @custom:artifact contracts/storage/MarketConfiguration.sol:MarketConfiguration -library MarketConfiguration { - struct Data { - uint128 marketId; - uint128 weightD18; - int128 maxDebtShareValueD18; - } -} - -// @custom:artifact contracts/storage/MarketCreator.sol:MarketCreator -library MarketCreator { - bytes32 private constant _SLOT_MARKET_CREATOR = keccak256(abi.encode("io.synthetix.synthetix.Markets")); - struct Data { - mapping(address => uint128[]) marketIdsForAddress; - uint128 lastCreatedMarketId; - } - function getMarketStore() internal pure returns (Data storage marketStore) { - bytes32 s = _SLOT_MARKET_CREATOR; - assembly { - marketStore.slot := s - } - } -} - -// @custom:artifact contracts/storage/MarketPoolInfo.sol:MarketPoolInfo -library MarketPoolInfo { - struct Data { - uint128 creditCapacityAmountD18; - uint128 pendingDebtD18; - } -} - -// @custom:artifact contracts/storage/OracleManager.sol:OracleManager -library OracleManager { - bytes32 private constant _SLOT_ORACLE_MANAGER = keccak256(abi.encode("io.synthetix.synthetix.OracleManager")); - struct Data { - address oracleManagerAddress; - } - function load() internal pure returns (Data storage oracleManager) { - bytes32 s = _SLOT_ORACLE_MANAGER; - assembly { - oracleManager.slot := s - } - } -} - -// @custom:artifact contracts/storage/Pool.sol:Pool -library Pool { - bytes32 private constant _CONFIG_SET_MARKET_MIN_DELEGATE_MAX = "setMarketMinDelegateTime_max"; - struct Data { - uint128 id; - string name; - address owner; - address nominatedOwner; - uint128 totalWeightsD18; - int128 totalVaultDebtsD18; - MarketConfiguration.Data[] marketConfigurations; - Distribution.Data vaultsDebtDistribution; - mapping(address => Vault.Data) vaults; - uint64 lastConfigurationTime; - uint64 __reserved1; - uint64 __reserved2; - uint64 __reserved3; - mapping(address => PoolCollateralConfiguration.Data) collateralConfigurations; - bool collateralDisabledByDefault; - SetUtil.Bytes32Set rewardIds; - mapping(bytes32 => RewardDistribution.Data) rewardsToVaults; - } - function load(uint128 id) internal pure returns (Data storage pool) { - bytes32 s = keccak256(abi.encode("io.synthetix.synthetix.Pool", id)); - assembly { - pool.slot := s - } - } -} - -// @custom:artifact contracts/storage/PoolCollateralConfiguration.sol:PoolCollateralConfiguration -library PoolCollateralConfiguration { - bytes32 private constant _SLOT = keccak256(abi.encode("io.synthetix.synthetix.PoolCollateralConfiguration")); - struct Data { - uint256 collateralLimitD18; - uint256 issuanceRatioD18; - } -} - -// @custom:artifact contracts/storage/RewardDistribution.sol:RewardDistribution -library RewardDistribution { - struct Data { - address distributor; - uint128 __slotAvailableForFutureUse; - uint128 rewardPerShareD18; - mapping(uint256 => RewardDistributionClaimStatus.Data) claimStatus; - int128 scheduledValueD18; - uint64 start; - uint32 duration; - uint32 lastUpdate; - int128 nextScheduledValueD18; - uint64 nextStart; - uint32 nextDuration; - } -} - -// @custom:artifact contracts/storage/RewardDistributionClaimStatus.sol:RewardDistributionClaimStatus -library RewardDistributionClaimStatus { - struct Data { - uint128 lastRewardPerShareD18; - uint128 pendingSendD18; - } -} - -// @custom:artifact contracts/storage/ScalableMapping.sol:ScalableMapping -library ScalableMapping { - struct Data { - uint128 totalSharesD18; - int128 scaleModifierD27; - mapping(bytes32 => uint256) sharesD18; - } -} - -// @custom:artifact contracts/storage/SystemAccountConfiguration.sol:SystemAccountConfiguration -library SystemAccountConfiguration { - bytes32 private constant _SLOT_SYSTEM_ACCOUNT_CONFIGURATION = keccak256(abi.encode("io.synthetix.synthetix.SystemAccountConfiguration")); - struct Data { - uint64 accountIdOffset; - } - function load() internal pure returns (Data storage systemAccountConfiguration) { - bytes32 s = _SLOT_SYSTEM_ACCOUNT_CONFIGURATION; - assembly { - systemAccountConfiguration.slot := s - } - } -} - -// @custom:artifact contracts/storage/SystemPoolConfiguration.sol:SystemPoolConfiguration -library SystemPoolConfiguration { - bytes32 private constant _SLOT_SYSTEM_POOL_CONFIGURATION = keccak256(abi.encode("io.synthetix.synthetix.SystemPoolConfiguration")); - struct Data { - uint256 minLiquidityRatioD18; - uint128 __reservedForFutureUse; - uint128 preferredPool; - SetUtil.UintSet approvedPools; - } - function load() internal pure returns (Data storage systemPoolConfiguration) { - bytes32 s = _SLOT_SYSTEM_POOL_CONFIGURATION; - assembly { - systemPoolConfiguration.slot := s - } - } -} - -// @custom:artifact contracts/storage/Vault.sol:Vault -library Vault { - struct Data { - uint256 epoch; - bytes32 __slotAvailableForFutureUse; - int128 _unused_prevTotalDebtD18; - mapping(uint256 => VaultEpoch.Data) epochData; - mapping(bytes32 => RewardDistribution.Data) rewards; - SetUtil.Bytes32Set rewardIds; - } - struct PositionSelector { - uint128 accountId; - uint128 poolId; - address collateralType; - } -} - -// @custom:artifact contracts/storage/VaultEpoch.sol:VaultEpoch -library VaultEpoch { - struct Data { - int128 unconsolidatedDebtD18; - int128 totalConsolidatedDebtD18; - Distribution.Data accountsDebtDistribution; - ScalableMapping.Data collateralAmounts; - mapping(uint256 => int256) consolidatedDebtAmountsD18; - mapping(uint128 => uint64) lastDelegationTime; - } -} - -// @custom:artifact contracts/utils/CcipClient.sol:CcipClient -library CcipClient { - bytes4 public constant EVM_EXTRA_ARGS_V1_TAG = 0x97a657c9; - struct EVMTokenAmount { - address token; - uint256 amount; - } - struct Any2EVMMessage { - bytes32 messageId; - uint64 sourceChainSelector; - bytes sender; - bytes data; - EVMTokenAmount[] tokenAmounts; - } - struct EVM2AnyMessage { - bytes receiver; - bytes data; - EVMTokenAmount[] tokenAmounts; - address feeToken; - bytes extraArgs; - } - struct EVMExtraArgsV1 { - uint256 gasLimit; - bool strict; - } -} diff --git a/utils/common-config/hardhat.config.ts b/utils/common-config/hardhat.config.ts index d0dd70396f..892529c717 100644 --- a/utils/common-config/hardhat.config.ts +++ b/utils/common-config/hardhat.config.ts @@ -8,8 +8,8 @@ import 'hardhat-contract-sizer'; import 'solidity-coverage'; import 'hardhat-gas-reporter'; import 'hardhat-cannon'; -import 'hardhat-ignore-warnings'; import '@synthetixio/hardhat-storage'; +import 'hardhat-ignore-warnings'; // Load common .env file from root dotenv.config({ path: path.resolve(__dirname, '..', '..', '.env') }); @@ -157,10 +157,6 @@ const config = { '!contracts/generated/**', '!contracts/mocks/**', ], - skip: [ - '@openzeppelin/contracts/**', - '@synthetixio/rewards-distributor/src/RewardsDistributor.sol:RewardsDistributor', - ], }, }; diff --git a/utils/core-modules/package.json b/utils/core-modules/package.json index cd714affa7..03afd9a356 100644 --- a/utils/core-modules/package.json +++ b/utils/core-modules/package.json @@ -13,11 +13,12 @@ "scripts": { "clean": "hardhat clean && rm -rf contracts/generated", "build": "yarn build:contracts", - "storage:verify": "hardhat compile --force && hardhat storage:verify", - "build:contracts": "hardhat compile --force", + "storage:verify": " hardhat storage:verify", + "build:contracts": "hardhat compile --force && yarn storage:dump && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "storage:dump": "hardhat storage:dump --output storage.new.dump.json", "generate-testable": "rm -rf contracts/generated && hardhat generate-testable", "build-testable": "hardhat compile", - "check:storage": "git diff --exit-code storage.dump.sol", + "check:storage": "diff -uw storage.dump.json storage.new.dump.json", "test": "CANNON_REGISTRY_PRIORITY=local hardhat test", "coverage": "hardhat coverage --network hardhat", "compile-contracts": "hardhat compile", diff --git a/utils/core-modules/storage.dump.json b/utils/core-modules/storage.dump.json new file mode 100644 index 0000000000..1daa1516c3 --- /dev/null +++ b/utils/core-modules/storage.dump.json @@ -0,0 +1,468 @@ +{ + "contracts/storage/AssociatedSystem.sol:AssociatedSystem": { + "name": "AssociatedSystem", + "kind": "library", + "structs": { + "Data": [ + { + "type": "address", + "name": "proxy", + "size": 20, + "slot": "0", + "offset": 0 + }, + { + "type": "address", + "name": "impl", + "size": 20, + "slot": "1", + "offset": 0 + }, + { + "type": "bytes32", + "name": "kind", + "size": 32, + "slot": "2", + "offset": 0 + } + ] + } + }, + "contracts/storage/CrossChain.sol:CrossChain": { + "name": "CrossChain", + "kind": "library", + "structs": { + "Data": [ + { + "type": "address", + "name": "ccipRouter", + "size": 20, + "slot": "0", + "offset": 0 + }, + { + "type": "struct", + "name": "supportedNetworks", + "members": [ + { + "type": "struct", + "name": "raw", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + } + ], + "size": 96, + "slot": "1", + "offset": 0 + }, + { + "type": "mapping", + "name": "ccipChainIdToSelector", + "key": { + "type": "uint64" + }, + "value": { + "type": "uint64" + }, + "size": 32, + "slot": "4", + "offset": 0 + }, + { + "type": "mapping", + "name": "ccipSelectorToChainId", + "key": { + "type": "uint64" + }, + "value": { + "type": "uint64" + }, + "size": 32, + "slot": "5", + "offset": 0 + } + ] + } + }, + "contracts/storage/DecayToken.sol:DecayToken": { + "name": "DecayToken", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint256", + "name": "decayRate", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "epochStart", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "uint256", + "name": "totalSupplyAtEpochStart", + "size": 32, + "slot": "2", + "offset": 0 + } + ] + } + }, + "contracts/storage/FeatureFlag.sol:FeatureFlag": { + "name": "FeatureFlag", + "kind": "library", + "structs": { + "Data": [ + { + "type": "bytes32", + "name": "name", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "bool", + "name": "allowAll", + "size": 1, + "slot": "1", + "offset": 0 + }, + { + "type": "bool", + "name": "denyAll", + "size": 1, + "slot": "1", + "offset": 1 + }, + { + "type": "struct", + "name": "permissionedAddresses", + "members": [ + { + "type": "struct", + "name": "raw", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + } + ], + "size": 96, + "slot": "2", + "offset": 0 + }, + { + "type": "array", + "name": "deniers", + "value": { + "type": "address" + }, + "size": 32, + "slot": "5", + "offset": 0 + } + ] + } + }, + "contracts/storage/Initialized.sol:Initialized": { + "name": "Initialized", + "kind": "library", + "structs": { + "Data": [ + { + "type": "bool", + "name": "initialized", + "size": 1, + "slot": "0", + "offset": 0 + } + ] + } + }, + "contracts/storage/SampleStorage.sol:SampleStorage": { + "name": "SampleStorage", + "kind": "library", + "structs": { + "Data": [ + { + "type": "uint256", + "name": "someValue", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "protectedValue", + "size": 32, + "slot": "1", + "offset": 0 + } + ] + } + }, + "contracts/storage/WormholeCrossChain.sol:WormholeCrossChain": { + "name": "WormholeCrossChain", + "kind": "library", + "structs": { + "Data": [ + { + "type": "address", + "name": "wormholeCore", + "size": 20, + "slot": "0", + "offset": 0 + }, + { + "type": "address", + "name": "wormholeRelayer", + "size": 20, + "slot": "1", + "offset": 0 + }, + { + "type": "uint256", + "name": "gasLimit", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "struct", + "name": "supportedNetworks", + "members": [ + { + "type": "struct", + "name": "raw", + "members": [ + { + "type": "array", + "name": "_values", + "value": { + "type": "bytes32" + } + }, + { + "type": "mapping", + "name": "_positions", + "key": { + "type": "bytes32" + }, + "value": { + "type": "uint256" + } + } + ] + } + ], + "size": 96, + "slot": "3", + "offset": 0 + }, + { + "type": "mapping", + "name": "registeredEmitters", + "key": { + "type": "uint16" + }, + "value": { + "type": "bytes32" + }, + "size": 32, + "slot": "6", + "offset": 0 + }, + { + "type": "mapping", + "name": "hasProcessedMessage", + "key": { + "type": "bytes32" + }, + "value": { + "type": "bool" + }, + "size": 32, + "slot": "7", + "offset": 0 + } + ] + } + }, + "contracts/utils/CcipClient.sol:CcipClient": { + "name": "CcipClient", + "kind": "library", + "structs": { + "EVMTokenAmount": [ + { + "type": "address", + "name": "token", + "size": 20, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "amount", + "size": 32, + "slot": "1", + "offset": 0 + } + ], + "Any2EVMMessage": [ + { + "type": "bytes32", + "name": "messageId", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint64", + "name": "sourceChainSelector", + "size": 8, + "slot": "1", + "offset": 0 + }, + { + "type": "bytes", + "name": "sender", + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "bytes", + "name": "data", + "size": 32, + "slot": "3", + "offset": 0 + }, + { + "type": "array", + "name": "tokenAmounts", + "value": { + "type": "struct", + "name": "EVMTokenAmount", + "members": [ + { + "type": "address", + "name": "token" + }, + { + "type": "uint256", + "name": "amount" + } + ] + }, + "size": 32, + "slot": "4", + "offset": 0 + } + ], + "EVM2AnyMessage": [ + { + "type": "bytes", + "name": "receiver", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "bytes", + "name": "data", + "size": 32, + "slot": "1", + "offset": 0 + }, + { + "type": "array", + "name": "tokenAmounts", + "value": { + "type": "struct", + "name": "EVMTokenAmount", + "members": [ + { + "type": "address", + "name": "token" + }, + { + "type": "uint256", + "name": "amount" + } + ] + }, + "size": 32, + "slot": "2", + "offset": 0 + }, + { + "type": "address", + "name": "feeToken", + "size": 20, + "slot": "3", + "offset": 0 + }, + { + "type": "bytes", + "name": "extraArgs", + "size": 32, + "slot": "4", + "offset": 0 + } + ], + "EVMExtraArgsV1": [ + { + "type": "uint256", + "name": "gasLimit", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "bool", + "name": "strict", + "size": 1, + "slot": "1", + "offset": 0 + } + ] + } + } +} diff --git a/utils/core-modules/storage.dump.sol b/utils/core-modules/storage.dump.sol deleted file mode 100644 index a0bad36d68..0000000000 --- a/utils/core-modules/storage.dump.sol +++ /dev/null @@ -1,351 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity ^0.8.4; - -// @custom:artifact @synthetixio/core-contracts/contracts/ownership/OwnableStorage.sol:OwnableStorage -library OwnableStorage { - bytes32 private constant _SLOT_OWNABLE_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.Ownable")); - struct Data { - address owner; - address nominatedOwner; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_OWNABLE_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/proxy/ProxyStorage.sol:ProxyStorage -contract ProxyStorage { - bytes32 private constant _SLOT_PROXY_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.Proxy")); - struct ProxyStore { - address implementation; - bool simulatingUpgrade; - } - function _proxyStore() internal pure returns (ProxyStore storage store) { - bytes32 s = _SLOT_PROXY_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/token/ERC20Storage.sol:ERC20Storage -library ERC20Storage { - bytes32 private constant _SLOT_ERC20_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.ERC20")); - struct Data { - string name; - string symbol; - uint8 decimals; - mapping(address => uint256) balanceOf; - mapping(address => mapping(address => uint256)) allowance; - uint256 totalSupply; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_ERC20_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/token/ERC721EnumerableStorage.sol:ERC721EnumerableStorage -library ERC721EnumerableStorage { - bytes32 private constant _SLOT_ERC721_ENUMERABLE_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.ERC721Enumerable")); - struct Data { - mapping(uint256 => uint256) ownedTokensIndex; - mapping(uint256 => uint256) allTokensIndex; - mapping(address => mapping(uint256 => uint256)) ownedTokens; - uint256[] allTokens; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_ERC721_ENUMERABLE_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/token/ERC721Storage.sol:ERC721Storage -library ERC721Storage { - bytes32 private constant _SLOT_ERC721_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.ERC721")); - struct Data { - string name; - string symbol; - string baseTokenURI; - mapping(uint256 => address) ownerOf; - mapping(address => uint256) balanceOf; - mapping(uint256 => address) tokenApprovals; - mapping(address => mapping(address => bool)) operatorApprovals; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_ERC721_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/DecimalMath.sol:DecimalMath -library DecimalMath { - uint256 public constant UNIT = 1e18; - int256 public constant UNIT_INT = int256(UNIT); - uint128 public constant UNIT_UINT128 = uint128(UNIT); - int128 public constant UNIT_INT128 = int128(UNIT_INT); - uint256 public constant UNIT_PRECISE = 1e27; - int256 public constant UNIT_PRECISE_INT = int256(UNIT_PRECISE); - int128 public constant UNIT_PRECISE_INT128 = int128(UNIT_PRECISE_INT); - uint256 public constant PRECISION_FACTOR = 9; -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/ERC2771Context.sol:ERC2771Context -library ERC2771Context { - address private constant TRUSTED_FORWARDER = 0xE2C5658cC5C448B48141168f3e475dF8f65A1e3e; -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/SetUtil.sol:SetUtil -library SetUtil { - struct UintSet { - Bytes32Set raw; - } - struct AddressSet { - Bytes32Set raw; - } - struct Bytes32Set { - bytes32[] _values; - mapping(bytes32 => uint256) _positions; - } -} - -// @custom:artifact contracts/interfaces/IWormhole.sol:IWormhole -interface IWormhole { - struct GuardianSet { - address[] keys; - uint32 expirationTime; - } - struct Signature { - bytes32 r; - bytes32 s; - uint8 v; - uint8 guardianIndex; - } - struct VM { - uint8 version; - uint32 timestamp; - uint32 nonce; - uint16 emitterChainId; - bytes32 emitterAddress; - uint64 sequence; - uint8 consistencyLevel; - bytes payload; - uint32 guardianSetIndex; - Signature[] signatures; - bytes32 hash; - } - struct ContractUpgrade { - bytes32 module; - uint8 action; - uint16 chain; - address newContract; - } - struct GuardianSetUpgrade { - bytes32 module; - uint8 action; - uint16 chain; - GuardianSet newGuardianSet; - uint32 newGuardianSetIndex; - } - struct SetMessageFee { - bytes32 module; - uint8 action; - uint16 chain; - uint256 messageFee; - } - struct TransferFees { - bytes32 module; - uint8 action; - uint16 chain; - uint256 amount; - bytes32 recipient; - } - struct RecoverChainId { - bytes32 module; - uint8 action; - uint256 evmChainId; - uint16 newChainId; - } -} - -// @custom:artifact contracts/interfaces/IWormholeRelayer.sol:IWormholeRelayerDelivery -interface IWormholeRelayerDelivery { - enum DeliveryStatus { - SUCCESS, - RECEIVER_FAILURE - } - enum RefundStatus { - REFUND_SENT, - REFUND_FAIL, - CROSS_CHAIN_REFUND_SENT, - CROSS_CHAIN_REFUND_FAIL_PROVIDER_NOT_SUPPORTED, - CROSS_CHAIN_REFUND_FAIL_NOT_ENOUGH, - NO_REFUND_REQUESTED - } -} - -// @custom:artifact contracts/modules/DecayTokenModule.sol:DecayTokenModule -contract DecayTokenModule { - uint256 private constant SECONDS_PER_YEAR = 31536000; -} - -// @custom:artifact contracts/modules/NftModule.sol:NftModule -contract NftModule { - bytes32 internal constant _INITIALIZED_NAME = "NftModule"; -} - -// @custom:artifact contracts/modules/TokenModule.sol:TokenModule -contract TokenModule { - bytes32 internal constant _INITIALIZED_NAME = "TokenModule"; -} - -// @custom:artifact contracts/storage/AssociatedSystem.sol:AssociatedSystem -library AssociatedSystem { - bytes32 public constant KIND_ERC20 = "erc20"; - bytes32 public constant KIND_ERC721 = "erc721"; - bytes32 public constant KIND_UNMANAGED = "unmanaged"; - struct Data { - address proxy; - address impl; - bytes32 kind; - } - function load(bytes32 id) internal pure returns (Data storage store) { - bytes32 s = keccak256(abi.encode("io.synthetix.core-modules.AssociatedSystem", id)); - assembly { - store.slot := s - } - } -} - -// @custom:artifact contracts/storage/CrossChain.sol:CrossChain -library CrossChain { - bytes32 private constant _SLOT_CROSS_CHAIN = keccak256(abi.encode("io.synthetix.core-modules.CrossChain")); - struct Data { - address ccipRouter; - SetUtil.UintSet supportedNetworks; - mapping(uint64 => uint64) ccipChainIdToSelector; - mapping(uint64 => uint64) ccipSelectorToChainId; - } - function load() internal pure returns (Data storage crossChain) { - bytes32 s = _SLOT_CROSS_CHAIN; - assembly { - crossChain.slot := s - } - } -} - -// @custom:artifact contracts/storage/DecayToken.sol:DecayToken -library DecayToken { - bytes32 private constant _SLOT_DECAY_TOKEN_STORAGE = keccak256(abi.encode("io.synthetix.core-modules.DecayToken")); - struct Data { - uint256 decayRate; - uint256 epochStart; - uint256 totalSupplyAtEpochStart; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_DECAY_TOKEN_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact contracts/storage/FeatureFlag.sol:FeatureFlag -library FeatureFlag { - struct Data { - bytes32 name; - bool allowAll; - bool denyAll; - SetUtil.AddressSet permissionedAddresses; - address[] deniers; - } - function load(bytes32 featureName) internal pure returns (Data storage store) { - bytes32 s = keccak256(abi.encode("io.synthetix.core-modules.FeatureFlag", featureName)); - assembly { - store.slot := s - } - } -} - -// @custom:artifact contracts/storage/Initialized.sol:Initialized -library Initialized { - struct Data { - bool initialized; - } - function load(bytes32 id) internal pure returns (Data storage store) { - bytes32 s = keccak256(abi.encode("io.synthetix.code-modules.Initialized", id)); - assembly { - store.slot := s - } - } -} - -// @custom:artifact contracts/storage/SampleStorage.sol:SampleStorage -library SampleStorage { - bytes32 private constant _SLOT_SAMPLE_STORAGE = keccak256(abi.encode("io.synthetix.core-modules.Sample")); - struct Data { - uint256 someValue; - uint256 protectedValue; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_SAMPLE_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact contracts/storage/WormholeCrossChain.sol:WormholeCrossChain -library WormholeCrossChain { - bytes32 private constant _SLOT_WORMHOLE_CROSS_CHAIN = keccak256(abi.encode("io.synthetix.core-modules.WormholeCrossChain")); - struct Data { - address wormholeCore; - address wormholeRelayer; - uint256 gasLimit; - SetUtil.UintSet supportedNetworks; - mapping(uint16 => bytes32) registeredEmitters; - mapping(bytes32 => bool) hasProcessedMessage; - } - function load() internal pure returns (Data storage crossChain) { - bytes32 s = _SLOT_WORMHOLE_CROSS_CHAIN; - assembly { - crossChain.slot := s - } - } -} - -// @custom:artifact contracts/utils/CcipClient.sol:CcipClient -library CcipClient { - bytes4 public constant EVM_EXTRA_ARGS_V1_TAG = 0x97a657c9; - struct EVMTokenAmount { - address token; - uint256 amount; - } - struct Any2EVMMessage { - bytes32 messageId; - uint64 sourceChainSelector; - bytes sender; - bytes data; - EVMTokenAmount[] tokenAmounts; - } - struct EVM2AnyMessage { - bytes receiver; - bytes data; - EVMTokenAmount[] tokenAmounts; - address feeToken; - bytes extraArgs; - } - struct EVMExtraArgsV1 { - uint256 gasLimit; - bool strict; - } -} diff --git a/utils/core-utils/package.json b/utils/core-utils/package.json index 5b46895389..b59a6e0b90 100644 --- a/utils/core-utils/package.json +++ b/utils/core-utils/package.json @@ -57,8 +57,7 @@ "solidity-ast": "^0.4.55", "ts-node": "^10.9.2", "typechain": "^8.3.2", - "typescript": "^5.5.4", - "viem": "^2.9.31" + "typescript": "^5.5.4" }, "dependencies": { "@ethersproject/abi": "^5.7.0", @@ -67,6 +66,7 @@ "fast-glob": "^3.3.2", "micromatch": "^4.0.8", "prompts": "^2.4.2", - "rfdc": "^1.3.1" + "rfdc": "^1.3.1", + "viem": "^2.16.5" } } diff --git a/utils/core-utils/src/utils/ast/finders.ts b/utils/core-utils/src/utils/ast/finders.ts index 3b82532975..ade8030576 100644 --- a/utils/core-utils/src/utils/ast/finders.ts +++ b/utils/core-utils/src/utils/ast/finders.ts @@ -14,12 +14,20 @@ import { findAll as _findAll } from 'solidity-ast/utils'; * Get all the contract definitions on the given node */ export function findAll( - astNode: Node | YulNode, + astNode: Node | YulNode | (Node | YulNode)[], nodeType: T | T[], filterFn: (node: (NodeTypeMap & YulNodeTypeMap)[T]) => boolean = () => true ) { const result: (NodeTypeMap & YulNodeTypeMap)[T][] = []; + if (Array.isArray(astNode)) { + for (const node of astNode) { + result.push(...findAll(node, nodeType, filterFn)); + } + + return result; + } + for (const node of _findAll(nodeType, astNode)) { if (filterFn(node)) result.push(node); } @@ -28,26 +36,51 @@ export function findAll( } export function findOne( - astNode: Node | YulNode, + astNode: Node | YulNode | (Node | YulNode)[], nodeType: T | T[], filterFn: (node: (NodeTypeMap & YulNodeTypeMap)[T]) => boolean = () => true ) { - for (const node of _findAll(nodeType, astNode)) { - if (filterFn(node)) return node; + if (Array.isArray(astNode)) { + for (const node of astNode) { + const result = findOne(node, nodeType, filterFn) as (NodeTypeMap & YulNodeTypeMap)[T]; + if (result) return result; + } + } else { + for (const node of _findAll(nodeType, astNode)) { + if (filterFn(node)) return node; + } } } +export function findOneById( + astNode: Node | YulNode | (Node | YulNode)[], + nodeType: T | T[], + nodeId: number, + filterFn: (node: (NodeTypeMap & YulNodeTypeMap)[T]) => boolean = () => true +) { + const result = findOne( + astNode, + nodeType, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (node) => typeof (node as any).id === 'number' && (node as any).id === nodeId && filterFn(node) + ); + + if (!result) throw new Error(`Could not find node with id "${nodeId}"`); + + return result; +} + // Helper function to find nodes as direct children in a SourceUnit, // Using this function you can avoid having to loop the whole tree when you know // where are you looking for stuff -export function findChildren( +export function findChildren( sourceUnit: SourceUnit, nodeType: T, filterFn: (node: SourceUnit['nodes'][number]) => boolean = () => true ) { return sourceUnit.nodes.filter( (node) => node.nodeType === nodeType && filterFn(node) - ) as NodeTypeMap[T][]; + ) as (NodeTypeMap & YulNodeTypeMap)[T][]; } /** @@ -206,6 +239,25 @@ export function findContractNode(contractFullyQualifiedName: string, astNodes: S return contractNode; } +/** + * Find a contracts node on the ASTs trees, and returns both + */ +export function findContractNodeWithAst( + contractFullyQualifiedName: string, + astNodes: SourceUnit[] +): [SourceUnit, ContractDefinition] { + const { contractNode, sourceUnitNode } = _findContractSourceByFullyQualifiedName( + contractFullyQualifiedName, + astNodes + ); + + if (!contractNode) { + throw new Error(`Could not find contract node for "${contractFullyQualifiedName}"`); + } + + return [sourceUnitNode, contractNode]; +} + /** * Get the fully qualified name of a local contract on a given AST node. Takes * into account any possible aliases given to it during import. diff --git a/utils/core-utils/src/utils/bootstrap/tests.ts b/utils/core-utils/src/utils/bootstrap/tests.ts index 6fa257b2aa..1b617cbf14 100644 --- a/utils/core-utils/src/utils/bootstrap/tests.ts +++ b/utils/core-utils/src/utils/bootstrap/tests.ts @@ -2,8 +2,8 @@ import fs from 'node:fs/promises'; import path from 'node:path'; -import { ethers } from 'ethers'; import hre from 'hardhat'; +import { ethers } from 'ethers'; import { glob, runTypeChain } from 'typechain'; import { ChainBuilderContext, ContractMap } from './cannon-types'; import { getHardhatSigners } from './get-hardhat-signers'; diff --git a/utils/core-utils/src/utils/solidity/compiler.ts b/utils/core-utils/src/utils/solidity/compiler.ts index 8d516d81e3..afde0de7ec 100644 --- a/utils/core-utils/src/utils/solidity/compiler.ts +++ b/utils/core-utils/src/utils/solidity/compiler.ts @@ -78,8 +78,7 @@ export async function compileSolidityFolder({ return compileSolidityContents(contents, version); } -// eslint-disable-next-line @typescript-eslint/no-explicit-any -async function _getCompiler(version: string): Promise { +async function _getCompiler(version: string) { const downloader = new CompilerDownloader( CompilerDownloader.getCompilerPlatform(), await getCompilersDir() diff --git a/utils/hardhat-storage/package.json b/utils/hardhat-storage/package.json index d006a3c4fd..9c99777fe6 100644 --- a/utils/hardhat-storage/package.json +++ b/utils/hardhat-storage/package.json @@ -31,12 +31,17 @@ "prepublishOnly": "yarn build" }, "dependencies": { + "@solidity-parser/parser": "^0.18.0", "@synthetixio/core-utils": "workspace:*", + "chalk": "^4.1.2", + "cli-table3": "^0.6.5", + "lodash.memoize": "^4.1.2", "mustache": "^4.2.0", "solidity-ast": "^0.4.55" }, "devDependencies": { "@types/jest": "^29.5.12", + "@types/lodash.memoize": "^4.1.9", "@types/mustache": "^4.2.5", "hardhat": "^2.19.5", "jest": "^29.7.0", diff --git a/utils/hardhat-storage/src/index.ts b/utils/hardhat-storage/src/index.ts index 8edf0830bd..e89752eefe 100644 --- a/utils/hardhat-storage/src/index.ts +++ b/utils/hardhat-storage/src/index.ts @@ -1,6 +1,19 @@ +import path from 'node:path'; +import { extendConfig } from 'hardhat/config'; +import { HardhatConfig, HardhatUserConfig } from 'hardhat/types'; +import './type-extensions'; import './subtasks/generate-testable-storage'; -import './subtasks/get-source-units'; -import './subtasks/parse-contents'; -import './subtasks/parse-dump'; +import './subtasks/get-artifacts'; +import './subtasks/validate-contracts'; +import './subtasks/verify-contracts'; +import './tasks/dump'; import './tasks/generate-testable'; +import './tasks/layout'; +import './tasks/validate'; import './tasks/verify'; + +extendConfig((config: HardhatConfig, userConfig: Readonly) => { + config.storage = { + artifacts: userConfig.storage?.artifacts || [path.join(config.paths.sources, '**')], + }; +}); diff --git a/utils/hardhat-storage/src/internal/are-deep-equal.ts b/utils/hardhat-storage/src/internal/are-deep-equal.ts new file mode 100644 index 0000000000..2aa68729bf --- /dev/null +++ b/utils/hardhat-storage/src/internal/are-deep-equal.ts @@ -0,0 +1,10 @@ +import { deepEqual } from 'node:assert'; + +export function areDeepEqual(a: unknown, b: unknown) { + try { + deepEqual(a, b); + return true; + } catch { + return false; + } +} diff --git a/utils/hardhat-storage/src/internal/artifacts.ts b/utils/hardhat-storage/src/internal/artifacts.ts new file mode 100644 index 0000000000..febeaea8a1 --- /dev/null +++ b/utils/hardhat-storage/src/internal/artifacts.ts @@ -0,0 +1,179 @@ +import path from 'node:path'; +import * as parser from '@solidity-parser/parser'; +import { ASTNodeTypeString, ContractDefinition } from '@solidity-parser/parser/src/ast-types'; +import { GetArtifactFunction, StorageArtifact } from '../types'; +import { readFileSafe } from './file-helpers'; +import { + ASTTypeMap, + findAll, + findContractStrict, + findOne, + getCanonicalImportedSymbolName, +} from './finders'; +import { ensureTrailingSlash, isExplicitRelativePath, removeBasePath } from './path-helpers'; + +export async function readArtifact(projectRoot: string, sourceName: string, sourcePrefix = '') { + if (sourcePrefix && !sourceName.startsWith(ensureTrailingSlash(sourcePrefix))) { + throw new Error(`Invalid sourcePrefix "${sourcePrefix}" for "${sourceName}"`); + } + + const sourcePath = sourcePrefix + ? sourceName.slice(ensureTrailingSlash(sourcePrefix).length) + : sourceName; + + const sourceFullPath = path.resolve(projectRoot, sourcePath); + const sourceCode = await readFileSafe(sourceFullPath); + + if (sourceCode === undefined) { + throw new Error(`Could not find "${sourceName}" at "${sourceFullPath}"`); + } + + const sourceUnit = parser.parse(sourceCode, { loc: true }); + + // Modify all import directives to start from `projectRoot` + _normalizeImportDirectives(projectRoot, sourceFullPath, sourceUnit, sourcePrefix); + + return { + sourceName, + ast: sourceUnit, + } satisfies StorageArtifact; +} + +function _normalizeImportDirectives( + projectRoot: string, + sourceFullPath: string, + sourceUnit: StorageArtifact['ast'], + sourcePrefix: string +) { + for (const node of findAll(sourceUnit, 'ImportDirective')) { + if (!isExplicitRelativePath(node.path)) continue; + const sourceName = removeBasePath( + projectRoot, + path.resolve(path.dirname(sourceFullPath), node.path) + ); + const target = sourcePrefix ? path.join(sourcePrefix, sourceName) : sourceName; + node.path = target; + node.pathLiteral.value = target; + node.pathLiteral.parts = [target]; + } +} + +export async function findNodeReferenceWithArtifact( + getArtifact: GetArtifactFunction, + nodeTypes: T | T[], + artifact: StorageArtifact, + nodePath: string +): Promise<[StorageArtifact, ASTTypeMap[T]]> { + // Handle children nodes, e.g.: ContractName.StrcutName + if (nodePath.includes('.')) { + const names = nodePath.split('.'); + + if (names.length > 2) { + throw new Error( + `Cannot handle node references with more than 1 parent in "${nodePath}" from "${artifact.sourceName}"` + ); + } + + const [parentNodeName, childNodeName] = names; + + const [parentArtifact, parentNode] = await findNodeReferenceWithArtifact( + getArtifact, + nodeTypes, + artifact, + parentNodeName + ); + + const childNode = findOne( + parentNode, + nodeTypes, + (node) => (node as { name: string }).name === childNodeName + ); + + if (!childNode) { + throw new Error( + `Could not find node with name "${nodePath}" from "${parentArtifact.sourceName}"` + ); + } + + return [parentArtifact, childNode]; + } + + // Check if it's defined on the same file + const localNode = findOne( + artifact.ast, + nodeTypes, + (node) => (node as { name: string }).name === nodePath + ); + + if (localNode) return [artifact, localNode]; + + const importDirective = getCanonicalImportedSymbolName(artifact.ast, nodePath); + + // If we have the real name and where it was imported from, look for it there + if (importDirective) { + const [importSourceName, canonicalNodeName] = importDirective; + const importedArtifact = await getArtifact(importSourceName); + const foundNode = findOne( + importedArtifact.ast, + nodeTypes, + (node) => (node as { name: string }).name === canonicalNodeName + ); + if (foundNode) return [importedArtifact, foundNode]; + } else { + // if not, recursively on all the imported files + const importedSourceNames = findAll(artifact.ast, 'ImportDirective').map((node) => node.path); + + // loop protection: prevents infinite loop in case recursion of file imports causes that + const doneSourceNames = new Set(importedSourceNames); + + let importSourceName; + while ((importSourceName = importedSourceNames.pop())) { + const importedArtifact = await getArtifact(importSourceName); + const foundNode = findOne( + importedArtifact.ast, + nodeTypes, + (node) => (node as { name: string }).name === nodePath + ); + if (foundNode) return [importedArtifact, foundNode]; + + // recursively add all import directives from this file + for (const d of findAll(importedArtifact.ast, 'ImportDirective').map((node) => node.path)) { + if (!doneSourceNames.has(d)) { + importedSourceNames.push(d); + doneSourceNames.add(d); + } + } + } + } + + throw new Error(`Could not find node with name "${nodePath}" from "${artifact.sourceName}"`); +} + +export async function findContractTree( + getArtifact: GetArtifactFunction, + artifact: StorageArtifact, + contractName: string +) { + const contractNode = findContractStrict(artifact.ast, contractName); + + const contractNodes: ContractDefinition[] = [contractNode]; + + for (const baseContract of contractNode.baseContracts) { + const [inheritedArtifact, inheritedContract] = await findNodeReferenceWithArtifact( + getArtifact, + 'ContractDefinition', + artifact, + baseContract.baseName.namePath + ); + + const importedContractTree = await findContractTree( + getArtifact, + inheritedArtifact, + inheritedContract.name + ); + + contractNodes.push(...importedContractTree); + } + + return contractNodes; +} diff --git a/utils/hardhat-storage/src/internal/dump.ts b/utils/hardhat-storage/src/internal/dump.ts index 670dc82ef0..a97413d21d 100644 --- a/utils/hardhat-storage/src/internal/dump.ts +++ b/utils/hardhat-storage/src/internal/dump.ts @@ -1,68 +1,235 @@ -import { findAll } from '@synthetixio/core-utils/utils/ast/finders'; -import { clone } from '@synthetixio/core-utils/utils/misc/clone'; -import { SourceUnit } from 'solidity-ast/types'; -import { iterateContracts, iterateSlotAssignments } from './iterators'; -import { render } from './render'; +import { + ContractDefinition, + TypeName, + VariableDeclaration, +} from '@solidity-parser/parser/src/ast-types'; +import { parseFullyQualifiedName } from 'hardhat/utils/contract-names'; +import { + GetArtifactFunction, + StorageArraySlot, + StorageArtifact, + StorageBuiltinValueSlot, + StorageBuiltInValueType, + StorageDump, + StorageLayout, + StorageSlot, + StorageSlotBase, +} from '../types'; +import { findNodeReferenceWithArtifact } from './artifacts'; +import { findAll, findContract } from './finders'; +import { hidrateSlotsLayout } from './layout'; -/** - * Generate a single solidity file including all the given contracts but only - * rendering its storage defintions. - */ -export async function dumpStorage( - astNodes: SourceUnit[], - version?: string, - license = 'UNLICENSED' -) { - if (!Array.isArray(astNodes) || !astNodes.length) { - throw new Error('No solidity files found'); +interface ContractOrLibrary extends ContractDefinition { + kind: 'contract' | 'library'; +} + +interface Params { + getArtifact: GetArtifactFunction; + contracts: string[]; + version?: string; + license?: string; +} + +class TypeNameError extends Error { + typeName: TypeName; + + constructor(typeName: TypeName, message: string) { + super(`${typeName.type}: ${message}`); + this.typeName = typeName; } +} - const result = [ - `// SPDX-License-Identifier: ${license}`, - version ? `pragma solidity ${version};` : _renderPragmaDirective(astNodes), - '', - ]; +export async function dumpStorage({ getArtifact, contracts }: Params) { + const results: StorageDump = {}; + + for (const [artifact, contractNode] of await _getContracts(getArtifact, contracts)) { + const result: StorageLayout = { + name: contractNode.name, + kind: contractNode.kind, + structs: {}, + }; - for (const [sourceUnit, contractNode] of iterateContracts(astNodes)) { - const sourceName = sourceUnit.absolutePath; const contractName = contractNode.name; + const sourceName = artifact.sourceName; const fqName = `${sourceName}:${contractName}`; - const resultNode = clone(contractNode); + for (const structDefinition of findAll(contractNode, 'StructDefinition')) { + const slots: StorageSlot[] = []; + + for (const member of structDefinition.members) { + const storageSlot = await _astVariableToStorageSlot(getArtifact, artifact, member); + slots.push(storageSlot); + } + + if (slots.length) { + result.structs[structDefinition.name] = hidrateSlotsLayout(slots); + } + } + + if (Object.keys(result.structs).length > 0) { + results[fqName] = result; + } + } + + return results; +} + +async function _astVariableToStorageSlot( + getArtifact: GetArtifactFunction, + artifact: StorageArtifact, + member: VariableDeclaration +) { + if (!member.typeName) throw new Error('Missing type notation'); + if (!member.name) throw new Error('Missing name notation'); + return _typeNameToStorageSlot(getArtifact, artifact, member.typeName, member.name); +} + +/** + * Utility function to convert the given AST typeName elements in StorageSlot that + * then can be used to calculate a complete Storage Layout with sizes and locations. + */ +async function _typeNameToStorageSlot( + getArtifact: GetArtifactFunction, + artifact: StorageArtifact, + typeName: TypeName, + name?: string +): Promise { + const _createSlot = (attrs: StorageSlot) => { + const { type, ...restAttrs } = attrs; + // order keys for consistency: + const slot = (name ? { type, name, ...restAttrs } : { type, ...restAttrs }) as StorageSlot; + return slot; + }; - const constDeclarations = findAll( - contractNode, - 'VariableDeclaration', - (node) => node.mutability === 'constant' + const _error = (msg: string) => { + throw new TypeNameError(typeName, msg); + }; + + if (typeName.type === 'ElementaryTypeName') { + const type = _getBuiltInValueType(typeName.name); + return _createSlot({ type }); + } + + if (typeName.type === 'ArrayTypeName') { + const value = await _typeNameToStorageSlot( + getArtifact, + artifact, + typeName.baseTypeName, + typeName.baseTypeName.type === 'UserDefinedTypeName' + ? typeName.baseTypeName.namePath + : undefined ); - const enumDefinitions = findAll(contractNode, 'EnumDefinition'); - const structDefinitions = findAll(contractNode, 'StructDefinition'); - const slotAssignments = [...iterateSlotAssignments([sourceUnit])].map( - ([, , functionNode]) => functionNode + + const slot = _createSlot({ type: 'array', value }); + + if (typeName.range) _error('array values with range not implemented'); + + if (typeName.length) { + if (typeName.length.type === 'NumberLiteral') { + (slot as StorageArraySlot).length = Number.parseInt(typeName.length.number); + } else { + _error('array length with custom value not implemented'); + } + } + + return slot; + } + + if (typeName.type === 'Mapping') { + const [key, value] = await Promise.all([ + _typeNameToStorageSlot( + getArtifact, + artifact, + typeName.keyType, + typeName.keyName?.name || undefined + ), + _typeNameToStorageSlot( + getArtifact, + artifact, + typeName.valueType, + typeName.valueName?.name || undefined + ), + ]); + + if (!_isBuiltInType(key)) { + throw new Error('Invalid key type for mapping'); + } + + return _createSlot({ type: 'mapping', key, value }); + } + + if (typeName.type === 'UserDefinedTypeName') { + const [referenceArtifact, referenceNode] = await findNodeReferenceWithArtifact( + getArtifact, + ['ContractDefinition', 'StructDefinition', 'EnumDefinition'], + artifact, + typeName.namePath ); - // Filter all the contract nodes to only include Structs and Storage Slot Definitions - resultNode.nodes = [ - ...constDeclarations, - ...enumDefinitions, - ...structDefinitions, - ...slotAssignments, - ]; + // If it is a reference to a contract, replace the type as `address` + if (referenceNode.type === 'ContractDefinition') { + return _createSlot({ type: 'address' }); + } + + if (referenceNode.type === 'EnumDefinition') { + const members = referenceNode.members.map((m) => m.name); + return _createSlot({ type: 'enum', members }); + } - if (!resultNode.nodes.length) continue; + // handle structs + const members = await Promise.all( + referenceNode.members.map((childMember) => + _astVariableToStorageSlot(getArtifact, referenceArtifact, childMember) + ) + ).then((result) => result.flat()); + + return _createSlot({ type: 'struct', members }); + } - // Render the contract only including storage definitions - const contract = render(resultNode); + throw new TypeNameError(typeName, 'not implemented for generating storage layout'); +} - result.push(`// @custom:artifact ${fqName}`, contract, ''); +function _isBuiltInType(storageSlot: StorageSlotBase): storageSlot is StorageBuiltinValueSlot { + try { + _getBuiltInValueType(storageSlot.type); + return true; + } catch { + return false; } +} + +const FIXED_SIZE_VALUE_REGEX = /^((?:int|uint|bytes)[0-9]+|(?:ufixed|fixed)[0-9]+x[0-9]+)$/; +function _isFixedBuiltInValueType(typeName: string): typeName is StorageBuiltInValueType { + return FIXED_SIZE_VALUE_REGEX.test(typeName); +} + +const _typeValueNormalizeMap = { + int: 'int256', + uint: 'uint256', + byte: 'bytes1', + ufixed: 'ufixed128x18', + fixed: 'fixed128x18', +} as { [k: string]: StorageBuiltInValueType }; - return result.join('\n'); +function _getBuiltInValueType(typeName: string): StorageBuiltInValueType { + if (typeof typeName !== 'string' || !typeName) throw new Error(`Invalid typeName ${typeName}`); + if (['bool', 'address', 'bytes', 'string'].includes(typeName)) + return typeName as StorageBuiltInValueType; + if (_typeValueNormalizeMap[typeName]) return _typeValueNormalizeMap[typeName]; + if (_isFixedBuiltInValueType(typeName)) return typeName; + throw new Error(`Invalid typeName ${typeName}`); } -function _renderPragmaDirective(sourceUnits: SourceUnit[]) { - const sourceUnit = sourceUnits[sourceUnits.length - 1]; - // TODO: calculate the best solc version based on all the files, instead of using - // the one from the last file - for (const node of findAll(sourceUnit, 'PragmaDirective')) return render(node); +async function _getContracts(getArtifact: GetArtifactFunction, contracts: string[]) { + return Promise.all( + contracts.map(async (fqName) => { + const { sourceName, contractName } = parseFullyQualifiedName(fqName); + const artifact = await getArtifact(sourceName); + const contractNode = findContract(artifact.ast, contractName, (node) => + ['contract', 'library'].includes(node.kind) + ) as ContractOrLibrary; + if (!contractNode) return; + return [artifact, contractNode]; + }) + ).then((results) => results.filter(Boolean) as [StorageArtifact, ContractOrLibrary][]); } diff --git a/utils/hardhat-storage/src/internal/error.ts b/utils/hardhat-storage/src/internal/error.ts index 6056d1f0d6..e63d262a33 100644 --- a/utils/hardhat-storage/src/internal/error.ts +++ b/utils/hardhat-storage/src/internal/error.ts @@ -1,7 +1,7 @@ -import { Node, YulNode } from 'solidity-ast/node'; -import { SourceUnit } from 'solidity-ast/types'; import { render } from './render'; +import type { ASTNode, AssemblyItem, BaseASTNode } from '@solidity-parser/parser/src/ast-types'; + export class ValidationError extends Error {} /** @@ -10,26 +10,25 @@ export class ValidationError extends Error {} */ export function createError({ message, - sourceUnit, + sourceName, nodes = [], }: { message: string; - sourceUnit: SourceUnit; - nodes: (Node | YulNode)[]; + sourceName: string; + nodes: (ASTNode | AssemblyItem)[]; }) { const err = new ValidationError(message); const [title] = err.stack!.split('\n'); const stack: string[] = []; try { - const { absolutePath } = sourceUnit; for (const node of nodes) { - const title = _getErrorTitle(node); + const title = _renderTitle(node); if (!title) continue; - stack.unshift(` at ${title} (${absolutePath})`); + stack.unshift(` at ${title} (${sourceName}${_renderLoc(node)})`); } - } catch { - console.warn('Could not render stack trace.'); + } catch (err) { + console.warn('Could not render stack trace.', err); } stack.unshift(title); @@ -37,14 +36,22 @@ export function createError({ return err; } -function _getErrorTitle(node: Node | YulNode) { - /* eslint-disable */ - switch (node.nodeType) { +function _renderTitle(node: ASTNode | AssemblyItem) { + switch (node.type) { case 'ContractDefinition': - return `${node.contractKind} ${node.name}`; + return `${node.kind} ${node.name}`; case 'VariableDeclaration': return render(node); default: - return (node as any).name as string; + return typeof (node as { name: string }).name === 'string' + ? (node as { name: string }).name + : node.type; } } + +function _renderLoc(node: BaseASTNode) { + if (!node.loc) return ''; + const loc = [`:${node.loc.start.line}`]; + if (node.loc.start.column) loc.push(`:${node.loc.start.column}`); + return loc.join(''); +} diff --git a/utils/hardhat-storage/src/internal/file-helpers.ts b/utils/hardhat-storage/src/internal/file-helpers.ts new file mode 100644 index 0000000000..8de6a069d8 --- /dev/null +++ b/utils/hardhat-storage/src/internal/file-helpers.ts @@ -0,0 +1,40 @@ +import fs from 'node:fs/promises'; +import path from 'node:path'; + +export async function readFile(filepath: string) { + return fs.readFile(filepath, { encoding: 'utf8' }).then((res) => res.toString()); +} + +export async function readFileSafe(filepath: string) { + try { + const result = await readFile(filepath); + return result; + } catch (err: unknown) { + if (_isNodeError(err) && err.code === 'ENOENT') return; + throw err; + } +} + +function _isNodeError(err: unknown): err is Error & { code?: string } { + return err instanceof Error && typeof (err as Error & { code?: string }).code === 'string'; +} + +export async function writeFile(target: string, content: string) { + await fs.mkdir(path.dirname(target), { recursive: true }); + return fs.writeFile(target, content); +} + +export async function readJsonFile(filepath: string) { + const content = await readFile(filepath); + return JSON.parse(content) as T; +} + +export async function readJsonFileSafe(filepath: string) { + const content = await readFileSafe(filepath); + return content ? (JSON.parse(content) as T) : undefined; +} + +export async function writeJsonFile(target: string, content: unknown) { + const data = typeof content === 'string' ? content : JSON.stringify(content, null, 2); + return writeFile(target, data + '\n'); +} diff --git a/utils/hardhat-storage/src/internal/finders.ts b/utils/hardhat-storage/src/internal/finders.ts new file mode 100644 index 0000000000..31cefd7cc4 --- /dev/null +++ b/utils/hardhat-storage/src/internal/finders.ts @@ -0,0 +1,119 @@ +import * as parser from '@solidity-parser/parser'; + +import type { + ASTNode, + ASTNodeTypeString, + ContractDefinition, + SourceUnit, +} from '@solidity-parser/parser/src/ast-types'; + +export type ASTMap = { [K in ASTNodeTypeString]: U extends { type: K } ? U : never }; +export type ASTTypeMap = ASTMap; + +// parse.visit() function but compatible with multiple astNodes and better types interface +function _visit( + astNodes: ASTNode | ASTNode[], + nodeTypes: T | T[], + visitorFn: (node: ASTTypeMap[T]) => false | void +) { + const visitor: { [nodeType: string]: (node: ASTTypeMap[T]) => false | void } = {}; + let cancelled = false; + + const astNodesArr = Array.isArray(astNodes) ? astNodes : [astNodes]; + const nodeTypesArr = Array.isArray(nodeTypes) ? nodeTypes : [nodeTypes]; + + const _visitorFn = (node: ASTTypeMap[T]) => { + const res = visitorFn(node); + if (res === false) cancelled = true; + }; + + for (const nodeType of nodeTypesArr) { + visitor[nodeType] = _visitorFn; + } + + for (const astNode of astNodesArr) { + if (cancelled) break; + parser.visit(astNode, visitor); + } +} + +export function findAll( + astNodes: ASTNode | ASTNode[], + nodeTypes: T | T[], + filterFn: (node: ASTTypeMap[T]) => boolean = () => true +) { + const results: ASTTypeMap[T][] = []; + + _visit(astNodes, nodeTypes, (node) => { + if (filterFn(node)) results.push(node); + }); + + return results; +} + +export function findOne( + astNodes: ASTNode | ASTNode[], + nodeTypes: T | T[], + filterFn: (node: ASTTypeMap[T]) => boolean = () => true +): ASTTypeMap[T] | undefined { + let result: ASTTypeMap[T] | undefined = undefined; + + _visit(astNodes, nodeTypes, (node) => { + if (filterFn(node)) { + result = node; + return false; + } + }); + + return result; +} + +export function findChildren( + astNode: SourceUnit, + nodeTypes: T | T[], + filterFn: (node: ASTTypeMap[T]) => boolean = () => true +) { + const types: ASTNodeTypeString[] = Array.isArray(nodeTypes) ? nodeTypes : [nodeTypes]; + return astNode.children.filter( + (node: ASTNode) => types.includes(node.type) && filterFn(node as ASTTypeMap[T]) + ); +} + +export function findContract( + astNode: SourceUnit, + contractName: string, + filterFn: (node: ContractDefinition) => boolean = () => true +) { + return astNode.children.find( + (node) => node.type === 'ContractDefinition' && node.name === contractName && filterFn(node) + ) as ContractDefinition | undefined; +} + +export function findContractStrict( + astNode: SourceUnit, + contractName: string, + filterFn: (node: ContractDefinition) => boolean = () => true +) { + const contractNode = findContract(astNode, contractName, filterFn); + + if (!contractNode) { + throw new Error(`Contract with name "${contractName}" not found`); + } + + return contractNode; +} + +export function getCanonicalImportedSymbolName( + astNode: ASTNode, + symbolName: string +): [string, string] | undefined { + for (const imp of findAll(astNode, 'ImportDirective')) { + if (imp.symbolAliases) { + for (const [canonicalName, alias] of imp.symbolAliases) { + if (canonicalName === symbolName || alias === symbolName) { + return [imp.path, canonicalName]; + } + } + } + } +} diff --git a/utils/hardhat-storage/src/internal/misc.ts b/utils/hardhat-storage/src/internal/is-present.ts similarity index 100% rename from utils/hardhat-storage/src/internal/misc.ts rename to utils/hardhat-storage/src/internal/is-present.ts diff --git a/utils/hardhat-storage/src/internal/iterators.ts b/utils/hardhat-storage/src/internal/iterators.ts index 092671f89c..21c28c5fbf 100644 --- a/utils/hardhat-storage/src/internal/iterators.ts +++ b/utils/hardhat-storage/src/internal/iterators.ts @@ -1,67 +1,39 @@ -import { findAll } from '@synthetixio/core-utils/utils/ast/finders'; import { + AssemblyAssignment, ContractDefinition, FunctionDefinition, - SourceUnit, - VariableDeclaration, - YulAssignment, -} from 'solidity-ast/types'; +} from '@solidity-parser/parser/src/ast-types'; +import { StorageArtifact } from '../types'; +import { findAll } from './finders'; export function* iterateContracts( - sourceUnits: SourceUnit[], - filter?: (sourceUnit: SourceUnit, contractNode: ContractDefinition) => boolean -): Generator<[SourceUnit, ContractDefinition]> { - for (const sourceUnit of sourceUnits) { - for (const contractNode of findAll(sourceUnit, 'ContractDefinition')) { - if (!filter || filter(sourceUnit, contractNode)) { - yield [sourceUnit, contractNode]; - } - } - } -} - -export function* iterateVariables( - contractNodes: [SourceUnit, ContractDefinition][], - filter?: (node: VariableDeclaration) => boolean -): Generator<[SourceUnit, ContractDefinition, VariableDeclaration]> { - for (const [sourceUnit, contractNode] of contractNodes) { - for (const variableNode of findAll(contractNode, 'VariableDeclaration', filter)) { - yield [sourceUnit, contractNode, variableNode]; - } - } -} - -export function* iterateFunctions( - sourceUnits: SourceUnit[], - filter?: (node: FunctionDefinition) => boolean -): Generator<[SourceUnit, ContractDefinition, FunctionDefinition]> { - for (const [sourceUnit, contractNode] of iterateContracts(sourceUnits)) { - for (const functionNode of findAll(contractNode, 'FunctionDefinition', filter)) { - yield [sourceUnit, contractNode, functionNode]; + artifacts: StorageArtifact[] +): Generator<[StorageArtifact, ContractDefinition]> { + for (const artifact of artifacts) { + for (const contractNode of findAll(artifact.ast, 'ContractDefinition')) { + yield [artifact, contractNode]; } } } export function* iterateSlotAssignments( - sourceUnits: SourceUnit[] -): Generator<[SourceUnit, ContractDefinition, FunctionDefinition, YulAssignment]> { - for (const [sourceUnit, contractNode, functionNode] of iterateFunctions( - sourceUnits, - _isPureInternal - )) { - // Do not include slot assignments from coverage - if (functionNode.name.startsWith('c_')) continue; - - const yulAssignments = findAll(functionNode, 'YulAssignment', (node) => { - return node.variableNames[0].name.endsWith('.slot'); - }); + artifacts: StorageArtifact[] +): Generator<[StorageArtifact, ContractDefinition, FunctionDefinition, AssemblyAssignment]> { + for (const [artifact, contractNode] of iterateContracts(artifacts)) { + for (const functionNode of findAll(contractNode, 'FunctionDefinition', _isPureInternal)) { + const assignments = findAll(functionNode, 'AssemblyAssignment', (node) => { + return ( + node.names[0].type === 'AssemblyMemberAccess' && node.names[0].memberName.name === 'slot' + ); + }); + + if (!assignments.length) continue; + if (assignments.length > 1) { + throw new Error('Cannon have a function that assigns slots several times'); + } - if (!yulAssignments.length) continue; - if (yulAssignments.length > 1) { - throw new Error('Cannon have a function that assigns slots several times'); + yield [artifact, contractNode, functionNode, assignments[0]]; } - - yield [sourceUnit, contractNode, functionNode, yulAssignments[0]]; } } diff --git a/utils/hardhat-storage/src/internal/layout.ts b/utils/hardhat-storage/src/internal/layout.ts new file mode 100644 index 0000000000..4a39f1e6f0 --- /dev/null +++ b/utils/hardhat-storage/src/internal/layout.ts @@ -0,0 +1,142 @@ +import { clone } from '@synthetixio/core-utils/utils/misc/clone'; +import { StorageSlot } from '../types'; + +const SLOT_SIZE = 32; + +/** + * Get the size on the storage layout for the given variable types. + * Keep in mind that this function gets the static size for the slot, and not + * the total dynamic size that could change durin execution, like from "bytes" or "string" vars. + * More info: https://docs.soliditylang.org/en/latest/internals/layout_in_storage.html + */ +export function getStorageSlotSize(slot: StorageSlot): number { + if (slot.type === 'bool') return 1; + + if (slot.type === 'address') return 20; + + if (slot.type === 'enum') { + const { length } = slot.members; + if (length < 1) throw new Error('Invalid enum size'); + const bitsSize = Math.ceil(Math.log2(length)) || 1; + return Math.ceil(bitsSize / 8); + } + + if (slot.type.startsWith('uint') || slot.type.startsWith('int')) { + const bits = _parseBasicTypeSize(slot.type, 256); + if (bits % 8 !== 0 || bits < 8) { + throw new Error(`Invalid bit size for type "${slot.type}"`); + } + return bits / 8; + } + + // These types always occupy 32 bytes, which only include a pointer to the real + // storage slot being used to save the data. + if (['bytes', 'string', 'mapping'].includes(slot.type)) { + return SLOT_SIZE; + } + + if (slot.type === 'array') { + // Dynamic arrays always occupy 32 bytes, because the data is saved on another slot. + if (!Number.isSafeInteger(slot.length)) return SLOT_SIZE; + // Static arrays save the data in place. + const valueSize = getStorageSlotSize(slot.value); + return sumStorageSlotSizes(new Array(slot.length).fill(valueSize), true); + } + + // bytesX size work the same as static arrays + if (slot.type.startsWith('bytes')) { + const bytes = _parseBasicTypeSize(slot.type, SLOT_SIZE); + return bytes; + } + + // These are not fully implemented yet: https://docs.soliditylang.org/en/latest/types.html#fixed-point-numbers + if (slot.type.startsWith('ufixed') || slot.type.startsWith('fixed')) { + throw new Error(`Type "${slot.type}" for storage size calculation not implemented`); + } + + // structs are saved in place, occupying the sum of all of its members + if (slot.type === 'struct') { + const sizes = slot.members.map(getStorageSlotSize).flat(); + return sumStorageSlotSizes(sizes, true); + } + + const err = new Error(`Storage slot size calculation not implemented for "${slot.type}"`); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (err as any).slot = slot; + throw err; +} + +/** + * Calculate the sum of the given slot sizes using slot assignment logic. If the + * current one does not get into the remaining space from the previous slot, it + * should start from a new one. + * @param slotsSizes an array of slot size values + * @param fillLastSlot true if it should full the size for the last slot, to occupy it completely + */ +export function sumStorageSlotSizes(slotsSizes: number[], fillLastSlot = false): number { + let size = 0; + + // First add up all slot sizes. If the current one does not get into the + // remaining space from the previous slot, it should start from a new one. + for (const slotSize of slotsSizes) { + const currentSlotSize = size % SLOT_SIZE; + if (currentSlotSize + slotSize <= SLOT_SIZE) { + size += slotSize; + } else { + size += SLOT_SIZE - currentSlotSize + slotSize; + } + } + + // Some size calculation should fill up the last slot, this is the case for + // structs and arrays because the next slot from these should be a new one. + return fillLastSlot ? SLOT_SIZE * Math.ceil(size / SLOT_SIZE) : size; +} + +/** + * Adds the "size", "slot" and "offset" properties to the given set of slots + * Taking into account how should they share slots when necessary. + */ +export function hidrateSlotsLayout(slots: StorageSlot[]) { + const cloned = clone(slots); + + for (let i = 0; i < cloned.length; i++) { + const prev: StorageSlot | undefined = cloned[i - 1]; + const slot = cloned[i]; + + slot.size = getStorageSlotSize(slot); + slot.slot = '0'; + slot.offset = 0; + + // Calculate slot number + if (prev) { + const remaining = SLOT_SIZE - (prev.offset! + prev.size!); + + // Check if we can pack it with the previous slot + if (remaining >= slot.size) { + slot.slot = prev.slot; + slot.offset = SLOT_SIZE - remaining; + } else { + // In the case that the previous variable occupies more than a single + // slot, namely structs. + const prevAmount = Math.ceil((prev.offset! + prev.size!) / SLOT_SIZE); + slot.slot = (Number.parseInt(prev.slot!) + prevAmount).toString(); + } + } + } + + return cloned; +} + +/** + * Get the amount of bts for the given type, e.g. + * _parseBasicTypeSize('uint128', 256) => 128 + * _parseBasicTypeSize('int', 256) => 256 + */ +function _parseBasicTypeSize(type: string, max = 256) { + const match = type.match(/^[a-z]+([1-9]+[0-9]*)?$/); + if (!match) throw new Error(`Invalid type "${type}"`); + if (!match[1]) return max; + const bits = Number.parseInt(match[1]); + if (bits === 0 || bits > max) throw new Error(`Invalid type "${type}"`); + return bits; +} diff --git a/utils/hardhat-storage/src/internal/log-in-chunks.ts b/utils/hardhat-storage/src/internal/log-in-chunks.ts new file mode 100644 index 0000000000..dda4f78fd4 --- /dev/null +++ b/utils/hardhat-storage/src/internal/log-in-chunks.ts @@ -0,0 +1,15 @@ +/** + * Helper function to write output to the console, uses process.stdout.write and + * write in chunks because bash piping seems to have some sort of a problem with + * outputting huge amounts of data all at once while using pipes. + */ +export function logInChunks(data: unknown) { + const _data = typeof data === 'string' ? data : JSON.stringify(data, null, 2); + const chunkSize = 16; + + for (let i = 0; i < _data.length; i += chunkSize) { + process.stdout.write(_data.slice(i, i + chunkSize)); + } + + return _data; +} diff --git a/utils/hardhat-storage/src/internal/path-helpers.ts b/utils/hardhat-storage/src/internal/path-helpers.ts new file mode 100644 index 0000000000..9102d9cc3e --- /dev/null +++ b/utils/hardhat-storage/src/internal/path-helpers.ts @@ -0,0 +1,23 @@ +import path from 'node:path'; + +export function ensureTrailingSlash(basePath: string) { + basePath = path.normalize(basePath); + return basePath.endsWith(path.sep) ? basePath : `${basePath}${path.sep}`; +} + +export function removeBasePath(basePath: string, fullPath: string) { + basePath = path.normalize(basePath); + fullPath = path.normalize(fullPath); + + if (!basePath.endsWith(path.sep)) basePath += path.sep; + + if (!fullPath.startsWith(basePath)) { + throw new Error(`The path "${fullPath}" is not inside "${fullPath}"`); + } + + return fullPath.substring(basePath.length); +} + +export function isExplicitRelativePath(sourceName: string) { + return sourceName.startsWith('./') || sourceName.startsWith('../'); +} diff --git a/utils/hardhat-storage/src/internal/read-hardhat-artifact.ts b/utils/hardhat-storage/src/internal/read-hardhat-artifact.ts new file mode 100644 index 0000000000..8a24f9c30f --- /dev/null +++ b/utils/hardhat-storage/src/internal/read-hardhat-artifact.ts @@ -0,0 +1,31 @@ +import path from 'node:path'; +import { findClosestPackageJson, getPackageName } from 'hardhat/internal/util/packageInfo'; +import { HardhatRuntimeEnvironment } from 'hardhat/types'; +import memoize from 'lodash.memoize'; +import { readArtifact } from './artifacts'; +import { ensureTrailingSlash } from './path-helpers'; + +export const readArtifactCached = memoize(readArtifact, (...args) => + args.join(',') +) as typeof readArtifact; + +export async function readHardhatArtifact(hre: HardhatRuntimeEnvironment, sourceName: string) { + const sourceFullPath = path.join(hre.config.paths.root, sourceName); + const isLocalSource = sourceFullPath.startsWith(ensureTrailingSlash(hre.config.paths.sources)); + + if (isLocalSource) { + return readArtifactCached(hre.config.paths.root, sourceName); + } else { + const sourceFullPath = require.resolve(sourceName); + const projectPackageJson = findClosestPackageJson(sourceFullPath); + + if (!projectPackageJson) { + throw new Error(`Could not find project root for "${sourceName}"`); + } + + const dependencyRoot = path.dirname(projectPackageJson); + const packageName = await getPackageName(projectPackageJson); + + return readArtifactCached(dependencyRoot, sourceName, packageName); + } +} diff --git a/utils/hardhat-storage/src/internal/render.ts b/utils/hardhat-storage/src/internal/render.ts index be654ba2f0..680d0a4ed8 100644 --- a/utils/hardhat-storage/src/internal/render.ts +++ b/utils/hardhat-storage/src/internal/render.ts @@ -1,32 +1,20 @@ -import { Node, YulNode } from 'solidity-ast/node'; -import { - ArrayTypeName, - Block, +import type { + ASTNode, + AssemblyItem, + PragmaDirective, + SourceUnit, ContractDefinition, + BaseASTNode, + StructDefinition, + VariableDeclaration, ElementaryTypeName, - ElementaryTypeNameExpression, + ArrayTypeName, + UserDefinedTypeName, + ImportDirective, + Mapping, EnumDefinition, EnumValue, - FunctionCall, - FunctionDefinition, - Identifier, - InlineAssembly, - Literal, - Mapping, - MemberAccess, - ParameterList, - PragmaDirective, - StructDefinition, - UnaryOperation, - BinaryOperation, - UserDefinedTypeName, - VariableDeclaration, - VariableDeclarationStatement, - YulAssignment, - YulBlock, - YulIdentifier, - YulLiteral, -} from 'solidity-ast/types'; +} from '@solidity-parser/parser/src/ast-types'; const TAB = ' '; @@ -34,15 +22,15 @@ const TAB = ' '; * Minimal solidity renderer, only renders contracts with storage slot assignments * and struct declarations. */ -export function render(node: T) { - if (!_has(_render, node.nodeType)) { +export function render(node: T) { + if (!_has(_render, node.type)) { console.log(JSON.stringify(node, null, 2)); - throw new Error(`Rendering of node of type "${node?.nodeType}" not implemented`); + throw new Error(`Rendering of node of type "${node?.type}" not implemented`); } try { // eslint-disable-next-line @typescript-eslint/no-explicit-any - return _render[node.nodeType](node as any); + return _render[node.type](node as any); } catch (err) { console.log(JSON.stringify(node, null, 2)); throw err; @@ -51,202 +39,126 @@ export function render(node: T) { function _renderSemicolons(parentType: keyof typeof _colons) { return function (node: Parameters[0]) { - const semi = _colons[parentType].includes(node.nodeType) ? ';' : ''; + const semi = _colons[parentType].includes(node.type) ? ';' : ''; return render(node) + semi; }; } const _colons = { ContractDefinition: [ - 'ErrorDefinition', + 'CustomErrorDefinition', 'EventDefinition', 'ModifierDefinition', - 'UsingForDirective', + 'UsingForDeclaration', 'VariableDeclaration', ], StructDefinition: ['VariableDeclaration'], Block: [ 'EmitStatement', 'ExpressionStatement', - 'Return', + 'ReturnStatement', 'RevertStatement', 'VariableDeclarationStatement', ], - YulBlock: [ - 'YulAssignment', - 'YulBreak', - 'YulContinue', - 'YulExpressionStatement', - 'YulLeave', - 'YulVariableDeclaration', - ], }; -const _render = { - PragmaDirective(node: PragmaDirective) { - const [solidity, ...version] = node.literals; - return `pragma ${solidity} ${version.join('')};`; - }, - - VariableDeclaration(node: VariableDeclaration) { - const val: string[] = [render(node.typeName!) as string]; - - if (node.stateVariable) val.push(node.visibility); - if (node.mutability !== 'mutable') val.push(node.mutability); - if (node.storageLocation !== 'default') val.push(node.storageLocation); - - val.push(node.name); - - if (node.value) val.push('=', render(node.value)); - - return `${val.join(' ')}`; - }, - - VariableDeclarationStatement(node: VariableDeclarationStatement): string { - if (node.declarations.length !== 1 || !node.declarations[0]) { - throw new Error('Rendering of node not implemented'); - } - - const declaration = render(node.declarations[0]); - - return node.initialValue ? `${declaration} = ${render(node.initialValue)}` : declaration; - }, - - ElementaryTypeName(node: ElementaryTypeName) { - return node.name; - }, - - EnumDefinition(node: EnumDefinition) { - if (!Array.isArray(node.members) || !node.members.length) return 'enum {}'; - const members: string[] = node.members.map(render).map(_indent()); - return [`enum ${node.name} {`, members.join(',\n'), '}'].join('\n'); - }, - - EnumValue(node: EnumValue) { - return node.name; - }, - - UserDefinedTypeName(node: UserDefinedTypeName) { - if (node.typeDescriptions.typeString?.startsWith('contract ')) { - return 'address'; - } - - return node.pathNode!.name; - }, - - Mapping(node: Mapping): string { - return `mapping(${render(node.keyType)} => ${render(node.valueType)})`; - }, +const _normalize = { + int: 'int256', + uint: 'uint256', + byte: 'bytes1', + ufixed: 'ufixed128x18', + fixed: 'fixed128x18', +}; - ArrayTypeName(node: ArrayTypeName): string { - return `${render(node.baseType)}[]`; +const _render = { + SourceUnit(node: SourceUnit) { + const children: string[] = node.children.map(render); + return children.join('\n\n'); }, - Literal(node: Literal) { - if (!node.isPure || !['number', 'string'].includes(node.kind)) { - throw new Error('Rendering of node not implemented'); - } - - return node.kind === 'string' ? `"${node.value}"` : `${node.value}`; + PragmaDirective(node: PragmaDirective) { + return `pragma ${node.name} ${node.value};`; }, - YulLiteral(node: YulLiteral) { - if (!['number', 'string'].includes(node.kind)) { - throw new Error('Rendering of node not implemented'); + ImportDirective(node: ImportDirective) { + if (node.symbolAliases) { + const aliases = node.symbolAliases.map(([from, to]) => `${from}${to ? ` as ${to}` : ''}`); + return `import {${aliases.join(', ')}} from "${node.pathLiteral.value}";`; + } else { + return `import "${node.pathLiteral.value}";`; } - - return node.kind === 'string' ? `"${node.value}"` : `${node.value}`; }, ContractDefinition(node: ContractDefinition) { - const children: string = node.nodes + const children: string = node.subNodes .map(_renderSemicolons('ContractDefinition')) .map(_indent()) .join('\n'); - return [`${node.contractKind} ${node.name} {`, children, '}'].join('\n'); + + return [`${node.kind} ${node.name} {`, children, '}'].join('\n'); }, StructDefinition(node: StructDefinition) { - if (node.visibility !== 'public') throw new Error('Rendering of node not implemented'); const vars: string = node.members .map(_renderSemicolons('StructDefinition')) .map(_indent()) .join('\n'); + return [`struct ${node.name} {`, vars, '}'].join('\n'); }, - FunctionDefinition(node: FunctionDefinition) { - if (node.kind !== 'function') throw new Error('Rendering of node not implemented'); - if (node.modifiers.length) throw new Error('Rendering of node not implemented'); - if (node.overrides) throw new Error('Rendering of node not implemented'); - - const params: string = render(node.parameters); - const attrs: string[] = [node.visibility, node.stateMutability]; + VariableDeclaration(node: VariableDeclaration) { + const val: string[] = [render(node.typeName!) as string]; - if (node.virtual) attrs.push('virtual'); - if (node.returnParameters.parameters.length) { - attrs.push(`returns (${render(node.returnParameters)})`); + if (node.visibility && !['internal', 'default'].includes(node.visibility)) { + val.push(node.visibility); } - const semi = node.body ? '' : ';'; - const block: string = node.body ? render(node.body) : ''; - - return `function ${node.name}(${params}) ${attrs.join(' ')}${semi}${block}`; - }, - - ParameterList(node: ParameterList): string { - return node.parameters.map(render).join(', '); - }, + if (node.isDeclaredConst) val.push('constant'); + if (node.storageLocation) val.push(node.storageLocation); - Block(node: Block) { - if (!Array.isArray(node.statements) || !node.statements.length) return ' {}'; - const statements: string[] = node.statements.map(_renderSemicolons('Block')).map(_indent()); - return [' {', ...statements, '}'].join('\n'); - }, + if (typeof node.name !== 'string' || !node.name) { + throw new Error('Missing variable name'); + } - YulBlock(node: YulBlock) { - if (!Array.isArray(node.statements) || !node.statements.length) return ' {}'; - const statements: string[] = node.statements.map(render).map(_indent()); - return ['assembly {', ...statements, '}'].join('\n'); - }, + val.push(node.name); - YulAssignment(node: YulAssignment): string { - if (node.variableNames.length !== 1) throw new Error('Rendering of node not implemented'); - return `${render(node.variableNames[0])} := ${render(node.value)}`; + return `${val.join(' ')}`; }, - InlineAssembly(node: InlineAssembly): string { - return render(node.AST); + ElementaryTypeName(node: ElementaryTypeName) { + const key = node.name as keyof typeof _normalize; + return _normalize[key] || key; }, - FunctionCall(node: FunctionCall) { - const name: string = render(node.expression); - const params: string[] = node.arguments.map(render); - return `${name}(${params.join(', ')})`; - }, + ArrayTypeName(node: ArrayTypeName): string { + if (node.length) { + throw new Error('Rendering of ArrayTypeName with length not implemented'); + } - Identifier(node: Identifier) { - return node.name; + return `${render(node.baseTypeName)}[]`; }, - YulIdentifier(node: YulIdentifier) { - return node.name; - }, + Mapping(node: Mapping): string { + if (node.keyName || node.valueName) { + throw new Error('Rendering of Mapping with keyName or valueName not implemented'); + } - ElementaryTypeNameExpression(node: ElementaryTypeNameExpression) { - return node.typeName.name; + return `mapping(${render(node.keyType)} => ${render(node.valueType)})`; }, - MemberAccess(node: MemberAccess): string { - return `${render(node.expression)}.${node.memberName}`; + UserDefinedTypeName(node: UserDefinedTypeName) { + return node.namePath; }, - UnaryOperation(node: UnaryOperation): string { - return `${node.operator}${render(node.subExpression)}`; + EnumDefinition(node: EnumDefinition) { + if (!Array.isArray(node.members) || !node.members.length) return 'enum {}'; + const members: string[] = node.members.map(render).map(_indent()); + return [`enum ${node.name} {`, members.join(',\n'), '}'].join('\n'); }, - BinaryOperation(node: BinaryOperation): string { - return `${render(node.leftExpression)} ${node.operator} ${render(node.rightExpression)}`; + EnumValue(node: EnumValue) { + return node.name; }, }; diff --git a/utils/hardhat-storage/src/internal/validate-namespace.ts b/utils/hardhat-storage/src/internal/validate-namespace.ts index bf567789f2..a488fed96e 100644 --- a/utils/hardhat-storage/src/internal/validate-namespace.ts +++ b/utils/hardhat-storage/src/internal/validate-namespace.ts @@ -1,83 +1,76 @@ -import { findOne } from '@synthetixio/core-utils/utils/ast/finders'; -import { Node, YulNode } from 'solidity-ast/node'; -import { FunctionCall, FunctionDefinition, VariableDeclaration } from 'solidity-ast/types'; +import { + ASTNode, + ContractDefinition, + FunctionDefinition, + Identifier, + VariableDeclaration, +} from '@solidity-parser/parser/src/ast-types'; +import { parseFullyQualifiedName } from 'hardhat/utils/contract-names'; +import { GetArtifactFunction } from '../types'; import { createError } from './error'; +import { findOne } from './finders'; +import { isPresent } from './is-present'; import { iterateSlotAssignments } from './iterators'; -import { isPresent } from './misc'; -import { ValidateParams } from './validate'; -export function validateSlotNamespaceCollisions({ sourceUnits }: ValidateParams) { +interface Params { + contracts: string[]; + getArtifact: GetArtifactFunction; +} + +export async function validateSlotNamespaceCollisions({ contracts, getArtifact }: Params) { const slots: string[] = []; - return [...iterateSlotAssignments(sourceUnits)] - .map(([sourceUnit, contractNode, functionNode, yulAssignment]) => { - const _error = (message: string, ...nodes: (Node | YulNode)[]) => ({ + const artifacts = await Promise.all( + contracts.map(async (fqName) => { + const { sourceName } = parseFullyQualifiedName(fqName); + return await getArtifact(sourceName); + }) + ); + + return [...iterateSlotAssignments(artifacts)] + .map(([artifact, contractNode, functionNode, yulAssignment]) => { + const _error = (message: string, ...nodes: ASTNode[]) => ({ message, - sourceUnit, + sourceName: artifact.sourceName, nodes: [contractNode, functionNode, ...nodes], }); - const val = yulAssignment.value; + const val = yulAssignment.expression; // The assignment of the .slot value should be an existing variable - if (val.nodeType !== 'YulIdentifier') { + if (val.type !== 'AssemblyCall') { return _error( 'Store assignments can only be assignments to a constant value in the contract', yulAssignment ); } - // Find when the value is declared inside the current function - const varStatement = _findVariableDeclarationStatementOf(functionNode, val.name); + // Find the declaration of the value + const varStatement = _findVariableDeclarationStatementOf( + contractNode, + functionNode, + val.functionName + ); if (!varStatement) { - return _error(`Could not find variable declaration value for "${val.name}"`, val); + return _error(`Could not find variable declaration value for "${val.functionName}"`, val); } if (!varStatement.initialValue) { return _error('Slot value not initialized', varStatement); } - let slotValue: FunctionCall; - - // If the slot value is a function call, is a dynamic value initialized inside - // the function - if (varStatement.initialValue.nodeType === 'FunctionCall') { - slotValue = varStatement.initialValue; - // If it is an identifier, it should be pointing to a contract constant - } else if (varStatement.initialValue.nodeType === 'Identifier') { - const slotName = varStatement.initialValue.name; - - const constantDeclaration = contractNode.nodes.find( - (node) => - node.nodeType === 'VariableDeclaration' && node.constant && node.name === slotName - ) as VariableDeclaration | undefined; - - if (!constantDeclaration?.value || constantDeclaration.value.nodeType !== 'FunctionCall') { - return _error( - 'Slot value should be a contract constant with a value initialized', - varStatement - ); - } - - slotValue = constantDeclaration.value; - } else { - return _error( - 'Slot value should be a contract constant or a dynamic local value', - varStatement - ); - } - - // Get the first string key value from keccak256(abi.encode("slot-name", ...)) - const slotKey = _getSlotValueFromFunctionCall(slotValue); + const slotValue = findOne(varStatement, 'StringLiteral'); - if (!slotKey) { + if (!slotValue) { return _error( 'Store slot definition should have the format keccak256(abi.encode("your-slot-name", ...))', val ); } + const slotKey = slotValue.value; + if (slots.includes(slotKey)) { return _error(`Store slot name repeated: ${slotKey}`, val); } @@ -88,29 +81,30 @@ export function validateSlotNamespaceCollisions({ sourceUnits }: ValidateParams) .map((err) => createError(err)); } -function _findVariableDeclarationStatementOf(functionNode: FunctionDefinition, varName: string) { - return findOne(functionNode, 'VariableDeclarationStatement', (declarationStatement) => { - return !!findOne(declarationStatement, 'VariableDeclaration', ({ name }) => name === varName); +function _findVariableDeclarationStatementOf( + contractNode: ContractDefinition, + functionNode: FunctionDefinition, + varName: string +) { + const res = findOne(functionNode, 'VariableDeclarationStatement', (declarationStatement) => { + return ( + declarationStatement.variables.length === 1 && + declarationStatement.variables[0]?.type === 'VariableDeclaration' && + (declarationStatement.variables[0] as VariableDeclaration).name === varName + ); }); -} - -function _getSlotValueFromFunctionCall(slotValue: FunctionCall) { - if (slotValue.nodeType !== 'FunctionCall') return; - if (slotValue.typeDescriptions.typeString !== 'bytes32') return; - - const { expression } = slotValue; - if (expression.nodeType !== 'Identifier' || expression.name !== 'keccak256') return; - if (slotValue.arguments.length !== 1 || slotValue.arguments[0].nodeType !== 'FunctionCall') - return; - const encode = slotValue.arguments[0]; - if (encode.expression.nodeType !== 'MemberAccess' || encode.expression.memberName !== 'encode') - return; + if (!res || !res.initialValue) return; - if (encode.arguments.length === 0) return; - const [slotKey] = encode.arguments; - if (slotKey.nodeType !== 'Literal' || slotKey.kind !== 'string') return; - if (typeof slotKey.value !== 'string' || !slotKey.value) return; + if (res.initialValue.type === 'Identifier') { + return findOne(contractNode, 'StateVariableDeclaration', (stateVariable) => { + return !!findOne( + stateVariable, + 'VariableDeclaration', + ({ name }) => name === (res.initialValue as Identifier).name + ); + }); + } - return slotKey.value; + return res; } diff --git a/utils/hardhat-storage/src/internal/validate-variables.ts b/utils/hardhat-storage/src/internal/validate-variables.ts index ba72a19e55..34d37ac627 100644 --- a/utils/hardhat-storage/src/internal/validate-variables.ts +++ b/utils/hardhat-storage/src/internal/validate-variables.ts @@ -1,38 +1,48 @@ -import { filterContracts } from '@synthetixio/core-utils/utils/hardhat/contracts'; -import { getFullyQualifiedName } from 'hardhat/utils/contract-names'; -import { VariableDeclaration } from 'solidity-ast/types'; -import { createError } from './error'; -import { iterateContracts, iterateVariables } from './iterators'; -import { ValidateParams } from './validate'; +import { parseFullyQualifiedName } from 'hardhat/utils/contract-names'; +import { GetArtifactFunction } from '../types'; +import { findContractTree } from './artifacts'; +import { createError, ValidationError } from './error'; +import { findAll } from './finders'; -export function validateMutableStateVariables({ sourceUnits, skip }: ValidateParams) { - const contractNodes = [ - // Filter out contracts that are marked to be skipped - ...iterateContracts(sourceUnits, (sourceUnit, contractNode) => { - const sourceName = sourceUnit.absolutePath; - const contractName = contractNode.name; - const fqName = getFullyQualifiedName(sourceName, contractName); - return filterContracts([fqName, sourceName, contractName], skip).length === 0; - }), - ]; +import type { + StateVariableDeclarationVariable, + VariableDeclaration, +} from '@solidity-parser/parser/src/ast-types'; - // Find state variables - const invalidVars = [...iterateVariables(contractNodes, _isMutableStateVariable)]; +interface Params { + contracts: string[]; + getArtifact: GetArtifactFunction; +} - return invalidVars.map(([sourceUnit, contractNode, variableNode]) => - createError({ - message: - 'Unsafe state variable declaration. Mutable state variables cannot be declared on a contract behind a Proxy', - sourceUnit, - nodes: [contractNode, variableNode], - }) - ); +export async function validateMutableStateVariables({ contracts, getArtifact }: Params) { + const errors: ValidationError[] = []; + + for (const fqName of contracts) { + const { sourceName, contractName } = parseFullyQualifiedName(fqName); + const artifact = await getArtifact(sourceName); + const contractNodes = await findContractTree(getArtifact, artifact, contractName); + + for (const contractNode of contractNodes) { + for (const node of findAll(contractNode, 'VariableDeclaration', _isMutableStateVariable)) { + errors.push( + createError({ + message: + 'Unsafe state variable declaration. Mutable state variables cannot be declared on a contract behind a Proxy', + sourceName, + nodes: [contractNode, node], + }) + ); + } + } + } + + return errors; } -function _isMutableStateVariable(variableNode: VariableDeclaration) { +function _isMutableStateVariable(node: VariableDeclaration) { return ( - variableNode.stateVariable && - variableNode.mutability !== 'constant' && - variableNode.mutability !== 'immutable' + node.isStateVar && + !node.isDeclaredConst && + !(node as StateVariableDeclarationVariable).isImmutable ); } diff --git a/utils/hardhat-storage/src/internal/validate.ts b/utils/hardhat-storage/src/internal/validate.ts deleted file mode 100644 index 2c7dffb385..0000000000 --- a/utils/hardhat-storage/src/internal/validate.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { SourceUnit } from 'solidity-ast/types'; -import { validateSlotNamespaceCollisions } from './validate-namespace'; -import { validateMutableStateVariables } from './validate-variables'; - -export interface ValidateParams { - sourceUnits: SourceUnit[]; - prevSourceUnits: SourceUnit[]; - skip: string[]; -} - -export function validate(params: ValidateParams) { - return [...validateMutableStateVariables(params), ...validateSlotNamespaceCollisions(params)]; -} diff --git a/utils/hardhat-storage/src/internal/verify-mutations.ts b/utils/hardhat-storage/src/internal/verify-mutations.ts new file mode 100644 index 0000000000..c4bf3f539f --- /dev/null +++ b/utils/hardhat-storage/src/internal/verify-mutations.ts @@ -0,0 +1,130 @@ +import { parseFullyQualifiedName } from 'hardhat/utils/contract-names'; +import { StorageDump, StorageMutation, StorageSlot } from '../types'; +import { areDeepEqual } from './are-deep-equal'; + +export function verifyMutations(curr?: StorageDump, prev?: StorageDump) { + // 1. Do not change 'slot' or 'offset' on any storage slot + // 2. Show a warning when renaming a slot + // 2. Show a warning when changing type + // 3. Do not allow to remove variables + + const contractNames = _getUniqKeys(curr, prev); + const mutations: StorageMutation[] = []; + + for (const fqName of contractNames) { + const { contractName, sourceName } = parseFullyQualifiedName(fqName); + + const currStorageDump = curr?.[fqName]; + const prevStorageDump = prev?.[fqName]; + + // Check if the contract was added or deleted + if (currStorageDump && !prevStorageDump) { + mutations.push({ + type: 'log', + kind: 'add', + message: `Added ${currStorageDump.kind} ${contractName} at ${sourceName}`, + }); + continue; + } else if (!currStorageDump && prevStorageDump) { + mutations.push({ + type: 'log', + kind: 'del', + message: `Deleted ${prevStorageDump.kind} ${contractName} at ${sourceName}`, + }); + continue; + } + + const structNames = _getUniqKeys(currStorageDump?.structs, prevStorageDump?.structs); + + for (const structName of structNames) { + const currStruct = currStorageDump?.structs[structName]; + const prevStruct = prevStorageDump?.structs[structName]; + + // Check if the struct was added or deleted + if (currStruct && !prevStruct) { + mutations.push({ + type: 'log', + kind: 'add', + message: `Added struct ${contractName}.${structName} at ${sourceName}`, + }); + continue; + } else if (!currStruct && prevStruct) { + mutations.push({ + type: 'log', + kind: 'del', + message: `Deleted struct ${contractName}.${structName} at ${sourceName}`, + }); + continue; + } + + // Just needed for better types + if (!currStruct || !prevStruct) throw new Error('Invalid state'); + + // There are no changes on this struct + if (areDeepEqual(currStruct, prevStruct)) continue; + + // Check that the same variable in the struct was not modified + const commonVariableNames = _intersection( + currStruct.map((s) => s.name!), + prevStruct.map((s) => s.name!) + ); + for (const name of commonVariableNames) { + const currSlot = currStruct.find((s) => s.name === name)!; + const prevSlot = prevStruct.find((s) => s.name === name)!; + + if ( + currSlot.slot !== prevSlot.slot || + currSlot.offset !== prevSlot.offset || + currSlot.size !== prevSlot.size + ) { + mutations.push({ + type: 'error', + kind: 'update', + message: `Invalid modification of value "${currSlot.type} ${name}" in ${contractName}.${structName} at ${sourceName}`, + }); + continue; + } + } + + // Do not allow to remove variables (they should be renamed to unused) + for (const prevSlot of prevStruct) { + const currSlot = currStruct.find((s) => s.name === prevSlot.name); + + // Variable is still there, nothing to check + if (currSlot) continue; + + const renamedSlot = currStruct.find((slot) => _haveSameSlot(slot, prevSlot)); + + if (renamedSlot) { + mutations.push({ + type: 'log', + kind: 'update', + message: `Renamed variable "${prevSlot.type} ${prevSlot.name}" in ${contractName}.${structName} at ${sourceName}`, + }); + } else { + mutations.push({ + type: 'error', + kind: 'del', + message: `Deleted variable "${prevSlot.type} ${prevSlot.name}" in ${contractName}.${structName} at ${sourceName}`, + }); + } + } + } + } + + return mutations; +} + +function _getUniqKeys(...objs: ({ [k: string]: unknown } | undefined)[]) { + const set = new Set(); + for (const obj of objs) for (const k of Object.keys(obj || {})) set.add(k); + return Array.from(set).sort(); +} + +function _intersection(a: T[], b: T[]) { + return a.filter((v) => b.includes(v)); +} + +function _haveSameSlot(a: StorageSlot, b: StorageSlot) { + return a.slot === b.slot && a.offset === b.offset && a.size === b.size && a.type === b.type; +} diff --git a/utils/hardhat-storage/src/subtasks/get-artifacts.ts b/utils/hardhat-storage/src/subtasks/get-artifacts.ts new file mode 100644 index 0000000000..75f210aded --- /dev/null +++ b/utils/hardhat-storage/src/subtasks/get-artifacts.ts @@ -0,0 +1,17 @@ +import { filterContracts } from '@synthetixio/core-utils/utils/hardhat/contracts'; +import { subtask } from 'hardhat/config'; +import { readHardhatArtifact } from '../internal/read-hardhat-artifact'; +import { SUBTASK_GET_ARTIFACTS } from '../task-names'; +import { GetArtifactFunction } from '../types'; + +type Result = { + contracts: string[]; + getArtifact: GetArtifactFunction; +}; + +subtask(SUBTASK_GET_ARTIFACTS).setAction(async (_, hre) => { + const allFqNames = await hre.artifacts.getAllFullyQualifiedNames(); + const contracts = filterContracts(allFqNames, hre.config.storage.artifacts); + const getArtifact = (fqName: string) => readHardhatArtifact(hre, fqName); + return { contracts, getArtifact } satisfies Result; +}); diff --git a/utils/hardhat-storage/src/subtasks/get-source-units.ts b/utils/hardhat-storage/src/subtasks/get-source-units.ts deleted file mode 100644 index ffec56abd1..0000000000 --- a/utils/hardhat-storage/src/subtasks/get-source-units.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { getContractsAsts } from '@synthetixio/core-utils/utils/hardhat/contracts'; -import { subtask } from 'hardhat/config'; -import { iterateFunctions } from '../internal/iterators'; -import { SUBTASK_STORAGE_GET_SOURCE_UNITS } from '../task-names'; -import 'hardhat/types/runtime'; - -// Flag added by solidity-coverage module, necessary so we can check if it is being used -declare module 'hardhat/types/runtime' { - export interface HardhatRuntimeEnvironment { - __SOLIDITY_COVERAGE_RUNNING?: boolean; - } -} - -interface Params { - artifacts: string[]; -} - -subtask(SUBTASK_STORAGE_GET_SOURCE_UNITS).setAction(async ({ artifacts }: Params, hre) => { - const sourceUnits = await getContractsAsts(hre, artifacts); - - // When running coverage, remove function calls added by solidity-coverage - if (hre.__SOLIDITY_COVERAGE_RUNNING) { - for (const [, contractNode, functionNode] of iterateFunctions(sourceUnits)) { - // Remove function added to the contract - if (functionNode.name.startsWith('c_')) { - contractNode.nodes = contractNode.nodes.filter((node) => node !== functionNode); - continue; - } - - // Remove the function calls to the previously deleted coverage functions - if (Array.isArray(functionNode.body?.statements)) { - functionNode.body!.statements = functionNode.body!.statements.filter((node) => { - if (node.nodeType !== 'ExpressionStatement') return true; - const e = node.expression; - const isCoverage = - e.nodeType === 'FunctionCall' && - e.kind === 'functionCall' && - e.expression.nodeType === 'Identifier' && - e.expression.name.startsWith('c_'); - return !isCoverage; - }); - } - } - } - - return sourceUnits; -}); diff --git a/utils/hardhat-storage/src/subtasks/parse-contents.ts b/utils/hardhat-storage/src/subtasks/parse-contents.ts deleted file mode 100644 index ebc61d5780..0000000000 --- a/utils/hardhat-storage/src/subtasks/parse-contents.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { compileSolidityContents } from '@synthetixio/core-utils/utils/solidity/compiler'; -import { subtask } from 'hardhat/config'; -import { SUBTASK_STORAGE_PARSE_CONTENTS } from '../task-names'; - -subtask(SUBTASK_STORAGE_PARSE_CONTENTS).setAction(async ({ contents }, hre) => { - const version = hre.config.solidity.compilers[0].version; - return await compileSolidityContents(contents, version); -}); diff --git a/utils/hardhat-storage/src/subtasks/parse-dump.ts b/utils/hardhat-storage/src/subtasks/parse-dump.ts deleted file mode 100644 index e52d351b62..0000000000 --- a/utils/hardhat-storage/src/subtasks/parse-dump.ts +++ /dev/null @@ -1,16 +0,0 @@ -import fs from 'node:fs'; -import path from 'node:path'; -import { compileSolidityFolder } from '@synthetixio/core-utils/utils/solidity/compiler'; -import { subtask } from 'hardhat/config'; -import { SUBTASK_STORAGE_PARSE_DUMP } from '../task-names'; - -subtask(SUBTASK_STORAGE_PARSE_DUMP).setAction(async ({ output }, hre) => { - const version = hre.config.solidity.compilers[0].version; - const rootDir = hre.config.paths.root; - - if (!fs.existsSync(path.resolve(rootDir, output))) { - return []; - } - - return await compileSolidityFolder({ rootDir, version, sources: output }); -}); diff --git a/utils/hardhat-storage/src/subtasks/validate-contracts.ts b/utils/hardhat-storage/src/subtasks/validate-contracts.ts new file mode 100644 index 0000000000..ad50fe4c73 --- /dev/null +++ b/utils/hardhat-storage/src/subtasks/validate-contracts.ts @@ -0,0 +1,30 @@ +import { subtask } from 'hardhat/config'; +import { HardhatPluginError } from 'hardhat/plugins'; +import { validateSlotNamespaceCollisions } from '../internal/validate-namespace'; +import { SUBTASK_VALIDATE_CONTRACTS } from '../task-names'; +import { GetArtifactFunction } from '../types'; + +type Params = { + contracts: string[]; + getArtifact: GetArtifactFunction; +}; + +subtask(SUBTASK_VALIDATE_CONTRACTS).setAction(async ({ contracts, getArtifact }: Params) => { + const errors = await Promise.all([ + // TODO: find a way to selectively do the mutable state variables check on only necessary contracts + /*validateMutableStateVariables({ + contracts, + getArtifact, + }),*/ + validateSlotNamespaceCollisions({ + contracts, + getArtifact, + }), + ]).then((result) => result.flat()); + + errors.forEach((err) => console.error(err, '\n')); + + if (errors.length) { + throw new HardhatPluginError('hardhat-storage', 'Storage validation failed'); + } +}); diff --git a/utils/hardhat-storage/src/subtasks/verify-contracts.ts b/utils/hardhat-storage/src/subtasks/verify-contracts.ts new file mode 100644 index 0000000000..33423e74bd --- /dev/null +++ b/utils/hardhat-storage/src/subtasks/verify-contracts.ts @@ -0,0 +1,48 @@ +import { subtask } from 'hardhat/config'; +import { HardhatPluginError } from 'hardhat/plugins'; +import { verifyMutations } from '../internal/verify-mutations'; +import { SUBTASK_VERIFY_CONTRACTS } from '../task-names'; +import { StorageDump, StorageMutation } from '../types'; + +type Params = { + curr?: StorageDump; + prev?: StorageDump; + quiet?: boolean; +}; + +subtask(SUBTASK_VERIFY_CONTRACTS).setAction(async ({ curr, prev, quiet }: Params) => { + const mutations = verifyMutations(curr, prev); + + if (mutations.some((m) => m.type === 'error')) { + const errors = mutations.filter((m) => m.type === 'error'); + console.log(); + for (const m of errors) _printMutation(m); + console.log(); + throw new HardhatPluginError( + 'hardhat-storage', + 'Invalid storage mutations found, please fix them before continuing' + ); + } + + if (!quiet) { + console.log(); + if (mutations.length) { + for (const m of mutations) _printMutation(m); + } else { + console.log('No storage mutations detected'); + } + console.log(); + } + + return mutations; +}); + +const prefixes = { + add: '+ ', + update: '+-', + del: '- ', +} satisfies Record; + +function _printMutation(mutation: StorageMutation) { + console[mutation.type](`${prefixes[mutation.kind]} ${mutation.message}`); +} diff --git a/utils/hardhat-storage/src/task-names.ts b/utils/hardhat-storage/src/task-names.ts index 3de5339ffb..c13be5f3c3 100644 --- a/utils/hardhat-storage/src/task-names.ts +++ b/utils/hardhat-storage/src/task-names.ts @@ -1,6 +1,9 @@ export const SUBTASK_GENERATE_TESTABLE_STORAGE = 'storage:generate-testable-storage'; -export const SUBTASK_STORAGE_GET_SOURCE_UNITS = 'storage:get-source-units'; -export const SUBTASK_STORAGE_PARSE_CONTENTS = 'storage:parse-contents'; -export const SUBTASK_STORAGE_PARSE_DUMP = 'storage:parse-dump'; +export const SUBTASK_GET_ARTIFACTS = 'storage:get-artifacts'; +export const SUBTASK_VALIDATE_CONTRACTS = 'storage:validate-contracts'; +export const SUBTASK_VERIFY_CONTRACTS = 'storage:verify-contracts'; export const TASK_GENERATE_TESTABLE = 'generate-testable'; +export const TASK_STORAGE_DUMP = 'storage:dump'; +export const TASK_STORAGE_LAYOUT = 'storage:layout'; +export const TASK_STORAGE_VALIDATE = 'storage:validate'; export const TASK_STORAGE_VERIFY = 'storage:verify'; diff --git a/utils/hardhat-storage/src/tasks/dump.ts b/utils/hardhat-storage/src/tasks/dump.ts new file mode 100644 index 0000000000..276913e828 --- /dev/null +++ b/utils/hardhat-storage/src/tasks/dump.ts @@ -0,0 +1,69 @@ +import path from 'node:path'; +import logger from '@synthetixio/core-utils/utils/io/logger'; +import { task } from 'hardhat/config'; +import { dumpStorage } from '../internal/dump'; +import { readJsonFileSafe, writeJsonFile } from '../internal/file-helpers'; +import { logInChunks } from '../internal/log-in-chunks'; +import { + TASK_STORAGE_DUMP, + SUBTASK_GET_ARTIFACTS, + SUBTASK_VALIDATE_CONTRACTS, + SUBTASK_VERIFY_CONTRACTS, +} from '../task-names'; +import { StorageDump } from '../types'; + +interface Params { + output: string; + noValidate: boolean; + noVerify: boolean; + quiet: boolean; + log: boolean; +} + +task(TASK_STORAGE_DUMP, 'Dump storage slots to a file') + .addOptionalParam( + 'output', + 'Storage dump output file relative to the root of the project', + 'storage.dump.json' + ) + .addFlag('noValidate', 'Do not perform static validations on contracts before generating') + .addFlag('noVerify', 'Do not verify storage mutations before replacing dump') + .addFlag('quiet', 'only emit errors to the console') + .addFlag('log', 'log json result to the console') + .setAction(async (params: Params, hre) => { + const { output, noValidate, noVerify, log, quiet } = params; + + const now = Date.now(); + const target = path.resolve(hre.config.paths.root, output); + + await hre.run('compile'); + + const { contracts, getArtifact } = await hre.run(SUBTASK_GET_ARTIFACTS); + + if (!noValidate) { + await hre.run(SUBTASK_VALIDATE_CONTRACTS, { contracts, getArtifact }); + } + + const dump = await dumpStorage({ contracts, getArtifact }); + + if (!noVerify) { + const prev = await readJsonFileSafe(target); + await hre.run(SUBTASK_VERIFY_CONTRACTS, { + curr: dump, + prev, + quiet: log || quiet, + }); + } + + if (output && dump) { + await writeJsonFile(target, dump); + } + + if (log) { + if (dump) logInChunks(dump); + } else if (!quiet) { + logger.success(`Storage dump finished in ${Date.now() - now}ms`); + } + + return dump; + }); diff --git a/utils/hardhat-storage/src/tasks/layout.ts b/utils/hardhat-storage/src/tasks/layout.ts new file mode 100644 index 0000000000..1087cf8fb9 --- /dev/null +++ b/utils/hardhat-storage/src/tasks/layout.ts @@ -0,0 +1,68 @@ +import chalk from 'chalk'; +import Table from 'cli-table3'; +import { task } from 'hardhat/config'; +import { dumpStorage } from '../internal/dump'; +import { SUBTASK_GET_ARTIFACTS, TASK_STORAGE_LAYOUT } from '../task-names'; + +const defaultTable = { + chars: { + top: '', + 'top-mid': '', + 'top-left': '', + 'top-right': '', + bottom: '', + 'bottom-mid': '', + 'bottom-left': '', + 'bottom-right': '', + left: '', + 'left-mid': '', + mid: '', + 'mid-mid': '', + right: '', + 'right-mid': '', + middle: ' ', + }, + style: { + // 'padding-left': 0, + // 'padding-right': 0, + head: [], + border: [], + }, +}; +task(TASK_STORAGE_LAYOUT, 'Pretty print the storage layout of all the contracts').setAction( + async (_, hre) => { + const { contracts, getArtifact } = await hre.run(SUBTASK_GET_ARTIFACTS); + const dump = await dumpStorage({ contracts, getArtifact }); + + if (!dump) return; + + console.log(); + + for (const fqName of Object.keys(dump)) { + const storageDump = dump[fqName]!; + const kind = storageDump!.kind; + + console.log(`${chalk.bold(chalk.underline(`${kind} ${fqName}`))}`); + + for (const structName of Object.keys(storageDump.structs)) { + const slots = storageDump.structs[structName]!; + console.log(` struct ${structName}`); + + const table = new Table({ + ...defaultTable, + head: ['slot', 'offset', 'size', 'type', 'name'].map((t) => (t ? chalk.dim(t) : t)), + colWidths: [null, null, null, null, null], + }); + + for (const slot of slots) { + table.push([slot.slot, slot.offset, slot.size, slot.type, slot.name]); + } + + console.log(table.toString().replace(/^/gm, ' ')); + console.log(''); + } + + console.log(''); + } + } +); diff --git a/utils/hardhat-storage/src/tasks/validate.ts b/utils/hardhat-storage/src/tasks/validate.ts new file mode 100644 index 0000000000..68dd7793a5 --- /dev/null +++ b/utils/hardhat-storage/src/tasks/validate.ts @@ -0,0 +1,25 @@ +import logger from '@synthetixio/core-utils/utils/io/logger'; +import { task } from 'hardhat/config'; +import { + SUBTASK_GET_ARTIFACTS, + SUBTASK_VALIDATE_CONTRACTS, + TASK_STORAGE_VALIDATE, +} from '../task-names'; + +task( + TASK_STORAGE_VALIDATE, + 'Validate state variables usage and storage slot names behind routers' +).setAction(async (_, hre) => { + const now = Date.now(); + + logger.subtitle('Validating store'); + + for (const contract of hre.config.storage.artifacts) { + logger.info(contract); + } + + const { contracts, getArtifact } = await hre.run(SUBTASK_GET_ARTIFACTS); + await hre.run(SUBTASK_VALIDATE_CONTRACTS, { contracts, getArtifact }); + + logger.success(`state variables and storage slots valid (${Date.now() - now}ms)`); +}); diff --git a/utils/hardhat-storage/src/tasks/verify.ts b/utils/hardhat-storage/src/tasks/verify.ts index 0974f47ea7..175f48a47c 100644 --- a/utils/hardhat-storage/src/tasks/verify.ts +++ b/utils/hardhat-storage/src/tasks/verify.ts @@ -1,110 +1,31 @@ -import fs from 'node:fs/promises'; import path from 'node:path'; -import * as types from '@synthetixio/core-utils/utils/hardhat/argument-types'; -import { getContractsFullyQualifiedNames } from '@synthetixio/core-utils/utils/hardhat/contracts'; -import logger from '@synthetixio/core-utils/utils/io/logger'; import { task } from 'hardhat/config'; -import { HardhatPluginError } from 'hardhat/plugins'; -import { HardhatConfig } from 'hardhat/types/config'; -import { dumpStorage } from '../internal/dump'; -import { validate } from '../internal/validate'; -import { - SUBTASK_STORAGE_GET_SOURCE_UNITS, - SUBTASK_STORAGE_PARSE_CONTENTS, - SUBTASK_STORAGE_PARSE_DUMP, - TASK_STORAGE_VERIFY, -} from '../task-names'; +import { readJsonFile } from '../internal/file-helpers'; +import { SUBTASK_VERIFY_CONTRACTS, TASK_STORAGE_VERIFY } from '../task-names'; +import { StorageDump } from '../types'; interface Params { - artifacts?: string[]; - skip?: string[]; - output?: string; - noSave?: boolean; - log?: boolean; + previous: string; + current: string; + quiet: boolean; } -type ExtendedHathatConfig = HardhatConfig & { storage: Params }; - task( TASK_STORAGE_VERIFY, - 'Validate all the contracts against existing storage dump and, if valid, update it' + 'Using the two given storage dumps, verify that there are not invalid storage mutations' ) - .addOptionalParam( - 'artifacts', - 'Contract files, names, fully qualified names or folder of contracts to include', - ['contracts/**'], - types.stringArray - ) - .addOptionalParam( - 'skip', - 'Optional whitelist of contracts to skip the validations', - [], - types.stringArray + .addOptionalPositionalParam('previous', 'Older storage dump to compare to', 'storage.dump.json') + .addOptionalPositionalParam( + 'current', + 'More recent storage dump to compare to', + 'storage.new.dump.json' ) - .addOptionalParam( - 'output', - 'Storage dump output file relative to the root of the project', - 'storage.dump.sol' - ) - .addFlag('log', 'Show the result in the console') - .addFlag('noSave', 'Do not update storage dump file') - .setAction(async (params: Required, hre) => { - const userOverrideConfig = (hre.config as ExtendedHathatConfig).storage ?? {}; - - const artifacts = userOverrideConfig.artifacts ?? params.artifacts; - const skip = userOverrideConfig.skip ?? params.skip; - const output = userOverrideConfig.output ?? params.output; - const log = userOverrideConfig.log ?? params.log; - const noSave = userOverrideConfig.noSave ?? params.noSave; - - if (log) { - logger.quiet = true; - } - - const now = Date.now(); - logger.subtitle('Validating storage'); - - for (const contract of artifacts) { - logger.info(contract); - } - - await hre.run('compile', { quiet: true, force: true }); - - const allContracts = await getContractsFullyQualifiedNames(hre, artifacts); - - const sourceUnits = await hre.run(SUBTASK_STORAGE_GET_SOURCE_UNITS, { - artifacts: allContracts, - }); - const prevSourceUnits = await hre.run(SUBTASK_STORAGE_PARSE_DUMP, { output }); - - const errors = validate({ sourceUnits, prevSourceUnits, skip }); - - errors.forEach((err) => console.error(err, '\n')); - - if (errors.length) { - throw new HardhatPluginError('hardhat-storage', 'Storage validation failed'); - } - - const dump = await dumpStorage(sourceUnits); - - if (log) { - console.log(dump); - } - - // Sanity check to verify that the generated dump is parseable - await hre.run(SUBTASK_STORAGE_PARSE_CONTENTS, { - contents: { - [output]: dump, - }, - }); - - if (!noSave) { - const target = path.resolve(hre.config.paths.root, output); - await fs.mkdir(path.dirname(target), { recursive: true }); - await fs.writeFile(target, dump); + .addFlag('quiet', 'only emit errors to the console') + .setAction(async ({ previous, current, quiet }: Required, hre) => { + const curr = await readJsonFile(path.resolve(hre.config.paths.root, current)); + const prev = await readJsonFile(path.resolve(hre.config.paths.root, previous)); - logger.success(`Storage dump written to ${output} in ${Date.now() - now}ms`); - } + const mutations = await hre.run(SUBTASK_VERIFY_CONTRACTS, { curr, prev, quiet }); - return dump; + return mutations; }); diff --git a/utils/hardhat-storage/src/type-extensions.ts b/utils/hardhat-storage/src/type-extensions.ts new file mode 100644 index 0000000000..77ea9b523e --- /dev/null +++ b/utils/hardhat-storage/src/type-extensions.ts @@ -0,0 +1,13 @@ +declare module 'hardhat/types/config' { + export interface HardhatUserConfig { + storage?: { + artifacts?: string[]; + }; + } + + export interface HardhatConfig { + storage: { + artifacts: string[]; + }; + } +} diff --git a/utils/hardhat-storage/src/types.ts b/utils/hardhat-storage/src/types.ts new file mode 100644 index 0000000000..8d072508ff --- /dev/null +++ b/utils/hardhat-storage/src/types.ts @@ -0,0 +1,84 @@ +import type { SourceUnit } from '@solidity-parser/parser/src/ast-types'; + +export type { SourceUnit }; + +export interface StorageArtifact { + sourceName: string; + ast: SourceUnit; +} + +export interface OldStorageArtifact extends StorageArtifact { + contractName: string; +} + +export type GetArtifactFunction = (sourceName: string) => Promise; + +export interface StorageSlotBase { + type: string; + name?: string; + size?: number; + slot?: string; + offset?: number; +} + +export type StorageBuiltInValueType = + | 'bool' + | 'address' + | `uint${number}` + | `int${number}` + | `bytes${number}` + | `ufixed${number}x${number}` + | `fixed${number}x${number}` + | 'bytes' + | 'string'; + +export interface StorageBuiltinValueSlot extends StorageSlotBase { + type: StorageBuiltInValueType; +} + +export interface StorageEnumSlot extends StorageSlotBase { + type: 'enum'; + members: string[]; +} + +export interface StorageStructSlot extends StorageSlotBase { + type: 'struct'; + members: StorageSlot[]; +} + +export interface StorageMappingSlot extends StorageSlotBase { + type: 'mapping'; + key: StorageBuiltinValueSlot; + value: StorageSlot; +} + +export interface StorageArraySlot extends StorageSlotBase { + type: 'array'; + value: StorageSlot; + length?: number; +} + +export type StorageSlot = + | StorageBuiltinValueSlot + | StorageStructSlot + | StorageMappingSlot + | StorageArraySlot + | StorageEnumSlot; + +export type StorageLayoutStructs = { [structName: string]: StorageSlot[] | undefined }; + +export interface StorageLayout { + kind: 'contract' | 'library'; + name: string; + structs: StorageLayoutStructs; +} + +export interface StorageDump { + [contractName: string]: StorageLayout | undefined; +} + +export interface StorageMutation { + type: 'log' | 'warn' | 'error'; + kind: 'add' | 'update' | 'del'; + message: string; +} diff --git a/utils/hardhat-storage/test/fixtures/ExampleContract.sol b/utils/hardhat-storage/test/fixtures/ExampleContract.sol index 65490ef9dd..828b9e9b01 100644 --- a/utils/hardhat-storage/test/fixtures/ExampleContract.sol +++ b/utils/hardhat-storage/test/fixtures/ExampleContract.sol @@ -5,18 +5,51 @@ contract ExampleContract { bytes32 private constant _SLOT_EXAMPLE_CONTRACT = keccak256(abi.encode("io.synthetix.hardhat-storage.Example")); - enum NodeType { - NONE, - REDUCER, - EXTERNAL, - CHAINLINK, - PYTH + enum EnumExample { + ONE, + TWO, + THREE, + FOUR, + FIVE + } + + struct SubData { + string someString; + uint256 someValue; + } + + struct SimpleStruct { + uint8 size1; + uint16 size2; + uint32 size4; + uint64 size8; + } + + struct SomeStruct { + uint256 field2; + address field1; } struct Data { address owner; - mapping(address => uint128) permissions; - NodeType nodeType; + address anotherOwner; + uint128 sharingSlot1; + uint128 sharingSlot2; + EnumExample enumExample; + uint8 afterEnumValue; + mapping(address => uint128) simpleMapping; + uint8 afterMappingSlot; + address[] dynamicArray; + uint32[3] staticArray; + uint8 unsignedInt; // solhint-disable-line explicit-types + uint256 unsignedInt256; + uint8 unsignedInt8; + SubData bigStruct; + int256 signedInt256; + mapping(ExampleContract => SubData) mappingWithNestedStruct; + string someStringValue; + SimpleStruct simpleStruct; + uint8 afterStructStartsNewSlot; } uint128 public constant SOME_CONSTANT = 445; @@ -26,6 +59,8 @@ contract ExampleContract { uint256 public stateVariableNumber = 12345; string public stateVariableString = "give me some testing data"; + Data public structData; + function getValue() public pure returns (uint256) { return 1; } diff --git a/utils/hardhat-storage/test/src/internal/__snapshots__/dump.test.ts.snap b/utils/hardhat-storage/test/src/internal/__snapshots__/dump.test.ts.snap index 3296634dae..de462597e2 100644 --- a/utils/hardhat-storage/test/src/internal/__snapshots__/dump.test.ts.snap +++ b/utils/hardhat-storage/test/src/internal/__snapshots__/dump.test.ts.snap @@ -1,54 +1,300 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`internal/dump.ts sample-project contract with storage and interface 1`] = ` -"// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.17; - -// @custom:artifact contracts/storage/GlobalStorage.sol:GlobalStorage -contract GlobalStorage { - bytes32 private constant _SLOT_GLOBAL_STORAGE = keccak256(abi.encode("io.synthetix.sample-project.Global")); - struct GlobalStore { - uint value; - uint someValue; - } - function _globalStore() internal pure returns (GlobalStore storage store) { - bytes32 s = _SLOT_GLOBAL_STORAGE; - assembly { - store.slot := s - } - } +{ + "contracts/storage/GlobalStorage.sol:GlobalStorage": { + "kind": "contract", + "name": "GlobalStorage", + "structs": { + "GlobalStore": [ + { + "name": "value", + "offset": 0, + "size": 32, + "slot": "0", + "type": "uint256", + }, + { + "name": "someValue", + "offset": 0, + "size": 32, + "slot": "1", + "type": "uint256", + }, + ], + }, + }, } -" `; exports[`internal/dump.ts single contract with state variables, contracts and structs 1`] = ` -"// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.17; - -// @custom:artifact ExampleContract.sol:ExampleContract -contract ExampleContract { - bytes32 private constant _SLOT_EXAMPLE_CONTRACT = keccak256(abi.encode("io.synthetix.hardhat-storage.Example")); - uint128 public constant SOME_CONSTANT = 445; - uint128 public constant SOME_CASTED_CONSTANT = uint128(SOME_CONSTANT); - address private constant SOME_ADDRESS = 0xe27454c382e79a1876096B691ef4b52747B7097D; - enum NodeType { - NONE, - REDUCER, - EXTERNAL, - CHAINLINK, - PYTH - } - struct Data { - address owner; - mapping(address => uint128) permissions; - NodeType nodeType; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_EXAMPLE_CONTRACT; - assembly { - store.slot := s - } - } +{ + "ExampleContract.sol:ExampleContract": { + "kind": "contract", + "name": "ExampleContract", + "structs": { + "Data": [ + { + "name": "owner", + "offset": 0, + "size": 20, + "slot": "0", + "type": "address", + }, + { + "name": "anotherOwner", + "offset": 0, + "size": 20, + "slot": "1", + "type": "address", + }, + { + "name": "sharingSlot1", + "offset": 0, + "size": 16, + "slot": "2", + "type": "uint128", + }, + { + "name": "sharingSlot2", + "offset": 16, + "size": 16, + "slot": "2", + "type": "uint128", + }, + { + "members": [ + "ONE", + "TWO", + "THREE", + "FOUR", + "FIVE", + ], + "name": "enumExample", + "offset": 0, + "size": 1, + "slot": "3", + "type": "enum", + }, + { + "name": "afterEnumValue", + "offset": 1, + "size": 1, + "slot": "3", + "type": "uint8", + }, + { + "key": { + "type": "address", + }, + "name": "simpleMapping", + "offset": 0, + "size": 32, + "slot": "4", + "type": "mapping", + "value": { + "type": "uint128", + }, + }, + { + "name": "afterMappingSlot", + "offset": 0, + "size": 1, + "slot": "5", + "type": "uint8", + }, + { + "name": "dynamicArray", + "offset": 0, + "size": 32, + "slot": "6", + "type": "array", + "value": { + "type": "address", + }, + }, + { + "length": 3, + "name": "staticArray", + "offset": 0, + "size": 32, + "slot": "7", + "type": "array", + "value": { + "type": "uint32", + }, + }, + { + "name": "unsignedInt", + "offset": 0, + "size": 1, + "slot": "8", + "type": "uint8", + }, + { + "name": "unsignedInt256", + "offset": 0, + "size": 32, + "slot": "9", + "type": "uint256", + }, + { + "name": "unsignedInt8", + "offset": 0, + "size": 1, + "slot": "10", + "type": "uint8", + }, + { + "members": [ + { + "name": "someString", + "type": "string", + }, + { + "name": "someValue", + "type": "uint256", + }, + ], + "name": "bigStruct", + "offset": 0, + "size": 64, + "slot": "11", + "type": "struct", + }, + { + "name": "signedInt256", + "offset": 0, + "size": 32, + "slot": "13", + "type": "int256", + }, + { + "key": { + "type": "address", + }, + "name": "mappingWithNestedStruct", + "offset": 0, + "size": 32, + "slot": "14", + "type": "mapping", + "value": { + "members": [ + { + "name": "someString", + "type": "string", + }, + { + "name": "someValue", + "type": "uint256", + }, + ], + "type": "struct", + }, + }, + { + "name": "someStringValue", + "offset": 0, + "size": 32, + "slot": "15", + "type": "string", + }, + { + "members": [ + { + "name": "size1", + "type": "uint8", + }, + { + "name": "size2", + "type": "uint16", + }, + { + "name": "size4", + "type": "uint32", + }, + { + "name": "size8", + "type": "uint64", + }, + ], + "name": "simpleStruct", + "offset": 0, + "size": 32, + "slot": "16", + "type": "struct", + }, + { + "name": "afterStructStartsNewSlot", + "offset": 0, + "size": 1, + "slot": "17", + "type": "uint8", + }, + ], + "SimpleStruct": [ + { + "name": "size1", + "offset": 0, + "size": 1, + "slot": "0", + "type": "uint8", + }, + { + "name": "size2", + "offset": 1, + "size": 2, + "slot": "0", + "type": "uint16", + }, + { + "name": "size4", + "offset": 3, + "size": 4, + "slot": "0", + "type": "uint32", + }, + { + "name": "size8", + "offset": 7, + "size": 8, + "slot": "0", + "type": "uint64", + }, + ], + "SomeStruct": [ + { + "name": "field2", + "offset": 0, + "size": 32, + "slot": "0", + "type": "uint256", + }, + { + "name": "field1", + "offset": 0, + "size": 20, + "slot": "1", + "type": "address", + }, + ], + "SubData": [ + { + "name": "someString", + "offset": 0, + "size": 32, + "slot": "0", + "type": "string", + }, + { + "name": "someValue", + "offset": 0, + "size": 32, + "slot": "1", + "type": "uint256", + }, + ], + }, + }, } -" `; diff --git a/utils/hardhat-storage/test/src/internal/dump.test.ts b/utils/hardhat-storage/test/src/internal/dump.test.ts index 2ddc3bdd48..719982afee 100644 --- a/utils/hardhat-storage/test/src/internal/dump.test.ts +++ b/utils/hardhat-storage/test/src/internal/dump.test.ts @@ -1,35 +1,33 @@ import path from 'node:path'; -import { compileSolidityFolder } from '@synthetixio/core-utils/utils/solidity/compiler'; +import { readArtifact } from '../../../src/internal/artifacts'; import { dumpStorage } from '../../../src/internal/dump'; -const version = '0.8.17'; - describe('internal/dump.ts', function () { - jest.setTimeout(120000); - it('single contract with state variables, contracts and structs', async function () { - const astNodes = await compileSolidityFolder({ - version, - rootDir: path.resolve(__dirname, '..', '..', 'fixtures'), - sources: 'ExampleContract.sol', - }); + async function getArtifact(sourceName: string) { + const projectRoot = path.resolve(__dirname, '..', '..', 'fixtures'); + return readArtifact(projectRoot, sourceName); + } - const result = await dumpStorage(astNodes, version); + const contracts = ['ExampleContract.sol:ExampleContract']; + + const result = await dumpStorage({ getArtifact, contracts }); expect(result).toMatchSnapshot(); }); it('sample-project contract with storage and interface', async function () { - const astNodes = await compileSolidityFolder({ - version, - rootDir: path.resolve(__dirname, '..', '..', '..', '..', 'sample-project'), - sources: [ - 'contracts/storage/GlobalStorage.sol', - 'contracts/interfaces/ISomeModule.sol', - 'contracts/modules/SomeModule.sol', - ], - }); + async function getArtifact(sourceName: string) { + const projectRoot = path.resolve(__dirname, '..', '..', '..', '..', 'sample-project'); + return readArtifact(projectRoot, sourceName); + } + + const contracts = [ + 'contracts/storage/GlobalStorage.sol:GlobalStorage', + 'contracts/interfaces/ISomeModule.sol:ISomeModule', + 'contracts/modules/SomeModule.sol:SomeModule', + ]; - const result = await dumpStorage(astNodes, version); + const result = await dumpStorage({ getArtifact, contracts }); expect(result).toMatchSnapshot(); }); }); diff --git a/utils/hardhat-storage/test/src/internal/layout.test.ts b/utils/hardhat-storage/test/src/internal/layout.test.ts new file mode 100644 index 0000000000..07e150eb9c --- /dev/null +++ b/utils/hardhat-storage/test/src/internal/layout.test.ts @@ -0,0 +1,134 @@ +import { getStorageSlotSize } from '../../../src/internal/layout'; + +describe('internal/layout.ts', function () { + describe('#getStorageSlotSize', function () { + it('should return correct size for "bool"', async function () { + expect(getStorageSlotSize({ type: 'bool' })).toBe(1); + }); + + it('should return correct size for "address"', async function () { + expect(getStorageSlotSize({ type: 'address' })).toBe(20); + }); + + it('should return correct size for "enum"', async function () { + const arr = (length = 0) => new Array(length); + + expect(getStorageSlotSize({ type: 'enum', members: arr(1) })).toBe(1); + expect(getStorageSlotSize({ type: 'enum', members: arr(256) })).toBe(1); + expect(getStorageSlotSize({ type: 'enum', members: arr(257) })).toBe(2); + + expect(() => getStorageSlotSize({ type: 'enum', members: arr(0) })).toThrow( + 'Invalid enum size' + ); + }); + + it('should return correct size for "uint"', async function () { + expect(getStorageSlotSize({ type: 'uint8' })).toBe(1); + expect(getStorageSlotSize({ type: 'uint16' })).toBe(2); + expect(getStorageSlotSize({ type: 'uint32' })).toBe(4); + expect(getStorageSlotSize({ type: 'uint64' })).toBe(8); + expect(getStorageSlotSize({ type: 'uint128' })).toBe(16); + expect(getStorageSlotSize({ type: 'uint256' })).toBe(32); + expect(() => getStorageSlotSize({ type: 'uint0' })).toThrow('Invalid type "uint0"'); + expect(() => getStorageSlotSize({ type: 'uint257' })).toThrow('Invalid type "uint257"'); + }); + + it('should return correct size for "int"', async function () { + expect(getStorageSlotSize({ type: 'int8' })).toBe(1); + expect(getStorageSlotSize({ type: 'int16' })).toBe(2); + expect(getStorageSlotSize({ type: 'int32' })).toBe(4); + expect(getStorageSlotSize({ type: 'int64' })).toBe(8); + expect(getStorageSlotSize({ type: 'int128' })).toBe(16); + expect(getStorageSlotSize({ type: 'int256' })).toBe(32); + expect(() => getStorageSlotSize({ type: 'int0' })).toThrow('Invalid type "int0"'); + expect(() => getStorageSlotSize({ type: 'int257' })).toThrow('Invalid type "int257"'); + }); + + it('should return correct size for fixed size "bytes"', async function () { + expect(getStorageSlotSize({ type: 'bytes1' })).toBe(1); + expect(getStorageSlotSize({ type: 'bytes3' })).toBe(3); + expect(getStorageSlotSize({ type: 'bytes8' })).toBe(8); + expect(getStorageSlotSize({ type: 'bytes16' })).toBe(16); + expect(getStorageSlotSize({ type: 'bytes32' })).toBe(32); + expect(() => getStorageSlotSize({ type: 'bytes0' })).toThrow('Invalid type "bytes0"'); + expect(() => getStorageSlotSize({ type: 'bytes33' })).toThrow('Invalid type "bytes33"'); + }); + + it('should return correct size for dynamic "bytes"', async function () { + expect(getStorageSlotSize({ type: 'bytes' })).toBe(32); + }); + + it('should return correct size for dynamic "string"', async function () { + expect(getStorageSlotSize({ type: 'string' })).toBe(32); + }); + + it('should return correct size for dynamic "mapping"', async function () { + expect( + getStorageSlotSize({ + type: 'mapping', + key: { type: 'address' }, + value: { type: 'uint256' }, + }) + ).toBe(32); + }); + + it('should return correct size for dynamic "array"', async function () { + expect(getStorageSlotSize({ type: 'array', value: { type: 'uint8' } })).toBe(32); + }); + + it('should return correct size for static "array"', async function () { + expect(getStorageSlotSize({ type: 'array', value: { type: 'uint8' }, length: 5 })).toBe(32); + expect(getStorageSlotSize({ type: 'array', value: { type: 'uint128' }, length: 3 })).toBe(64); + expect( + getStorageSlotSize({ + type: 'array', + value: { type: 'array', value: { type: 'uint8' }, length: 3 }, + length: 2, + }) + ).toBe(64); + }); + + it('fails when trying to calculate size for "fixed" & "ufixed"', async function () { + expect(() => getStorageSlotSize({ type: 'fixed128x18' })).toThrow( + 'Type "fixed128x18" for storage size calculation not implemented' + ); + expect(() => getStorageSlotSize({ type: 'ufixed128x18' })).toThrow( + 'Type "ufixed128x18" for storage size calculation not implemented' + ); + }); + + it('should return correct size for "struct"', async function () { + expect( + getStorageSlotSize({ + type: 'struct', + members: [{ type: 'uint8' }, { type: 'uint16' }, { type: 'uint32' }, { type: 'uint64' }], + }) + ).toBe(32); // 1 + 2 + 4 + 8 = 15 rounded to 32 + + expect( + getStorageSlotSize({ + type: 'struct', + members: [{ type: 'int128' }, { type: 'uint64' }, { type: 'uint64' }], + }) + ).toBe(32); // 8 + 8 = 16 rounded to 32 + + expect( + getStorageSlotSize({ + type: 'struct', + members: [{ type: 'uint8' }, { type: 'uint256' }, { type: 'uint8' }], + }) + ).toBe(96); // 1 (aligned to 32) + 32 + 1 = 65 rounded to 96 + + expect( + getStorageSlotSize({ + type: 'struct', + members: [ + { type: 'uint8' }, // size 1 + { type: 'struct', members: [{ type: 'uint8' }, { type: 'uint16' }] }, // size 32 + { type: 'uint32' }, // size 4 + ], + }) + ).toBe(96); // it uses 3 slots because the child struct starts on a new slot + }); + }); +}); diff --git a/utils/hardhat-storage/test/src/internal/verify-mutations.test.ts b/utils/hardhat-storage/test/src/internal/verify-mutations.test.ts new file mode 100644 index 0000000000..7d15df80b1 --- /dev/null +++ b/utils/hardhat-storage/test/src/internal/verify-mutations.test.ts @@ -0,0 +1,141 @@ +import { hidrateSlotsLayout } from '../../../src/internal/layout'; +import { verifyMutations } from '../../../src/internal/verify-mutations'; +import { StorageDump, StorageLayoutStructs } from '../../../src/types'; + +function fixtureSingleContractDump(contractName: string, structsDefs: StorageLayoutStructs) { + const structs: StorageLayoutStructs = {}; + for (const structName of Object.keys(structsDefs)) { + structs[structName] = hidrateSlotsLayout(structsDefs[structName]!); + } + return { + [`contracts/${contractName}.sol:${contractName}`]: { + name: contractName, + kind: 'contract', + structs, + }, + } satisfies StorageDump; +} + +describe('internal/verify-mutations.ts', function () { + describe('#verifyMutations', function () { + it('should notify about a contract addition', async function () { + const curr = fixtureSingleContractDump('AddedContract', { + Data: [{ type: 'uint128', name: 'someValue' }], + }); + + expect(verifyMutations(curr, {})).toMatchObject([ + { + type: 'log', + kind: 'add', + message: 'Added contract AddedContract at contracts/AddedContract.sol', + }, + ]); + }); + + it('should notify about a contract deletion', async function () { + const prev = fixtureSingleContractDump('DeletedContract', { + Data: [{ type: 'uint128', name: 'someValue' }], + }); + + expect(verifyMutations({}, prev)).toMatchObject([ + { + type: 'log', + kind: 'del', + message: 'Deleted contract DeletedContract at contracts/DeletedContract.sol', + }, + ]); + }); + + it('should notify about a struct addition', async function () { + const curr = fixtureSingleContractDump('Contract', { + Data: [{ type: 'uint128', name: 'someValue' }], + NewStruct: [{ type: 'uint256', name: 'newValue' }], + }); + const prev = fixtureSingleContractDump('Contract', { + Data: [{ type: 'uint128', name: 'someValue' }], + }); + + expect(verifyMutations(curr, prev)).toMatchObject([ + { + type: 'log', + kind: 'add', + message: 'Added struct Contract.NewStruct at contracts/Contract.sol', + }, + ]); + }); + + it('should notify about a struct deletion', async function () { + const curr = fixtureSingleContractDump('Contract', { + Data: [{ type: 'uint128', name: 'someValue' }], + }); + const prev = fixtureSingleContractDump('Contract', { + Data: [{ type: 'uint128', name: 'someValue' }], + DeletedStruct: [{ type: 'uint256', name: 'value' }], + }); + + expect(verifyMutations(curr, prev)).toMatchObject([ + { + type: 'log', + kind: 'del', + message: 'Deleted struct Contract.DeletedStruct at contracts/Contract.sol', + }, + ]); + }); + + it('should throw an error when changing the type of a variable', async function () { + const curr = fixtureSingleContractDump('Contract', { + Data: [{ type: 'uint128', name: 'someValue' }], + }); + const prev = fixtureSingleContractDump('Contract', { + Data: [{ type: 'uint64', name: 'someValue' }], + }); + + expect(verifyMutations(curr, prev)).toMatchObject([ + { + type: 'error', + kind: 'update', + message: + 'Invalid modification of value "uint128 someValue" in Contract.Data at contracts/Contract.sol', + }, + ]); + }); + + it('should allow to rename variables if the slot does not change', async function () { + const curr = fixtureSingleContractDump('Contract', { + Data: [{ type: 'uint128', name: 'value' }], + }); + const prev = fixtureSingleContractDump('Contract', { + Data: [{ type: 'uint128', name: 'updatedValue' }], + }); + + expect(verifyMutations(curr, prev)).toMatchObject([ + { + type: 'log', + kind: 'update', + message: + 'Renamed variable "uint128 updatedValue" in Contract.Data at contracts/Contract.sol', + }, + ]); + }); + + it('does not allow to delete variables', async function () { + const curr = fixtureSingleContractDump('Contract', { + Data: [{ type: 'uint128', name: 'first' }], + }); + const prev = fixtureSingleContractDump('Contract', { + Data: [ + { type: 'uint128', name: 'first' }, + { type: 'uint128', name: 'second' }, + ], + }); + + expect(verifyMutations(curr, prev)).toMatchObject([ + { + type: 'error', + kind: 'del', + message: 'Deleted variable "uint128 second" in Contract.Data at contracts/Contract.sol', + }, + ]); + }); + }); +}); diff --git a/utils/sample-project/contracts/modules/SomeModule.sol b/utils/sample-project/contracts/modules/SomeModule.sol index 43266500ce..05bf12144e 100644 --- a/utils/sample-project/contracts/modules/SomeModule.sol +++ b/utils/sample-project/contracts/modules/SomeModule.sol @@ -1,23 +1,20 @@ //SPDX-License-Identifier: MIT pragma solidity >=0.8.11 <0.9.0; -import "@synthetixio/core-contracts/contracts/utils/ERC2771Context.sol"; import "../storage/GlobalStorage.sol"; import "../interfaces/ISomeModule.sol"; contract SomeModule is GlobalStorage, ISomeModule { - event ValueSet(address sender, uint256 value); + event ValueSet(uint256 value); function setValue(uint256 newValue) public override { _globalStore().value = newValue; - - emit ValueSet(ERC2771Context._msgSender(), newValue); + emit ValueSet(newValue); } function setSomeValue(uint256 newSomeValue) public override { _globalStore().someValue = newSomeValue; - - emit ValueSet(ERC2771Context._msgSender(), newSomeValue); + emit ValueSet(newSomeValue); } function getValue() public view override returns (uint256) { diff --git a/utils/sample-project/hardhat.config.js b/utils/sample-project/hardhat.config.js index 93a6a85d7c..d3a53ce720 100644 --- a/utils/sample-project/hardhat.config.js +++ b/utils/sample-project/hardhat.config.js @@ -14,4 +14,12 @@ module.exports = { }, }, defaultNetwork: 'cannon', + storage: { + artifacts: [ + 'contracts/**', + '!contracts/routers/**', + '!contracts/generated/**', + '!contracts/mocks/**', + ], + }, }; diff --git a/utils/sample-project/package.json b/utils/sample-project/package.json index 08cb513502..73b97bc0ab 100644 --- a/utils/sample-project/package.json +++ b/utils/sample-project/package.json @@ -6,9 +6,10 @@ "scripts": { "clean": "hardhat clean", "build": "yarn build:contracts", - "storage:verify": "hardhat compile --force && hardhat storage:verify", - "build:contracts": "hardhat compile --force && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", - "check:storage": "git diff --exit-code storage.dump.sol", + "build:contracts": "hardhat compile --force && yarn storage:dump && CANNON_REGISTRY_PRIORITY=local hardhat cannon:build", + "storage:dump": "hardhat storage:dump --output storage.new.dump.json", + "check:storage": "diff -uw storage.dump.json storage.new.dump.json", + "storage:verify": " hardhat storage:verify", "test": "hardhat test", "coverage": "hardhat coverage --network hardhat" }, diff --git a/utils/sample-project/storage.dump.json b/utils/sample-project/storage.dump.json new file mode 100644 index 0000000000..8c2f5edd35 --- /dev/null +++ b/utils/sample-project/storage.dump.json @@ -0,0 +1,54 @@ +{ + "contracts/storage/GlobalStorage.sol:GlobalStorage": { + "name": "GlobalStorage", + "kind": "contract", + "structs": { + "GlobalStore": [ + { + "type": "uint256", + "name": "value", + "size": 32, + "slot": "0", + "offset": 0 + }, + { + "type": "uint256", + "name": "someValue", + "size": 32, + "slot": "1", + "offset": 0 + } + ] + } + }, + "contracts/storage/InitializableStorage.sol:InitializableStorage": { + "name": "InitializableStorage", + "kind": "contract", + "structs": { + "InitializableStore": [ + { + "type": "bool", + "name": "initialized", + "size": 1, + "slot": "0", + "offset": 0 + } + ] + } + }, + "contracts/storage/SettingsStorage.sol:SettingsStorage": { + "name": "SettingsStorage", + "kind": "contract", + "structs": { + "SettingsStore": [ + { + "type": "uint256", + "name": "aSettingValue", + "size": 32, + "slot": "0", + "offset": 0 + } + ] + } + } +} diff --git a/utils/sample-project/storage.dump.sol b/utils/sample-project/storage.dump.sol deleted file mode 100644 index 6e8b529c45..0000000000 --- a/utils/sample-project/storage.dump.sol +++ /dev/null @@ -1,85 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity >=0.8.11<0.9.0; - -// @custom:artifact @synthetixio/core-contracts/contracts/ownership/OwnableStorage.sol:OwnableStorage -library OwnableStorage { - bytes32 private constant _SLOT_OWNABLE_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.Ownable")); - struct Data { - address owner; - address nominatedOwner; - } - function load() internal pure returns (Data storage store) { - bytes32 s = _SLOT_OWNABLE_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/proxy/ProxyStorage.sol:ProxyStorage -contract ProxyStorage { - bytes32 private constant _SLOT_PROXY_STORAGE = keccak256(abi.encode("io.synthetix.core-contracts.Proxy")); - struct ProxyStore { - address implementation; - bool simulatingUpgrade; - } - function _proxyStore() internal pure returns (ProxyStore storage store) { - bytes32 s = _SLOT_PROXY_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact @synthetixio/core-contracts/contracts/utils/ERC2771Context.sol:ERC2771Context -library ERC2771Context { - address private constant TRUSTED_FORWARDER = 0xE2C5658cC5C448B48141168f3e475dF8f65A1e3e; -} - -// @custom:artifact contracts/modules/AnotherModule.sol:AnotherModule -contract AnotherModule { - uint256 private constant _SIXTY_FOUR = 64; -} - -// @custom:artifact contracts/storage/GlobalStorage.sol:GlobalStorage -contract GlobalStorage { - bytes32 private constant _SLOT_GLOBAL_STORAGE = keccak256(abi.encode("io.synthetix.sample-project.Global")); - struct GlobalStore { - uint256 value; - uint256 someValue; - } - function _globalStore() internal pure returns (GlobalStore storage store) { - bytes32 s = _SLOT_GLOBAL_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact contracts/storage/InitializableStorage.sol:InitializableStorage -contract InitializableStorage { - bytes32 private constant _SLOT_INITIALIZABLE_STORAGE = keccak256(abi.encode("io.synthetix.sample-project.Initializable")); - struct InitializableStore { - bool initialized; - } - function _initializableStore() internal pure returns (InitializableStore storage store) { - bytes32 s = _SLOT_INITIALIZABLE_STORAGE; - assembly { - store.slot := s - } - } -} - -// @custom:artifact contracts/storage/SettingsStorage.sol:SettingsStorage -contract SettingsStorage { - bytes32 private constant _SLOT_SETTINGS_STORAGE = keccak256(abi.encode("io.synthetix.sample-project.Settings")); - struct SettingsStore { - uint256 aSettingValue; - } - function _settingsStore() internal pure returns (SettingsStore storage store) { - bytes32 s = _SLOT_SETTINGS_STORAGE; - assembly { - store.slot := s - } - } -} diff --git a/yarn.lock b/yarn.lock index 6007041175..1f64ff1076 100644 --- a/yarn.lock +++ b/yarn.lock @@ -394,6 +394,52 @@ __metadata: languageName: node linkType: hard +"@chainsafe/as-sha256@npm:^0.3.1": + version: 0.3.1 + resolution: "@chainsafe/as-sha256@npm:0.3.1" + checksum: 10/3bae7b4bc6e307baa3cf1f9d2c75827874cd0fb458bc592656d741d374b48e71c042fe21616a506cb821487a5abfc6b92181e4b7fbf49b7370cee4df0b67d95a + languageName: node + linkType: hard + +"@chainsafe/persistent-merkle-tree@npm:^0.4.2": + version: 0.4.2 + resolution: "@chainsafe/persistent-merkle-tree@npm:0.4.2" + dependencies: + "@chainsafe/as-sha256": "npm:^0.3.1" + checksum: 10/a7e59f80be3ce0a86fe452a3c003bd159a1719ed22cae22e9841668f0eda8c35412fa16b3b150d96f583a24f430a5cc2a1bfcabafc1b9cf6e1fdb227e98c4dc7 + languageName: node + linkType: hard + +"@chainsafe/persistent-merkle-tree@npm:^0.5.0": + version: 0.5.0 + resolution: "@chainsafe/persistent-merkle-tree@npm:0.5.0" + dependencies: + "@chainsafe/as-sha256": "npm:^0.3.1" + checksum: 10/c8a37eb2fbe04d8b6f219774400dad5c50e109a9daf427883c9e33826a294a1bbd6bc759b5d6d38fefb2398443d2d880b67130eacab55b34d95d1332ac8ab680 + languageName: node + linkType: hard + +"@chainsafe/ssz@npm:^0.10.0": + version: 0.10.2 + resolution: "@chainsafe/ssz@npm:0.10.2" + dependencies: + "@chainsafe/as-sha256": "npm:^0.3.1" + "@chainsafe/persistent-merkle-tree": "npm:^0.5.0" + checksum: 10/359b3a672b460ad7fee524115fe7e5d9518c62b667dfc3dc6d8be0286ebb785ce303a68070cde5b31fc2860f99fda40df4296030cb9af42554143290f542326b + languageName: node + linkType: hard + +"@chainsafe/ssz@npm:^0.9.2": + version: 0.9.4 + resolution: "@chainsafe/ssz@npm:0.9.4" + dependencies: + "@chainsafe/as-sha256": "npm:^0.3.1" + "@chainsafe/persistent-merkle-tree": "npm:^0.4.2" + case: "npm:^1.6.3" + checksum: 10/2fe83d0b3ef131e14b51b88bb3343b14e7a02185fa9fd3da84b4726dbd857daaa4f7f6f4840fe3772fc1380352b1675a13b5f6153c4211c0f00ffa542b62bf2f + languageName: node + linkType: hard + "@colors/colors@npm:1.5.0": version: 1.5.0 resolution: "@colors/colors@npm:1.5.0" @@ -723,7 +769,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/providers@npm:5.7.2, @ethersproject/providers@npm:^5.7.2": +"@ethersproject/providers@npm:5.7.2, @ethersproject/providers@npm:^5.7.1, @ethersproject/providers@npm:^5.7.2": version: 5.7.2 resolution: "@ethersproject/providers@npm:5.7.2" dependencies: @@ -1041,14 +1087,14 @@ __metadata: languageName: node linkType: hard -"@inquirer/expand@npm:^2.3.0": - version: 2.3.0 - resolution: "@inquirer/expand@npm:2.3.0" +"@inquirer/expand@npm:^2.1.22": + version: 2.2.0 + resolution: "@inquirer/expand@npm:2.2.0" dependencies: "@inquirer/core": "npm:^9.1.0" "@inquirer/type": "npm:^1.5.3" yoctocolors-cjs: "npm:^2.1.2" - checksum: 10/fdc9b2d0a509e9c0120fda8e1c044593b1f4b68038fd13e19fc35cc305f1e132fddd482bc1b44966cbcab06d579d130cabbb5cac50d917549d16d7e66fad4e74 + checksum: 10/1ae942cb81a0e2de23c520aa1897a6cf9c5f92e4b71089d85cd9b2837a88b4721b5d0d0046fd35f833427835e39162510140800180ed9c76ae4a6b0a617210cc languageName: node linkType: hard @@ -1059,7 +1105,7 @@ __metadata: languageName: node linkType: hard -"@inquirer/input@npm:^2.3.0": +"@inquirer/input@npm:^2.2.9": version: 2.3.0 resolution: "@inquirer/input@npm:2.3.0" dependencies: @@ -1069,7 +1115,7 @@ __metadata: languageName: node linkType: hard -"@inquirer/select@npm:^2.5.0": +"@inquirer/select@npm:^2.4.7": version: 2.5.0 resolution: "@inquirer/select@npm:2.5.0" dependencies: @@ -1455,23 +1501,54 @@ __metadata: linkType: hard "@lerna-lite/changed@npm:^3.3.0": - version: 3.9.1 - resolution: "@lerna-lite/changed@npm:3.9.1" + version: 3.3.0 + resolution: "@lerna-lite/changed@npm:3.3.0" + dependencies: + "@lerna-lite/cli": "npm:3.3.0" + "@lerna-lite/core": "npm:3.3.0" + "@lerna-lite/list": "npm:3.3.0" + "@lerna-lite/listable": "npm:3.3.0" + checksum: 10/62fd881f385bf8635b0a9f416d310139005935468baf88569c679cc844eadea7134ca90c3698b64a8eab5c2e1e322a51561d270b57d1eb291df103a185618c37 + languageName: node + linkType: hard + +"@lerna-lite/cli@npm:3.3.0": + version: 3.3.0 + resolution: "@lerna-lite/cli@npm:3.3.0" dependencies: - "@lerna-lite/cli": "npm:3.9.1" - "@lerna-lite/core": "npm:3.9.1" - "@lerna-lite/list": "npm:3.9.1" - "@lerna-lite/listable": "npm:3.9.1" - checksum: 10/a8c4547f9df56dde1763b3669ccdc79b087c36ecb509ba757cb6a4b2eb845d769f177e71022c7a15f04c465f2766e87a84bbb2f013ea8c1656bf2886526ef9b5 + "@lerna-lite/core": "npm:3.3.0" + "@lerna-lite/init": "npm:3.3.0" + dedent: "npm:^1.5.1" + dotenv: "npm:^16.4.1" + import-local: "npm:^3.1.0" + load-json-file: "npm:^7.0.1" + npmlog: "npm:^7.0.1" + yargs: "npm:^17.7.2" + peerDependenciesMeta: + "@lerna-lite/exec": + optional: true + "@lerna-lite/list": + optional: true + "@lerna-lite/publish": + optional: true + "@lerna-lite/run": + optional: true + "@lerna-lite/version": + optional: true + "@lerna-lite/watch": + optional: true + bin: + lerna: dist/cli.js + checksum: 10/3208c8df15e4b95c21669dbbcbce2f8044549d1e873c285760597abc6a9608e7f878e168cfb3bc4222f34b3cf511b373e1ba6f790b0829d6921d109d568afdd3 languageName: node linkType: hard -"@lerna-lite/cli@npm:3.9.1, @lerna-lite/cli@npm:^3.3.0": - version: 3.9.1 - resolution: "@lerna-lite/cli@npm:3.9.1" +"@lerna-lite/cli@npm:^3.3.0": + version: 3.9.0 + resolution: "@lerna-lite/cli@npm:3.9.0" dependencies: - "@lerna-lite/core": "npm:3.9.1" - "@lerna-lite/init": "npm:3.9.1" + "@lerna-lite/core": "npm:3.9.0" + "@lerna-lite/init": "npm:3.9.0" "@lerna-lite/npmlog": "npm:3.8.0" dedent: "npm:^1.5.3" dotenv: "npm:^16.4.5" @@ -1493,17 +1570,51 @@ __metadata: optional: true bin: lerna: dist/cli.js - checksum: 10/94e8837711d3a18c829cc5051d480ef551dc4e7462ca6581524690d1a1f2971caad40f0c40b95c90ea39ba442e506a1174ab05c1920f1fbb200d97b73d5b2515 + checksum: 10/b3f69e817a0b31e375dee8472e1fbd8c68f68fb4ef40cb76b0297d80811f39aa342e44f0ea094c3b9a1b2dca2ba89e2f069e54ed4ec05db6520595b2876dc25b + languageName: node + linkType: hard + +"@lerna-lite/core@npm:3.3.0": + version: 3.3.0 + resolution: "@lerna-lite/core@npm:3.3.0" + dependencies: + "@npmcli/run-script": "npm:^7.0.4" + chalk: "npm:^5.3.0" + clone-deep: "npm:^4.0.1" + config-chain: "npm:^1.1.13" + cosmiconfig: "npm:^9.0.0" + dedent: "npm:^1.5.1" + execa: "npm:^8.0.1" + fs-extra: "npm:^11.2.0" + glob-parent: "npm:^6.0.2" + globby: "npm:^14.0.0" + inquirer: "npm:^9.2.14" + is-ci: "npm:^3.0.1" + json5: "npm:^2.2.3" + load-json-file: "npm:^7.0.1" + minimatch: "npm:^9.0.3" + npm-package-arg: "npm:^11.0.1" + npmlog: "npm:^7.0.1" + p-map: "npm:^7.0.1" + p-queue: "npm:^8.0.1" + resolve-from: "npm:^5.0.0" + semver: "npm:^7.6.0" + slash: "npm:^5.1.0" + strong-log-transformer: "npm:^2.1.0" + write-file-atomic: "npm:^5.0.1" + write-json-file: "npm:^5.0.0" + write-pkg: "npm:^6.0.1" + checksum: 10/ab62d6f4bb64de1d0f1ebbbcc84db075669853bf14e03ff23aee7cd4e818df2e4016ebc2eb9d6dd4f39e03b99249ccb2779076d3e43ae5727a10647f496689af languageName: node linkType: hard -"@lerna-lite/core@npm:3.9.1": - version: 3.9.1 - resolution: "@lerna-lite/core@npm:3.9.1" +"@lerna-lite/core@npm:3.9.0": + version: 3.9.0 + resolution: "@lerna-lite/core@npm:3.9.0" dependencies: - "@inquirer/expand": "npm:^2.3.0" - "@inquirer/input": "npm:^2.3.0" - "@inquirer/select": "npm:^2.5.0" + "@inquirer/expand": "npm:^2.1.22" + "@inquirer/input": "npm:^2.2.9" + "@inquirer/select": "npm:^2.4.7" "@lerna-lite/npmlog": "npm:^3.8.0" "@npmcli/run-script": "npm:^8.1.0" chalk: "npm:^5.3.0" @@ -1529,68 +1640,81 @@ __metadata: write-file-atomic: "npm:^5.0.1" write-json-file: "npm:^6.0.0" write-package: "npm:^7.1.0" - checksum: 10/494c4c3c2568b127670bc2ad74059041290ede4d24f5e12fb07506f3979f0fd8ad1ef6dcd762bf3057c25a78108a79ad9adebcd831ade1e2f18533edf8e9526a + checksum: 10/fbdfb7b7f7956ee08b1300ac1a0cdf5f4ce92c5ee1f73cedaff968ba2924f5afad97af9f229ac97f4ce9bf8efb964b17c25cd3f616e84a96e21cefbdbe9a687f languageName: node linkType: hard "@lerna-lite/exec@npm:^3.3.0": - version: 3.9.1 - resolution: "@lerna-lite/exec@npm:3.9.1" + version: 3.3.0 + resolution: "@lerna-lite/exec@npm:3.3.0" dependencies: - "@lerna-lite/cli": "npm:3.9.1" - "@lerna-lite/core": "npm:3.9.1" - "@lerna-lite/filter-packages": "npm:3.9.1" - "@lerna-lite/profiler": "npm:3.9.1" + "@lerna-lite/cli": "npm:3.3.0" + "@lerna-lite/core": "npm:3.3.0" + "@lerna-lite/filter-packages": "npm:3.3.0" + "@lerna-lite/profiler": "npm:3.3.0" chalk: "npm:^5.3.0" - dotenv: "npm:^16.4.5" - p-map: "npm:^7.0.2" - checksum: 10/1368c3fdc54cd434915043d5fef6ca6ea865c5fdbe399e751b098d72af3652b459074bfbc1dcc72e1762c982ad47ee9daae738c475e2158a9f92e08b70890a61 + dotenv: "npm:^16.4.1" + npmlog: "npm:^7.0.1" + p-map: "npm:^7.0.1" + checksum: 10/c487ba7bd7af63a61e3874aa9b9e6b5b9dfdd7a22c4146799a3b03e3664079868d48f54ea6bf43f04be3daebf8b9b093e53235482c2df7f57c1d09456785518f languageName: node linkType: hard -"@lerna-lite/filter-packages@npm:3.9.1": - version: 3.9.1 - resolution: "@lerna-lite/filter-packages@npm:3.9.1" +"@lerna-lite/filter-packages@npm:3.3.0": + version: 3.3.0 + resolution: "@lerna-lite/filter-packages@npm:3.3.0" dependencies: - "@lerna-lite/core": "npm:3.9.1" - "@lerna-lite/npmlog": "npm:^3.8.0" + "@lerna-lite/core": "npm:3.3.0" multimatch: "npm:^7.0.0" - checksum: 10/40698651999d3d49d87b291e7cd070baebcc4b67bdc936e8f9e1203b24eeac5491bee768af914a6cd1bc819b1d2b4dbefa9823c12e991828537d37c85ee5bfa9 + npmlog: "npm:^7.0.1" + checksum: 10/d2780f226236fa7a53f4ef4503fdbc4624a3ad3d192cb5d23cdc8140fc909937154bed2016f245f4dbb97e10ca47b2f4ef27f106f7ef9ea3a748fdd4eb07e2ef + languageName: node + linkType: hard + +"@lerna-lite/init@npm:3.3.0": + version: 3.3.0 + resolution: "@lerna-lite/init@npm:3.3.0" + dependencies: + "@lerna-lite/core": "npm:3.3.0" + fs-extra: "npm:^11.2.0" + p-map: "npm:^7.0.1" + write-json-file: "npm:^5.0.0" + checksum: 10/c23db113e0ca89bb5ce533ea65e5f27cd5b2f2ec5bf0dd37433a453695cda9a0ba6ccc9630a81df4a276ff4ab76d5571c7210e523c8cef2e4b0fde89b146bd93 languageName: node linkType: hard -"@lerna-lite/init@npm:3.9.1": - version: 3.9.1 - resolution: "@lerna-lite/init@npm:3.9.1" +"@lerna-lite/init@npm:3.9.0": + version: 3.9.0 + resolution: "@lerna-lite/init@npm:3.9.0" dependencies: - "@lerna-lite/core": "npm:3.9.1" + "@lerna-lite/core": "npm:3.9.0" fs-extra: "npm:^11.2.0" p-map: "npm:^7.0.2" write-json-file: "npm:^6.0.0" - checksum: 10/5193e963b6d4b57376389fea1db67eda579e96ad49be03d0d3f7686881ae0640c66ed7823b2ec462d2add5acd52beb5011380f75ca2146a6c4a035d8b4b70b1e + checksum: 10/431ae54c50fe28dea72449785f2e2ce03fce5e5bd340c1f7ad4b71b42708b8df0afafc36049d91aa87c9533193f6cffa6b8ced2f21e1b75d2350a0bc7204da7f languageName: node linkType: hard -"@lerna-lite/list@npm:3.9.1": - version: 3.9.1 - resolution: "@lerna-lite/list@npm:3.9.1" +"@lerna-lite/list@npm:3.3.0": + version: 3.3.0 + resolution: "@lerna-lite/list@npm:3.3.0" dependencies: - "@lerna-lite/cli": "npm:3.9.1" - "@lerna-lite/core": "npm:3.9.1" - "@lerna-lite/filter-packages": "npm:3.9.1" - "@lerna-lite/listable": "npm:3.9.1" - checksum: 10/95d87140a7123b6c7787f86470352b169095c6cc376c3a6c4cde7cd3a70672d9cb8cb2c0ba575ecfde64453deb3f9885c7fd30342c8804848faf0443a0b96762 + "@lerna-lite/cli": "npm:3.3.0" + "@lerna-lite/core": "npm:3.3.0" + "@lerna-lite/filter-packages": "npm:3.3.0" + "@lerna-lite/listable": "npm:3.3.0" + checksum: 10/88c7611f17bf458fd51db4612f7e9db2a415826b506d6c56ee0e23aea323137431a70b73ee95f90fdd7c0d0d464adf272d29817e5427ca16bdef0f2b020e82d1 languageName: node linkType: hard -"@lerna-lite/listable@npm:3.9.1": - version: 3.9.1 - resolution: "@lerna-lite/listable@npm:3.9.1" +"@lerna-lite/listable@npm:3.3.0": + version: 3.3.0 + resolution: "@lerna-lite/listable@npm:3.3.0" dependencies: - "@lerna-lite/core": "npm:3.9.1" + "@lerna-lite/core": "npm:3.3.0" chalk: "npm:^5.3.0" columnify: "npm:^1.6.0" - checksum: 10/e33c56e604f3e84e23dae3d1ce26be42bd530056056fcc5593ae7798608a6174e14c9c6a8f351e0d5aa78a6c5e3a61bd8ccb090e48e007c722dbdc0628aad221 + checksum: 10/28f39cdad3d723a1f8e378458cefb6b88713ca809498882a38e3ea6eb53f9ce4cfb3c662af44aec5fd31d3c605c4ec508fcbd88c6c45b38974afab09e88a2f33 languageName: node linkType: hard @@ -1611,89 +1735,98 @@ __metadata: languageName: node linkType: hard -"@lerna-lite/profiler@npm:3.9.1": - version: 3.9.1 - resolution: "@lerna-lite/profiler@npm:3.9.1" +"@lerna-lite/profiler@npm:3.3.0": + version: 3.3.0 + resolution: "@lerna-lite/profiler@npm:3.3.0" dependencies: - "@lerna-lite/core": "npm:3.9.1" - "@lerna-lite/npmlog": "npm:3.8.0" + "@lerna-lite/core": "npm:3.3.0" fs-extra: "npm:^11.2.0" + npmlog: "npm:^7.0.1" upath: "npm:^2.0.1" - checksum: 10/7e717aad04c9c520350b27c3a2081b74dc0bcd69554bc015689c1321d0071544c0099b066eed5462cf27616183cba06dcea4b6dd3745fbb3bb38899df8f74381 + checksum: 10/4ff9bcbc2368db6ad67d98111f4d9f7641a04daf9cf8f812a973f341fde36073d7dc2d2c2aa1d585f5acfdc7e7821e3310f3d2e01f759700bf18551f4f4a8624 languageName: node linkType: hard "@lerna-lite/publish@npm:^3.3.0": - version: 3.9.1 - resolution: "@lerna-lite/publish@npm:3.9.1" + version: 3.3.0 + resolution: "@lerna-lite/publish@npm:3.3.0" dependencies: - "@lerna-lite/cli": "npm:3.9.1" - "@lerna-lite/core": "npm:3.9.1" - "@lerna-lite/npmlog": "npm:^3.8.0" - "@lerna-lite/version": "npm:3.9.1" - "@npmcli/arborist": "npm:^7.5.4" - "@npmcli/package-json": "npm:^5.2.0" - byte-size: "npm:^9.0.0" + "@lerna-lite/cli": "npm:3.3.0" + "@lerna-lite/core": "npm:3.3.0" + "@lerna-lite/version": "npm:3.3.0" + "@npmcli/arborist": "npm:^7.3.1" + byte-size: "npm:^8.1.1" chalk: "npm:^5.3.0" columnify: "npm:^1.6.0" fs-extra: "npm:^11.2.0" - glob: "npm:^10.4.5" + glob: "npm:^10.3.10" has-unicode: "npm:^2.0.1" - libnpmaccess: "npm:^8.0.6" - libnpmpublish: "npm:^9.0.9" + libnpmaccess: "npm:^8.0.2" + libnpmpublish: "npm:^9.0.4" normalize-path: "npm:^3.0.0" - npm-package-arg: "npm:^11.0.3" + npm-package-arg: "npm:^11.0.1" npm-packlist: "npm:^8.0.2" - npm-registry-fetch: "npm:^17.1.0" - p-map: "npm:^7.0.2" + npm-registry-fetch: "npm:^16.1.0" + npmlog: "npm:^7.0.1" + p-map: "npm:^7.0.1" p-pipe: "npm:^4.0.0" - pacote: "npm:^18.0.6" - semver: "npm:^7.6.3" - ssri: "npm:^11.0.0" - tar: "npm:^6.2.1" + pacote: "npm:^17.0.6" + pify: "npm:^6.1.0" + read-package-json: "npm:^7.0.0" + semver: "npm:^7.6.0" + ssri: "npm:^10.0.5" + tar: "npm:^6.2.0" temp-dir: "npm:^3.0.0" - checksum: 10/a7256fb57757445b808f6d0681316cf9881eb94204307a199166f95121dc9a3fa0efbca69ec8acc702830127a4a010f59bf5ceb19860142accd190abe2921ccd + checksum: 10/a312a65baa517420d4170dd2ed0f0a1a81097cc513cb60832e2aff391ac9643fae822058c9c3a08d3c78a5f587d098138bb6c7cfde124eda83bb3904d06fde66 languageName: node linkType: hard -"@lerna-lite/version@npm:3.9.1": - version: 3.9.1 - resolution: "@lerna-lite/version@npm:3.9.1" +"@lerna-lite/version@npm:3.3.0": + version: 3.3.0 + resolution: "@lerna-lite/version@npm:3.3.0" dependencies: - "@lerna-lite/cli": "npm:3.9.1" - "@lerna-lite/core": "npm:3.9.1" - "@lerna-lite/npmlog": "npm:^3.8.0" + "@lerna-lite/cli": "npm:3.3.0" + "@lerna-lite/core": "npm:3.3.0" "@octokit/plugin-enterprise-rest": "npm:^6.0.1" - "@octokit/rest": "npm:^21.0.2" + "@octokit/rest": "npm:^20.0.2" chalk: "npm:^5.3.0" conventional-changelog-angular: "npm:^7.0.0" conventional-changelog-core: "npm:^7.0.0" conventional-changelog-writer: "npm:^7.0.1" conventional-commits-parser: "npm:^5.0.0" conventional-recommended-bump: "npm:^9.0.0" - dedent: "npm:^1.5.3" + dedent: "npm:^1.5.1" fs-extra: "npm:^11.2.0" - get-stream: "npm:^9.0.1" - git-url-parse: "npm:^15.0.0" + get-stream: "npm:^8.0.1" + git-url-parse: "npm:^14.0.0" graceful-fs: "npm:^4.2.11" - is-stream: "npm:^4.0.1" + is-stream: "npm:^3.0.0" load-json-file: "npm:^7.0.1" - make-dir: "npm:^5.0.0" - minimatch: "npm:^9.0.5" + make-dir: "npm:^4.0.0" + minimatch: "npm:^9.0.3" new-github-release-url: "npm:^2.0.0" node-fetch: "npm:^3.3.2" - npm-package-arg: "npm:^11.0.3" - p-limit: "npm:^6.1.0" - p-map: "npm:^7.0.2" + npm-package-arg: "npm:^11.0.1" + npmlog: "npm:^7.0.1" + p-map: "npm:^7.0.1" p-pipe: "npm:^4.0.0" p-reduce: "npm:^3.0.0" pify: "npm:^6.1.0" - semver: "npm:^7.6.3" + semver: "npm:^7.6.0" slash: "npm:^5.1.0" temp-dir: "npm:^3.0.0" - uuid: "npm:^10.0.0" - write-json-file: "npm:^6.0.0" - checksum: 10/25c693ab84cf094535dd0bff26ef0683083f46bb17f7ff00f9cb16c20ab15cfd8925604476a61a59e0d8a69845d82087484546658f83e331eb06ad5cb4e65119 + uuid: "npm:^9.0.1" + write-json-file: "npm:^5.0.0" + checksum: 10/c1e574b36978a1017a3f528a0b841807aa6d798d37a20f63aa1e4d93210e1b0a30d31da727a3a0875a40a67823e8b0797aad8ea7b9064112b8a43d232ee2457a + languageName: node + linkType: hard + +"@ljharb/through@npm:^2.3.12": + version: 2.3.12 + resolution: "@ljharb/through@npm:2.3.12" + dependencies: + call-bind: "npm:^1.0.5" + checksum: 10/e1bd9b3a068d6a5886e0116ac34a13ec161d21088f65c5ca17beb141382af2358b46be9e359e6585496e9e61a4390839386dc78f5656e54e89a95c373b9eacfb languageName: node linkType: hard @@ -1792,117 +1925,161 @@ __metadata: languageName: node linkType: hard -"@nomicfoundation/edr-darwin-arm64@npm:0.5.2": - version: 0.5.2 - resolution: "@nomicfoundation/edr-darwin-arm64@npm:0.5.2" - checksum: 10/201d75a79cc2482ad7522bec5492426bd9d9324a15e0285fb7357ca8d656f43f0bc9121ad3767cc2629d108530450e396712eeb0226ef7872ead4db108ce5fdd - languageName: node - linkType: hard - -"@nomicfoundation/edr-darwin-x64@npm:0.5.2": - version: 0.5.2 - resolution: "@nomicfoundation/edr-darwin-x64@npm:0.5.2" - checksum: 10/d64d18471895334a492ee279388e9975f05d6aef03a49a9d48f1a8a15a01fb3854be871724473dc577d6c99d0440ce90e590ad3990eba54aa1ced6bed5827c30 +"@nomicfoundation/ethereumjs-block@npm:5.0.2": + version: 5.0.2 + resolution: "@nomicfoundation/ethereumjs-block@npm:5.0.2" + dependencies: + "@nomicfoundation/ethereumjs-common": "npm:4.0.2" + "@nomicfoundation/ethereumjs-rlp": "npm:5.0.2" + "@nomicfoundation/ethereumjs-trie": "npm:6.0.2" + "@nomicfoundation/ethereumjs-tx": "npm:5.0.2" + "@nomicfoundation/ethereumjs-util": "npm:9.0.2" + ethereum-cryptography: "npm:0.1.3" + ethers: "npm:^5.7.1" + checksum: 10/e3d7c24aa10306ae26389ce464f71e36fe8d331706e942a626594afdd097451d3bda210238b1da843e582b347f4349115b53432076b0f9b37ba36e31818b12cb languageName: node linkType: hard -"@nomicfoundation/edr-linux-arm64-gnu@npm:0.5.2": - version: 0.5.2 - resolution: "@nomicfoundation/edr-linux-arm64-gnu@npm:0.5.2" - checksum: 10/b2370caba6562c960e344f03aefb9c5cbdcfe96fef26481c7173867dd4486d0bf0b7d779fcd378b840d201b6021249fc689e99e71f44291371b10025b6eaaf71 +"@nomicfoundation/ethereumjs-blockchain@npm:7.0.2": + version: 7.0.2 + resolution: "@nomicfoundation/ethereumjs-blockchain@npm:7.0.2" + dependencies: + "@nomicfoundation/ethereumjs-block": "npm:5.0.2" + "@nomicfoundation/ethereumjs-common": "npm:4.0.2" + "@nomicfoundation/ethereumjs-ethash": "npm:3.0.2" + "@nomicfoundation/ethereumjs-rlp": "npm:5.0.2" + "@nomicfoundation/ethereumjs-trie": "npm:6.0.2" + "@nomicfoundation/ethereumjs-tx": "npm:5.0.2" + "@nomicfoundation/ethereumjs-util": "npm:9.0.2" + abstract-level: "npm:^1.0.3" + debug: "npm:^4.3.3" + ethereum-cryptography: "npm:0.1.3" + level: "npm:^8.0.0" + lru-cache: "npm:^5.1.1" + memory-level: "npm:^1.0.0" + checksum: 10/4cc27cf1d39175f93ec02b4627f0320258685fc19541c0cb2b9208204e65a924f3fbeb69c23840d7100a75c6d88b7a0c65f552cb44bf1e06b530a39ac6f04e17 languageName: node linkType: hard -"@nomicfoundation/edr-linux-arm64-musl@npm:0.5.2": - version: 0.5.2 - resolution: "@nomicfoundation/edr-linux-arm64-musl@npm:0.5.2" - checksum: 10/386bfec2bd2c4e2dfd6cd01418c0c97842e0a9668dd6095532659a0028f9517eadc5d2046a3fcac8a9498111cbed4f289a6e6fa5d6468254cd126ad7500117c8 +"@nomicfoundation/ethereumjs-common@npm:4.0.2": + version: 4.0.2 + resolution: "@nomicfoundation/ethereumjs-common@npm:4.0.2" + dependencies: + "@nomicfoundation/ethereumjs-util": "npm:9.0.2" + crc-32: "npm:^1.2.0" + checksum: 10/ea0199240a9cfc932450421b00ba390a9d357092fdbb6ceee2b09ee6a8bc7820fb1df076ead94e0b6748158620ec655099e401816d47ad24eb603694f3a787d1 languageName: node linkType: hard -"@nomicfoundation/edr-linux-x64-gnu@npm:0.5.2": - version: 0.5.2 - resolution: "@nomicfoundation/edr-linux-x64-gnu@npm:0.5.2" - checksum: 10/feac8d6b9505b8ee01834375d209fc601a1c4d5b059674194db1d9bd4f1ab60204e3f4391867a868db5cc4fb6a27d8f8d4fa2b1cef380057f8235de1da1a69ff +"@nomicfoundation/ethereumjs-ethash@npm:3.0.2": + version: 3.0.2 + resolution: "@nomicfoundation/ethereumjs-ethash@npm:3.0.2" + dependencies: + "@nomicfoundation/ethereumjs-block": "npm:5.0.2" + "@nomicfoundation/ethereumjs-rlp": "npm:5.0.2" + "@nomicfoundation/ethereumjs-util": "npm:9.0.2" + abstract-level: "npm:^1.0.3" + bigint-crypto-utils: "npm:^3.0.23" + ethereum-cryptography: "npm:0.1.3" + checksum: 10/c7d963a6806e70cb96ff290a9bc461fb6ad4f74144d9f38eb5f190b228d9b0961aa67d398f80da4b59efb8c57957c936b32faab26c17cf07a6145efe0a6d16e9 languageName: node linkType: hard -"@nomicfoundation/edr-linux-x64-musl@npm:0.5.2": - version: 0.5.2 - resolution: "@nomicfoundation/edr-linux-x64-musl@npm:0.5.2" - checksum: 10/278ce49c69b088d15c5ad18794b01b18afd6cbb1a739bd2aed3a880a73c0369a3f60dd72dad5a4a605da5a14a8971e7a7513514bd8479a2a1ebe630b329f1b17 +"@nomicfoundation/ethereumjs-evm@npm:2.0.2": + version: 2.0.2 + resolution: "@nomicfoundation/ethereumjs-evm@npm:2.0.2" + dependencies: + "@ethersproject/providers": "npm:^5.7.1" + "@nomicfoundation/ethereumjs-common": "npm:4.0.2" + "@nomicfoundation/ethereumjs-tx": "npm:5.0.2" + "@nomicfoundation/ethereumjs-util": "npm:9.0.2" + debug: "npm:^4.3.3" + ethereum-cryptography: "npm:0.1.3" + mcl-wasm: "npm:^0.7.1" + rustbn.js: "npm:~0.2.0" + checksum: 10/abcc280500d776a214b282d5a66093fdf3b91582e9f69d6f35e0c7000f58af57060cd384acda7d147193f962f17a8c4ed55e5f2453b2d5b43d694d6588306ef9 languageName: node linkType: hard -"@nomicfoundation/edr-win32-x64-msvc@npm:0.5.2": - version: 0.5.2 - resolution: "@nomicfoundation/edr-win32-x64-msvc@npm:0.5.2" - checksum: 10/032ef94e5eb59dea16d243f59e23f4327179cd21c99329d2c3b7a0372d58924c310fd3831af08fa26a9fa04bb99aa19ac0e537b9cc6d6b2880b0d204571054fa +"@nomicfoundation/ethereumjs-rlp@npm:5.0.2": + version: 5.0.2 + resolution: "@nomicfoundation/ethereumjs-rlp@npm:5.0.2" + bin: + rlp: bin/rlp + checksum: 10/ceb820296624f45fa8f7cd3e2cfa4d229722953e91631e6fb3fbca9d1ebe8eea21a8ef4917fa15295f05bed369db06eb81f44e74382b1bca4ece2bb000c6e6d4 languageName: node linkType: hard -"@nomicfoundation/edr@npm:^0.5.2": - version: 0.5.2 - resolution: "@nomicfoundation/edr@npm:0.5.2" +"@nomicfoundation/ethereumjs-statemanager@npm:2.0.2": + version: 2.0.2 + resolution: "@nomicfoundation/ethereumjs-statemanager@npm:2.0.2" dependencies: - "@nomicfoundation/edr-darwin-arm64": "npm:0.5.2" - "@nomicfoundation/edr-darwin-x64": "npm:0.5.2" - "@nomicfoundation/edr-linux-arm64-gnu": "npm:0.5.2" - "@nomicfoundation/edr-linux-arm64-musl": "npm:0.5.2" - "@nomicfoundation/edr-linux-x64-gnu": "npm:0.5.2" - "@nomicfoundation/edr-linux-x64-musl": "npm:0.5.2" - "@nomicfoundation/edr-win32-x64-msvc": "npm:0.5.2" - checksum: 10/c1dad20ae11888962fbb24edb0af74395037fed9fdeef6598f4e5ce4ed16c5517fa7592d39901c535da64705ac0726dce9b82d4fcda4528c975e25a24cb28306 + "@nomicfoundation/ethereumjs-common": "npm:4.0.2" + "@nomicfoundation/ethereumjs-rlp": "npm:5.0.2" + debug: "npm:^4.3.3" + ethereum-cryptography: "npm:0.1.3" + ethers: "npm:^5.7.1" + js-sdsl: "npm:^4.1.4" + checksum: 10/0eb939c75aa63517ec8832330c02a71c060fd8424ebe608a072c563a0a9d16621dca9a9c851fa98971316aed80dd9174a0d72ae09633a9698367a3316d773389 languageName: node linkType: hard -"@nomicfoundation/ethereumjs-common@npm:4.0.4": - version: 4.0.4 - resolution: "@nomicfoundation/ethereumjs-common@npm:4.0.4" +"@nomicfoundation/ethereumjs-trie@npm:6.0.2": + version: 6.0.2 + resolution: "@nomicfoundation/ethereumjs-trie@npm:6.0.2" dependencies: - "@nomicfoundation/ethereumjs-util": "npm:9.0.4" - checksum: 10/1daaede087c5dee92cb1e5309a548da2d64484722b917eccda4118d627293b61f705a990075f4d7f0f350100ed79396b3a25e7ea67824242d36d23716fe75e97 + "@nomicfoundation/ethereumjs-rlp": "npm:5.0.2" + "@nomicfoundation/ethereumjs-util": "npm:9.0.2" + "@types/readable-stream": "npm:^2.3.13" + ethereum-cryptography: "npm:0.1.3" + readable-stream: "npm:^3.6.0" + checksum: 10/f70b89e7f089a90647ea96babc23427cf4db3bdc027667b93be38a0ff03f3222c5130529778fb210ffa56eb2a53cb1657cafdfe828c6a41825bb7e2b74614060 languageName: node linkType: hard -"@nomicfoundation/ethereumjs-rlp@npm:5.0.4": - version: 5.0.4 - resolution: "@nomicfoundation/ethereumjs-rlp@npm:5.0.4" - bin: - rlp: bin/rlp.cjs - checksum: 10/39fb26340bb2643a66c642315aa7b6fcfbdbddddeee18b4b683b77aa93b8a031bc86d4d4144368e5dd20499dc96b8b27751c6a285ff34e7a9969b530b306ce8c +"@nomicfoundation/ethereumjs-tx@npm:5.0.2": + version: 5.0.2 + resolution: "@nomicfoundation/ethereumjs-tx@npm:5.0.2" + dependencies: + "@chainsafe/ssz": "npm:^0.9.2" + "@ethersproject/providers": "npm:^5.7.2" + "@nomicfoundation/ethereumjs-common": "npm:4.0.2" + "@nomicfoundation/ethereumjs-rlp": "npm:5.0.2" + "@nomicfoundation/ethereumjs-util": "npm:9.0.2" + ethereum-cryptography: "npm:0.1.3" + checksum: 10/0feb40b602d3b525359f57ad76d64542e192a6f8bb714477b9044b5ba13ab7007a3b5a8a2b2df50e3fdcc9da0c04d07daa3797bc5cc6aad5d29d5633c5616251 languageName: node linkType: hard -"@nomicfoundation/ethereumjs-tx@npm:5.0.4": - version: 5.0.4 - resolution: "@nomicfoundation/ethereumjs-tx@npm:5.0.4" +"@nomicfoundation/ethereumjs-util@npm:9.0.2": + version: 9.0.2 + resolution: "@nomicfoundation/ethereumjs-util@npm:9.0.2" dependencies: - "@nomicfoundation/ethereumjs-common": "npm:4.0.4" - "@nomicfoundation/ethereumjs-rlp": "npm:5.0.4" - "@nomicfoundation/ethereumjs-util": "npm:9.0.4" + "@chainsafe/ssz": "npm:^0.10.0" + "@nomicfoundation/ethereumjs-rlp": "npm:5.0.2" ethereum-cryptography: "npm:0.1.3" - peerDependencies: - c-kzg: ^2.1.2 - peerDependenciesMeta: - c-kzg: - optional: true - checksum: 10/5e84de14fa464501c5c60ac6519f536d39ebc52c4d1fb79c63a66ea86f992bde4f338b0b0fdd2e5bc811ebd984e8ff41e4205e47d30001bad5b45370568bc41c + checksum: 10/ec687ecd964bf624e82b5f0cbbffd0896dfdcff6e7b3eb216d18b79cdb6735f2c8a516d04c5a2b0e36a906bd8f35174a4653634151f35e615a7d24d901a35905 languageName: node linkType: hard -"@nomicfoundation/ethereumjs-util@npm:9.0.4": - version: 9.0.4 - resolution: "@nomicfoundation/ethereumjs-util@npm:9.0.4" - dependencies: - "@nomicfoundation/ethereumjs-rlp": "npm:5.0.4" +"@nomicfoundation/ethereumjs-vm@npm:7.0.2": + version: 7.0.2 + resolution: "@nomicfoundation/ethereumjs-vm@npm:7.0.2" + dependencies: + "@nomicfoundation/ethereumjs-block": "npm:5.0.2" + "@nomicfoundation/ethereumjs-blockchain": "npm:7.0.2" + "@nomicfoundation/ethereumjs-common": "npm:4.0.2" + "@nomicfoundation/ethereumjs-evm": "npm:2.0.2" + "@nomicfoundation/ethereumjs-rlp": "npm:5.0.2" + "@nomicfoundation/ethereumjs-statemanager": "npm:2.0.2" + "@nomicfoundation/ethereumjs-trie": "npm:6.0.2" + "@nomicfoundation/ethereumjs-tx": "npm:5.0.2" + "@nomicfoundation/ethereumjs-util": "npm:9.0.2" + debug: "npm:^4.3.3" ethereum-cryptography: "npm:0.1.3" - peerDependencies: - c-kzg: ^2.1.2 - peerDependenciesMeta: - c-kzg: - optional: true - checksum: 10/891806c7edda29c7b3f61551949ff0c1fa5f4e122fba84878bf27362a9e058768fd01194dc0e031de2e523c30ecbeb22e6841b8ab3772c8567fef4af6480872d + mcl-wasm: "npm:^0.7.1" + rustbn.js: "npm:~0.2.0" + checksum: 10/7ad391bc68e8e755ed0b88012e8857390590b5ba8b11bdb4995b04ba7afed5570a4259b85fff329affb643e87be12972ca44d269e14e5f840a82c315011d0d7a languageName: node linkType: hard @@ -2070,52 +2247,50 @@ __metadata: languageName: node linkType: hard -"@npmcli/arborist@npm:^7.5.4": - version: 7.5.4 - resolution: "@npmcli/arborist@npm:7.5.4" +"@npmcli/arborist@npm:^7.3.1": + version: 7.3.1 + resolution: "@npmcli/arborist@npm:7.3.1" dependencies: "@isaacs/string-locale-compare": "npm:^1.1.0" - "@npmcli/fs": "npm:^3.1.1" - "@npmcli/installed-package-contents": "npm:^2.1.0" + "@npmcli/fs": "npm:^3.1.0" + "@npmcli/installed-package-contents": "npm:^2.0.2" "@npmcli/map-workspaces": "npm:^3.0.2" - "@npmcli/metavuln-calculator": "npm:^7.1.1" + "@npmcli/metavuln-calculator": "npm:^7.0.0" "@npmcli/name-from-folder": "npm:^2.0.0" "@npmcli/node-gyp": "npm:^3.0.0" - "@npmcli/package-json": "npm:^5.1.0" - "@npmcli/query": "npm:^3.1.0" - "@npmcli/redact": "npm:^2.0.0" - "@npmcli/run-script": "npm:^8.1.0" - bin-links: "npm:^4.0.4" - cacache: "npm:^18.0.3" + "@npmcli/package-json": "npm:^5.0.0" + "@npmcli/query": "npm:^3.0.1" + "@npmcli/run-script": "npm:^7.0.2" + bin-links: "npm:^4.0.1" + cacache: "npm:^18.0.0" common-ancestor-path: "npm:^1.0.1" - hosted-git-info: "npm:^7.0.2" - json-parse-even-better-errors: "npm:^3.0.2" + hosted-git-info: "npm:^7.0.1" + json-parse-even-better-errors: "npm:^3.0.0" json-stringify-nice: "npm:^1.1.4" - lru-cache: "npm:^10.2.2" - minimatch: "npm:^9.0.4" - nopt: "npm:^7.2.1" + minimatch: "npm:^9.0.0" + nopt: "npm:^7.0.0" npm-install-checks: "npm:^6.2.0" - npm-package-arg: "npm:^11.0.2" - npm-pick-manifest: "npm:^9.0.1" - npm-registry-fetch: "npm:^17.0.1" - pacote: "npm:^18.0.6" + npm-package-arg: "npm:^11.0.1" + npm-pick-manifest: "npm:^9.0.0" + npm-registry-fetch: "npm:^16.0.0" + npmlog: "npm:^7.0.1" + pacote: "npm:^17.0.4" parse-conflict-json: "npm:^3.0.0" - proc-log: "npm:^4.2.0" - proggy: "npm:^2.0.0" + proc-log: "npm:^3.0.0" promise-all-reject-late: "npm:^1.0.0" promise-call-limit: "npm:^3.0.1" read-package-json-fast: "npm:^3.0.2" semver: "npm:^7.3.7" - ssri: "npm:^10.0.6" + ssri: "npm:^10.0.5" treeverse: "npm:^3.0.0" walk-up-path: "npm:^3.0.1" bin: arborist: bin/index.js - checksum: 10/b77170754f419171e5ca2abfb679a9c811443e2b67036916a62eda81fd069f12c98186941cd73a0d36c2ec76cda638b43ceeb4c5fae39de1bb9df825432f3ef7 + checksum: 10/c265bdedfd1c8f961f7d1161c956e813ece91782c8a8ef92c57c744456c3d79bd386d5653a8223db0ecc26cbdb0accc47be71315d1c01a80c70584254b0af2e5 languageName: node linkType: hard -"@npmcli/fs@npm:^3.1.0, @npmcli/fs@npm:^3.1.1": +"@npmcli/fs@npm:^3.1.0": version: 3.1.1 resolution: "@npmcli/fs@npm:3.1.1" dependencies: @@ -2140,7 +2315,7 @@ __metadata: languageName: node linkType: hard -"@npmcli/installed-package-contents@npm:^2.0.1, @npmcli/installed-package-contents@npm:^2.1.0": +"@npmcli/installed-package-contents@npm:^2.0.1, @npmcli/installed-package-contents@npm:^2.0.2": version: 2.1.0 resolution: "@npmcli/installed-package-contents@npm:2.1.0" dependencies: @@ -2164,16 +2339,15 @@ __metadata: languageName: node linkType: hard -"@npmcli/metavuln-calculator@npm:^7.1.1": - version: 7.1.1 - resolution: "@npmcli/metavuln-calculator@npm:7.1.1" +"@npmcli/metavuln-calculator@npm:^7.0.0": + version: 7.0.0 + resolution: "@npmcli/metavuln-calculator@npm:7.0.0" dependencies: cacache: "npm:^18.0.0" json-parse-even-better-errors: "npm:^3.0.0" - pacote: "npm:^18.0.0" - proc-log: "npm:^4.1.0" + pacote: "npm:^17.0.0" semver: "npm:^7.3.5" - checksum: 10/57163b4bde4af3f5badb0c9b0c868f9539e2a112ee73c606680b7548b148bf58e793952d74eb1e581c9cc2e630bc03bc60adc04b3f1e7960482f97af817f28d2 + checksum: 10/fd2404f5f07dcb4257409a2ffa7e571541efbdd28527ac05a7dd79768be9e169639343c2a41be88e019c62317b8464072cd6accccd4a069566218af40ad863e8 languageName: node linkType: hard @@ -2191,7 +2365,7 @@ __metadata: languageName: node linkType: hard -"@npmcli/package-json@npm:^5.0.0, @npmcli/package-json@npm:^5.1.0, @npmcli/package-json@npm:^5.2.0": +"@npmcli/package-json@npm:^5.0.0": version: 5.2.0 resolution: "@npmcli/package-json@npm:5.2.0" dependencies: @@ -2215,23 +2389,29 @@ __metadata: languageName: node linkType: hard -"@npmcli/query@npm:^3.1.0": - version: 3.1.0 - resolution: "@npmcli/query@npm:3.1.0" +"@npmcli/query@npm:^3.0.1": + version: 3.0.1 + resolution: "@npmcli/query@npm:3.0.1" dependencies: postcss-selector-parser: "npm:^6.0.10" - checksum: 10/fa79ae317934c95d14b89cb149cb8eb0b2a4e611acf0661681cfa964bf9af6740f60efe095c8bb7e880398e0955666408cc8a3ffede90e87922cb81cce1efcdb + checksum: 10/8e5ac95fc145101fc33288d434c5d50d19fb31b1068140fae8777fd76f407ab9e54feb7c7e8465d367cc25c2a06da6172c81476095fb6ef8781e1d28d1c82e25 languageName: node linkType: hard -"@npmcli/redact@npm:^2.0.0": - version: 2.0.1 - resolution: "@npmcli/redact@npm:2.0.1" - checksum: 10/f19a521fa71b539707eee69106ed3d97e3047712d4f279c80007a8d0aef63d137e3062941f11e19d6cec03812eaa0872891ae20c84f603d9e021dfb93cc9d6e5 +"@npmcli/run-script@npm:^7.0.0, @npmcli/run-script@npm:^7.0.2, @npmcli/run-script@npm:^7.0.4": + version: 7.0.4 + resolution: "@npmcli/run-script@npm:7.0.4" + dependencies: + "@npmcli/node-gyp": "npm:^3.0.0" + "@npmcli/package-json": "npm:^5.0.0" + "@npmcli/promise-spawn": "npm:^7.0.0" + node-gyp: "npm:^10.0.0" + which: "npm:^4.0.0" + checksum: 10/f09268051f74af7d7be46e9911a23126d531160c338d3c05d53e6cd7994b88271fb4ec524139fe7f2d826525f15a281eafef3be02831adc1f68556a8a668621a languageName: node linkType: hard -"@npmcli/run-script@npm:^8.0.0, @npmcli/run-script@npm:^8.1.0": +"@npmcli/run-script@npm:^8.1.0": version: 8.1.0 resolution: "@npmcli/run-script@npm:8.1.0" dependencies: @@ -2340,53 +2520,53 @@ __metadata: languageName: node linkType: hard -"@octokit/auth-token@npm:^5.0.0": - version: 5.1.1 - resolution: "@octokit/auth-token@npm:5.1.1" - checksum: 10/956ee8166ad1b623478ac5168529a081658bceb16e267102b149b44366a9280b5104a0346a4f1c5de12981d2dedb767f7b71d7e1b1ddd1ccb591efa8c6c06f94 +"@octokit/auth-token@npm:^4.0.0": + version: 4.0.0 + resolution: "@octokit/auth-token@npm:4.0.0" + checksum: 10/60e42701e341d700f73c518c7a35675d36d79fa9d5e838cc3ade96d147e49f5ba74db2e07b2337c2b95aaa540aa42088116df2122daa25633f9e70a2c8785c44 languageName: node linkType: hard -"@octokit/core@npm:^6.1.2": - version: 6.1.2 - resolution: "@octokit/core@npm:6.1.2" +"@octokit/core@npm:^5.0.0": + version: 5.1.0 + resolution: "@octokit/core@npm:5.1.0" dependencies: - "@octokit/auth-token": "npm:^5.0.0" - "@octokit/graphql": "npm:^8.0.0" - "@octokit/request": "npm:^9.0.0" - "@octokit/request-error": "npm:^6.0.1" - "@octokit/types": "npm:^13.0.0" - before-after-hook: "npm:^3.0.2" - universal-user-agent: "npm:^7.0.0" - checksum: 10/ef8cc502790142d892b97b92a6e398323f1e4be777e5675681d5985d4681855f4e6f02a7b16466984af702ecdffed0ab923610d59c07c540c3e243160818eaec + "@octokit/auth-token": "npm:^4.0.0" + "@octokit/graphql": "npm:^7.0.0" + "@octokit/request": "npm:^8.0.2" + "@octokit/request-error": "npm:^5.0.0" + "@octokit/types": "npm:^12.0.0" + before-after-hook: "npm:^2.2.0" + universal-user-agent: "npm:^6.0.0" + checksum: 10/8062e86a3088f24a691b36d2c3e9f33e864cefcb5f544b0633650358bce280708b111551cbe855ecf6a5190d6fc4fec1220117c329a2c27525940dd97b868614 languageName: node linkType: hard -"@octokit/endpoint@npm:^10.0.0": - version: 10.1.1 - resolution: "@octokit/endpoint@npm:10.1.1" +"@octokit/endpoint@npm:^9.0.0": + version: 9.0.4 + resolution: "@octokit/endpoint@npm:9.0.4" dependencies: - "@octokit/types": "npm:^13.0.0" - universal-user-agent: "npm:^7.0.2" - checksum: 10/6b8991b278ba7e63ddf95e7396f54e5f1347237f11fb845322ec25101764336ed0994ccb197c449b4fd4bc00ec5b78780ccbc3a0b48ba0620dcc115027a3add1 + "@octokit/types": "npm:^12.0.0" + universal-user-agent: "npm:^6.0.0" + checksum: 10/7df35c96f2b5628fe5b3f44a72614be9b439779c06b4dd1bb72283b3cb2ea53e59e1f9a108798efe5404b6856f4380a4c5be12d93255d854f0683cd6e22f3a27 languageName: node linkType: hard -"@octokit/graphql@npm:^8.0.0": - version: 8.1.1 - resolution: "@octokit/graphql@npm:8.1.1" +"@octokit/graphql@npm:^7.0.0": + version: 7.0.2 + resolution: "@octokit/graphql@npm:7.0.2" dependencies: - "@octokit/request": "npm:^9.0.0" - "@octokit/types": "npm:^13.0.0" - universal-user-agent: "npm:^7.0.0" - checksum: 10/d8b3941e6afa724fba0cff79c71c839971aed6f87777833e1f6facc816c5fcd9a5b637dad779462cd723aa7490151f69fc6634758ca5bfe76f2cce298df934a1 + "@octokit/request": "npm:^8.0.1" + "@octokit/types": "npm:^12.0.0" + universal-user-agent: "npm:^6.0.0" + checksum: 10/f5dcc51fed5304f65dab83fcea4c2a569107d3b71e8d084199dc44f0d0cfc852c9e1f341b06ae66601f9da4af3aad416b0c62dcd0567ac7568f072d8d90d502e languageName: node linkType: hard -"@octokit/openapi-types@npm:^22.2.0": - version: 22.2.0 - resolution: "@octokit/openapi-types@npm:22.2.0" - checksum: 10/0471b0c789fada5aa2390e6f82ba477738228ef7d2d986dda9aab0cb625d1562bd178ba0ba4d2655ce841079cd5efff9e58ece2077c27e569ea22109ea301830 +"@octokit/openapi-types@npm:^19.1.0": + version: 19.1.0 + resolution: "@octokit/openapi-types@npm:19.1.0" + checksum: 10/3abedc09baa91bb4de00a2b82bf519401c2b6388913b7caa98541002c9e9612eba8256926323b1e40782ac700309a3373bb8c13520af325cef1accc40cb4566b languageName: node linkType: hard @@ -2397,76 +2577,78 @@ __metadata: languageName: node linkType: hard -"@octokit/plugin-paginate-rest@npm:^11.0.0": - version: 11.3.3 - resolution: "@octokit/plugin-paginate-rest@npm:11.3.3" +"@octokit/plugin-paginate-rest@npm:^9.0.0": + version: 9.1.5 + resolution: "@octokit/plugin-paginate-rest@npm:9.1.5" dependencies: - "@octokit/types": "npm:^13.5.0" + "@octokit/types": "npm:^12.4.0" peerDependencies: - "@octokit/core": ">=6" - checksum: 10/87eeb4dd68a8207e669989cdbf9de3717b74038d630c2b803cbc7a9c44c3ff74771ce1cf45fa056b7172aaaa80fd9a0e4bf5eca06aabc19f30e7e29898f1f69e + "@octokit/core": ">=5" + checksum: 10/5f1793ebebc9e2feaf8574beb2308b6fe9d0fec69d3fc3c93ed7ce8083d34e7ae7452121bd88b27e9ba91da29d648f8ffbf19d6f02787f8273a8bb0e3fbc2b9f languageName: node linkType: hard -"@octokit/plugin-request-log@npm:^5.3.1": - version: 5.3.1 - resolution: "@octokit/plugin-request-log@npm:5.3.1" +"@octokit/plugin-request-log@npm:^4.0.0": + version: 4.0.0 + resolution: "@octokit/plugin-request-log@npm:4.0.0" peerDependencies: - "@octokit/core": ">=6" - checksum: 10/a27e163282c8d0ba8feee4d3cbbd1b62e1aa89a892877f7a9876fc17ddde3e1e1af922e6664221a0cabae99b8a7a2a5215b9ec2ee5222edb50e06298e99022b0 + "@octokit/core": ">=5" + checksum: 10/2a8a6619640942092009a9248ceeb163ce01c978e2d7b2a7eb8686bd09a04b783c4cd9071eebb16652d233587abcde449a02ce4feabc652f0a171615fb3e9946 languageName: node linkType: hard -"@octokit/plugin-rest-endpoint-methods@npm:^13.0.0": - version: 13.2.4 - resolution: "@octokit/plugin-rest-endpoint-methods@npm:13.2.4" +"@octokit/plugin-rest-endpoint-methods@npm:^10.0.0": + version: 10.2.0 + resolution: "@octokit/plugin-rest-endpoint-methods@npm:10.2.0" dependencies: - "@octokit/types": "npm:^13.5.0" + "@octokit/types": "npm:^12.3.0" peerDependencies: - "@octokit/core": ">=6" - checksum: 10/5d90adb9b5ab52a7ce260fcd2acc48a6723fc888e4f5711f958694c4bfb53fa146ad6791ce651060566d1bd513b3d9287c44a25b1da866d9611c3e1e739b5981 + "@octokit/core": ">=5" + checksum: 10/0f8ca73b3e582b366b400278f19df6309f263efa3809a9d6ba613063e7a26f16d6f8d69c413bf9b23c2431ad4c795e4e06a43717b6acc1367186fb55347cfb69 languageName: node linkType: hard -"@octokit/request-error@npm:^6.0.1": - version: 6.1.4 - resolution: "@octokit/request-error@npm:6.1.4" +"@octokit/request-error@npm:^5.0.0": + version: 5.0.1 + resolution: "@octokit/request-error@npm:5.0.1" dependencies: - "@octokit/types": "npm:^13.0.0" - checksum: 10/e4e475ec50cef8e271f39e69667d0f8eaccb2367aa56b81638c629b5bbfa2b697b40207301e5c797a63051a82d8698e7c792b4050b84e383c54300a49a01304a + "@octokit/types": "npm:^12.0.0" + deprecation: "npm:^2.0.0" + once: "npm:^1.4.0" + checksum: 10/a21a4614c46cb173e4ba73fa048576204f1ddc541dee3e7c938ef36088566e3b25e04ca1f96f375ec2e3cc29b7ba970b3b078a89a20bc50cdcdbed879db94573 languageName: node linkType: hard -"@octokit/request@npm:^9.0.0": - version: 9.1.3 - resolution: "@octokit/request@npm:9.1.3" +"@octokit/request@npm:^8.0.1, @octokit/request@npm:^8.0.2": + version: 8.2.0 + resolution: "@octokit/request@npm:8.2.0" dependencies: - "@octokit/endpoint": "npm:^10.0.0" - "@octokit/request-error": "npm:^6.0.1" - "@octokit/types": "npm:^13.1.0" - universal-user-agent: "npm:^7.0.2" - checksum: 10/b445f263157a2c608d8cfa89162be5f5d39551607d0ec973c3fdf9d3fd3753e33861c4e34942f5dbf47576ac91a99238ed482f2d6c6af3f9070e0b190b3f07a2 + "@octokit/endpoint": "npm:^9.0.0" + "@octokit/request-error": "npm:^5.0.0" + "@octokit/types": "npm:^12.0.0" + universal-user-agent: "npm:^6.0.0" + checksum: 10/553ba8b99ea6fe2d3b66b2be6df06f7fe62a0b81e441d334ef25388cf0fcdab4a888fcfe2c1fb1ada262c233bcf7169da3ad5e03f024060ea5723f7753b0de3e languageName: node linkType: hard -"@octokit/rest@npm:^21.0.2": - version: 21.0.2 - resolution: "@octokit/rest@npm:21.0.2" +"@octokit/rest@npm:^20.0.2": + version: 20.0.2 + resolution: "@octokit/rest@npm:20.0.2" dependencies: - "@octokit/core": "npm:^6.1.2" - "@octokit/plugin-paginate-rest": "npm:^11.0.0" - "@octokit/plugin-request-log": "npm:^5.3.1" - "@octokit/plugin-rest-endpoint-methods": "npm:^13.0.0" - checksum: 10/f67fbb1b3e9568f352933c55703cd33354183e48710a146f6a1c5930419006d2d97c08f5b0a29a56fffc9e53f01b34bae2681a577f604172f4331644b85a9779 + "@octokit/core": "npm:^5.0.0" + "@octokit/plugin-paginate-rest": "npm:^9.0.0" + "@octokit/plugin-request-log": "npm:^4.0.0" + "@octokit/plugin-rest-endpoint-methods": "npm:^10.0.0" + checksum: 10/527e1806ca274209a2a7daa485010dafb2ebb6c9b0b44c1d33a8f1f16f10e54a96386a4f642dc416160842a4b367d3953d27f8b827b9a94600709d2ac5e95d21 languageName: node linkType: hard -"@octokit/types@npm:^13.0.0, @octokit/types@npm:^13.1.0, @octokit/types@npm:^13.5.0": - version: 13.5.0 - resolution: "@octokit/types@npm:13.5.0" +"@octokit/types@npm:^12.0.0, @octokit/types@npm:^12.3.0, @octokit/types@npm:^12.4.0": + version: 12.4.0 + resolution: "@octokit/types@npm:12.4.0" dependencies: - "@octokit/openapi-types": "npm:^22.2.0" - checksum: 10/d2aeebc1d8684c4e950f054a52b484e898b72d9f5f8433bcf010161716eea20d1132820d922212f19557a8f147354f2674d1a27b22941308b7c298bdd2674ffa + "@octokit/openapi-types": "npm:^19.1.0" + checksum: 10/b0a893e31fed59a919c2072ae67b671aa5f21e00ee3dee689af325f09f12ddd9175ce07c590b835d183bcb1cd2a2da908e02391b2fc33071881561366b2a35e7 languageName: node linkType: hard @@ -2673,13 +2855,6 @@ __metadata: languageName: node linkType: hard -"@sec-ant/readable-stream@npm:^0.4.1": - version: 0.4.1 - resolution: "@sec-ant/readable-stream@npm:0.4.1" - checksum: 10/aac89581652ac85debe7c5303451c2ebf8bf25ca25db680e4b9b73168f6940616d9a4bbe3348981827b1159b14e2f2e6af4b7bd5735cac898c12d5c51909c102 - languageName: node - linkType: hard - "@sentry/core@npm:5.30.0": version: 5.30.0 resolution: "@sentry/core@npm:5.30.0" @@ -2857,21 +3032,21 @@ __metadata: languageName: node linkType: hard -"@sinonjs/fake-timers@npm:11.2.2, @sinonjs/fake-timers@npm:^11.2.2": - version: 11.2.2 - resolution: "@sinonjs/fake-timers@npm:11.2.2" +"@sinonjs/fake-timers@npm:^10.0.2": + version: 10.3.0 + resolution: "@sinonjs/fake-timers@npm:10.3.0" dependencies: "@sinonjs/commons": "npm:^3.0.0" - checksum: 10/da7dfa677b2362bc5a321fc1563184755b5c62fbb1a72457fb9e901cd187ba9dc834f9e8a0fb5a4e1d1e6e6ad4c5b54e90900faa44dd6c82d3c49c92ec23ecd4 + checksum: 10/78155c7bd866a85df85e22028e046b8d46cf3e840f72260954f5e3ed5bd97d66c595524305a6841ffb3f681a08f6e5cef572a2cce5442a8a232dc29fb409b83e languageName: node linkType: hard -"@sinonjs/fake-timers@npm:^10.0.2": - version: 10.3.0 - resolution: "@sinonjs/fake-timers@npm:10.3.0" +"@sinonjs/fake-timers@npm:^11.2.2": + version: 11.2.2 + resolution: "@sinonjs/fake-timers@npm:11.2.2" dependencies: "@sinonjs/commons": "npm:^3.0.0" - checksum: 10/78155c7bd866a85df85e22028e046b8d46cf3e840f72260954f5e3ed5bd97d66c595524305a6841ffb3f681a08f6e5cef572a2cce5442a8a232dc29fb409b83e + checksum: 10/da7dfa677b2362bc5a321fc1563184755b5c62fbb1a72457fb9e901cd187ba9dc834f9e8a0fb5a4e1d1e6e6ad4c5b54e90900faa44dd6c82d3c49c92ec23ecd4 languageName: node linkType: hard @@ -2902,6 +3077,13 @@ __metadata: languageName: node linkType: hard +"@solidity-parser/parser@npm:^0.17.0": + version: 0.17.0 + resolution: "@solidity-parser/parser@npm:0.17.0" + checksum: 10/76de7d1268de676c101b9a41576c324c0d0b9699e3ba3d846b5e580d6cae454fd7ec088011c316ce18af1b23a1482da88768d30f0e41becfd9da90f692fb9a65 + languageName: node + linkType: hard + "@solidity-parser/parser@npm:^0.18.0": version: 0.18.0 resolution: "@solidity-parser/parser@npm:0.18.0" @@ -3052,7 +3234,7 @@ __metadata: ts-node: "npm:^10.9.2" typechain: "npm:^8.3.2" typescript: "npm:^5.5.4" - viem: "npm:^2.9.31" + viem: "npm:^2.16.5" peerDependencies: "@usecannon/builder": ^2.16.2 "@usecannon/cli": ^2.16.2 @@ -3132,11 +3314,16 @@ __metadata: version: 0.0.0-use.local resolution: "@synthetixio/hardhat-storage@workspace:utils/hardhat-storage" dependencies: + "@solidity-parser/parser": "npm:^0.18.0" "@synthetixio/core-utils": "workspace:*" "@types/jest": "npm:^29.5.12" + "@types/lodash.memoize": "npm:^4.1.9" "@types/mustache": "npm:^4.2.5" + chalk: "npm:^4.1.2" + cli-table3: "npm:^0.6.5" hardhat: "npm:^2.19.5" jest: "npm:^29.7.0" + lodash.memoize: "npm:^4.1.2" mustache: "npm:^4.2.0" solidity-ast: "npm:^0.4.55" ts-jest: "npm:^29.1.2" @@ -3675,7 +3862,16 @@ __metadata: languageName: node linkType: hard -"@types/lodash@npm:^4.14.199": +"@types/lodash.memoize@npm:^4.1.9": + version: 4.1.9 + resolution: "@types/lodash.memoize@npm:4.1.9" + dependencies: + "@types/lodash": "npm:*" + checksum: 10/d11efe604911aabbf9c49eb02e944de856619d6e0ab348d83be3ff07de245ee605ea71b1f3ee24b5c134286d02625119edf3ac2c0e6aa4732f699b1f4aa55240 + languageName: node + linkType: hard + +"@types/lodash@npm:*, @types/lodash@npm:^4.14.199": version: 4.17.7 resolution: "@types/lodash@npm:4.17.7" checksum: 10/b8177f19cf962414a66989837481b13f546afc2e98e8d465bec59e6ac03a59c584eb7053ce511cde3a09c5f3096d22a5ae22cfb56b23f3b0da75b0743b6b1a44 @@ -3697,11 +3893,11 @@ __metadata: linkType: hard "@types/micromatch@npm:^4": - version: 4.0.9 - resolution: "@types/micromatch@npm:4.0.9" + version: 4.0.6 + resolution: "@types/micromatch@npm:4.0.6" dependencies: "@types/braces": "npm:*" - checksum: 10/324f4bcb4a7caa2048bdd650f442d2c24b5bf6bc95e4d63d4741bd234fdcf3cde140217bd477b2c02c7fb0034c7293037fd7b61429ace84e997dd3b4d3b2b2f7 + checksum: 10/d86560645ad74acfd8251da612e459f72c1b146ad48cfd894aae1c4d0e55f2ea32491f793b623c7890dae546bf4b6e3b31fc536e4448ea5331c7a26acc450f94 languageName: node linkType: hard @@ -3736,9 +3932,9 @@ __metadata: linkType: hard "@types/mocha@npm:*, @types/mocha@npm:^10.0.6": - version: 10.0.7 - resolution: "@types/mocha@npm:10.0.7" - checksum: 10/4494871e8a867633d818b00d6f29d47379f9e23655b89ca728166ff2f0a406b97d376fcc3e7a570a3840f72abb03c886c5e66f50ae0f018376e4dc10ed179564 + version: 10.0.6 + resolution: "@types/mocha@npm:10.0.6" + checksum: 10/fc73626e81e89c32d06b7ff9b72c4177b46d579cdd932f796614adc026852d84cb849d743473ba572cb4d9ea6d8c04e3749552d326c26495ec1c4b46e6e0a0c0 languageName: node linkType: hard @@ -3854,6 +4050,16 @@ __metadata: languageName: node linkType: hard +"@types/readable-stream@npm:^2.3.13": + version: 2.3.15 + resolution: "@types/readable-stream@npm:2.3.15" + dependencies: + "@types/node": "npm:*" + safe-buffer: "npm:~5.1.1" + checksum: 10/49b51e56f9cc401cb31c72973a7565ef4208d7e2465a789843104ec0fcbe609727b0b5bf4682fbec773c7f7bd14858e5dba739fd85e14d8a85e41185d65984d3 + languageName: node + linkType: hard + "@types/secp256k1@npm:^4.0.1": version: 4.0.3 resolution: "@types/secp256k1@npm:4.0.3" @@ -3946,14 +4152,14 @@ __metadata: linkType: hard "@typescript-eslint/eslint-plugin@npm:^8.4.0": - version: 8.5.0 - resolution: "@typescript-eslint/eslint-plugin@npm:8.5.0" + version: 8.4.0 + resolution: "@typescript-eslint/eslint-plugin@npm:8.4.0" dependencies: "@eslint-community/regexpp": "npm:^4.10.0" - "@typescript-eslint/scope-manager": "npm:8.5.0" - "@typescript-eslint/type-utils": "npm:8.5.0" - "@typescript-eslint/utils": "npm:8.5.0" - "@typescript-eslint/visitor-keys": "npm:8.5.0" + "@typescript-eslint/scope-manager": "npm:8.4.0" + "@typescript-eslint/type-utils": "npm:8.4.0" + "@typescript-eslint/utils": "npm:8.4.0" + "@typescript-eslint/visitor-keys": "npm:8.4.0" graphemer: "npm:^1.4.0" ignore: "npm:^5.3.1" natural-compare: "npm:^1.4.0" @@ -3964,66 +4170,66 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 10/344f5aca7e167544af718b81269b87b8c2a041210882cac76e1608dbec7c2a646de74387920ca9a5704fcd4c24ada052c2bc5adbeee39e950e7bce83647dae7d + checksum: 10/3f1373be2ecd9248e000646b43e9fc94e19da3bbc829526e6c0422d58c7af7942a279d96bded8a505ad5bd666564749236fd5515a95fc48f1f4e3329d786e0da languageName: node linkType: hard "@typescript-eslint/parser@npm:^8.4.0": - version: 8.5.0 - resolution: "@typescript-eslint/parser@npm:8.5.0" + version: 8.4.0 + resolution: "@typescript-eslint/parser@npm:8.4.0" dependencies: - "@typescript-eslint/scope-manager": "npm:8.5.0" - "@typescript-eslint/types": "npm:8.5.0" - "@typescript-eslint/typescript-estree": "npm:8.5.0" - "@typescript-eslint/visitor-keys": "npm:8.5.0" + "@typescript-eslint/scope-manager": "npm:8.4.0" + "@typescript-eslint/types": "npm:8.4.0" + "@typescript-eslint/typescript-estree": "npm:8.4.0" + "@typescript-eslint/visitor-keys": "npm:8.4.0" debug: "npm:^4.3.4" peerDependencies: eslint: ^8.57.0 || ^9.0.0 peerDependenciesMeta: typescript: optional: true - checksum: 10/f0d5a11a8d4b42750c3e7a3a8f6874740c7bb006b6bf3037a2b1422ba8f4eb2ff2d46e673a9f54007b95d3e4302b7966677b2481da58b6307d0ceb962478ee95 + checksum: 10/852ad7037e14c83a4637b95a2211e7f49900ed31cb0a4f7e6df4b444feab64caeb8918eec157f57fc32c1a92c721cbbbf22d5b24fb0b469b5fe880191f98237d languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:8.5.0": - version: 8.5.0 - resolution: "@typescript-eslint/scope-manager@npm:8.5.0" +"@typescript-eslint/scope-manager@npm:8.4.0": + version: 8.4.0 + resolution: "@typescript-eslint/scope-manager@npm:8.4.0" dependencies: - "@typescript-eslint/types": "npm:8.5.0" - "@typescript-eslint/visitor-keys": "npm:8.5.0" - checksum: 10/18f9958cdf196a0beede93535e564313d27dfd392a335952c785e46c32def55fdeae8c3c7d46f07c81c105ed2b48e9cd36a1fe5101fccd80e83c04cf1693dbed + "@typescript-eslint/types": "npm:8.4.0" + "@typescript-eslint/visitor-keys": "npm:8.4.0" + checksum: 10/e43a96ef057ccef2ad7dc4a04713d362f5cd17a684e867548c9744ad79960c41e56a706d9ff86b851bec989771e535b1c72fd922e1dee3fe6fdd9bf167c5f0f4 languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:8.5.0": - version: 8.5.0 - resolution: "@typescript-eslint/type-utils@npm:8.5.0" +"@typescript-eslint/type-utils@npm:8.4.0": + version: 8.4.0 + resolution: "@typescript-eslint/type-utils@npm:8.4.0" dependencies: - "@typescript-eslint/typescript-estree": "npm:8.5.0" - "@typescript-eslint/utils": "npm:8.5.0" + "@typescript-eslint/typescript-estree": "npm:8.4.0" + "@typescript-eslint/utils": "npm:8.4.0" debug: "npm:^4.3.4" ts-api-utils: "npm:^1.3.0" peerDependenciesMeta: typescript: optional: true - checksum: 10/ed487c8b530a0a6ea292385c82b2d9d9d94b99768ddd93882899be3319ea6af09c1b9f1a07e0381beb6149bbbb1f66ae95a635279fad8946345fd2298bce3549 + checksum: 10/f5d3e07c2985f97f72949d69962d0a3bb52814714e33d991ae5f815ae008bdfac25cd62f26feef4b0f835fe967609d60f34e0c30682ba47200867d1342343d80 languageName: node linkType: hard -"@typescript-eslint/types@npm:8.5.0": - version: 8.5.0 - resolution: "@typescript-eslint/types@npm:8.5.0" - checksum: 10/5cc55411fbf3f46d1571fe6ad1ef88f937093629a58e2b7bafb389646dde8a4e29d938fd57309eb30ee3f20978b4bdc5f823b31d718e053ba4c54c637a6df4e4 +"@typescript-eslint/types@npm:8.4.0": + version: 8.4.0 + resolution: "@typescript-eslint/types@npm:8.4.0" + checksum: 10/962eb0b45ca7634264698086dadb917d96684bd8a88926026e0c314984e68d14e1f30e0291f196408935a507aa9e9976ec4d27fc6aa632d34295059b4e436bae languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:8.5.0": - version: 8.5.0 - resolution: "@typescript-eslint/typescript-estree@npm:8.5.0" +"@typescript-eslint/typescript-estree@npm:8.4.0": + version: 8.4.0 + resolution: "@typescript-eslint/typescript-estree@npm:8.4.0" dependencies: - "@typescript-eslint/types": "npm:8.5.0" - "@typescript-eslint/visitor-keys": "npm:8.5.0" + "@typescript-eslint/types": "npm:8.4.0" + "@typescript-eslint/visitor-keys": "npm:8.4.0" debug: "npm:^4.3.4" fast-glob: "npm:^3.3.2" is-glob: "npm:^4.0.3" @@ -4033,31 +4239,31 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 10/69f21c49a158c394106e0d627f57451430cf32449a6c01118ee4afbb9f92f06be3aa87f3478ffc84d1062c3b21dca983e458f70f2cbe4fee1ad206f84ab97eb8 + checksum: 10/ec3396795b877c8ea0c3f0bdfb67c60b5e195f94569c0581ae7b9f3acbed047714722ff908f0ea1cbf19c16aaaa57826c2069c6383fcb9a3ad29bc26898a7125 languageName: node linkType: hard -"@typescript-eslint/utils@npm:8.5.0": - version: 8.5.0 - resolution: "@typescript-eslint/utils@npm:8.5.0" +"@typescript-eslint/utils@npm:8.4.0": + version: 8.4.0 + resolution: "@typescript-eslint/utils@npm:8.4.0" dependencies: "@eslint-community/eslint-utils": "npm:^4.4.0" - "@typescript-eslint/scope-manager": "npm:8.5.0" - "@typescript-eslint/types": "npm:8.5.0" - "@typescript-eslint/typescript-estree": "npm:8.5.0" + "@typescript-eslint/scope-manager": "npm:8.4.0" + "@typescript-eslint/types": "npm:8.4.0" + "@typescript-eslint/typescript-estree": "npm:8.4.0" peerDependencies: eslint: ^8.57.0 || ^9.0.0 - checksum: 10/f4727ebdee15082debe61a815eaad588f006a4f93d7fe94d065da563b4d3f91b7b7f795b5c77aa4cdebdf0936f83aa878089f22b8dbdbb738c557e8974129f54 + checksum: 10/46d6dda136e5513c703a905264fb96b9cc560ec1501a991fb9ef7386baf878081494bc9131f25d772b34ccfecbfa8c2fce0fb5ad6deb447b0f24758e131afd47 languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:8.5.0": - version: 8.5.0 - resolution: "@typescript-eslint/visitor-keys@npm:8.5.0" +"@typescript-eslint/visitor-keys@npm:8.4.0": + version: 8.4.0 + resolution: "@typescript-eslint/visitor-keys@npm:8.4.0" dependencies: - "@typescript-eslint/types": "npm:8.5.0" + "@typescript-eslint/types": "npm:8.4.0" eslint-visitor-keys: "npm:^3.4.3" - checksum: 10/32cc9d8120531bb1b5da79d697ab80bbbf18e5630d74c8b6c0f835d7914be7833ed9e5b95fa05f6f7b724d928cd4208b4028a2cc9d767401434d88214614887b + checksum: 10/3ac1d15d1beca887b333b9f1da9d6b819da5f965dbd7eb1c76342574adeaffe584b27c7e00a0e7fb69db7f4c307eeb8dd4410bdf177d6b14395cdd52e3e205e7 languageName: node linkType: hard @@ -4298,6 +4504,21 @@ __metadata: languageName: node linkType: hard +"abstract-level@npm:^1.0.0, abstract-level@npm:^1.0.2, abstract-level@npm:^1.0.3": + version: 1.0.3 + resolution: "abstract-level@npm:1.0.3" + dependencies: + buffer: "npm:^6.0.3" + catering: "npm:^2.1.0" + is-buffer: "npm:^2.0.5" + level-supports: "npm:^4.0.0" + level-transcoder: "npm:^1.0.1" + module-error: "npm:^1.0.1" + queue-microtask: "npm:^1.2.3" + checksum: 10/a6872010a7be78240e1e5bf24b202950adbbd2a382970e17cc661ac8a73663327c241dc25f2863e599f3f5b24d0c3c357b5af4092c4ce34511bae1c09283a278 + languageName: node + linkType: hard + "acorn-jsx@npm:^5.3.2": version: 5.3.2 resolution: "acorn-jsx@npm:5.3.2" @@ -4423,6 +4644,13 @@ __metadata: languageName: node linkType: hard +"ansi-colors@npm:3.2.3": + version: 3.2.3 + resolution: "ansi-colors@npm:3.2.3" + checksum: 10/9465fcf0feca5001201013091036397537a7e196e04efca48aa1e7f4a986176778a33924d506e2b9af74321be9fb0649ab0c11be168d15aae5459feff681d665 + languageName: node + linkType: hard + "ansi-colors@npm:^4.1.1, ansi-colors@npm:^4.1.3": version: 4.1.3 resolution: "ansi-colors@npm:4.1.3" @@ -4483,7 +4711,7 @@ __metadata: languageName: node linkType: hard -"ansi-styles@npm:^3.2.1": +"ansi-styles@npm:^3.2.0, ansi-styles@npm:^3.2.1": version: 3.2.1 resolution: "ansi-styles@npm:3.2.1" dependencies: @@ -4555,7 +4783,7 @@ __metadata: languageName: node linkType: hard -"anymatch@npm:^3.0.3, anymatch@npm:~3.1.2": +"anymatch@npm:^3.0.3, anymatch@npm:~3.1.1, anymatch@npm:~3.1.2": version: 3.1.3 resolution: "anymatch@npm:3.1.3" dependencies: @@ -4614,6 +4842,16 @@ __metadata: languageName: node linkType: hard +"are-we-there-yet@npm:^4.0.0": + version: 4.0.0 + resolution: "are-we-there-yet@npm:4.0.0" + dependencies: + delegates: "npm:^1.0.0" + readable-stream: "npm:^4.1.0" + checksum: 10/f6cfe62e7c3fd96f233dd9dca2febe97aa5044a6e31729c61e302285850aef9b10ec2f1895568206f8feefb5d0d2c1196fb20854a7eb99c3da228e80f6be7a30 + languageName: node + linkType: hard + "arg@npm:^4.1.0": version: 4.1.3 resolution: "arg@npm:4.1.3" @@ -4651,6 +4889,16 @@ __metadata: languageName: node linkType: hard +"array-buffer-byte-length@npm:^1.0.0": + version: 1.0.0 + resolution: "array-buffer-byte-length@npm:1.0.0" + dependencies: + call-bind: "npm:^1.0.2" + is-array-buffer: "npm:^3.0.1" + checksum: 10/044e101ce150f4804ad19c51d6c4d4cfa505c5b2577bd179256e4aa3f3f6a0a5e9874c78cd428ee566ac574c8a04d7ce21af9fe52e844abfdccb82b33035a7c3 + languageName: node + linkType: hard + "array-differ@npm:^3.0.0": version: 3.0.0 resolution: "array-differ@npm:3.0.0" @@ -4693,17 +4941,58 @@ __metadata: languageName: node linkType: hard -"arrify@npm:^1.0.1": - version: 1.0.1 - resolution: "arrify@npm:1.0.1" - checksum: 10/745075dd4a4624ff0225c331dacb99be501a515d39bcb7c84d24660314a6ec28e68131b137e6f7e16318170842ce97538cd298fc4cd6b2cc798e0b957f2747e7 +"array.prototype.findlast@npm:^1.2.2": + version: 1.2.3 + resolution: "array.prototype.findlast@npm:1.2.3" + dependencies: + call-bind: "npm:^1.0.2" + define-properties: "npm:^1.2.0" + es-abstract: "npm:^1.22.1" + es-shim-unscopables: "npm:^1.0.0" + get-intrinsic: "npm:^1.2.1" + checksum: 10/d615b5298b3c9bd2e59f4ffd7e2a35b99e03313ac5a035e8138ab32c3b8fcb5a770748f65c8a891e4e2a1c39f57cc091385a7454474f1fa0c1f2c20f4e2e5d32 languageName: node linkType: hard -"arrify@npm:^2.0.1": - version: 2.0.1 - resolution: "arrify@npm:2.0.1" - checksum: 10/067c4c1afd182806a82e4c1cb8acee16ab8b5284fbca1ce29408e6e91281c36bb5b612f6ddfbd40a0f7a7e0c75bf2696eb94c027f6e328d6e9c52465c98e4209 +"array.prototype.reduce@npm:^1.0.5": + version: 1.0.5 + resolution: "array.prototype.reduce@npm:1.0.5" + dependencies: + call-bind: "npm:^1.0.2" + define-properties: "npm:^1.1.4" + es-abstract: "npm:^1.20.4" + es-array-method-boxes-properly: "npm:^1.0.0" + is-string: "npm:^1.0.7" + checksum: 10/ad8976da587854088fe8d5290e0709d670ba0dcac840b380b4aee11eae61b25fa78c324373387d39f4242345fda9cc57ff1b0cbfe510b9afa0cd1624ab1a1cab + languageName: node + linkType: hard + +"arraybuffer.prototype.slice@npm:^1.0.2": + version: 1.0.2 + resolution: "arraybuffer.prototype.slice@npm:1.0.2" + dependencies: + array-buffer-byte-length: "npm:^1.0.0" + call-bind: "npm:^1.0.2" + define-properties: "npm:^1.2.0" + es-abstract: "npm:^1.22.1" + get-intrinsic: "npm:^1.2.1" + is-array-buffer: "npm:^3.0.2" + is-shared-array-buffer: "npm:^1.0.2" + checksum: 10/c200faf437786f5b2c80d4564ff5481c886a16dee642ef02abdc7306c7edd523d1f01d1dd12b769c7eb42ac9bc53874510db19a92a2c035c0f6696172aafa5d3 + languageName: node + linkType: hard + +"arrify@npm:^1.0.1": + version: 1.0.1 + resolution: "arrify@npm:1.0.1" + checksum: 10/745075dd4a4624ff0225c331dacb99be501a515d39bcb7c84d24660314a6ec28e68131b137e6f7e16318170842ce97538cd298fc4cd6b2cc798e0b957f2747e7 + languageName: node + linkType: hard + +"arrify@npm:^2.0.1": + version: 2.0.1 + resolution: "arrify@npm:2.0.1" + checksum: 10/067c4c1afd182806a82e4c1cb8acee16ab8b5284fbca1ce29408e6e91281c36bb5b612f6ddfbd40a0f7a7e0c75bf2696eb94c027f6e328d6e9c52465c98e4209 languageName: node linkType: hard @@ -4810,6 +5099,13 @@ __metadata: languageName: node linkType: hard +"available-typed-arrays@npm:^1.0.5": + version: 1.0.5 + resolution: "available-typed-arrays@npm:1.0.5" + checksum: 10/4d4d5e86ea0425696f40717882f66a570647b94ac8d273ddc7549a9b61e5da099e149bf431530ccbd776bd74e02039eb8b5edf426e3e2211ee61af16698a9064 + languageName: node + linkType: hard + "aws-sign2@npm:~0.7.0": version: 0.7.0 resolution: "aws-sign2@npm:0.7.0" @@ -4970,10 +5266,10 @@ __metadata: languageName: node linkType: hard -"before-after-hook@npm:^3.0.2": - version: 3.0.2 - resolution: "before-after-hook@npm:3.0.2" - checksum: 10/57dfee78930276a740559552460a83f31c605e0164f02f170f71352aa1f4f5fb2c1632ac3bcba06ba711c32bd88b7e3c82431428e0c4984fbd2336faa78cf08c +"before-after-hook@npm:^2.2.0": + version: 2.2.3 + resolution: "before-after-hook@npm:2.2.3" + checksum: 10/e676f769dbc4abcf4b3317db2fd2badb4a92c0710e0a7da12cf14b59c3482d4febf835ad7de7874499060fd4e13adf0191628e504728b3c5bb4ec7a878c09940 languageName: node linkType: hard @@ -4984,15 +5280,22 @@ __metadata: languageName: node linkType: hard -"bin-links@npm:^4.0.4": - version: 4.0.4 - resolution: "bin-links@npm:4.0.4" +"bigint-crypto-utils@npm:^3.0.23": + version: 3.2.2 + resolution: "bigint-crypto-utils@npm:3.2.2" + checksum: 10/e7a3ccd915003f755da94ec709ca42a0aa58e018ff4af2c3381c7ba75b7fab569b7e143bc8ebe7c0ad315713d4987ac076035fcd8223c9fc6dcfba9363f200c4 + languageName: node + linkType: hard + +"bin-links@npm:^4.0.1": + version: 4.0.2 + resolution: "bin-links@npm:4.0.2" dependencies: cmd-shim: "npm:^6.0.0" npm-normalize-package-bin: "npm:^3.0.0" read-cmd-shim: "npm:^4.0.0" write-file-atomic: "npm:^5.0.0" - checksum: 10/58d62143aacdbb783b076e9bdd970d8470f2750e1076d6fd1ae559fa532c4647478dd2550a911ba22d4c9e6339881451046e2fbc4b8958f4bf3bf8e5144d1e4d + checksum: 10/0ba0dfd8b728569d00370b857e48d7ee2f06ca99cfe0b7385c2ccb3bac32b52507eef6fec86c5262b616b187ff212bfe1ef49b08f65c3db9a0f5fa6577d215b1 languageName: node linkType: hard @@ -5042,6 +5345,17 @@ __metadata: languageName: node linkType: hard +"bl@npm:^4.1.0": + version: 4.1.0 + resolution: "bl@npm:4.1.0" + dependencies: + buffer: "npm:^5.5.0" + inherits: "npm:^2.0.4" + readable-stream: "npm:^3.4.0" + checksum: 10/b7904e66ed0bdfc813c06ea6c3e35eafecb104369dbf5356d0f416af90c1546de3b74e5b63506f0629acf5e16a6f87c3798f16233dcff086e9129383aa02ab55 + languageName: node + linkType: hard + "bl@npm:^5.0.0": version: 5.1.0 resolution: "bl@npm:5.1.0" @@ -5141,6 +5455,18 @@ __metadata: languageName: node linkType: hard +"browser-level@npm:^1.0.1": + version: 1.0.1 + resolution: "browser-level@npm:1.0.1" + dependencies: + abstract-level: "npm:^1.0.2" + catering: "npm:^2.1.1" + module-error: "npm:^1.0.2" + run-parallel-limit: "npm:^1.1.0" + checksum: 10/e712569111782da76853fecf648b43ff878ff2301c2830a9e7399685b646824a85f304dea5f023e02ee41a63a972f9aad734bd411069095adc9c79784fc649a5 + languageName: node + linkType: hard + "browser-readablestream-to-it@npm:^1.0.0, browser-readablestream-to-it@npm:^1.0.1, browser-readablestream-to-it@npm:^1.0.3": version: 1.0.3 resolution: "browser-readablestream-to-it@npm:1.0.3" @@ -5148,7 +5474,7 @@ __metadata: languageName: node linkType: hard -"browser-stdout@npm:^1.3.1": +"browser-stdout@npm:1.3.1, browser-stdout@npm:^1.3.1": version: 1.3.1 resolution: "browser-stdout@npm:1.3.1" checksum: 10/ac70a84e346bb7afc5045ec6f22f6a681b15a4057447d4cc1c48a25c6dedb302a49a46dd4ddfb5cdd9c96e0c905a8539be1b98ae7bc440512152967009ec7015 @@ -5183,7 +5509,7 @@ __metadata: languageName: node linkType: hard -"bs-logger@npm:^0.2.6": +"bs-logger@npm:0.x": version: 0.2.6 resolution: "bs-logger@npm:0.2.6" dependencies: @@ -5259,6 +5585,16 @@ __metadata: languageName: node linkType: hard +"buffer@npm:^5.5.0": + version: 5.7.1 + resolution: "buffer@npm:5.7.1" + dependencies: + base64-js: "npm:^1.3.1" + ieee754: "npm:^1.1.13" + checksum: 10/997434d3c6e3b39e0be479a80288875f71cd1c07d75a3855e6f08ef848a3c966023f79534e22e415ff3a5112708ce06127277ab20e527146d55c84566405c7c6 + languageName: node + linkType: hard + "buffer@npm:^6.0.1, buffer@npm:^6.0.3": version: 6.0.3 resolution: "buffer@npm:6.0.3" @@ -5287,10 +5623,10 @@ __metadata: languageName: node linkType: hard -"byte-size@npm:^9.0.0": - version: 9.0.0 - resolution: "byte-size@npm:9.0.0" - checksum: 10/10a2ce3433e83526d6151055aa82e414e7b15e20a9714314a17a11313b9029a4f7b0acda441d3ad8f61f1592b4ffc1649ae30a0faeb3f5561ee9995ba7de0c8e +"byte-size@npm:^8.1.1": + version: 8.1.1 + resolution: "byte-size@npm:8.1.1" + checksum: 10/eacd83b5f39b4b35115160201553150c3c085473ddb1e788d0f4ee22a2f3461470de5732eef8d7874efbbd883b7ae1277190b579128060e616d606ff419fe1e0 languageName: node linkType: hard @@ -5321,7 +5657,7 @@ __metadata: languageName: node linkType: hard -"cacache@npm:^18.0.0, cacache@npm:^18.0.3": +"cacache@npm:^18.0.0": version: 18.0.4 resolution: "cacache@npm:18.0.4" dependencies: @@ -5375,7 +5711,7 @@ __metadata: languageName: node linkType: hard -"call-bind@npm:^1.0.0": +"call-bind@npm:^1.0.0, call-bind@npm:^1.0.2, call-bind@npm:^1.0.5": version: 1.0.6 resolution: "call-bind@npm:1.0.6" dependencies: @@ -5445,6 +5781,13 @@ __metadata: languageName: node linkType: hard +"case@npm:^1.6.3": + version: 1.6.3 + resolution: "case@npm:1.6.3" + checksum: 10/2fc1df75bbb4118339e06141b9a54aba95cc62460ac92730290144fbec6b6a04f5bf7abf6a6486a1338f5821bd184402f216cec8cea0472451759c27e20fc332 + languageName: node + linkType: hard + "caseless@npm:^0.12.0, caseless@npm:~0.12.0": version: 0.12.0 resolution: "caseless@npm:0.12.0" @@ -5452,6 +5795,13 @@ __metadata: languageName: node linkType: hard +"catering@npm:^2.1.0, catering@npm:^2.1.1": + version: 2.1.1 + resolution: "catering@npm:2.1.1" + checksum: 10/4669c9fa5f3a73273535fb458a964d8aba12dc5102d8487049cf03623bef3cdff4b5d9f92ff04c00f1001057a7cc7df6e700752ac622c2a7baf7bcff34166683 + languageName: node + linkType: hard + "cbor@npm:^8.1.0": version: 8.1.0 resolution: "cbor@npm:8.1.0" @@ -5515,6 +5865,13 @@ __metadata: languageName: node linkType: hard +"chardet@npm:^0.7.0": + version: 0.7.0 + resolution: "chardet@npm:0.7.0" + checksum: 10/b0ec668fba5eeec575ed2559a0917ba41a6481f49063c8445400e476754e0957ee09e44dc032310f526182b8f1bf25e9d4ed371f74050af7be1383e06bc44952 + languageName: node + linkType: hard + "charenc@npm:0.0.2, charenc@npm:>= 0.0.1": version: 0.0.2 resolution: "charenc@npm:0.0.2" @@ -5522,6 +5879,25 @@ __metadata: languageName: node linkType: hard +"chokidar@npm:3.3.0": + version: 3.3.0 + resolution: "chokidar@npm:3.3.0" + dependencies: + anymatch: "npm:~3.1.1" + braces: "npm:~3.0.2" + fsevents: "npm:~2.1.1" + glob-parent: "npm:~5.1.0" + is-binary-path: "npm:~2.1.0" + is-glob: "npm:~4.0.1" + normalize-path: "npm:~3.0.0" + readdirp: "npm:~3.2.0" + dependenciesMeta: + fsevents: + optional: true + checksum: 10/57c5c20fd1e46cf32f626f907b0a3e0dd584b2939cd8ca67cbfb255e334355f2781674d4148e2c92d045b2722fcb50178e50e57307b511f86d1e90098532d962 + languageName: node + linkType: hard + "chokidar@npm:3.5.3": version: 3.5.3 resolution: "chokidar@npm:3.5.3" @@ -5624,6 +6000,20 @@ __metadata: languageName: node linkType: hard +"classic-level@npm:^1.2.0": + version: 1.3.0 + resolution: "classic-level@npm:1.3.0" + dependencies: + abstract-level: "npm:^1.0.2" + catering: "npm:^2.1.0" + module-error: "npm:^1.0.1" + napi-macros: "npm:^2.2.2" + node-gyp: "npm:latest" + node-gyp-build: "npm:^4.3.0" + checksum: 10/b2d07a5932a09bdf0a5b27e662154888c85edd59d75816c7e60960dacadbc7553daa9f5efb58d2575b3eae0540d504ef71d49f438744366626762a0ddefe5cc5 + languageName: node + linkType: hard + "clean-stack@npm:^2.0.0": version: 2.2.0 resolution: "clean-stack@npm:2.2.0" @@ -5674,7 +6064,7 @@ __metadata: languageName: node linkType: hard -"cli-spinners@npm:^2.2.0, cli-spinners@npm:^2.9.2": +"cli-spinners@npm:^2.2.0, cli-spinners@npm:^2.5.0, cli-spinners@npm:^2.9.2": version: 2.9.2 resolution: "cli-spinners@npm:2.9.2" checksum: 10/a0a863f442df35ed7294424f5491fa1756bd8d2e4ff0c8736531d886cec0ece4d85e8663b77a5afaf1d296e3cbbebff92e2e99f52bbea89b667cbe789b994794 @@ -5709,16 +6099,16 @@ __metadata: languageName: node linkType: hard -"cli-table3@npm:^0.6.0": - version: 0.6.3 - resolution: "cli-table3@npm:0.6.3" +"cli-table3@npm:^0.6.0, cli-table3@npm:^0.6.5": + version: 0.6.5 + resolution: "cli-table3@npm:0.6.5" dependencies: "@colors/colors": "npm:1.5.0" string-width: "npm:^4.2.0" dependenciesMeta: "@colors/colors": optional: true - checksum: 10/8d82b75be7edc7febb1283dc49582a521536527cba80af62a2e4522a0ee39c252886a1a2f02d05ae9d753204dbcffeb3a40d1358ee10dccd7fe8d935cfad3f85 + checksum: 10/8dca71256f6f1367bab84c33add3f957367c7c43750a9828a4212ebd31b8df76bd7419d386e3391ac7419698a8540c25f1a474584028f35b170841cde2e055c5 languageName: node linkType: hard @@ -5739,6 +6129,17 @@ __metadata: languageName: node linkType: hard +"cliui@npm:^5.0.0": + version: 5.0.0 + resolution: "cliui@npm:5.0.0" + dependencies: + string-width: "npm:^3.1.0" + strip-ansi: "npm:^5.2.0" + wrap-ansi: "npm:^5.1.0" + checksum: 10/381264fcc3c8316b77b378ce5471ff9a1974d1f6217e0be8f4f09788482b3e6f7c0894eb21e0a86eab4ce0c68426653a407226dd51997306cb87f734776f5fdc + languageName: node + linkType: hard + "cliui@npm:^6.0.0": version: 6.0.0 resolution: "cliui@npm:6.0.0" @@ -5916,6 +6317,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:3.0.2": + version: 3.0.2 + resolution: "commander@npm:3.0.2" + checksum: 10/f42053569f5954498246783465b39139917a51284bf3361574c9f731fea27a4bd6452dbb1755cc2d923c7b47dfea67930037c7b7e862288f2c397cec9a74da87 + languageName: node + linkType: hard + "commander@npm:^10.0.0": version: 10.0.1 resolution: "commander@npm:10.0.1" @@ -6200,6 +6608,15 @@ __metadata: languageName: node linkType: hard +"crc-32@npm:^1.2.0": + version: 1.2.2 + resolution: "crc-32@npm:1.2.2" + bin: + crc32: bin/crc32.njs + checksum: 10/824f696a5baaf617809aa9cd033313c8f94f12d15ebffa69f10202480396be44aef9831d900ab291638a8022ed91c360696dd5b1ba691eb3f34e60be8835b7c3 + languageName: node + linkType: hard + "create-hash@npm:^1.1.0, create-hash@npm:^1.1.2, create-hash@npm:^1.2.0": version: 1.2.0 resolution: "create-hash@npm:1.2.0" @@ -6332,6 +6749,15 @@ __metadata: languageName: node linkType: hard +"debug@npm:3.2.6": + version: 3.2.6 + resolution: "debug@npm:3.2.6" + dependencies: + ms: "npm:^2.1.1" + checksum: 10/c495d32519ed205aeab71b4bba84701c60b2d18efe98d41f88f498f09423252155450846ee31da0e4c3ea5d7d8f5123525e463612a7d3fa0bcd5fc06e4efe5fc + languageName: node + linkType: hard + "debug@npm:4, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:^4.3.5, debug@npm:^4.3.6, debug@npm:~4.3.6": version: 4.3.6 resolution: "debug@npm:4.3.6" @@ -6398,7 +6824,7 @@ __metadata: languageName: node linkType: hard -"dedent@npm:^1.0.0, dedent@npm:^1.5.3": +"dedent@npm:^1.0.0, dedent@npm:^1.5.1, dedent@npm:^1.5.3": version: 1.5.3 resolution: "dedent@npm:1.5.3" peerDependencies: @@ -6424,6 +6850,13 @@ __metadata: languageName: node linkType: hard +"deepmerge-ts@npm:^5.1.0": + version: 5.1.0 + resolution: "deepmerge-ts@npm:5.1.0" + checksum: 10/0f615ccfb27b93a286abc315d7d1ec171f1befe9c511c2799ca7184c11fc6a6f29f5368d446c6885338de0d95cf6cb66a5ff4c55141a1265012730bd69408cf9 + languageName: node + linkType: hard + "deepmerge-ts@npm:^7.1.0": version: 7.1.0 resolution: "deepmerge-ts@npm:7.1.0" @@ -6463,7 +6896,7 @@ __metadata: languageName: node linkType: hard -"define-data-property@npm:^1.1.2": +"define-data-property@npm:^1.0.1, define-data-property@npm:^1.1.2": version: 1.1.3 resolution: "define-data-property@npm:1.1.3" dependencies: @@ -6482,6 +6915,16 @@ __metadata: languageName: node linkType: hard +"define-properties@npm:^1.1.2, define-properties@npm:^1.1.3, define-properties@npm:^1.1.4, define-properties@npm:^1.2.0": + version: 1.2.0 + resolution: "define-properties@npm:1.2.0" + dependencies: + has-property-descriptors: "npm:^1.0.0" + object-keys: "npm:^1.1.1" + checksum: 10/e60aee6a19b102df4e2b1f301816804e81ab48bb91f00d0d935f269bf4b3f79c88b39e4f89eaa132890d23267335fd1140dfcd8d5ccd61031a0a2c41a54e33a6 + languageName: node + linkType: hard + "delay@npm:^5.0.0": version: 5.0.0 resolution: "delay@npm:5.0.0" @@ -6543,6 +6986,13 @@ __metadata: languageName: node linkType: hard +"deprecation@npm:^2.0.0": + version: 2.3.1 + resolution: "deprecation@npm:2.3.1" + checksum: 10/f56a05e182c2c195071385455956b0c4106fe14e36245b00c689ceef8e8ab639235176a96977ba7c74afb173317fac2e0ec6ec7a1c6d1e6eaa401c586c714132 + languageName: node + linkType: hard + "deps-regex@npm:^0.2.0": version: 0.2.0 resolution: "deps-regex@npm:0.2.0" @@ -6557,7 +7007,7 @@ __metadata: languageName: node linkType: hard -"detect-indent@npm:^7.0.1": +"detect-indent@npm:^7.0.0, detect-indent@npm:^7.0.1": version: 7.0.1 resolution: "detect-indent@npm:7.0.1" checksum: 10/cbf3f0b1c3c881934ca94428e1179b26ab2a587e0d719031d37a67fb506d49d067de54ff057cb1e772e75975fed5155c01cd4518306fee60988b1486e3fc7768 @@ -6578,6 +7028,13 @@ __metadata: languageName: node linkType: hard +"diff@npm:3.5.0": + version: 3.5.0 + resolution: "diff@npm:3.5.0" + checksum: 10/cfbc2df98d6f8eb82c0f7735c8468695f65189d31f95a708d4c97cd96a8083fdfd83d87a067a29924ae7d8ff64f578e7da78391af537815750268555fe0df9f0 + languageName: node + linkType: hard + "diff@npm:^4.0.1": version: 4.0.2 resolution: "diff@npm:4.0.2" @@ -6662,7 +7119,7 @@ __metadata: languageName: node linkType: hard -"dotenv@npm:^16.4.3, dotenv@npm:^16.4.5": +"dotenv@npm:^16.4.1, dotenv@npm:^16.4.3, dotenv@npm:^16.4.5": version: 16.4.5 resolution: "dotenv@npm:16.4.5" checksum: 10/55a3134601115194ae0f924e54473459ed0d9fc340ae610b676e248cca45aa7c680d86365318ea964e6da4e2ea80c4514c1adab5adb43d6867fb57ff068f95c8 @@ -6704,14 +7161,14 @@ __metadata: languageName: node linkType: hard -"ejs@npm:^3.1.10, ejs@npm:^3.1.8": - version: 3.1.10 - resolution: "ejs@npm:3.1.10" +"ejs@npm:^3.1.8": + version: 3.1.9 + resolution: "ejs@npm:3.1.9" dependencies: jake: "npm:^10.8.5" bin: ejs: bin/cli.js - checksum: 10/a9cb7d7cd13b7b1cd0be5c4788e44dd10d92f7285d2f65b942f33e127230c054f99a42db4d99f766d8dbc6c57e94799593ee66a14efd7c8dd70c4812bf6aa384 + checksum: 10/71f56d37540d2c2d71701f0116710c676f75314a3e997ef8b83515d5d4d2b111c5a72725377caeecb928671bacb84a0d38135f345904812e989847057d59f21a languageName: node linkType: hard @@ -6760,6 +7217,13 @@ __metadata: languageName: node linkType: hard +"emoji-regex@npm:^7.0.1": + version: 7.0.3 + resolution: "emoji-regex@npm:7.0.3" + checksum: 10/9159b2228b1511f2870ac5920f394c7e041715429a68459ebe531601555f11ea782a8e1718f969df2711d38c66268174407cbca57ce36485544f695c2dfdc96e + languageName: node + linkType: hard + "emoji-regex@npm:^8.0.0": version: 8.0.0 resolution: "emoji-regex@npm:8.0.0" @@ -6838,6 +7302,60 @@ __metadata: languageName: node linkType: hard +"es-abstract@npm:^1.20.4, es-abstract@npm:^1.21.2, es-abstract@npm:^1.22.1": + version: 1.22.2 + resolution: "es-abstract@npm:1.22.2" + dependencies: + array-buffer-byte-length: "npm:^1.0.0" + arraybuffer.prototype.slice: "npm:^1.0.2" + available-typed-arrays: "npm:^1.0.5" + call-bind: "npm:^1.0.2" + es-set-tostringtag: "npm:^2.0.1" + es-to-primitive: "npm:^1.2.1" + function.prototype.name: "npm:^1.1.6" + get-intrinsic: "npm:^1.2.1" + get-symbol-description: "npm:^1.0.0" + globalthis: "npm:^1.0.3" + gopd: "npm:^1.0.1" + has: "npm:^1.0.3" + has-property-descriptors: "npm:^1.0.0" + has-proto: "npm:^1.0.1" + has-symbols: "npm:^1.0.3" + internal-slot: "npm:^1.0.5" + is-array-buffer: "npm:^3.0.2" + is-callable: "npm:^1.2.7" + is-negative-zero: "npm:^2.0.2" + is-regex: "npm:^1.1.4" + is-shared-array-buffer: "npm:^1.0.2" + is-string: "npm:^1.0.7" + is-typed-array: "npm:^1.1.12" + is-weakref: "npm:^1.0.2" + object-inspect: "npm:^1.12.3" + object-keys: "npm:^1.1.1" + object.assign: "npm:^4.1.4" + regexp.prototype.flags: "npm:^1.5.1" + safe-array-concat: "npm:^1.0.1" + safe-regex-test: "npm:^1.0.0" + string.prototype.trim: "npm:^1.2.8" + string.prototype.trimend: "npm:^1.0.7" + string.prototype.trimstart: "npm:^1.0.7" + typed-array-buffer: "npm:^1.0.0" + typed-array-byte-length: "npm:^1.0.0" + typed-array-byte-offset: "npm:^1.0.0" + typed-array-length: "npm:^1.0.4" + unbox-primitive: "npm:^1.0.2" + which-typed-array: "npm:^1.1.11" + checksum: 10/fe09bf3bf707d5a781b9e4f9ef8e835a890600b7e1e65567328da12b173e99ffd9d5b86f5d0a69a5aa308a925b59c631814ada46fca55e9db10857a352289adb + languageName: node + linkType: hard + +"es-array-method-boxes-properly@npm:^1.0.0": + version: 1.0.0 + resolution: "es-array-method-boxes-properly@npm:1.0.0" + checksum: 10/27a8a21acf20f3f51f69dce8e643f151e380bffe569e95dc933b9ded9fcd89a765ee21b5229c93f9206c93f87395c6b75f80be8ac8c08a7ceb8771e1822ff1fb + languageName: node + linkType: hard + "es-errors@npm:^1.3.0": version: 1.3.0 resolution: "es-errors@npm:1.3.0" @@ -6845,6 +7363,37 @@ __metadata: languageName: node linkType: hard +"es-set-tostringtag@npm:^2.0.1": + version: 2.0.1 + resolution: "es-set-tostringtag@npm:2.0.1" + dependencies: + get-intrinsic: "npm:^1.1.3" + has: "npm:^1.0.3" + has-tostringtag: "npm:^1.0.0" + checksum: 10/ec416a12948cefb4b2a5932e62093a7cf36ddc3efd58d6c58ca7ae7064475ace556434b869b0bbeb0c365f1032a8ccd577211101234b69837ad83ad204fff884 + languageName: node + linkType: hard + +"es-shim-unscopables@npm:^1.0.0": + version: 1.0.0 + resolution: "es-shim-unscopables@npm:1.0.0" + dependencies: + has: "npm:^1.0.3" + checksum: 10/ac2db2c70d253cf83bebcdc974d185239e205ca18af743efd3b656bac00cabfee2358a050b18b63b46972dab5cfa10ef3f2597eb3a8d4d6d9417689793665da6 + languageName: node + linkType: hard + +"es-to-primitive@npm:^1.2.1": + version: 1.2.1 + resolution: "es-to-primitive@npm:1.2.1" + dependencies: + is-callable: "npm:^1.1.4" + is-date-object: "npm:^1.0.1" + is-symbol: "npm:^1.0.2" + checksum: 10/74aeeefe2714cf99bb40cab7ce3012d74e1e2c1bd60d0a913b467b269edde6e176ca644b5ba03a5b865fb044a29bca05671cd445c85ca2cdc2de155d7fc8fe9b + languageName: node + linkType: hard + "es6-error@npm:^4.0.1": version: 4.1.1 resolution: "es6-error@npm:4.1.1" @@ -6875,6 +7424,13 @@ __metadata: languageName: node linkType: hard +"escape-string-regexp@npm:1.0.5, escape-string-regexp@npm:^1.0.5": + version: 1.0.5 + resolution: "escape-string-regexp@npm:1.0.5" + checksum: 10/6092fda75c63b110c706b6a9bfde8a612ad595b628f0bd2147eea1d3406723020810e591effc7db1da91d80a71a737a313567c5abb3813e8d9c71f4aa595b410 + languageName: node + linkType: hard + "escape-string-regexp@npm:4.0.0, escape-string-regexp@npm:^4.0.0": version: 4.0.0 resolution: "escape-string-regexp@npm:4.0.0" @@ -6882,13 +7438,6 @@ __metadata: languageName: node linkType: hard -"escape-string-regexp@npm:^1.0.5": - version: 1.0.5 - resolution: "escape-string-regexp@npm:1.0.5" - checksum: 10/6092fda75c63b110c706b6a9bfde8a612ad595b628f0bd2147eea1d3406723020810e591effc7db1da91d80a71a737a313567c5abb3813e8d9c71f4aa595b410 - languageName: node - linkType: hard - "escape-string-regexp@npm:^2.0.0": version: 2.0.0 resolution: "escape-string-regexp@npm:2.0.0" @@ -6916,9 +7465,9 @@ __metadata: linkType: hard "eslint-plugin-no-only-tests@npm:^3.1.0": - version: 3.3.0 - resolution: "eslint-plugin-no-only-tests@npm:3.3.0" - checksum: 10/1b3a88e392113240758405966047ef40dd742fbd828f3c8d02a207125edaa5303ef9a0319a778551bd88789110423221fff4e9db02896c20836389b13c27b32e + version: 3.1.0 + resolution: "eslint-plugin-no-only-tests@npm:3.1.0" + checksum: 10/2a5de82f3a732dbd46792661dd0f8546cf819f76d8828968166dee35741e8039904ba473dafe1eed585f401a496d260c2c38354bb887c94bd4ced0ddca00fb62 languageName: node linkType: hard @@ -7228,7 +7777,7 @@ __metadata: languageName: node linkType: hard -"ethers@npm:^5.0.0, ethers@npm:^5.7.2": +"ethers@npm:^5.0.0, ethers@npm:^5.7.1, ethers@npm:^5.7.2": version: 5.7.2 resolution: "ethers@npm:5.7.2" dependencies: @@ -7300,7 +7849,7 @@ __metadata: languageName: node linkType: hard -"events@npm:3.3.0": +"events@npm:3.3.0, events@npm:^3.3.0": version: 3.3.0 resolution: "events@npm:3.3.0" checksum: 10/a3d47e285e28d324d7180f1e493961a2bbb4cad6412090e4dec114f4db1f5b560c7696ee8e758f55e23913ede856e3689cd3aa9ae13c56b5d8314cd3b3ddd1be @@ -7395,6 +7944,17 @@ __metadata: languageName: node linkType: hard +"external-editor@npm:^3.1.0": + version: 3.1.0 + resolution: "external-editor@npm:3.1.0" + dependencies: + chardet: "npm:^0.7.0" + iconv-lite: "npm:^0.4.24" + tmp: "npm:^0.0.33" + checksum: 10/776dff1d64a1d28f77ff93e9e75421a81c062983fd1544279d0a32f563c0b18c52abbb211f31262e2827e48edef5c9dc8f960d06dd2d42d1654443b88568056b + languageName: node + linkType: hard + "extsprintf@npm:1.3.0": version: 1.3.0 resolution: "extsprintf@npm:1.3.0" @@ -7533,6 +8093,15 @@ __metadata: languageName: node linkType: hard +"figures@npm:^3.2.0": + version: 3.2.0 + resolution: "figures@npm:3.2.0" + dependencies: + escape-string-regexp: "npm:^1.0.5" + checksum: 10/a3bf94e001be51d3770500789157f067218d4bc681a65e1f69d482de15120bcac822dceb1a7b3803f32e4e3a61a46df44f7f2c8ba95d6375e7491502e0dd3d97 + languageName: node + linkType: hard + "file-entry-cache@npm:^8.0.0": version: 8.0.0 resolution: "file-entry-cache@npm:8.0.0" @@ -7580,6 +8149,15 @@ __metadata: languageName: node linkType: hard +"find-up@npm:3.0.0, find-up@npm:^3.0.0": + version: 3.0.0 + resolution: "find-up@npm:3.0.0" + dependencies: + locate-path: "npm:^3.0.0" + checksum: 10/38eba3fe7a66e4bc7f0f5a1366dc25508b7cfc349f852640e3678d26ad9a6d7e2c43eff0a472287de4a9753ef58f066a0ea892a256fa3636ad51b3fe1e17fae9 + languageName: node + linkType: hard + "find-up@npm:^2.1.0": version: 2.1.0 resolution: "find-up@npm:2.1.0" @@ -7641,6 +8219,17 @@ __metadata: languageName: node linkType: hard +"flat@npm:^4.1.0": + version: 4.1.1 + resolution: "flat@npm:4.1.1" + dependencies: + is-buffer: "npm:~2.0.3" + bin: + flat: cli.js + checksum: 10/95abffb1fe56c33bc7fd4098e7a9eceb5aaba0db0c1f7f240d0e220037a630ead91de83101ac9714b95756cf178c0164379fa89961c66091abb4febaf9dbd2ff + languageName: node + linkType: hard + "flat@npm:^5.0.2": version: 5.0.2 resolution: "flat@npm:5.0.2" @@ -7667,6 +8256,15 @@ __metadata: languageName: node linkType: hard +"for-each@npm:^0.3.3": + version: 0.3.3 + resolution: "for-each@npm:0.3.3" + dependencies: + is-callable: "npm:^1.1.3" + checksum: 10/fdac0cde1be35610bd635ae958422e8ce0cc1313e8d32ea6d34cfda7b60850940c1fd07c36456ad76bd9c24aef6ff5e03b02beb58c83af5ef6c968a64eada676 + languageName: node + linkType: hard + "foreground-child@npm:^2.0.0": version: 2.0.0 resolution: "foreground-child@npm:2.0.0" @@ -7790,6 +8388,19 @@ __metadata: languageName: node linkType: hard +"fs-extra@npm:^0.30.0": + version: 0.30.0 + resolution: "fs-extra@npm:0.30.0" + dependencies: + graceful-fs: "npm:^4.1.2" + jsonfile: "npm:^2.1.0" + klaw: "npm:^1.0.0" + path-is-absolute: "npm:^1.0.0" + rimraf: "npm:^2.2.8" + checksum: 10/bfdd95f598a36a3f24b02db840c1dc54facba2793dea06355c75a6ed823f92e4033589e287f2b91a02a9980c3fb44099e3f00fce5230f045c87431f69be26084 + languageName: node + linkType: hard + "fs-extra@npm:^11.2.0": version: 11.2.0 resolution: "fs-extra@npm:11.2.0" @@ -7875,6 +8486,16 @@ __metadata: languageName: node linkType: hard +"fsevents@npm:~2.1.1": + version: 2.1.3 + resolution: "fsevents@npm:2.1.3" + dependencies: + node-gyp: "npm:latest" + checksum: 10/b604991f31d9ec772e278831bbe069eed8b6824b09b707eeb5c792ceb79fafa9db377981acf7555deab8f5818a75e5487d37b366f55e31d6ea62ea0e06fc777b + conditions: os=darwin + languageName: node + linkType: hard + "fsevents@patch:fsevents@npm%3A^2.3.2#optional!builtin, fsevents@patch:fsevents@npm%3A~2.3.2#optional!builtin": version: 2.3.2 resolution: "fsevents@patch:fsevents@npm%3A2.3.2#optional!builtin::version=2.3.2&hash=df0bf1" @@ -7884,13 +8505,48 @@ __metadata: languageName: node linkType: hard -"function-bind@npm:^1.1.2": +"fsevents@patch:fsevents@npm%3A~2.1.1#optional!builtin": + version: 2.1.3 + resolution: "fsevents@patch:fsevents@npm%3A2.1.3#optional!builtin::version=2.1.3&hash=31d12a" + dependencies: + node-gyp: "npm:latest" + conditions: os=darwin + languageName: node + linkType: hard + +"function-bind@npm:^1.1.1, function-bind@npm:^1.1.2": version: 1.1.2 resolution: "function-bind@npm:1.1.2" checksum: 10/185e20d20f10c8d661d59aac0f3b63b31132d492e1b11fcc2a93cb2c47257ebaee7407c38513efd2b35cafdf972d9beb2ea4593c1e0f3bf8f2744836928d7454 languageName: node linkType: hard +"function.prototype.name@npm:^1.1.6": + version: 1.1.6 + resolution: "function.prototype.name@npm:1.1.6" + dependencies: + call-bind: "npm:^1.0.2" + define-properties: "npm:^1.2.0" + es-abstract: "npm:^1.22.1" + functions-have-names: "npm:^1.2.3" + checksum: 10/4d40be44d4609942e4e90c4fff77a811fa936f4985d92d2abfcf44f673ba344e2962bf223a33101f79c1a056465f36f09b072b9c289d7660ca554a12491cd5a2 + languageName: node + linkType: hard + +"functional-red-black-tree@npm:^1.0.1": + version: 1.0.1 + resolution: "functional-red-black-tree@npm:1.0.1" + checksum: 10/debe73e92204341d1fa5f89614e44284d3add26dee660722978d8c50829170f87d1c74768f68c251d215ae461c11db7bac13101c77f4146ff051da75466f7a12 + languageName: node + linkType: hard + +"functions-have-names@npm:^1.2.3": + version: 1.2.3 + resolution: "functions-have-names@npm:1.2.3" + checksum: 10/0ddfd3ed1066a55984aaecebf5419fbd9344a5c38dd120ffb0739fac4496758dcf371297440528b115e4367fc46e3abc86a2cc0ff44612181b175ae967a11a05 + languageName: node + linkType: hard + "fuse.js@npm:^7.0.0": version: 7.0.0 resolution: "fuse.js@npm:7.0.0" @@ -7914,6 +8570,22 @@ __metadata: languageName: node linkType: hard +"gauge@npm:^5.0.0": + version: 5.0.1 + resolution: "gauge@npm:5.0.1" + dependencies: + aproba: "npm:^1.0.3 || ^2.0.0" + color-support: "npm:^1.1.3" + console-control-strings: "npm:^1.1.0" + has-unicode: "npm:^2.0.1" + signal-exit: "npm:^4.0.1" + string-width: "npm:^4.2.3" + strip-ansi: "npm:^6.0.1" + wide-align: "npm:^1.1.5" + checksum: 10/d9f41a6477b7638398f990eb0964a00a565252abd7d5bd679c83d2cfd4ddfeaec678581b376aaac9b27389866904258aefcd58b40cee1138fc8ec6c29b693d87 + languageName: node + linkType: hard + "gensync@npm:^1.0.0-beta.2": version: 1.0.0-beta.2 resolution: "gensync@npm:1.0.0-beta.2" @@ -7935,7 +8607,7 @@ __metadata: languageName: node linkType: hard -"get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.2, get-intrinsic@npm:^1.2.3, get-intrinsic@npm:^1.2.4": +"get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.1, get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.0, get-intrinsic@npm:^1.2.1, get-intrinsic@npm:^1.2.2, get-intrinsic@npm:^1.2.3, get-intrinsic@npm:^1.2.4": version: 1.2.4 resolution: "get-intrinsic@npm:1.2.4" dependencies: @@ -7990,13 +8662,13 @@ __metadata: languageName: node linkType: hard -"get-stream@npm:^9.0.1": - version: 9.0.1 - resolution: "get-stream@npm:9.0.1" +"get-symbol-description@npm:^1.0.0": + version: 1.0.0 + resolution: "get-symbol-description@npm:1.0.0" dependencies: - "@sec-ant/readable-stream": "npm:^0.4.1" - is-stream: "npm:^4.0.1" - checksum: 10/ce56e6db6bcd29ca9027b0546af035c3e93dcd154ca456b54c298901eb0e5b2ce799c5d727341a100c99e14c523f267f1205f46f153f7b75b1f4da6d98a21c5e + call-bind: "npm:^1.0.2" + get-intrinsic: "npm:^1.1.1" + checksum: 10/7e5f298afe0f0872747dce4a949ce490ebc5d6dd6aefbbe5044543711c9b19a4dfaebdbc627aee99e1299d58a435b2fbfa083458c1d58be6dc03a3bada24d359 languageName: node linkType: hard @@ -8056,16 +8728,16 @@ __metadata: languageName: node linkType: hard -"git-url-parse@npm:^15.0.0": - version: 15.0.0 - resolution: "git-url-parse@npm:15.0.0" +"git-url-parse@npm:^14.0.0": + version: 14.0.0 + resolution: "git-url-parse@npm:14.0.0" dependencies: git-up: "npm:^7.0.0" - checksum: 10/b6e54fc58bb4f4c9bfb1060ec93c3d1462880c6bec76926978e32b2bbfac3535001c87efd1ef0dca9cd9ee0ffdaacba2f50dc4f7032ba09ad92d93e9acc9936b + checksum: 10/c19430947895676c59ce472d534c88e5d2d9f443e6b6e4deaa8ad9ad921ded6c27a996b219503775c37fbb90f4a3c02a5f106f14b61286386f9e5098dff7d634 languageName: node linkType: hard -"glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.2": +"glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.0, glob-parent@npm:~5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" dependencies: @@ -8083,6 +8755,20 @@ __metadata: languageName: node linkType: hard +"glob@npm:7.1.3": + version: 7.1.3 + resolution: "glob@npm:7.1.3" + dependencies: + fs.realpath: "npm:^1.0.0" + inflight: "npm:^1.0.4" + inherits: "npm:2" + minimatch: "npm:^3.0.4" + once: "npm:^1.3.0" + path-is-absolute: "npm:^1.0.0" + checksum: 10/2364d488ec74c4603eef6aed7d0b139341342aafe94e0b0de788248a19320633b1ccbc2639472aac90004560b0227353f27b5abedc9a0b2c5536950b227239c8 + languageName: node + linkType: hard + "glob@npm:7.1.7": version: 7.1.7 resolution: "glob@npm:7.1.7" @@ -8123,7 +8809,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^10.2.2, glob@npm:^10.3.10, glob@npm:^10.4.5": +"glob@npm:^10.2.2, glob@npm:^10.3.10": version: 10.4.5 resolution: "glob@npm:10.4.5" dependencies: @@ -8244,6 +8930,15 @@ __metadata: languageName: node linkType: hard +"globalthis@npm:^1.0.3": + version: 1.0.3 + resolution: "globalthis@npm:1.0.3" + dependencies: + define-properties: "npm:^1.1.3" + checksum: 10/45ae2f3b40a186600d0368f2a880ae257e8278b4c7704f0417d6024105ad7f7a393661c5c2fa1334669cd485ea44bc883a08fdd4516df2428aec40c99f52aa89 + languageName: node + linkType: hard + "globby@npm:^10.0.1": version: 10.0.2 resolution: "globby@npm:10.0.2" @@ -8274,7 +8969,7 @@ __metadata: languageName: node linkType: hard -"globby@npm:^14.0.2": +"globby@npm:^14.0.0, globby@npm:^14.0.2": version: 14.0.2 resolution: "globby@npm:14.0.2" dependencies: @@ -8363,7 +9058,7 @@ __metadata: languageName: node linkType: hard -"graceful-fs@npm:^4.1.15, graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.11, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": +"graceful-fs@npm:^4.1.15, graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.1.9, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.11, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": version: 4.2.11 resolution: "graceful-fs@npm:4.2.11" checksum: 10/bf152d0ed1dc159239db1ba1f74fdbc40cb02f626770dcd5815c427ce0688c2635a06ed69af364396da4636d0408fcf7d4afdf7881724c3307e46aff30ca49e2 @@ -8400,6 +9095,13 @@ __metadata: languageName: node linkType: hard +"growl@npm:1.10.5": + version: 1.10.5 + resolution: "growl@npm:1.10.5" + checksum: 10/1391a9add951964de566adc0aee8b0e2b2321e768c1fdccb7a8e156d6a6cd7ea72782883ba8c2c307baf524e3059519423b72e585eba5e7a5f6e83a1e2359b0d + languageName: node + linkType: hard + "hamt-sharding@npm:^2.0.0": version: 2.0.1 resolution: "hamt-sharding@npm:2.0.1" @@ -8496,26 +9198,32 @@ __metadata: linkType: hard "hardhat-ignore-warnings@npm:^0.2.9": - version: 0.2.11 - resolution: "hardhat-ignore-warnings@npm:0.2.11" + version: 0.2.9 + resolution: "hardhat-ignore-warnings@npm:0.2.9" dependencies: minimatch: "npm:^5.1.0" node-interval-tree: "npm:^2.0.1" solidity-comments: "npm:^0.0.2" - checksum: 10/b249e02dbc207a40cb3090577c0f972b52f233b062ebafed413e70454ad389f991f32a8fda582f32d87f6057886e529a9f58ff6abb604d3294f7f4697a6dcb16 + checksum: 10/e1f57f53010e55466ae93412139b5c79080bdfd8157c6270e7f18cdec265cf15e6c48682177d31cddee14680ba20e62a84eaee22351eb783c6ab1436deb7817c languageName: node linkType: hard "hardhat@npm:^2.19.5": - version: 2.22.10 - resolution: "hardhat@npm:2.22.10" + version: 2.19.5 + resolution: "hardhat@npm:2.19.5" dependencies: "@ethersproject/abi": "npm:^5.1.2" "@metamask/eth-sig-util": "npm:^4.0.0" - "@nomicfoundation/edr": "npm:^0.5.2" - "@nomicfoundation/ethereumjs-common": "npm:4.0.4" - "@nomicfoundation/ethereumjs-tx": "npm:5.0.4" - "@nomicfoundation/ethereumjs-util": "npm:9.0.4" + "@nomicfoundation/ethereumjs-block": "npm:5.0.2" + "@nomicfoundation/ethereumjs-blockchain": "npm:7.0.2" + "@nomicfoundation/ethereumjs-common": "npm:4.0.2" + "@nomicfoundation/ethereumjs-evm": "npm:2.0.2" + "@nomicfoundation/ethereumjs-rlp": "npm:5.0.2" + "@nomicfoundation/ethereumjs-statemanager": "npm:2.0.2" + "@nomicfoundation/ethereumjs-trie": "npm:6.0.2" + "@nomicfoundation/ethereumjs-tx": "npm:5.0.2" + "@nomicfoundation/ethereumjs-util": "npm:9.0.2" + "@nomicfoundation/ethereumjs-vm": "npm:7.0.2" "@nomicfoundation/solidity-analyzer": "npm:^0.1.0" "@sentry/node": "npm:^5.18.1" "@types/bn.js": "npm:^5.1.0" @@ -8546,7 +9254,7 @@ __metadata: raw-body: "npm:^2.4.1" resolve: "npm:1.17.0" semver: "npm:^6.3.0" - solc: "npm:0.8.26" + solc: "npm:0.7.3" source-map-support: "npm:^0.5.13" stacktrace-parser: "npm:^0.1.10" tsort: "npm:0.0.1" @@ -8563,13 +9271,20 @@ __metadata: optional: true bin: hardhat: internal/cli/bootstrap.js - checksum: 10/fe16adc72b2e03ce18dd87f2b19407cfe9378884b7062299c214c049368ed089891eb115c17f7d7e44a4e1bca9a8876aa6384cea3e9d401d5379535f706dbbf3 + checksum: 10/13f2ffeb790155a226960678ee1d5b6041be3754faf675e0f557723cf34b6bb00a8175141d166507bf03f8ea3f790279a64b2d05706a9a7f6b5544cb4160e58d languageName: node linkType: hard -"has-flag@npm:^1.0.0": - version: 1.0.0 - resolution: "has-flag@npm:1.0.0" +"has-bigints@npm:^1.0.1, has-bigints@npm:^1.0.2": + version: 1.0.2 + resolution: "has-bigints@npm:1.0.2" + checksum: 10/4e0426c900af034d12db14abfece02ce7dbf53f2022d28af1a97913ff4c07adb8799476d57dc44fbca0e07d1dbda2a042c2928b1f33d3f09c15de0640a7fb81b + languageName: node + linkType: hard + +"has-flag@npm:^1.0.0": + version: 1.0.0 + resolution: "has-flag@npm:1.0.0" checksum: 10/ce3f8ae978e70f16e4bbe17d3f0f6d6c0a3dd3b62a23f97c91d0fda9ed8e305e13baf95cc5bee4463b9f25ac9f5255de113165c5fb285e01b8065b2ac079b301 languageName: node linkType: hard @@ -8588,7 +9303,7 @@ __metadata: languageName: node linkType: hard -"has-property-descriptors@npm:^1.0.1": +"has-property-descriptors@npm:^1.0.0, has-property-descriptors@npm:^1.0.1": version: 1.0.1 resolution: "has-property-descriptors@npm:1.0.1" dependencies: @@ -8604,13 +9319,22 @@ __metadata: languageName: node linkType: hard -"has-symbols@npm:^1.0.3": +"has-symbols@npm:^1.0.0, has-symbols@npm:^1.0.2, has-symbols@npm:^1.0.3": version: 1.0.3 resolution: "has-symbols@npm:1.0.3" checksum: 10/464f97a8202a7690dadd026e6d73b1ceeddd60fe6acfd06151106f050303eaa75855aaa94969df8015c11ff7c505f196114d22f7386b4a471038da5874cf5e9b languageName: node linkType: hard +"has-tostringtag@npm:^1.0.0": + version: 1.0.0 + resolution: "has-tostringtag@npm:1.0.0" + dependencies: + has-symbols: "npm:^1.0.2" + checksum: 10/95546e7132efc895a9ae64a8a7cf52588601fc3d52e0304ed228f336992cdf0baaba6f3519d2655e560467db35a1ed79f6420c286cc91a13aa0647a31ed92570 + languageName: node + linkType: hard + "has-unicode@npm:^2.0.1": version: 2.0.1 resolution: "has-unicode@npm:2.0.1" @@ -8618,6 +9342,15 @@ __metadata: languageName: node linkType: hard +"has@npm:^1.0.3": + version: 1.0.3 + resolution: "has@npm:1.0.3" + dependencies: + function-bind: "npm:^1.1.1" + checksum: 10/a449f3185b1d165026e8d25f6a8c3390bd25c201ff4b8c1aaf948fc6a5fcfd6507310b8c00c13a3325795ea9791fcc3d79d61eafa313b5750438fc19183df57b + languageName: node + linkType: hard + "hash-base@npm:^3.0.0": version: 3.1.0 resolution: "hash-base@npm:3.1.0" @@ -8668,7 +9401,7 @@ __metadata: languageName: node linkType: hard -"he@npm:^1.2.0": +"he@npm:1.2.0, he@npm:^1.2.0": version: 1.2.0 resolution: "he@npm:1.2.0" bin: @@ -8720,7 +9453,7 @@ __metadata: languageName: node linkType: hard -"hosted-git-info@npm:^7.0.0, hosted-git-info@npm:^7.0.2": +"hosted-git-info@npm:^7.0.0, hosted-git-info@npm:^7.0.1": version: 7.0.2 resolution: "hosted-git-info@npm:7.0.2" dependencies: @@ -8876,7 +9609,7 @@ __metadata: languageName: node linkType: hard -"iconv-lite@npm:0.4.24": +"iconv-lite@npm:0.4.24, iconv-lite@npm:^0.4.24": version: 0.4.24 resolution: "iconv-lite@npm:0.4.24" dependencies: @@ -8894,7 +9627,7 @@ __metadata: languageName: node linkType: hard -"ieee754@npm:^1.2.1": +"ieee754@npm:^1.1.13, ieee754@npm:^1.2.1": version: 1.2.1 resolution: "ieee754@npm:1.2.1" checksum: 10/d9f2557a59036f16c282aaeb107832dc957a93d73397d89bbad4eb1130560560eb695060145e8e6b3b498b15ab95510226649a0b8f52ae06583575419fe10fc4 @@ -8941,7 +9674,7 @@ __metadata: languageName: node linkType: hard -"import-local@npm:^3.0.2, import-local@npm:^3.2.0": +"import-local@npm:^3.0.2, import-local@npm:^3.1.0, import-local@npm:^3.2.0": version: 3.2.0 resolution: "import-local@npm:3.2.0" dependencies: @@ -8998,6 +9731,29 @@ __metadata: languageName: node linkType: hard +"inquirer@npm:^9.2.14": + version: 9.2.14 + resolution: "inquirer@npm:9.2.14" + dependencies: + "@ljharb/through": "npm:^2.3.12" + ansi-escapes: "npm:^4.3.2" + chalk: "npm:^5.3.0" + cli-cursor: "npm:^3.1.0" + cli-width: "npm:^4.1.0" + external-editor: "npm:^3.1.0" + figures: "npm:^3.2.0" + lodash: "npm:^4.17.21" + mute-stream: "npm:1.0.0" + ora: "npm:^5.4.1" + run-async: "npm:^3.0.0" + rxjs: "npm:^7.8.1" + string-width: "npm:^4.2.3" + strip-ansi: "npm:^6.0.1" + wrap-ansi: "npm:^6.2.0" + checksum: 10/6a44a29a909031ef59a660425bfa8554138dae220f67c894bffaeb5f75e49100cd8dbfe25aa237397474e48211f1a4cc8f8f35062996d9153352f51ca11fa536 + languageName: node + linkType: hard + "interface-datastore@npm:^6.0.2": version: 6.1.1 resolution: "interface-datastore@npm:6.1.1" @@ -9027,6 +9783,17 @@ __metadata: languageName: node linkType: hard +"internal-slot@npm:^1.0.5": + version: 1.0.5 + resolution: "internal-slot@npm:1.0.5" + dependencies: + get-intrinsic: "npm:^1.2.0" + has: "npm:^1.0.3" + side-channel: "npm:^1.0.4" + checksum: 10/e2eb5b348e427957dd4092cb57b9374a2cbcabbf61e5e5b4d99cb68eeaae29394e8efd79f23dc2b1831253346f3c16b82010737b84841225e934d80d04d68643 + languageName: node + linkType: hard + "interpret@npm:^1.0.0": version: 1.4.0 resolution: "interpret@npm:1.4.0" @@ -9216,6 +9983,17 @@ __metadata: languageName: node linkType: hard +"is-array-buffer@npm:^3.0.1, is-array-buffer@npm:^3.0.2": + version: 3.0.2 + resolution: "is-array-buffer@npm:3.0.2" + dependencies: + call-bind: "npm:^1.0.2" + get-intrinsic: "npm:^1.2.0" + is-typed-array: "npm:^1.1.10" + checksum: 10/dcac9dda66ff17df9cabdc58214172bf41082f956eab30bb0d86bc0fab1e44b690fc8e1f855cf2481245caf4e8a5a006a982a71ddccec84032ed41f9d8da8c14 + languageName: node + linkType: hard + "is-arrayish@npm:^0.2.1": version: 0.2.1 resolution: "is-arrayish@npm:0.2.1" @@ -9223,6 +10001,15 @@ __metadata: languageName: node linkType: hard +"is-bigint@npm:^1.0.1": + version: 1.0.4 + resolution: "is-bigint@npm:1.0.4" + dependencies: + has-bigints: "npm:^1.0.1" + checksum: 10/cc981cf0564c503aaccc1e5f39e994ae16ae2d1a8fcd14721f14ad431809071f39ec568cfceef901cff408045f1a6d6bac90d1b43eeb0b8e3bc34c8eb1bdb4c4 + languageName: node + linkType: hard + "is-binary-path@npm:~2.1.0": version: 2.1.0 resolution: "is-binary-path@npm:2.1.0" @@ -9232,6 +10019,23 @@ __metadata: languageName: node linkType: hard +"is-boolean-object@npm:^1.1.0": + version: 1.1.2 + resolution: "is-boolean-object@npm:1.1.2" + dependencies: + call-bind: "npm:^1.0.2" + has-tostringtag: "npm:^1.0.0" + checksum: 10/ba794223b56a49a9f185e945eeeb6b7833b8ea52a335cec087d08196cf27b538940001615d3bb976511287cefe94e5907d55f00bb49580533f9ca9b4515fcc2e + languageName: node + linkType: hard + +"is-buffer@npm:^2.0.5, is-buffer@npm:~2.0.3": + version: 2.0.5 + resolution: "is-buffer@npm:2.0.5" + checksum: 10/3261a8b858edcc6c9566ba1694bf829e126faa88911d1c0a747ea658c5d81b14b6955e3a702d59dabadd58fdd440c01f321aa71d6547105fd21d03f94d0597e7 + languageName: node + linkType: hard + "is-buffer@npm:~1.1.6": version: 1.1.6 resolution: "is-buffer@npm:1.1.6" @@ -9239,6 +10043,13 @@ __metadata: languageName: node linkType: hard +"is-callable@npm:^1.1.3, is-callable@npm:^1.1.4, is-callable@npm:^1.2.7": + version: 1.2.7 + resolution: "is-callable@npm:1.2.7" + checksum: 10/48a9297fb92c99e9df48706241a189da362bff3003354aea4048bd5f7b2eb0d823cd16d0a383cece3d76166ba16d85d9659165ac6fcce1ac12e6c649d66dbdb9 + languageName: node + linkType: hard + "is-ci@npm:^3.0.1": version: 3.0.1 resolution: "is-ci@npm:3.0.1" @@ -9259,6 +10070,15 @@ __metadata: languageName: node linkType: hard +"is-date-object@npm:^1.0.1": + version: 1.0.5 + resolution: "is-date-object@npm:1.0.5" + dependencies: + has-tostringtag: "npm:^1.0.0" + checksum: 10/cc80b3a4b42238fa0d358b9a6230dae40548b349e64a477cb7c5eff9b176ba194c11f8321daaf6dd157e44073e9b7fd01f87db1f14952a88d5657acdcd3a56e2 + languageName: node + linkType: hard + "is-docker@npm:^2.0.0, is-docker@npm:^2.1.1": version: 2.2.1 resolution: "is-docker@npm:2.2.1" @@ -9358,6 +10178,22 @@ __metadata: languageName: node linkType: hard +"is-negative-zero@npm:^2.0.2": + version: 2.0.2 + resolution: "is-negative-zero@npm:2.0.2" + checksum: 10/edbec1a9e6454d68bf595a114c3a72343d2d0be7761d8173dae46c0b73d05bb8fe9398c85d121e7794a66467d2f40b4a610b0be84cd804262d234fc634c86131 + languageName: node + linkType: hard + +"is-number-object@npm:^1.0.4": + version: 1.0.7 + resolution: "is-number-object@npm:1.0.7" + dependencies: + has-tostringtag: "npm:^1.0.0" + checksum: 10/8700dcf7f602e0a9625830541345b8615d04953655acbf5c6d379c58eb1af1465e71227e95d501343346e1d49b6f2d53cbc166b1fc686a7ec19151272df582f9 + languageName: node + linkType: hard + "is-number@npm:^7.0.0": version: 7.0.0 resolution: "is-number@npm:7.0.0" @@ -9409,6 +10245,16 @@ __metadata: languageName: node linkType: hard +"is-regex@npm:^1.1.4": + version: 1.1.4 + resolution: "is-regex@npm:1.1.4" + dependencies: + call-bind: "npm:^1.0.2" + has-tostringtag: "npm:^1.0.0" + checksum: 10/36d9174d16d520b489a5e9001d7d8d8624103b387be300c50f860d9414556d0485d74a612fdafc6ebbd5c89213d947dcc6b6bff6b2312093f71ea03cbb19e564 + languageName: node + linkType: hard + "is-retry-allowed@npm:^2.2.0": version: 2.2.0 resolution: "is-retry-allowed@npm:2.2.0" @@ -9416,6 +10262,15 @@ __metadata: languageName: node linkType: hard +"is-shared-array-buffer@npm:^1.0.2": + version: 1.0.2 + resolution: "is-shared-array-buffer@npm:1.0.2" + dependencies: + call-bind: "npm:^1.0.2" + checksum: 10/23d82259d6cd6dbb7c4ff3e4efeff0c30dbc6b7f88698498c17f9821cb3278d17d2b6303a5341cbd638ab925a28f3f086a6c79b3df70ac986cc526c725d43b4f + languageName: node + linkType: hard + "is-ssh@npm:^1.4.0": version: 1.4.0 resolution: "is-ssh@npm:1.4.0" @@ -9439,10 +10294,21 @@ __metadata: languageName: node linkType: hard -"is-stream@npm:^4.0.1": - version: 4.0.1 - resolution: "is-stream@npm:4.0.1" - checksum: 10/cbea3f1fc271b21ceb228819d0c12a0965a02b57f39423925f99530b4eb86935235f258f06310b67cd02b2d10b49e9a0998f5ececf110ab7d3760bae4055ad23 +"is-string@npm:^1.0.5, is-string@npm:^1.0.7": + version: 1.0.7 + resolution: "is-string@npm:1.0.7" + dependencies: + has-tostringtag: "npm:^1.0.0" + checksum: 10/2bc292fe927493fb6dfc3338c099c3efdc41f635727c6ebccf704aeb2a27bca7acb9ce6fd34d103db78692b10b22111a8891de26e12bfa1c5e11e263c99d1fef + languageName: node + linkType: hard + +"is-symbol@npm:^1.0.2, is-symbol@npm:^1.0.3": + version: 1.0.4 + resolution: "is-symbol@npm:1.0.4" + dependencies: + has-symbols: "npm:^1.0.2" + checksum: 10/a47dd899a84322528b71318a89db25c7ecdec73197182dad291df15ffea501e17e3c92c8de0bfb50e63402747399981a687b31c519971b1fa1a27413612be929 languageName: node linkType: hard @@ -9455,6 +10321,15 @@ __metadata: languageName: node linkType: hard +"is-typed-array@npm:^1.1.10, is-typed-array@npm:^1.1.12, is-typed-array@npm:^1.1.9": + version: 1.1.12 + resolution: "is-typed-array@npm:1.1.12" + dependencies: + which-typed-array: "npm:^1.1.11" + checksum: 10/d953adfd3c41618d5e01b2a10f21817e4cdc9572772fa17211100aebb3811b6e3c2e308a0558cc87d218a30504cb90154b833013437776551bfb70606fb088ca + languageName: node + linkType: hard + "is-typedarray@npm:^1.0.0, is-typedarray@npm:~1.0.0": version: 1.0.0 resolution: "is-typedarray@npm:1.0.0" @@ -9469,6 +10344,15 @@ __metadata: languageName: node linkType: hard +"is-weakref@npm:^1.0.2": + version: 1.0.2 + resolution: "is-weakref@npm:1.0.2" + dependencies: + call-bind: "npm:^1.0.2" + checksum: 10/0023fd0e4bdf9c338438ffbe1eed7ebbbff7e7e18fb7cdc227caaf9d4bd024a2dcdf6a8c9f40c92192022eac8391243bb9e66cccebecbf6fe1d8a366108f8513 + languageName: node + linkType: hard + "is-windows@npm:^1.0.1, is-windows@npm:^1.0.2": version: 1.0.2 resolution: "is-windows@npm:1.0.2" @@ -9492,6 +10376,13 @@ __metadata: languageName: node linkType: hard +"isarray@npm:^2.0.5": + version: 2.0.5 + resolution: "isarray@npm:2.0.5" + checksum: 10/1d8bc7911e13bb9f105b1b3e0b396c787a9e63046af0b8fe0ab1414488ab06b2b099b87a2d8a9e31d21c9a6fad773c7fc8b257c4880f2d957274479d28ca3414 + languageName: node + linkType: hard + "isarray@npm:~1.0.0": version: 1.0.0 resolution: "isarray@npm:1.0.0" @@ -10203,6 +11094,13 @@ __metadata: languageName: node linkType: hard +"js-sdsl@npm:^4.1.4": + version: 4.4.1 + resolution: "js-sdsl@npm:4.4.1" + checksum: 10/f1f6faa0bdd8aa2acf58a2b2bddc85fc203937cad458b3802f4fe9dc335978753c88b28ae210e999d4b3a12f9f31f29494dff31aa46a89d3855e9a5e920bc908 + languageName: node + linkType: hard + "js-sha3@npm:0.5.7": version: 0.5.7 resolution: "js-sha3@npm:0.5.7" @@ -10224,6 +11122,18 @@ __metadata: languageName: node linkType: hard +"js-yaml@npm:3.13.1": + version: 3.13.1 + resolution: "js-yaml@npm:3.13.1" + dependencies: + argparse: "npm:^1.0.7" + esprima: "npm:^4.0.0" + bin: + js-yaml: bin/js-yaml.js + checksum: 10/cec89175b065743875fce53e63adc8b89aded77e18d00e54ff80c57ab730f22ccfddaf2fe3e6adab1d6dff59a3d55dd9ae6fc711d46335b7e94c32d3583a5627 + languageName: node + linkType: hard + "js-yaml@npm:3.14.1, js-yaml@npm:3.x, js-yaml@npm:^3.13.1, js-yaml@npm:^3.14.1": version: 3.14.1 resolution: "js-yaml@npm:3.14.1" @@ -10277,7 +11187,7 @@ __metadata: languageName: node linkType: hard -"json-parse-even-better-errors@npm:^3.0.0, json-parse-even-better-errors@npm:^3.0.2": +"json-parse-even-better-errors@npm:^3.0.0": version: 3.0.2 resolution: "json-parse-even-better-errors@npm:3.0.2" checksum: 10/6f04ea6c9ccb783630a59297959247e921cc90b917b8351197ca7fd058fccc7079268fd9362be21ba876fc26aa5039369dd0a2280aae49aae425784794a94927 @@ -10335,6 +11245,18 @@ __metadata: languageName: node linkType: hard +"jsonfile@npm:^2.1.0": + version: 2.4.0 + resolution: "jsonfile@npm:2.4.0" + dependencies: + graceful-fs: "npm:^4.1.6" + dependenciesMeta: + graceful-fs: + optional: true + checksum: 10/517656e0a7c4eda5a90341dd0ec9e9b7590d0c77d66d8aad0162615dfc7c5f219c82565b927cc4cc774ca93e484d118a274ef0def74279a3d8afb4ff2f4e4800 + languageName: node + linkType: hard + "jsonfile@npm:^4.0.0": version: 4.0.0 resolution: "jsonfile@npm:4.0.0" @@ -10435,6 +11357,18 @@ __metadata: languageName: node linkType: hard +"klaw@npm:^1.0.0": + version: 1.3.1 + resolution: "klaw@npm:1.3.1" + dependencies: + graceful-fs: "npm:^4.1.9" + dependenciesMeta: + graceful-fs: + optional: true + checksum: 10/68b8ccb89f222dca60805df2b0e0fa0b3e4203ca1928b8facc0afac660e3e362809fe00f868ac877f495ebf89e376bb9ac9275508a132b5573e7382bed3ab006 + languageName: node + linkType: hard + "kleur@npm:^3.0.3": version: 3.0.3 resolution: "kleur@npm:3.0.3" @@ -10451,6 +11385,33 @@ __metadata: languageName: node linkType: hard +"level-supports@npm:^4.0.0": + version: 4.0.1 + resolution: "level-supports@npm:4.0.1" + checksum: 10/e2f177af813a25af29d15406a14240e2e10e5efb1c35b03643c885ac5931af760b9337826506b6395f98cf6b1e68ba294bfc345a248a1ae3f9c69e08e81824b2 + languageName: node + linkType: hard + +"level-transcoder@npm:^1.0.1": + version: 1.0.1 + resolution: "level-transcoder@npm:1.0.1" + dependencies: + buffer: "npm:^6.0.3" + module-error: "npm:^1.0.1" + checksum: 10/2fb41a1d8037fc279f851ead8cdc3852b738f1f935ac2895183cd606aae3e57008e085c7c2bd2b2d43cfd057333108cfaed604092e173ac2abdf5ab1b8333f9e + languageName: node + linkType: hard + +"level@npm:^8.0.0": + version: 8.0.0 + resolution: "level@npm:8.0.0" + dependencies: + browser-level: "npm:^1.0.1" + classic-level: "npm:^1.2.0" + checksum: 10/1e7df97fe80fb158c8c1d6feeb651ee1381fd8e45af773b2bb02d3dd020fefd4f48a69d260b2d0ce9c4245ee9d8d40b8a9c49275b0b1ef6e1d4158feb5c39081 + languageName: node + linkType: hard + "leven@npm:^3.1.0": version: 3.1.0 resolution: "leven@npm:3.1.0" @@ -10478,29 +11439,29 @@ __metadata: languageName: node linkType: hard -"libnpmaccess@npm:^8.0.6": - version: 8.0.6 - resolution: "libnpmaccess@npm:8.0.6" +"libnpmaccess@npm:^8.0.2": + version: 8.0.2 + resolution: "libnpmaccess@npm:8.0.2" dependencies: - npm-package-arg: "npm:^11.0.2" - npm-registry-fetch: "npm:^17.0.1" - checksum: 10/62fa6a476321268ebd379f35782d9ead8993964bd9dfc8afbd201921d9037b7bc9d956f8b2717f1247e44ab33cb7de45b556ded66144f4b3038a828299cb260d + npm-package-arg: "npm:^11.0.1" + npm-registry-fetch: "npm:^16.0.0" + checksum: 10/20113f2fe4e32e3aaaa04f89cf2a7c1c907f847e274cc81d16617e5e5d5be4f801cd5709fe978bd9f9c0f6983d2cd941933a3c59393b63f7f2283bafb6a31659 languageName: node linkType: hard -"libnpmpublish@npm:^9.0.9": - version: 9.0.9 - resolution: "libnpmpublish@npm:9.0.9" +"libnpmpublish@npm:^9.0.4": + version: 9.0.4 + resolution: "libnpmpublish@npm:9.0.4" dependencies: ci-info: "npm:^4.0.0" - normalize-package-data: "npm:^6.0.1" - npm-package-arg: "npm:^11.0.2" - npm-registry-fetch: "npm:^17.0.1" - proc-log: "npm:^4.2.0" + normalize-package-data: "npm:^6.0.0" + npm-package-arg: "npm:^11.0.1" + npm-registry-fetch: "npm:^16.0.0" + proc-log: "npm:^3.0.0" semver: "npm:^7.3.7" sigstore: "npm:^2.2.0" - ssri: "npm:^10.0.6" - checksum: 10/ea1064a727938abefe345d5af1261db8bdc1e71aedabf6945187c2b3a6ef1a4c9db69747ad3ffd4ecd61ea16866890e0da1a4defcbed64e555e7dcae49e55a98 + ssri: "npm:^10.0.5" + checksum: 10/11a997cf1197f17217267005e1f11f1eb5305b2d3eab0a900abc5f27455d846ed43ddac2c0699698bbac9f6c308aab9d2f61a7f657df6bbafaee08dbf6f74a23 languageName: node linkType: hard @@ -10576,6 +11537,16 @@ __metadata: languageName: node linkType: hard +"locate-path@npm:^3.0.0": + version: 3.0.0 + resolution: "locate-path@npm:3.0.0" + dependencies: + p-locate: "npm:^3.0.0" + path-exists: "npm:^3.0.0" + checksum: 10/53db3996672f21f8b0bf2a2c645ae2c13ffdae1eeecfcd399a583bce8516c0b88dcb4222ca6efbbbeb6949df7e46860895be2c02e8d3219abd373ace3bfb4e11 + languageName: node + linkType: hard + "locate-path@npm:^5.0.0": version: 5.0.0 resolution: "locate-path@npm:5.0.0" @@ -10645,7 +11616,7 @@ __metadata: languageName: node linkType: hard -"lodash.memoize@npm:^4.1.2": +"lodash.memoize@npm:4.x, lodash.memoize@npm:^4.1.2": version: 4.1.2 resolution: "lodash.memoize@npm:4.1.2" checksum: 10/192b2168f310c86f303580b53acf81ab029761b9bd9caa9506a019ffea5f3363ea98d7e39e7e11e6b9917066c9d36a09a11f6fe16f812326390d8f3a54a1a6da @@ -10750,7 +11721,7 @@ __metadata: languageName: node linkType: hard -"log-symbols@npm:^3.0.0": +"log-symbols@npm:3.0.0, log-symbols@npm:^3.0.0": version: 3.0.0 resolution: "log-symbols@npm:3.0.0" dependencies: @@ -10803,7 +11774,7 @@ __metadata: languageName: node linkType: hard -"lru-cache@npm:^10.0.1, lru-cache@npm:^10.2.0, lru-cache@npm:^10.2.2": +"lru-cache@npm:^10.0.1, lru-cache@npm:^10.2.0": version: 10.4.3 resolution: "lru-cache@npm:10.4.3" checksum: 10/e6e90267360476720fa8e83cc168aa2bf0311f3f2eea20a6ba78b90a885ae72071d9db132f40fda4129c803e7dcec3a6b6a6fbb44ca90b081630b810b5d6a41a @@ -10870,14 +11841,16 @@ __metadata: languageName: node linkType: hard -"make-dir@npm:^5.0.0": - version: 5.0.0 - resolution: "make-dir@npm:5.0.0" - checksum: 10/9f40f4756af5138ca3b138f9e8af144b0420516e96b0e079d816a173d2f69b2ef3425abf20e25764d222c0939a9fd2bce91dd26c22002a559cd6beaea5c994d2 +"make-dir@npm:^4.0.0": + version: 4.0.0 + resolution: "make-dir@npm:4.0.0" + dependencies: + semver: "npm:^7.5.3" + checksum: 10/bf0731a2dd3aab4db6f3de1585cea0b746bb73eb5a02e3d8d72757e376e64e6ada190b1eddcde5b2f24a81b688a9897efd5018737d05e02e2a671dda9cff8a8a languageName: node linkType: hard -"make-error@npm:^1.1.1, make-error@npm:^1.3.6": +"make-error@npm:1.x, make-error@npm:^1.1.1": version: 1.3.6 resolution: "make-error@npm:1.3.6" checksum: 10/b86e5e0e25f7f777b77fabd8e2cbf15737972869d852a22b7e73c17623928fccb826d8e46b9951501d3f20e51ad74ba8c59ed584f610526a48f8ccf88aaec402 @@ -10965,6 +11938,13 @@ __metadata: languageName: node linkType: hard +"mcl-wasm@npm:^0.7.1": + version: 0.7.9 + resolution: "mcl-wasm@npm:0.7.9" + checksum: 10/eb689cf0e2422ef7b98e8b040ed601821aea839718c876cd734e9148ca7013adf1c869bbc9495aac351e645d314ec3bd3d3612c91f60c499c5aea8d3dd2a7e38 + languageName: node + linkType: hard + "md5.js@npm:^1.3.4": version: 1.3.5 resolution: "md5.js@npm:1.3.5" @@ -10987,6 +11967,17 @@ __metadata: languageName: node linkType: hard +"memory-level@npm:^1.0.0": + version: 1.0.0 + resolution: "memory-level@npm:1.0.0" + dependencies: + abstract-level: "npm:^1.0.0" + functional-red-black-tree: "npm:^1.0.1" + module-error: "npm:^1.0.1" + checksum: 10/e3293d8c67ebc0aa4b29982c5f8e3d139c5b1b04b97fa3ae98f940f91c7bdfefec9ff189742943734ebb6c7efa85fed6a4d559407b2d5751106b24cac17a23a6 + languageName: node + linkType: hard + "memorystream@npm:^0.3.1": version: 0.3.1 resolution: "memorystream@npm:0.3.1" @@ -11135,6 +12126,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:3.0.4": + version: 3.0.4 + resolution: "minimatch@npm:3.0.4" + dependencies: + brace-expansion: "npm:^1.1.7" + checksum: 10/3b3f17f76582417dd139646505f1d1bb5f148ea5191eb98fe73cd41224a678dadb94cc674c7d06b36de4ab5c303f039cfd7cd2d089348d6f70d04db169cf3770 + languageName: node + linkType: hard + "minimatch@npm:^5.0.1, minimatch@npm:^5.1.0, minimatch@npm:^5.1.6": version: 5.1.6 resolution: "minimatch@npm:5.1.6" @@ -11231,6 +12231,16 @@ __metadata: languageName: node linkType: hard +"minipass-json-stream@npm:^1.0.1": + version: 1.0.1 + resolution: "minipass-json-stream@npm:1.0.1" + dependencies: + jsonparse: "npm:^1.3.1" + minipass: "npm:^3.0.0" + checksum: 10/3c65482c630b063c3fa86c853f324a50d9484f2eb6c3034f9c86c0b22f44181668848088f2c869cc764f8a9b8adc8f617f93762cd9d11521f563b8a71c5b815d + languageName: node + linkType: hard + "minipass-pipeline@npm:^1.2.4": version: 1.2.4 resolution: "minipass-pipeline@npm:1.2.4" @@ -11289,6 +12299,17 @@ __metadata: languageName: node linkType: hard +"mkdirp@npm:0.5.5": + version: 0.5.5 + resolution: "mkdirp@npm:0.5.5" + dependencies: + minimist: "npm:^1.2.5" + bin: + mkdirp: bin/cmd.js + checksum: 10/3bce20ea525f9477befe458ab85284b0b66c8dc3812f94155af07c827175948cdd8114852ac6c6d82009b13c1048c37f6d98743eb019651ee25c39acc8aabe7d + languageName: node + linkType: hard + "mkdirp@npm:0.5.x, mkdirp@npm:^0.5.1": version: 0.5.6 resolution: "mkdirp@npm:0.5.6" @@ -11351,7 +12372,7 @@ __metadata: languageName: node linkType: hard -"mocha@npm:^10.0.0, mocha@npm:^10.2.0, mocha@npm:^10.7.3, mocha@npm:^7.1.1": +"mocha@npm:^10.0.0, mocha@npm:^10.2.0, mocha@npm:^10.7.3": version: 10.7.3 resolution: "mocha@npm:10.7.3" dependencies: @@ -11382,6 +12403,55 @@ __metadata: languageName: node linkType: hard +"mocha@npm:^7.1.1": + version: 7.2.0 + resolution: "mocha@npm:7.2.0" + dependencies: + ansi-colors: "npm:3.2.3" + browser-stdout: "npm:1.3.1" + chokidar: "npm:3.3.0" + debug: "npm:3.2.6" + diff: "npm:3.5.0" + escape-string-regexp: "npm:1.0.5" + find-up: "npm:3.0.0" + glob: "npm:7.1.3" + growl: "npm:1.10.5" + he: "npm:1.2.0" + js-yaml: "npm:3.13.1" + log-symbols: "npm:3.0.0" + minimatch: "npm:3.0.4" + mkdirp: "npm:0.5.5" + ms: "npm:2.1.1" + node-environment-flags: "npm:1.0.6" + object.assign: "npm:4.1.0" + strip-json-comments: "npm:2.0.1" + supports-color: "npm:6.0.0" + which: "npm:1.3.1" + wide-align: "npm:1.1.3" + yargs: "npm:13.3.2" + yargs-parser: "npm:13.1.2" + yargs-unparser: "npm:1.6.0" + bin: + _mocha: bin/_mocha + mocha: bin/mocha + checksum: 10/3f7630fc5aecd1497a13ffa8ac98a5db6d91a9f0232d12f5d258c17da187ab1ec53192e4947443d96174785256036b711e0d3cd6f99fd5766b29c801836fe6c1 + languageName: node + linkType: hard + +"module-error@npm:^1.0.1, module-error@npm:^1.0.2": + version: 1.0.2 + resolution: "module-error@npm:1.0.2" + checksum: 10/5d653e35bd55b3e95f8aee2cdac108082ea892e71b8f651be92cde43e4ee86abee4fa8bd7fc3fe5e68b63926d42f63c54cd17b87a560c31f18739295575a3962 + languageName: node + linkType: hard + +"ms@npm:2.1.1": + version: 2.1.1 + resolution: "ms@npm:2.1.1" + checksum: 10/0078a23cd916a9a7435c413caa14c57d4b4f6e2470e0ab554b6964163c8a4436448ac7ae020e883685475da6b6796cc396b670f579cb275db288a21e3e57721e + languageName: node + linkType: hard + "ms@npm:2.1.2": version: 2.1.2 resolution: "ms@npm:2.1.2" @@ -11510,7 +12580,7 @@ __metadata: languageName: node linkType: hard -"mute-stream@npm:^1.0.0": +"mute-stream@npm:1.0.0, mute-stream@npm:^1.0.0": version: 1.0.0 resolution: "mute-stream@npm:1.0.0" checksum: 10/36fc968b0e9c9c63029d4f9dc63911950a3bdf55c9a87f58d3a266289b67180201cade911e7699f8b2fa596b34c9db43dad37649e3f7fdd13c3bb9edb0017ee7 @@ -11526,6 +12596,13 @@ __metadata: languageName: node linkType: hard +"napi-macros@npm:^2.2.2": + version: 2.2.2 + resolution: "napi-macros@npm:2.2.2" + checksum: 10/2cdb9c40ad4b424b14fbe5e13c5329559e2b511665acf41cdcda172fd2270202dc747a2d288b687c72bc70f654c797bc24a93adb67631128d62461588d7cc070 + languageName: node + linkType: hard + "native-abort-controller@npm:^1.0.3, native-abort-controller@npm:^1.0.4": version: 1.0.4 resolution: "native-abort-controller@npm:1.0.4" @@ -11626,6 +12703,16 @@ __metadata: languageName: node linkType: hard +"node-environment-flags@npm:1.0.6": + version: 1.0.6 + resolution: "node-environment-flags@npm:1.0.6" + dependencies: + object.getownpropertydescriptors: "npm:^2.0.3" + semver: "npm:^5.7.0" + checksum: 10/e179d0ff3697cd6006d426ce707060b044da93c8e4c7ce1b19d211c25cc276ba72aa36247bfe64d6e79a0264843d5df7124f0fc28e50fc904f07cc1b96f8c781 + languageName: node + linkType: hard + "node-fetch@npm:^2.6.1, node-fetch@npm:^2.6.8, node-fetch@npm:^2.7.0": version: 2.7.0 resolution: "node-fetch@npm:2.7.0" @@ -11651,7 +12738,7 @@ __metadata: languageName: node linkType: hard -"node-gyp-build@npm:^4.2.0": +"node-gyp-build@npm:^4.2.0, node-gyp-build@npm:^4.3.0": version: 4.6.0 resolution: "node-gyp-build@npm:4.6.0" bin: @@ -11764,7 +12851,7 @@ __metadata: languageName: node linkType: hard -"nopt@npm:^7.0.0, nopt@npm:^7.2.1": +"nopt@npm:^7.0.0": version: 7.2.1 resolution: "nopt@npm:7.2.1" dependencies: @@ -11799,7 +12886,7 @@ __metadata: languageName: node linkType: hard -"normalize-package-data@npm:^6.0.0, normalize-package-data@npm:^6.0.1": +"normalize-package-data@npm:^6.0.0": version: 6.0.2 resolution: "normalize-package-data@npm:6.0.2" dependencies: @@ -11849,7 +12936,7 @@ __metadata: languageName: node linkType: hard -"npm-package-arg@npm:^11.0.0, npm-package-arg@npm:^11.0.2, npm-package-arg@npm:^11.0.3": +"npm-package-arg@npm:^11.0.0, npm-package-arg@npm:^11.0.1, npm-package-arg@npm:^11.0.3": version: 11.0.3 resolution: "npm-package-arg@npm:11.0.3" dependencies: @@ -11870,7 +12957,7 @@ __metadata: languageName: node linkType: hard -"npm-pick-manifest@npm:^9.0.0, npm-pick-manifest@npm:^9.0.1": +"npm-pick-manifest@npm:^9.0.0": version: 9.1.0 resolution: "npm-pick-manifest@npm:9.1.0" dependencies: @@ -11882,19 +12969,18 @@ __metadata: languageName: node linkType: hard -"npm-registry-fetch@npm:^17.0.0, npm-registry-fetch@npm:^17.0.1, npm-registry-fetch@npm:^17.1.0": - version: 17.1.0 - resolution: "npm-registry-fetch@npm:17.1.0" +"npm-registry-fetch@npm:^16.0.0, npm-registry-fetch@npm:^16.1.0": + version: 16.1.0 + resolution: "npm-registry-fetch@npm:16.1.0" dependencies: - "@npmcli/redact": "npm:^2.0.0" - jsonparse: "npm:^1.3.1" make-fetch-happen: "npm:^13.0.0" minipass: "npm:^7.0.2" minipass-fetch: "npm:^3.0.0" + minipass-json-stream: "npm:^1.0.1" minizlib: "npm:^2.1.2" npm-package-arg: "npm:^11.0.0" - proc-log: "npm:^4.0.0" - checksum: 10/b9b2a73907fb5b2d8187031e040d7b2918f2b127ac858a84bd244f6435d16dd04df23c9660f32d7e9deb0216b91071623f040fd51b0bd375e8c7fed7d7a82a1c + proc-log: "npm:^3.0.0" + checksum: 10/ba760c9cdacb1219ac5d8fecc26b1c55d502b55d45ab85ad556353b9bc5ba664c226fda54284c06df8c7eecfdcacb1aa065838ea7d1b0189d24c4d3f186309d2 languageName: node linkType: hard @@ -11928,6 +13014,18 @@ __metadata: languageName: node linkType: hard +"npmlog@npm:^7.0.1": + version: 7.0.1 + resolution: "npmlog@npm:7.0.1" + dependencies: + are-we-there-yet: "npm:^4.0.0" + console-control-strings: "npm:^1.1.0" + gauge: "npm:^5.0.0" + set-blocking: "npm:^2.0.0" + checksum: 10/37cc2796a4b47bb82b5fc5d111f812d5856b30f8dd29d3e9ecce30fe966bd4389926e818ec5e7f11e9fcc60220ef9c65d7e4c56dd5101ee19d8f5e60320e558b + languageName: node + linkType: hard + "number-to-bn@npm:1.7.0": version: 1.7.0 resolution: "number-to-bn@npm:1.7.0" @@ -11989,13 +13087,20 @@ __metadata: languageName: node linkType: hard -"object-inspect@npm:^1.9.0": +"object-inspect@npm:^1.12.3, object-inspect@npm:^1.9.0": version: 1.12.3 resolution: "object-inspect@npm:1.12.3" checksum: 10/532b0036f0472f561180fac0d04fe328ee01f57637624c83fb054f81b5bfe966cdf4200612a499ed391a7ca3c46b20a0bc3a55fc8241d944abe687c556a32b39 languageName: node linkType: hard +"object-keys@npm:^1.0.11, object-keys@npm:^1.1.1": + version: 1.1.1 + resolution: "object-keys@npm:1.1.1" + checksum: 10/3d81d02674115973df0b7117628ea4110d56042e5326413e4b4313f0bcdf7dd78d4a3acef2c831463fa3796a66762c49daef306f4a0ea1af44877d7086d73bde + languageName: node + linkType: hard + "object-treeify@npm:^1.1.33": version: 1.1.33 resolution: "object-treeify@npm:1.1.33" @@ -12003,6 +13108,43 @@ __metadata: languageName: node linkType: hard +"object.assign@npm:4.1.0": + version: 4.1.0 + resolution: "object.assign@npm:4.1.0" + dependencies: + define-properties: "npm:^1.1.2" + function-bind: "npm:^1.1.1" + has-symbols: "npm:^1.0.0" + object-keys: "npm:^1.0.11" + checksum: 10/9ca3797cdbd3ff8a196aaee7b4808f2d1802c4d3655b1a03d15ca0284fc1034d097c112c6be60a11a866bcbf728b05318326834054d36f11a17aacb15d04ec9e + languageName: node + linkType: hard + +"object.assign@npm:^4.1.4": + version: 4.1.4 + resolution: "object.assign@npm:4.1.4" + dependencies: + call-bind: "npm:^1.0.2" + define-properties: "npm:^1.1.4" + has-symbols: "npm:^1.0.3" + object-keys: "npm:^1.1.1" + checksum: 10/fd82d45289df0a952d772817622ecbaeb4ec933d3abb53267aede083ee38f6a395af8fadfbc569ee575115b0b7c9b286e7cfb2b7a2557b1055f7acbce513bc29 + languageName: node + linkType: hard + +"object.getownpropertydescriptors@npm:^2.0.3": + version: 2.1.6 + resolution: "object.getownpropertydescriptors@npm:2.1.6" + dependencies: + array.prototype.reduce: "npm:^1.0.5" + call-bind: "npm:^1.0.2" + define-properties: "npm:^1.2.0" + es-abstract: "npm:^1.21.2" + safe-array-concat: "npm:^1.0.0" + checksum: 10/442983bf16c4cbf6f3b8882d14ca4d76fc78c4afc45a16454f6a728946f8e1aaf4ba4bd60557bbd800211bea0e7e83732344e884d5a8c20a195273fa637d8876 + languageName: node + linkType: hard + "obliterator@npm:^2.0.0": version: 2.0.4 resolution: "obliterator@npm:2.0.4" @@ -12109,6 +13251,23 @@ __metadata: languageName: node linkType: hard +"ora@npm:^5.4.1": + version: 5.4.1 + resolution: "ora@npm:5.4.1" + dependencies: + bl: "npm:^4.1.0" + chalk: "npm:^4.1.0" + cli-cursor: "npm:^3.1.0" + cli-spinners: "npm:^2.5.0" + is-interactive: "npm:^1.0.0" + is-unicode-supported: "npm:^0.1.0" + log-symbols: "npm:^4.1.0" + strip-ansi: "npm:^6.0.0" + wcwidth: "npm:^1.0.1" + checksum: 10/8d071828f40090a8e1c6e8f350c6eb065808e9ab2b3e57fa37e0d5ae78cb46dac00117c8f12c3c8b8da2923454afbd8265e08c10b69881170c5b269f451e7fef + languageName: node + linkType: hard + "os-shim@npm:^0.1.2": version: 0.1.3 resolution: "os-shim@npm:0.1.3" @@ -12156,7 +13315,7 @@ __metadata: languageName: node linkType: hard -"p-limit@npm:^2.2.0": +"p-limit@npm:^2.0.0, p-limit@npm:^2.2.0": version: 2.3.0 resolution: "p-limit@npm:2.3.0" dependencies: @@ -12183,15 +13342,6 @@ __metadata: languageName: node linkType: hard -"p-limit@npm:^6.1.0": - version: 6.1.0 - resolution: "p-limit@npm:6.1.0" - dependencies: - yocto-queue: "npm:^1.1.1" - checksum: 10/9670cb4426d77c20a477cad0e44e8207248381135650f5b9bfe039c9d93566cd4b05cfc557fe60f2db88c799991c7edc6be436255d287a87a605ee604a71cd91 - languageName: node - linkType: hard - "p-locate@npm:^2.0.0": version: 2.0.0 resolution: "p-locate@npm:2.0.0" @@ -12201,6 +13351,15 @@ __metadata: languageName: node linkType: hard +"p-locate@npm:^3.0.0": + version: 3.0.0 + resolution: "p-locate@npm:3.0.0" + dependencies: + p-limit: "npm:^2.0.0" + checksum: 10/83991734a9854a05fe9dbb29f707ea8a0599391f52daac32b86f08e21415e857ffa60f0e120bfe7ce0cc4faf9274a50239c7895fc0d0579d08411e513b83a4ae + languageName: node + linkType: hard + "p-locate@npm:^4.1.0": version: 4.1.0 resolution: "p-locate@npm:4.1.0" @@ -12246,7 +13405,7 @@ __metadata: languageName: node linkType: hard -"p-map@npm:^7.0.2": +"p-map@npm:^7.0.1, p-map@npm:^7.0.2": version: 7.0.2 resolution: "p-map@npm:7.0.2" checksum: 10/b4a590038b991c17b9c1484aa8c24cb9d3aa8a6167d02b9f9459c9200c7d392202a860c95b6dcd190d51f5f083ed256b32f9cb5976785022b0111bab853ec58b @@ -12329,30 +13488,31 @@ __metadata: languageName: node linkType: hard -"pacote@npm:^18.0.0, pacote@npm:^18.0.6": - version: 18.0.6 - resolution: "pacote@npm:18.0.6" +"pacote@npm:^17.0.0, pacote@npm:^17.0.4, pacote@npm:^17.0.6": + version: 17.0.6 + resolution: "pacote@npm:17.0.6" dependencies: "@npmcli/git": "npm:^5.0.0" "@npmcli/installed-package-contents": "npm:^2.0.1" - "@npmcli/package-json": "npm:^5.1.0" "@npmcli/promise-spawn": "npm:^7.0.0" - "@npmcli/run-script": "npm:^8.0.0" + "@npmcli/run-script": "npm:^7.0.0" cacache: "npm:^18.0.0" fs-minipass: "npm:^3.0.0" minipass: "npm:^7.0.2" npm-package-arg: "npm:^11.0.0" npm-packlist: "npm:^8.0.0" npm-pick-manifest: "npm:^9.0.0" - npm-registry-fetch: "npm:^17.0.0" - proc-log: "npm:^4.0.0" + npm-registry-fetch: "npm:^16.0.0" + proc-log: "npm:^3.0.0" promise-retry: "npm:^2.0.1" + read-package-json: "npm:^7.0.0" + read-package-json-fast: "npm:^3.0.0" sigstore: "npm:^2.2.0" ssri: "npm:^10.0.0" tar: "npm:^6.1.11" bin: - pacote: bin/index.js - checksum: 10/48cbcb3c20792952d431c995c2965340d3501e1795313d7225149435c883fb071d6a9bfbe11b1021dc888319f27a8c865cb70656f6472d7443545eb347447553 + pacote: lib/bin.js + checksum: 10/fe96b362623128c67b4974bc2d0e8721515927c3546f04e9f3b0df0fe93ab74a8ed59c2896dec3ad1ed5395a8e439b3b64007b32d31b4b86796b50c75dffc924 languageName: node linkType: hard @@ -12691,14 +13851,15 @@ __metadata: linkType: hard "prettier-plugin-solidity@npm:^1.3.1": - version: 1.4.1 - resolution: "prettier-plugin-solidity@npm:1.4.1" + version: 1.3.1 + resolution: "prettier-plugin-solidity@npm:1.3.1" dependencies: - "@solidity-parser/parser": "npm:^0.18.0" + "@solidity-parser/parser": "npm:^0.17.0" semver: "npm:^7.5.4" + solidity-comments-extractor: "npm:^0.0.8" peerDependencies: prettier: ">=2.3.0" - checksum: 10/8bd0b20cd1a0973bfdbb4e035d5dae9ff229a7f6475c4e31e99b85d74f77625c0a874835df23e51d36750139aa2e5c5d900a366d1cdff16edfe52b3550b7e2da + checksum: 10/45c1bf16ca960e43e8dc518db95a9eecfce941480e2737272ab259ea9dcb9796a7830a8884de21637f286f80f06d4b4163418d4d55e41347aee96ee93bc4e8f0 languageName: node linkType: hard @@ -12732,11 +13893,11 @@ __metadata: linkType: hard "prettier@npm:^3.2.5": - version: 3.3.3 - resolution: "prettier@npm:3.3.3" + version: 3.2.5 + resolution: "prettier@npm:3.2.5" bin: prettier: bin/prettier.cjs - checksum: 10/5beac1f30b5b40162532b8e2f7c3a4eb650910a2695e9c8512a62ffdc09dae93190c29db9107fa7f26d1b6c71aad3628ecb9b5de1ecb0911191099be109434d7 + checksum: 10/d509f9da0b70e8cacc561a1911c0d99ec75117faed27b95cc8534cb2349667dee6351b0ca83fa9d5703f14127faa52b798de40f5705f02d843da133fc3aa416a languageName: node linkType: hard @@ -12758,7 +13919,7 @@ __metadata: languageName: node linkType: hard -"proc-log@npm:^4.0.0, proc-log@npm:^4.1.0, proc-log@npm:^4.2.0": +"proc-log@npm:^4.0.0": version: 4.2.0 resolution: "proc-log@npm:4.2.0" checksum: 10/4e1394491b717f6c1ade15c570ecd4c2b681698474d3ae2d303c1e4b6ab9455bd5a81566211e82890d5a5ae9859718cc6954d5150bb18b09b72ecb297beae90a @@ -12781,10 +13942,10 @@ __metadata: languageName: node linkType: hard -"proggy@npm:^2.0.0": - version: 2.0.0 - resolution: "proggy@npm:2.0.0" - checksum: 10/9c96830d30516534c91e1260cae98d2c12aa32ea4ca7ff979876557ae293581c4874c95daf80497a7350179e7fec6d119cd589ef09af9c925f5842161897ed7e +"process@npm:^0.11.10": + version: 0.11.10 + resolution: "process@npm:0.11.10" + checksum: 10/dbaa7e8d1d5cf375c36963ff43116772a989ef2bb47c9bdee20f38fd8fc061119cf38140631cf90c781aca4d3f0f0d2c834711952b728953f04fd7d238f59f5b languageName: node linkType: hard @@ -12853,8 +14014,8 @@ __metadata: linkType: hard "protobufjs@npm:^6.10.2": - version: 6.11.4 - resolution: "protobufjs@npm:6.11.4" + version: 6.11.3 + resolution: "protobufjs@npm:6.11.3" dependencies: "@protobufjs/aspromise": "npm:^1.1.2" "@protobufjs/base64": "npm:^1.1.2" @@ -12872,7 +14033,7 @@ __metadata: bin: pbjs: bin/pbjs pbts: bin/pbts - checksum: 10/6b7fd7540d74350d65c38f69f398c9995ae019da070e79d9cd464a458c6d19b40b07c9a026be4e10704c824a344b603307745863310c50026ebd661ce4da0663 + checksum: 10/ab7efcdc4d2e43ffad92272cf8c7bed7b8abfa75b00d059024abe7af446e7151bf71c265347b06dc21136187682c86cd1214e1fcf057ed3fc8142c8a6c47b613 languageName: node linkType: hard @@ -12967,7 +14128,7 @@ __metadata: languageName: node linkType: hard -"queue-microtask@npm:^1.2.2": +"queue-microtask@npm:^1.2.2, queue-microtask@npm:^1.2.3": version: 1.2.3 resolution: "queue-microtask@npm:1.2.3" checksum: 10/72900df0616e473e824202113c3df6abae59150dfb73ed13273503127235320e9c8ca4aaaaccfd58cf417c6ca92a6e68ee9a5c3182886ae949a768639b388a7b @@ -13072,6 +14233,18 @@ __metadata: languageName: node linkType: hard +"read-package-json@npm:^7.0.0": + version: 7.0.0 + resolution: "read-package-json@npm:7.0.0" + dependencies: + glob: "npm:^10.2.2" + json-parse-even-better-errors: "npm:^3.0.0" + normalize-package-data: "npm:^6.0.0" + npm-normalize-package-bin: "npm:^3.0.0" + checksum: 10/b395d5330e9096cb533553e51c6dd123284a744e65c771fbd4d868ca600d2a61b867a4f10723e360608e839101fbe805448dd0079267b3232637ec8bb62bb080 + languageName: node + linkType: hard + "read-pkg-up@npm:^10.0.0": version: 10.1.0 resolution: "read-pkg-up@npm:10.1.0" @@ -13157,6 +14330,18 @@ __metadata: languageName: node linkType: hard +"readable-stream@npm:^4.1.0": + version: 4.4.0 + resolution: "readable-stream@npm:4.4.0" + dependencies: + abort-controller: "npm:^3.0.0" + buffer: "npm:^6.0.3" + events: "npm:^3.3.0" + process: "npm:^0.11.10" + checksum: 10/18e0af6f90fc16f43b14681c759a7a6fbed02d840026eecd6ac7e97bf59b959f0aa76a1fe2b57cd2c761c9c3e9bcd5384efa2d83615cc3b1cf4e05144b35c973 + languageName: node + linkType: hard + "readable-stream@npm:~1.0.26-4": version: 1.0.34 resolution: "readable-stream@npm:1.0.34" @@ -13178,6 +14363,15 @@ __metadata: languageName: node linkType: hard +"readdirp@npm:~3.2.0": + version: 3.2.0 + resolution: "readdirp@npm:3.2.0" + dependencies: + picomatch: "npm:^2.0.4" + checksum: 10/3efe893b62a2fac6a5c5b7a5ef7247a7894ed4cf21c1b7115fce6f61139da3b7fa8ae81d1ff9df035c6364175935163608f44efa23e3955c7074025396e9960e + languageName: node + linkType: hard + "receptacle@npm:^1.3.2": version: 1.3.2 resolution: "receptacle@npm:1.3.2" @@ -13231,6 +14425,17 @@ __metadata: languageName: node linkType: hard +"regexp.prototype.flags@npm:^1.5.1": + version: 1.5.1 + resolution: "regexp.prototype.flags@npm:1.5.1" + dependencies: + call-bind: "npm:^1.0.2" + define-properties: "npm:^1.2.0" + set-function-name: "npm:^2.0.0" + checksum: 10/3fa5610b8e411bbc3a43ddfd13162f3a817beb43155fbd8caa24d4fd0ce2f431a8197541808772a5a06e5946cebfb68464c827827115bde0d11720a92fe2981a + languageName: node + linkType: hard + "registry-auth-token@npm:^5.0.1": version: 5.0.2 resolution: "registry-auth-token@npm:5.0.2" @@ -13335,7 +14540,7 @@ __metadata: languageName: node linkType: hard -"require-from-string@npm:^2.0.2": +"require-from-string@npm:^2.0.0, require-from-string@npm:^2.0.2": version: 2.0.2 resolution: "require-from-string@npm:2.0.2" checksum: 10/839a3a890102a658f4cb3e7b2aa13a1f80a3a976b512020c3d1efc418491c48a886b6e481ea56afc6c4cb5eef678f23b2a4e70575e7534eccadf5e30ed2e56eb @@ -13525,7 +14730,7 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^2.6.3": +"rimraf@npm:^2.2.8, rimraf@npm:^2.6.3": version: 2.7.1 resolution: "rimraf@npm:2.7.1" dependencies: @@ -13568,6 +14773,22 @@ __metadata: languageName: node linkType: hard +"run-async@npm:^3.0.0": + version: 3.0.0 + resolution: "run-async@npm:3.0.0" + checksum: 10/97fb8747f7765b77ebcd311d3a33548099336f04c6434e0763039b98c1de0f1b4421000695aff8751f309c0b995d8dfd620c1f1e4c35572da38c101488165305 + languageName: node + linkType: hard + +"run-parallel-limit@npm:^1.1.0": + version: 1.1.0 + resolution: "run-parallel-limit@npm:1.1.0" + dependencies: + queue-microtask: "npm:^1.2.2" + checksum: 10/672c3b87e7f939c684b9965222b361421db0930223ed1e43ebf0e7e48ccc1a022ea4de080bef4d5468434e2577c33b7681e3f03b7593fdc49ad250a55381123c + languageName: node + linkType: hard + "run-parallel@npm:^1.1.9": version: 1.2.0 resolution: "run-parallel@npm:1.2.0" @@ -13577,6 +14798,34 @@ __metadata: languageName: node linkType: hard +"rustbn.js@npm:~0.2.0": + version: 0.2.0 + resolution: "rustbn.js@npm:0.2.0" + checksum: 10/2d7d09f6bea2b5fb05142724f5cfc65c8d96b6e57a29874060733d041789aabbd236617c05d8569a43a2997eea850b4323527e92368c46d04a671ef0b2319fe9 + languageName: node + linkType: hard + +"rxjs@npm:^7.8.1": + version: 7.8.1 + resolution: "rxjs@npm:7.8.1" + dependencies: + tslib: "npm:^2.1.0" + checksum: 10/b10cac1a5258f885e9dd1b70d23c34daeb21b61222ee735d2ec40a8685bdca40429000703a44f0e638c27a684ac139e1c37e835d2a0dc16f6fc061a138ae3abb + languageName: node + linkType: hard + +"safe-array-concat@npm:^1.0.0, safe-array-concat@npm:^1.0.1": + version: 1.0.1 + resolution: "safe-array-concat@npm:1.0.1" + dependencies: + call-bind: "npm:^1.0.2" + get-intrinsic: "npm:^1.2.1" + has-symbols: "npm:^1.0.3" + isarray: "npm:^2.0.5" + checksum: 10/44f073d85ca12458138e6eff103ac63cec619c8261b6579bd2fa3ae7b6516cf153f02596d68e40c5bbe322a29c930017800efff652734ddcb8c0f33b2a71f89c + languageName: node + linkType: hard + "safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.0, safe-buffer@npm:^5.1.1, safe-buffer@npm:^5.1.2, safe-buffer@npm:^5.2.0, safe-buffer@npm:~5.2.0": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" @@ -13591,6 +14840,17 @@ __metadata: languageName: node linkType: hard +"safe-regex-test@npm:^1.0.0": + version: 1.0.0 + resolution: "safe-regex-test@npm:1.0.0" + dependencies: + call-bind: "npm:^1.0.2" + get-intrinsic: "npm:^1.1.3" + is-regex: "npm:^1.1.4" + checksum: 10/c7248dfa07891aa634c8b9c55da696e246f8589ca50e7fd14b22b154a106e83209ddf061baf2fa45ebfbd485b094dc7297325acfc50724de6afe7138451b42a9 + languageName: node + linkType: hard + "safer-buffer@npm:>= 2.1.2 < 3, safer-buffer@npm:>= 2.1.2 < 3.0.0, safer-buffer@npm:^2.0.2, safer-buffer@npm:^2.1.0, safer-buffer@npm:~2.1.0": version: 2.1.2 resolution: "safer-buffer@npm:2.1.2" @@ -13655,7 +14915,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:2 || 3 || 4 || 5, semver@npm:^5.5.0": +"semver@npm:2 || 3 || 4 || 5, semver@npm:^5.5.0, semver@npm:^5.7.0": version: 5.7.2 resolution: "semver@npm:5.7.2" bin: @@ -13664,7 +14924,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:7.3.5, semver@npm:7.4.0, semver@npm:^7.0.0, semver@npm:^7.1.1, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.2, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.3": +"semver@npm:7.3.5, semver@npm:^7.0.0, semver@npm:^7.1.1, semver@npm:^7.3.4, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.2, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0, semver@npm:^7.6.3": version: 7.6.3 resolution: "semver@npm:7.6.3" bin: @@ -13673,6 +14933,17 @@ __metadata: languageName: node linkType: hard +"semver@npm:7.4.0": + version: 7.4.0 + resolution: "semver@npm:7.4.0" + dependencies: + lru-cache: "npm:^6.0.0" + bin: + semver: bin/semver.js + checksum: 10/f75986344d4d68a8441c95932fa19b00b01aed64f13757d9a7bc7c7e4951f31c69f93b95e5c58e012bf23a87920ed5d015fc0b4acb6455317b42c9f55e6bbf7e + languageName: node + linkType: hard + "semver@npm:^6.0.0, semver@npm:^6.3.0, semver@npm:^6.3.1": version: 6.3.1 resolution: "semver@npm:6.3.1" @@ -13712,6 +14983,17 @@ __metadata: languageName: node linkType: hard +"set-function-name@npm:^2.0.0": + version: 2.0.1 + resolution: "set-function-name@npm:2.0.1" + dependencies: + define-data-property: "npm:^1.0.1" + functions-have-names: "npm:^1.2.3" + has-property-descriptors: "npm:^1.0.0" + checksum: 10/4975d17d90c40168eee2c7c9c59d023429f0a1690a89d75656306481ece0c3c1fb1ebcc0150ea546d1913e35fbd037bace91372c69e543e51fc5d1f31a9fa126 + languageName: node + linkType: hard + "setimmediate@npm:1.0.4": version: 1.0.4 resolution: "setimmediate@npm:1.0.4" @@ -13856,16 +15138,16 @@ __metadata: linkType: hard "sinon@npm:^18.0.0": - version: 18.0.1 - resolution: "sinon@npm:18.0.1" + version: 18.0.0 + resolution: "sinon@npm:18.0.0" dependencies: "@sinonjs/commons": "npm:^3.0.1" - "@sinonjs/fake-timers": "npm:11.2.2" + "@sinonjs/fake-timers": "npm:^11.2.2" "@sinonjs/samsam": "npm:^8.0.0" diff: "npm:^5.2.0" nise: "npm:^6.0.0" supports-color: "npm:^7" - checksum: 10/65be65a7c5dbef7e9e315820bcd17fe0387fb07cb5dd41d3d6a89177e9a2ca463144676d8407348dc075758daa7cf37b9376d35bd1bc7e06717e87d03aa26111 + checksum: 10/4c491798e2b7bb0e60357eb19820956229fb4356af7b00498f7a30dcbfe186597c816c331d8acd1771cb32510adde7657eeee0172fbd0baecdbb00e1d8c6806f languageName: node linkType: hard @@ -13960,26 +15242,28 @@ __metadata: languageName: node linkType: hard -"solc@npm:0.8.21": - version: 0.8.21 - resolution: "solc@npm:0.8.21" +"solc@npm:0.7.3": + version: 0.7.3 + resolution: "solc@npm:0.7.3" dependencies: command-exists: "npm:^1.2.8" - commander: "npm:^8.1.0" + commander: "npm:3.0.2" follow-redirects: "npm:^1.12.1" + fs-extra: "npm:^0.30.0" js-sha3: "npm:0.8.0" memorystream: "npm:^0.3.1" + require-from-string: "npm:^2.0.0" semver: "npm:^5.5.0" tmp: "npm:0.0.33" bin: - solcjs: solc.js - checksum: 10/e050323d171e38969b159567b0635ee9f58285f89e477a1650008e91b7c4ea176c3ad6d984e568ec4046fed0ff63d93b148ea53fa8177fe294278fea41af55a9 + solcjs: solcjs + checksum: 10/68bb783765d1aacf6ebe151ddbffff4c17f679046f2f83a2abae99c57cc0e7dbbcebd62b31861892df18fde272697c37c7a7518f1a9b1219de80217f0c780f0b languageName: node linkType: hard -"solc@npm:0.8.26": - version: 0.8.26 - resolution: "solc@npm:0.8.26" +"solc@npm:0.8.21": + version: 0.8.21 + resolution: "solc@npm:0.8.21" dependencies: command-exists: "npm:^1.2.8" commander: "npm:^8.1.0" @@ -13990,7 +15274,7 @@ __metadata: tmp: "npm:0.0.33" bin: solcjs: solc.js - checksum: 10/30ef9c2687f727eb5bdd685c77b1a0b354e7d6ba7a080cfcdce5a89f25a1399ff7949fecef47768088d825588da230da0044b46f056fc36f3959c0e3d3c9a82b + checksum: 10/e050323d171e38969b159567b0635ee9f58285f89e477a1650008e91b7c4ea176c3ad6d984e568ec4046fed0ff63d93b148ea53fa8177fe294278fea41af55a9 languageName: node linkType: hard @@ -14045,9 +15329,11 @@ __metadata: linkType: hard "solidity-ast@npm:^0.4.38, solidity-ast@npm:^0.4.55": - version: 0.4.58 - resolution: "solidity-ast@npm:0.4.58" - checksum: 10/f483278c428747a8b8da14d3428d9d158746236cd814b1f0bc7c669aece0ba092de3b6f11dbc56d9e6178fa940726ed30176232e3fe9b7317a071eb0133a28a9 + version: 0.4.55 + resolution: "solidity-ast@npm:0.4.55" + dependencies: + array.prototype.findlast: "npm:^1.2.2" + checksum: 10/fb9d5c358f8ca50f40b0f4568717e9a6c0b4bdade2bb711bea1d6d84c3f19e253550b5ba1be03da767c9cc3388b79649cadd86613d55ea0147fe7944fc6d0dae languageName: node linkType: hard @@ -14065,6 +15351,13 @@ __metadata: languageName: node linkType: hard +"solidity-comments-extractor@npm:^0.0.8": + version: 0.0.8 + resolution: "solidity-comments-extractor@npm:0.0.8" + checksum: 10/615d53c2e8f5e7a1ad26e4e7e3bdc8b7c7885420611fcd690864bb54a9af2813a93cf30bdede16273791bda16eebc7a4ce1379d458ac2d7834074eb4936dea70 + languageName: node + linkType: hard + "solidity-comments-freebsd-x64@npm:0.0.2": version: 0.0.2 resolution: "solidity-comments-freebsd-x64@npm:0.0.2" @@ -14161,8 +15454,8 @@ __metadata: linkType: hard "solidity-coverage@npm:^0.8.7": - version: 0.8.13 - resolution: "solidity-coverage@npm:0.8.13" + version: 0.8.7 + resolution: "solidity-coverage@npm:0.8.7" dependencies: "@ethersproject/abi": "npm:^5.0.9" "@solidity-parser/parser": "npm:^0.18.0" @@ -14174,7 +15467,7 @@ __metadata: global-modules: "npm:^2.0.0" globby: "npm:^10.0.1" jsonschema: "npm:^1.2.4" - lodash: "npm:^4.17.21" + lodash: "npm:^4.17.15" mocha: "npm:^10.2.0" node-emoji: "npm:^1.10.0" pify: "npm:^4.0.1" @@ -14187,7 +15480,7 @@ __metadata: hardhat: ^2.11.0 bin: solidity-coverage: plugins/bin.js - checksum: 10/c92e4c1356155e1445241fe0a004c14656517c29e7fec42cc76737dd91e555891861cd716bd5ebb08fbf004f479d2c1ea45bd6dca9350c1ead2ae72c1271f37a + checksum: 10/fe2034545874b33157f09cdec2ba4c9ad18b6a1491dfb817f8966f237cb3bb4b73a54c7fef600e782d806b37d03be648aa0bc8d30842278628e766384a450ef1 languageName: node linkType: hard @@ -14369,7 +15662,7 @@ __metadata: languageName: node linkType: hard -"ssri@npm:^10.0.0, ssri@npm:^10.0.6": +"ssri@npm:^10.0.0, ssri@npm:^10.0.5": version: 10.0.6 resolution: "ssri@npm:10.0.6" dependencies: @@ -14378,15 +15671,6 @@ __metadata: languageName: node linkType: hard -"ssri@npm:^11.0.0": - version: 11.0.0 - resolution: "ssri@npm:11.0.0" - dependencies: - minipass: "npm:^7.0.3" - checksum: 10/e2fb25d3b010586ed50a89a94dbe04a15ac3b7c60492031c8c6b22e5880dbc80ef9f8b1f7df928be7a8fbe198acef57811f0fb647394f698a4b870f43ac9fb5c - languageName: node - linkType: hard - "stable@npm:^0.1.8": version: 0.1.8 resolution: "stable@npm:0.1.8" @@ -14477,7 +15761,7 @@ __metadata: languageName: node linkType: hard -"string-width@npm:^2.1.1": +"string-width@npm:^1.0.2 || 2, string-width@npm:^2.1.1": version: 2.1.1 resolution: "string-width@npm:2.1.1" dependencies: @@ -14487,6 +15771,17 @@ __metadata: languageName: node linkType: hard +"string-width@npm:^3.0.0, string-width@npm:^3.1.0": + version: 3.1.0 + resolution: "string-width@npm:3.1.0" + dependencies: + emoji-regex: "npm:^7.0.1" + is-fullwidth-code-point: "npm:^2.0.0" + strip-ansi: "npm:^5.1.0" + checksum: 10/57f7ca73d201682816d573dc68bd4bb8e1dff8dc9fcf10470fdfc3474135c97175fec12ea6a159e67339b41e86963112355b64529489af6e7e70f94a7caf08b2 + languageName: node + linkType: hard + "string-width@npm:^5.0.1, string-width@npm:^5.1.2": version: 5.1.2 resolution: "string-width@npm:5.1.2" @@ -14509,6 +15804,39 @@ __metadata: languageName: node linkType: hard +"string.prototype.trim@npm:^1.2.8": + version: 1.2.8 + resolution: "string.prototype.trim@npm:1.2.8" + dependencies: + call-bind: "npm:^1.0.2" + define-properties: "npm:^1.2.0" + es-abstract: "npm:^1.22.1" + checksum: 10/9301f6cb2b6c44f069adde1b50f4048915985170a20a1d64cf7cb2dc53c5cd6b9525b92431f1257f894f94892d6c4ae19b5aa7f577c3589e7e51772dffc9d5a4 + languageName: node + linkType: hard + +"string.prototype.trimend@npm:^1.0.7": + version: 1.0.7 + resolution: "string.prototype.trimend@npm:1.0.7" + dependencies: + call-bind: "npm:^1.0.2" + define-properties: "npm:^1.2.0" + es-abstract: "npm:^1.22.1" + checksum: 10/3f0d3397ab9bd95cd98ae2fe0943bd3e7b63d333c2ab88f1875cf2e7c958c75dc3355f6fe19ee7c8fca28de6f39f2475e955e103821feb41299a2764a7463ffa + languageName: node + linkType: hard + +"string.prototype.trimstart@npm:^1.0.7": + version: 1.0.7 + resolution: "string.prototype.trimstart@npm:1.0.7" + dependencies: + call-bind: "npm:^1.0.2" + define-properties: "npm:^1.2.0" + es-abstract: "npm:^1.22.1" + checksum: 10/6e594d3a61b127d243b8be1312e9f78683abe452cfe0bcafa3e0dc62ad6f030ccfb64d87ed3086fb7cb540fda62442c164d237cc5cc4d53c6e3eb659c29a0aeb + languageName: node + linkType: hard + "string_decoder@npm:^1.1.1": version: 1.3.0 resolution: "string_decoder@npm:1.3.0" @@ -14552,7 +15880,7 @@ __metadata: languageName: node linkType: hard -"strip-ansi@npm:^5.2.0": +"strip-ansi@npm:^5.0.0, strip-ansi@npm:^5.1.0, strip-ansi@npm:^5.2.0": version: 5.2.0 resolution: "strip-ansi@npm:5.2.0" dependencies: @@ -14609,6 +15937,13 @@ __metadata: languageName: node linkType: hard +"strip-json-comments@npm:2.0.1, strip-json-comments@npm:~2.0.1": + version: 2.0.1 + resolution: "strip-json-comments@npm:2.0.1" + checksum: 10/1074ccb63270d32ca28edfb0a281c96b94dc679077828135141f27d52a5a398ef5e78bcf22809d23cadc2b81dfbe345eb5fd8699b385c8b1128907dec4a7d1e1 + languageName: node + linkType: hard + "strip-json-comments@npm:^3.1.1": version: 3.1.1 resolution: "strip-json-comments@npm:3.1.1" @@ -14616,13 +15951,6 @@ __metadata: languageName: node linkType: hard -"strip-json-comments@npm:~2.0.1": - version: 2.0.1 - resolution: "strip-json-comments@npm:2.0.1" - checksum: 10/1074ccb63270d32ca28edfb0a281c96b94dc679077828135141f27d52a5a398ef5e78bcf22809d23cadc2b81dfbe345eb5fd8699b385c8b1128907dec4a7d1e1 - languageName: node - linkType: hard - "strong-log-transformer@npm:^2.1.0": version: 2.1.0 resolution: "strong-log-transformer@npm:2.1.0" @@ -14636,6 +15964,15 @@ __metadata: languageName: node linkType: hard +"supports-color@npm:6.0.0": + version: 6.0.0 + resolution: "supports-color@npm:6.0.0" + dependencies: + has-flag: "npm:^3.0.0" + checksum: 10/bc443c8e01dc11dec4b12386a2bbd0e82c3108c6b4507076d7c21f70ffabbf539487d52d65fcc21628f5841efb8dbce117ed5d622d7f3023840fa3dc5ee303ba + languageName: node + linkType: hard + "supports-color@npm:^3.1.0": version: 3.2.3 resolution: "supports-color@npm:3.2.3" @@ -14797,7 +16134,7 @@ __metadata: languageName: node linkType: hard -"tar@npm:^6.1.0, tar@npm:^6.1.11, tar@npm:^6.1.2, tar@npm:^6.2.1": +"tar@npm:^6.1.0, tar@npm:^6.1.11, tar@npm:^6.1.2, tar@npm:^6.2.0": version: 6.2.1 resolution: "tar@npm:6.2.1" dependencies: @@ -14896,7 +16233,7 @@ __metadata: languageName: node linkType: hard -"tmp@npm:0.0.33": +"tmp@npm:0.0.33, tmp@npm:^0.0.33": version: 0.0.33 resolution: "tmp@npm:0.0.33" dependencies: @@ -15022,21 +16359,19 @@ __metadata: linkType: hard "ts-jest@npm:^29.1.2": - version: 29.2.5 - resolution: "ts-jest@npm:29.2.5" + version: 29.1.2 + resolution: "ts-jest@npm:29.1.2" dependencies: - bs-logger: "npm:^0.2.6" - ejs: "npm:^3.1.10" - fast-json-stable-stringify: "npm:^2.1.0" + bs-logger: "npm:0.x" + fast-json-stable-stringify: "npm:2.x" jest-util: "npm:^29.0.0" json5: "npm:^2.2.3" - lodash.memoize: "npm:^4.1.2" - make-error: "npm:^1.3.6" - semver: "npm:^7.6.3" - yargs-parser: "npm:^21.1.1" + lodash.memoize: "npm:4.x" + make-error: "npm:1.x" + semver: "npm:^7.5.3" + yargs-parser: "npm:^21.0.1" peerDependencies: "@babel/core": ">=7.0.0-beta.0 <8" - "@jest/transform": ^29.0.0 "@jest/types": ^29.0.0 babel-jest: ^29.0.0 jest: ^29.0.0 @@ -15044,8 +16379,6 @@ __metadata: peerDependenciesMeta: "@babel/core": optional: true - "@jest/transform": - optional: true "@jest/types": optional: true babel-jest: @@ -15054,7 +16387,7 @@ __metadata: optional: true bin: ts-jest: cli.js - checksum: 10/f89e562816861ec4510840a6b439be6145f688b999679328de8080dc8e66481325fc5879519b662163e33b7578f35243071c38beb761af34e5fe58e3e326a958 + checksum: 10/5e40e7b933a1f3aa0d304d3c53913d1a7125fc79cd44e22b332f6e25dfe13008ddc7ac647066bb4f914d76083f7e8949f0bc156d793c30f3419f4ffd8180968b languageName: node linkType: hard @@ -15103,7 +16436,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.0.0, tslib@npm:^2.3.1, tslib@npm:^2.4.0, tslib@npm:^2.5.0": +"tslib@npm:^2.0.0, tslib@npm:^2.1.0, tslib@npm:^2.3.1, tslib@npm:^2.4.0, tslib@npm:^2.5.0": version: 2.5.3 resolution: "tslib@npm:2.5.3" checksum: 10/d507e60ebe2480af4efc1655dfdb2762bb6ca57d76c4ba680375af801493648c2e97808bbd7e54691eb40e33a7e2e793cdef9c24ce6a8539b03cac8b26e09a61 @@ -15268,6 +16601,53 @@ __metadata: languageName: node linkType: hard +"typed-array-buffer@npm:^1.0.0": + version: 1.0.0 + resolution: "typed-array-buffer@npm:1.0.0" + dependencies: + call-bind: "npm:^1.0.2" + get-intrinsic: "npm:^1.2.1" + is-typed-array: "npm:^1.1.10" + checksum: 10/3e0281c79b2a40cd97fe715db803884301993f4e8c18e8d79d75fd18f796e8cd203310fec8c7fdb5e6c09bedf0af4f6ab8b75eb3d3a85da69328f28a80456bd3 + languageName: node + linkType: hard + +"typed-array-byte-length@npm:^1.0.0": + version: 1.0.0 + resolution: "typed-array-byte-length@npm:1.0.0" + dependencies: + call-bind: "npm:^1.0.2" + for-each: "npm:^0.3.3" + has-proto: "npm:^1.0.1" + is-typed-array: "npm:^1.1.10" + checksum: 10/6f376bf5d988f00f98ccee41fd551cafc389095a2a307c18fab30f29da7d1464fc3697139cf254cda98b4128bbcb114f4b557bbabdc6d9c2e5039c515b31decf + languageName: node + linkType: hard + +"typed-array-byte-offset@npm:^1.0.0": + version: 1.0.0 + resolution: "typed-array-byte-offset@npm:1.0.0" + dependencies: + available-typed-arrays: "npm:^1.0.5" + call-bind: "npm:^1.0.2" + for-each: "npm:^0.3.3" + has-proto: "npm:^1.0.1" + is-typed-array: "npm:^1.1.10" + checksum: 10/2d81747faae31ca79f6c597dc18e15ae3d5b7e97f7aaebce3b31f46feeb2a6c1d6c92b9a634d901c83731ffb7ec0b74d05c6ff56076f5ae39db0cd19b16a3f92 + languageName: node + linkType: hard + +"typed-array-length@npm:^1.0.4": + version: 1.0.4 + resolution: "typed-array-length@npm:1.0.4" + dependencies: + call-bind: "npm:^1.0.2" + for-each: "npm:^0.3.3" + is-typed-array: "npm:^1.1.9" + checksum: 10/0444658acc110b233176cb0b7689dcb828b0cfa099ab1d377da430e8553b6fdcdce882360b7ffe9ae085b6330e1d39383d7b2c61574d6cd8eef651d3e4a87822 + languageName: node + linkType: hard + "typedarray-to-buffer@npm:^3.1.5": version: 3.1.5 resolution: "typedarray-to-buffer@npm:3.1.5" @@ -15354,6 +16734,18 @@ __metadata: languageName: node linkType: hard +"unbox-primitive@npm:^1.0.2": + version: 1.0.2 + resolution: "unbox-primitive@npm:1.0.2" + dependencies: + call-bind: "npm:^1.0.2" + has-bigints: "npm:^1.0.2" + has-symbols: "npm:^1.0.3" + which-boxed-primitive: "npm:^1.0.2" + checksum: 10/06e1ee41c1095e37281cb71a975cb3350f7cb470a0665d2576f02cc9564f623bd90cfc0183693b8a7fdf2d242963dcc3010b509fa3ac683f540c765c0f3e7e43 + languageName: node + linkType: hard + "undici-types@npm:~5.26.4": version: 5.26.5 resolution: "undici-types@npm:5.26.5" @@ -15402,10 +16794,10 @@ __metadata: languageName: node linkType: hard -"universal-user-agent@npm:^7.0.0, universal-user-agent@npm:^7.0.2": - version: 7.0.2 - resolution: "universal-user-agent@npm:7.0.2" - checksum: 10/3f02cb6de0bb9fbaf379566bd0320d8e46af6e4358a2e88fce7e70687ed7b48b37f479d728bb22f4204a518e363f3038ac4841c033af1ee2253f6428a6c67e53 +"universal-user-agent@npm:^6.0.0": + version: 6.0.0 + resolution: "universal-user-agent@npm:6.0.0" + checksum: 10/5092bbc80dd0d583cef0b62c17df0043193b74f425112ea6c1f69bc5eda21eeec7a08d8c4f793a277eb2202ffe9b44bec852fa3faff971234cd209874d1b79ef languageName: node linkType: hard @@ -15504,15 +16896,6 @@ __metadata: languageName: node linkType: hard -"uuid@npm:^10.0.0": - version: 10.0.0 - resolution: "uuid@npm:10.0.0" - bin: - uuid: dist/bin/uuid - checksum: 10/35aa60614811a201ff90f8ca5e9ecb7076a75c3821e17f0f5ff72d44e36c2d35fcbc2ceee9c4ac7317f4cc41895da30e74f3885e30313bee48fda6338f250538 - languageName: node - linkType: hard - "uuid@npm:^3.3.2": version: 3.4.0 resolution: "uuid@npm:3.4.0" @@ -15531,6 +16914,15 @@ __metadata: languageName: node linkType: hard +"uuid@npm:^9.0.1": + version: 9.0.1 + resolution: "uuid@npm:9.0.1" + bin: + uuid: dist/bin/uuid + checksum: 10/9d0b6adb72b736e36f2b1b53da0d559125ba3e39d913b6072f6f033e0c87835b414f0836b45bcfaf2bdf698f92297fea1c3cc19b0b258bc182c9c43cc0fab9f2 + languageName: node + linkType: hard + "v8-compile-cache-lib@npm:^3.0.1": version: 3.0.1 resolution: "v8-compile-cache-lib@npm:3.0.1" @@ -15593,7 +16985,7 @@ __metadata: languageName: node linkType: hard -"viem@npm:^2.16.5, viem@npm:^2.9.31": +"viem@npm:^2.16.5": version: 2.21.1 resolution: "viem@npm:2.21.1" dependencies: @@ -15744,6 +17136,19 @@ __metadata: languageName: node linkType: hard +"which-boxed-primitive@npm:^1.0.2": + version: 1.0.2 + resolution: "which-boxed-primitive@npm:1.0.2" + dependencies: + is-bigint: "npm:^1.0.1" + is-boolean-object: "npm:^1.1.0" + is-number-object: "npm:^1.0.4" + is-string: "npm:^1.0.5" + is-symbol: "npm:^1.0.3" + checksum: 10/9c7ca7855255f25ac47f4ce8b59c4cc33629e713fd7a165c9d77a2bb47bf3d9655a5664660c70337a3221cf96742f3589fae15a3a33639908d33e29aa2941efb + languageName: node + linkType: hard + "which-module@npm:^2.0.0": version: 2.0.1 resolution: "which-module@npm:2.0.1" @@ -15751,6 +17156,19 @@ __metadata: languageName: node linkType: hard +"which-typed-array@npm:^1.1.11": + version: 1.1.11 + resolution: "which-typed-array@npm:1.1.11" + dependencies: + available-typed-arrays: "npm:^1.0.5" + call-bind: "npm:^1.0.2" + for-each: "npm:^0.3.3" + gopd: "npm:^1.0.1" + has-tostringtag: "npm:^1.0.0" + checksum: 10/bc9e8690e71d6c64893c9d88a7daca33af45918861003013faf77574a6a49cc6194d32ca7826e90de341d2f9ef3ac9e3acbe332a8ae73cadf07f59b9c6c6ecad + languageName: node + linkType: hard + "which@npm:1.2.x": version: 1.2.14 resolution: "which@npm:1.2.14" @@ -15762,25 +17180,25 @@ __metadata: languageName: node linkType: hard -"which@npm:2.0.2, which@npm:^2.0.1, which@npm:^2.0.2": - version: 2.0.2 - resolution: "which@npm:2.0.2" +"which@npm:1.3.1, which@npm:^1.1.1, which@npm:^1.2.14, which@npm:^1.2.9, which@npm:^1.3.1": + version: 1.3.1 + resolution: "which@npm:1.3.1" dependencies: isexe: "npm:^2.0.0" bin: - node-which: ./bin/node-which - checksum: 10/4782f8a1d6b8fc12c65e968fea49f59752bf6302dc43036c3bf87da718a80710f61a062516e9764c70008b487929a73546125570acea95c5b5dcc8ac3052c70f + which: ./bin/which + checksum: 10/549dcf1752f3ee7fbb64f5af2eead4b9a2f482108b7de3e85c781d6c26d8cf6a52d37cfbe0642a155fa6470483fe892661a859c03157f24c669cf115f3bbab5e languageName: node linkType: hard -"which@npm:^1.1.1, which@npm:^1.2.14, which@npm:^1.2.9, which@npm:^1.3.1": - version: 1.3.1 - resolution: "which@npm:1.3.1" +"which@npm:2.0.2, which@npm:^2.0.1, which@npm:^2.0.2": + version: 2.0.2 + resolution: "which@npm:2.0.2" dependencies: isexe: "npm:^2.0.0" bin: - which: ./bin/which - checksum: 10/549dcf1752f3ee7fbb64f5af2eead4b9a2f482108b7de3e85c781d6c26d8cf6a52d37cfbe0642a155fa6470483fe892661a859c03157f24c669cf115f3bbab5e + node-which: ./bin/node-which + checksum: 10/4782f8a1d6b8fc12c65e968fea49f59752bf6302dc43036c3bf87da718a80710f61a062516e9764c70008b487929a73546125570acea95c5b5dcc8ac3052c70f languageName: node linkType: hard @@ -15795,6 +17213,15 @@ __metadata: languageName: node linkType: hard +"wide-align@npm:1.1.3": + version: 1.1.3 + resolution: "wide-align@npm:1.1.3" + dependencies: + string-width: "npm:^1.0.2 || 2" + checksum: 10/187642e0bbaf36d7ef95e85fec9cabe281a29bebfbeb218024fedbef3f066374e99fbf8391a57f2e40612dca4fa460feeeeb526bb17de7d9d0654b6b4bd1be2e + languageName: node + linkType: hard + "wide-align@npm:^1.1.5": version: 1.1.5 resolution: "wide-align@npm:1.1.5" @@ -15855,6 +17282,17 @@ __metadata: languageName: node linkType: hard +"wrap-ansi@npm:^5.1.0": + version: 5.1.0 + resolution: "wrap-ansi@npm:5.1.0" + dependencies: + ansi-styles: "npm:^3.2.0" + string-width: "npm:^3.0.0" + strip-ansi: "npm:^5.0.0" + checksum: 10/f02bbbd13f40169f3d69b8c95126c1d2a340e6f149d04125527c3d501d74a304a434f4329a83bfdc3b9fdb82403e9ae0cdd7b83a99f0da0d5a7e544f6b709914 + languageName: node + linkType: hard + "wrap-ansi@npm:^6.2.0": version: 6.2.0 resolution: "wrap-ansi@npm:6.2.0" @@ -15895,7 +17333,7 @@ __metadata: languageName: node linkType: hard -"write-file-atomic@npm:^3.0.0": +"write-file-atomic@npm:^3.0.0, write-file-atomic@npm:^3.0.3": version: 3.0.3 resolution: "write-file-atomic@npm:3.0.3" dependencies: @@ -15927,6 +17365,18 @@ __metadata: languageName: node linkType: hard +"write-json-file@npm:^5.0.0": + version: 5.0.0 + resolution: "write-json-file@npm:5.0.0" + dependencies: + detect-indent: "npm:^7.0.0" + is-plain-obj: "npm:^4.0.0" + sort-keys: "npm:^5.0.0" + write-file-atomic: "npm:^3.0.3" + checksum: 10/6df0e8857c6ebe091cf8d23fa3405f004e7febf10307ad3d4da7b1ddfe1fa80e7cdd9832d3a554e253b6d3a6255d67b66f419cea0f8724abb25949be392eb23b + languageName: node + linkType: hard + "write-json-file@npm:^6.0.0": version: 6.0.0 resolution: "write-json-file@npm:6.0.0" @@ -15952,6 +17402,19 @@ __metadata: languageName: node linkType: hard +"write-pkg@npm:^6.0.1": + version: 6.0.1 + resolution: "write-pkg@npm:6.0.1" + dependencies: + deepmerge-ts: "npm:^5.1.0" + read-pkg: "npm:^8.1.0" + sort-keys: "npm:^5.0.0" + type-fest: "npm:^4.6.0" + write-json-file: "npm:^5.0.0" + checksum: 10/5f820dac69f9815f7d62c49c36734bec0c389792696a54a464da17034121d30b7333ca4628062b7ad095438174f444e90d673d01ed95e3421755d9fda6e681bd + languageName: node + linkType: hard + "ws@npm:7.4.6, ws@npm:^7.4.5, ws@npm:^7.4.6": version: 7.5.10 resolution: "ws@npm:7.5.10" @@ -15967,7 +17430,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:8.17.1, ws@npm:8.9.0": +"ws@npm:8.17.1": version: 8.18.0 resolution: "ws@npm:8.18.0" peerDependencies: @@ -15982,6 +17445,21 @@ __metadata: languageName: node linkType: hard +"ws@npm:8.9.0": + version: 8.9.0 + resolution: "ws@npm:8.9.0" + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + checksum: 10/be5289395cf4fd8376869e926b26064d6302c8b94a181d709957e754b25a5070789ba7405b35a33e511eec6c474647bea331a68024878510d08b12ce5aa75da8 + languageName: node + linkType: hard + "xhr2-cookies@npm:1.1.0": version: 1.1.0 resolution: "xhr2-cookies@npm:1.1.0" @@ -16063,6 +17541,16 @@ __metadata: languageName: node linkType: hard +"yargs-parser@npm:13.1.2, yargs-parser@npm:^13.1.2": + version: 13.1.2 + resolution: "yargs-parser@npm:13.1.2" + dependencies: + camelcase: "npm:^5.0.0" + decamelize: "npm:^1.2.0" + checksum: 10/89a84fbb32827832a1d34f596f5efe98027c398af731728304a920c2f9ba03071c694418723df16882ebb646ddb72a8fb1c9567552afcbc2f268e86c4faea5a8 + languageName: node + linkType: hard + "yargs-parser@npm:^18.1.2": version: 18.1.3 resolution: "yargs-parser@npm:18.1.3" @@ -16080,13 +17568,24 @@ __metadata: languageName: node linkType: hard -"yargs-parser@npm:^21.0.0, yargs-parser@npm:^21.1.1": +"yargs-parser@npm:^21.0.0, yargs-parser@npm:^21.0.1, yargs-parser@npm:^21.1.1": version: 21.1.1 resolution: "yargs-parser@npm:21.1.1" checksum: 10/9dc2c217ea3bf8d858041252d43e074f7166b53f3d010a8c711275e09cd3d62a002969a39858b92bbda2a6a63a585c7127014534a560b9c69ed2d923d113406e languageName: node linkType: hard +"yargs-unparser@npm:1.6.0": + version: 1.6.0 + resolution: "yargs-unparser@npm:1.6.0" + dependencies: + flat: "npm:^4.1.0" + lodash: "npm:^4.17.15" + yargs: "npm:^13.3.0" + checksum: 10/ca662bb94af53d816d47f2162f0a1d135783f09de9fd47645a5cb18dd25532b0b710432b680d2c065ff45de122ba4a96433c41595fa7bfcc08eb12e889db95c1 + languageName: node + linkType: hard + "yargs-unparser@npm:^2.0.0": version: 2.0.0 resolution: "yargs-unparser@npm:2.0.0" @@ -16099,6 +17598,24 @@ __metadata: languageName: node linkType: hard +"yargs@npm:13.3.2, yargs@npm:^13.3.0": + version: 13.3.2 + resolution: "yargs@npm:13.3.2" + dependencies: + cliui: "npm:^5.0.0" + find-up: "npm:^3.0.0" + get-caller-file: "npm:^2.0.1" + require-directory: "npm:^2.1.1" + require-main-filename: "npm:^2.0.0" + set-blocking: "npm:^2.0.0" + string-width: "npm:^3.0.0" + which-module: "npm:^2.0.0" + y18n: "npm:^4.0.0" + yargs-parser: "npm:^13.1.2" + checksum: 10/608ba2e62ac2c7c4572b9c6f7a2d3ef76e2deaad8c8082788ed29ae3ef33e9f68e087f07eb804ed5641de2bc4eab977405d3833b1d11ae8dbbaf5847584d96be + languageName: node + linkType: hard + "yargs@npm:^15.0.2": version: 15.4.1 resolution: "yargs@npm:15.4.1" @@ -16162,7 +17679,7 @@ __metadata: languageName: node linkType: hard -"yocto-queue@npm:^1.0.0, yocto-queue@npm:^1.1.1": +"yocto-queue@npm:^1.0.0": version: 1.1.1 resolution: "yocto-queue@npm:1.1.1" checksum: 10/f2e05b767ed3141e6372a80af9caa4715d60969227f38b1a4370d60bffe153c9c5b33a862905609afc9b375ec57cd40999810d20e5e10229a204e8bde7ef255c