Skip to content

Commit

Permalink
refactor: custom errors for core contracts (#410)
Browse files Browse the repository at this point in the history
* refactor: custom errors for core contracts

* abi+binding

* Update BlockTracker.sol

* args in errors

* abi + binding
  • Loading branch information
shaspitz authored Sep 25, 2024
1 parent 0f32940 commit a170087
Show file tree
Hide file tree
Showing 22 changed files with 618 additions and 104 deletions.
122 changes: 122 additions & 0 deletions contracts-abi/abi/BidderRegistry.abi
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,32 @@
}
]
},
{
"type": "error",
"name": "BidNotPreConfirmed",
"inputs": [
{
"name": "bidID",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "actualState",
"type": "uint8",
"internalType": "enum IBidderRegistry.State"
},
{
"name": "expectedState",
"type": "uint8",
"internalType": "enum IBidderRegistry.State"
}
]
},
{
"type": "error",
"name": "BidderAmountIsZero",
"inputs": []
},
{
"type": "error",
"name": "ERC1967InvalidImplementation",
Expand Down Expand Up @@ -1035,6 +1061,22 @@
"name": "NotInitializing",
"inputs": []
},
{
"type": "error",
"name": "OnlyBidderCanWithdraw",
"inputs": [
{
"name": "sender",
"type": "address",
"internalType": "address"
},
{
"name": "bidder",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "error",
"name": "OwnableInvalidOwner",
Expand All @@ -1057,11 +1099,70 @@
}
]
},
{
"type": "error",
"name": "ProviderAmountIsZero",
"inputs": [
{
"name": "provider",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "error",
"name": "ReentrancyGuardReentrantCall",
"inputs": []
},
{
"type": "error",
"name": "SenderIsNotPreconfManager",
"inputs": [
{
"name": "sender",
"type": "address",
"internalType": "address"
},
{
"name": "preconfManager",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "error",
"name": "TransferToBidderFailed",
"inputs": [
{
"name": "bidder",
"type": "address",
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"type": "error",
"name": "TransferToProviderFailed",
"inputs": [
{
"name": "provider",
"type": "address",
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"type": "error",
"name": "UUPSUnauthorizedCallContext",
Expand All @@ -1077,5 +1178,26 @@
"internalType": "bytes32"
}
]
},
{
"type": "error",
"name": "WindowNotSettled",
"inputs": []
},
{
"type": "error",
"name": "WithdrawAfterWindowSettled",
"inputs": [
{
"name": "window",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "currentWindow",
"type": "uint256",
"internalType": "uint256"
}
]
}
]
33 changes: 32 additions & 1 deletion contracts-abi/abi/BlockTracker.abi
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"name": "getBuilder",
"inputs": [
{
"name": "builderNameGrafiti",
"name": "builderNameGraffiti",
"type": "string",
"internalType": "string"
}
Expand Down Expand Up @@ -507,6 +507,11 @@
}
]
},
{
"type": "error",
"name": "BlockNumberIsZero",
"inputs": []
},
{
"type": "error",
"name": "ERC1967InvalidImplementation",
Expand Down Expand Up @@ -538,16 +543,42 @@
"name": "FailedInnerCall",
"inputs": []
},
{
"type": "error",
"name": "InvalidFallback",
"inputs": []
},
{
"type": "error",
"name": "InvalidInitialization",
"inputs": []
},
{
"type": "error",
"name": "InvalidReceive",
"inputs": []
},
{
"type": "error",
"name": "NotInitializing",
"inputs": []
},
{
"type": "error",
"name": "NotOracleAccount",
"inputs": [
{
"name": "sender",
"type": "address",
"internalType": "address"
},
{
"name": "oracleAccount",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "error",
"name": "OwnableInvalidOwner",
Expand Down
53 changes: 53 additions & 0 deletions contracts-abi/abi/Oracle.abi
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,22 @@
}
]
},
{
"type": "error",
"name": "BuilderNotBlockWinner",
"inputs": [
{
"name": "blockWinner",
"type": "address",
"internalType": "address"
},
{
"name": "builder",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "error",
"name": "ERC1967InvalidImplementation",
Expand Down Expand Up @@ -464,16 +480,42 @@
"name": "FailedInnerCall",
"inputs": []
},
{
"type": "error",
"name": "InvalidFallback",
"inputs": []
},
{
"type": "error",
"name": "InvalidInitialization",
"inputs": []
},
{
"type": "error",
"name": "InvalidReceive",
"inputs": []
},
{
"type": "error",
"name": "NotInitializing",
"inputs": []
},
{
"type": "error",
"name": "NotOracleAccount",
"inputs": [
{
"name": "sender",
"type": "address",
"internalType": "address"
},
{
"name": "oracleAccount",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "error",
"name": "OwnableInvalidOwner",
Expand All @@ -496,6 +538,17 @@
}
]
},
{
"type": "error",
"name": "ResidualBidPercentAfterDecayExceeds100",
"inputs": [
{
"name": "residualBidPercentAfterDecay",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"type": "error",
"name": "UUPSUnauthorizedCallContext",
Expand Down
37 changes: 37 additions & 0 deletions contracts-abi/abi/PreconfManager.abi
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,17 @@
}
]
},
{
"type": "error",
"name": "CommitmentAlreadySettled",
"inputs": [
{
"name": "commitmentIndex",
"type": "bytes32",
"internalType": "bytes32"
}
]
},
{
"type": "error",
"name": "ERC1967InvalidImplementation",
Expand Down Expand Up @@ -1652,11 +1663,21 @@
}
]
},
{
"type": "error",
"name": "InvalidFallback",
"inputs": []
},
{
"type": "error",
"name": "InvalidInitialization",
"inputs": []
},
{
"type": "error",
"name": "InvalidReceive",
"inputs": []
},
{
"type": "error",
"name": "NotInitializing",
Expand Down Expand Up @@ -1700,6 +1721,22 @@
}
]
},
{
"type": "error",
"name": "SenderIsNotOracleContract",
"inputs": [
{
"name": "sender",
"type": "address",
"internalType": "address"
},
{
"name": "oracleContract",
"type": "address",
"internalType": "address"
}
]
},
{
"type": "error",
"name": "UUPSUnauthorizedCallContext",
Expand Down
Loading

0 comments on commit a170087

Please sign in to comment.