Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add integrity check errors to Roles ABI #149

Merged
merged 2 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>",
"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
Loading