From 0a547053bf4f3c6b929f7f467b8f6f53ecd9d44f Mon Sep 17 00:00:00 2001 From: Jan-Felix Date: Mon, 8 Jan 2024 17:18:48 +0100 Subject: [PATCH 1/2] add integrity check errors to Roles ABI --- sdk/abi/RolesV2Integrity.json | 113 ++++++++++++++++++++++++++++++++++ sdk/contracts.ts | 7 ++- 2 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 sdk/abi/RolesV2Integrity.json diff --git a/sdk/abi/RolesV2Integrity.json b/sdk/abi/RolesV2Integrity.json new file mode 100644 index 00000000..0de4fe88 --- /dev/null +++ b/sdk/abi/RolesV2Integrity.json @@ -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" + } +] \ No newline at end of file diff --git a/sdk/contracts.ts b/sdk/contracts.ts index d0389c26..4f3d3a54 100644 --- a/sdk/contracts.ts +++ b/sdk/contracts.ts @@ -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"; @@ -247,7 +248,11 @@ export const ContractAbis: Record = { [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, From 5be6e212e8dfd6244210b60765d98638add4b809 Mon Sep 17 00:00:00 2001 From: Jan-Felix Date: Mon, 8 Jan 2024 17:32:47 +0100 Subject: [PATCH 2/2] bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index dd85000c..85f8d911 100644 --- a/package.json +++ b/package.json @@ -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 ", "license": "LGPL-3.0+",