diff --git a/contracts/utils/Panic.sol b/contracts/utils/Panic.sol index a24dc6245..b6443035c 100644 --- a/contracts/utils/Panic.sol +++ b/contracts/utils/Panic.sol @@ -47,9 +47,9 @@ library Panic { function panic(uint256 code) internal pure { /// @solidity memory-safe-assembly assembly { - mstore(0x00, shl(0xe0, 0x4e487b71)) - mstore(0x04, code) - revert(0x00, 0x24) + mstore(0x00, 0x4e487b71) + mstore(0x20, code) + revert(0x1c, 0x24) } } } diff --git a/package-lock.json b/package-lock.json index 59aeaf2a8..ba0492608 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@changesets/cli": "^2.26.0", "@changesets/pre": "^2.0.0", "@changesets/read": "^0.6.0", - "@nomicfoundation/hardhat-chai-matchers": "^2.0.3", + "@nomicfoundation/hardhat-chai-matchers": "^2.0.6", "@nomicfoundation/hardhat-ethers": "^3.0.4", "@nomicfoundation/hardhat-network-helpers": "^1.0.3", "@openzeppelin/docs-utils": "^0.1.5", @@ -2080,9 +2080,9 @@ } }, "node_modules/@nomicfoundation/hardhat-chai-matchers": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-2.0.3.tgz", - "integrity": "sha512-A40s7EAK4Acr8UP1Yudgi9GGD9Cca/K3LHt3DzmRIje14lBfHtg9atGQ7qK56vdPcTwKmeaGn30FzxMUfPGEMw==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-2.0.6.tgz", + "integrity": "sha512-Te1Uyo9oJcTCF0Jy9dztaLpshmlpjLf2yPtWXlXuLjMt3RRSmJLm/+rKVTW6gfadAEs12U/it6D0ZRnnRGiICQ==", "dev": true, "dependencies": { "@types/chai-as-promised": "^7.1.3", diff --git a/package.json b/package.json index ff4f03ade..049af1183 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@changesets/cli": "^2.26.0", "@changesets/pre": "^2.0.0", "@changesets/read": "^0.6.0", - "@nomicfoundation/hardhat-chai-matchers": "^2.0.3", + "@nomicfoundation/hardhat-chai-matchers": "^2.0.6", "@nomicfoundation/hardhat-ethers": "^3.0.4", "@nomicfoundation/hardhat-network-helpers": "^1.0.3", "@openzeppelin/docs-utils": "^0.1.5", diff --git a/test/utils/Panic.test.js b/test/utils/Panic.test.js index cdd492601..49673c751 100644 --- a/test/utils/Panic.test.js +++ b/test/utils/Panic.test.js @@ -15,7 +15,7 @@ describe('Panic', function () { for (const [name, code] of Object.entries({ GENERIC: 0x0, ASSERT: PANIC_CODES.ASSERTION_ERROR, - UNDER_OVERFLOW: PANIC_CODES.ARITHMETIC_UNDER_OR_OVERFLOW, + UNDER_OVERFLOW: PANIC_CODES.ARITHMETIC_OVERFLOW, DIVISION_BY_ZERO: PANIC_CODES.DIVISION_BY_ZERO, ENUM_CONVERSION_ERROR: PANIC_CODES.ENUM_CONVERSION_OUT_OF_BOUNDS, STORAGE_ENCODING_ERROR: PANIC_CODES.INCORRECTLY_ENCODED_STORAGE_BYTE_ARRAY,