Skip to content

feat(erc20-bridge): bridge TRUF tokens#1154

Merged
MicBun merged 1 commit intomainfrom
feat/bridge-action
Sep 12, 2025
Merged

feat(erc20-bridge): bridge TRUF tokens#1154
MicBun merged 1 commit intomainfrom
feat/bridge-action

Conversation

@williamrusdyputra
Copy link
Contributor

@williamrusdyputra williamrusdyputra commented Sep 12, 2025

Related Problem

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

How Has This Been Tested?

Screenshot 2025-09-12 at 14 39 31 Screenshot 2025-09-12 at 14 39 54

Summary by CodeRabbit

  • New Features
    • Added admin actions to initiate ERC‑20 token bridging on both Sepolia (testnet) and Mainnet.
    • Actions accept an amount input and forward it to the bridge, enabling streamlined admin‑initiated transfers.
    • Accessible to authorized administrators; no changes for regular users.

@coderabbitai
Copy link

coderabbitai bot commented Sep 12, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds two public admin actions in internal/migrations/erc20-bridge/001-actions.sql that accept a TEXT amount, cast it to NUMERIC(78,0), and call the respective bridge functions for Sepolia and Mainnet. No additional permission checks or error handling were introduced.

Changes

Cohort / File(s) Summary
ERC20 bridge admin actions
internal/migrations/erc20-bridge/001-actions.sql
Introduces sepolia_admin_bridge_tokens($amount TEXT) PUBLIC calling sepolia_bridge.bridge($amount::NUMERIC(78,0)) and mainnet_admin_bridge_tokens($amount TEXT) PUBLIC calling mainnet_bridge.bridge($amount::NUMERIC(78,0)); inserted under testnet and mainnet sections without extra permission checks.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant A1 as sepolia_admin_bridge_tokens
  participant B1 as sepolia_bridge.bridge

  Note over C,A1: Sepolia admin bridging
  C->>A1: amount (TEXT)
  A1->>A1: CAST amount -> NUMERIC(78,0)
  A1->>B1: bridge(amount_numeric)
  B1-->>A1: result
  A1-->>C: result
Loading
sequenceDiagram
  autonumber
  participant C as Client
  participant A2 as mainnet_admin_bridge_tokens
  participant B2 as mainnet_bridge.bridge

  Note over C,A2: Mainnet admin bridging
  C->>A2: amount (TEXT)
  A2->>A2: CAST amount -> NUMERIC(78,0)
  A2->>B2: bridge(amount_numeric)
  B2-->>A2: result
  A2-->>C: result
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • MicBun

Poem

I hop through schemas, light and quick,
Two shiny actions, neat and slick.
Sepolia, Mainnet—bridge on cue,
Cast the amount, let tokens through.
Ears up high, I stamp approval—
Thump-thump! for smooth bridge removal. 🥕✨

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.


📜 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 fd7cbdc and 309cc50.

📒 Files selected for processing (1)
  • internal/migrations/erc20-bridge/001-actions.sql (2 hunks)
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/bridge-action

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

holdex bot commented Sep 12, 2025

Time Submission Status

Member Status Time Action Last Update
williamrusdyputra ✅ Submitted 20min Update time Sep 12, 2025, 7:50 AM
MicBun ✅ Submitted 15min Update time Sep 12, 2025, 9:01 AM

@williamrusdyputra williamrusdyputra changed the title feat: bridge TRUF tokens feat(erc20-bridge): bridge TRUF tokens Sep 12, 2025
@MicBun MicBun merged commit c7541ca into main Sep 12, 2025
4 of 6 checks passed
@MicBun MicBun deleted the feat/bridge-action branch September 12, 2025 07:50
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