From fac82b6186626d3a7d3f3c4dfbed58f0c9e87ffb Mon Sep 17 00:00:00 2001
From: Piotr Roslaniec
Date: Fri, 6 Oct 2023 13:23:28 +0200
Subject: [PATCH] feat(allowlist): register encrypters in the ritual allowlist
---
packages/pre/src/characters/bob.ts | 4 +-
packages/pre/src/cohort.ts | 4 +-
packages/pre/src/kits/retrieval.ts | 2 +-
packages/pre/src/policy.ts | 3 +-
packages/shared/abis/GlobalAllowList.json | 522 ++++++++++
.../src/contracts/agents/global-allow-list.ts | 41 +
packages/shared/src/contracts/agents/index.ts | 1 +
.../ethers-typechain/GlobalAllowList.ts | 976 ++++++++++++++++++
.../factories/GlobalAllowList__factory.ts | 546 ++++++++++
.../ethers-typechain/factories/index.ts | 1 +
.../src/contracts/ethers-typechain/index.ts | 2 +
packages/shared/src/contracts/registry.ts | 9 +-
packages/shared/src/index.ts | 2 +-
packages/shared/src/types.ts | 2 +-
packages/shared/src/web3.ts | 2 +-
packages/taco/src/conditions/const.ts | 2 +-
packages/taco/src/taco.ts | 22 +-
packages/test-utils/src/utils.ts | 8 +-
18 files changed, 2133 insertions(+), 16 deletions(-)
create mode 100644 packages/shared/abis/GlobalAllowList.json
create mode 100644 packages/shared/src/contracts/agents/global-allow-list.ts
create mode 100644 packages/shared/src/contracts/ethers-typechain/GlobalAllowList.ts
create mode 100644 packages/shared/src/contracts/ethers-typechain/factories/GlobalAllowList__factory.ts
diff --git a/packages/pre/src/characters/bob.ts b/packages/pre/src/characters/bob.ts
index 6fac22ba7..6db7dabba 100644
--- a/packages/pre/src/characters/bob.ts
+++ b/packages/pre/src/characters/bob.ts
@@ -5,7 +5,7 @@ import {
SecretKey,
Signer,
} from '@nucypher/nucypher-core';
-import { PorterClient, zip } from '@nucypher/shared';
+import { ChecksumAddress, PorterClient, zip } from '@nucypher/shared';
import { Keyring } from '../keyring';
import { PolicyMessageKit, RetrievalResult } from '../kits';
@@ -128,7 +128,7 @@ export class Bob {
return zip(policyMessageKits, retrieveCFragsResponses).map((pair) => {
const [messageKit, { cFrags, errors }] = pair;
const vcFrags = Object.keys(cFrags).map((address) => {
- const verified = cFrags[address].verify(
+ const verified = cFrags[address as ChecksumAddress].verify(
messageKit.capsule,
publisherVerifyingKey,
policyEncryptingKey,
diff --git a/packages/pre/src/cohort.ts b/packages/pre/src/cohort.ts
index 43e820f8b..fecad583a 100644
--- a/packages/pre/src/cohort.ts
+++ b/packages/pre/src/cohort.ts
@@ -14,8 +14,8 @@ export class Cohort {
public static async create(
porterUri: string,
numUrsulas: number,
- include: string[] = [],
- exclude: string[] = [],
+ include: ChecksumAddress[] = [],
+ exclude: ChecksumAddress[] = [],
) {
const porter = new PorterClient(porterUri);
const ursulas = await porter.getUrsulas(numUrsulas, exclude, include);
diff --git a/packages/pre/src/kits/retrieval.ts b/packages/pre/src/kits/retrieval.ts
index ad5f333e2..cae7ad4ea 100644
--- a/packages/pre/src/kits/retrieval.ts
+++ b/packages/pre/src/kits/retrieval.ts
@@ -12,7 +12,7 @@ export class RetrievalResult {
}
public get addresses(): readonly ChecksumAddress[] {
- return Object.keys(this.cFrags);
+ return Object.keys(this.cFrags) as ChecksumAddress[];
}
public withResult(result: RetrievalResult): RetrievalResult {
diff --git a/packages/pre/src/policy.ts b/packages/pre/src/policy.ts
index 9ce220154..f5447ff31 100644
--- a/packages/pre/src/policy.ts
+++ b/packages/pre/src/policy.ts
@@ -7,6 +7,7 @@ import {
VerifiedKeyFrag,
} from '@nucypher/nucypher-core';
import {
+ ChecksumAddress,
PreSubscriptionManagerAgent,
toBytes,
toCanonicalAddress,
@@ -76,7 +77,7 @@ export class PreEnactedPolicy implements IPreEnactedPolicy {
this.size,
startTimestamp,
endTimestamp,
- ownerAddress,
+ ownerAddress as ChecksumAddress,
);
return tx.hash;
}
diff --git a/packages/shared/abis/GlobalAllowList.json b/packages/shared/abis/GlobalAllowList.json
new file mode 100644
index 000000000..414fb653f
--- /dev/null
+++ b/packages/shared/abis/GlobalAllowList.json
@@ -0,0 +1,522 @@
+[
+ {
+ "inputs": [
+ {
+ "internalType": "contract Coordinator",
+ "name": "_coordinator",
+ "type": "address"
+ },
+ {
+ "internalType": "address",
+ "name": "_admin",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "nonpayable",
+ "type": "constructor"
+ },
+ {
+ "anonymous": false,
+ "inputs": [],
+ "name": "DefaultAdminDelayChangeCanceled",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": false,
+ "internalType": "uint48",
+ "name": "newDelay",
+ "type": "uint48"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint48",
+ "name": "effectSchedule",
+ "type": "uint48"
+ }
+ ],
+ "name": "DefaultAdminDelayChangeScheduled",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [],
+ "name": "DefaultAdminTransferCanceled",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "newAdmin",
+ "type": "address"
+ },
+ {
+ "indexed": false,
+ "internalType": "uint48",
+ "name": "acceptSchedule",
+ "type": "uint48"
+ }
+ ],
+ "name": "DefaultAdminTransferScheduled",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "bytes32",
+ "name": "role",
+ "type": "bytes32"
+ },
+ {
+ "indexed": true,
+ "internalType": "bytes32",
+ "name": "previousAdminRole",
+ "type": "bytes32"
+ },
+ {
+ "indexed": true,
+ "internalType": "bytes32",
+ "name": "newAdminRole",
+ "type": "bytes32"
+ }
+ ],
+ "name": "RoleAdminChanged",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "bytes32",
+ "name": "role",
+ "type": "bytes32"
+ },
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "account",
+ "type": "address"
+ },
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "sender",
+ "type": "address"
+ }
+ ],
+ "name": "RoleGranted",
+ "type": "event"
+ },
+ {
+ "anonymous": false,
+ "inputs": [
+ {
+ "indexed": true,
+ "internalType": "bytes32",
+ "name": "role",
+ "type": "bytes32"
+ },
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "account",
+ "type": "address"
+ },
+ {
+ "indexed": true,
+ "internalType": "address",
+ "name": "sender",
+ "type": "address"
+ }
+ ],
+ "name": "RoleRevoked",
+ "type": "event"
+ },
+ {
+ "inputs": [],
+ "name": "DEFAULT_ADMIN_ROLE",
+ "outputs": [
+ {
+ "internalType": "bytes32",
+ "name": "",
+ "type": "bytes32"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "acceptDefaultAdminTransfer",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint32",
+ "name": "ritualId",
+ "type": "uint32"
+ },
+ {
+ "internalType": "address[]",
+ "name": "addresses",
+ "type": "address[]"
+ }
+ ],
+ "name": "authorize",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "address",
+ "name": "newAdmin",
+ "type": "address"
+ }
+ ],
+ "name": "beginDefaultAdminTransfer",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "cancelDefaultAdminTransfer",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint48",
+ "name": "newDelay",
+ "type": "uint48"
+ }
+ ],
+ "name": "changeDefaultAdminDelay",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "coordinator",
+ "outputs": [
+ {
+ "internalType": "contract Coordinator",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint32",
+ "name": "ritualId",
+ "type": "uint32"
+ },
+ {
+ "internalType": "address[]",
+ "name": "addresses",
+ "type": "address[]"
+ }
+ ],
+ "name": "deauthorize",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "defaultAdmin",
+ "outputs": [
+ {
+ "internalType": "address",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "defaultAdminDelay",
+ "outputs": [
+ {
+ "internalType": "uint48",
+ "name": "",
+ "type": "uint48"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "defaultAdminDelayIncreaseWait",
+ "outputs": [
+ {
+ "internalType": "uint48",
+ "name": "",
+ "type": "uint48"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "role",
+ "type": "bytes32"
+ }
+ ],
+ "name": "getRoleAdmin",
+ "outputs": [
+ {
+ "internalType": "bytes32",
+ "name": "",
+ "type": "bytes32"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "role",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "address",
+ "name": "account",
+ "type": "address"
+ }
+ ],
+ "name": "grantRole",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "role",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "address",
+ "name": "account",
+ "type": "address"
+ }
+ ],
+ "name": "hasRole",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint32",
+ "name": "ritualId",
+ "type": "uint32"
+ },
+ {
+ "internalType": "address",
+ "name": "encryptor",
+ "type": "address"
+ }
+ ],
+ "name": "isAddressAuthorized",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "uint32",
+ "name": "ritualId",
+ "type": "uint32"
+ },
+ {
+ "internalType": "bytes",
+ "name": "evidence",
+ "type": "bytes"
+ },
+ {
+ "internalType": "bytes",
+ "name": "ciphertextHeader",
+ "type": "bytes"
+ }
+ ],
+ "name": "isAuthorized",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "owner",
+ "outputs": [
+ {
+ "internalType": "address",
+ "name": "",
+ "type": "address"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "pendingDefaultAdmin",
+ "outputs": [
+ {
+ "internalType": "address",
+ "name": "newAdmin",
+ "type": "address"
+ },
+ {
+ "internalType": "uint48",
+ "name": "schedule",
+ "type": "uint48"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "pendingDefaultAdminDelay",
+ "outputs": [
+ {
+ "internalType": "uint48",
+ "name": "newDelay",
+ "type": "uint48"
+ },
+ {
+ "internalType": "uint48",
+ "name": "schedule",
+ "type": "uint48"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "role",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "address",
+ "name": "account",
+ "type": "address"
+ }
+ ],
+ "name": "renounceRole",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes32",
+ "name": "role",
+ "type": "bytes32"
+ },
+ {
+ "internalType": "address",
+ "name": "account",
+ "type": "address"
+ }
+ ],
+ "name": "revokeRole",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [],
+ "name": "rollbackDefaultAdminDelay",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "contract Coordinator",
+ "name": "_coordinator",
+ "type": "address"
+ }
+ ],
+ "name": "setCoordinator",
+ "outputs": [],
+ "stateMutability": "nonpayable",
+ "type": "function"
+ },
+ {
+ "inputs": [
+ {
+ "internalType": "bytes4",
+ "name": "interfaceId",
+ "type": "bytes4"
+ }
+ ],
+ "name": "supportsInterface",
+ "outputs": [
+ {
+ "internalType": "bool",
+ "name": "",
+ "type": "bool"
+ }
+ ],
+ "stateMutability": "view",
+ "type": "function"
+ }
+]
diff --git a/packages/shared/src/contracts/agents/global-allow-list.ts b/packages/shared/src/contracts/agents/global-allow-list.ts
new file mode 100644
index 000000000..a66974c70
--- /dev/null
+++ b/packages/shared/src/contracts/agents/global-allow-list.ts
@@ -0,0 +1,41 @@
+import { ethers } from 'ethers';
+
+import { ChecksumAddress } from '../../types';
+import { GlobalAllowList, GlobalAllowList__factory } from '../ethers-typechain';
+import { DEFAULT_WAIT_N_CONFIRMATIONS, getContract } from '../registry';
+
+export class GlobalAllowListAgent {
+ public static async registerEncrypters(
+ provider: ethers.providers.Provider,
+ signer: ethers.Signer,
+ ritualId: number,
+ encrypters: ChecksumAddress[],
+ ): Promise {
+ const globalAllowList = await this.connectReadWrite(provider, signer);
+ const tx = await globalAllowList.authorize(ritualId, encrypters);
+ await tx.wait(DEFAULT_WAIT_N_CONFIRMATIONS);
+ }
+
+ private static async connectReadOnly(provider: ethers.providers.Provider) {
+ return await this.connect(provider);
+ }
+
+ private static async connectReadWrite(
+ provider: ethers.providers.Provider,
+ signer: ethers.Signer,
+ ) {
+ return await this.connect(provider, signer);
+ }
+
+ private static async connect(
+ provider: ethers.providers.Provider,
+ signer?: ethers.Signer,
+ ): Promise {
+ const network = await provider.getNetwork();
+ const contractAddress = getContract(network.chainId, 'GLOBAL_ALLOW_LIST');
+ return GlobalAllowList__factory.connect(
+ contractAddress,
+ signer ?? provider,
+ );
+ }
+}
diff --git a/packages/shared/src/contracts/agents/index.ts b/packages/shared/src/contracts/agents/index.ts
index 6196ca778..61e29c0e6 100644
--- a/packages/shared/src/contracts/agents/index.ts
+++ b/packages/shared/src/contracts/agents/index.ts
@@ -1,2 +1,3 @@
export * from './coordinator';
+export * from './global-allow-list';
export * from './subscription-manager';
diff --git a/packages/shared/src/contracts/ethers-typechain/GlobalAllowList.ts b/packages/shared/src/contracts/ethers-typechain/GlobalAllowList.ts
new file mode 100644
index 000000000..448e4424b
--- /dev/null
+++ b/packages/shared/src/contracts/ethers-typechain/GlobalAllowList.ts
@@ -0,0 +1,976 @@
+/* Autogenerated file. Do not edit manually. */
+/* tslint:disable */
+/* eslint-disable */
+import type {
+ BaseContract,
+ BigNumber,
+ BigNumberish,
+ BytesLike,
+ CallOverrides,
+ ContractTransaction,
+ Overrides,
+ PopulatedTransaction,
+ Signer,
+ utils,
+} from "ethers";
+import type {
+ FunctionFragment,
+ Result,
+ EventFragment,
+} from "@ethersproject/abi";
+import type { Listener, Provider } from "@ethersproject/providers";
+import type {
+ TypedEventFilter,
+ TypedEvent,
+ TypedListener,
+ OnEvent,
+} from "./common";
+
+export interface GlobalAllowListInterface extends utils.Interface {
+ functions: {
+ "DEFAULT_ADMIN_ROLE()": FunctionFragment;
+ "acceptDefaultAdminTransfer()": FunctionFragment;
+ "authorize(uint32,address[])": FunctionFragment;
+ "beginDefaultAdminTransfer(address)": FunctionFragment;
+ "cancelDefaultAdminTransfer()": FunctionFragment;
+ "changeDefaultAdminDelay(uint48)": FunctionFragment;
+ "coordinator()": FunctionFragment;
+ "deauthorize(uint32,address[])": FunctionFragment;
+ "defaultAdmin()": FunctionFragment;
+ "defaultAdminDelay()": FunctionFragment;
+ "defaultAdminDelayIncreaseWait()": FunctionFragment;
+ "getRoleAdmin(bytes32)": FunctionFragment;
+ "grantRole(bytes32,address)": FunctionFragment;
+ "hasRole(bytes32,address)": FunctionFragment;
+ "isAddressAuthorized(uint32,address)": FunctionFragment;
+ "isAuthorized(uint32,bytes,bytes)": FunctionFragment;
+ "owner()": FunctionFragment;
+ "pendingDefaultAdmin()": FunctionFragment;
+ "pendingDefaultAdminDelay()": FunctionFragment;
+ "renounceRole(bytes32,address)": FunctionFragment;
+ "revokeRole(bytes32,address)": FunctionFragment;
+ "rollbackDefaultAdminDelay()": FunctionFragment;
+ "setCoordinator(address)": FunctionFragment;
+ "supportsInterface(bytes4)": FunctionFragment;
+ };
+
+ getFunction(
+ nameOrSignatureOrTopic:
+ | "DEFAULT_ADMIN_ROLE"
+ | "acceptDefaultAdminTransfer"
+ | "authorize"
+ | "beginDefaultAdminTransfer"
+ | "cancelDefaultAdminTransfer"
+ | "changeDefaultAdminDelay"
+ | "coordinator"
+ | "deauthorize"
+ | "defaultAdmin"
+ | "defaultAdminDelay"
+ | "defaultAdminDelayIncreaseWait"
+ | "getRoleAdmin"
+ | "grantRole"
+ | "hasRole"
+ | "isAddressAuthorized"
+ | "isAuthorized"
+ | "owner"
+ | "pendingDefaultAdmin"
+ | "pendingDefaultAdminDelay"
+ | "renounceRole"
+ | "revokeRole"
+ | "rollbackDefaultAdminDelay"
+ | "setCoordinator"
+ | "supportsInterface"
+ ): FunctionFragment;
+
+ encodeFunctionData(
+ functionFragment: "DEFAULT_ADMIN_ROLE",
+ values?: undefined
+ ): string;
+ encodeFunctionData(
+ functionFragment: "acceptDefaultAdminTransfer",
+ values?: undefined
+ ): string;
+ encodeFunctionData(
+ functionFragment: "authorize",
+ values: [BigNumberish, string[]]
+ ): string;
+ encodeFunctionData(
+ functionFragment: "beginDefaultAdminTransfer",
+ values: [string]
+ ): string;
+ encodeFunctionData(
+ functionFragment: "cancelDefaultAdminTransfer",
+ values?: undefined
+ ): string;
+ encodeFunctionData(
+ functionFragment: "changeDefaultAdminDelay",
+ values: [BigNumberish]
+ ): string;
+ encodeFunctionData(
+ functionFragment: "coordinator",
+ values?: undefined
+ ): string;
+ encodeFunctionData(
+ functionFragment: "deauthorize",
+ values: [BigNumberish, string[]]
+ ): string;
+ encodeFunctionData(
+ functionFragment: "defaultAdmin",
+ values?: undefined
+ ): string;
+ encodeFunctionData(
+ functionFragment: "defaultAdminDelay",
+ values?: undefined
+ ): string;
+ encodeFunctionData(
+ functionFragment: "defaultAdminDelayIncreaseWait",
+ values?: undefined
+ ): string;
+ encodeFunctionData(
+ functionFragment: "getRoleAdmin",
+ values: [BytesLike]
+ ): string;
+ encodeFunctionData(
+ functionFragment: "grantRole",
+ values: [BytesLike, string]
+ ): string;
+ encodeFunctionData(
+ functionFragment: "hasRole",
+ values: [BytesLike, string]
+ ): string;
+ encodeFunctionData(
+ functionFragment: "isAddressAuthorized",
+ values: [BigNumberish, string]
+ ): string;
+ encodeFunctionData(
+ functionFragment: "isAuthorized",
+ values: [BigNumberish, BytesLike, BytesLike]
+ ): string;
+ encodeFunctionData(functionFragment: "owner", values?: undefined): string;
+ encodeFunctionData(
+ functionFragment: "pendingDefaultAdmin",
+ values?: undefined
+ ): string;
+ encodeFunctionData(
+ functionFragment: "pendingDefaultAdminDelay",
+ values?: undefined
+ ): string;
+ encodeFunctionData(
+ functionFragment: "renounceRole",
+ values: [BytesLike, string]
+ ): string;
+ encodeFunctionData(
+ functionFragment: "revokeRole",
+ values: [BytesLike, string]
+ ): string;
+ encodeFunctionData(
+ functionFragment: "rollbackDefaultAdminDelay",
+ values?: undefined
+ ): string;
+ encodeFunctionData(
+ functionFragment: "setCoordinator",
+ values: [string]
+ ): string;
+ encodeFunctionData(
+ functionFragment: "supportsInterface",
+ values: [BytesLike]
+ ): string;
+
+ decodeFunctionResult(
+ functionFragment: "DEFAULT_ADMIN_ROLE",
+ data: BytesLike
+ ): Result;
+ decodeFunctionResult(
+ functionFragment: "acceptDefaultAdminTransfer",
+ data: BytesLike
+ ): Result;
+ decodeFunctionResult(functionFragment: "authorize", data: BytesLike): Result;
+ decodeFunctionResult(
+ functionFragment: "beginDefaultAdminTransfer",
+ data: BytesLike
+ ): Result;
+ decodeFunctionResult(
+ functionFragment: "cancelDefaultAdminTransfer",
+ data: BytesLike
+ ): Result;
+ decodeFunctionResult(
+ functionFragment: "changeDefaultAdminDelay",
+ data: BytesLike
+ ): Result;
+ decodeFunctionResult(
+ functionFragment: "coordinator",
+ data: BytesLike
+ ): Result;
+ decodeFunctionResult(
+ functionFragment: "deauthorize",
+ data: BytesLike
+ ): Result;
+ decodeFunctionResult(
+ functionFragment: "defaultAdmin",
+ data: BytesLike
+ ): Result;
+ decodeFunctionResult(
+ functionFragment: "defaultAdminDelay",
+ data: BytesLike
+ ): Result;
+ decodeFunctionResult(
+ functionFragment: "defaultAdminDelayIncreaseWait",
+ data: BytesLike
+ ): Result;
+ decodeFunctionResult(
+ functionFragment: "getRoleAdmin",
+ data: BytesLike
+ ): Result;
+ decodeFunctionResult(functionFragment: "grantRole", data: BytesLike): Result;
+ decodeFunctionResult(functionFragment: "hasRole", data: BytesLike): Result;
+ decodeFunctionResult(
+ functionFragment: "isAddressAuthorized",
+ data: BytesLike
+ ): Result;
+ decodeFunctionResult(
+ functionFragment: "isAuthorized",
+ data: BytesLike
+ ): Result;
+ decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
+ decodeFunctionResult(
+ functionFragment: "pendingDefaultAdmin",
+ data: BytesLike
+ ): Result;
+ decodeFunctionResult(
+ functionFragment: "pendingDefaultAdminDelay",
+ data: BytesLike
+ ): Result;
+ decodeFunctionResult(
+ functionFragment: "renounceRole",
+ data: BytesLike
+ ): Result;
+ decodeFunctionResult(functionFragment: "revokeRole", data: BytesLike): Result;
+ decodeFunctionResult(
+ functionFragment: "rollbackDefaultAdminDelay",
+ data: BytesLike
+ ): Result;
+ decodeFunctionResult(
+ functionFragment: "setCoordinator",
+ data: BytesLike
+ ): Result;
+ decodeFunctionResult(
+ functionFragment: "supportsInterface",
+ data: BytesLike
+ ): Result;
+
+ events: {
+ "DefaultAdminDelayChangeCanceled()": EventFragment;
+ "DefaultAdminDelayChangeScheduled(uint48,uint48)": EventFragment;
+ "DefaultAdminTransferCanceled()": EventFragment;
+ "DefaultAdminTransferScheduled(address,uint48)": EventFragment;
+ "RoleAdminChanged(bytes32,bytes32,bytes32)": EventFragment;
+ "RoleGranted(bytes32,address,address)": EventFragment;
+ "RoleRevoked(bytes32,address,address)": EventFragment;
+ };
+
+ getEvent(
+ nameOrSignatureOrTopic: "DefaultAdminDelayChangeCanceled"
+ ): EventFragment;
+ getEvent(
+ nameOrSignatureOrTopic: "DefaultAdminDelayChangeScheduled"
+ ): EventFragment;
+ getEvent(
+ nameOrSignatureOrTopic: "DefaultAdminTransferCanceled"
+ ): EventFragment;
+ getEvent(
+ nameOrSignatureOrTopic: "DefaultAdminTransferScheduled"
+ ): EventFragment;
+ getEvent(nameOrSignatureOrTopic: "RoleAdminChanged"): EventFragment;
+ getEvent(nameOrSignatureOrTopic: "RoleGranted"): EventFragment;
+ getEvent(nameOrSignatureOrTopic: "RoleRevoked"): EventFragment;
+}
+
+export interface DefaultAdminDelayChangeCanceledEventObject {}
+export type DefaultAdminDelayChangeCanceledEvent = TypedEvent<
+ [],
+ DefaultAdminDelayChangeCanceledEventObject
+>;
+
+export type DefaultAdminDelayChangeCanceledEventFilter =
+ TypedEventFilter;
+
+export interface DefaultAdminDelayChangeScheduledEventObject {
+ newDelay: number;
+ effectSchedule: number;
+}
+export type DefaultAdminDelayChangeScheduledEvent = TypedEvent<
+ [number, number],
+ DefaultAdminDelayChangeScheduledEventObject
+>;
+
+export type DefaultAdminDelayChangeScheduledEventFilter =
+ TypedEventFilter;
+
+export interface DefaultAdminTransferCanceledEventObject {}
+export type DefaultAdminTransferCanceledEvent = TypedEvent<
+ [],
+ DefaultAdminTransferCanceledEventObject
+>;
+
+export type DefaultAdminTransferCanceledEventFilter =
+ TypedEventFilter;
+
+export interface DefaultAdminTransferScheduledEventObject {
+ newAdmin: string;
+ acceptSchedule: number;
+}
+export type DefaultAdminTransferScheduledEvent = TypedEvent<
+ [string, number],
+ DefaultAdminTransferScheduledEventObject
+>;
+
+export type DefaultAdminTransferScheduledEventFilter =
+ TypedEventFilter;
+
+export interface RoleAdminChangedEventObject {
+ role: string;
+ previousAdminRole: string;
+ newAdminRole: string;
+}
+export type RoleAdminChangedEvent = TypedEvent<
+ [string, string, string],
+ RoleAdminChangedEventObject
+>;
+
+export type RoleAdminChangedEventFilter =
+ TypedEventFilter;
+
+export interface RoleGrantedEventObject {
+ role: string;
+ account: string;
+ sender: string;
+}
+export type RoleGrantedEvent = TypedEvent<
+ [string, string, string],
+ RoleGrantedEventObject
+>;
+
+export type RoleGrantedEventFilter = TypedEventFilter;
+
+export interface RoleRevokedEventObject {
+ role: string;
+ account: string;
+ sender: string;
+}
+export type RoleRevokedEvent = TypedEvent<
+ [string, string, string],
+ RoleRevokedEventObject
+>;
+
+export type RoleRevokedEventFilter = TypedEventFilter;
+
+export interface GlobalAllowList extends BaseContract {
+ connect(signerOrProvider: Signer | Provider | string): this;
+ attach(addressOrName: string): this;
+ deployed(): Promise;
+
+ interface: GlobalAllowListInterface;
+
+ queryFilter(
+ event: TypedEventFilter,
+ fromBlockOrBlockhash?: string | number | undefined,
+ toBlock?: string | number | undefined
+ ): Promise>;
+
+ listeners(
+ eventFilter?: TypedEventFilter
+ ): Array>;
+ listeners(eventName?: string): Array;
+ removeAllListeners(
+ eventFilter: TypedEventFilter
+ ): this;
+ removeAllListeners(eventName?: string): this;
+ off: OnEvent;
+ on: OnEvent;
+ once: OnEvent;
+ removeListener: OnEvent;
+
+ functions: {
+ DEFAULT_ADMIN_ROLE(overrides?: CallOverrides): Promise<[string]>;
+
+ acceptDefaultAdminTransfer(
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ authorize(
+ ritualId: BigNumberish,
+ addresses: string[],
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ beginDefaultAdminTransfer(
+ newAdmin: string,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ cancelDefaultAdminTransfer(
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ changeDefaultAdminDelay(
+ newDelay: BigNumberish,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ coordinator(overrides?: CallOverrides): Promise<[string]>;
+
+ deauthorize(
+ ritualId: BigNumberish,
+ addresses: string[],
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ defaultAdmin(overrides?: CallOverrides): Promise<[string]>;
+
+ defaultAdminDelay(overrides?: CallOverrides): Promise<[number]>;
+
+ defaultAdminDelayIncreaseWait(overrides?: CallOverrides): Promise<[number]>;
+
+ getRoleAdmin(role: BytesLike, overrides?: CallOverrides): Promise<[string]>;
+
+ grantRole(
+ role: BytesLike,
+ account: string,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ hasRole(
+ role: BytesLike,
+ account: string,
+ overrides?: CallOverrides
+ ): Promise<[boolean]>;
+
+ isAddressAuthorized(
+ ritualId: BigNumberish,
+ encryptor: string,
+ overrides?: CallOverrides
+ ): Promise<[boolean]>;
+
+ isAuthorized(
+ ritualId: BigNumberish,
+ evidence: BytesLike,
+ ciphertextHeader: BytesLike,
+ overrides?: CallOverrides
+ ): Promise<[boolean]>;
+
+ owner(overrides?: CallOverrides): Promise<[string]>;
+
+ pendingDefaultAdmin(
+ overrides?: CallOverrides
+ ): Promise<[string, number] & { newAdmin: string; schedule: number }>;
+
+ pendingDefaultAdminDelay(
+ overrides?: CallOverrides
+ ): Promise<[number, number] & { newDelay: number; schedule: number }>;
+
+ renounceRole(
+ role: BytesLike,
+ account: string,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ revokeRole(
+ role: BytesLike,
+ account: string,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ rollbackDefaultAdminDelay(
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ setCoordinator(
+ _coordinator: string,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ supportsInterface(
+ interfaceId: BytesLike,
+ overrides?: CallOverrides
+ ): Promise<[boolean]>;
+ };
+
+ DEFAULT_ADMIN_ROLE(overrides?: CallOverrides): Promise;
+
+ acceptDefaultAdminTransfer(
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ authorize(
+ ritualId: BigNumberish,
+ addresses: string[],
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ beginDefaultAdminTransfer(
+ newAdmin: string,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ cancelDefaultAdminTransfer(
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ changeDefaultAdminDelay(
+ newDelay: BigNumberish,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ coordinator(overrides?: CallOverrides): Promise;
+
+ deauthorize(
+ ritualId: BigNumberish,
+ addresses: string[],
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ defaultAdmin(overrides?: CallOverrides): Promise;
+
+ defaultAdminDelay(overrides?: CallOverrides): Promise;
+
+ defaultAdminDelayIncreaseWait(overrides?: CallOverrides): Promise;
+
+ getRoleAdmin(role: BytesLike, overrides?: CallOverrides): Promise;
+
+ grantRole(
+ role: BytesLike,
+ account: string,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ hasRole(
+ role: BytesLike,
+ account: string,
+ overrides?: CallOverrides
+ ): Promise;
+
+ isAddressAuthorized(
+ ritualId: BigNumberish,
+ encryptor: string,
+ overrides?: CallOverrides
+ ): Promise;
+
+ isAuthorized(
+ ritualId: BigNumberish,
+ evidence: BytesLike,
+ ciphertextHeader: BytesLike,
+ overrides?: CallOverrides
+ ): Promise;
+
+ owner(overrides?: CallOverrides): Promise;
+
+ pendingDefaultAdmin(
+ overrides?: CallOverrides
+ ): Promise<[string, number] & { newAdmin: string; schedule: number }>;
+
+ pendingDefaultAdminDelay(
+ overrides?: CallOverrides
+ ): Promise<[number, number] & { newDelay: number; schedule: number }>;
+
+ renounceRole(
+ role: BytesLike,
+ account: string,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ revokeRole(
+ role: BytesLike,
+ account: string,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ rollbackDefaultAdminDelay(
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ setCoordinator(
+ _coordinator: string,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ supportsInterface(
+ interfaceId: BytesLike,
+ overrides?: CallOverrides
+ ): Promise;
+
+ callStatic: {
+ DEFAULT_ADMIN_ROLE(overrides?: CallOverrides): Promise;
+
+ acceptDefaultAdminTransfer(overrides?: CallOverrides): Promise;
+
+ authorize(
+ ritualId: BigNumberish,
+ addresses: string[],
+ overrides?: CallOverrides
+ ): Promise;
+
+ beginDefaultAdminTransfer(
+ newAdmin: string,
+ overrides?: CallOverrides
+ ): Promise;
+
+ cancelDefaultAdminTransfer(overrides?: CallOverrides): Promise;
+
+ changeDefaultAdminDelay(
+ newDelay: BigNumberish,
+ overrides?: CallOverrides
+ ): Promise;
+
+ coordinator(overrides?: CallOverrides): Promise;
+
+ deauthorize(
+ ritualId: BigNumberish,
+ addresses: string[],
+ overrides?: CallOverrides
+ ): Promise;
+
+ defaultAdmin(overrides?: CallOverrides): Promise;
+
+ defaultAdminDelay(overrides?: CallOverrides): Promise;
+
+ defaultAdminDelayIncreaseWait(overrides?: CallOverrides): Promise;
+
+ getRoleAdmin(role: BytesLike, overrides?: CallOverrides): Promise;
+
+ grantRole(
+ role: BytesLike,
+ account: string,
+ overrides?: CallOverrides
+ ): Promise;
+
+ hasRole(
+ role: BytesLike,
+ account: string,
+ overrides?: CallOverrides
+ ): Promise;
+
+ isAddressAuthorized(
+ ritualId: BigNumberish,
+ encryptor: string,
+ overrides?: CallOverrides
+ ): Promise;
+
+ isAuthorized(
+ ritualId: BigNumberish,
+ evidence: BytesLike,
+ ciphertextHeader: BytesLike,
+ overrides?: CallOverrides
+ ): Promise;
+
+ owner(overrides?: CallOverrides): Promise;
+
+ pendingDefaultAdmin(
+ overrides?: CallOverrides
+ ): Promise<[string, number] & { newAdmin: string; schedule: number }>;
+
+ pendingDefaultAdminDelay(
+ overrides?: CallOverrides
+ ): Promise<[number, number] & { newDelay: number; schedule: number }>;
+
+ renounceRole(
+ role: BytesLike,
+ account: string,
+ overrides?: CallOverrides
+ ): Promise;
+
+ revokeRole(
+ role: BytesLike,
+ account: string,
+ overrides?: CallOverrides
+ ): Promise;
+
+ rollbackDefaultAdminDelay(overrides?: CallOverrides): Promise;
+
+ setCoordinator(
+ _coordinator: string,
+ overrides?: CallOverrides
+ ): Promise;
+
+ supportsInterface(
+ interfaceId: BytesLike,
+ overrides?: CallOverrides
+ ): Promise;
+ };
+
+ filters: {
+ "DefaultAdminDelayChangeCanceled()"(): DefaultAdminDelayChangeCanceledEventFilter;
+ DefaultAdminDelayChangeCanceled(): DefaultAdminDelayChangeCanceledEventFilter;
+
+ "DefaultAdminDelayChangeScheduled(uint48,uint48)"(
+ newDelay?: null,
+ effectSchedule?: null
+ ): DefaultAdminDelayChangeScheduledEventFilter;
+ DefaultAdminDelayChangeScheduled(
+ newDelay?: null,
+ effectSchedule?: null
+ ): DefaultAdminDelayChangeScheduledEventFilter;
+
+ "DefaultAdminTransferCanceled()"(): DefaultAdminTransferCanceledEventFilter;
+ DefaultAdminTransferCanceled(): DefaultAdminTransferCanceledEventFilter;
+
+ "DefaultAdminTransferScheduled(address,uint48)"(
+ newAdmin?: string | null,
+ acceptSchedule?: null
+ ): DefaultAdminTransferScheduledEventFilter;
+ DefaultAdminTransferScheduled(
+ newAdmin?: string | null,
+ acceptSchedule?: null
+ ): DefaultAdminTransferScheduledEventFilter;
+
+ "RoleAdminChanged(bytes32,bytes32,bytes32)"(
+ role?: BytesLike | null,
+ previousAdminRole?: BytesLike | null,
+ newAdminRole?: BytesLike | null
+ ): RoleAdminChangedEventFilter;
+ RoleAdminChanged(
+ role?: BytesLike | null,
+ previousAdminRole?: BytesLike | null,
+ newAdminRole?: BytesLike | null
+ ): RoleAdminChangedEventFilter;
+
+ "RoleGranted(bytes32,address,address)"(
+ role?: BytesLike | null,
+ account?: string | null,
+ sender?: string | null
+ ): RoleGrantedEventFilter;
+ RoleGranted(
+ role?: BytesLike | null,
+ account?: string | null,
+ sender?: string | null
+ ): RoleGrantedEventFilter;
+
+ "RoleRevoked(bytes32,address,address)"(
+ role?: BytesLike | null,
+ account?: string | null,
+ sender?: string | null
+ ): RoleRevokedEventFilter;
+ RoleRevoked(
+ role?: BytesLike | null,
+ account?: string | null,
+ sender?: string | null
+ ): RoleRevokedEventFilter;
+ };
+
+ estimateGas: {
+ DEFAULT_ADMIN_ROLE(overrides?: CallOverrides): Promise;
+
+ acceptDefaultAdminTransfer(
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ authorize(
+ ritualId: BigNumberish,
+ addresses: string[],
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ beginDefaultAdminTransfer(
+ newAdmin: string,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ cancelDefaultAdminTransfer(
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ changeDefaultAdminDelay(
+ newDelay: BigNumberish,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ coordinator(overrides?: CallOverrides): Promise;
+
+ deauthorize(
+ ritualId: BigNumberish,
+ addresses: string[],
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ defaultAdmin(overrides?: CallOverrides): Promise;
+
+ defaultAdminDelay(overrides?: CallOverrides): Promise;
+
+ defaultAdminDelayIncreaseWait(
+ overrides?: CallOverrides
+ ): Promise;
+
+ getRoleAdmin(
+ role: BytesLike,
+ overrides?: CallOverrides
+ ): Promise;
+
+ grantRole(
+ role: BytesLike,
+ account: string,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ hasRole(
+ role: BytesLike,
+ account: string,
+ overrides?: CallOverrides
+ ): Promise;
+
+ isAddressAuthorized(
+ ritualId: BigNumberish,
+ encryptor: string,
+ overrides?: CallOverrides
+ ): Promise;
+
+ isAuthorized(
+ ritualId: BigNumberish,
+ evidence: BytesLike,
+ ciphertextHeader: BytesLike,
+ overrides?: CallOverrides
+ ): Promise;
+
+ owner(overrides?: CallOverrides): Promise;
+
+ pendingDefaultAdmin(overrides?: CallOverrides): Promise;
+
+ pendingDefaultAdminDelay(overrides?: CallOverrides): Promise;
+
+ renounceRole(
+ role: BytesLike,
+ account: string,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ revokeRole(
+ role: BytesLike,
+ account: string,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ rollbackDefaultAdminDelay(
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ setCoordinator(
+ _coordinator: string,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ supportsInterface(
+ interfaceId: BytesLike,
+ overrides?: CallOverrides
+ ): Promise;
+ };
+
+ populateTransaction: {
+ DEFAULT_ADMIN_ROLE(
+ overrides?: CallOverrides
+ ): Promise;
+
+ acceptDefaultAdminTransfer(
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ authorize(
+ ritualId: BigNumberish,
+ addresses: string[],
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ beginDefaultAdminTransfer(
+ newAdmin: string,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ cancelDefaultAdminTransfer(
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ changeDefaultAdminDelay(
+ newDelay: BigNumberish,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ coordinator(overrides?: CallOverrides): Promise;
+
+ deauthorize(
+ ritualId: BigNumberish,
+ addresses: string[],
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ defaultAdmin(overrides?: CallOverrides): Promise;
+
+ defaultAdminDelay(overrides?: CallOverrides): Promise;
+
+ defaultAdminDelayIncreaseWait(
+ overrides?: CallOverrides
+ ): Promise;
+
+ getRoleAdmin(
+ role: BytesLike,
+ overrides?: CallOverrides
+ ): Promise;
+
+ grantRole(
+ role: BytesLike,
+ account: string,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ hasRole(
+ role: BytesLike,
+ account: string,
+ overrides?: CallOverrides
+ ): Promise;
+
+ isAddressAuthorized(
+ ritualId: BigNumberish,
+ encryptor: string,
+ overrides?: CallOverrides
+ ): Promise;
+
+ isAuthorized(
+ ritualId: BigNumberish,
+ evidence: BytesLike,
+ ciphertextHeader: BytesLike,
+ overrides?: CallOverrides
+ ): Promise;
+
+ owner(overrides?: CallOverrides): Promise;
+
+ pendingDefaultAdmin(
+ overrides?: CallOverrides
+ ): Promise;
+
+ pendingDefaultAdminDelay(
+ overrides?: CallOverrides
+ ): Promise;
+
+ renounceRole(
+ role: BytesLike,
+ account: string,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ revokeRole(
+ role: BytesLike,
+ account: string,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ rollbackDefaultAdminDelay(
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ setCoordinator(
+ _coordinator: string,
+ overrides?: Overrides & { from?: string }
+ ): Promise;
+
+ supportsInterface(
+ interfaceId: BytesLike,
+ overrides?: CallOverrides
+ ): Promise;
+ };
+}
diff --git a/packages/shared/src/contracts/ethers-typechain/factories/GlobalAllowList__factory.ts b/packages/shared/src/contracts/ethers-typechain/factories/GlobalAllowList__factory.ts
new file mode 100644
index 000000000..f46e18fa6
--- /dev/null
+++ b/packages/shared/src/contracts/ethers-typechain/factories/GlobalAllowList__factory.ts
@@ -0,0 +1,546 @@
+/* Autogenerated file. Do not edit manually. */
+/* tslint:disable */
+/* eslint-disable */
+
+import { Contract, Signer, utils } from "ethers";
+import type { Provider } from "@ethersproject/providers";
+import type {
+ GlobalAllowList,
+ GlobalAllowListInterface,
+} from "../GlobalAllowList";
+
+const _abi = [
+ {
+ inputs: [
+ {
+ internalType: "contract Coordinator",
+ name: "_coordinator",
+ type: "address",
+ },
+ {
+ internalType: "address",
+ name: "_admin",
+ type: "address",
+ },
+ ],
+ stateMutability: "nonpayable",
+ type: "constructor",
+ },
+ {
+ anonymous: false,
+ inputs: [],
+ name: "DefaultAdminDelayChangeCanceled",
+ type: "event",
+ },
+ {
+ anonymous: false,
+ inputs: [
+ {
+ indexed: false,
+ internalType: "uint48",
+ name: "newDelay",
+ type: "uint48",
+ },
+ {
+ indexed: false,
+ internalType: "uint48",
+ name: "effectSchedule",
+ type: "uint48",
+ },
+ ],
+ name: "DefaultAdminDelayChangeScheduled",
+ type: "event",
+ },
+ {
+ anonymous: false,
+ inputs: [],
+ name: "DefaultAdminTransferCanceled",
+ type: "event",
+ },
+ {
+ anonymous: false,
+ inputs: [
+ {
+ indexed: true,
+ internalType: "address",
+ name: "newAdmin",
+ type: "address",
+ },
+ {
+ indexed: false,
+ internalType: "uint48",
+ name: "acceptSchedule",
+ type: "uint48",
+ },
+ ],
+ name: "DefaultAdminTransferScheduled",
+ type: "event",
+ },
+ {
+ anonymous: false,
+ inputs: [
+ {
+ indexed: true,
+ internalType: "bytes32",
+ name: "role",
+ type: "bytes32",
+ },
+ {
+ indexed: true,
+ internalType: "bytes32",
+ name: "previousAdminRole",
+ type: "bytes32",
+ },
+ {
+ indexed: true,
+ internalType: "bytes32",
+ name: "newAdminRole",
+ type: "bytes32",
+ },
+ ],
+ name: "RoleAdminChanged",
+ type: "event",
+ },
+ {
+ anonymous: false,
+ inputs: [
+ {
+ indexed: true,
+ internalType: "bytes32",
+ name: "role",
+ type: "bytes32",
+ },
+ {
+ indexed: true,
+ internalType: "address",
+ name: "account",
+ type: "address",
+ },
+ {
+ indexed: true,
+ internalType: "address",
+ name: "sender",
+ type: "address",
+ },
+ ],
+ name: "RoleGranted",
+ type: "event",
+ },
+ {
+ anonymous: false,
+ inputs: [
+ {
+ indexed: true,
+ internalType: "bytes32",
+ name: "role",
+ type: "bytes32",
+ },
+ {
+ indexed: true,
+ internalType: "address",
+ name: "account",
+ type: "address",
+ },
+ {
+ indexed: true,
+ internalType: "address",
+ name: "sender",
+ type: "address",
+ },
+ ],
+ name: "RoleRevoked",
+ type: "event",
+ },
+ {
+ inputs: [],
+ name: "DEFAULT_ADMIN_ROLE",
+ outputs: [
+ {
+ internalType: "bytes32",
+ name: "",
+ type: "bytes32",
+ },
+ ],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "acceptDefaultAdminTransfer",
+ outputs: [],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [
+ {
+ internalType: "uint32",
+ name: "ritualId",
+ type: "uint32",
+ },
+ {
+ internalType: "address[]",
+ name: "addresses",
+ type: "address[]",
+ },
+ ],
+ name: "authorize",
+ outputs: [],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [
+ {
+ internalType: "address",
+ name: "newAdmin",
+ type: "address",
+ },
+ ],
+ name: "beginDefaultAdminTransfer",
+ outputs: [],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "cancelDefaultAdminTransfer",
+ outputs: [],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [
+ {
+ internalType: "uint48",
+ name: "newDelay",
+ type: "uint48",
+ },
+ ],
+ name: "changeDefaultAdminDelay",
+ outputs: [],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "coordinator",
+ outputs: [
+ {
+ internalType: "contract Coordinator",
+ name: "",
+ type: "address",
+ },
+ ],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [
+ {
+ internalType: "uint32",
+ name: "ritualId",
+ type: "uint32",
+ },
+ {
+ internalType: "address[]",
+ name: "addresses",
+ type: "address[]",
+ },
+ ],
+ name: "deauthorize",
+ outputs: [],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "defaultAdmin",
+ outputs: [
+ {
+ internalType: "address",
+ name: "",
+ type: "address",
+ },
+ ],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "defaultAdminDelay",
+ outputs: [
+ {
+ internalType: "uint48",
+ name: "",
+ type: "uint48",
+ },
+ ],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "defaultAdminDelayIncreaseWait",
+ outputs: [
+ {
+ internalType: "uint48",
+ name: "",
+ type: "uint48",
+ },
+ ],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [
+ {
+ internalType: "bytes32",
+ name: "role",
+ type: "bytes32",
+ },
+ ],
+ name: "getRoleAdmin",
+ outputs: [
+ {
+ internalType: "bytes32",
+ name: "",
+ type: "bytes32",
+ },
+ ],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [
+ {
+ internalType: "bytes32",
+ name: "role",
+ type: "bytes32",
+ },
+ {
+ internalType: "address",
+ name: "account",
+ type: "address",
+ },
+ ],
+ name: "grantRole",
+ outputs: [],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [
+ {
+ internalType: "bytes32",
+ name: "role",
+ type: "bytes32",
+ },
+ {
+ internalType: "address",
+ name: "account",
+ type: "address",
+ },
+ ],
+ name: "hasRole",
+ outputs: [
+ {
+ internalType: "bool",
+ name: "",
+ type: "bool",
+ },
+ ],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [
+ {
+ internalType: "uint32",
+ name: "ritualId",
+ type: "uint32",
+ },
+ {
+ internalType: "address",
+ name: "encryptor",
+ type: "address",
+ },
+ ],
+ name: "isAddressAuthorized",
+ outputs: [
+ {
+ internalType: "bool",
+ name: "",
+ type: "bool",
+ },
+ ],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [
+ {
+ internalType: "uint32",
+ name: "ritualId",
+ type: "uint32",
+ },
+ {
+ internalType: "bytes",
+ name: "evidence",
+ type: "bytes",
+ },
+ {
+ internalType: "bytes",
+ name: "ciphertextHeader",
+ type: "bytes",
+ },
+ ],
+ name: "isAuthorized",
+ outputs: [
+ {
+ internalType: "bool",
+ name: "",
+ type: "bool",
+ },
+ ],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "owner",
+ outputs: [
+ {
+ internalType: "address",
+ name: "",
+ type: "address",
+ },
+ ],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "pendingDefaultAdmin",
+ outputs: [
+ {
+ internalType: "address",
+ name: "newAdmin",
+ type: "address",
+ },
+ {
+ internalType: "uint48",
+ name: "schedule",
+ type: "uint48",
+ },
+ ],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "pendingDefaultAdminDelay",
+ outputs: [
+ {
+ internalType: "uint48",
+ name: "newDelay",
+ type: "uint48",
+ },
+ {
+ internalType: "uint48",
+ name: "schedule",
+ type: "uint48",
+ },
+ ],
+ stateMutability: "view",
+ type: "function",
+ },
+ {
+ inputs: [
+ {
+ internalType: "bytes32",
+ name: "role",
+ type: "bytes32",
+ },
+ {
+ internalType: "address",
+ name: "account",
+ type: "address",
+ },
+ ],
+ name: "renounceRole",
+ outputs: [],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [
+ {
+ internalType: "bytes32",
+ name: "role",
+ type: "bytes32",
+ },
+ {
+ internalType: "address",
+ name: "account",
+ type: "address",
+ },
+ ],
+ name: "revokeRole",
+ outputs: [],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [],
+ name: "rollbackDefaultAdminDelay",
+ outputs: [],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [
+ {
+ internalType: "contract Coordinator",
+ name: "_coordinator",
+ type: "address",
+ },
+ ],
+ name: "setCoordinator",
+ outputs: [],
+ stateMutability: "nonpayable",
+ type: "function",
+ },
+ {
+ inputs: [
+ {
+ internalType: "bytes4",
+ name: "interfaceId",
+ type: "bytes4",
+ },
+ ],
+ name: "supportsInterface",
+ outputs: [
+ {
+ internalType: "bool",
+ name: "",
+ type: "bool",
+ },
+ ],
+ stateMutability: "view",
+ type: "function",
+ },
+] as const;
+
+export class GlobalAllowList__factory {
+ static readonly abi = _abi;
+ static createInterface(): GlobalAllowListInterface {
+ return new utils.Interface(_abi) as GlobalAllowListInterface;
+ }
+ static connect(
+ address: string,
+ signerOrProvider: Signer | Provider
+ ): GlobalAllowList {
+ return new Contract(address, _abi, signerOrProvider) as GlobalAllowList;
+ }
+}
diff --git a/packages/shared/src/contracts/ethers-typechain/factories/index.ts b/packages/shared/src/contracts/ethers-typechain/factories/index.ts
index f91f0a2b7..19ffd50d3 100644
--- a/packages/shared/src/contracts/ethers-typechain/factories/index.ts
+++ b/packages/shared/src/contracts/ethers-typechain/factories/index.ts
@@ -2,4 +2,5 @@
/* tslint:disable */
/* eslint-disable */
export { Coordinator__factory } from "./Coordinator__factory";
+export { GlobalAllowList__factory } from "./GlobalAllowList__factory";
export { SubscriptionManager__factory } from "./SubscriptionManager__factory";
diff --git a/packages/shared/src/contracts/ethers-typechain/index.ts b/packages/shared/src/contracts/ethers-typechain/index.ts
index 64d144160..27e4b39b2 100644
--- a/packages/shared/src/contracts/ethers-typechain/index.ts
+++ b/packages/shared/src/contracts/ethers-typechain/index.ts
@@ -2,7 +2,9 @@
/* tslint:disable */
/* eslint-disable */
export type { Coordinator } from "./Coordinator";
+export type { GlobalAllowList } from "./GlobalAllowList";
export type { SubscriptionManager } from "./SubscriptionManager";
export * as factories from "./factories";
export { Coordinator__factory } from "./factories/Coordinator__factory";
+export { GlobalAllowList__factory } from "./factories/GlobalAllowList__factory";
export { SubscriptionManager__factory } from "./factories/SubscriptionManager__factory";
diff --git a/packages/shared/src/contracts/registry.ts b/packages/shared/src/contracts/registry.ts
index d15ffc23e..8a2a7b937 100644
--- a/packages/shared/src/contracts/registry.ts
+++ b/packages/shared/src/contracts/registry.ts
@@ -4,33 +4,38 @@ import { ChainId } from '../web3';
type Contracts = {
readonly SUBSCRIPTION_MANAGER: ChecksumAddress | undefined;
readonly COORDINATOR: ChecksumAddress | undefined;
+ readonly GLOBAL_ALLOW_LIST: ChecksumAddress | undefined;
};
const POLYGON: Contracts = {
SUBSCRIPTION_MANAGER: '0xB0194073421192F6Cf38d72c791Be8729721A0b3',
COORDINATOR: undefined,
+ GLOBAL_ALLOW_LIST: undefined,
};
const MUMBAI: Contracts = {
SUBSCRIPTION_MANAGER: '0xb9015d7b35ce7c81dde38ef7136baa3b1044f313',
COORDINATOR: '0x8E49989F9D3aD89c8ab0de21FbA2E00C67ca872F',
+ GLOBAL_ALLOW_LIST: '0x7b521E78CFaf55fa01433181d1D636E7e4b73243',
};
const GOERLI: Contracts = {
SUBSCRIPTION_MANAGER: undefined,
COORDINATOR: '0x2cf19429168a0943992D8e7dE534E9b802C687B6',
+ GLOBAL_ALLOW_LIST: undefined,
};
-const MAINNET: Contracts = {
+const ETHEREUM_MAINNET: Contracts = {
SUBSCRIPTION_MANAGER: undefined,
COORDINATOR: undefined,
+ GLOBAL_ALLOW_LIST: undefined,
};
const CONTRACTS: { readonly [key in ChainId]: Contracts } = {
[ChainId.POLYGON]: POLYGON,
[ChainId.MUMBAI]: MUMBAI,
[ChainId.GOERLI]: GOERLI,
- [ChainId.MAINNET]: MAINNET,
+ [ChainId.ETHEREUM_MAINNET]: ETHEREUM_MAINNET,
};
export const getContract = (
diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts
index 800d2ac5e..63f08aa5a 100644
--- a/packages/shared/src/index.ts
+++ b/packages/shared/src/index.ts
@@ -1,6 +1,6 @@
export * from './contracts';
export * from './porter';
-export * from './types';
+export type * from './types';
export * from './utils';
export * from './web3';
diff --git a/packages/shared/src/types.ts b/packages/shared/src/types.ts
index 9befc497e..02603b3c2 100644
--- a/packages/shared/src/types.ts
+++ b/packages/shared/src/types.ts
@@ -1,3 +1,3 @@
-export type ChecksumAddress = string;
+export type ChecksumAddress = `0x${string}`;
export type HexEncodedBytes = string;
export type Base64EncodedBytes = string;
diff --git a/packages/shared/src/web3.ts b/packages/shared/src/web3.ts
index c4bdcee12..d82919698 100644
--- a/packages/shared/src/web3.ts
+++ b/packages/shared/src/web3.ts
@@ -4,7 +4,7 @@ export enum ChainId {
POLYGON = 137,
MUMBAI = 80001,
GOERLI = 5,
- MAINNET = 1,
+ ETHEREUM_MAINNET = 1,
}
export const toCanonicalAddress = (address: string): Uint8Array => {
diff --git a/packages/taco/src/conditions/const.ts b/packages/taco/src/conditions/const.ts
index a7d8dc12c..2c100bf33 100644
--- a/packages/taco/src/conditions/const.ts
+++ b/packages/taco/src/conditions/const.ts
@@ -8,5 +8,5 @@ export const SUPPORTED_CHAIN_IDS = [
ChainId.POLYGON,
ChainId.MUMBAI,
ChainId.GOERLI,
- ChainId.MAINNET,
+ ChainId.ETHEREUM_MAINNET,
];
diff --git a/packages/taco/src/taco.ts b/packages/taco/src/taco.ts
index 6765ec29f..08d4d71c5 100644
--- a/packages/taco/src/taco.ts
+++ b/packages/taco/src/taco.ts
@@ -4,7 +4,13 @@ import {
encryptForDkg,
ThresholdMessageKit,
} from '@nucypher/nucypher-core';
-import { DkgCoordinatorAgent, fromHexString, toBytes } from '@nucypher/shared';
+import {
+ ChecksumAddress,
+ DkgCoordinatorAgent,
+ fromHexString,
+ GlobalAllowListAgent,
+ toBytes,
+} from '@nucypher/shared';
import { ethers } from 'ethers';
import { keccak256 } from 'ethers/lib/utils';
@@ -101,3 +107,17 @@ export const isAuthorized = async (
messageKit: ThresholdMessageKit,
ritualId: number,
) => DkgCoordinatorAgent.isEncryptionAuthorized(provider, ritualId, messageKit);
+
+export const registerEncrypters = async (
+ provider: ethers.providers.Provider,
+ signer: ethers.Signer,
+ ritualId: number,
+ encrypters: ChecksumAddress[],
+): Promise => {
+ await GlobalAllowListAgent.registerEncrypters(
+ provider,
+ signer,
+ ritualId,
+ encrypters,
+ );
+};
diff --git a/packages/test-utils/src/utils.ts b/packages/test-utils/src/utils.ts
index 91c3df776..b8b04970f 100644
--- a/packages/test-utils/src/utils.ts
+++ b/packages/test-utils/src/utils.ts
@@ -95,8 +95,10 @@ export const fakeProvider = (
} as unknown as ethers.providers.Web3Provider;
};
-const genChecksumAddress = (i: number) =>
- '0x' + '0'.repeat(40 - i.toString(16).length) + i.toString(16);
+const genChecksumAddress = (i: number): ChecksumAddress =>
+ `0x${'0'.repeat(40 - i.toString(16).length)}${i.toString(
+ 16,
+ )}`.toLowerCase() as ChecksumAddress;
const genEthAddr = (i: number) =>
EthereumAddress.fromString(genChecksumAddress(i));
@@ -105,7 +107,7 @@ export const fakeUrsulas = (n = 4): Ursula[] =>
// 0...n-1
Array.from(Array(n).keys()).map((i: number) => ({
encryptingKey: SecretKey.random().publicKey(),
- checksumAddress: genChecksumAddress(i).toLowerCase(),
+ checksumAddress: genChecksumAddress(i),
uri: `https://example.${i}.com:9151`,
}));