Skip to content

Commit

Permalink
add integrity check errors to Roles ABI
Browse files Browse the repository at this point in the history
  • Loading branch information
jfschwarz committed Jan 8, 2024
1 parent 0fc02ae commit 0a54705
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 1 deletion.
113 changes: 113 additions & 0 deletions sdk/abi/RolesV2Integrity.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
[
{
"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": [
{
"components": [
{
"internalType": "uint8",
"name": "parent",
"type": "uint8"
},
{
"internalType": "enum ParameterType",
"name": "paramType",
"type": "ParameterType"
},
{
"internalType": "enum Operator",
"name": "operator",
"type": "Operator"
},
{
"internalType": "bytes",
"name": "compValue",
"type": "bytes"
}
],
"internalType": "struct ConditionFlat[]",
"name": "conditions",
"type": "tuple[]"
}
],
"name": "enforce",
"outputs": [],
"stateMutability": "pure",
"type": "function"
}
]
7 changes: 6 additions & 1 deletion sdk/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ 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 @@ -247,7 +248,11 @@ export const ContractAbis: Record<KnownContracts, any> = {
[KnownContracts.REALITY_ETH]: RealityEthAbi,
[KnownContracts.ROLES]: RolesV1Abi,
[KnownContracts.ROLES_V1]: RolesV1Abi,
[KnownContracts.ROLES_V2]: RolesV2Abi,
[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.SCOPE_GUARD]: ScopeGuardAbi,
[KnownContracts.TELLOR]: TellorAbi,
[KnownContracts.MULTISEND_ENCODER]: MultisendEncoderAbi,
Expand Down

0 comments on commit 0a54705

Please sign in to comment.