Skip to content

Commit

Permalink
Merge pull request #81 from ethereum-attestation-service/refactor
Browse files Browse the repository at this point in the history
Check for ethers v6 compatibility
  • Loading branch information
lbeder authored Feb 3, 2024
2 parents 8cdbfb1 + 41d9876 commit 3908dca
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@

- 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

## 1.4.1 (2024-02-02)

- Check for ethers v6 compatibility
4 changes: 4 additions & 0 deletions dist/eas.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/eas.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ethereum-attestation-service/eas-sdk",
"version": "1.4.0",
"version": "1.4.1",
"description": "Ethereum Attestation Service - TypeScript/JavaScript SDK",
"repository": "[email protected]:ethereum-attestation-service/eas-sdk.git",
"author": "Leonid Beder <[email protected]>",
Expand Down
5 changes: 5 additions & 0 deletions src/eas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ export class EAS extends Base<EASContract> {

super(new EAS__factory(), address, signerOrProvider);

// Check for ethers v6 compatibility
if (!this.contract.getAddress) {
throw new Error('Incompatible ethers version detect. Make sure to use the SDK with ethers v6 or later');
}

if (proxy) {
this.proxy = proxy;
}
Expand Down
2 changes: 1 addition & 1 deletion test/test/eas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ import { getSchemaUID, getUIDFromAttestTx } from '../../src/utils';
import Contracts from '../components/Contracts';
import { ZERO_ADDRESS, ZERO_BYTES, ZERO_BYTES32 } from '../utils/Constants';
import chai from './helpers/chai';
import { CustomOffchain } from './helpers/custom-offchain';
import {
expectAttestation,
expectMultiAttestations,
expectMultiRevocations,
expectRevocation,
SignatureType
} from './helpers/eas';
import { CustomOffchain } from './helpers/mocks/custom-offchain';
import { duration, latest } from './helpers/time';
import { createWallet } from './helpers/wallet';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { EAS } from '../../../src/eas';
import { Offchain, OffchainAttestationType, OffchainAttestationVersion, TypedDataConfig } from '../../../src/offchain';
import { EAS } from '../../../../src/eas';
import {
Offchain,
OffchainAttestationType,
OffchainAttestationVersion,
TypedDataConfig
} from '../../../../src/offchain';

interface CustomOffchainParams {
contractVersion: string;
Expand Down

0 comments on commit 3908dca

Please sign in to comment.