Skip to content

Commit

Permalink
Merge pull request #85 from 0xCLARITY/recipient-optional-in-attest
Browse files Browse the repository at this point in the history
Fix recipient being mandatory in attest() calls
  • Loading branch information
lbeder authored Feb 24, 2024
2 parents 5c56dde + 60328a6 commit fabe040
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 fabe040

Please sign in to comment.