Skip to content

Conversation

benjamin852
Copy link
Contributor

@benjamin852 benjamin852 commented Sep 26, 2025

why?

ITS Factory script commands and ITS script commands are written out differently. Makes it inconsistent to run the two scripts

  • ...
  • Task: ?

how?

Refactored ITS Factory commands to match ITS script commands

  • ...

testing

Tested each command and added an example for how to run each command in the README

  • ...

Greptile Overview

Updated On: 2025-09-26 20:12:39 UTC

Summary

This PR refactors the Interchain Token Factory commands to match the existing ITS script command structure, replacing the old --action flag approach with individual commands using positional arguments. The changes include:

  • Command Structure Alignment: Updated interchainTokenFactory.js to use individual commands (e.g., deploy-interchain-token) instead of the previous --action deployInterchainToken format
  • Positional Arguments: Changed from option-based parameters to positional arguments, consistent with its.js patterns
  • GitHub Workflow Updates: Updated test workflow to use the new command syntax
  • Documentation: Added comprehensive documentation for all Interchain Token Factory commands with examples

The refactoring improves consistency across the codebase by standardizing the command-line interface pattern used throughout the project.

Confidence Score: 4/5

  • This PR is generally safe to merge with minor fixes needed for syntax issues
  • Score reflects a well-structured refactoring that improves consistency, but has two minor syntax issues: a duplicate argument in the GitHub workflow and a missing code block formatting in README
  • Fix the link-token command in .github/workflows/test-evm.yaml and the code block formatting in evm/README.md

Important Files Changed

File Analysis

Filename        Score        Overview
.github/workflows/test-evm.yaml 3/5 Updated commands to match new CLI interface with one syntax error in link-token command
evm/README.md 4/5 Comprehensive documentation for Interchain Token Factory commands with one formatting issue
evm/interchainTokenFactory.js 5/5 Complete refactoring to match ITS command structure with proper argument parsing and command definitions

Sequence Diagram

sequenceDiagram
    participant GH as GitHub Workflow
    participant ITF as InterchainTokenFactory.js
    participant ITS as InterchainTokenService.js
    participant BC as Blockchain

    Note over GH: Test EVM Workflow Execution
    
    GH->>ITF: deploy-interchain-token "test" "TST" 18 12345 <minter> --salt "salt"
    ITF->>BC: Deploy token with metadata
    BC-->>ITF: TokenId & Token Address
    ITF-->>GH: Success
    
    GH->>ITF: deploy-remote-interchain-token remote --salt "salt"
    ITF->>BC: Deploy remote token
    BC-->>ITF: TokenId
    ITF-->>GH: Success
    
    GH->>ITS: register-token-metadata <token-address>
    ITS->>BC: Register metadata
    BC-->>ITS: Success
    ITS-->>GH: Success
    
    GH->>ITF: register-custom-token <token-address> 4 <operator> --salt "salt"
    ITF->>BC: Register custom token
    BC-->>ITF: Success
    ITF-->>GH: Success
    
    GH->>ITS: transfer-mintership <token-address> <new-minter>
    ITS->>BC: Transfer mintership
    BC-->>ITS: Success
    ITS-->>GH: Success
    
    GH->>ITF: link-token remote "0x1234" 4 "0x5678" --salt "salt"
    Note right of GH: Fixed: removed duplicate 'remote' argument
    ITF->>BC: Link tokens across chains
    BC-->>ITF: Success
    ITF-->>GH: Success
Loading

Note

Refactors interchainTokenFactory.js to a subcommand/positional-arg CLI, and updates docs and CI to the new syntax.

  • CLI (evm/interchainTokenFactory.js):
    • Replace --action + flags with subcommands using positional args (e.g., deploy-interchain-token, deploy-remote-interchain-token, register-custom-token, link-token, etc.).
    • Restructure command wiring: main(action, args, options), pass args via options.args, and map Commander subcommands to actions.
    • Normalize action names (kebab-case), switch cases updated accordingly; remove unused interchainTokenAddress action.
    • Update validation/printing and handleTx calls to use the resolved action; add optional gas value options to relevant commands.
    • Minor tweaks: log gasValue for remote deploy, export interchainTokenFactory entrypoint.
  • Documentation (evm/README.md):
    • Add comprehensive "Interchain Token Factory" section with command references and examples for all new subcommands.
  • CI/Workflows (.github/workflows/test-evm.yaml):
    • Update ITS Factory steps to use new subcommand syntax for deploy/register/link.
  • Release Docs (releases/evm/EVM-ITS-Release-Template.md):
    • Update checklist examples to new CLI syntax for token creation and remote deployment.

Written by Cursor Bugbot for commit e24987e. This will update automatically on new commits. Configure here.

@benjamin852 benjamin852 self-assigned this Sep 26, 2025
@benjamin852 benjamin852 force-pushed the chore/its-factory-update branch from aa59961 to 13189da Compare September 26, 2025 19:38
@benjamin852 benjamin852 changed the title Chore/its factory update Chore: its factory commands update Sep 26, 2025
@benjamin852 benjamin852 changed the title Chore: its factory commands update chore: its factory commands update Sep 26, 2025
@benjamin852 benjamin852 marked this pull request as ready for review September 26, 2025 20:09
@benjamin852 benjamin852 requested a review from a team as a code owner September 26, 2025 20:09
cursor[bot]

This comment was marked as outdated.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

3 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

@kulikthebird kulikthebird left a comment

Choose a reason for hiding this comment

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

I like that we get rid of the --action option in favor of separate commands. Though in my opinion the sequence of 5+ unnaed arguments makes it harder to read the commands.

cursor[bot]

This comment was marked as outdated.

@isi8787
Copy link
Collaborator

isi8787 commented Oct 3, 2025

update the release template document

@benjamin852 benjamin852 force-pushed the chore/its-factory-update branch from 19aa9d6 to 7b8ffa5 Compare October 6, 2025 17:01
cursor[bot]

This comment was marked as outdated.

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