Skip to content

chore: rename erc20 action names#1162

Merged
MicBun merged 1 commit into
mainfrom
chore/rename-actions
Sep 16, 2025
Merged

chore: rename erc20 action names#1162
MicBun merged 1 commit into
mainfrom
chore/rename-actions

Conversation

@williamrusdyputra
Copy link
Copy Markdown
Contributor

@williamrusdyputra williamrusdyputra commented Sep 16, 2025

Related Problem

resolves: https://github.com/trufnetwork/truf-network/issues/1203

Summary by CodeRabbit

  • New Features

    • Introduced simplified token bridging on Ethereum and Sepolia that transfers the full specified amount without fees.
  • Refactor

    • Renamed “Mainnet” terminology to “Ethereum” across wallet balance and bridging actions for clarity and consistency.
    • Consolidated/updated bridging entry points to use consistent Ethereum/Sepolia naming.
  • Chores

    • Streamlined bridge logic by removing fee/treasury handling to reduce friction and improve predictability for users.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Sep 16, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Renames mainnet-related actions to ethereum, replaces admin bridge actions with public bridge entry points, removes fee/treasury handling, and standardizes token bridging to pass the full amount (TEXT → NUMERIC(78,0)) to chain-specific bridge functions. Wallet balance action renamed (mainnet → ethereum). Other existing actions remain unchanged.

Changes

Cohort / File(s) Summary
ERC20 bridge action renames and simplification
internal/migrations/erc20-bridge/001-actions.sql
- Replace sepolia_admin_bridge_tokenssepolia_bridge_tokens(amount TEXT) calling sepolia_bridge.bridge($amount::NUMERIC(78,0)) without fee/treasury
- Replace mainnet_admin_bridge_tokensethereum_bridge_tokens(amount TEXT) calling mainnet_bridge.bridge($amount::NUMERIC(78,0)) without fee/treasury
- Rename mainnet_wallet_balanceethereum_wallet_balance (same behavior via mainnet_bridge.balance)
- Keep get_erc20_bridge_info and sepolia_wallet_balance as-is aside from name alignment

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant DB as SQL Actions
  participant SB as sepolia_bridge
  participant MB as mainnet_bridge

  rect rgba(230,245,255,0.6)
  note over C,DB: Sepolia bridge path (new)
  C->>DB: sepolia_bridge_tokens(amount: TEXT)
  DB->>DB: CAST amount -> NUMERIC(78,0)
  DB->>SB: bridge(amount_num)
  SB-->>DB: result
  DB-->>C: ack/result
  end

  rect rgba(240,255,230,0.6)
  note over C,DB: Ethereum bridge path (renamed from mainnet)
  C->>DB: ethereum_bridge_tokens(amount: TEXT)
  DB->>DB: CAST amount -> NUMERIC(78,0)
  DB->>MB: bridge(amount_num)
  MB-->>DB: result
  DB-->>C: ack/result
  end

  rect rgba(255,245,230,0.6)
  note over C,DB: Wallet balance (renamed)
  C->>DB: ethereum_wallet_balance(address)
  DB->>MB: balance(address)
  MB-->>DB: balance NUMERIC(78,0)
  DB-->>C: balance
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • MicBun

Poem

A hop and a bridge with numbers so neat,
No fees in my paws, just tokens complete.
Sepolia to Ether, I boop and I go—
Cast it to NUMERIC, watch balances flow.
Renamed burrows, same comfy ground,
Thump-thump, deploy—swift, safe, sound. 🐇✨

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/rename-actions

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 48b6058 and 8dd0a22.

📒 Files selected for processing (1)
  • internal/migrations/erc20-bridge/001-actions.sql (1 hunks)

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@holdex
Copy link
Copy Markdown

holdex Bot commented Sep 16, 2025

Time Submission Status

Member Status Time Action Last Update
williamrusdyputra ✅ Submitted 15min Update time Sep 16, 2025, 3:24 AM
MicBun ✅ Submitted 5min Update time Sep 16, 2025, 7:31 AM

@MicBun MicBun merged commit 8aa4f6b into main Sep 16, 2025
3 of 5 checks passed
@MicBun MicBun deleted the chore/rename-actions branch September 16, 2025 03:22
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.

2 participants