feat(cli): add EAS attestation support to deploy, verify, and transfe…#286
feat(cli): add EAS attestation support to deploy, verify, and transfe…#286ezequiel-rodriguez merged 15 commits intorsksmart:mainfrom
Conversation
…r commands with unified signer, schema handling, and fallback logic for smoother integration
src/commands/deploy.ts
Outdated
| logSuccess(params, `📍 Contract Address: ${receipt.contractAddress}`); | ||
| logInfo(params, `🔗 View on Explorer: ${explorerUrl}`); | ||
|
|
||
| // Create deployment attestation if enabled |
There was a problem hiding this comment.
Please clean comments, they are not needed.
src/utils/attestation.ts
Outdated
|
|
||
| spinner.succeed(chalk.green("✅ Deployment attestation created successfully!")); | ||
|
|
||
| console.log(chalk.cyan(`📋 Attestation UID: ${receipt}`)); |
There was a problem hiding this comment.
In order for this feature of CLI to be used in the MCP Server, we need normalize the usage of console chalk and spinner, in a external/nonexternal basis, for that please refer to other existing commands and check how they use this, for example THIS where we use logMessage and startSpinner, succeedSpinner, etc.
…er by adding helper functions (logMessage, logError, logSuccess, logInfo, startSpinner, updateSpinner, succeedSpinner, failSpinner, warnSpinner) with isExternal support, updating AttestationService to accept isExternal, replacing all console/chalk/spinner calls across attestation methods (createDeploymentAttestation, createVerificationAttestation, createTransferAttestation, verifyAttestation), forwarding isExternal through exported functions, updating deploy/transfer/verify command integrations to pass it, and disabling spinners via ora({ isEnabled: false }) when isExternal is true; refactor: cleaned up comments
|
Heyy... I’ve applied the changes based on your feedback. Please take a look
and let me know if further adjustments are required.
…On Mon, Dec 1, 2025 at 9:13 AM Sebas ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/utils/attestation.ts
<#286 (comment)>:
> + revocable: true,
+ data: encodedData
+ };
+
+ if (schemaUID) {
+ const tx = await this.eas.attest({
+ schema: schemaUID,
+ data: attestationData
+ });
+
+ spinner.text = "Waiting for attestation confirmation...";
+ const receipt = await tx.wait();
+
+ spinner.succeed(chalk.green("✅ Deployment attestation created successfully!"));
+
+ console.log(chalk.cyan(`📋 Attestation UID: ${receipt}`));
In order for this feature of CLI to be used in the MCP Server, we need
normalize the usage of console chalk and spinner, in a external/nonexternal
basis, for that please refer to other existing commands and check how they
use this, for example THIS
<https://github.com/rsksmart/rsk-cli/blob/main/src/commands/deploy.ts>
where we use logMessage and startSpinner, succeedSpinner, etc.
—
Reply to this email directly, view it on GitHub
<#286 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A7QZ75IFQV7DPZWLFTQJPJD37P2ENAVCNFSM6AAAAACLKUBSTSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTKMRTG4YTEMZXGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
scguaquetam
left a comment
There was a problem hiding this comment.
Please take in account we should keep simple code and DRY, centralize attestation usage for avoiding code repetition.
| } | ||
|
|
||
| let attestationUID: string | null = null; | ||
| if (params.attestation?.enabled && receipt.contractAddress) { |
There was a problem hiding this comment.
We have code repetition here, along Deploy, transfer and verify, you should centralize this Attestation server into a shared function which each command is able to call and send custom params. This to avoid having the same function structure in many parts of the code, and just re-use code which is cleaner.
package.json
Outdated
| "chalk": "^5.3.0", | ||
| "cli-table3": "^0.6.5", | ||
| "commander": "^13.1.0", | ||
| "crypto-js": "^4.2.0", |
There was a problem hiding this comment.
this lib is not longer maintained https://www.npmjs.com/package/crypto-js, can you use another ? In which part of the code are you using it?
There was a problem hiding this comment.
That was a mistake during my initial research phase. The code actually uses Node.js's built-in crypto module and ethers.keccak256 for hashing. I've removed both crypto-js and @types/crypto-js in the latest commit.
…r, spinner + logger utils, explorer/network/timestamp helpers, wei constants, contract name extraction, remove crypto-js, unify error handling, and stabilize deploy/transfer/verify logic
| import { DeploymentAttestationData, AttestationService } from "../utils/attestation.js"; | ||
| import { handleAttestation } from "../utils/attestationHandler.js"; | ||
| import { getConfig } from "./config.js"; | ||
| import { logError, logSuccess, logInfo } from "../utils/logger.js"; |
There was a problem hiding this comment.
This is a great idea , could you add this along all the project where it is used logs or spinner? of course we will take this in account for the final prize.
There was a problem hiding this comment.
Yes of course, I'm working on it
package.json
Outdated
| "devDependencies": { | ||
| "@types/bun": "latest", | ||
| "@types/figlet": "^1.5.8", | ||
| "@types/jest": "^30.0.0", |
There was a problem hiding this comment.
It was used during initial development for testing the feature. It's been removed now
scguaquetam
left a comment
There was a problem hiding this comment.
I did not realize before, you need to add information to the readme, otherwise people wont know how to use/execute this attestation function, please add it, thanks.
…ture + default schema - Add password capture to viemProvider for attestation signing - Integrate transfer attestation into interactive and batch modes - Fix EAS SDK ESM compatibility via createRequire - Update RSK EAS contract addresses with proper checksums - Add default testnet transfer schema UID (0x44d562ac1d7cd77e232978687fea027ace48f719cf1d58c7888e509663bb87fc) - Add detailed attestation documentation - Update README with transfer attestation examples
…and utilities Replaces scattered console.log/chalk usage with the shared logger utilities to improve maintainability and prep the codebase for MCP Server integration. - Remove duplicate logger implementations across commands (monitor, batchTransfer, contract, tx) and utilities (rnsHelper, MonitorManager) - Replace all console.log/console.error calls with logError, logSuccess, logInfo, logWarning, and logMessage from utils/logger - Standardize spinner usage by switching all direct ora instances to createSpinner from utils/spinner - Update all logger calls to pass the isExternal boolean as the first argument for MCP compatibility This centralization makes feedback consistent, reduces noise, and gives us a single point of control for logging behavior across both CLI and MCP contexts.
|
Heyy.... I’ve made the requested changes. Please let me know if there’s
anything else I can work on.
I’m available to contribute beyond this idea as well.
…On Thu, Dec 11, 2025, 10:41 AM Sebas ***@***.***> wrote:
*scguaquetam* left a comment (rsksmart/rsk-cli#286)
<#286 (comment)>
Also, I am testing this node dist/bin/index.js transfer --testnet -i
--attest-transfer
And , as you can see on the image, nothing happens, no attestation or log
displayed. image.png (view on web)
<https://github.com/user-attachments/assets/78e567b9-16c3-4382-8be0-3d23ab562c06>
—
Reply to this email directly, view it on GitHub
<#286 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A7QZ75MIVLLURDCAM2LZZXD4BE36DAVCNFSM6AAAAACLKUBSTSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMNBRGA4DONRTHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
Hello Adrian, I have tested it again, and now it is working perfect, thanks It is just a thought I have, it would be great, if here, additional to the attestation Hash, you could add the link to the attestation view, for example this for mainnet or testnet, this in order the user could see the attestation. As you can see we have currently an attestation viewer in our explorer. (testnet is failing for now, but mainnet is working okay. |
docs/ATTESTATIONS.md
Outdated
|
|
||
| ## Schema Information | ||
|
|
||
| ### Transfer Schema (Testnet) |
There was a problem hiding this comment.
Which are the Schemas for the other parts where you implemented Attestations?
- Verify
- Deploy
There was a problem hiding this comment.
Thanks for the feedback, I’ve now implemented the attestation viewer links so they show alongside the attestation hash. And I left you a message on the hacktivator marketplace window regarding the route to take going forward
…on schemas - Add getAttestationViewerUrl() helper to generate explorer links - Display attestation viewer URL in all attestation success messages - Add isTestnet property to AttestationService class for network tracking - Document deployment schema with field descriptions in ATTESTATIONS.md - Document verification schema with field descriptions in ATTESTATIONS.md - Update EXPLORER_URLS to include attestation viewer endpoints for both networks
…tion types BREAKING CHANGE: Remove default schema UIDs to prevent schema mismatch errors - Remove hardcoded default schema UID for transfer attestations - Make --attest-schema-uid required for all attestation types (transfer, deployment, verification) - Update error messages to display schema structure requirements - Add comprehensive schema registration guide to documentation - Document all three schema structures (transfer, deployment, verification) - Add step-by-step instructions for registering schemas via RAS explorer
…red schemas - Update schema UIDs for transfer, deployment, and verification attestations - Add version fields to work around RSK SchemaRegistry limitations - All schemas verified on-chain and production-ready
|
Thanks for pointing that out @scguaquetam , I've cleaned it |
|
It looks good now, thanks |
|
@Ad-Capital Thanks for your contribution! 💪 |

feat(cli): add EAS attestation support to deploy, verify, and transfer commands with unified signer, schema handling, and fallback logic for smoother integration