Skip to content

Commit

Permalink
Merge branch 'master' into update-factory-to-latest
Browse files Browse the repository at this point in the history
  • Loading branch information
auryn-macmillan authored Sep 5, 2022
2 parents 04f704c + 9e7d8c9 commit 1199484
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions src/deployments.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"1": {
"metaGuard":{
"v1.0.0": "0xe2847462a574bfd43014d1c7BB6De5769C294691"
},
"optimisticGovernor": {
"v1.0.0": "0xC419A1dc987d7c34243f98d66211d356023F344E"
},
Expand Down Expand Up @@ -38,6 +41,9 @@
}
},
"4": {
"metaGuard":{
"v1.0.0": "0xe2847462a574bfd43014d1c7BB6De5769C294691"
},
"optimisticGovernor": {
"v1.0.0": "0x6Ff461b854F5349857c2Ad41e0f558C19953DF89"
},
Expand Down Expand Up @@ -108,6 +114,9 @@
}
},
"56": {
"metaGuard":{
"v1.0.0": "0xe2847462a574bfd43014d1c7BB6De5769C294691"
},
"realityETH": {
"v1.0.0": "0x72d453a685c27580acDFcF495830EB16B7E165f8"
},
Expand Down Expand Up @@ -139,6 +148,9 @@
}
},
"100": {
"metaGuard":{
"v1.0.0": "0xe2847462a574bfd43014d1c7BB6De5769C294691"
},
"realityETH": {
"v1.0.0": "0x72d453a685c27580acDFcF495830EB16B7E165f8"
},
Expand Down Expand Up @@ -171,6 +183,9 @@
}
},
"137": {
"metaGuard":{
"v1.0.0": "0xe2847462a574bfd43014d1c7BB6De5769C294691"
},
"optimisticGovernor": {
"v1.0.0": "0x59bC80BC7703f2573C0B31542828fFF993548994"
},
Expand Down Expand Up @@ -214,6 +229,9 @@
}
},
"80001": {
"metaGuard":{
"v1.0.0": "0xe2847462a574bfd43014d1c7BB6De5769C294691"
},
"tellor": {
"v1.0.1": "0xBCc265bDbc5a26D9279250b6e9CbD5527EEf4FAD"
},
Expand Down
24 changes: 24 additions & 0 deletions src/factory/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { ContractAddresses, KnownContracts } from "./types";
export const SUPPORTED_NETWORKS = [1, 4, 56, 100, 137, 31337, 80001];

const MasterCopyAddresses: Record<KnownContracts, string> = {
[KnownContracts.META_GUARD]: "0xe2847462a574bfd43014d1c7BB6De5769C294691",
[KnownContracts.REALITY_ETH]: "0x72d453a685c27580acDFcF495830EB16B7E165f8",
[KnownContracts.REALITY_ERC20]: "0x6f628F0c3A3Ff75c39CF310901f10d79692Ed889",
[KnownContracts.BRIDGE]: "0x457042756F2B1056487173003D27f37644C119f3",
Expand Down Expand Up @@ -63,6 +64,29 @@ export const CONTRACT_ADDRESSES: Record<
};

export const CONTRACT_ABIS: Record<KnownContracts, string[]> = {
[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)`,
Expand Down
3 changes: 3 additions & 0 deletions src/factory/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export enum KnownContracts {
META_GUARD = "metaGuard",
OPTIMISTIC_GOVERNOR = 'optimisticGovernor',
TELLOR = "tellor",
REALITY_ETH = "realityETH",
Expand All @@ -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";
Expand All @@ -30,6 +32,7 @@ type ROLES_MOD_VERSION = "v1.0.0";
type ContractMasterCopies<V extends string> = Record<V, string>;

export interface ContractAddresses {
metaGuard: ContractMasterCopies<META_GUARD_VERSION>;
optimisticGovernor: ContractMasterCopies<OPTIMISTIC_GOVERNOR_VERSION>;
tellor: ContractMasterCopies<TELLOR_VERSION>;
realityETH: ContractMasterCopies<REALITY_ETH_VERSION>;
Expand Down

0 comments on commit 1199484

Please sign in to comment.