Skip to content

Commit

Permalink
Merge pull request #149 from gnosis/add-roles-integrity
Browse files Browse the repository at this point in the history
Add integrity check errors to Roles ABI
  • Loading branch information
jfschwarz authored Jan 8, 2024
2 parents 0fc02ae + 5be6e21 commit c5e9aba
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gnosis.pm/zodiac",
"version": "3.5.0",
"version": "3.5.1",
"description": "Zodiac is a composable design philosophy and collection of standards for building DAO ecosystem tooling.",
"author": "Auryn Macmillan <auryn.macmillan@gnosis.io>",
"license": "LGPL-3.0+",
Expand Down
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 c5e9aba

Please sign in to comment.