Skip to content

feat(cli): add EAS attestation support to deploy, verify, and transfe…#286

Merged
ezequiel-rodriguez merged 15 commits intorsksmart:mainfrom
Ad-Capital:Adrian
Feb 19, 2026
Merged

feat(cli): add EAS attestation support to deploy, verify, and transfe…#286
ezequiel-rodriguez merged 15 commits intorsksmart:mainfrom
Ad-Capital:Adrian

Conversation

@Ad-Capital
Copy link
Contributor

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

…r commands with unified signer, schema handling, and fallback logic for smoother integration
logSuccess(params, `📍 Contract Address: ${receipt.contractAddress}`);
logInfo(params, `🔗 View on Explorer: ${explorerUrl}`);

// Create deployment attestation if enabled
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please clean comments, they are not needed.


spinner.succeed(chalk.green("✅ Deployment attestation created successfully!"));

console.log(chalk.cyan(`📋 Attestation UID: ${receipt}`));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@Ad-Capital
Copy link
Contributor Author

Ad-Capital commented Dec 1, 2025 via email

Copy link
Member

@scguaquetam scguaquetam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is used this for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was used during initial development for testing the feature. It's been removed now

Copy link
Member

@scguaquetam scguaquetam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@scguaquetam
Copy link
Member

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

…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.
@Ad-Capital
Copy link
Contributor Author

Ad-Capital commented Dec 14, 2025 via email

@scguaquetam
Copy link
Member

Hello Adrian, I have tested it again, and now it is working perfect, thanks

✔ ✅ Transfer attestation created successfully!
📋 Attestation UID: 0xb50010602f82ff0e8ec8405a4ddd765e208a5cdae1fd2c98c88c6fd9db8a40d6
💸 Transfer: 0.00001 RBTC
👤 From: 0x13dCdE1430B8d3847a25c07038B78B932d29bfd5
👤 To: 0x13dcde1430b8d3847a25c07038b78b932d29bfd5
🎯 Transfer attestation created: 0xb50010602f82ff0e8ec8405a4ddd765e208a5cdae1fd2c98c88c6fd9db8a40d6

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.


## Schema Information

### Transfer Schema (Testnet)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which are the Schemas for the other parts where you implemented Attestations?

  • Verify
  • Deploy

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Ad-Capital and others added 4 commits January 5, 2026 15:23
…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
@Ad-Capital
Copy link
Contributor Author

Thanks for pointing that out @scguaquetam , I've cleaned it

@scguaquetam
Copy link
Member

It looks good now, thanks

Copy link
Collaborator

@ezequiel-rodriguez ezequiel-rodriguez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ezequiel-rodriguez
Copy link
Collaborator

@Ad-Capital Thanks for your contribution! 💪

@ezequiel-rodriguez ezequiel-rodriguez merged commit 31b1965 into rsksmart:main Feb 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants