Skip to content

Commit d16ce95

Browse files
SaeeDawodsaeeddawodbl0up
authored
fix(docs): correct EAS variable naming and attestation UID access (#652)
- Fix variable naming conflict (const EAS = new EAS -> const eas = new EAS) - Fix attestation UID access (receipt.attestationUID -> newAttestationUID from tx.wait()) - Apply fixes to all 4 EAS documentation files for consistency - Ensures code examples work correctly when copied by developers Co-authored-by: saeeddawod <saeed.dawod@gmail.com> Co-authored-by: bl0up <ambroise.m2@gmail.com>
1 parent ef54591 commit d16ce95

4 files changed

Lines changed: 24 additions & 20 deletions

File tree

content/docs/building-with-settlemint/evm-chains-guide/attestation-indexer.mdx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ const config = {
302302
// Connect to the blockchain
303303
const provider = new ethers.JsonRpcProvider(config.rpcUrl);
304304
const signer = new ethers.Wallet(config.privateKey, provider);
305-
const EAS = new EAS(config.easAddress);
305+
const eas = new EAS(config.easAddress);
306306
eas.connect(signer);
307307
308308
// Create an encoder that matches our schema structure
@@ -333,11 +333,12 @@ async function createAttestation() {
333333
},
334334
});
335335
336-
// Wait for confirmation and get the result
337-
const receipt = await tx.wait();
336+
// Wait for confirmation and get the full transaction receipt
337+
const newAttestationUID = await tx.wait();
338+
338339
console.log(
339340
"✅ Attestation created successfully! UID:",
340-
receipt.attestationUID
341+
newAttestationUID
341342
);
342343
} catch (error) {
343344
console.error("❌ Error creating attestation:", error.message);
@@ -382,7 +383,7 @@ const config = {
382383
async function verifyAttestation(attestationUID) {
383384
// Setup our blockchain connection
384385
const provider = new ethers.JsonRpcProvider(config.rpcUrl);
385-
const EAS = new EAS(config.easAddress);
386+
const eas = new EAS(config.easAddress);
386387
eas.connect(provider);
387388
388389
console.log("🔍 Verifying attestation:", attestationUID);

content/docs/building-with-settlemint/hedera-hashgraph-guide/attestation-indexer.mdx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ const config = {
302302
// Connect to the blockchain
303303
const provider = new ethers.JsonRpcProvider(config.rpcUrl);
304304
const signer = new ethers.Wallet(config.privateKey, provider);
305-
const EAS = new EAS(config.easAddress);
305+
const eas = new EAS(config.easAddress);
306306
eas.connect(signer);
307307

308308
// Create an encoder that matches our schema structure
@@ -333,11 +333,12 @@ async function createAttestation() {
333333
},
334334
});
335335

336-
// Wait for confirmation and get the result
337-
const receipt = await tx.wait();
336+
// Wait for confirmation and get the full transaction receipt
337+
const newAttestationUID = await tx.wait();
338+
338339
console.log(
339340
"✅ Attestation created successfully! UID:",
340-
receipt.attestationUID
341+
newAttestationUID
341342
);
342343
} catch (error) {
343344
console.error("❌ Error creating attestation:", error.message);
@@ -382,7 +383,7 @@ const config = {
382383
async function verifyAttestation(attestationUID) {
383384
// Setup our blockchain connection
384385
const provider = new ethers.JsonRpcProvider(config.rpcUrl);
385-
const EAS = new EAS(config.easAddress);
386+
const eas = new EAS(config.easAddress);
386387
eas.connect(provider);
387388

388389
console.log("🔍 Verifying attestation:", attestationUID);

content/docs/platform-components/middleware-and-api-layer/attestation-indexer.mdx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ const config = {
334334
// Connect to the blockchain
335335
const provider = new ethers.JsonRpcProvider(config.rpcUrl);
336336
const signer = new ethers.Wallet(config.privateKey, provider);
337-
const EAS = new EAS(config.easAddress);
337+
const eas = new EAS(config.easAddress);
338338
eas.connect(signer);
339339

340340
// Create an encoder that matches our schema structure
@@ -365,11 +365,12 @@ async function createAttestation() {
365365
},
366366
});
367367

368-
// Wait for confirmation and get the result
369-
const receipt = await tx.wait();
368+
// Wait for confirmation and get the full transaction receipt
369+
const newAttestationUID = await tx.wait();
370+
370371
console.log(
371372
"✅ Attestation created successfully! UID:",
372-
receipt.attestationUID
373+
newAttestationUID
373374
);
374375
} catch (error) {
375376
console.error("❌ Error creating attestation:", error.message);
@@ -414,7 +415,7 @@ const config = {
414415
async function verifyAttestation(attestationUID) {
415416
// Setup our blockchain connection
416417
const provider = new ethers.JsonRpcProvider(config.rpcUrl);
417-
const EAS = new EAS(config.easAddress);
418+
const eas = new EAS(config.easAddress);
418419
eas.connect(provider);
419420

420421
console.log("🔍 Verifying attestation:", attestationUID);

content/docs/use-case-guides/attestation-service.mdx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ const config = {
299299
// Connect to the blockchain
300300
const provider = new ethers.JsonRpcProvider(config.rpcUrl);
301301
const signer = new ethers.Wallet(config.privateKey, provider);
302-
const EAS = new EAS(config.easAddress);
302+
const eas = new EAS(config.easAddress);
303303
eas.connect(signer);
304304

305305
// Create an encoder that matches our schema structure
@@ -330,11 +330,12 @@ async function createAttestation() {
330330
},
331331
});
332332

333-
// Wait for confirmation and get the result
334-
const receipt = await tx.wait();
333+
// Wait for confirmation and get the full transaction receipt
334+
const newAttestationUID = await tx.wait();
335+
335336
console.log(
336337
"✅ Attestation created successfully! UID:",
337-
receipt.attestationUID
338+
newAttestationUID
338339
);
339340
} catch (error) {
340341
console.error("❌ Error creating attestation:", error.message);
@@ -379,7 +380,7 @@ const config = {
379380
async function verifyAttestation(attestationUID) {
380381
// Setup our blockchain connection
381382
const provider = new ethers.JsonRpcProvider(config.rpcUrl);
382-
const EAS = new EAS(config.easAddress);
383+
const eas = new EAS(config.easAddress);
383384
eas.connect(provider);
384385

385386
console.log("🔍 Verifying attestation:", attestationUID);

0 commit comments

Comments
 (0)