chore: update erc20 extension queries#1228
Conversation
WalkthroughSplit ERC20 bridge actions into sepolia- and ethereum-specific variants, added commented Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant SQL_Actions
participant SepoliaBridge
rect rgb(240,248,255)
Client->>SQL_Actions: sepolia_get_erc20_bridge_info()
SQL_Actions->>SepoliaBridge: sepolia_bridge.info()
SepoliaBridge-->>SQL_Actions: (escrow, epoch_period, erc20, decimals, balance, synced, synced_at, enabled)
SQL_Actions-->>Client: return sepolia info
end
sequenceDiagram
participant Client
participant SQL_Actions
participant EthereumBridge
rect rgb(245,255,240)
Client->>SQL_Actions: ethereum_get_erc20_bridge_info()
SQL_Actions->>EthereumBridge: ethereum_bridge.info()
EthereumBridge-->>SQL_Actions: (chain, escrow, epoch_period, erc20, decimals, balance, synced, synced_at, enabled)
SQL_Actions-->>Client: return ethereum info
end
sequenceDiagram
participant Client
participant SQL_Actions
participant EthereumBridge
rect rgb(255,250,240)
Client->>SQL_Actions: ethereum_transfer(to, amount)
SQL_Actions->>EthereumBridge: ethereum_bridge.transfer(to, amount)
EthereumBridge-->>SQL_Actions: transfer result / error
SQL_Actions-->>Client: return result
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🧰 Additional context used🧠 Learnings (2)📓 Common learnings📚 Learning: 2025-10-23T07:00:26.182ZApplied to files:
🔇 Additional comments (6)
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. Comment |
Time Submission Status
|
|
The CI fails, can you check? @williamrusdyputra |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
internal/migrations/erc20-bridge/000-extension.sql (1)
1-1: Update the comment to reflect multi-chain support.The comment indicates the contract address is for mainnet only, but the migration now supports both
sepoliaandethereumchains. Clarify what the comment means or update it.--- This is not meant to be run on tests as the contract address is valid for mainnet only. +-- This is not meant to be run on tests as the contract addresses are valid for mainnet only.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
internal/migrations/erc20-bridge/000-extension.sql(1 hunks)
🔇 Additional comments (1)
internal/migrations/erc20-bridge/000-extension.sql (1)
5-6: Verify the new escrow address with your testnet deployment and DevOps team.Git history confirms the escrow address change was intentional (
deca98f chore: change escrow address). Codebase analysis found no hardcoded references to the old address (0x2D4f435867066737bA1617ef024E073413909Ad2), and the new address0xf6009345d772a04f4e52150b5ec91617db79be58appears only in the migration file. Tests dynamically fetch the escrow address viagetBridgeEscrowAddress(), so no breakage risk exists within the codebase.However, confirm with your testnet/deployment team that the new address is correct for the sepolia testnet deployment and that no external systems depend on the previous address.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
internal/migrations/erc20-bridge/002-public-transfer-actions.sql (1)
22-35: Action references unavailable binding.The
ethereum_transferaction correctly callsethereum_bridge.transfer()(line 34), but theethereum_bridgebinding is not available—it remains commented out in 000-extension.sql. This action will fail at runtime when invoked until the binding is enabled.Dependency: This issue is blocked by uncommenting the
ethereum_bridgebinding in 000-extension.sql (lines 9–14). Ensure that change is applied before this action becomes active on mainnet.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
internal/migrations/erc20-bridge/000-extension.sql(1 hunks)internal/migrations/erc20-bridge/002-public-transfer-actions.sql(2 hunks)tests/extensions/erc20/erc20_bridge_transfer_actions_test.go(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- tests/extensions/erc20/erc20_bridge_transfer_actions_test.go
🔇 Additional comments (2)
internal/migrations/erc20-bridge/000-extension.sql (1)
5-7: Verify escrow address and distribution_period changes for sepolia_bridge.The sepolia_bridge escrow address has been updated from
0x2D4f435867066737bA1617ef024E073413909Ad2to0xf6009345d772a04f4e52150b5ec91617db79be58, anddistribution_period: '30m'has been added. Confirm these changes are intentional, validated against the contract deployment, and consistent with the mainnet migration scope.internal/migrations/erc20-bridge/002-public-transfer-actions.sql (1)
5-18: ✓ sepolia_transfer action is properly integrated.The
sepolia_transferaction correctly references thesepolia_bridgebinding, which is uncommented and configured in 000-extension.sql. Validation logic and binding call are correct.
There was a problem hiding this comment.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
internal/migrations/erc20-bridge/000-extension.sql(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: acceptance-test
|
@MicBun tests passed, migration changed to protect accidental execution, only enabling for tests. |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
current version migrated on mainnet
Summary by CodeRabbit
New Features
Refactor
Tests