diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b6aa9b..6895484 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 20 cache: 'pnpm' - name: Install SDK dependencies diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a10fbb..53208ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,27 +1,37 @@ # Changelog -## 2.0.1-beta.1 (2024-04-04) +## 2.1.0-beta.1 + +- Automatically derive the EIP712 version via the domain separator +- Improve delegated attestation backward compatibility + +## 2.0.1-beta.1 - Fix signer assignment during `connect` (2.0.0-beta.1 regression). -## 2.0.0-beta.1 (2024-03-21) +## 2.0.0-beta.1 - Don't automatically broadcast transactions. In order to broadcast transactions, it's now always necessary to call the `wait()` function. -## 1.5.0 (2024-02-16) +## 1.6.0 + +- Automatically derive the EIP712 version via the domain separator +- Improve delegated attestation backward compatibility + +## 1.5.0 - Introduce framework-agnostic `TransactionSigner` and `TypeDataSigner` interfaces which replace the previous usage of the signer/provider - Fix recipient being mandatory in `attest()` calls -## 1.4.2 (2024-02-03) +## 1.4.2 - Remove nonce from serialization/deserialization of offchain attestations -## 1.4.1 (2024-02-02) +## 1.4.1 - Check for ethers v6 compatibility -## 1.4.0 (2023-12-08) +## 1.4.0 - Add customizable salt to offchain attestations to reduce the chance of predictable UIDs (which may be abused in some very specific use-cases) - Remove unnecessary offchain attestation version input from the `signOffchainAttestation` API diff --git a/dist/eas.d.ts b/dist/eas.d.ts index bef85ae..7bc42af 100644 --- a/dist/eas.d.ts +++ b/dist/eas.d.ts @@ -4,6 +4,7 @@ import { EIP712Proxy } from './eip712-proxy'; import { Delegated, Offchain } from './offchain'; import { AttestationRequest, DelegatedAttestationRequest, DelegatedProxyAttestationRequest, DelegatedProxyRevocationRequest, DelegatedRevocationRequest, MultiAttestationRequest, MultiDelegatedAttestationRequest, MultiDelegatedProxyAttestationRequest, MultiDelegatedProxyRevocationRequest, MultiDelegatedRevocationRequest, MultiRevocationRequest, RevocationRequest } from './request'; import { Base, Transaction, TransactionSigner } from './transaction'; +export { Overrides } from 'ethers'; export * from './request'; export interface Attestation { uid: string; @@ -25,6 +26,8 @@ export declare class EAS extends Base { private proxy?; private delegated?; private offchain?; + private version?; + private legacyEAS; constructor(address: string, options?: EASOptions); connect(signer: TransactionSigner): this; getVersion(): Promise; @@ -58,4 +61,5 @@ export declare class EAS extends Base { getRevokeTypeHash(): Promise; private setDelegated; private setOffchain; + private isLegacyContract; } diff --git a/dist/eas.js b/dist/eas.js index 77eccfe..cdb8037 100644 --- a/dist/eas.js +++ b/dist/eas.js @@ -3,16 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.EAS = void 0; const tslib_1 = require("tslib"); const eas_contracts_1 = require("@ethereum-attestation-service/eas-contracts"); +const eas_contracts_legacy_1 = require("@ethereum-attestation-service/eas-contracts-legacy"); +const semver_1 = tslib_1.__importDefault(require("semver")); const version_1 = require("./legacy/version"); const offchain_1 = require("./offchain"); const request_1 = require("./request"); const transaction_1 = require("./transaction"); const utils_1 = require("./utils"); +const LEGACY_VERSION = '1.1.0'; tslib_1.__exportStar(require("./request"), exports); class EAS extends transaction_1.Base { proxy; delegated; offchain; + version; + legacyEAS; constructor(address, options) { const { signer, proxy } = options || {}; super(new eas_contracts_1.EAS__factory(), address, signer); @@ -24,17 +29,24 @@ class EAS extends transaction_1.Base { if (proxy) { this.proxy = proxy; } + this.legacyEAS = new transaction_1.Base(new eas_contracts_legacy_1.EAS__factory(), address, signer); } // Connects the API to a specific signer connect(signer) { delete this.delegated; delete this.offchain; super.connect(signer); + if (this.legacyEAS) { + this.legacyEAS.connect(signer); + } return this; } // Returns the version of the contract async getVersion() { - return (await (0, version_1.legacyVersion)(this.contract)) ?? this.contract.version(); + if (this.version) { + return this.version; + } + return (this.version = (await (0, version_1.legacyVersion)(this.contract)) ?? (await this.contract.version())); } // Returns an existing schema by attestation UID getAttestation(uid) { @@ -92,20 +104,39 @@ class EAS extends transaction_1.Base { if (!this.signer) { throw new Error('Invalid signer'); } - return new transaction_1.Transaction(await this.contract.attestByDelegation.populateTransaction({ - schema, - data: { - recipient, - expirationTime, - revocable, - refUID, - data, - value - }, - signature, - attester, - deadline - }, { value, ...overrides }), this.signer, + let tx; + if (await this.isLegacyContract()) { + tx = await this.legacyEAS.contract.attestByDelegation.populateTransaction({ + schema, + data: { + recipient, + expirationTime, + revocable, + refUID, + data, + value + }, + signature, + attester + }, { value, ...overrides }); + } + else { + tx = await this.contract.attestByDelegation.populateTransaction({ + schema, + data: { + recipient, + expirationTime, + revocable, + refUID, + data, + value + }, + signature, + attester, + deadline + }, { value, ...overrides }); + } + return new transaction_1.Transaction(tx, this.signer, // eslint-disable-next-line require-await async (receipt) => (0, utils_1.getUIDsFromAttestReceipt)(receipt)[0]); } @@ -141,28 +172,56 @@ class EAS extends transaction_1.Base { if (!this.signer) { throw new Error('Invalid signer'); } - const multiAttestationRequests = requests.map((r) => ({ - schema: r.schema, - data: r.data.map((d) => ({ - recipient: d.recipient ?? utils_1.ZERO_ADDRESS, - expirationTime: d.expirationTime ?? request_1.NO_EXPIRATION, - revocable: d.revocable ?? true, - refUID: d.refUID ?? utils_1.ZERO_BYTES32, - data: d.data ?? utils_1.ZERO_BYTES32, - value: d.value ?? 0n - })), - signatures: r.signatures, - attester: r.attester, - deadline: r.deadline ?? request_1.NO_EXPIRATION - })); - const requestedValue = multiAttestationRequests.reduce((res, { data }) => { - const total = data.reduce((res, r) => res + r.value, 0n); - return res + total; - }, 0n); - return new transaction_1.Transaction(await this.contract.multiAttestByDelegation.populateTransaction(multiAttestationRequests, { - value: requestedValue, - ...overrides - }), this.signer, + let tx; + if (await this.isLegacyContract()) { + const multiAttestationRequests = requests.map((r) => ({ + schema: r.schema, + data: r.data.map((d) => ({ + recipient: d.recipient ?? utils_1.ZERO_ADDRESS, + expirationTime: d.expirationTime ?? request_1.NO_EXPIRATION, + revocable: d.revocable ?? true, + refUID: d.refUID ?? utils_1.ZERO_BYTES32, + data: d.data ?? utils_1.ZERO_BYTES32, + value: d.value ?? 0n + })), + signatures: r.signatures, + attester: r.attester, + deadline: r.deadline ?? request_1.NO_EXPIRATION + })); + const requestedValue = multiAttestationRequests.reduce((res, { data }) => { + const total = data.reduce((res, r) => res + r.value, 0n); + return res + total; + }, 0n); + tx = await this.legacyEAS.contract.multiAttestByDelegation.populateTransaction(multiAttestationRequests, { + value: requestedValue, + ...overrides + }); + } + else { + const multiAttestationRequests = requests.map((r) => ({ + schema: r.schema, + data: r.data.map((d) => ({ + recipient: d.recipient ?? utils_1.ZERO_ADDRESS, + expirationTime: d.expirationTime ?? request_1.NO_EXPIRATION, + revocable: d.revocable ?? true, + refUID: d.refUID ?? utils_1.ZERO_BYTES32, + data: d.data ?? utils_1.ZERO_BYTES32, + value: d.value ?? 0n + })), + signatures: r.signatures, + attester: r.attester, + deadline: r.deadline ?? request_1.NO_EXPIRATION + })); + const requestedValue = multiAttestationRequests.reduce((res, { data }) => { + const total = data.reduce((res, r) => res + r.value, 0n); + return res + total; + }, 0n); + tx = await this.contract.multiAttestByDelegation.populateTransaction(multiAttestationRequests, { + value: requestedValue, + ...overrides + }); + } + return new transaction_1.Transaction(tx, this.signer, // eslint-disable-next-line require-await async (receipt) => (0, utils_1.getUIDsFromAttestReceipt)(receipt)); } @@ -178,16 +237,31 @@ class EAS extends transaction_1.Base { if (!this.signer) { throw new Error('Invalid signer'); } - return new transaction_1.Transaction(await this.contract.revokeByDelegation.populateTransaction({ - schema, - data: { - uid, - value - }, - signature, - revoker, - deadline - }, { value, ...overrides }), this.signer, async () => { }); + let tx; + if (await this.isLegacyContract()) { + tx = await this.legacyEAS.contract.revokeByDelegation.populateTransaction({ + schema, + data: { + uid, + value + }, + signature, + revoker + }, { value, ...overrides }); + } + else { + tx = await this.contract.revokeByDelegation.populateTransaction({ + schema, + data: { + uid, + value + }, + signature, + revoker, + deadline + }, { value, ...overrides }); + } + return new transaction_1.Transaction(tx, this.signer, async () => { }); } // Multi-revokes multiple attestations async multiRevoke(requests, overrides) { @@ -215,24 +289,50 @@ class EAS extends transaction_1.Base { if (!this.signer) { throw new Error('Invalid signer'); } - const multiRevocationRequests = requests.map((r) => ({ - schema: r.schema, - data: r.data.map((d) => ({ - uid: d.uid, - value: d.value ?? 0n - })), - signatures: r.signatures, - revoker: r.revoker, - deadline: r.deadline ?? request_1.NO_EXPIRATION - })); - const requestedValue = multiRevocationRequests.reduce((res, { data }) => { - const total = data.reduce((res, r) => res + r.value, 0n); - return res + total; - }, 0n); - return new transaction_1.Transaction(await this.contract.multiRevokeByDelegation.populateTransaction(multiRevocationRequests, { - value: requestedValue, - ...overrides - }), this.signer, async () => { }); + if (!this.signer) { + throw new Error('Invalid signer'); + } + let tx; + if (await this.isLegacyContract()) { + const multiRevocationRequests = requests.map((r) => ({ + schema: r.schema, + data: r.data.map((d) => ({ + uid: d.uid, + value: d.value ?? 0n + })), + signatures: r.signatures, + revoker: r.revoker + })); + const requestedValue = multiRevocationRequests.reduce((res, { data }) => { + const total = data.reduce((res, r) => res + r.value, 0n); + return res + total; + }, 0n); + tx = await this.legacyEAS.contract.multiRevokeByDelegation.populateTransaction(multiRevocationRequests, { + value: requestedValue, + ...overrides + }); + } + else { + const multiRevocationRequests = requests.map((r) => ({ + schema: r.schema, + data: r.data.map((d) => ({ + uid: d.uid, + value: d.value ?? 0n + })), + signatures: r.signatures, + revoker: r.revoker, + deadline: r.deadline ?? request_1.NO_EXPIRATION + })); + const requestedValue = multiRevocationRequests.reduce((res, { data }) => { + const total = data.reduce((res, r) => res + r.value, 0n); + return res + total; + }, 0n); + tx = await this.contract.multiRevokeByDelegation.populateTransaction(multiRevocationRequests, { + value: requestedValue, + ...overrides + }); + } + return new transaction_1.Transaction(tx, this.signer, async () => { }); } // Attests to a specific schema via an EIP712 delegation request using an external EIP712 proxy attestByDelegationProxy(request, overrides) { @@ -318,7 +418,7 @@ class EAS extends transaction_1.Base { async setDelegated() { this.delegated = new offchain_1.Delegated({ address: await this.contract.getAddress(), - version: await this.getVersion(), + domainSeparator: await this.getDomainSeparator(), chainId: await this.getChainId() }); return this.delegated; @@ -332,6 +432,9 @@ class EAS extends transaction_1.Base { }, offchain_1.OffchainAttestationVersion.Version2, this); return this.offchain; } + async isLegacyContract() { + return semver_1.default.lte(await this.getVersion(), LEGACY_VERSION); + } } exports.EAS = EAS; //# sourceMappingURL=eas.js.map \ No newline at end of file diff --git a/dist/eas.js.map b/dist/eas.js.map index d7d3dee..122cfc2 100644 --- a/dist/eas.js.map +++ b/dist/eas.js.map @@ -1 +1 @@ -{"version":3,"file":"eas.js","sourceRoot":"","sources":["../src/eas.ts"],"names":[],"mappings":";;;;AAAA,+EAA+F;AAG/F,8CAAiD;AACjD,yCAA6E;AAC7E,uCAcmB;AACnB,+CAAqE;AACrE,mCAMiB;AAEjB,oDAA0B;AAoB1B,MAAa,GAAI,SAAQ,kBAAiB;IAChC,KAAK,CAAe;IACpB,SAAS,CAAa;IACtB,QAAQ,CAAY;IAE5B,YAAY,OAAe,EAAE,OAAoB;QAC/C,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;QAExC,KAAK,CAAC,IAAI,4BAAY,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAE3C,oCAAoC;QACpC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,sFAAsF,CAAC,CAAC;QAC1G,CAAC;QAED,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACrB,CAAC;IACH,CAAC;IAED,wCAAwC;IACjC,OAAO,CAAC,MAAyB;QACtC,OAAO,IAAI,CAAC,SAAS,CAAC;QACtB,OAAO,IAAI,CAAC,QA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AAW;QACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,mBAAQ,CAC1B;YACE,OAAO,EAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;YACzC,OAAO,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE;YAChC,OAAO,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE;SACjC,EACD,qCAA0B,CAAC,QAAQ,EACnC,IAAI,CACL,CAAC;QAEF,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAEO,KAAK,CAAC,gBAAgB;QAC5B,OAAO,gBAAM,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,UAAU,EAAE,EAAE,cAAc,CAAC,CAAC;IAC7D,CAAC;CACF;AAhmBD,kBAgmBC"} \ No newline at end of file diff --git a/dist/offchain/delegated.d.ts b/dist/offchain/delegated.d.ts index 61087d8..0724452 100644 --- a/dist/offchain/delegated.d.ts +++ b/dist/offchain/delegated.d.ts @@ -1,7 +1,6 @@ -import { EIP712MessageTypes, EIP712Params, EIP712Response, PartialTypedDataConfig, TypeDataSigner, TypedDataHandler } from './typed-data-handler'; -export { EIP712MessageTypes, EIP712TypedData, EIP712Request, EIP712Response, PartialTypedDataConfig, Signature } from './typed-data-handler'; -export declare const EIP712_NAME = "EAS"; -export declare enum DelegatedAttestationVersion { +import { EIP712MessageTypes, EIP712Params, EIP712Response, TypeDataSigner, TypedDataHandler } from './typed-data-handler'; +export { EIP712MessageTypes, EIP712TypedData, EIP712Request, EIP712Response, Signature } from './typed-data-handler'; +declare enum DelegatedAttestationVersion { Legacy = 0, Version1 = 1, Version2 = 2 @@ -22,11 +21,17 @@ export type EIP712RevocationParams = EIP712Params & { value: bigint; deadline: bigint; }; +interface DelegatedConfig { + address: string; + chainId: bigint; + version?: string; + domainSeparator?: string; +} export declare class Delegated extends TypedDataHandler { readonly version: DelegatedAttestationVersion; private readonly attestType; private readonly revokeType; - constructor(config: PartialTypedDataConfig); + constructor(config: DelegatedConfig); signDelegatedAttestation(params: EIP712AttestationParams, signer: TypeDataSigner): Promise>; verifyDelegatedAttestationSignature(attester: string, response: EIP712Response): boolean; signDelegatedRevocation(params: EIP712RevocationParams, signer: TypeDataSigner): Promise>; diff --git a/dist/offchain/delegated.js b/dist/offchain/delegated.js index 0647c46..8f7389a 100644 --- a/dist/offchain/delegated.js +++ b/dist/offchain/delegated.js @@ -1,17 +1,17 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.Delegated = exports.DelegatedAttestationVersion = exports.EIP712_NAME = void 0; +exports.Delegated = void 0; const tslib_1 = require("tslib"); const omit_1 = tslib_1.__importDefault(require("lodash/omit")); const semver_1 = tslib_1.__importDefault(require("semver")); const typed_data_handler_1 = require("./typed-data-handler"); -exports.EIP712_NAME = 'EAS'; +const versions_1 = require("./versions"); var DelegatedAttestationVersion; (function (DelegatedAttestationVersion) { DelegatedAttestationVersion[DelegatedAttestationVersion["Legacy"] = 0] = "Legacy"; DelegatedAttestationVersion[DelegatedAttestationVersion["Version1"] = 1] = "Version1"; DelegatedAttestationVersion[DelegatedAttestationVersion["Version2"] = 2] = "Version2"; -})(DelegatedAttestationVersion || (exports.DelegatedAttestationVersion = DelegatedAttestationVersion = {})); +})(DelegatedAttestationVersion || (DelegatedAttestationVersion = {})); const DELEGATED_ATTESTATION_TYPES = { [DelegatedAttestationVersion.Legacy]: { typedSignature: 'Attest(bytes32 schema,address recipient,uint64 expirationTime,bool revocable,bytes32 refUID,bytes data,uint256 nonce)', @@ -109,11 +109,34 @@ class Delegated extends typed_data_handler_1.TypedDataHandler { attestType; revokeType; constructor(config) { - super({ ...config, name: exports.EIP712_NAME }); - if (semver_1.default.lt(config.version, '1.2.0')) { + let { version } = config; + if (!version) { + const { domainSeparator } = config; + if (!domainSeparator) { + throw new Error('Neither EIP712 version or domain separator were provided'); + } + // If only the domain separator was provided, let's try to deduce the version accordingly. + for (const eip712Version of versions_1.EIP712_VERSIONS) { + if (domainSeparator === + typed_data_handler_1.TypedDataHandler.getDomainSeparator({ + address: config.address, + name: versions_1.EIP712_NAME, + version: eip712Version, + chainId: config.chainId + })) { + version = eip712Version; + break; + } + } + if (!version) { + throw new Error(`Unable to find version for domain separator: ${domainSeparator}`); + } + } + super({ ...config, version, name: versions_1.EIP712_NAME }); + if (semver_1.default.lt(version, '1.2.0')) { this.version = DelegatedAttestationVersion.Legacy; } - else if (semver_1.default.lt(config.version, '1.3.0')) { + else if (semver_1.default.lt(version, '1.3.0')) { this.version = DelegatedAttestationVersion.Version1; } else { @@ -127,9 +150,10 @@ class Delegated extends typed_data_handler_1.TypedDataHandler { attester: await signer.getAddress(), ...params }; - if (this.version === DelegatedAttestationVersion.Legacy) { - // Committing to a value or to a deadline isn't supported for legacy attestations, therefore they will be ignored - effectiveParams = (0, omit_1.default)(params, ['value', 'deadline']); + switch (this.version) { + case DelegatedAttestationVersion.Legacy: + effectiveParams = (0, omit_1.default)(params, ['value', 'deadline']); + break; } return this.signTypedDataRequest(effectiveParams, { domain: this.getDomainTypedData(), @@ -149,9 +173,10 @@ class Delegated extends typed_data_handler_1.TypedDataHandler { revoker: await signer.getAddress(), ...params }; - if (this.version === DelegatedAttestationVersion.Legacy) { - // Committing to a value or to a deadline isn't supported for legacy revocations, therefore they will be ignored - effectiveParams = (0, omit_1.default)(params, ['value', 'deadline']); + switch (this.version) { + case DelegatedAttestationVersion.Legacy: + effectiveParams = (0, omit_1.default)(params, ['value', 'deadline']); + break; } return this.signTypedDataRequest(effectiveParams, { domain: this.getDomainTypedData(), diff --git a/dist/offchain/delegated.js.map b/dist/offchain/delegated.js.map index d967edf..9334481 100644 --- a/dist/offchain/delegated.js.map +++ b/dist/offchain/delegated.js.map @@ -1 +1 @@ -{"version":3,"file":"delegated.js","sourceRoot":"","sources":["../../src/offchain/delegated.ts"],"names":[],"mappings":";;;;AAAA,+DAA+B;AAC/B,4DAA4B;AAC5B,6DAQ8B;AAWjB,QAAA,WAAW,GAAG,KAAK,CAAC;AAEjC,IAAY,2BA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AA+B;YAChD,OAAO,EAAE,MAAM,MAAM,CAAC,UAAU,EAAE;YAClC,GAAG,MAAM;SACV,CAAC;QAEF,QAAQ,IAAI,CAAC,OAAO,EAAE,CAAC;YACrB,KAAK,2BAA2B,CAAC,MAAM;gBACrC,eAAe,GAAG,IAAA,cAAI,EAAC,MAAM,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC,CAA+B,CAAC;gBAEpF,MAAM;QACV,CAAC;QAED,OAAO,IAAI,CAAC,oBAAoB,CAC9B,eAAe,EACf;YACE,MAAM,EAAE,IAAI,CAAC,kBAAkB,EAAE;YACjC,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,WAAW;YACxC,OAAO,EAAE,eAAe;YACxB,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK;SAC7B,EACD,MAAM,CACP,CAAC;IACJ,CAAC;IAEM,kCAAkC,CACvC,OAAe,EACf,QAAoE;QAEpE,OAAO,IAAI,CAAC,+BAA+B,CACzC,OAAO,EACP,EAAE,GAAG,QAAQ,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAC,OAAO,EAAE,EAAE,EAC1D;YACE,WAAW,EAAE,IAAI,CAAC,UAAU,CAAC,WAAW;YACxC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK;SAC7B,CACF,CAAC;IACJ,CAAC;CACF;AArID,8BAqIC"} \ No newline at end of file diff --git a/dist/offchain/offchain.d.ts b/dist/offchain/offchain.d.ts index fbadbf3..f9ea917 100644 --- a/dist/offchain/offchain.d.ts +++ b/dist/offchain/offchain.d.ts @@ -1,6 +1,6 @@ import { EAS } from '../eas'; -import { DomainTypedData, EIP712MessageTypes, EIP712Params, EIP712Response, EIP712Types, PartialTypedDataConfig, TypeDataSigner, TypedDataHandler } from './typed-data-handler'; -export { EIP712Request, PartialTypedDataConfig, EIP712MessageTypes } from './typed-data-handler'; +import { DomainTypedData, EIP712MessageTypes, EIP712Params, EIP712Response, EIP712Types, TypeDataSigner, TypedDataHandler } from './typed-data-handler'; +export { EIP712Request, EIP712MessageTypes } from './typed-data-handler'; export interface OffchainAttestationType extends EIP712Types { domain: string; } @@ -32,12 +32,17 @@ export interface SignedOffchainAttestation extends EIP712Response; diff --git a/dist/offchain/offchain.js b/dist/offchain/offchain.js index 1f44658..6354739 100644 --- a/dist/offchain/offchain.js +++ b/dist/offchain/offchain.js @@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.Offchain = exports.SALT_SIZE = exports.OFFCHAIN_ATTESTATION_TYPES = exports.OffchainAttestationVersion = void 0; const ethers_1 = require("ethers"); const utils_1 = require("../utils"); -const delegated_1 = require("./delegated"); const typed_data_handler_1 = require("./typed-data-handler"); +const versions_1 = require("./versions"); var OffchainAttestationVersion; (function (OffchainAttestationVersion) { OffchainAttestationVersion[OffchainAttestationVersion["Legacy"] = 0] = "Legacy"; @@ -110,7 +110,7 @@ class Offchain extends typed_data_handler_1.TypedDataHandler { if (version > OffchainAttestationVersion.Version2) { throw new Error('Unsupported version'); } - super({ ...config, name: delegated_1.EIP712_NAME }); + super({ ...config, name: versions_1.EIP712_NAME }); this.version = version; this.verificationTypes = exports.OFFCHAIN_ATTESTATION_TYPES[this.version]; this.signingType = this.verificationTypes[0]; diff --git a/dist/offchain/offchain.js.map b/dist/offchain/offchain.js.map index 7c0d3dc..3376c0c 100644 --- a/dist/offchain/offchain.js.map +++ b/dist/offchain/offchain.js.map @@ -1 +1 @@ -{"version":3,"file":"offchain.js","sourceRoot":"","sources":["../../src/offchain/offchain.ts"],"names":[],"mappings":";;;AAAA,mCAAgF;AAEhF,oCAAwD;AACxD,2CAA0C;AAC1C,6DAW8B;AAQ9B,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IACpC,+EAAU,CAAA;IACV,mFAAY,CAAA;IACZ,mFAAY,CAAA;AACd,CAAC,EAJW,0BAA0B,0CAA1B,0BAA0B,QAIrC;AAEY,QAAA,0BAA0B,GAAkE;IACvG,CAAC,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AAC,OAAO,CAAC,MAAM,EAC1B,WAAW,CAAC,OAAO,CAAC,SAAS,EAC7B,WAAW,CAAC,OAAO,CAAC,IAAI,EACxB,WAAW,CAAC,OAAO,CAAC,cAAc,EAClC,WAAW,CAAC,OAAO,CAAC,SAAS,EAC7B,WAAW,CAAC,OAAO,CAAC,MAAM,EAC1B,WAAW,CAAC,OAAO,CAAC,IAAI,EACxB,WAAW,CAAC,OAAO,CAAC,IAAI,CACzB,CAAC;IACJ,CAAC;CACF;AA/ID,4BA+IC"} \ No newline at end of file diff --git a/dist/offchain/typed-data-handler.d.ts b/dist/offchain/typed-data-handler.d.ts index 421f41f..fb754df 100644 --- a/dist/offchain/typed-data-handler.d.ts +++ b/dist/offchain/typed-data-handler.d.ts @@ -2,14 +2,6 @@ import { Addressable, TypedDataDomain, TypedDataField } from 'ethers'; export interface TypeDataSigner extends Addressable { signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; } -export interface PartialTypedDataConfig { - address: string; - version: string; - chainId: bigint; -} -export interface TypedDataConfig extends PartialTypedDataConfig { - name: string; -} export interface DomainTypedData { chainId: bigint; name: string; @@ -62,10 +54,17 @@ export declare class InvalidTypes extends Error { } export declare class InvalidAddress extends Error { } +export interface TypedDataConfig { + address: string; + version: string; + chainId: bigint; + name: string; +} export declare abstract class TypedDataHandler { config: TypedDataConfig; constructor(config: TypedDataConfig); getDomainSeparator(): string; + static getDomainSeparator(config: TypedDataConfig): string; getDomainTypedData(): DomainTypedData; signTypedDataRequest(params: P, types: EIP712TypedData, signer: TypeDataSigner): Promise>; verifyTypedDataRequestSignature(attester: string, response: EIP712Response, types: EIP712Types, strict?: boolean): boolean; diff --git a/dist/offchain/typed-data-handler.js b/dist/offchain/typed-data-handler.js index 3ed096a..cf82d5c 100644 --- a/dist/offchain/typed-data-handler.js +++ b/dist/offchain/typed-data-handler.js @@ -24,12 +24,15 @@ class TypedDataHandler { this.config = config; } getDomainSeparator() { + return TypedDataHandler.getDomainSeparator(this.config); + } + static getDomainSeparator(config) { return (0, ethers_1.keccak256)(ethers_1.AbiCoder.defaultAbiCoder().encode(['bytes32', 'bytes32', 'bytes32', 'uint256', 'address'], [ (0, ethers_1.keccak256)((0, ethers_1.toUtf8Bytes)(exports.EIP712_DOMAIN)), - (0, ethers_1.keccak256)((0, ethers_1.toUtf8Bytes)(this.config.name)), - (0, ethers_1.keccak256)((0, ethers_1.toUtf8Bytes)(this.config.version)), - this.config.chainId, - this.config.address + (0, ethers_1.keccak256)((0, ethers_1.toUtf8Bytes)(config.name)), + (0, ethers_1.keccak256)((0, ethers_1.toUtf8Bytes)(config.version)), + config.chainId, + config.address ])); } getDomainTypedData() { diff --git a/dist/offchain/typed-data-handler.js.map b/dist/offchain/typed-data-handler.js.map index cfa0d9c..94cde81 100644 --- a/dist/offchain/typed-data-handler.js.map +++ b/dist/offchain/typed-data-handler.js.map @@ -1 +1 @@ -{"version":3,"file":"typed-data-handler.js","sourceRoot":"","sources":["../../src/offchain/typed-data-handler.ts"],"names":[],"mappings":";;;;AAAA,mCAWgB;AAChB,qEAAqC;AACrC,oCAAwC;AAsF3B,QAAA,aAAa,GAAG,oFAAoF,CAAC;AAElH,MAAa,aAAc,SAAQ,KAAK;CAAG;AAA3C,sCAA2C;AAC3C,MAAa,kBAAmB,SAAQ,KAAK;CAAG;AAAhD,gDAAgD;AAChD,MAAa,YAAa,SAAQ,KAAK;CAAG;AAA1C,oCAA0C;AAC1C,MAAa,cAAe,SAAQ,KAAK;CAAG;AAA5C,wCAA4C;AAE5C,MAAsB,gBAAgB;IAC7B,MAAM,CAAkB;IAE/B,YAAY,MAAuB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAEM,kBAAkB;QACvB,OAAO,IAAA,kBAAS,EACd,iBAAQ,CAAC,eAAe,EAAE,CAAC,MAAM,CAC/B,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,EACvD;YACE,IAAA,kB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newline at end of file +{"version":3,"file":"typed-data-handler.js","sourceRoot":"","sources":["../../src/offchain/typed-data-handler.ts"],"names":[],"mappings":";;;;AAAA,mCAWgB;AAChB,qEAAqC;AACrC,oCAAwC;AA4E3B,QAAA,aAAa,GAAG,oFAAoF,CAAC;AAElH,MAAa,aAAc,SAAQ,KAAK;CAAG;AAA3C,sCAA2C;AAC3C,MAAa,kBAAmB,SAAQ,KAAK;CAAG;AAAhD,gDAAgD;AAChD,MAAa,YAAa,SAAQ,KAAK;CAAG;AAA1C,oCAA0C;AAC1C,MAAa,cAAe,SAAQ,KAAK;CAAG;AAA5C,wCAA4C;AAS5C,MAAsB,gBAAgB;IAC7B,MAAM,CAAkB;IAE/B,YAAY,MAAuB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAEM,kBAAkB;QACvB,OAAO,gBAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC1D,CAAC;IAEM,MAAM,CAAC,kBAAkB,CAAC,MAAuB;QACtD,OAAO,IAAA,kBAAS,EACd,iBAAQ,CAAC,eAAe,EAAE,CAAC,MAAM,CAC/B,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,EACvD;YACE,IAAA,kBAAS,EAAC,IAAA,oBAAW,EAAC,qBAAa,CAAC,CAAC;YACrC,IAAA,kBAAS,EAAC,IAAA,oBAAW,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACnC,IAAA,kBAAS,EAAC,IAAA,oBAAW,EAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACtC,MAAM,CAAC,OAAO;YACd,MAAM,CAAC,OAAO;SACf,CACF,CACF,CAAC;IACJ,CAAC;IAEM,kBAAkB;QACvB,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;YACtB,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO;YAC5B,OAAO,EAAE,IAAI,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,EAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1C,MAAM,IAAI,YAAY,EAAE,CAAC;QAC3B,CAAC;QAED,IAAI,QAAQ,KAAK,oBAAY,EAAE,CAAC;YAC9B,MAAM,IAAI,cAAc,EAAE,CAAC;QAC7B,CAAC;QAED,MAAM,EAAE,SAAS,EAAE,GAAG,QAAQ,CAAC;QAC/B,MAAM,GAAG,GAAG,kBAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,IAAA,gBAAO,EAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAA,gBAAO,EAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC;QACtG,MAAM,gBAAgB,GAAG,IAAA,wBAAe,EAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAExF,OAAO,IAAA,mBAAU,EAAC,QAAQ,CAAC,KAAK,IAAA,mBAAU,EAAC,gBAAgB,CAAC,CAAC;IAC/D,CAAC;CACF;AAlFD,4CAkFC"} \ No newline at end of file diff --git a/dist/offchain/versions.d.ts b/dist/offchain/versions.d.ts new file mode 100644 index 0000000..93e26ba --- /dev/null +++ b/dist/offchain/versions.d.ts @@ -0,0 +1,2 @@ +export declare const EIP712_NAME = "EAS"; +export declare const EIP712_VERSIONS: string[]; diff --git a/dist/offchain/versions.js b/dist/offchain/versions.js new file mode 100644 index 0000000..365a212 --- /dev/null +++ b/dist/offchain/versions.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.EIP712_VERSIONS = exports.EIP712_NAME = void 0; +exports.EIP712_NAME = 'EAS'; +exports.EIP712_VERSIONS = ['0.26', '1.0.0', '1.0.1', '1.0.2', '1.1.0', '1.2.0', '1.3.0', '1.4.0']; +//# sourceMappingURL=versions.js.map \ No newline at end of file diff --git a/dist/offchain/versions.js.map b/dist/offchain/versions.js.map new file mode 100644 index 0000000..d2229ef --- /dev/null +++ b/dist/offchain/versions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../src/offchain/versions.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG,KAAK,CAAC;AACpB,QAAA,eAAe,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC"} \ No newline at end of file diff --git a/package.json b/package.json index 312e028..dcad063 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ethereum-attestation-service/eas-sdk", - "version": "2.0.1-beta.1", + "version": "2.1.0-beta.1", "description": "Ethereum Attestation Service - TypeScript/JavaScript SDK", "repository": "git@github.com:ethereum-attestation-service/eas-sdk.git", "author": "Leonid Beder ", @@ -19,6 +19,7 @@ }, "dependencies": { "@ethereum-attestation-service/eas-contracts": "1.3.7", + "@ethereum-attestation-service/eas-contracts-legacy": "npm:@ethereum-attestation-service/eas-contracts@1.0.0-beta.0", "ethers": "^6.11.1", "js-base64": "^3.7.7", "lodash": "^4.17.21", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e3980a4..c20d374 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ dependencies: '@ethereum-attestation-service/eas-contracts': specifier: 1.3.7 version: 1.3.7(ts-node@10.9.2)(typescript@5.4.2) + '@ethereum-attestation-service/eas-contracts-legacy': + specifier: npm:@ethereum-attestation-service/eas-contracts@1.0.0-beta.0 + version: /@ethereum-attestation-service/eas-contracts@1.0.0-beta.0(ts-node@10.9.2)(typescript@5.4.2) ethers: specifier: ^6.11.1 version: 6.11.1 @@ -88,12 +91,20 @@ packages: resolution: {integrity: sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==} dev: false - /@ampproject/remapping@2.3.0: - resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} + /@ampproject/remapping@2.2.1: + resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} engines: {node: '>=6.0.0'} dependencies: - '@jridgewell/gen-mapping': 0.3.5 - '@jridgewell/trace-mapping': 0.3.25 + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.22 + dev: true + + /@babel/code-frame@7.23.5: + resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/highlight': 7.23.4 + chalk: 2.4.2 dev: true /@babel/code-frame@7.24.2: @@ -104,22 +115,22 @@ packages: picocolors: 1.0.0 dev: true - /@babel/compat-data@7.24.1: - resolution: {integrity: sha512-Pc65opHDliVpRHuKfzI+gSA4zcgr65O4cl64fFJIWEEh8JoHIHh0Oez1Eo8Arz8zq/JhgKodQaxEwUPRtZylVA==} + /@babel/compat-data@7.23.5: + resolution: {integrity: sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==} engines: {node: '>=6.9.0'} dev: true - /@babel/core@7.24.3: - resolution: {integrity: sha512-5FcvN1JHw2sHJChotgx8Ek0lyuh4kCKelgMTTqhYJJtloNvUfpAFMeNQUtdlIaktwrSV9LtCdqwk48wL2wBacQ==} + /@babel/core@7.24.4: + resolution: {integrity: sha512-MBVlMXP+kkl5394RBLSxxk/iLTeVGuXTV3cIDXavPpMMqnSnt6apKgan/U8O3USWZCWZT/TbgfEpKa4uMgN4Dg==} engines: {node: '>=6.9.0'} dependencies: - '@ampproject/remapping': 2.3.0 + '@ampproject/remapping': 2.2.1 '@babel/code-frame': 7.24.2 - '@babel/generator': 7.24.1 + '@babel/generator': 7.24.4 '@babel/helper-compilation-targets': 7.23.6 - '@babel/helper-module-transforms': 7.23.3(@babel/core@7.24.3) - '@babel/helpers': 7.24.1 - '@babel/parser': 7.24.1 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.24.4) + '@babel/helpers': 7.24.4 + '@babel/parser': 7.24.4 '@babel/template': 7.24.0 '@babel/traverse': 7.24.1 '@babel/types': 7.24.0 @@ -132,8 +143,18 @@ packages: - supports-color dev: true - /@babel/generator@7.24.1: - resolution: {integrity: sha512-DfCRfZsBcrPEHUfuBMgbJ1Ut01Y/itOs+hY2nFLgqsqXd52/iSiVq5TITtUasIUgm+IIKdY2/1I7auiQOEeC9A==} + /@babel/generator@7.23.6: + resolution: {integrity: sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.24.0 + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.22 + jsesc: 2.5.2 + dev: true + + /@babel/generator@7.24.4: + resolution: {integrity: sha512-Xd6+v6SnjWVx/nus+y0l1sxMOTOMBkyL4+BIdbALyatQnAe/SRVjANeDPSCYaX+i1iJmuGSKf3Z+E+V/va1Hvw==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.24.0 @@ -146,9 +167,9 @@ packages: resolution: {integrity: sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/compat-data': 7.24.1 + '@babel/compat-data': 7.23.5 '@babel/helper-validator-option': 7.23.5 - browserslist: 4.23.0 + browserslist: 4.22.3 lru-cache: 5.1.1 semver: 6.3.1 dev: true @@ -162,7 +183,7 @@ packages: resolution: {integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.24.0 + '@babel/template': 7.23.9 '@babel/types': 7.24.0 dev: true @@ -173,22 +194,22 @@ packages: '@babel/types': 7.24.0 dev: true - /@babel/helper-module-imports@7.24.3: - resolution: {integrity: sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg==} + /@babel/helper-module-imports@7.22.15: + resolution: {integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.24.0 dev: true - /@babel/helper-module-transforms@7.23.3(@babel/core@7.24.3): + /@babel/helper-module-transforms@7.23.3(@babel/core@7.24.4): resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.24.3 + '@babel/core': 7.24.4 '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-module-imports': 7.24.3 + '@babel/helper-module-imports': 7.22.15 '@babel/helper-simple-access': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 '@babel/helper-validator-identifier': 7.22.20 @@ -208,8 +229,8 @@ packages: '@babel/types': 7.24.0 dev: true - /@babel/helper-string-parser@7.24.1: - resolution: {integrity: sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==} + /@babel/helper-string-parser@7.23.4: + resolution: {integrity: sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==} engines: {node: '>=6.9.0'} dev: true @@ -223,8 +244,8 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helpers@7.24.1: - resolution: {integrity: sha512-BpU09QqEe6ZCHuIHFphEFgvNSrubve1FtyMton26ekZ85gRGi6LrTF7zArARp2YvyFxloeiRmtSCq5sjh1WqIg==} + /@babel/helpers@7.24.4: + resolution: {integrity: sha512-FewdlZbSiwaVGlgT1DPANDuCHaDMiOo+D/IDYRFYjHOuv66xMSJ7fQwwODwRNAPkADIO/z1EoF/l2BCWlWABDw==} engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.24.0 @@ -234,6 +255,15 @@ packages: - supports-color dev: true + /@babel/highlight@7.23.4: + resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-validator-identifier': 7.22.20 + chalk: 2.4.2 + js-tokens: 4.0.0 + dev: true + /@babel/highlight@7.24.2: resolution: {integrity: sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==} engines: {node: '>=6.9.0'} @@ -244,20 +274,29 @@ packages: picocolors: 1.0.0 dev: true - /@babel/parser@7.24.1: - resolution: {integrity: sha512-Zo9c7N3xdOIQrNip7Lc9wvRPzlRtovHVE4lkz8WEDr7uYh/GMQhSiIgFxGIArRHYdJE5kxtZjAf8rT0xhdLCzg==} + /@babel/parser@7.24.4: + resolution: {integrity: sha512-zTvEBcghmeBma9QIGunWevvBAp4/Qu9Bdq+2k0Ot4fVMD6v3dsC9WOcRSKk7tRRyBM/53yKMJko9xOatGQAwSg==} engines: {node: '>=6.0.0'} hasBin: true dependencies: '@babel/types': 7.24.0 dev: true + /@babel/template@7.23.9: + resolution: {integrity: sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.24.2 + '@babel/parser': 7.24.4 + '@babel/types': 7.24.0 + dev: true + /@babel/template@7.24.0: resolution: {integrity: sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==} engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.24.2 - '@babel/parser': 7.24.1 + '@babel/parser': 7.24.4 '@babel/types': 7.24.0 dev: true @@ -266,12 +305,12 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.24.2 - '@babel/generator': 7.24.1 + '@babel/generator': 7.24.4 '@babel/helper-environment-visitor': 7.22.20 '@babel/helper-function-name': 7.23.0 '@babel/helper-hoist-variables': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 - '@babel/parser': 7.24.1 + '@babel/parser': 7.24.4 '@babel/types': 7.24.0 debug: 4.3.4(supports-color@8.1.1) globals: 11.12.0 @@ -283,7 +322,7 @@ packages: resolution: {integrity: sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-string-parser': 7.24.1 + '@babel/helper-string-parser': 7.23.4 '@babel/helper-validator-identifier': 7.22.20 to-fast-properties: 2.0.0 dev: true @@ -362,6 +401,18 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true + /@ethereum-attestation-service/eas-contracts@1.0.0-beta.0(ts-node@10.9.2)(typescript@5.4.2): + resolution: {integrity: sha512-kMe8XVl5QXI1L8ANqlVJqLv3WDs2uzz9+dzY9LUXvBKWF00tBhNji9lxEg4LKN0vz4YVL9bAUDuDeeSv8BOWdw==} + dependencies: + hardhat: 2.17.0(ts-node@10.9.2)(typescript@5.4.2) + transitivePeerDependencies: + - bufferutil + - supports-color + - ts-node + - typescript + - utf-8-validate + dev: false + /@ethereum-attestation-service/eas-contracts@1.3.7(ts-node@10.9.2)(typescript@5.4.2): resolution: {integrity: sha512-msCKGDhqSjfkx0lbs0PPkf/Z6bWxaYT9ze/uLoRh1tM7W8N27mobX4g6AsjATqGC+eWHRfliK9eCwJQj7TU8WA==} dependencies: @@ -721,8 +772,8 @@ packages: '@ethersproject/strings': 5.7.0 dev: false - /@fastify/busboy@2.1.1: - resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} + /@fastify/busboy@2.1.0: + resolution: {integrity: sha512-+KpH+QxZU7O4675t3mnkQKcZZg56u+K/Ct2K+N2AZYNVK8kyeo/bI18tI8aPm3tvNNRyTWfj6s5tnGNlcbQRsA==} engines: {node: '>=14'} dev: false @@ -755,9 +806,9 @@ packages: '@vue/compiler-sfc': optional: true dependencies: - '@babel/core': 7.24.3 - '@babel/generator': 7.24.1 - '@babel/parser': 7.24.1 + '@babel/core': 7.24.4 + '@babel/generator': 7.23.6 + '@babel/parser': 7.24.4 '@babel/traverse': 7.24.1 '@babel/types': 7.24.0 prettier: 3.2.5 @@ -766,6 +817,15 @@ packages: - supports-color dev: true + /@jridgewell/gen-mapping@0.3.3: + resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/set-array': 1.1.2 + '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/trace-mapping': 0.3.22 + dev: true + /@jridgewell/gen-mapping@0.3.5: resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} engines: {node: '>=6.0.0'} @@ -775,10 +835,15 @@ packages: '@jridgewell/trace-mapping': 0.3.25 dev: true - /@jridgewell/resolve-uri@3.1.2: - resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} + /@jridgewell/resolve-uri@3.1.1: + resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==} engines: {node: '>=6.0.0'} + /@jridgewell/set-array@1.1.2: + resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} + engines: {node: '>=6.0.0'} + dev: true + /@jridgewell/set-array@1.2.1: resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} engines: {node: '>=6.0.0'} @@ -787,25 +852,32 @@ packages: /@jridgewell/sourcemap-codec@1.4.15: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} + /@jridgewell/trace-mapping@0.3.22: + resolution: {integrity: sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==} + dependencies: + '@jridgewell/resolve-uri': 3.1.1 + '@jridgewell/sourcemap-codec': 1.4.15 + dev: true + /@jridgewell/trace-mapping@0.3.25: resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} dependencies: - '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/resolve-uri': 3.1.1 '@jridgewell/sourcemap-codec': 1.4.15 dev: true /@jridgewell/trace-mapping@0.3.9: resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} dependencies: - '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/resolve-uri': 3.1.1 '@jridgewell/sourcemap-codec': 1.4.15 /@metamask/abi-utils@2.0.2: resolution: {integrity: sha512-B/A1dY/w4F/t6cDHUscklO6ovb/ztFsrsTXFd8QlqSByk/vyy+QbPE3VVpmmyI/7RX+PA1AJcvBdzCIz+r9dVQ==} engines: {node: '>=16.0.0'} dependencies: - '@metamask/utils': 8.4.0 - superstruct: 1.0.4 + '@metamask/utils': 8.3.0 + superstruct: 1.0.3 transitivePeerDependencies: - supports-color dev: true @@ -827,7 +899,7 @@ packages: dependencies: '@ethereumjs/util': 8.1.0 '@metamask/abi-utils': 2.0.2 - '@metamask/utils': 8.4.0 + '@metamask/utils': 8.3.0 ethereum-cryptography: 2.1.3 tweetnacl: 1.0.3 tweetnacl-util: 0.15.1 @@ -835,19 +907,18 @@ packages: - supports-color dev: true - /@metamask/utils@8.4.0: - resolution: {integrity: sha512-dbIc3C7alOe0agCuBHM1h71UaEaEqOk2W8rAtEn8QGz4haH2Qq7MoK6i7v2guzvkJVVh79c+QCzIqphC3KvrJg==} + /@metamask/utils@8.3.0: + resolution: {integrity: sha512-WFVcMPEkKKRCJ8DDkZUTVbLlpwgRn98F4VM/WzN89HM8PmHMnCyk/oG0AmK/seOxtik7uC7Bbi2YBC5Z5XB2zw==} engines: {node: '>=16.0.0'} dependencies: '@ethereumjs/tx': 4.2.0 - '@noble/hashes': 1.4.0 - '@scure/base': 1.1.6 + '@noble/hashes': 1.3.3 + '@scure/base': 1.1.5 '@types/debug': 4.1.12 debug: 4.3.4(supports-color@8.1.1) pony-cause: 2.1.10 semver: 7.6.0 - superstruct: 1.0.4 - uuid: 9.0.1 + superstruct: 1.0.3 transitivePeerDependencies: - supports-color dev: true @@ -878,11 +949,6 @@ packages: engines: {node: '>= 16'} dev: true - /@noble/hashes@1.4.0: - resolution: {integrity: sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==} - engines: {node: '>= 16'} - dev: true - /@noble/secp256k1@1.7.1: resolution: {integrity: sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==} dev: false @@ -905,9 +971,25 @@ packages: engines: {node: '>= 8'} dependencies: '@nodelib/fs.scandir': 2.1.5 - fastq: 1.17.1 + fastq: 1.17.0 dev: true + /@nomicfoundation/ethereumjs-block@5.0.1: + resolution: {integrity: sha512-u1Yioemi6Ckj3xspygu/SfFvm8vZEO8/Yx5a1QLzi6nVU0jz3Pg2OmHKJ5w+D9Ogk1vhwRiqEBAqcb0GVhCyHw==} + engines: {node: '>=14'} + dependencies: + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-trie': 6.0.1 + '@nomicfoundation/ethereumjs-tx': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + ethereum-cryptography: 0.1.3 + ethers: 5.7.2 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: false + /@nomicfoundation/ethereumjs-block@5.0.2: resolution: {integrity: sha512-hSe6CuHI4SsSiWWjHDIzWhSiAVpzMUcDRpWYzN0T9l8/Rz7xNn3elwVOJ/tAyS0LqL6vitUD78Uk7lQDXZun7Q==} engines: {node: '>=14'} @@ -924,6 +1006,29 @@ packages: - utf-8-validate dev: false + /@nomicfoundation/ethereumjs-blockchain@7.0.1: + resolution: {integrity: sha512-NhzndlGg829XXbqJEYrF1VeZhAwSPgsK/OB7TVrdzft3y918hW5KNd7gIZ85sn6peDZOdjBsAXIpXZ38oBYE5A==} + engines: {node: '>=14'} + dependencies: + '@nomicfoundation/ethereumjs-block': 5.0.1 + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-ethash': 3.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-trie': 6.0.1 + '@nomicfoundation/ethereumjs-tx': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + abstract-level: 1.0.4 + debug: 4.3.4(supports-color@8.1.1) + ethereum-cryptography: 0.1.3 + level: 8.0.1 + lru-cache: 5.1.1 + memory-level: 1.0.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: false + /@nomicfoundation/ethereumjs-blockchain@7.0.2: resolution: {integrity: sha512-8UUsSXJs+MFfIIAKdh3cG16iNmWzWC/91P40sazNvrqhhdR/RtGDlFk2iFTGbBAZPs2+klZVzhRX8m2wvuvz3w==} engines: {node: '>=14'} @@ -947,6 +1052,13 @@ packages: - utf-8-validate dev: false + /@nomicfoundation/ethereumjs-common@4.0.1: + resolution: {integrity: sha512-OBErlkfp54GpeiE06brBW/TTbtbuBJV5YI5Nz/aB2evTDo+KawyEzPjBlSr84z/8MFfj8wS2wxzQX1o32cev5g==} + dependencies: + '@nomicfoundation/ethereumjs-util': 9.0.1 + crc-32: 1.2.2 + dev: false + /@nomicfoundation/ethereumjs-common@4.0.2: resolution: {integrity: sha512-I2WGP3HMGsOoycSdOTSqIaES0ughQTueOsddJ36aYVpI3SN8YSusgRFLwzDJwRFVIYDKx/iJz0sQ5kBHVgdDwg==} dependencies: @@ -954,6 +1066,21 @@ packages: crc-32: 1.2.2 dev: false + /@nomicfoundation/ethereumjs-ethash@3.0.1: + resolution: {integrity: sha512-KDjGIB5igzWOp8Ik5I6QiRH5DH+XgILlplsHR7TEuWANZA759G6krQ6o8bvj+tRUz08YygMQu/sGd9mJ1DYT8w==} + engines: {node: '>=14'} + dependencies: + '@nomicfoundation/ethereumjs-block': 5.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + abstract-level: 1.0.4 + bigint-crypto-utils: 3.3.0 + ethereum-cryptography: 0.1.3 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: false + /@nomicfoundation/ethereumjs-ethash@3.0.2: resolution: {integrity: sha512-8PfoOQCcIcO9Pylq0Buijuq/O73tmMVURK0OqdjhwqcGHYC2PwhbajDh7GZ55ekB0Px197ajK3PQhpKoiI/UPg==} engines: {node: '>=14'} @@ -969,6 +1096,24 @@ packages: - utf-8-validate dev: false + /@nomicfoundation/ethereumjs-evm@2.0.1: + resolution: {integrity: sha512-oL8vJcnk0Bx/onl+TgQOQ1t/534GKFaEG17fZmwtPFeH8S5soiBYPCLUrvANOl4sCp9elYxIMzIiTtMtNNN8EQ==} + engines: {node: '>=14'} + dependencies: + '@ethersproject/providers': 5.7.2 + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-tx': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + debug: 4.3.4(supports-color@8.1.1) + ethereum-cryptography: 0.1.3 + mcl-wasm: 0.7.9 + rustbn.js: 0.2.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: false + /@nomicfoundation/ethereumjs-evm@2.0.2: resolution: {integrity: sha512-rBLcUaUfANJxyOx9HIdMX6uXGin6lANCulIm/pjMgRqfiCRMZie3WKYxTSd8ZE/d+qT+zTedBF4+VHTdTSePmQ==} engines: {node: '>=14'} @@ -987,12 +1132,33 @@ packages: - utf-8-validate dev: false + /@nomicfoundation/ethereumjs-rlp@5.0.1: + resolution: {integrity: sha512-xtxrMGa8kP4zF5ApBQBtjlSbN5E2HI8m8FYgVSYAnO6ssUoY5pVPGy2H8+xdf/bmMa22Ce8nWMH3aEW8CcqMeQ==} + engines: {node: '>=14'} + hasBin: true + dev: false + /@nomicfoundation/ethereumjs-rlp@5.0.2: resolution: {integrity: sha512-QwmemBc+MMsHJ1P1QvPl8R8p2aPvvVcKBbvHnQOKBpBztEo0omN0eaob6FeZS/e3y9NSe+mfu3nNFBHszqkjTA==} engines: {node: '>=14'} hasBin: true dev: false + /@nomicfoundation/ethereumjs-statemanager@2.0.1: + resolution: {integrity: sha512-B5ApMOnlruVOR7gisBaYwFX+L/AP7i/2oAahatssjPIBVDF6wTX1K7Qpa39E/nzsH8iYuL3krkYeUFIdO3EMUQ==} + dependencies: + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + debug: 4.3.4(supports-color@8.1.1) + ethereum-cryptography: 0.1.3 + ethers: 5.7.2 + js-sdsl: 4.4.2 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: false + /@nomicfoundation/ethereumjs-statemanager@2.0.2: resolution: {integrity: sha512-dlKy5dIXLuDubx8Z74sipciZnJTRSV/uHG48RSijhgm1V7eXYFC567xgKtsKiVZB1ViTP9iFL4B6Je0xD6X2OA==} dependencies: @@ -1008,6 +1174,17 @@ packages: - utf-8-validate dev: false + /@nomicfoundation/ethereumjs-trie@6.0.1: + resolution: {integrity: sha512-A64It/IMpDVODzCgxDgAAla8jNjNtsoQZIzZUfIV5AY6Coi4nvn7+VReBn5itlxMiL2yaTlQr9TRWp3CSI6VoA==} + engines: {node: '>=14'} + dependencies: + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + '@types/readable-stream': 2.3.15 + ethereum-cryptography: 0.1.3 + readable-stream: 3.6.2 + dev: false + /@nomicfoundation/ethereumjs-trie@6.0.2: resolution: {integrity: sha512-yw8vg9hBeLYk4YNg5MrSJ5H55TLOv2FSWUTROtDtTMMmDGROsAu+0tBjiNGTnKRi400M6cEzoFfa89Fc5k8NTQ==} engines: {node: '>=14'} @@ -1019,6 +1196,21 @@ packages: readable-stream: 3.6.2 dev: false + /@nomicfoundation/ethereumjs-tx@5.0.1: + resolution: {integrity: sha512-0HwxUF2u2hrsIM1fsasjXvlbDOq1ZHFV2dd1yGq8CA+MEYhaxZr8OTScpVkkxqMwBcc5y83FyPl0J9MZn3kY0w==} + engines: {node: '>=14'} + dependencies: + '@chainsafe/ssz': 0.9.4 + '@ethersproject/providers': 5.7.2 + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + ethereum-cryptography: 0.1.3 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: false + /@nomicfoundation/ethereumjs-tx@5.0.2: resolution: {integrity: sha512-T+l4/MmTp7VhJeNloMkM+lPU3YMUaXdcXgTGCf8+ZFvV9NYZTRLFekRwlG6/JMmVfIfbrW+dRRJ9A6H5Q/Z64g==} engines: {node: '>=14'} @@ -1034,6 +1226,15 @@ packages: - utf-8-validate dev: false + /@nomicfoundation/ethereumjs-util@9.0.1: + resolution: {integrity: sha512-TwbhOWQ8QoSCFhV/DDfSmyfFIHjPjFBj957219+V3jTZYZ2rf9PmDtNOeZWAE3p3vlp8xb02XGpd0v6nTUPbsA==} + engines: {node: '>=14'} + dependencies: + '@chainsafe/ssz': 0.10.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + ethereum-cryptography: 0.1.3 + dev: false + /@nomicfoundation/ethereumjs-util@9.0.2: resolution: {integrity: sha512-4Wu9D3LykbSBWZo8nJCnzVIYGvGCuyiYLIJa9XXNVt1q1jUzHdB+sJvx95VGCpPkCT+IbLecW6yfzy3E1bQrwQ==} engines: {node: '>=14'} @@ -1043,6 +1244,29 @@ packages: ethereum-cryptography: 0.1.3 dev: false + /@nomicfoundation/ethereumjs-vm@7.0.1: + resolution: {integrity: sha512-rArhyn0jPsS/D+ApFsz3yVJMQ29+pVzNZ0VJgkzAZ+7FqXSRtThl1C1prhmlVr3YNUlfpZ69Ak+RUT4g7VoOuQ==} + engines: {node: '>=14'} + dependencies: + '@nomicfoundation/ethereumjs-block': 5.0.1 + '@nomicfoundation/ethereumjs-blockchain': 7.0.1 + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-evm': 2.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-statemanager': 2.0.1 + '@nomicfoundation/ethereumjs-trie': 6.0.1 + '@nomicfoundation/ethereumjs-tx': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + debug: 4.3.4(supports-color@8.1.1) + ethereum-cryptography: 0.1.3 + mcl-wasm: 0.7.9 + rustbn.js: 0.2.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: false + /@nomicfoundation/ethereumjs-vm@7.0.2: resolution: {integrity: sha512-Bj3KZT64j54Tcwr7Qm/0jkeZXJMfdcAtRBedou+Hx0dPOSIgqaIr0vvLwP65TpHbak2DmAq+KJbW2KNtIoFwvA==} engines: {node: '>=14'} @@ -1172,15 +1396,15 @@ packages: '@nomicfoundation/solidity-analyzer-win32-x64-msvc': 0.1.1 dev: false - /@scure/base@1.1.6: - resolution: {integrity: sha512-ok9AWwhcgYuGG3Zfhyqg+zwl+Wn5uE+dwC0NV/2qQkx4dABbb/bx96vWu8NSj+BNjjSjno+JRYRjle1jV08k3g==} + /@scure/base@1.1.5: + resolution: {integrity: sha512-Brj9FiG2W1MRQSTB212YVPRrcbjkv48FoZi/u4l/zds/ieRrqsh7aUf6CLwkAq61oKXr/ZlTzlY66gLIj3TFTQ==} /@scure/bip32@1.1.5: resolution: {integrity: sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw==} dependencies: '@noble/hashes': 1.2.0 '@noble/secp256k1': 1.7.1 - '@scure/base': 1.1.6 + '@scure/base': 1.1.5 dev: false /@scure/bip32@1.3.3: @@ -1188,21 +1412,21 @@ packages: dependencies: '@noble/curves': 1.3.0 '@noble/hashes': 1.3.3 - '@scure/base': 1.1.6 + '@scure/base': 1.1.5 dev: true /@scure/bip39@1.1.1: resolution: {integrity: sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg==} dependencies: '@noble/hashes': 1.2.0 - '@scure/base': 1.1.6 + '@scure/base': 1.1.5 dev: false /@scure/bip39@1.2.2: resolution: {integrity: sha512-HYf9TUXG80beW+hGAt3TRM8wU6pQoYur9iNypTROm42dorCGmLnFe3eWjz3gOq6G62H2WRh0FCzAR1PI+29zIA==} dependencies: '@noble/hashes': 1.3.3 - '@scure/base': 1.1.6 + '@scure/base': 1.1.5 dev: true /@sentry/core@5.30.0: @@ -1392,7 +1616,7 @@ packages: ignore: 5.3.1 natural-compare: 1.4.0 semver: 7.6.0 - ts-api-utils: 1.3.0(typescript@5.4.2) + ts-api-utils: 1.2.1(typescript@5.4.2) typescript: 5.4.2 transitivePeerDependencies: - supports-color @@ -1441,7 +1665,7 @@ packages: '@typescript-eslint/utils': 7.3.1(eslint@8.57.0)(typescript@5.4.2) debug: 4.3.4(supports-color@8.1.1) eslint: 8.57.0 - ts-api-utils: 1.3.0(typescript@5.4.2) + ts-api-utils: 1.2.1(typescript@5.4.2) typescript: 5.4.2 transitivePeerDependencies: - supports-color @@ -1468,7 +1692,7 @@ packages: is-glob: 4.0.3 minimatch: 9.0.3 semver: 7.6.0 - ts-api-utils: 1.3.0(typescript@5.4.2) + ts-api-utils: 1.2.1(typescript@5.4.2) typescript: 5.4.2 transitivePeerDependencies: - supports-color @@ -1505,6 +1729,13 @@ packages: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true + /abort-controller@3.0.0: + resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} + engines: {node: '>=6.5'} + dependencies: + event-target-shim: 5.0.1 + dev: false + /abstract-level@1.0.4: resolution: {integrity: sha512-eUP/6pbXBkMbXFdx4IH2fVgvB7M0JvR7/lIL33zcs0IBcwjdzSSl31TOJsaCzmKSSDF9h8QYSOJux4Nd4YJqFg==} engines: {node: '>=12'} @@ -1621,22 +1852,21 @@ packages: /argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - /array-buffer-byte-length@1.0.1: - resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==} - engines: {node: '>= 0.4'} + /array-buffer-byte-length@1.0.0: + resolution: {integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==} dependencies: - call-bind: 1.0.7 - is-array-buffer: 3.0.4 + call-bind: 1.0.5 + is-array-buffer: 3.0.2 dev: true /array-includes@3.1.7: resolution: {integrity: sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.5 define-properties: 1.2.1 - es-abstract: 1.22.5 - get-intrinsic: 1.2.4 + es-abstract: 1.22.3 + get-intrinsic: 1.2.2 is-string: 1.0.7 dev: true @@ -1645,25 +1875,24 @@ packages: engines: {node: '>=8'} dev: true - /array.prototype.findlastindex@1.2.5: - resolution: {integrity: sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==} + /array.prototype.findlastindex@1.2.3: + resolution: {integrity: sha512-LzLoiOMAxvy+Gd3BAq3B7VeIgPdo+Q8hthvKtXybMvRV0jrXfJM/t8mw7nNlpEcVlVUnCnM2KSX4XU5HmpodOA==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.5 define-properties: 1.2.1 - es-abstract: 1.23.2 - es-errors: 1.3.0 - es-object-atoms: 1.0.0 + es-abstract: 1.22.3 es-shim-unscopables: 1.0.2 + get-intrinsic: 1.2.2 dev: true /array.prototype.flat@1.3.2: resolution: {integrity: sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.5 define-properties: 1.2.1 - es-abstract: 1.22.5 + es-abstract: 1.22.3 es-shim-unscopables: 1.0.2 dev: true @@ -1671,24 +1900,23 @@ packages: resolution: {integrity: sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.5 define-properties: 1.2.1 - es-abstract: 1.22.5 + es-abstract: 1.22.3 es-shim-unscopables: 1.0.2 dev: true - /arraybuffer.prototype.slice@1.0.3: - resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==} + /arraybuffer.prototype.slice@1.0.2: + resolution: {integrity: sha512-yMBKppFur/fbHu9/6USUe03bZ4knMYiwFBcyiaXB8Go0qNehwX6inYPzK9U0NeQvGxKthcmHcaR8P5MStSRBAw==} engines: {node: '>= 0.4'} dependencies: - array-buffer-byte-length: 1.0.1 - call-bind: 1.0.7 + array-buffer-byte-length: 1.0.0 + call-bind: 1.0.5 define-properties: 1.2.1 - es-abstract: 1.23.2 - es-errors: 1.3.0 - get-intrinsic: 1.2.4 - is-array-buffer: 3.0.4 - is-shared-array-buffer: 1.0.3 + es-abstract: 1.22.3 + get-intrinsic: 1.2.2 + is-array-buffer: 3.0.2 + is-shared-array-buffer: 1.0.2 dev: true /author-regex@1.0.0: @@ -1696,11 +1924,9 @@ packages: engines: {node: '>=0.8'} dev: true - /available-typed-arrays@1.0.7: - resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==} + /available-typed-arrays@1.0.6: + resolution: {integrity: sha512-j1QzY8iPNPG4o4xmO3ptzpRxTciqD3MgEHtifP/YnJpIo58Xu+ne4BejlbkuaLfXn/nz6HFiw29bLpj2PNMdGg==} engines: {node: '>= 0.4'} - dependencies: - possible-typed-array-names: 1.0.0 dev: true /balanced-match@1.0.2: @@ -1725,8 +1951,8 @@ packages: engines: {node: '>=14.0.0'} dev: false - /binary-extensions@2.3.0: - resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} + /binary-extensions@2.2.0: + resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} engines: {node: '>=8'} dev: false @@ -1787,15 +2013,15 @@ packages: safe-buffer: 5.2.1 dev: false - /browserslist@4.23.0: - resolution: {integrity: sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==} + /browserslist@4.22.3: + resolution: {integrity: sha512-UAp55yfwNv0klWNapjs/ktHoguxuQNGnOzxYmfnXIS+8AsRDZkSDxg7R1AX3GKzn078SBI5dzwzj/Yx0Or0e3A==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001599 - electron-to-chromium: 1.4.711 + caniuse-lite: 1.0.30001583 + electron-to-chromium: 1.4.656 node-releases: 2.0.14 - update-browserslist-db: 1.0.13(browserslist@4.23.0) + update-browserslist-db: 1.0.13(browserslist@4.22.3) dev: true /bs58@4.0.1: @@ -1832,15 +2058,12 @@ packages: engines: {node: '>= 0.8'} dev: false - /call-bind@1.0.7: - resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} - engines: {node: '>= 0.4'} + /call-bind@1.0.5: + resolution: {integrity: sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==} dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 function-bind: 1.1.2 - get-intrinsic: 1.2.4 - set-function-length: 1.2.2 + get-intrinsic: 1.2.2 + set-function-length: 1.2.0 dev: true /callsites@3.1.0: @@ -1853,8 +2076,8 @@ packages: engines: {node: '>=10'} dev: false - /caniuse-lite@1.0.30001599: - resolution: {integrity: sha512-LRAQHZ4yT1+f9LemSMeqdMpMxZcc4RMWdj4tiFe3G8tNkWK+E58g+/tzotb5cU6TbcVJLr4fySiAW7XmxQvZQA==} + /caniuse-lite@1.0.30001583: + resolution: {integrity: sha512-acWTYaha8xfhA/Du/z4sNZjHUWjkiuoAi2LM+T/aL+kemKQgPT1xBb/YKjlQ0Qo8gvbHsGNplrEJ+9G3gL7i4Q==} dev: true /case@1.6.3: @@ -1897,21 +2120,6 @@ packages: fsevents: 2.3.3 dev: false - /chokidar@3.6.0: - resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} - engines: {node: '>= 8.10.0'} - dependencies: - anymatch: 3.1.3 - braces: 3.0.2 - glob-parent: 5.1.2 - is-binary-path: 2.1.0 - is-glob: 4.0.3 - normalize-path: 3.0.0 - readdirp: 3.6.0 - optionalDependencies: - fsevents: 2.3.3 - dev: false - /ci-info@2.0.0: resolution: {integrity: sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==} dev: false @@ -2039,33 +2247,6 @@ packages: which: 2.0.2 dev: true - /data-view-buffer@1.0.1: - resolution: {integrity: sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - is-data-view: 1.0.1 - dev: true - - /data-view-byte-length@1.0.1: - resolution: {integrity: sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - is-data-view: 1.0.1 - dev: true - - /data-view-byte-offset@1.0.0: - resolution: {integrity: sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - is-data-view: 1.0.1 - dev: true - /debug@3.2.7: resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} peerDependencies: @@ -2098,21 +2279,21 @@ packages: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} dev: true - /define-data-property@1.1.4: - resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} + /define-data-property@1.1.1: + resolution: {integrity: sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==} engines: {node: '>= 0.4'} dependencies: - es-define-property: 1.0.0 - es-errors: 1.3.0 + get-intrinsic: 1.2.2 gopd: 1.0.1 + has-property-descriptors: 1.0.1 dev: true /define-properties@1.2.1: resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} engines: {node: '>= 0.4'} dependencies: - define-data-property: 1.1.4 - has-property-descriptors: 1.0.2 + define-data-property: 1.1.1 + has-property-descriptors: 1.0.1 object-keys: 1.1.1 dev: true @@ -2151,8 +2332,8 @@ packages: esutils: 2.0.3 dev: true - /electron-to-chromium@1.4.711: - resolution: {integrity: sha512-hRg81qzvUEibX2lDxnFlVCHACa+LtrCPIsWAxo161LDYIB3jauf57RGsMZV9mvGwE98yGH06icj3zBEoOkxd/w==} + /electron-to-chromium@1.4.656: + resolution: {integrity: sha512-9AQB5eFTHyR3Gvt2t/NwR0le2jBSUNwCnMbUCejFWHD+so4tH40/dRLgoE+jxlPeWS43XJewyvCv+I8LPMl49Q==} dev: true /elliptic@6.5.4: @@ -2167,18 +2348,6 @@ packages: minimalistic-crypto-utils: 1.0.1 dev: false - /elliptic@6.5.5: - resolution: {integrity: sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw==} - dependencies: - bn.js: 4.12.0 - brorand: 1.1.0 - hash.js: 1.1.7 - hmac-drbg: 1.0.1 - inherits: 2.0.4 - minimalistic-assert: 1.0.1 - minimalistic-crypto-utils: 1.0.1 - dev: false - /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} dev: false @@ -2202,137 +2371,64 @@ packages: is-arrayish: 0.2.1 dev: true - /es-abstract@1.22.5: - resolution: {integrity: sha512-oW69R+4q2wG+Hc3KZePPZxOiisRIqfKBVo/HLx94QcJeWGU/8sZhCvc829rd1kS366vlJbzBfXf9yWwf0+Ko7w==} - engines: {node: '>= 0.4'} - dependencies: - array-buffer-byte-length: 1.0.1 - arraybuffer.prototype.slice: 1.0.3 - available-typed-arrays: 1.0.7 - call-bind: 1.0.7 - es-define-property: 1.0.0 - es-errors: 1.3.0 - es-set-tostringtag: 2.0.3 - es-to-primitive: 1.2.1 - function.prototype.name: 1.1.6 - get-intrinsic: 1.2.4 - get-symbol-description: 1.0.2 - globalthis: 1.0.3 - gopd: 1.0.1 - has-property-descriptors: 1.0.2 - has-proto: 1.0.3 - has-symbols: 1.0.3 - hasown: 2.0.2 - internal-slot: 1.0.7 - is-array-buffer: 3.0.4 - is-callable: 1.2.7 - is-negative-zero: 2.0.3 - is-regex: 1.1.4 - is-shared-array-buffer: 1.0.3 - is-string: 1.0.7 - is-typed-array: 1.1.13 - is-weakref: 1.0.2 - object-inspect: 1.13.1 - object-keys: 1.1.1 - object.assign: 4.1.5 - regexp.prototype.flags: 1.5.2 - safe-array-concat: 1.1.2 - safe-regex-test: 1.0.3 - string.prototype.trim: 1.2.9 - string.prototype.trimend: 1.0.8 - string.prototype.trimstart: 1.0.7 - typed-array-buffer: 1.0.2 - typed-array-byte-length: 1.0.1 - typed-array-byte-offset: 1.0.2 - typed-array-length: 1.0.5 - unbox-primitive: 1.0.2 - which-typed-array: 1.1.15 - dev: true - - /es-abstract@1.23.2: - resolution: {integrity: sha512-60s3Xv2T2p1ICykc7c+DNDPLDMm9t4QxCOUU0K9JxiLjM3C1zB9YVdN7tjxrFd4+AkZ8CdX1ovUga4P2+1e+/w==} + /es-abstract@1.22.3: + resolution: {integrity: sha512-eiiY8HQeYfYH2Con2berK+To6GrK2RxbPawDkGq4UiCQQfZHb6wX9qQqkbpPqaxQFcl8d9QzZqo0tGE0VcrdwA==} engines: {node: '>= 0.4'} dependencies: - array-buffer-byte-length: 1.0.1 - arraybuffer.prototype.slice: 1.0.3 - available-typed-arrays: 1.0.7 - call-bind: 1.0.7 - data-view-buffer: 1.0.1 - data-view-byte-length: 1.0.1 - data-view-byte-offset: 1.0.0 - es-define-property: 1.0.0 - es-errors: 1.3.0 - es-object-atoms: 1.0.0 - es-set-tostringtag: 2.0.3 + array-buffer-byte-length: 1.0.0 + arraybuffer.prototype.slice: 1.0.2 + available-typed-arrays: 1.0.6 + call-bind: 1.0.5 + es-set-tostringtag: 2.0.2 es-to-primitive: 1.2.1 function.prototype.name: 1.1.6 - get-intrinsic: 1.2.4 - get-symbol-description: 1.0.2 + get-intrinsic: 1.2.2 + get-symbol-description: 1.0.0 globalthis: 1.0.3 gopd: 1.0.1 - has-property-descriptors: 1.0.2 - has-proto: 1.0.3 + has-property-descriptors: 1.0.1 + has-proto: 1.0.1 has-symbols: 1.0.3 - hasown: 2.0.2 - internal-slot: 1.0.7 - is-array-buffer: 3.0.4 + hasown: 2.0.0 + internal-slot: 1.0.6 + is-array-buffer: 3.0.2 is-callable: 1.2.7 - is-data-view: 1.0.1 - is-negative-zero: 2.0.3 + is-negative-zero: 2.0.2 is-regex: 1.1.4 - is-shared-array-buffer: 1.0.3 + is-shared-array-buffer: 1.0.2 is-string: 1.0.7 is-typed-array: 1.1.13 is-weakref: 1.0.2 object-inspect: 1.13.1 object-keys: 1.1.1 object.assign: 4.1.5 - regexp.prototype.flags: 1.5.2 - safe-array-concat: 1.1.2 - safe-regex-test: 1.0.3 - string.prototype.trim: 1.2.9 - string.prototype.trimend: 1.0.8 + regexp.prototype.flags: 1.5.1 + safe-array-concat: 1.1.0 + safe-regex-test: 1.0.2 + string.prototype.trim: 1.2.8 + string.prototype.trimend: 1.0.7 string.prototype.trimstart: 1.0.7 - typed-array-buffer: 1.0.2 - typed-array-byte-length: 1.0.1 - typed-array-byte-offset: 1.0.2 - typed-array-length: 1.0.5 + typed-array-buffer: 1.0.0 + typed-array-byte-length: 1.0.0 + typed-array-byte-offset: 1.0.0 + typed-array-length: 1.0.4 unbox-primitive: 1.0.2 - which-typed-array: 1.1.15 - dev: true - - /es-define-property@1.0.0: - resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} - engines: {node: '>= 0.4'} - dependencies: - get-intrinsic: 1.2.4 - dev: true - - /es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - dev: true - - /es-object-atoms@1.0.0: - resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==} - engines: {node: '>= 0.4'} - dependencies: - es-errors: 1.3.0 + which-typed-array: 1.1.14 dev: true - /es-set-tostringtag@2.0.3: - resolution: {integrity: sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==} + /es-set-tostringtag@2.0.2: + resolution: {integrity: sha512-BuDyupZt65P9D2D2vA/zqcI3G5xRsklm5N3xCwuiy+/vKy8i0ifdsQP1sLgO4tZDSCaQUSnmC48khknGMV3D2Q==} engines: {node: '>= 0.4'} dependencies: - get-intrinsic: 1.2.4 + get-intrinsic: 1.2.2 has-tostringtag: 1.0.2 - hasown: 2.0.2 + hasown: 2.0.0 dev: true /es-shim-unscopables@1.0.2: resolution: {integrity: sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==} dependencies: - hasown: 2.0.2 + hasown: 2.0.0 dev: true /es-to-primitive@1.2.1: @@ -2344,8 +2440,8 @@ packages: is-symbol: 1.0.4 dev: true - /escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} + /escalade@3.1.1: + resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} /escape-string-regexp@1.0.5: @@ -2366,8 +2462,8 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.1(@typescript-eslint/parser@7.3.1)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): - resolution: {integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==} + /eslint-module-utils@2.8.0(@typescript-eslint/parser@7.3.1)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): + resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: '@typescript-eslint/parser': '*' @@ -2407,21 +2503,21 @@ packages: dependencies: '@typescript-eslint/parser': 7.3.1(eslint@8.57.0)(typescript@5.4.2) array-includes: 3.1.7 - array.prototype.findlastindex: 1.2.5 + array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.2 array.prototype.flatmap: 1.3.2 debug: 3.2.7 doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.3.1)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) - hasown: 2.0.2 + eslint-module-utils: 2.8.0(@typescript-eslint/parser@7.3.1)(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) + hasown: 2.0.0 is-core-module: 2.13.1 is-glob: 4.0.3 minimatch: 3.1.2 - object.fromentries: 2.0.8 - object.groupby: 1.0.3 - object.values: 1.2.0 + object.fromentries: 2.0.7 + object.groupby: 1.0.1 + object.values: 1.1.7 semver: 6.3.1 tsconfig-paths: 3.15.0 transitivePeerDependencies: @@ -2582,7 +2678,7 @@ packages: '@types/bn.js': 4.11.6 bn.js: 4.12.0 create-hash: 1.2.0 - elliptic: 6.5.5 + elliptic: 6.5.4 ethereum-cryptography: 0.1.3 ethjs-util: 0.1.6 rlp: 2.2.7 @@ -2650,6 +2746,11 @@ packages: strip-hex-prefix: 1.0.0 dev: false + /event-target-shim@5.0.1: + resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} + engines: {node: '>=6'} + dev: false + /evp_bytestokey@1.0.3: resolution: {integrity: sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==} dependencies: @@ -2680,8 +2781,8 @@ packages: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} dev: true - /fastq@1.17.1: - resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} + /fastq@1.17.0: + resolution: {integrity: sha512-zGygtijUMT7jnk3h26kUms3BkSDp4IfIKjmnqI2tvx6nuBfiF1UqOxbnLfzdv+apBy+53oaImsKtMw/xYbW+1w==} dependencies: reusify: 1.0.4 dev: true @@ -2717,7 +2818,7 @@ packages: resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} engines: {node: ^10.12.0 || >=12.0.0} dependencies: - flatted: 3.3.1 + flatted: 3.2.9 keyv: 4.5.4 rimraf: 3.0.2 dev: true @@ -2727,12 +2828,12 @@ packages: hasBin: true dev: false - /flatted@3.3.1: - resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} + /flatted@3.2.9: + resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==} dev: true - /follow-redirects@1.15.6(debug@4.3.4): - resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} + /follow-redirects@1.15.5(debug@4.3.4): + resolution: {integrity: sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==} engines: {node: '>=4.0'} peerDependencies: debug: '*' @@ -2800,9 +2901,9 @@ packages: resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.5 define-properties: 1.2.1 - es-abstract: 1.23.2 + es-abstract: 1.22.3 functions-have-names: 1.2.3 dev: true @@ -2824,24 +2925,21 @@ packages: engines: {node: 6.* || 8.* || >= 10.*} dev: false - /get-intrinsic@1.2.4: - resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} - engines: {node: '>= 0.4'} + /get-intrinsic@1.2.2: + resolution: {integrity: sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==} dependencies: - es-errors: 1.3.0 function-bind: 1.1.2 - has-proto: 1.0.3 + has-proto: 1.0.1 has-symbols: 1.0.3 - hasown: 2.0.2 + hasown: 2.0.0 dev: true - /get-symbol-description@1.0.2: - resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==} + /get-symbol-description@1.0.0: + resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - get-intrinsic: 1.2.4 + call-bind: 1.0.5 + get-intrinsic: 1.2.2 dev: true /glob-parent@5.1.2: @@ -2879,17 +2977,6 @@ packages: path-is-absolute: 1.0.1 dev: true - /glob@8.1.0: - resolution: {integrity: sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==} - engines: {node: '>=12'} - dependencies: - fs.realpath: 1.0.0 - inflight: 1.0.6 - inherits: 2.0.4 - minimatch: 5.0.1 - once: 1.4.0 - dev: false - /globals@11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} @@ -2924,7 +3011,7 @@ packages: /gopd@1.0.1: resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} dependencies: - get-intrinsic: 1.2.4 + get-intrinsic: 1.2.2 dev: true /graceful-fs@4.2.11: @@ -2934,6 +3021,76 @@ packages: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} dev: true + /hardhat@2.17.0(ts-node@10.9.2)(typescript@5.4.2): + resolution: {integrity: sha512-CaEGa13tkJNe2/rdaBiive4pmdNShwxvdWVhr1zfb6aVpRhQt9VNO0l/UIBt/zzajz38ZFjvhfM2bj8LDXo9gw==} + engines: {node: '>=16.0.0'} + hasBin: true + peerDependencies: + ts-node: '*' + typescript: '*' + peerDependenciesMeta: + ts-node: + optional: true + typescript: + optional: true + dependencies: + '@ethersproject/abi': 5.7.0 + '@metamask/eth-sig-util': 4.0.1 + '@nomicfoundation/ethereumjs-block': 5.0.1 + '@nomicfoundation/ethereumjs-blockchain': 7.0.1 + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-evm': 2.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-statemanager': 2.0.1 + '@nomicfoundation/ethereumjs-trie': 6.0.1 + '@nomicfoundation/ethereumjs-tx': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + '@nomicfoundation/ethereumjs-vm': 7.0.1 + '@nomicfoundation/solidity-analyzer': 0.1.1 + '@sentry/node': 5.30.0 + '@types/bn.js': 5.1.5 + '@types/lru-cache': 5.1.1 + abort-controller: 3.0.0 + adm-zip: 0.4.16 + aggregate-error: 3.1.0 + ansi-escapes: 4.3.2 + chalk: 2.4.2 + chokidar: 3.5.3 + ci-info: 2.0.0 + debug: 4.3.4(supports-color@8.1.1) + enquirer: 2.4.1 + env-paths: 2.2.1 + ethereum-cryptography: 1.2.0 + ethereumjs-abi: 0.6.8 + find-up: 2.1.0 + fp-ts: 1.19.3 + fs-extra: 7.0.1 + glob: 7.2.0 + immutable: 4.3.5 + io-ts: 1.10.4 + keccak: 3.0.4 + lodash: 4.17.21 + mnemonist: 0.38.5 + mocha: 10.2.0 + p-map: 4.0.0 + raw-body: 2.5.2 + resolve: 1.17.0 + semver: 6.3.1 + solc: 0.7.3(debug@4.3.4) + source-map-support: 0.5.21 + stacktrace-parser: 0.1.10 + ts-node: 10.9.2(@types/node@20.11.30)(typescript@5.4.2) + tsort: 0.0.1 + typescript: 5.4.2 + undici: 5.28.2 + uuid: 8.3.2 + ws: 7.5.9 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: false + /hardhat@2.19.1(ts-node@10.9.2)(typescript@5.4.2): resolution: {integrity: sha512-bsWa63g1GB78ZyMN08WLhFElLPA+J+pShuKD1BFO2+88g3l+BL3R07vj9deIi9dMbssxgE714Gof1dBEDGqnCw==} hasBin: true @@ -2966,7 +3123,7 @@ packages: aggregate-error: 3.1.0 ansi-escapes: 4.3.2 chalk: 2.4.2 - chokidar: 3.6.0 + chokidar: 3.5.3 ci-info: 2.0.0 debug: 4.3.4(supports-color@8.1.1) enquirer: 2.4.1 @@ -2982,7 +3139,7 @@ packages: keccak: 3.0.4 lodash: 4.17.21 mnemonist: 0.38.5 - mocha: 10.3.0 + mocha: 10.2.0 p-map: 4.0.0 raw-body: 2.5.2 resolve: 1.17.0 @@ -2993,7 +3150,7 @@ packages: ts-node: 10.9.2(@types/node@20.11.30)(typescript@5.4.2) tsort: 0.0.1 typescript: 5.4.2 - undici: 5.28.3 + undici: 5.28.2 uuid: 8.3.2 ws: 7.5.9 transitivePeerDependencies: @@ -3014,14 +3171,14 @@ packages: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} - /has-property-descriptors@1.0.2: - resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + /has-property-descriptors@1.0.1: + resolution: {integrity: sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==} dependencies: - es-define-property: 1.0.0 + get-intrinsic: 1.2.2 dev: true - /has-proto@1.0.3: - resolution: {integrity: sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==} + /has-proto@1.0.1: + resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==} engines: {node: '>= 0.4'} dev: true @@ -3053,8 +3210,8 @@ packages: minimalistic-assert: 1.0.1 dev: false - /hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + /hasown@2.0.0: + resolution: {integrity: sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==} engines: {node: '>= 0.4'} dependencies: function-bind: 1.1.2 @@ -3141,13 +3298,13 @@ packages: /inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - /internal-slot@1.0.7: - resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==} + /internal-slot@1.0.6: + resolution: {integrity: sha512-Xj6dv+PsbtwyPpEflsejS+oIZxmMlV44zAhG479uYu89MsjcYOhCFnNyKrkJrihbsiasQyY0afoCl/9BLR65bg==} engines: {node: '>= 0.4'} dependencies: - es-errors: 1.3.0 - hasown: 2.0.2 - side-channel: 1.0.6 + get-intrinsic: 1.2.2 + hasown: 2.0.0 + side-channel: 1.0.4 dev: true /io-ts@1.10.4: @@ -3156,12 +3313,12 @@ packages: fp-ts: 1.19.3 dev: false - /is-array-buffer@3.0.4: - resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==} - engines: {node: '>= 0.4'} + /is-array-buffer@3.0.2: + resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.2.4 + call-bind: 1.0.5 + get-intrinsic: 1.2.2 + is-typed-array: 1.1.13 dev: true /is-arrayish@0.2.1: @@ -3178,14 +3335,14 @@ packages: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} engines: {node: '>=8'} dependencies: - binary-extensions: 2.3.0 + binary-extensions: 2.2.0 dev: false /is-boolean-object@1.1.2: resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.5 has-tostringtag: 1.0.2 dev: true @@ -3202,14 +3359,7 @@ packages: /is-core-module@2.13.1: resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} dependencies: - hasown: 2.0.2 - dev: true - - /is-data-view@1.0.1: - resolution: {integrity: sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==} - engines: {node: '>= 0.4'} - dependencies: - is-typed-array: 1.1.13 + hasown: 2.0.0 dev: true /is-date-object@1.0.5: @@ -3239,8 +3389,8 @@ packages: engines: {node: '>=6.5.0', npm: '>=3'} dev: false - /is-negative-zero@2.0.3: - resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} + /is-negative-zero@2.0.2: + resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} engines: {node: '>= 0.4'} dev: true @@ -3269,15 +3419,14 @@ packages: resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.5 has-tostringtag: 1.0.2 dev: true - /is-shared-array-buffer@1.0.3: - resolution: {integrity: sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==} - engines: {node: '>= 0.4'} + /is-shared-array-buffer@1.0.2: + resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.5 dev: true /is-string@1.0.7: @@ -3298,7 +3447,7 @@ packages: resolution: {integrity: sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==} engines: {node: '>= 0.4'} dependencies: - which-typed-array: 1.1.15 + which-typed-array: 1.1.14 dev: true /is-unicode-supported@0.1.0: @@ -3309,7 +3458,7 @@ packages: /is-weakref@1.0.2: resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.5 dev: true /isarray@2.0.5: @@ -3582,8 +3731,8 @@ packages: obliterator: 2.0.4 dev: false - /mocha@10.3.0: - resolution: {integrity: sha512-uF2XJs+7xSLsrmIvn37i/wnc91nw7XjOQB8ccyx5aEgdnohr7n+rEiZP23WkCYHjilR6+EboEnbq/ZQDz4LSbg==} + /mocha@10.2.0: + resolution: {integrity: sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==} engines: {node: '>= 14.0.0'} hasBin: true dependencies: @@ -3594,12 +3743,13 @@ packages: diff: 5.0.0 escape-string-regexp: 4.0.0 find-up: 5.0.0 - glob: 8.1.0 + glob: 7.2.0 he: 1.2.0 js-yaml: 4.1.0 log-symbols: 4.1.0 minimatch: 5.0.1 ms: 2.1.3 + nanoid: 3.3.3 serialize-javascript: 6.0.0 strip-json-comments: 3.1.1 supports-color: 8.1.1 @@ -3624,6 +3774,12 @@ packages: resolution: {integrity: sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==} dev: false + /nanoid@3.3.3: + resolution: {integrity: sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + dev: false + /napi-macros@2.2.2: resolution: {integrity: sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==} dev: false @@ -3663,38 +3819,37 @@ packages: resolution: {integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.5 define-properties: 1.2.1 has-symbols: 1.0.3 object-keys: 1.1.1 dev: true - /object.fromentries@2.0.8: - resolution: {integrity: sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==} + /object.fromentries@2.0.7: + resolution: {integrity: sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.5 define-properties: 1.2.1 - es-abstract: 1.23.2 - es-object-atoms: 1.0.0 + es-abstract: 1.22.3 dev: true - /object.groupby@1.0.3: - resolution: {integrity: sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==} - engines: {node: '>= 0.4'} + /object.groupby@1.0.1: + resolution: {integrity: sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.5 define-properties: 1.2.1 - es-abstract: 1.23.2 + es-abstract: 1.22.3 + get-intrinsic: 1.2.2 dev: true - /object.values@1.2.0: - resolution: {integrity: sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==} + /object.values@1.1.7: + resolution: {integrity: sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.5 define-properties: 1.2.1 - es-object-atoms: 1.0.0 + es-abstract: 1.22.3 dev: true /obliterator@2.0.4: @@ -3783,7 +3938,7 @@ packages: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} dependencies: - '@babel/code-frame': 7.24.2 + '@babel/code-frame': 7.23.5 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -3839,11 +3994,6 @@ packages: engines: {node: '>=12.0.0'} dev: true - /possible-typed-array-names@1.0.0: - resolution: {integrity: sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==} - engines: {node: '>= 0.4'} - dev: true - /prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -3910,14 +4060,13 @@ packages: picomatch: 2.3.1 dev: false - /regexp.prototype.flags@1.5.2: - resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} + /regexp.prototype.flags@1.5.1: + resolution: {integrity: sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.5 define-properties: 1.2.1 - es-errors: 1.3.0 - set-function-name: 2.0.2 + set-function-name: 2.0.1 dev: true /require-directory@2.1.1: @@ -3999,12 +4148,12 @@ packages: resolution: {integrity: sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==} dev: false - /safe-array-concat@1.1.2: - resolution: {integrity: sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==} + /safe-array-concat@1.1.0: + resolution: {integrity: sha512-ZdQ0Jeb9Ofti4hbt5lX3T2JcAamT9hfzYU1MNB+z/jaEbB6wfFfPIR/zEORmZqobkCCJhSjodobH6WHNmJ97dg==} engines: {node: '>=0.4'} dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.2.4 + call-bind: 1.0.5 + get-intrinsic: 1.2.2 has-symbols: 1.0.3 isarray: 2.0.5 dev: true @@ -4017,12 +4166,12 @@ packages: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} dev: false - /safe-regex-test@1.0.3: - resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==} + /safe-regex-test@1.0.2: + resolution: {integrity: sha512-83S9w6eFq12BBIJYvjMux6/dkirb8+4zJRA9cxNBVb7Wq5fJBW+Xze48WqR8pxua7bDuAaaAxtVVd4Idjp1dBQ==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 + call-bind: 1.0.5 + get-intrinsic: 1.2.2 is-regex: 1.1.4 dev: true @@ -4039,7 +4188,7 @@ packages: engines: {node: '>=10.0.0'} requiresBuild: true dependencies: - elliptic: 6.5.5 + elliptic: 6.5.4 node-addon-api: 2.0.2 node-gyp-build: 4.8.0 dev: false @@ -4066,26 +4215,24 @@ packages: randombytes: 2.1.0 dev: false - /set-function-length@1.2.2: - resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} + /set-function-length@1.2.0: + resolution: {integrity: sha512-4DBHDoyHlM1IRPGYcoxexgh67y4ueR53FKV1yyxwFMY7aCqcN/38M1+SwZ/qJQ8iLv7+ck385ot4CcisOAPT9w==} engines: {node: '>= 0.4'} dependencies: - define-data-property: 1.1.4 - es-errors: 1.3.0 + define-data-property: 1.1.1 function-bind: 1.1.2 - get-intrinsic: 1.2.4 + get-intrinsic: 1.2.2 gopd: 1.0.1 - has-property-descriptors: 1.0.2 + has-property-descriptors: 1.0.1 dev: true - /set-function-name@2.0.2: - resolution: {integrity: sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==} + /set-function-name@2.0.1: + resolution: {integrity: sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA==} engines: {node: '>= 0.4'} dependencies: - define-data-property: 1.1.4 - es-errors: 1.3.0 + define-data-property: 1.1.1 functions-have-names: 1.2.3 - has-property-descriptors: 1.0.2 + has-property-descriptors: 1.0.1 dev: true /setimmediate@1.0.5: @@ -4116,13 +4263,11 @@ packages: engines: {node: '>=8'} dev: true - /side-channel@1.0.6: - resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} - engines: {node: '>= 0.4'} + /side-channel@1.0.4: + resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - get-intrinsic: 1.2.4 + call-bind: 1.0.5 + get-intrinsic: 1.2.2 object-inspect: 1.13.1 dev: true @@ -4138,7 +4283,7 @@ packages: dependencies: command-exists: 1.2.9 commander: 3.0.2 - follow-redirects: 1.15.6(debug@4.3.4) + follow-redirects: 1.15.5(debug@4.3.4) fs-extra: 0.30.0 js-sha3: 0.8.0 memorystream: 0.3.1 @@ -4190,30 +4335,29 @@ packages: strip-ansi: 6.0.1 dev: false - /string.prototype.trim@1.2.9: - resolution: {integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==} + /string.prototype.trim@1.2.8: + resolution: {integrity: sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.5 define-properties: 1.2.1 - es-abstract: 1.23.2 - es-object-atoms: 1.0.0 + es-abstract: 1.22.3 dev: true - /string.prototype.trimend@1.0.8: - resolution: {integrity: sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==} + /string.prototype.trimend@1.0.7: + resolution: {integrity: sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.5 define-properties: 1.2.1 - es-object-atoms: 1.0.0 + es-abstract: 1.22.3 dev: true /string.prototype.trimstart@1.0.7: resolution: {integrity: sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.5 define-properties: 1.2.1 - es-abstract: 1.23.2 + es-abstract: 1.22.3 dev: true /string_decoder@1.3.0: @@ -4244,8 +4388,8 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} - /superstruct@1.0.4: - resolution: {integrity: sha512-7JpaAoX2NGyoFlI9NBh66BQXGONc+uE+MRS5i2iOBKuS4e+ccgMDjATgZldkah+33DakBxDHiss9kvUcGAO8UQ==} + /superstruct@1.0.3: + resolution: {integrity: sha512-8iTn3oSS8nRGn+C2pgXSKPI3jmpm6FExNazNpjvqS6ZUJQCej3PUXEKM8NjHBOs54ExM+LPW/FBRhymrdcCiSg==} engines: {node: '>=14.0.0'} dev: true @@ -4299,8 +4443,8 @@ packages: engines: {node: '>=0.6'} dev: false - /ts-api-utils@1.3.0(typescript@5.4.2): - resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} + /ts-api-utils@1.2.1(typescript@5.4.2): + resolution: {integrity: sha512-RIYA36cJn2WiH9Hy77hdF9r7oEwxAtB/TS9/S4Qd90Ap4z5FSiin5zEiTL44OII1Y3IIlEvxwxFUVgrHSZ/UpA==} engines: {node: '>=16'} peerDependencies: typescript: '>=4.2.0' @@ -4391,48 +4535,42 @@ packages: engines: {node: '>=8'} dev: false - /typed-array-buffer@1.0.2: - resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==} + /typed-array-buffer@1.0.0: + resolution: {integrity: sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 + call-bind: 1.0.5 + get-intrinsic: 1.2.2 is-typed-array: 1.1.13 dev: true - /typed-array-byte-length@1.0.1: - resolution: {integrity: sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==} + /typed-array-byte-length@1.0.0: + resolution: {integrity: sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.5 for-each: 0.3.3 - gopd: 1.0.1 - has-proto: 1.0.3 + has-proto: 1.0.1 is-typed-array: 1.1.13 dev: true - /typed-array-byte-offset@1.0.2: - resolution: {integrity: sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==} + /typed-array-byte-offset@1.0.0: + resolution: {integrity: sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==} engines: {node: '>= 0.4'} dependencies: - available-typed-arrays: 1.0.7 - call-bind: 1.0.7 + available-typed-arrays: 1.0.6 + call-bind: 1.0.5 for-each: 0.3.3 - gopd: 1.0.1 - has-proto: 1.0.3 + has-proto: 1.0.1 is-typed-array: 1.1.13 dev: true - /typed-array-length@1.0.5: - resolution: {integrity: sha512-yMi0PlwuznKHxKmcpoOdeLwxBoVPkqZxd7q2FgMkmD3bNwvF5VW0+UlUQ1k1vmktTu4Yu13Q0RIxEP8+B+wloA==} - engines: {node: '>= 0.4'} + /typed-array-length@1.0.4: + resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.5 for-each: 0.3.3 - gopd: 1.0.1 - has-proto: 1.0.3 is-typed-array: 1.1.13 - possible-typed-array-names: 1.0.0 dev: true /typescript@5.4.2: @@ -4443,7 +4581,7 @@ packages: /unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.5 has-bigints: 1.0.2 has-symbols: 1.0.3 which-boxed-primitive: 1.0.2 @@ -4452,11 +4590,11 @@ packages: /undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} - /undici@5.28.3: - resolution: {integrity: sha512-3ItfzbrhDlINjaP0duwnNsKpDQk3acHI3gVJ1z4fmwMK31k5G9OVIAMLSIaP6w4FaGkaAkN6zaQO9LUvZ1t7VA==} + /undici@5.28.2: + resolution: {integrity: sha512-wh1pHJHnUeQV5Xa8/kyQhO7WFa8M34l026L5P/+2TYiakvGy5Rdc8jWZVyG7ieht/0WgJLEd3kcU5gKx+6GC8w==} engines: {node: '>=14.0'} dependencies: - '@fastify/busboy': 2.1.1 + '@fastify/busboy': 2.1.0 dev: false /universalify@0.1.2: @@ -4474,14 +4612,14 @@ packages: engines: {node: '>= 0.8'} dev: false - /update-browserslist-db@1.0.13(browserslist@4.23.0): + /update-browserslist-db@1.0.13(browserslist@4.22.3): resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' dependencies: - browserslist: 4.23.0 - escalade: 3.1.2 + browserslist: 4.22.3 + escalade: 3.1.1 picocolors: 1.0.0 dev: true @@ -4500,11 +4638,6 @@ packages: hasBin: true dev: false - /uuid@9.0.1: - resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} - hasBin: true - dev: true - /v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} @@ -4518,12 +4651,12 @@ packages: is-symbol: 1.0.4 dev: true - /which-typed-array@1.1.15: - resolution: {integrity: sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==} + /which-typed-array@1.1.14: + resolution: {integrity: sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==} engines: {node: '>= 0.4'} dependencies: - available-typed-arrays: 1.0.7 - call-bind: 1.0.7 + available-typed-arrays: 1.0.6 + call-bind: 1.0.5 for-each: 0.3.3 gopd: 1.0.1 has-tostringtag: 1.0.2 @@ -4628,7 +4761,7 @@ packages: engines: {node: '>=10'} dependencies: cliui: 7.0.4 - escalade: 3.1.2 + escalade: 3.1.1 get-caller-file: 2.0.5 require-directory: 2.1.1 string-width: 4.2.3 diff --git a/src/eas.ts b/src/eas.ts index 014a236..1883224 100644 --- a/src/eas.ts +++ b/src/eas.ts @@ -1,5 +1,10 @@ -import { EAS__factory, EAS as EASContract } from '@ethereum-attestation-service/eas-contracts'; -import { Overrides, TransactionReceipt } from 'ethers'; +import { EAS as EASContract, EAS__factory as EASFactory } from '@ethereum-attestation-service/eas-contracts'; +import { + EAS as EASLegacyContract, + EAS__factory as EASLegacyFactory +} from '@ethereum-attestation-service/eas-contracts-legacy'; +import { ContractTransaction, Overrides, TransactionReceipt } from 'ethers'; +import semver from 'semver'; import { EIP712Proxy } from './eip712-proxy'; import { legacyVersion } from './legacy/version'; import { Delegated, Offchain, OffchainAttestationVersion } from './offchain'; @@ -27,6 +32,9 @@ import { ZERO_BYTES32 } from './utils'; +const LEGACY_VERSION = '1.1.0'; + +export { Overrides } from 'ethers'; export * from './request'; export interface Attestation { @@ -51,11 +59,13 @@ export class EAS extends Base { private proxy?: EIP712Proxy; private delegated?: Delegated; private offchain?: Offchain; + private version?: string; + private legacyEAS: Base; constructor(address: string, options?: EASOptions) { const { signer, proxy } = options || {}; - super(new EAS__factory(), address, signer); + super(new EASFactory(), address, signer); // Check for ethers v6 compatibility if (!this.contract.getAddress) { @@ -67,6 +77,8 @@ export class EAS extends Base { if (proxy) { this.proxy = proxy; } + + this.legacyEAS = new Base(new EASLegacyFactory(), address, signer); } // Connects the API to a specific signer @@ -76,12 +88,20 @@ export class EAS extends Base { super.connect(signer); + if (this.legacyEAS) { + this.legacyEAS.connect(signer); + } + return this; } // Returns the version of the contract public async getVersion(): Promise { - return (await legacyVersion(this.contract)) ?? this.contract.version(); + if (this.version) { + return this.version; + } + + return (this.version = (await legacyVersion(this.contract)) ?? (await this.contract.version())); } // Returns an existing schema by attestation UID @@ -189,8 +209,27 @@ export class EAS extends Base { throw new Error('Invalid signer'); } - return new Transaction( - await this.contract.attestByDelegation.populateTransaction( + let tx: ContractTransaction; + + if (await this.isLegacyContract()) { + tx = await this.legacyEAS.contract.attestByDelegation.populateTransaction( + { + schema, + data: { + recipient, + expirationTime, + revocable, + refUID, + data, + value + }, + signature, + attester + }, + { value, ...overrides } + ); + } else { + tx = await this.contract.attestByDelegation.populateTransaction( { schema, data: { @@ -206,7 +245,11 @@ export class EAS extends Base { deadline }, { value, ...overrides } - ), + ); + } + + return new Transaction( + tx, this.signer, // eslint-disable-next-line require-await async (receipt: TransactionReceipt) => getUIDsFromAttestReceipt(receipt)[0] @@ -256,31 +299,62 @@ export class EAS extends Base { throw new Error('Invalid signer'); } - const multiAttestationRequests = requests.map((r) => ({ - schema: r.schema, - data: r.data.map((d) => ({ - recipient: d.recipient ?? ZERO_ADDRESS, - expirationTime: d.expirationTime ?? NO_EXPIRATION, - revocable: d.revocable ?? true, - refUID: d.refUID ?? ZERO_BYTES32, - data: d.data ?? ZERO_BYTES32, - value: d.value ?? 0n - })), - signatures: r.signatures, - attester: r.attester, - deadline: r.deadline ?? NO_EXPIRATION - })); - - const requestedValue = multiAttestationRequests.reduce((res, { data }) => { - const total = data.reduce((res, r) => res + r.value, 0n); - return res + total; - }, 0n); - - return new Transaction( - await this.contract.multiAttestByDelegation.populateTransaction(multiAttestationRequests, { + let tx: ContractTransaction; + + if (await this.isLegacyContract()) { + const multiAttestationRequests = requests.map((r) => ({ + schema: r.schema, + data: r.data.map((d) => ({ + recipient: d.recipient ?? ZERO_ADDRESS, + expirationTime: d.expirationTime ?? NO_EXPIRATION, + revocable: d.revocable ?? true, + refUID: d.refUID ?? ZERO_BYTES32, + data: d.data ?? ZERO_BYTES32, + value: d.value ?? 0n + })), + signatures: r.signatures, + attester: r.attester, + deadline: r.deadline ?? NO_EXPIRATION + })); + + const requestedValue = multiAttestationRequests.reduce((res, { data }) => { + const total = data.reduce((res, r) => res + r.value, 0n); + return res + total; + }, 0n); + + tx = await this.legacyEAS.contract.multiAttestByDelegation.populateTransaction(multiAttestationRequests, { value: requestedValue, ...overrides - }), + }); + } else { + const multiAttestationRequests = requests.map((r) => ({ + schema: r.schema, + data: r.data.map((d) => ({ + recipient: d.recipient ?? ZERO_ADDRESS, + expirationTime: d.expirationTime ?? NO_EXPIRATION, + revocable: d.revocable ?? true, + refUID: d.refUID ?? ZERO_BYTES32, + data: d.data ?? ZERO_BYTES32, + value: d.value ?? 0n + })), + signatures: r.signatures, + attester: r.attester, + deadline: r.deadline ?? NO_EXPIRATION + })); + + const requestedValue = multiAttestationRequests.reduce((res, { data }) => { + const total = data.reduce((res, r) => res + r.value, 0n); + return res + total; + }, 0n); + + tx = await this.contract.multiAttestByDelegation.populateTransaction(multiAttestationRequests, { + value: requestedValue, + ...overrides + }); + } + + return new Transaction( + tx, this.signer, // eslint-disable-next-line require-await async (receipt: TransactionReceipt) => getUIDsFromAttestReceipt(receipt) @@ -312,8 +386,23 @@ export class EAS extends Base { throw new Error('Invalid signer'); } - return new Transaction( - await this.contract.revokeByDelegation.populateTransaction( + let tx: ContractTransaction; + + if (await this.isLegacyContract()) { + tx = await this.legacyEAS.contract.revokeByDelegation.populateTransaction( + { + schema, + data: { + uid, + value + }, + signature, + revoker + }, + { value, ...overrides } + ); + } else { + tx = await this.contract.revokeByDelegation.populateTransaction( { schema, data: { @@ -325,10 +414,10 @@ export class EAS extends Base { deadline }, { value, ...overrides } - ), - this.signer, - async () => {} - ); + ); + } + + return new Transaction(tx, this.signer, async () => {}); } // Multi-revokes multiple attestations @@ -369,30 +458,56 @@ export class EAS extends Base { throw new Error('Invalid signer'); } - const multiRevocationRequests = requests.map((r) => ({ - schema: r.schema, - data: r.data.map((d) => ({ - uid: d.uid, - value: d.value ?? 0n - })), - signatures: r.signatures, - revoker: r.revoker, - deadline: r.deadline ?? NO_EXPIRATION - })); - - const requestedValue = multiRevocationRequests.reduce((res, { data }) => { - const total = data.reduce((res, r) => res + r.value, 0n); - return res + total; - }, 0n); + if (!this.signer) { + throw new Error('Invalid signer'); + } - return new Transaction( - await this.contract.multiRevokeByDelegation.populateTransaction(multiRevocationRequests, { + let tx: ContractTransaction; + + if (await this.isLegacyContract()) { + const multiRevocationRequests = requests.map((r) => ({ + schema: r.schema, + data: r.data.map((d) => ({ + uid: d.uid, + value: d.value ?? 0n + })), + signatures: r.signatures, + revoker: r.revoker + })); + + const requestedValue = multiRevocationRequests.reduce((res, { data }) => { + const total = data.reduce((res, r) => res + r.value, 0n); + return res + total; + }, 0n); + + tx = await this.legacyEAS.contract.multiRevokeByDelegation.populateTransaction(multiRevocationRequests, { value: requestedValue, ...overrides - }), - this.signer, - async () => {} - ); + }); + } else { + const multiRevocationRequests = requests.map((r) => ({ + schema: r.schema, + data: r.data.map((d) => ({ + uid: d.uid, + value: d.value ?? 0n + })), + signatures: r.signatures, + revoker: r.revoker, + deadline: r.deadline ?? NO_EXPIRATION + })); + + const requestedValue = multiRevocationRequests.reduce((res, { data }) => { + const total = data.reduce((res, r) => res + r.value, 0n); + return res + total; + }, 0n); + + tx = await this.contract.multiRevokeByDelegation.populateTransaction(multiRevocationRequests, { + value: requestedValue, + ...overrides + }); + } + + return new Transaction(tx, this.signer, async () => {}); } // Attests to a specific schema via an EIP712 delegation request using an external EIP712 proxy @@ -523,7 +638,7 @@ export class EAS extends Base { private async setDelegated(): Promise { this.delegated = new Delegated({ address: await this.contract.getAddress(), - version: await this.getVersion(), + domainSeparator: await this.getDomainSeparator(), chainId: await this.getChainId() }); @@ -544,4 +659,8 @@ export class EAS extends Base { return this.offchain; } + + private async isLegacyContract() { + return semver.lte(await this.getVersion(), LEGACY_VERSION); + } } diff --git a/src/offchain/delegated.ts b/src/offchain/delegated.ts index a823c31..6f7dd76 100644 --- a/src/offchain/delegated.ts +++ b/src/offchain/delegated.ts @@ -5,23 +5,14 @@ import { EIP712Params, EIP712Response, EIP712Types, - PartialTypedDataConfig, TypeDataSigner, TypedDataHandler } from './typed-data-handler'; +import { EIP712_NAME, EIP712_VERSIONS } from './versions'; -export { - EIP712MessageTypes, - EIP712TypedData, - EIP712Request, - EIP712Response, - PartialTypedDataConfig, - Signature -} from './typed-data-handler'; +export { EIP712MessageTypes, EIP712TypedData, EIP712Request, EIP712Response, Signature } from './typed-data-handler'; -export const EIP712_NAME = 'EAS'; - -export enum DelegatedAttestationVersion { +enum DelegatedAttestationVersion { Legacy = 0, Version1 = 1, Version2 = 2 @@ -154,17 +145,54 @@ interface EIP712FullRevocationParams extends EIP712RevocationParams { revoker: string; } +interface DelegatedConfig { + address: string; + chainId: bigint; + version?: string; + domainSeparator?: string; +} + export class Delegated extends TypedDataHandler { public readonly version: DelegatedAttestationVersion; private readonly attestType: DelegatedAttestationType; private readonly revokeType: DelegatedAttestationType; - constructor(config: PartialTypedDataConfig) { - super({ ...config, name: EIP712_NAME }); + constructor(config: DelegatedConfig) { + let { version } = config; + if (!version) { + const { domainSeparator } = config; + + if (!domainSeparator) { + throw new Error('Neither EIP712 version or domain separator were provided'); + } + + // If only the domain separator was provided, let's try to deduce the version accordingly. + for (const eip712Version of EIP712_VERSIONS) { + if ( + domainSeparator === + TypedDataHandler.getDomainSeparator({ + address: config.address, + name: EIP712_NAME, + version: eip712Version, + chainId: config.chainId + }) + ) { + version = eip712Version; - if (semver.lt(config.version, '1.2.0')) { + break; + } + } + + if (!version) { + throw new Error(`Unable to find version for domain separator: ${domainSeparator}`); + } + } + + super({ ...config, version, name: EIP712_NAME }); + + if (semver.lt(version, '1.2.0')) { this.version = DelegatedAttestationVersion.Legacy; - } else if (semver.lt(config.version, '1.3.0')) { + } else if (semver.lt(version, '1.3.0')) { this.version = DelegatedAttestationVersion.Version1; } else { this.version = DelegatedAttestationVersion.Version2; @@ -183,9 +211,11 @@ export class Delegated extends TypedDataHandler { ...params }; - if (this.version === DelegatedAttestationVersion.Legacy) { - // Committing to a value or to a deadline isn't supported for legacy attestations, therefore they will be ignored - effectiveParams = omit(params, ['value', 'deadline']) as EIP712FullAttestationParams; + switch (this.version) { + case DelegatedAttestationVersion.Legacy: + effectiveParams = omit(params, ['value', 'deadline']) as EIP712FullAttestationParams; + + break; } return this.signTypedDataRequest( @@ -223,9 +253,11 @@ export class Delegated extends TypedDataHandler { ...params }; - if (this.version === DelegatedAttestationVersion.Legacy) { - // Committing to a value or to a deadline isn't supported for legacy revocations, therefore they will be ignored - effectiveParams = omit(params, ['value', 'deadline']) as EIP712FullRevocationParams; + switch (this.version) { + case DelegatedAttestationVersion.Legacy: + effectiveParams = omit(params, ['value', 'deadline']) as EIP712FullRevocationParams; + + break; } return this.signTypedDataRequest( diff --git a/src/offchain/offchain.ts b/src/offchain/offchain.ts index 3b80d22..4742325 100644 --- a/src/offchain/offchain.ts +++ b/src/offchain/offchain.ts @@ -1,7 +1,6 @@ import { AbiCoder, hexlify, keccak256, randomBytes, toUtf8Bytes } from 'ethers'; import { EAS } from '../eas'; import { getOffchainUID, ZERO_BYTES32 } from '../utils'; -import { EIP712_NAME } from './delegated'; import { DomainTypedData, EIP712MessageTypes, @@ -10,12 +9,12 @@ import { EIP712Types, InvalidPrimaryType, InvalidTypes, - PartialTypedDataConfig, TypeDataSigner, TypedDataHandler } from './typed-data-handler'; +import { EIP712_NAME } from './versions'; -export { EIP712Request, PartialTypedDataConfig, EIP712MessageTypes } from './typed-data-handler'; +export { EIP712Request, EIP712MessageTypes } from './typed-data-handler'; export interface OffchainAttestationType extends EIP712Types { domain: string; @@ -143,13 +142,19 @@ export interface SignedOffchainAttestation extends EIP712Response OffchainAttestationVersion.Version2) { throw new Error('Unsupported version'); } diff --git a/src/offchain/typed-data-handler.ts b/src/offchain/typed-data-handler.ts index 52cd4fb..1bfd4a9 100644 --- a/src/offchain/typed-data-handler.ts +++ b/src/offchain/typed-data-handler.ts @@ -22,16 +22,6 @@ export interface TypeDataSigner extends Addressable { ): Promise; } -export interface PartialTypedDataConfig { - address: string; - version: string; - chainId: bigint; -} - -export interface TypedDataConfig extends PartialTypedDataConfig { - name: string; -} - export interface DomainTypedData { chainId: bigint; name: string; @@ -104,6 +94,13 @@ export class InvalidPrimaryType extends Error {} export class InvalidTypes extends Error {} export class InvalidAddress extends Error {} +export interface TypedDataConfig { + address: string; + version: string; + chainId: bigint; + name: string; +} + export abstract class TypedDataHandler { public config: TypedDataConfig; @@ -112,15 +109,19 @@ export abstract class TypedDataHandler { } public getDomainSeparator() { + return TypedDataHandler.getDomainSeparator(this.config); + } + + public static getDomainSeparator(config: TypedDataConfig) { return keccak256( AbiCoder.defaultAbiCoder().encode( ['bytes32', 'bytes32', 'bytes32', 'uint256', 'address'], [ keccak256(toUtf8Bytes(EIP712_DOMAIN)), - keccak256(toUtf8Bytes(this.config.name)), - keccak256(toUtf8Bytes(this.config.version)), - this.config.chainId, - this.config.address + keccak256(toUtf8Bytes(config.name)), + keccak256(toUtf8Bytes(config.version)), + config.chainId, + config.address ] ) ); diff --git a/src/offchain/versions.ts b/src/offchain/versions.ts new file mode 100644 index 0000000..10fa50d --- /dev/null +++ b/src/offchain/versions.ts @@ -0,0 +1,2 @@ +export const EIP712_NAME = 'EAS'; +export const EIP712_VERSIONS = ['0.26', '1.0.0', '1.0.1', '1.0.2', '1.1.0', '1.2.0', '1.3.0', '1.4.0']; diff --git a/test/components/Contracts.ts b/test/components/Contracts.ts index 8290f24..35ec27c 100644 --- a/test/components/Contracts.ts +++ b/test/components/Contracts.ts @@ -1,12 +1,13 @@ import { - EAS__factory, - EIP712Proxy__factory, - Indexer__factory, - SchemaRegistry__factory + EAS__factory as EASFactory, + EIP712Proxy__factory as EIP712ProxyFactory, + Indexer__factory as IndexerFactory, + SchemaRegistry__factory as SchemaRegistryFactory } from '@ethereum-attestation-service/eas-contracts'; +import { EAS__factory as EASLegacyFactory } from '@ethereum-attestation-service/eas-contracts-legacy'; import { ContractFactory, Signer } from 'ethers'; import { ethers } from 'hardhat'; -import { ETHResolver__factory } from '../typechain-types'; +import { ETHResolver__factory as ETHResolverFactory } from '../typechain-types'; export * from '../typechain-types'; @@ -14,8 +15,8 @@ export * from '../typechain-types'; type AsyncReturnType any> = T extends (...args: any) => Promise ? U : T extends (...args: any) => infer U - ? U - : any; + ? U + : any; /* eslint-enable @typescript-eslint/no-explicit-any */ type Contract = AsyncReturnType; @@ -70,12 +71,13 @@ export const attachOnly = ( const getContracts = (signer?: Signer) => ({ connect: (signer: Signer) => getContracts(signer), - EAS: deployOrAttach('EAS', EAS__factory, signer), - SchemaRegistry: deployOrAttach('SchemaRegistry', SchemaRegistry__factory, signer), - EIP712Proxy: deployOrAttach('EIP712Proxy', EIP712Proxy__factory, signer), - Indexer: deployOrAttach('Indexer', Indexer__factory, signer), + EAS: deployOrAttach('EAS', EASFactory, signer), + SchemaRegistry: deployOrAttach('SchemaRegistry', SchemaRegistryFactory, signer), + EIP712Proxy: deployOrAttach('EIP712Proxy', EIP712ProxyFactory, signer), + Indexer: deployOrAttach('Indexer', IndexerFactory, signer), - ETHResolver: deployOrAttach('ETHResolver', ETHResolver__factory, signer) + EASLegacy: deployOrAttach('EAS', EASLegacyFactory, signer), + ETHResolver: deployOrAttach('ETHResolver', ETHResolverFactory, signer) }); /* eslint-enable camelcase */ diff --git a/test/hardhat.config.ts b/test/hardhat.config.ts index c2abe10..c74fbe3 100644 --- a/test/hardhat.config.ts +++ b/test/hardhat.config.ts @@ -36,7 +36,9 @@ const config: HardhatUserConfig = { dependencyCompiler: { paths: [ '@ethereum-attestation-service/eas-contracts/contracts/EAS.sol', - '@ethereum-attestation-service/eas-contracts/contracts/SchemaRegistry.sol' + '@ethereum-attestation-service/eas-contracts/contracts/SchemaRegistry.sol', + '@ethereum-attestation-service/eas-contracts-legacy/contracts/EAS.sol', + '@ethereum-attestation-service/eas-contracts-legacy/contracts/SchemaRegistry.sol' ] }, diff --git a/test/package.json b/test/package.json index 37943fe..ed33ea0 100755 --- a/test/package.json +++ b/test/package.json @@ -9,6 +9,7 @@ }, "devDependencies": { "@ethereum-attestation-service/eas-contracts": "1.3.7", + "@ethereum-attestation-service/eas-contracts-legacy": "npm:@ethereum-attestation-service/eas-contracts@1.0.0-beta.0", "@ianvs/prettier-plugin-sort-imports": "^4.2.1", "@nomicfoundation/edr-linux-x64-gnu": "^0.3.2", "@nomicfoundation/hardhat-ethers": "^3.0.5", diff --git a/test/pnpm-lock.yaml b/test/pnpm-lock.yaml index 78afe68..a20e680 100644 --- a/test/pnpm-lock.yaml +++ b/test/pnpm-lock.yaml @@ -8,6 +8,9 @@ devDependencies: '@ethereum-attestation-service/eas-contracts': specifier: 1.3.7 version: 1.3.7(ts-node@10.9.2)(typescript@5.4.2) + '@ethereum-attestation-service/eas-contracts-legacy': + specifier: npm:@ethereum-attestation-service/eas-contracts@1.0.0-beta.0 + version: /@ethereum-attestation-service/eas-contracts@1.0.0-beta.0(ts-node@10.9.2)(typescript@5.4.2) '@ianvs/prettier-plugin-sort-imports': specifier: ^4.2.1 version: 4.2.1(prettier@3.2.5) @@ -394,6 +397,18 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true + /@ethereum-attestation-service/eas-contracts@1.0.0-beta.0(ts-node@10.9.2)(typescript@5.4.2): + resolution: {integrity: sha512-kMe8XVl5QXI1L8ANqlVJqLv3WDs2uzz9+dzY9LUXvBKWF00tBhNji9lxEg4LKN0vz4YVL9bAUDuDeeSv8BOWdw==} + dependencies: + hardhat: 2.17.0(ts-node@10.9.2)(typescript@5.4.2) + transitivePeerDependencies: + - bufferutil + - supports-color + - ts-node + - typescript + - utf-8-validate + dev: true + /@ethereum-attestation-service/eas-contracts@1.3.7(ts-node@10.9.2)(typescript@5.4.2): resolution: {integrity: sha512-msCKGDhqSjfkx0lbs0PPkf/Z6bWxaYT9ze/uLoRh1tM7W8N27mobX4g6AsjATqGC+eWHRfliK9eCwJQj7TU8WA==} dependencies: @@ -997,6 +1012,22 @@ packages: '@nomicfoundation/edr-win32-x64-msvc': 0.3.2 dev: true + /@nomicfoundation/ethereumjs-block@5.0.1: + resolution: {integrity: sha512-u1Yioemi6Ckj3xspygu/SfFvm8vZEO8/Yx5a1QLzi6nVU0jz3Pg2OmHKJ5w+D9Ogk1vhwRiqEBAqcb0GVhCyHw==} + engines: {node: '>=14'} + dependencies: + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-trie': 6.0.1 + '@nomicfoundation/ethereumjs-tx': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + ethereum-cryptography: 0.1.3 + ethers: 5.7.2 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: true + /@nomicfoundation/ethereumjs-block@5.0.2: resolution: {integrity: sha512-hSe6CuHI4SsSiWWjHDIzWhSiAVpzMUcDRpWYzN0T9l8/Rz7xNn3elwVOJ/tAyS0LqL6vitUD78Uk7lQDXZun7Q==} engines: {node: '>=14'} @@ -1013,6 +1044,29 @@ packages: - utf-8-validate dev: true + /@nomicfoundation/ethereumjs-blockchain@7.0.1: + resolution: {integrity: sha512-NhzndlGg829XXbqJEYrF1VeZhAwSPgsK/OB7TVrdzft3y918hW5KNd7gIZ85sn6peDZOdjBsAXIpXZ38oBYE5A==} + engines: {node: '>=14'} + dependencies: + '@nomicfoundation/ethereumjs-block': 5.0.1 + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-ethash': 3.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-trie': 6.0.1 + '@nomicfoundation/ethereumjs-tx': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + abstract-level: 1.0.4 + debug: 4.3.4(supports-color@8.1.1) + ethereum-cryptography: 0.1.3 + level: 8.0.1 + lru-cache: 5.1.1 + memory-level: 1.0.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + /@nomicfoundation/ethereumjs-blockchain@7.0.2: resolution: {integrity: sha512-8UUsSXJs+MFfIIAKdh3cG16iNmWzWC/91P40sazNvrqhhdR/RtGDlFk2iFTGbBAZPs2+klZVzhRX8m2wvuvz3w==} engines: {node: '>=14'} @@ -1036,6 +1090,13 @@ packages: - utf-8-validate dev: true + /@nomicfoundation/ethereumjs-common@4.0.1: + resolution: {integrity: sha512-OBErlkfp54GpeiE06brBW/TTbtbuBJV5YI5Nz/aB2evTDo+KawyEzPjBlSr84z/8MFfj8wS2wxzQX1o32cev5g==} + dependencies: + '@nomicfoundation/ethereumjs-util': 9.0.1 + crc-32: 1.2.2 + dev: true + /@nomicfoundation/ethereumjs-common@4.0.2: resolution: {integrity: sha512-I2WGP3HMGsOoycSdOTSqIaES0ughQTueOsddJ36aYVpI3SN8YSusgRFLwzDJwRFVIYDKx/iJz0sQ5kBHVgdDwg==} dependencies: @@ -1051,6 +1112,21 @@ packages: - c-kzg dev: true + /@nomicfoundation/ethereumjs-ethash@3.0.1: + resolution: {integrity: sha512-KDjGIB5igzWOp8Ik5I6QiRH5DH+XgILlplsHR7TEuWANZA759G6krQ6o8bvj+tRUz08YygMQu/sGd9mJ1DYT8w==} + engines: {node: '>=14'} + dependencies: + '@nomicfoundation/ethereumjs-block': 5.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + abstract-level: 1.0.4 + bigint-crypto-utils: 3.3.0 + ethereum-cryptography: 0.1.3 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: true + /@nomicfoundation/ethereumjs-ethash@3.0.2: resolution: {integrity: sha512-8PfoOQCcIcO9Pylq0Buijuq/O73tmMVURK0OqdjhwqcGHYC2PwhbajDh7GZ55ekB0Px197ajK3PQhpKoiI/UPg==} engines: {node: '>=14'} @@ -1066,6 +1142,24 @@ packages: - utf-8-validate dev: true + /@nomicfoundation/ethereumjs-evm@2.0.1: + resolution: {integrity: sha512-oL8vJcnk0Bx/onl+TgQOQ1t/534GKFaEG17fZmwtPFeH8S5soiBYPCLUrvANOl4sCp9elYxIMzIiTtMtNNN8EQ==} + engines: {node: '>=14'} + dependencies: + '@ethersproject/providers': 5.7.2 + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-tx': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + debug: 4.3.4(supports-color@8.1.1) + ethereum-cryptography: 0.1.3 + mcl-wasm: 0.7.9 + rustbn.js: 0.2.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + /@nomicfoundation/ethereumjs-evm@2.0.2: resolution: {integrity: sha512-rBLcUaUfANJxyOx9HIdMX6uXGin6lANCulIm/pjMgRqfiCRMZie3WKYxTSd8ZE/d+qT+zTedBF4+VHTdTSePmQ==} engines: {node: '>=14'} @@ -1084,6 +1178,12 @@ packages: - utf-8-validate dev: true + /@nomicfoundation/ethereumjs-rlp@5.0.1: + resolution: {integrity: sha512-xtxrMGa8kP4zF5ApBQBtjlSbN5E2HI8m8FYgVSYAnO6ssUoY5pVPGy2H8+xdf/bmMa22Ce8nWMH3aEW8CcqMeQ==} + engines: {node: '>=14'} + hasBin: true + dev: true + /@nomicfoundation/ethereumjs-rlp@5.0.2: resolution: {integrity: sha512-QwmemBc+MMsHJ1P1QvPl8R8p2aPvvVcKBbvHnQOKBpBztEo0omN0eaob6FeZS/e3y9NSe+mfu3nNFBHszqkjTA==} engines: {node: '>=14'} @@ -1096,6 +1196,21 @@ packages: hasBin: true dev: true + /@nomicfoundation/ethereumjs-statemanager@2.0.1: + resolution: {integrity: sha512-B5ApMOnlruVOR7gisBaYwFX+L/AP7i/2oAahatssjPIBVDF6wTX1K7Qpa39E/nzsH8iYuL3krkYeUFIdO3EMUQ==} + dependencies: + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + debug: 4.3.4(supports-color@8.1.1) + ethereum-cryptography: 0.1.3 + ethers: 5.7.2 + js-sdsl: 4.4.2 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + /@nomicfoundation/ethereumjs-statemanager@2.0.2: resolution: {integrity: sha512-dlKy5dIXLuDubx8Z74sipciZnJTRSV/uHG48RSijhgm1V7eXYFC567xgKtsKiVZB1ViTP9iFL4B6Je0xD6X2OA==} dependencies: @@ -1111,6 +1226,17 @@ packages: - utf-8-validate dev: true + /@nomicfoundation/ethereumjs-trie@6.0.1: + resolution: {integrity: sha512-A64It/IMpDVODzCgxDgAAla8jNjNtsoQZIzZUfIV5AY6Coi4nvn7+VReBn5itlxMiL2yaTlQr9TRWp3CSI6VoA==} + engines: {node: '>=14'} + dependencies: + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + '@types/readable-stream': 2.3.15 + ethereum-cryptography: 0.1.3 + readable-stream: 3.6.2 + dev: true + /@nomicfoundation/ethereumjs-trie@6.0.2: resolution: {integrity: sha512-yw8vg9hBeLYk4YNg5MrSJ5H55TLOv2FSWUTROtDtTMMmDGROsAu+0tBjiNGTnKRi400M6cEzoFfa89Fc5k8NTQ==} engines: {node: '>=14'} @@ -1122,6 +1248,21 @@ packages: readable-stream: 3.6.2 dev: true + /@nomicfoundation/ethereumjs-tx@5.0.1: + resolution: {integrity: sha512-0HwxUF2u2hrsIM1fsasjXvlbDOq1ZHFV2dd1yGq8CA+MEYhaxZr8OTScpVkkxqMwBcc5y83FyPl0J9MZn3kY0w==} + engines: {node: '>=14'} + dependencies: + '@chainsafe/ssz': 0.9.4 + '@ethersproject/providers': 5.7.2 + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + ethereum-cryptography: 0.1.3 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: true + /@nomicfoundation/ethereumjs-tx@5.0.2: resolution: {integrity: sha512-T+l4/MmTp7VhJeNloMkM+lPU3YMUaXdcXgTGCf8+ZFvV9NYZTRLFekRwlG6/JMmVfIfbrW+dRRJ9A6H5Q/Z64g==} engines: {node: '>=14'} @@ -1152,6 +1293,15 @@ packages: ethereum-cryptography: 0.1.3 dev: true + /@nomicfoundation/ethereumjs-util@9.0.1: + resolution: {integrity: sha512-TwbhOWQ8QoSCFhV/DDfSmyfFIHjPjFBj957219+V3jTZYZ2rf9PmDtNOeZWAE3p3vlp8xb02XGpd0v6nTUPbsA==} + engines: {node: '>=14'} + dependencies: + '@chainsafe/ssz': 0.10.2 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + ethereum-cryptography: 0.1.3 + dev: true + /@nomicfoundation/ethereumjs-util@9.0.2: resolution: {integrity: sha512-4Wu9D3LykbSBWZo8nJCnzVIYGvGCuyiYLIJa9XXNVt1q1jUzHdB+sJvx95VGCpPkCT+IbLecW6yfzy3E1bQrwQ==} engines: {node: '>=14'} @@ -1174,6 +1324,29 @@ packages: ethereum-cryptography: 0.1.3 dev: true + /@nomicfoundation/ethereumjs-vm@7.0.1: + resolution: {integrity: sha512-rArhyn0jPsS/D+ApFsz3yVJMQ29+pVzNZ0VJgkzAZ+7FqXSRtThl1C1prhmlVr3YNUlfpZ69Ak+RUT4g7VoOuQ==} + engines: {node: '>=14'} + dependencies: + '@nomicfoundation/ethereumjs-block': 5.0.1 + '@nomicfoundation/ethereumjs-blockchain': 7.0.1 + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-evm': 2.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-statemanager': 2.0.1 + '@nomicfoundation/ethereumjs-trie': 6.0.1 + '@nomicfoundation/ethereumjs-tx': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + debug: 4.3.4(supports-color@8.1.1) + ethereum-cryptography: 0.1.3 + mcl-wasm: 0.7.9 + rustbn.js: 0.2.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + /@nomicfoundation/ethereumjs-vm@7.0.2: resolution: {integrity: sha512-Bj3KZT64j54Tcwr7Qm/0jkeZXJMfdcAtRBedou+Hx0dPOSIgqaIr0vvLwP65TpHbak2DmAq+KJbW2KNtIoFwvA==} engines: {node: '>=14'} @@ -1754,6 +1927,13 @@ packages: resolution: {integrity: sha512-LEyx4aLEC3x6T0UguF6YILf+ntvmOaWsVfENmIW0E9H09vKlLDGelMjjSm0jkDHALj8A8quZ/HapKNigzwge+Q==} dev: true + /abort-controller@3.0.0: + resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} + engines: {node: '>=6.5'} + dependencies: + event-target-shim: 5.0.1 + dev: true + /abstract-level@1.0.4: resolution: {integrity: sha512-eUP/6pbXBkMbXFdx4IH2fVgvB7M0JvR7/lIL33zcs0IBcwjdzSSl31TOJsaCzmKSSDF9h8QYSOJux4Nd4YJqFg==} engines: {node: '>=12'} @@ -3404,6 +3584,11 @@ packages: strip-hex-prefix: 1.0.0 dev: true + /event-target-shim@5.0.1: + resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} + engines: {node: '>=6'} + dev: true + /evp_bytestokey@1.0.3: resolution: {integrity: sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==} dependencies: @@ -3861,6 +4046,76 @@ packages: - utf-8-validate dev: true + /hardhat@2.17.0(ts-node@10.9.2)(typescript@5.4.2): + resolution: {integrity: sha512-CaEGa13tkJNe2/rdaBiive4pmdNShwxvdWVhr1zfb6aVpRhQt9VNO0l/UIBt/zzajz38ZFjvhfM2bj8LDXo9gw==} + engines: {node: '>=16.0.0'} + hasBin: true + peerDependencies: + ts-node: '*' + typescript: '*' + peerDependenciesMeta: + ts-node: + optional: true + typescript: + optional: true + dependencies: + '@ethersproject/abi': 5.7.0 + '@metamask/eth-sig-util': 4.0.1 + '@nomicfoundation/ethereumjs-block': 5.0.1 + '@nomicfoundation/ethereumjs-blockchain': 7.0.1 + '@nomicfoundation/ethereumjs-common': 4.0.1 + '@nomicfoundation/ethereumjs-evm': 2.0.1 + '@nomicfoundation/ethereumjs-rlp': 5.0.1 + '@nomicfoundation/ethereumjs-statemanager': 2.0.1 + '@nomicfoundation/ethereumjs-trie': 6.0.1 + '@nomicfoundation/ethereumjs-tx': 5.0.1 + '@nomicfoundation/ethereumjs-util': 9.0.1 + '@nomicfoundation/ethereumjs-vm': 7.0.1 + '@nomicfoundation/solidity-analyzer': 0.1.1 + '@sentry/node': 5.30.0 + '@types/bn.js': 5.1.5 + '@types/lru-cache': 5.1.1 + abort-controller: 3.0.0 + adm-zip: 0.4.16 + aggregate-error: 3.1.0 + ansi-escapes: 4.3.2 + chalk: 2.4.2 + chokidar: 3.6.0 + ci-info: 2.0.0 + debug: 4.3.4(supports-color@8.1.1) + enquirer: 2.4.1 + env-paths: 2.2.1 + ethereum-cryptography: 1.2.0 + ethereumjs-abi: 0.6.8 + find-up: 2.1.0 + fp-ts: 1.19.3 + fs-extra: 7.0.1 + glob: 7.2.0 + immutable: 4.3.5 + io-ts: 1.10.4 + keccak: 3.0.4 + lodash: 4.17.21 + mnemonist: 0.38.5 + mocha: 10.3.0 + p-map: 4.0.0 + raw-body: 2.5.2 + resolve: 1.17.0 + semver: 6.3.1 + solc: 0.7.3(debug@4.3.4) + source-map-support: 0.5.21 + stacktrace-parser: 0.1.10 + ts-node: 10.9.2(@types/node@20.11.30)(typescript@5.4.2) + tsort: 0.0.1 + typescript: 5.4.2 + undici: 5.28.3 + uuid: 8.3.2 + ws: 7.5.9 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + /hardhat@2.19.1(ts-node@10.9.2)(typescript@5.4.2): resolution: {integrity: sha512-bsWa63g1GB78ZyMN08WLhFElLPA+J+pShuKD1BFO2+88g3l+BL3R07vj9deIi9dMbssxgE714Gof1dBEDGqnCw==} hasBin: true diff --git a/test/test/eas.ts b/test/test/eas.ts index 8ac7613..f57a11a 100644 --- a/test/test/eas.ts +++ b/test/test/eas.ts @@ -1,8 +1,3 @@ -import { - EAS as EASContract, - EIP712Proxy as EIP712ProxyContract, - SchemaRegistry as SchemaRegistryContract -} from '@ethereum-attestation-service/eas-contracts'; import { encodeBytes32String, Signer } from 'ethers'; import { ethers } from 'hardhat'; import { EAS, NO_EXPIRATION } from '../../src/eas'; @@ -16,7 +11,6 @@ import { } from '../../src/offchain'; import { InvalidAddress, InvalidDomain, InvalidPrimaryType, InvalidTypes } from '../../src/offchain/typed-data-handler'; import { SchemaRegistry } from '../../src/schema-registry'; -import { getSchemaUID } from '../../src/utils'; import Contracts from '../components/Contracts'; import { ZERO_ADDRESS, ZERO_BYTES, ZERO_BYTES32 } from '../utils/Constants'; import chai from './helpers/chai'; @@ -35,19 +29,19 @@ const { expect } = chai; const EIP712_PROXY_NAME = 'EAS-Proxy'; +export enum EASVersion { + Legacy = 'legacy', + Version1 = 'version 1' +} + describe('EAS API', () => { let accounts: Signer[]; let sender: Signer; let recipient: Signer; let recipient2: Signer; - let registry: SchemaRegistryContract; - let easContract: EASContract; - let proxyContract: EIP712ProxyContract; - let eas: EAS; let schemaRegistry: SchemaRegistry; - let proxy: EIP712Proxy; before(async () => { accounts = await ethers.getSigners(); @@ -58,117 +52,335 @@ describe('EAS API', () => { beforeEach(async () => { sender = await createWallet(); - registry = await Contracts.SchemaRegistry.deploy(); - easContract = await Contracts.EAS.deploy(await registry.getAddress()); - proxyContract = await Contracts.EIP712Proxy.deploy(await easContract.getAddress(), EIP712_PROXY_NAME); + const schemaRegistryContract = await Contracts.SchemaRegistry.deploy(); + schemaRegistry = new SchemaRegistry(await schemaRegistryContract.getAddress(), { + signer: sender + }); }); - context('with a signer', () => { - beforeEach(async () => { - proxy = new EIP712Proxy(await proxyContract.getAddress(), { signer: sender }); - eas = new EAS(await easContract.getAddress(), { signer: sender, proxy }); - schemaRegistry = new SchemaRegistry(await registry.getAddress(), { signer: sender }); - }); + for (const { version, signatureTypes } of [ + { + version: EASVersion.Legacy, + signatureTypes: [SignatureType.Direct, SignatureType.Delegated] + }, + { + version: EASVersion.Version1, + signatureTypes: [ + SignatureType.Direct, + SignatureType.Delegated, + SignatureType.DelegatedProxy, + SignatureType.Offchain + ] + } + ]) { + context(`EAS ${version}`, () => { + beforeEach(async () => { + switch (version) { + case EASVersion.Legacy: + { + const easContract = await Contracts.EASLegacy.deploy(await schemaRegistry.contract.getAddress()); + eas = new EAS(await easContract.getAddress(), { signer: sender }); + } - describe('construction', () => { - it('should properly create an EAS API', async () => { - expect(eas.contract.runner?.provider).not.to.be.null; + break; - expect(await eas.getVersion()).to.equal(await easContract.version()); + case EASVersion.Version1: + { + const easContract = await Contracts.EAS.deploy(await schemaRegistry.contract.getAddress()); + const proxyContract = await Contracts.EIP712Proxy.deploy( + await easContract.getAddress(), + EIP712_PROXY_NAME + ); + + const proxy = new EIP712Proxy(await proxyContract.getAddress(), { signer: sender }); + + eas = new EAS(await easContract.getAddress(), { signer: sender, proxy }); + } + + break; + + default: + throw new Error(`Unsupported EAS version: ${version}`); + } }); - }); - describe('attesting', () => { - let expirationTime: bigint; - const data = '0x1234'; + describe('construction', () => { + it('should properly create an EAS API', async () => { + expect(eas.contract.runner?.provider).not.to.be.null; - beforeEach(async () => { - expirationTime = (await latest()) + duration.days(30n); + expect(await eas.getVersion()).to.equal(await eas.contract.version()); + }); }); - for (const signatureType of [ - SignatureType.Direct, - SignatureType.Delegated, - SignatureType.DelegatedProxy, - SignatureType.Offchain - ]) { - context(`via ${signatureType} attestation`, () => { - for (const revocable of [true, false]) { - for (const [maxPriorityFeePerGas, maxFeePerGas] of [ - [undefined, undefined], - [1000000000n, 200000000000n] - ]) { - context( - maxPriorityFeePerGas && maxFeePerGas - ? `with maxPriorityFeePerGas=${maxPriorityFeePerGas.toString()}, maxFeePerGas=${maxFeePerGas.toString()} overrides` - : 'with default fees', - () => { - context(`with ${revocable ? 'a revocable' : 'an irrevocable'} registered schema`, () => { - const schema1 = 'bool like'; - const schema2 = 'bytes32 proposalId, bool vote'; - let schema1Id: string; - let schema2Id: string; - - beforeEach(async () => { - const tx1 = await schemaRegistry.register({ schema: schema1, revocable }); - const tx2 = await schemaRegistry.register({ schema: schema2, revocable }); - - schema1Id = await tx1.wait(); - schema2Id = await tx2.wait(); - }); + describe('attesting', () => { + let expirationTime: bigint; + const data = '0x1234'; - it('should be able to query the schema registry', async () => { - const schemaData = await registry.getSchema(schema1Id); - expect(schemaData.uid).to.equal(schema1Id); - expect(schemaData.resolver).to.equal(ZERO_ADDRESS); - expect(schemaData.revocable).to.equal(revocable); - expect(schemaData.schema).to.equal(schema1); - }); + beforeEach(async () => { + expirationTime = (await latest()) + duration.days(30n); + }); - it('should allow attestation to an empty recipient', async () => { - await expectAttestation( - eas, - schema1Id, - { - recipient: ZERO_ADDRESS, - expirationTime, - revocable, - data - }, - { - signatureType, - from: sender, - maxFeePerGas, - maxPriorityFeePerGas, - deadline: (await latest()) + duration.days(1n) - } - ); - }); + for (const signatureType of signatureTypes) { + context(`via ${signatureType} attestation`, () => { + for (const revocable of [true, false]) { + for (const [maxPriorityFeePerGas, maxFeePerGas] of [ + [undefined, undefined], + [1000000000n, 200000000000n] + ]) { + context( + maxPriorityFeePerGas && maxFeePerGas + ? `with maxPriorityFeePerGas=${maxPriorityFeePerGas.toString()}, maxFeePerGas=${maxFeePerGas.toString()} overrides` + : 'with default fees', + () => { + context(`with ${revocable ? 'a revocable' : 'an irrevocable'} registered schema`, () => { + const schema1 = 'bool like'; + const schema2 = 'bytes32 proposalId, bool vote'; + let schema1Id: string; + let schema2Id: string; + + beforeEach(async () => { + const tx1 = await schemaRegistry.register({ schema: schema1, revocable }); + const tx2 = await schemaRegistry.register({ schema: schema2, revocable }); + + schema1Id = await tx1.wait(); + schema2Id = await tx2.wait(); + }); - it('should allow self attestations', async () => { - await expectAttestation( - eas, - schema1Id, - { recipient: await sender.getAddress(), expirationTime, revocable, data }, - { - signatureType, - from: sender, - maxFeePerGas, - maxPriorityFeePerGas, - deadline: (await latest()) + duration.days(1n) - } - ); + it('should be able to query the schema registry', async () => { + const schemaData = await schemaRegistry.getSchema({ uid: schema1Id }); + expect(schemaData.uid).to.equal(schema1Id); + expect(schemaData.resolver).to.equal(ZERO_ADDRESS); + expect(schemaData.revocable).to.equal(revocable); + expect(schemaData.schema).to.equal(schema1); + }); + + it('should allow attestation to an empty recipient', async () => { + await expectAttestation( + eas, + schema1Id, + { + recipient: ZERO_ADDRESS, + expirationTime, + revocable, + data + }, + { + signatureType, + from: sender, + maxFeePerGas, + maxPriorityFeePerGas, + deadline: (await latest()) + duration.days(1n) + } + ); + }); + + it('should allow self attestations', async () => { + await expectAttestation( + eas, + schema1Id, + { recipient: await sender.getAddress(), expirationTime, revocable, data }, + { + signatureType, + from: sender, + maxFeePerGas, + maxPriorityFeePerGas, + deadline: (await latest()) + duration.days(1n) + } + ); + }); + + it('should allow multiple attestations', async () => { + await expectAttestation( + eas, + schema1Id, + { + recipient: await recipient.getAddress(), + expirationTime, + revocable, + data: encodeBytes32String('0') + }, + { + signatureType, + from: sender, + maxFeePerGas, + maxPriorityFeePerGas, + deadline: (await latest()) + duration.days(1n) + } + ); + + await expectAttestation( + eas, + schema1Id, + { + recipient: await recipient2.getAddress(), + expirationTime, + revocable, + data: encodeBytes32String('1') + }, + { + signatureType, + from: sender, + maxFeePerGas, + maxPriorityFeePerGas, + deadline: (await latest()) + duration.days(1n) + } + ); + }); + + if (signatureType !== SignatureType.Offchain) { + it('should allow multi attestations', async () => { + await expectMultiAttestations( + eas, + [ + { + schema: schema1Id, + data: [ + { + recipient: await recipient.getAddress(), + expirationTime, + revocable, + data: encodeBytes32String('0') + }, + { + recipient: await recipient2.getAddress(), + expirationTime, + revocable, + data: encodeBytes32String('1') + } + ] + }, + { + schema: schema2Id, + data: [ + { + recipient: await recipient.getAddress(), + expirationTime, + revocable, + data: encodeBytes32String('2') + }, + { + recipient: await recipient2.getAddress(), + expirationTime, + revocable, + data: encodeBytes32String('3') + } + ] + } + ], + { + signatureType, + from: sender, + maxFeePerGas, + maxPriorityFeePerGas, + deadline: (await latest()) + duration.days(1n) + } + ); + }); + } + + it('should allow attestation without expiration time', async () => { + await expectAttestation( + eas, + schema1Id, + { recipient: await recipient.getAddress(), expirationTime: NO_EXPIRATION, revocable, data }, + { + signatureType, + from: sender, + maxFeePerGas, + maxPriorityFeePerGas, + deadline: (await latest()) + duration.days(1n) + } + ); + }); + + it('should allow attestation without any data', async () => { + await expectAttestation( + eas, + schema1Id, + { recipient: await recipient.getAddress(), expirationTime, revocable, data: ZERO_BYTES }, + { + signatureType, + from: sender, + maxFeePerGas, + maxPriorityFeePerGas, + deadline: (await latest()) + duration.days(1n) + } + ); + }); + + it('should store referenced attestation', async () => { + const uid = await ( + await eas.attest({ + schema: schema1Id, + data: { recipient: await recipient.getAddress(), expirationTime, revocable, data } + }) + ).wait(); + + await expectAttestation( + eas, + schema1Id, + { recipient: await recipient.getAddress(), expirationTime, revocable, refUID: uid, data }, + { + signatureType, + from: sender, + maxFeePerGas, + maxPriorityFeePerGas, + deadline: (await latest()) + duration.days(1n) + } + ); + }); }); + } + ); + } + } + }); + } + }); + + describe('revocation', () => { + const schema1 = 'bool like'; + const schema2 = 'bytes32 proposalId, bool vote'; + let schema1Id: string; + let schema2Id: string; + + let uids1: string[]; + let uids2: string[]; + + beforeEach(async () => { + const tx1 = await schemaRegistry.register({ schema: schema1 }); + const tx2 = await schemaRegistry.register({ schema: schema2 }); - it('should allow multiple attestations', async () => { - await expectAttestation( + schema1Id = await tx1.wait(); + schema2Id = await tx2.wait(); + }); + + for (const signatureType of signatureTypes) { + if (signatureType === SignatureType.Offchain) { + continue; + } + + for (const [maxPriorityFeePerGas, maxFeePerGas] of [ + [undefined, undefined], + [1000000000n, 200000000000n] + ]) { + context( + maxPriorityFeePerGas && maxFeePerGas + ? `with maxPriorityFeePerGas=${maxPriorityFeePerGas.toString()}, maxFeePerGas=${maxFeePerGas.toString()} overrides` + : 'with default fees', + () => { + context(`via ${signatureType} revocation`, () => { + beforeEach(async () => { + uids1 = []; + + for (let i = 0; i < 2; i++) { + const uid = await expectAttestation( eas, schema1Id, { recipient: await recipient.getAddress(), - expirationTime, - revocable, - data: encodeBytes32String('0') + expirationTime: NO_EXPIRATION, + data: encodeBytes32String((i + 1).toString()) }, { signatureType, @@ -179,14 +391,19 @@ describe('EAS API', () => { } ); - await expectAttestation( + uids1.push(uid); + } + + uids2 = []; + + for (let i = 0; i < 2; i++) { + const uid = await expectAttestation( eas, - schema1Id, + schema2Id, { - recipient: await recipient2.getAddress(), - expirationTime, - revocable, - data: encodeBytes32String('1') + recipient: await recipient.getAddress(), + expirationTime: NO_EXPIRATION, + data: encodeBytes32String((i + 1).toString()) }, { signatureType, @@ -196,64 +413,17 @@ describe('EAS API', () => { deadline: (await latest()) + duration.days(1n) } ); - }); - if (signatureType !== SignatureType.Offchain) { - it('should allow multi attestations', async () => { - await expectMultiAttestations( - eas, - [ - { - schema: schema1Id, - data: [ - { - recipient: await recipient.getAddress(), - expirationTime, - revocable, - data: encodeBytes32String('0') - }, - { - recipient: await recipient2.getAddress(), - expirationTime, - revocable, - data: encodeBytes32String('1') - } - ] - }, - { - schema: schema2Id, - data: [ - { - recipient: await recipient.getAddress(), - expirationTime, - revocable, - data: encodeBytes32String('2') - }, - { - recipient: await recipient2.getAddress(), - expirationTime, - revocable, - data: encodeBytes32String('3') - } - ] - } - ], - { - signatureType, - from: sender, - maxFeePerGas, - maxPriorityFeePerGas, - deadline: (await latest()) + duration.days(1n) - } - ); - }); + uids2.push(uid); } + }); - it('should allow attestation without expiration time', async () => { - await expectAttestation( + it('should allow revoking existing attestations', async () => { + for (const uid of uids1) { + await expectRevocation( eas, schema1Id, - { recipient: await recipient.getAddress(), expirationTime: NO_EXPIRATION, revocable, data }, + { uid }, { signatureType, from: sender, @@ -262,13 +432,13 @@ describe('EAS API', () => { deadline: (await latest()) + duration.days(1n) } ); - }); + } - it('should allow attestation without any data', async () => { - await expectAttestation( + for (const uid of uids2) { + await expectRevocation( eas, - schema1Id, - { recipient: await recipient.getAddress(), expirationTime, revocable, data: ZERO_BYTES }, + schema2Id, + { uid }, { signatureType, from: sender, @@ -277,78 +447,22 @@ describe('EAS API', () => { deadline: (await latest()) + duration.days(1n) } ); - }); + } + }); - it('should store referenced attestation', async () => { - const uid = await ( - await eas.attest({ + it('should allow to multi-revoke existing attestations', async () => { + await expectMultiRevocations( + eas, + [ + { schema: schema1Id, - data: { recipient: await recipient.getAddress(), expirationTime, revocable, data } - }) - ).wait(); - - await expectAttestation( - eas, - schema1Id, - { recipient: await recipient.getAddress(), expirationTime, revocable, refUID: uid, data }, + data: [{ uid: uids1[0] }, { uid: uids1[1] }] + }, { - signatureType, - from: sender, - maxFeePerGas, - maxPriorityFeePerGas, - deadline: (await latest()) + duration.days(1n) + schema: schema2Id, + data: [{ uid: uids2[0] }, { uid: uids2[1] }] } - ); - }); - }); - } - ); - } - } - }); - } - }); - - describe('revocation', () => { - const schema1 = 'bool like'; - const schema2 = 'bytes32 proposalId, bool vote'; - let schema1Id: string; - let schema2Id: string; - - let uids1: string[]; - let uids2: string[]; - - beforeEach(async () => { - const tx1 = await schemaRegistry.register({ schema: schema1 }); - const tx2 = await schemaRegistry.register({ schema: schema2 }); - - schema1Id = await tx1.wait(); - schema2Id = await tx2.wait(); - }); - - for (const signatureType of [SignatureType.Direct, SignatureType.Delegated, SignatureType.DelegatedProxy]) { - for (const [maxPriorityFeePerGas, maxFeePerGas] of [ - [undefined, undefined], - [1000000000n, 200000000000n] - ]) { - context( - maxPriorityFeePerGas && maxFeePerGas - ? `with maxPriorityFeePerGas=${maxPriorityFeePerGas.toString()}, maxFeePerGas=${maxFeePerGas.toString()} overrides` - : 'with default fees', - () => { - context(`via ${signatureType} revocation`, () => { - beforeEach(async () => { - uids1 = []; - - for (let i = 0; i < 2; i++) { - const uid = await expectAttestation( - eas, - schema1Id, - { - recipient: await recipient.getAddress(), - expirationTime: NO_EXPIRATION, - data: encodeBytes32String((i + 1).toString()) - }, + ], { signatureType, from: sender, @@ -356,445 +470,16 @@ describe('EAS API', () => { maxPriorityFeePerGas, deadline: (await latest()) + duration.days(1n) } - ); - - uids1.push(uid); - } - - uids2 = []; - - for (let i = 0; i < 2; i++) { - const uid = await expectAttestation( - eas, - schema2Id, - { - recipient: await recipient.getAddress(), - expirationTime: NO_EXPIRATION, - data: encodeBytes32String((i + 1).toString()) - }, - { - signatureType, - from: sender, - maxFeePerGas, - maxPriorityFeePerGas, - deadline: (await latest()) + duration.days(1n) - } - ); - - uids2.push(uid); - } - }); - - it('should allow to revoke existing attestations', async () => { - for (const uid of uids1) { - await expectRevocation( - eas, - schema1Id, - { uid }, - { - signatureType, - from: sender, - maxFeePerGas, - maxPriorityFeePerGas, - deadline: (await latest()) + duration.days(1n) - } - ); - } - - for (const uid of uids2) { - await expectRevocation( - eas, - schema2Id, - { uid }, - { - signatureType, - from: sender, - maxFeePerGas, - maxPriorityFeePerGas, - deadline: (await latest()) + duration.days(1n) - } - ); - } - }); - - it('should allow to multi-revoke existing attestations', async () => { - await expectMultiRevocations( - eas, - [ - { - schema: schema1Id, - data: [{ uid: uids1[0] }, { uid: uids1[1] }] - }, - { - schema: schema2Id, - data: [{ uid: uids2[0] }, { uid: uids2[1] }] - } - ], - { - signatureType, - from: sender, - maxFeePerGas, - maxPriorityFeePerGas, - deadline: (await latest()) + duration.days(1n) - } - ); - }); - }); - } - ); - } - } - }); - - describe('timestamping', () => { - const data1 = encodeBytes32String('0x1234'); - const data2 = encodeBytes32String('0x4567'); - const data3 = encodeBytes32String('0x6666'); - - for (const [maxPriorityFeePerGas, maxFeePerGas] of [ - [undefined, undefined], - [1000000000, 200000000000] - ]) { - context( - maxPriorityFeePerGas && maxFeePerGas - ? `with maxPriorityFeePerGas=${maxPriorityFeePerGas.toString()}, maxFeePerGas=${maxFeePerGas.toString()} overrides` - : 'with default fees', - () => { - const overrides = maxPriorityFeePerGas && maxFeePerGas ? { maxFeePerGas, maxPriorityFeePerGas } : undefined; - - it('should timestamp a single data', async () => { - const tx = await eas.timestamp(data1, overrides); - const timestamp = await tx.wait(); - expect(timestamp).to.equal(await latest()); - - expect(await eas.getTimestamp(data1)).to.equal(timestamp); - - if (maxPriorityFeePerGas && maxFeePerGas) { - expect(tx.data.maxPriorityFeePerGas).to.equal(maxPriorityFeePerGas); - expect(tx.data.maxFeePerGas).to.equal(maxFeePerGas); - } - - const tx2 = await eas.timestamp(data2, overrides); - const timestamp2 = await tx2.wait(); - expect(timestamp2).to.equal(await latest()); - - expect(await eas.getTimestamp(data2)).to.equal(timestamp2); - - if (maxPriorityFeePerGas && maxFeePerGas) { - expect(tx2.data.maxPriorityFeePerGas).to.equal(maxPriorityFeePerGas); - expect(tx2.data.maxFeePerGas).to.equal(maxFeePerGas); - } - }); - - it('should timestamp multiple data', async () => { - const data = [data1, data2]; - const tx = await eas.multiTimestamp([data1, data2], overrides); - const timestamps = await tx.wait(); - - const currentTime = await latest(); - - for (const [i, d] of data.entries()) { - const timestamp = timestamps[i]; - expect(timestamp).to.equal(currentTime); - - expect(await eas.getTimestamp(d)).to.equal(timestamp); - } - - if (maxPriorityFeePerGas && maxFeePerGas) { - expect(tx.data.maxPriorityFeePerGas).to.equal(maxPriorityFeePerGas); - expect(tx.data.maxFeePerGas).to.equal(maxFeePerGas); - } - }); - - it("should return 0 for any data that wasn't timestamped multiple data", async () => { - expect(await eas.getTimestamp(data3)).to.equal(0); - }); - } - ); - } - }); - - describe('offchain attestation handling/verification', () => { - let offchain: Offchain; - - const schema = 'bool like'; - const schemaId = getSchemaUID(schema, ZERO_ADDRESS, true); - - beforeEach(async () => { - await registry.register(schema, ZERO_ADDRESS, false); - }); - - beforeEach(async () => { - offchain = await eas.getOffchain(); - }); - - describe('salting', () => { - beforeEach(async () => { - await registry.register(schema, ZERO_ADDRESS, true); - }); - - it('should support customizable salts', async () => { - const params = { - version: OffchainAttestationVersion.Version2, - schema: schemaId, - recipient: await recipient.getAddress(), - time: await latest(), - expirationTime: NO_EXPIRATION, - revocable: false, - refUID: ZERO_BYTES32, - data: ZERO_BYTES - }; - - const attestation = await offchain.signOffchainAttestation( - { ...params, salt: encodeBytes32String('SALT1') }, - sender, - { verifyOnchain: true } - ); - expect(await offchain.verifyOffchainAttestationSignature(await sender.getAddress(), attestation)).to.be.true; - - const attestation2 = await offchain.signOffchainAttestation( - { ...params, salt: encodeBytes32String('SALT2') }, - sender, - { verifyOnchain: true } - ); - expect(await offchain.verifyOffchainAttestationSignature(await sender.getAddress(), attestation2)).to.be.true; - - expect(attestation.uid).not.to.be.equal(attestation2.uid); - }); - - it('should generate a random salt by default', async () => { - const params = { - version: OffchainAttestationVersion.Version2, - schema: schemaId, - recipient: await recipient.getAddress(), - time: await latest(), - expirationTime: NO_EXPIRATION, - revocable: false, - refUID: ZERO_BYTES32, - data: ZERO_BYTES - }; - - const attestation = await offchain.signOffchainAttestation(params, sender, { verifyOnchain: true }); - expect(await offchain.verifyOffchainAttestationSignature(await sender.getAddress(), attestation)).to.be.true; - - const attestation2 = await offchain.signOffchainAttestation(params, sender, { verifyOnchain: true }); - expect(await offchain.verifyOffchainAttestationSignature(await sender.getAddress(), attestation2)).to.be.true; - - expect(attestation.message.salt).not.to.be.equal(attestation2.message.salt); - expect(attestation.uid).not.to.be.equal(attestation2.uid); - }); - }); - - describe('verification', () => { - const salt = encodeBytes32String('SALT'); - - beforeEach(async () => { - await registry.register(schema, ZERO_ADDRESS, true); - }); - - it('should verify the attestation onchain', async () => { - const attestation = await offchain.signOffchainAttestation( - { - schema: schemaId, - recipient: await recipient.getAddress(), - time: await latest(), - expirationTime: NO_EXPIRATION, - revocable: false, - refUID: ZERO_BYTES32, - data: ZERO_BYTES, - salt - }, - sender, - { verifyOnchain: true } - ); - expect(await offchain.verifyOffchainAttestationSignature(await sender.getAddress(), attestation)).to.be.true; - }); - - it('should throw on onchain verification of invalid attestations', async () => { - const params = { - version: OffchainAttestationVersion.Version2, - schema: schemaId, - recipient: await recipient.getAddress(), - time: await latest(), - expirationTime: NO_EXPIRATION, - revocable: false, - refUID: ZERO_BYTES32, - data: ZERO_BYTES, - salt - }; - - // Invalid schema - await expect( - offchain.signOffchainAttestation({ ...params, schema: ZERO_BYTES32 }, sender, { verifyOnchain: true }) - ).to.be.rejectedWith( - "Error: VM Exception while processing transaction: reverted with custom error 'InvalidSchema()'" - ); - - // Invalid expiration time - await expect( - offchain.signOffchainAttestation( - { ...params, expirationTime: (await latest()) - duration.days(1n) }, - sender, - { verifyOnchain: true } - ) - ).to.be.rejectedWith( - "Error: VM Exception while processing transaction: reverted with custom error 'InvalidExpirationTime()" - ); - }); - - it('should throw on offchain verification of invalid attestations', async () => { - const params = { - version: OffchainAttestationVersion.Version2, - schema: schemaId, - recipient: await recipient.getAddress(), - time: await latest(), - expirationTime: NO_EXPIRATION, - revocable: false, - refUID: ZERO_BYTES32, - data: ZERO_BYTES - }; - const senderAddress = await sender.getAddress(); - - const attestation = await offchain.signOffchainAttestation(params, sender); - - // Invalid attester - expect(() => offchain.verifyOffchainAttestationSignature(ZERO_ADDRESS, attestation)).to.throw(InvalidAddress); - - // Invalid domains - const { domain } = attestation; - - await expect(() => - offchain.verifyOffchainAttestationSignature(senderAddress, { - ...attestation, - ...{ domain: { ...domain, chainId: domain.chainId + 100n } } - }) - ).to.throw(InvalidDomain); - - await expect(() => - offchain.verifyOffchainAttestationSignature(senderAddress, { - ...attestation, - ...{ domain: { ...domain, verifyingContract: ZERO_ADDRESS } } - }) - ).to.throw(InvalidDomain); - - await expect(() => - offchain.verifyOffchainAttestationSignature(senderAddress, { - ...attestation, - ...{ domain: { ...domain, name: `BAD${domain.name}BAD` } } - }) - ).to.throw(InvalidDomain); - - // Invalid version verification won't throw, due to the check not being strict, but will fail on signature - await expect( - offchain.verifyOffchainAttestationSignature(senderAddress, { - ...attestation, - ...{ domain: { ...domain, version: '9999.9999.9999' } } - }) - ).to.be.false; - - // Invalid primary type - await expect(() => - offchain.verifyOffchainAttestationSignature(senderAddress, { - ...attestation, - ...{ primaryType: `BAD${attestation.primaryType}BAD` } - }) - ).to.throw(InvalidPrimaryType); - - // Invalid types - await expect(() => - offchain.verifyOffchainAttestationSignature(senderAddress, { - ...attestation, - ...{ - types: { [attestation.primaryType]: [{ name: 'schema', type: 'bytes32' }] } - } - }) - ).to.throw(InvalidTypes); - - await expect(() => - offchain.verifyOffchainAttestationSignature(senderAddress, { - ...attestation, - ...{ - types: { BAD: attestation.types.values } - } - }) - ).to.throw(InvalidTypes); - }); - - it('should verify offchain attestations with legacy/obsoleted domains', async () => { - const { config } = offchain; - const params = { - version: OffchainAttestationVersion.Legacy, - schema: schemaId, - recipient: await recipient.getAddress(), - time: await latest(), - expirationTime: NO_EXPIRATION, - revocable: false, - refUID: ZERO_BYTES32, - data: ZERO_BYTES - }; - const senderAddress = await sender.getAddress(); - - // Legacy version - const legacyOffchain = new Offchain(config, OffchainAttestationVersion.Legacy, new EAS(ZERO_ADDRESS)); - - let customOffchain = new CustomOffchain( - config, - OffchainAttestationVersion.Legacy, - { contractVersion: '0.0.1' }, - new EAS(ZERO_ADDRESS) - ); - - let attestation = await customOffchain.signOffchainAttestation(params, sender); - await expect(legacyOffchain.verifyOffchainAttestationSignature(senderAddress, attestation)).to.be.true; - - // Legacy types - for (const type of OFFCHAIN_ATTESTATION_TYPES[OffchainAttestationVersion.Legacy].slice(1)) { - customOffchain = new CustomOffchain( - config, - OffchainAttestationVersion.Legacy, - { - contractVersion: '0.26', - type - }, - new EAS(ZERO_ADDRESS) - ); - - attestation = await customOffchain.signOffchainAttestation(params, sender); - await expect(legacyOffchain.verifyOffchainAttestationSignature(senderAddress, attestation)).to.be.true; - } - }); - - context('with an irrevocable schema', () => { - const schema2 = 'bytes32 eventId,uint8 ticketType,uint32 ticketNum'; - const schema2Id = getSchemaUID(schema2, ZERO_ADDRESS, false); - - beforeEach(async () => { - await registry.register(schema2, ZERO_ADDRESS, false); - }); - - it('should throw on verification of invalid offchain attestations', async () => { - await expect( - offchain.signOffchainAttestation( - { - schema: schema2Id, - recipient: await recipient.getAddress(), - time: await latest(), - expirationTime: NO_EXPIRATION, - revocable: true, - refUID: ZERO_BYTES32, - data: ZERO_BYTES - }, - sender, - { verifyOnchain: true } - ) - ).to.be.rejectedWith( - "Error: VM Exception while processing transaction: reverted with custom error 'Irrevocable()'" + ); + }); + }); + } ); - }); - }); + } + } }); - describe('revocation', () => { + describe('timestamping', () => { const data1 = encodeBytes32String('0x1234'); const data2 = encodeBytes32String('0x4567'); const data3 = encodeBytes32String('0x6666'); @@ -811,23 +496,23 @@ describe('EAS API', () => { const overrides = maxPriorityFeePerGas && maxFeePerGas ? { maxFeePerGas, maxPriorityFeePerGas } : undefined; - it('should revoke a single data', async () => { - const tx = await eas.revokeOffchain(data1, overrides); + it('should timestamp a single data', async () => { + const tx = await eas.timestamp(data1, overrides); const timestamp = await tx.wait(); expect(timestamp).to.equal(await latest()); - expect(await eas.getRevocationOffchain(await sender.getAddress(), data1)).to.equal(timestamp); + expect(await eas.getTimestamp(data1)).to.equal(timestamp); if (maxPriorityFeePerGas && maxFeePerGas) { expect(tx.data.maxPriorityFeePerGas).to.equal(maxPriorityFeePerGas); expect(tx.data.maxFeePerGas).to.equal(maxFeePerGas); } - const tx2 = await eas.revokeOffchain(data2, overrides); + const tx2 = await eas.timestamp(data2, overrides); const timestamp2 = await tx2.wait(); expect(timestamp2).to.equal(await latest()); - expect(await eas.getRevocationOffchain(await sender.getAddress(), data2)).to.equal(timestamp2); + expect(await eas.getTimestamp(data2)).to.equal(timestamp2); if (maxPriorityFeePerGas && maxFeePerGas) { expect(tx2.data.maxPriorityFeePerGas).to.equal(maxPriorityFeePerGas); @@ -835,9 +520,9 @@ describe('EAS API', () => { } }); - it('should revoke multiple data', async () => { + it('should timestamp multiple data', async () => { const data = [data1, data2]; - const tx = await eas.multiRevokeOffchain([data1, data2], overrides); + const tx = await eas.multiTimestamp([data1, data2], overrides); const timestamps = await tx.wait(); const currentTime = await latest(); @@ -846,7 +531,7 @@ describe('EAS API', () => { const timestamp = timestamps[i]; expect(timestamp).to.equal(currentTime); - expect(await eas.getRevocationOffchain(await sender.getAddress(), d)).to.equal(timestamp); + expect(await eas.getTimestamp(d)).to.equal(timestamp); } if (maxPriorityFeePerGas && maxFeePerGas) { @@ -854,339 +539,698 @@ describe('EAS API', () => { expect(tx.data.maxFeePerGas).to.equal(maxFeePerGas); } }); + + it("should return 0 for any data that wasn't timestamped multiple data", async () => { + expect(await eas.getTimestamp(data3)).to.equal(0); + }); } ); } - - it("should return 0 for any data that wasn't revoked multiple data", async () => { - expect(await eas.getRevocationOffchain(await sender.getAddress(), data3)).to.equal(0); - }); }); - }); - describe('delegated attestation handling/verification', () => { - let delegated: Delegated; + describe('offchain attestation handling/verification', () => { + let offchain: Offchain; - const schema = 'bool like'; - const schemaId = getSchemaUID(schema, ZERO_ADDRESS, true); + const schema = 'bool like'; + let schemaId: string; - beforeEach(async () => { - await registry.register(schema, ZERO_ADDRESS, false); - }); + beforeEach(async () => { + const tx = await schemaRegistry.register({ schema, resolverAddress: ZERO_ADDRESS, revocable: false }); + schemaId = await tx.wait(); - beforeEach(async () => { - delegated = await eas.getDelegated(); - }); + offchain = await eas.getOffchain(); + }); - describe('verification', () => { - describe('attestation', () => { - it('should throw on offchain verification of invalid attestations', async () => { - const senderAddress = await sender.getAddress(); + describe('salting', () => { + it('should support customizable salts', async () => { const params = { + version: OffchainAttestationVersion.Version2, schema: schemaId, recipient: await recipient.getAddress(), + time: await latest(), expirationTime: NO_EXPIRATION, revocable: false, refUID: ZERO_BYTES32, - data: ZERO_BYTES, - value: 0n, - nonce: await eas.getNonce(senderAddress), - deadline: NO_EXPIRATION + data: ZERO_BYTES }; - const response = await delegated.signDelegatedAttestation(params, sender); + const attestation = await offchain.signOffchainAttestation( + { ...params, salt: encodeBytes32String('SALT1') }, + sender, + { verifyOnchain: true } + ); + expect(await offchain.verifyOffchainAttestationSignature(await sender.getAddress(), attestation)).to.be + .true; - // Invalid attester - expect(() => delegated.verifyDelegatedAttestationSignature(ZERO_ADDRESS, response)).to.throw( - InvalidAddress + const attestation2 = await offchain.signOffchainAttestation( + { ...params, salt: encodeBytes32String('SALT2') }, + sender, + { verifyOnchain: true } ); + expect(await offchain.verifyOffchainAttestationSignature(await sender.getAddress(), attestation2)).to.be + .true; - // Invalid domains - const { domain } = response; + expect(attestation.uid).not.to.be.equal(attestation2.uid); + }); - await expect(() => - delegated.verifyDelegatedAttestationSignature(senderAddress, { - ...response, - ...{ domain: { ...domain, chainId: domain.chainId + 100n } } - }) - ).to.throw(InvalidDomain); + it('should generate a random salt by default', async () => { + const params = { + version: OffchainAttestationVersion.Version2, + schema: schemaId, + recipient: await recipient.getAddress(), + time: await latest(), + expirationTime: NO_EXPIRATION, + revocable: false, + refUID: ZERO_BYTES32, + data: ZERO_BYTES + }; - await expect(() => - delegated.verifyDelegatedAttestationSignature(senderAddress, { - ...response, - ...{ domain: { ...domain, name: `BAD${domain.name}BAD` } } - }) - ).to.throw(InvalidDomain); + const attestation = await offchain.signOffchainAttestation(params, sender, { verifyOnchain: true }); + expect(await offchain.verifyOffchainAttestationSignature(await sender.getAddress(), attestation)).to.be + .true; - await expect(() => - delegated.verifyDelegatedAttestationSignature(senderAddress, { - ...response, - ...{ domain: { ...domain, verifyingContract: ZERO_ADDRESS } } - }) - ).to.throw(InvalidDomain); + const attestation2 = await offchain.signOffchainAttestation(params, sender, { verifyOnchain: true }); + expect(await offchain.verifyOffchainAttestationSignature(await sender.getAddress(), attestation2)).to.be + .true; - await expect(() => - delegated.verifyDelegatedAttestationSignature(senderAddress, { - ...response, - ...{ domain: { ...domain, version: '9999.9999.9999' } } - }) - ).to.throw(InvalidDomain); + expect(attestation.message.salt).not.to.be.equal(attestation2.message.salt); + expect(attestation.uid).not.to.be.equal(attestation2.uid); + }); + }); - // Invalid types - await expect(() => - delegated.verifyDelegatedAttestationSignature(senderAddress, { - ...response, - ...{ - types: { [response.primaryType]: [{ name: 'schema', type: 'bytes32' }] } - } - }) - ).to.throw(InvalidTypes); + describe('verification', () => { + const salt = encodeBytes32String('SALT'); - await expect(() => - delegated.verifyDelegatedAttestationSignature(senderAddress, { - ...response, - ...{ - types: { BAD: response.types.values } - } - }) - ).to.throw(InvalidTypes); + it('should verify the attestation onchain', async () => { + const attestation = await offchain.signOffchainAttestation( + { + schema: schemaId, + recipient: await recipient.getAddress(), + time: await latest(), + expirationTime: NO_EXPIRATION, + revocable: false, + refUID: ZERO_BYTES32, + data: ZERO_BYTES, + salt + }, + sender, + { verifyOnchain: true } + ); + expect(await offchain.verifyOffchainAttestationSignature(await sender.getAddress(), attestation)).to.be + .true; }); - }); - describe('revocation', () => { - it('should throw on offchain verification of invalid revocations', async () => { - const senderAddress = await sender.getAddress(); + it('should throw on onchain verification of invalid attestations', async () => { + const params = { + version: OffchainAttestationVersion.Version2, + schema: schemaId, + recipient: await recipient.getAddress(), + time: await latest(), + expirationTime: NO_EXPIRATION, + revocable: false, + refUID: ZERO_BYTES32, + data: ZERO_BYTES, + salt + }; + + // Invalid schema + await expect( + offchain.signOffchainAttestation({ ...params, schema: ZERO_BYTES32 }, sender, { verifyOnchain: true }) + ).to.be.rejectedWith( + "Error: VM Exception while processing transaction: reverted with custom error 'InvalidSchema()'" + ); + + // Invalid expiration time + await expect( + offchain.signOffchainAttestation( + { ...params, expirationTime: (await latest()) - duration.days(1n) }, + sender, + { verifyOnchain: true } + ) + ).to.be.rejectedWith( + "Error: VM Exception while processing transaction: reverted with custom error 'InvalidExpirationTime()" + ); + }); + + it('should throw on offchain verification of invalid attestations', async () => { const params = { + version: OffchainAttestationVersion.Version2, schema: schemaId, - uid: encodeBytes32String('123'), - value: 0n, - nonce: await eas.getNonce(senderAddress), - deadline: NO_EXPIRATION + recipient: await recipient.getAddress(), + time: await latest(), + expirationTime: NO_EXPIRATION, + revocable: false, + refUID: ZERO_BYTES32, + data: ZERO_BYTES }; + const senderAddress = await sender.getAddress(); - const response = await delegated.signDelegatedRevocation(params, sender); + const attestation = await offchain.signOffchainAttestation(params, sender); // Invalid attester - expect(() => delegated.verifyDelegatedRevocationSignature(ZERO_ADDRESS, response)).to.throw(InvalidAddress); + expect(() => offchain.verifyOffchainAttestationSignature(ZERO_ADDRESS, attestation)).to.throw( + InvalidAddress + ); // Invalid domains - const { domain } = response; + const { domain } = attestation; await expect(() => - delegated.verifyDelegatedRevocationSignature(senderAddress, { - ...response, + offchain.verifyOffchainAttestationSignature(senderAddress, { + ...attestation, ...{ domain: { ...domain, chainId: domain.chainId + 100n } } }) ).to.throw(InvalidDomain); await expect(() => - delegated.verifyDelegatedRevocationSignature(senderAddress, { - ...response, - ...{ domain: { ...domain, name: `BAD${domain.name}BAD` } } + offchain.verifyOffchainAttestationSignature(senderAddress, { + ...attestation, + ...{ domain: { ...domain, verifyingContract: ZERO_ADDRESS } } }) ).to.throw(InvalidDomain); await expect(() => - delegated.verifyDelegatedRevocationSignature(senderAddress, { - ...response, - ...{ domain: { ...domain, verifyingContract: ZERO_ADDRESS } } + offchain.verifyOffchainAttestationSignature(senderAddress, { + ...attestation, + ...{ domain: { ...domain, name: `BAD${domain.name}BAD` } } }) ).to.throw(InvalidDomain); - await expect(() => - delegated.verifyDelegatedRevocationSignature(senderAddress, { - ...response, + // Invalid version verification won't throw, due to the check not being strict, but will fail on signature + await expect( + offchain.verifyOffchainAttestationSignature(senderAddress, { + ...attestation, ...{ domain: { ...domain, version: '9999.9999.9999' } } }) - ).to.throw(InvalidDomain); + ).to.be.false; + + // Invalid primary type + await expect(() => + offchain.verifyOffchainAttestationSignature(senderAddress, { + ...attestation, + ...{ primaryType: `BAD${attestation.primaryType}BAD` } + }) + ).to.throw(InvalidPrimaryType); // Invalid types await expect(() => - delegated.verifyDelegatedRevocationSignature(senderAddress, { - ...response, + offchain.verifyOffchainAttestationSignature(senderAddress, { + ...attestation, ...{ - types: { [response.primaryType]: [{ name: 'schema', type: 'bytes32' }] } + types: { [attestation.primaryType]: [{ name: 'schema', type: 'bytes32' }] } } }) ).to.throw(InvalidTypes); await expect(() => - delegated.verifyDelegatedRevocationSignature(senderAddress, { - ...response, + offchain.verifyOffchainAttestationSignature(senderAddress, { + ...attestation, ...{ - types: { BAD: response.types.values } + types: { BAD: attestation.types.values } } }) ).to.throw(InvalidTypes); }); - }); - }); - }); - - describe('delegated proxy attestation handling/verification', () => { - let delegatedProxy: DelegatedProxy; - - const schema = 'bool like'; - const schemaId = getSchemaUID(schema, ZERO_ADDRESS, true); - - beforeEach(async () => { - await registry.register(schema, ZERO_ADDRESS, false); - }); - - beforeEach(async () => { - const proxy = await eas.getEIP712Proxy(); - if (!proxy) { - throw new Error('Invalid proxy'); - } - delegatedProxy = await proxy.getDelegated(); - }); - - describe('verification', () => { - describe('attestation', () => { - it('should throw on offchain verification of invalid attestations', async () => { - const senderAddress = await sender.getAddress(); + it('should verify offchain attestations with legacy/obsoleted domains', async () => { + const { config } = offchain; const params = { + version: OffchainAttestationVersion.Legacy, schema: schemaId, recipient: await recipient.getAddress(), + time: await latest(), expirationTime: NO_EXPIRATION, revocable: false, refUID: ZERO_BYTES32, - data: ZERO_BYTES, - value: 0n, - nonce: await eas.getNonce(senderAddress), - deadline: NO_EXPIRATION + data: ZERO_BYTES }; + const senderAddress = await sender.getAddress(); - const response = await delegatedProxy.signDelegatedProxyAttestation(params, sender); + // Legacy version + const legacyOffchain = new Offchain(config, OffchainAttestationVersion.Legacy, new EAS(ZERO_ADDRESS)); - // Invalid attester - expect(() => delegatedProxy.verifyDelegatedProxyAttestationSignature(ZERO_ADDRESS, response)).to.throw( - InvalidAddress + let customOffchain = new CustomOffchain( + config, + OffchainAttestationVersion.Legacy, + { contractVersion: '0.0.1' }, + new EAS(ZERO_ADDRESS) ); - // Invalid domains - const { domain } = response; + let attestation = await customOffchain.signOffchainAttestation(params, sender); + await expect(legacyOffchain.verifyOffchainAttestationSignature(senderAddress, attestation)).to.be.true; - await expect(() => - delegatedProxy.verifyDelegatedProxyAttestationSignature(senderAddress, { - ...response, - ...{ domain: { ...domain, chainId: domain.chainId + 100n } } - }) - ).to.throw(InvalidDomain); + // Legacy types + for (const type of OFFCHAIN_ATTESTATION_TYPES[OffchainAttestationVersion.Legacy].slice(1)) { + customOffchain = new CustomOffchain( + config, + OffchainAttestationVersion.Legacy, + { + contractVersion: '0.26', + type + }, + new EAS(ZERO_ADDRESS) + ); - await expect(() => - delegatedProxy.verifyDelegatedProxyAttestationSignature(senderAddress, { - ...response, - ...{ domain: { ...domain, name: `BAD${domain.name}BAD` } } - }) - ).to.throw(InvalidDomain); + attestation = await customOffchain.signOffchainAttestation(params, sender); + await expect(legacyOffchain.verifyOffchainAttestationSignature(senderAddress, attestation)).to.be.true; + } + }); - await expect(() => - delegatedProxy.verifyDelegatedProxyAttestationSignature(senderAddress, { - ...response, - ...{ domain: { ...domain, verifyingContract: ZERO_ADDRESS } } - }) - ).to.throw(InvalidDomain); + context('with an irrevocable schema', () => { + const schema2 = 'bytes32 eventId,uint8 ticketType,uint32 ticketNum'; + let schema2Id: string; - await expect(() => - delegatedProxy.verifyDelegatedProxyAttestationSignature(senderAddress, { - ...response, - ...{ domain: { ...domain, version: '9999.9999.9999' } } - }) - ).to.throw(InvalidDomain); + beforeEach(async () => { + const tx = await schemaRegistry.register({ + schema: schema2, + resolverAddress: ZERO_ADDRESS, + revocable: false + }); + schema2Id = await tx.wait(); + }); - // Invalid types - await expect(() => - delegatedProxy.verifyDelegatedProxyAttestationSignature(senderAddress, { - ...response, - ...{ - types: { [response.primaryType]: [{ name: 'schema', type: 'bytes32' }] } - } - }) - ).to.throw(InvalidTypes); + it('should throw on verification of invalid offchain attestations', async () => { + await expect( + offchain.signOffchainAttestation( + { + schema: schema2Id, + recipient: await recipient.getAddress(), + time: await latest(), + expirationTime: NO_EXPIRATION, + revocable: true, + refUID: ZERO_BYTES32, + data: ZERO_BYTES + }, + sender, + { verifyOnchain: true } + ) + ).to.be.rejectedWith( + "Error: VM Exception while processing transaction: reverted with custom error 'Irrevocable()'" + ); + }); + }); + }); - await expect(() => - delegatedProxy.verifyDelegatedProxyAttestationSignature(senderAddress, { - ...response, - ...{ - types: { BAD: response.types.values } - } - }) - ).to.throw(InvalidTypes); + describe('revocation', () => { + const data1 = encodeBytes32String('0x1234'); + const data2 = encodeBytes32String('0x4567'); + const data3 = encodeBytes32String('0x6666'); + + for (const [maxPriorityFeePerGas, maxFeePerGas] of [ + [undefined, undefined], + [1000000000, 200000000000] + ]) { + context( + maxPriorityFeePerGas && maxFeePerGas + ? `with maxPriorityFeePerGas=${maxPriorityFeePerGas.toString()}, maxFeePerGas=${maxFeePerGas.toString()} overrides` + : 'with default fees', + () => { + const overrides = + maxPriorityFeePerGas && maxFeePerGas ? { maxFeePerGas, maxPriorityFeePerGas } : undefined; + + it('should revoke a single data', async () => { + const tx = await eas.revokeOffchain(data1, overrides); + const timestamp = await tx.wait(); + expect(timestamp).to.equal(await latest()); + + expect(await eas.getRevocationOffchain(await sender.getAddress(), data1)).to.equal(timestamp); + + if (maxPriorityFeePerGas && maxFeePerGas) { + expect(tx.data.maxPriorityFeePerGas).to.equal(maxPriorityFeePerGas); + expect(tx.data.maxFeePerGas).to.equal(maxFeePerGas); + } + + const tx2 = await eas.revokeOffchain(data2, overrides); + const timestamp2 = await tx2.wait(); + expect(timestamp2).to.equal(await latest()); + + expect(await eas.getRevocationOffchain(await sender.getAddress(), data2)).to.equal(timestamp2); + + if (maxPriorityFeePerGas && maxFeePerGas) { + expect(tx2.data.maxPriorityFeePerGas).to.equal(maxPriorityFeePerGas); + expect(tx2.data.maxFeePerGas).to.equal(maxFeePerGas); + } + }); + + it('should revoke multiple data', async () => { + const data = [data1, data2]; + const tx = await eas.multiRevokeOffchain([data1, data2], overrides); + const timestamps = await tx.wait(); + + const currentTime = await latest(); + + for (const [i, d] of data.entries()) { + const timestamp = timestamps[i]; + expect(timestamp).to.equal(currentTime); + + expect(await eas.getRevocationOffchain(await sender.getAddress(), d)).to.equal(timestamp); + } + + if (maxPriorityFeePerGas && maxFeePerGas) { + expect(tx.data.maxPriorityFeePerGas).to.equal(maxPriorityFeePerGas); + expect(tx.data.maxFeePerGas).to.equal(maxFeePerGas); + } + }); + } + ); + } + + it("should return 0 for any data that wasn't revoked multiple data", async () => { + expect(await eas.getRevocationOffchain(await sender.getAddress(), data3)).to.equal(0); }); }); }); - describe('revocation', () => { - it('should throw on offchain verification of invalid revocations', async () => { - const senderAddress = await sender.getAddress(); - const params = { - schema: schemaId, - uid: encodeBytes32String('123'), - value: 0n, - nonce: await eas.getNonce(senderAddress), - deadline: NO_EXPIRATION - }; - - const response = await delegatedProxy.signDelegatedProxyRevocation(params, sender); - - // Invalid attester - expect(() => delegatedProxy.verifyDelegatedProxyRevocationSignature(ZERO_ADDRESS, response)).to.throw( - InvalidAddress - ); + describe('delegated attestation handling/verification', () => { + let delegated: Delegated; - // Invalid domains - const { domain } = response; - - await expect(() => - delegatedProxy.verifyDelegatedProxyRevocationSignature(senderAddress, { - ...response, - ...{ domain: { ...domain, chainId: domain.chainId + 100n } } - }) - ).to.throw(InvalidDomain); - - await expect(() => - delegatedProxy.verifyDelegatedProxyRevocationSignature(senderAddress, { - ...response, - ...{ domain: { ...domain, name: `BAD${domain.name}BAD` } } - }) - ).to.throw(InvalidDomain); - - await expect(() => - delegatedProxy.verifyDelegatedProxyRevocationSignature(senderAddress, { - ...response, - ...{ domain: { ...domain, verifyingContract: ZERO_ADDRESS } } - }) - ).to.throw(InvalidDomain); - - await expect(() => - delegatedProxy.verifyDelegatedProxyRevocationSignature(senderAddress, { - ...response, - ...{ domain: { ...domain, version: '9999.9999.9999' } } - }) - ).to.throw(InvalidDomain); - - // Invalid types - await expect(() => - delegatedProxy.verifyDelegatedProxyRevocationSignature(senderAddress, { - ...response, - ...{ - types: { [response.primaryType]: [{ name: 'schema', type: 'bytes32' }] } - } - }) - ).to.throw(InvalidTypes); - - await expect(() => - delegatedProxy.verifyDelegatedProxyRevocationSignature(senderAddress, { - ...response, - ...{ - types: { BAD: response.types.values } - } - }) - ).to.throw(InvalidTypes); + const schema = 'bool like'; + let schemaId: string; + + beforeEach(async () => { + const tx = await schemaRegistry.register({ schema, resolverAddress: ZERO_ADDRESS, revocable: false }); + schemaId = await tx.wait(); + }); + + beforeEach(async () => { + delegated = await eas.getDelegated(); + }); + + describe('verification', () => { + describe('attestation', () => { + it('should throw on offchain verification of invalid attestations', async () => { + const senderAddress = await sender.getAddress(); + const params = { + schema: schemaId, + recipient: await recipient.getAddress(), + expirationTime: NO_EXPIRATION, + revocable: false, + refUID: ZERO_BYTES32, + data: ZERO_BYTES, + value: 0n, + nonce: await eas.getNonce(senderAddress), + deadline: NO_EXPIRATION + }; + + const response = await delegated.signDelegatedAttestation(params, sender); + + // Invalid attester + expect(() => delegated.verifyDelegatedAttestationSignature(ZERO_ADDRESS, response)).to.throw( + InvalidAddress + ); + + // Invalid domains + const { domain } = response; + + await expect(() => + delegated.verifyDelegatedAttestationSignature(senderAddress, { + ...response, + ...{ domain: { ...domain, chainId: domain.chainId + 100n } } + }) + ).to.throw(InvalidDomain); + + await expect(() => + delegated.verifyDelegatedAttestationSignature(senderAddress, { + ...response, + ...{ domain: { ...domain, name: `BAD${domain.name}BAD` } } + }) + ).to.throw(InvalidDomain); + + await expect(() => + delegated.verifyDelegatedAttestationSignature(senderAddress, { + ...response, + ...{ domain: { ...domain, verifyingContract: ZERO_ADDRESS } } + }) + ).to.throw(InvalidDomain); + + await expect(() => + delegated.verifyDelegatedAttestationSignature(senderAddress, { + ...response, + ...{ domain: { ...domain, version: '9999.9999.9999' } } + }) + ).to.throw(InvalidDomain); + + // Invalid types + await expect(() => + delegated.verifyDelegatedAttestationSignature(senderAddress, { + ...response, + ...{ + types: { [response.primaryType]: [{ name: 'schema', type: 'bytes32' }] } + } + }) + ).to.throw(InvalidTypes); + + await expect(() => + delegated.verifyDelegatedAttestationSignature(senderAddress, { + ...response, + ...{ + types: { BAD: response.types.values } + } + }) + ).to.throw(InvalidTypes); + }); + }); + + describe('revocation', () => { + it('should throw on offchain verification of invalid revocations', async () => { + const senderAddress = await sender.getAddress(); + const params = { + schema: schemaId, + uid: encodeBytes32String('123'), + value: 0n, + nonce: await eas.getNonce(senderAddress), + deadline: NO_EXPIRATION + }; + + const response = await delegated.signDelegatedRevocation(params, sender); + + // Invalid attester + expect(() => delegated.verifyDelegatedRevocationSignature(ZERO_ADDRESS, response)).to.throw( + InvalidAddress + ); + + // Invalid domains + const { domain } = response; + + await expect(() => + delegated.verifyDelegatedRevocationSignature(senderAddress, { + ...response, + ...{ domain: { ...domain, chainId: domain.chainId + 100n } } + }) + ).to.throw(InvalidDomain); + + await expect(() => + delegated.verifyDelegatedRevocationSignature(senderAddress, { + ...response, + ...{ domain: { ...domain, name: `BAD${domain.name}BAD` } } + }) + ).to.throw(InvalidDomain); + + await expect(() => + delegated.verifyDelegatedRevocationSignature(senderAddress, { + ...response, + ...{ domain: { ...domain, verifyingContract: ZERO_ADDRESS } } + }) + ).to.throw(InvalidDomain); + + await expect(() => + delegated.verifyDelegatedRevocationSignature(senderAddress, { + ...response, + ...{ domain: { ...domain, version: '9999.9999.9999' } } + }) + ).to.throw(InvalidDomain); + + // Invalid types + await expect(() => + delegated.verifyDelegatedRevocationSignature(senderAddress, { + ...response, + ...{ + types: { [response.primaryType]: [{ name: 'schema', type: 'bytes32' }] } + } + }) + ).to.throw(InvalidTypes); + + await expect(() => + delegated.verifyDelegatedRevocationSignature(senderAddress, { + ...response, + ...{ + types: { BAD: response.types.values } + } + }) + ).to.throw(InvalidTypes); + }); + }); }); }); + + if (version !== EASVersion.Legacy) { + describe('delegated proxy attestation handling/verification', () => { + let delegatedProxy: DelegatedProxy; + + const schema = 'bool like'; + let schemaId: string; + + beforeEach(async () => { + const tx = await schemaRegistry.register({ schema, resolverAddress: ZERO_ADDRESS, revocable: false }); + schemaId = await tx.wait(); + }); + + beforeEach(async () => { + const proxy = await eas.getEIP712Proxy(); + if (!proxy) { + throw new Error('Invalid proxy'); + } + + delegatedProxy = await proxy.getDelegated(); + }); + + describe('verification', () => { + describe('attestation', () => { + it('should throw on offchain verification of invalid attestations', async () => { + const senderAddress = await sender.getAddress(); + const params = { + schema: schemaId, + recipient: await recipient.getAddress(), + expirationTime: NO_EXPIRATION, + revocable: false, + refUID: ZERO_BYTES32, + data: ZERO_BYTES, + value: 0n, + nonce: await eas.getNonce(senderAddress), + deadline: NO_EXPIRATION + }; + + const response = await delegatedProxy.signDelegatedProxyAttestation(params, sender); + + // Invalid attester + expect(() => delegatedProxy.verifyDelegatedProxyAttestationSignature(ZERO_ADDRESS, response)).to.throw( + InvalidAddress + ); + + // Invalid domains + const { domain } = response; + + await expect(() => + delegatedProxy.verifyDelegatedProxyAttestationSignature(senderAddress, { + ...response, + ...{ domain: { ...domain, chainId: domain.chainId + 100n } } + }) + ).to.throw(InvalidDomain); + + await expect(() => + delegatedProxy.verifyDelegatedProxyAttestationSignature(senderAddress, { + ...response, + ...{ domain: { ...domain, name: `BAD${domain.name}BAD` } } + }) + ).to.throw(InvalidDomain); + + await expect(() => + delegatedProxy.verifyDelegatedProxyAttestationSignature(senderAddress, { + ...response, + ...{ domain: { ...domain, verifyingContract: ZERO_ADDRESS } } + }) + ).to.throw(InvalidDomain); + + await expect(() => + delegatedProxy.verifyDelegatedProxyAttestationSignature(senderAddress, { + ...response, + ...{ domain: { ...domain, version: '9999.9999.9999' } } + }) + ).to.throw(InvalidDomain); + + // Invalid types + await expect(() => + delegatedProxy.verifyDelegatedProxyAttestationSignature(senderAddress, { + ...response, + ...{ + types: { [response.primaryType]: [{ name: 'schema', type: 'bytes32' }] } + } + }) + ).to.throw(InvalidTypes); + + await expect(() => + delegatedProxy.verifyDelegatedProxyAttestationSignature(senderAddress, { + ...response, + ...{ + types: { BAD: response.types.values } + } + }) + ).to.throw(InvalidTypes); + }); + }); + }); + + describe('revocation', () => { + it('should throw on offchain verification of invalid revocations', async () => { + const senderAddress = await sender.getAddress(); + const params = { + schema: schemaId, + uid: encodeBytes32String('123'), + value: 0n, + nonce: await eas.getNonce(senderAddress), + deadline: NO_EXPIRATION + }; + + const response = await delegatedProxy.signDelegatedProxyRevocation(params, sender); + + // Invalid attester + expect(() => delegatedProxy.verifyDelegatedProxyRevocationSignature(ZERO_ADDRESS, response)).to.throw( + InvalidAddress + ); + + // Invalid domains + const { domain } = response; + + await expect(() => + delegatedProxy.verifyDelegatedProxyRevocationSignature(senderAddress, { + ...response, + ...{ domain: { ...domain, chainId: domain.chainId + 100n } } + }) + ).to.throw(InvalidDomain); + + await expect(() => + delegatedProxy.verifyDelegatedProxyRevocationSignature(senderAddress, { + ...response, + ...{ domain: { ...domain, name: `BAD${domain.name}BAD` } } + }) + ).to.throw(InvalidDomain); + + await expect(() => + delegatedProxy.verifyDelegatedProxyRevocationSignature(senderAddress, { + ...response, + ...{ domain: { ...domain, verifyingContract: ZERO_ADDRESS } } + }) + ).to.throw(InvalidDomain); + + await expect(() => + delegatedProxy.verifyDelegatedProxyRevocationSignature(senderAddress, { + ...response, + ...{ domain: { ...domain, version: '9999.9999.9999' } } + }) + ).to.throw(InvalidDomain); + + // Invalid types + await expect(() => + delegatedProxy.verifyDelegatedProxyRevocationSignature(senderAddress, { + ...response, + ...{ + types: { [response.primaryType]: [{ name: 'schema', type: 'bytes32' }] } + } + }) + ).to.throw(InvalidTypes); + + await expect(() => + delegatedProxy.verifyDelegatedProxyRevocationSignature(senderAddress, { + ...response, + ...{ + types: { BAD: response.types.values } + } + }) + ).to.throw(InvalidTypes); + }); + }); + }); + } }); - }); + } });