Skip to content

Commit

Permalink
Fix recipient being mandatory in attest() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
0xCLARITY committed Feb 23, 2024
1 parent 395d6d9 commit 60328a6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/eas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
getTimestampFromOffchainRevocationReceipt,
getTimestampFromTimestampReceipt,
getUIDsFromAttestReceipt,
ZERO_ADDRESS,
ZERO_BYTES32
} from './utils';

Expand Down Expand Up @@ -139,7 +140,7 @@ export class EAS extends Base<EASContract> {
public async attest(
{
schema,
data: { recipient, data, expirationTime = NO_EXPIRATION, revocable = true, refUID = ZERO_BYTES32, value = 0n }
data: { recipient = ZERO_ADDRESS, data, expirationTime = NO_EXPIRATION, revocable = true, refUID = ZERO_BYTES32, value = 0n }
}: AttestationRequest,
overrides?: Overrides
): Promise<Transaction<string>> {
Expand All @@ -156,7 +157,7 @@ export class EAS extends Base<EASContract> {
public async attestByDelegation(
{
schema,
data: { recipient, data, expirationTime = NO_EXPIRATION, revocable = true, refUID = ZERO_BYTES32, value = 0n },
data: { recipient = ZERO_ADDRESS, data, expirationTime = NO_EXPIRATION, revocable = true, refUID = ZERO_BYTES32, value = 0n },
signature,
attester,
deadline = NO_EXPIRATION
Expand Down Expand Up @@ -190,7 +191,7 @@ export class EAS extends Base<EASContract> {
const multiAttestationRequests = requests.map((r) => ({
schema: r.schema,
data: r.data.map((d) => ({
recipient: d.recipient,
recipient: d.recipient ?? ZERO_ADDRESS,
expirationTime: d.expirationTime ?? NO_EXPIRATION,
revocable: d.revocable ?? true,
refUID: d.refUID ?? ZERO_BYTES32,
Expand Down Expand Up @@ -221,7 +222,7 @@ export class EAS extends Base<EASContract> {
const multiAttestationRequests = requests.map((r) => ({
schema: r.schema,
data: r.data.map((d) => ({
recipient: d.recipient,
recipient: d.recipient ?? ZERO_ADDRESS,
expirationTime: d.expirationTime ?? NO_EXPIRATION,
revocable: d.revocable ?? true,
refUID: d.refUID ?? ZERO_BYTES32,
Expand Down

0 comments on commit 60328a6

Please sign in to comment.