From 6a3bea432c9377caf13c688246c7fe3d90d68eea Mon Sep 17 00:00:00 2001 From: PedroCailleret Date: Mon, 8 May 2023 16:17:32 -0300 Subject: [PATCH] Errors cleanup --- artifacts/contracts/DataTypes.sol/DataTypes.dbg.json | 2 +- .../contracts/EventAndErrors.sol/EventAndErrors.dbg.json | 2 +- artifacts/contracts/EventAndErrors.sol/EventAndErrors.json | 5 ----- artifacts/contracts/Reputation.sol/Reputation.dbg.json | 2 +- artifacts/contracts/lib/auth/Owned.sol/Owned.dbg.json | 2 +- .../lib/interfaces/IReputation.sol/IReputation.dbg.json | 2 +- .../contracts/lib/mock/mockToken.sol/MockToken.dbg.json | 2 +- artifacts/contracts/lib/tokens/ERC20.sol/ERC20.dbg.json | 2 +- .../lib/utils/MerkleProofLib.sol/MerkleProofLib.dbg.json | 2 +- .../contracts/lib/utils/Multicall.sol/Multicall.dbg.json | 2 +- .../lib/utils/ReentrancyGuard.sol/ReentrancyGuard.dbg.json | 2 +- .../lib/utils/SafeTransferLib.sol/SafeTransferLib.dbg.json | 2 +- artifacts/contracts/p2pix.sol/P2PIX.dbg.json | 2 +- artifacts/contracts/p2pix.sol/P2PIX.json | 5 ----- contracts/EventAndErrors.sol | 4 ---- contracts/p2pix.sol | 1 + src/types/factories/EventAndErrors__factory.ts | 5 ----- src/types/factories/p2pix.sol/P2PIX__factory.ts | 5 ----- test/utils/errors.ts | 1 - 19 files changed, 13 insertions(+), 37 deletions(-) diff --git a/artifacts/contracts/DataTypes.sol/DataTypes.dbg.json b/artifacts/contracts/DataTypes.sol/DataTypes.dbg.json index adb3dfd..66c6e2f 100644 --- a/artifacts/contracts/DataTypes.sol/DataTypes.dbg.json +++ b/artifacts/contracts/DataTypes.sol/DataTypes.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../build-info/901b067f80b6616939e558d795c555e5.json" + "buildInfo": "../../build-info/e4fd58ee172659ae7bbfbfbb00ad761b.json" } diff --git a/artifacts/contracts/EventAndErrors.sol/EventAndErrors.dbg.json b/artifacts/contracts/EventAndErrors.sol/EventAndErrors.dbg.json index adb3dfd..66c6e2f 100644 --- a/artifacts/contracts/EventAndErrors.sol/EventAndErrors.dbg.json +++ b/artifacts/contracts/EventAndErrors.sol/EventAndErrors.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../build-info/901b067f80b6616939e558d795c555e5.json" + "buildInfo": "../../build-info/e4fd58ee172659ae7bbfbfbb00ad761b.json" } diff --git a/artifacts/contracts/EventAndErrors.sol/EventAndErrors.json b/artifacts/contracts/EventAndErrors.sol/EventAndErrors.json index 4451430..93e033c 100644 --- a/artifacts/contracts/EventAndErrors.sol/EventAndErrors.json +++ b/artifacts/contracts/EventAndErrors.sol/EventAndErrors.json @@ -23,11 +23,6 @@ "name": "DecOverflow", "type": "error" }, - { - "inputs": [], - "name": "DepositAlreadyExists", - "type": "error" - }, { "inputs": [], "name": "EmptyPixTarget", diff --git a/artifacts/contracts/Reputation.sol/Reputation.dbg.json b/artifacts/contracts/Reputation.sol/Reputation.dbg.json index adb3dfd..66c6e2f 100644 --- a/artifacts/contracts/Reputation.sol/Reputation.dbg.json +++ b/artifacts/contracts/Reputation.sol/Reputation.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../build-info/901b067f80b6616939e558d795c555e5.json" + "buildInfo": "../../build-info/e4fd58ee172659ae7bbfbfbb00ad761b.json" } diff --git a/artifacts/contracts/lib/auth/Owned.sol/Owned.dbg.json b/artifacts/contracts/lib/auth/Owned.sol/Owned.dbg.json index 27e859a..60306b4 100644 --- a/artifacts/contracts/lib/auth/Owned.sol/Owned.dbg.json +++ b/artifacts/contracts/lib/auth/Owned.sol/Owned.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json" + "buildInfo": "../../../../build-info/e4fd58ee172659ae7bbfbfbb00ad761b.json" } diff --git a/artifacts/contracts/lib/interfaces/IReputation.sol/IReputation.dbg.json b/artifacts/contracts/lib/interfaces/IReputation.sol/IReputation.dbg.json index 27e859a..60306b4 100644 --- a/artifacts/contracts/lib/interfaces/IReputation.sol/IReputation.dbg.json +++ b/artifacts/contracts/lib/interfaces/IReputation.sol/IReputation.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json" + "buildInfo": "../../../../build-info/e4fd58ee172659ae7bbfbfbb00ad761b.json" } diff --git a/artifacts/contracts/lib/mock/mockToken.sol/MockToken.dbg.json b/artifacts/contracts/lib/mock/mockToken.sol/MockToken.dbg.json index 27e859a..60306b4 100644 --- a/artifacts/contracts/lib/mock/mockToken.sol/MockToken.dbg.json +++ b/artifacts/contracts/lib/mock/mockToken.sol/MockToken.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json" + "buildInfo": "../../../../build-info/e4fd58ee172659ae7bbfbfbb00ad761b.json" } diff --git a/artifacts/contracts/lib/tokens/ERC20.sol/ERC20.dbg.json b/artifacts/contracts/lib/tokens/ERC20.sol/ERC20.dbg.json index 27e859a..60306b4 100644 --- a/artifacts/contracts/lib/tokens/ERC20.sol/ERC20.dbg.json +++ b/artifacts/contracts/lib/tokens/ERC20.sol/ERC20.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json" + "buildInfo": "../../../../build-info/e4fd58ee172659ae7bbfbfbb00ad761b.json" } diff --git a/artifacts/contracts/lib/utils/MerkleProofLib.sol/MerkleProofLib.dbg.json b/artifacts/contracts/lib/utils/MerkleProofLib.sol/MerkleProofLib.dbg.json index 27e859a..60306b4 100644 --- a/artifacts/contracts/lib/utils/MerkleProofLib.sol/MerkleProofLib.dbg.json +++ b/artifacts/contracts/lib/utils/MerkleProofLib.sol/MerkleProofLib.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json" + "buildInfo": "../../../../build-info/e4fd58ee172659ae7bbfbfbb00ad761b.json" } diff --git a/artifacts/contracts/lib/utils/Multicall.sol/Multicall.dbg.json b/artifacts/contracts/lib/utils/Multicall.sol/Multicall.dbg.json index 27e859a..60306b4 100644 --- a/artifacts/contracts/lib/utils/Multicall.sol/Multicall.dbg.json +++ b/artifacts/contracts/lib/utils/Multicall.sol/Multicall.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json" + "buildInfo": "../../../../build-info/e4fd58ee172659ae7bbfbfbb00ad761b.json" } diff --git a/artifacts/contracts/lib/utils/ReentrancyGuard.sol/ReentrancyGuard.dbg.json b/artifacts/contracts/lib/utils/ReentrancyGuard.sol/ReentrancyGuard.dbg.json index 27e859a..60306b4 100644 --- a/artifacts/contracts/lib/utils/ReentrancyGuard.sol/ReentrancyGuard.dbg.json +++ b/artifacts/contracts/lib/utils/ReentrancyGuard.sol/ReentrancyGuard.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json" + "buildInfo": "../../../../build-info/e4fd58ee172659ae7bbfbfbb00ad761b.json" } diff --git a/artifacts/contracts/lib/utils/SafeTransferLib.sol/SafeTransferLib.dbg.json b/artifacts/contracts/lib/utils/SafeTransferLib.sol/SafeTransferLib.dbg.json index 27e859a..60306b4 100644 --- a/artifacts/contracts/lib/utils/SafeTransferLib.sol/SafeTransferLib.dbg.json +++ b/artifacts/contracts/lib/utils/SafeTransferLib.sol/SafeTransferLib.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../../../build-info/901b067f80b6616939e558d795c555e5.json" + "buildInfo": "../../../../build-info/e4fd58ee172659ae7bbfbfbb00ad761b.json" } diff --git a/artifacts/contracts/p2pix.sol/P2PIX.dbg.json b/artifacts/contracts/p2pix.sol/P2PIX.dbg.json index adb3dfd..66c6e2f 100644 --- a/artifacts/contracts/p2pix.sol/P2PIX.dbg.json +++ b/artifacts/contracts/p2pix.sol/P2PIX.dbg.json @@ -1,4 +1,4 @@ { "_format": "hh-sol-dbg-1", - "buildInfo": "../../build-info/901b067f80b6616939e558d795c555e5.json" + "buildInfo": "../../build-info/e4fd58ee172659ae7bbfbfbb00ad761b.json" } diff --git a/artifacts/contracts/p2pix.sol/P2PIX.json b/artifacts/contracts/p2pix.sol/P2PIX.json index 16419cd..d0712e6 100644 --- a/artifacts/contracts/p2pix.sol/P2PIX.json +++ b/artifacts/contracts/p2pix.sol/P2PIX.json @@ -54,11 +54,6 @@ "name": "DecOverflow", "type": "error" }, - { - "inputs": [], - "name": "DepositAlreadyExists", - "type": "error" - }, { "inputs": [], "name": "EmptyPixTarget", diff --git a/contracts/EventAndErrors.sol b/contracts/EventAndErrors.sol index a59062d..7f46f4c 100644 --- a/contracts/EventAndErrors.sol +++ b/contracts/EventAndErrors.sol @@ -54,9 +54,6 @@ interface EventAndErrors { /// ███ Errors ████████████████████████████████████████████████████████████ - /// @dev Deposit already exist and it is still valid. - /// @dev 0xc44bd765 - error DepositAlreadyExists(); /// @dev Only seller could call this function. /// @dev `msg.sender` and the seller differ. /// @dev 0x85d1f726 @@ -105,7 +102,6 @@ interface EventAndErrors { /// @dev Reverts on an expired lock. /// @dev 0xf6fafba0 error LockExpired(); - /// @dev 0xce3a3d37 error DecOverflow(); /// @dev 0xf3fb0eb9 diff --git a/contracts/p2pix.sol b/contracts/p2pix.sol index a74d21b..bd7ce23 100644 --- a/contracts/p2pix.sol +++ b/contracts/p2pix.sol @@ -654,6 +654,7 @@ contract P2PIX is _spendLimit := returnValue // reverts if call does not succeed. if iszero(success) { + // StaticCallFailed() mstore(0x00, 0xe10bf1cc) revert(0x1c, 0x04) } diff --git a/src/types/factories/EventAndErrors__factory.ts b/src/types/factories/EventAndErrors__factory.ts index a77dec2..135c160 100644 --- a/src/types/factories/EventAndErrors__factory.ts +++ b/src/types/factories/EventAndErrors__factory.ts @@ -30,11 +30,6 @@ const _abi = [ name: "DecOverflow", type: "error", }, - { - inputs: [], - name: "DepositAlreadyExists", - type: "error", - }, { inputs: [], name: "EmptyPixTarget", diff --git a/src/types/factories/p2pix.sol/P2PIX__factory.ts b/src/types/factories/p2pix.sol/P2PIX__factory.ts index 1e58e12..c73eb92 100644 --- a/src/types/factories/p2pix.sol/P2PIX__factory.ts +++ b/src/types/factories/p2pix.sol/P2PIX__factory.ts @@ -65,11 +65,6 @@ const _abi = [ name: "DecOverflow", type: "error", }, - { - inputs: [], - name: "DepositAlreadyExists", - type: "error", - }, { inputs: [], name: "EmptyPixTarget", diff --git a/test/utils/errors.ts b/test/utils/errors.ts index c2e3e98..310e7b9 100644 --- a/test/utils/errors.ts +++ b/test/utils/errors.ts @@ -1,5 +1,4 @@ export enum P2PixErrors { - DepositAlreadyExists = "DepositAlreadyExists", OnlySeller = "OnlySeller", NotExpired = "NotExpired", LoopOverflow = "LoopOverflow",