diff --git a/README.md b/README.md index 47e08702..dae9eda4 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,7 @@ contract MyModule is Module { #### Guards +- **[Meta](https://github.com/cardstack/cardstack-meta-guard)** (developed by [Cardstack](https://twitter.com/cardstack)): This guard allows an avatar to have multiple checking processes by registering multiple guards to this meta guard. - **[Scope](https://github.com/gnosis/zodiac-guard-scope)** (developed by [Gnosis Guild](https://twitter.com/gnosisguild)): This guard allows an avatar to limit the scope of the addressable functions with which its owners can interact. This enables the avatar to define granular permissions for different control mechanisms. ## Support and Contributions diff --git a/src/deployments.json b/src/deployments.json index 0b78686c..8d9d0fcc 100644 --- a/src/deployments.json +++ b/src/deployments.json @@ -1,5 +1,8 @@ { "1": { + "metaGuard":{ + "v1.0.0": "0xe2847462a574bfd43014d1c7BB6De5769C294691" + }, "optimisticGovernor": { "v1.0.0": "0xC419A1dc987d7c34243f98d66211d356023F344E" }, @@ -38,6 +41,9 @@ } }, "4": { + "metaGuard":{ + "v1.0.0": "0xe2847462a574bfd43014d1c7BB6De5769C294691" + }, "optimisticGovernor": { "v1.0.0": "0x6Ff461b854F5349857c2Ad41e0f558C19953DF89" }, @@ -108,6 +114,9 @@ } }, "56": { + "metaGuard":{ + "v1.0.0": "0xe2847462a574bfd43014d1c7BB6De5769C294691" + }, "realityETH": { "v1.0.0": "0x72d453a685c27580acDFcF495830EB16B7E165f8" }, @@ -139,6 +148,9 @@ } }, "100": { + "metaGuard":{ + "v1.0.0": "0xe2847462a574bfd43014d1c7BB6De5769C294691" + }, "realityETH": { "v1.0.0": "0x72d453a685c27580acDFcF495830EB16B7E165f8" }, @@ -171,6 +183,9 @@ } }, "137": { + "metaGuard":{ + "v1.0.0": "0xe2847462a574bfd43014d1c7BB6De5769C294691" + }, "optimisticGovernor": { "v1.0.0": "0x59bC80BC7703f2573C0B31542828fFF993548994" }, @@ -214,6 +229,9 @@ } }, "80001": { + "metaGuard":{ + "v1.0.0": "0xe2847462a574bfd43014d1c7BB6De5769C294691" + }, "tellor": { "v1.0.1": "0xBCc265bDbc5a26D9279250b6e9CbD5527EEf4FAD" }, diff --git a/src/factory/constants.ts b/src/factory/constants.ts index 29ccda3a..b2337190 100644 --- a/src/factory/constants.ts +++ b/src/factory/constants.ts @@ -13,6 +13,7 @@ import { ContractAddresses, KnownContracts } from "./types"; export const SUPPORTED_NETWORKS = [1, 4, 56, 100, 137, 31337, 80001]; const MasterCopyAddresses: Record = { + [KnownContracts.META_GUARD]: "0xe2847462a574bfd43014d1c7BB6De5769C294691", [KnownContracts.REALITY_ETH]: "0x72d453a685c27580acDFcF495830EB16B7E165f8", [KnownContracts.REALITY_ERC20]: "0x6f628F0c3A3Ff75c39CF310901f10d79692Ed889", [KnownContracts.BRIDGE]: "0x457042756F2B1056487173003D27f37644C119f3", @@ -63,6 +64,29 @@ export const CONTRACT_ADDRESSES: Record< }; export const CONTRACT_ABIS: Record = { + [KnownContracts.META_GUARD]: [ + `function setUp(bytes memory initParams) public`, + `function setAvatar(address _avatar) public`, + `function setMaxGuard(uint256 _maxGuard) public`, + `function checkTransaction( + address to, + uint256 value, + bytes memory data, + Enum.Operation operation, + uint256 safeTxGas, + uint256 baseGas, + uint256 gasPrice, + address gasToken, + address payable refundReceiver, + bytes memory signatures, + address msgSender + ) external`, + `function checkAfterExecution(bytes32 txHash, bool success) external`, + `function removeGuard(address prevGuard, address guard) public`, + `function addGuard(address guard) public`, + `function isGuardAdded(address _guard) public`, + `function getAllGuards() external` + ], [KnownContracts.OPTIMISTIC_GOVERNOR]: [ `function setUp(bytes memory initParams) public`, `function initialized() public view returns (bool)`, diff --git a/src/factory/types.ts b/src/factory/types.ts index e300f43f..44a24168 100644 --- a/src/factory/types.ts +++ b/src/factory/types.ts @@ -1,4 +1,5 @@ export enum KnownContracts { + META_GUARD = "metaGuard", OPTIMISTIC_GOVERNOR = 'optimisticGovernor', TELLOR = "tellor", REALITY_ETH = "realityETH", @@ -14,6 +15,7 @@ export enum KnownContracts { ROLES = "roles", } +type META_GUARD_VERSION = "v1.0.0"; type OPTIMISTIC_GOVERNOR_VERSION = "v1.0.0"; type TELLOR_VERSION = "v1.0.1"; type REALITY_ETH_VERSION = "v1.0.0"; @@ -30,6 +32,7 @@ type ROLES_MOD_VERSION = "v1.0.0"; type ContractMasterCopies = Record; export interface ContractAddresses { + metaGuard: ContractMasterCopies; optimisticGovernor: ContractMasterCopies; tellor: ContractMasterCopies; realityETH: ContractMasterCopies;