Skip to content

Commit

Permalink
include Integrity errors directly in the ABI json
Browse files Browse the repository at this point in the history
this way also the exported contract factories will support decoding these errors
  • Loading branch information
jfschwarz authored and cristovaoth committed Jan 9, 2024
1 parent c5e9aba commit 4503d60
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 119 deletions.
76 changes: 76 additions & 0 deletions sdk/abi/RolesV2.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,80 @@
[
{
"inputs": [],
"name": "NotBFS",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "UnsuitableChildCount",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "UnsuitableChildTypeTree",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "UnsuitableCompValue",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "UnsuitableParameterType",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "UnsuitableParent",
"type": "error"
},
{
"inputs": [],
"name": "UnsuitableRootNode",
"type": "error"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "UnsupportedOperator",
"type": "error"
},
{
"inputs": [
{
Expand Down
113 changes: 0 additions & 113 deletions sdk/abi/RolesV2Integrity.json

This file was deleted.

7 changes: 1 addition & 6 deletions sdk/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import RealityErc20Abi from "./abi/RealityErc20.json";
import RealityEthAbi from "./abi/RealityEth.json";
import RolesV1Abi from "./abi/RolesV1.json";
import RolesV2Abi from "./abi/RolesV2.json";
import RolesV2IntegrityAbi from "./abi/RolesV2Integrity.json";
import ScopeGuardAbi from "./abi/ScopeGuard.json";
import TellorAbi from "./abi/Tellor.json";
import { KnownContracts } from "./factory/types";
Expand Down Expand Up @@ -248,11 +247,7 @@ export const ContractAbis: Record<KnownContracts, any> = {
[KnownContracts.REALITY_ETH]: RealityEthAbi,
[KnownContracts.ROLES]: RolesV1Abi,
[KnownContracts.ROLES_V1]: RolesV1Abi,
[KnownContracts.ROLES_V2]: [
...RolesV2Abi,
// we add the custom errors from the Integrity lib so integrity check errors can be decoded
RolesV2IntegrityAbi.filter((fragment) => fragment.type === "error"),
],
[KnownContracts.ROLES_V2]: RolesV2Abi, // we've manually added custom errors from Integrity.sol to the ABI in RolesV2.json
[KnownContracts.SCOPE_GUARD]: ScopeGuardAbi,
[KnownContracts.TELLOR]: TellorAbi,
[KnownContracts.MULTISEND_ENCODER]: MultisendEncoderAbi,
Expand Down

0 comments on commit 4503d60

Please sign in to comment.