Skip to content

Conversation

@ezynda3
Copy link
Contributor

@ezynda3 ezynda3 commented Nov 10, 2025

Which Jira task belongs to this PR?

Why did I implement it this way?

Checklist before requesting a review

Checklist for reviewer (DO NOT DEPLOY and contracts BEFORE CHECKING THIS!!!)

  • I have checked that any arbitrary calls to external contracts are validated and or restricted
  • I have checked that any privileged calls (i.e. storage modifications) are validated and or restricted
  • I have ensured that any new contracts have had AT A MINIMUM 1 preliminary audit conducted on by <company/auditor>

- Extend GlacisData struct with outputToken field for multibridge routing
- Update IGlacisAirlift interface from v1.0.0 to v1.1.0
- Add support for 6-param send() and 7-param quoteSend()
- Update tests to fork from Optimism at block 143581698
- Add documentation for breaking changes and new features

BREAKING CHANGE: GlacisData struct now requires 4th field (outputToken)
@lifi-action-bot lifi-action-bot marked this pull request as draft November 10, 2025 13:52
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 10, 2025

Walkthrough

Adds a new bytes32 outputToken field to GlacisData, exposes it via new IGlacisAirlift send(..., bytes32 outputToken) and quoteSend(..., bytes32 outputToken) overloads to enable multibridge / specific-token routing; updates docs, demo, tests, deployment manifests, and audit metadata; bumps GlacisFacet to v1.2.0 and IGlacisAirlift to v1.1.0.

Changes

Cohort / File(s) Change Summary
Core contracts & interface
src/Facets/GlacisFacet.sol, src/Interfaces/IGlacisAirlift.sol
Added bytes32 outputToken to GlacisData; added overloads send(..., bytes32 outputToken) and quoteSend(..., bytes32 outputToken); bumped GlacisFacet to v1.2.0 and IGlacisAirlift to v1.1.0; documented routing semantics (bytes32(0) = default routing).
Documentation
docs/GlacisFacet.md
Documented new Version (v1.2.0 / Glacis Airlift v1.1.0), added outputToken field description, default vs specific-token routing semantics, examples, and Breaking Change Notice for extended GlacisData.
Demo script
script/demoScripts/demoGlacis.ts
Switched demo destination to Unichain (chainId 130); added DST/SRC token addresses; pass outputToken via zeroPadAddressToBytes32(DST_TOKEN_ADDRESS); updated logs and calldata display for extended calldata.
Tests
test/solidity/Facets/GlacisFacet.t.sol
Added outputToken in test GlacisData instances; updated test setup (addresses, chain IDs, fork blocks, funding) to exercise multibridge routing; adjusted fuzz limits and headers.
Deployments / manifests
deployments/_deployments_log_file.json, deployments/*.json (many)
Added v1.2.0 entries to deployments log; updated numerous per-network GlacisFacet addresses and added facet entry/version in staging diamond JSON; some files had removed/edited entries (e.g., FeeForwarder removed in avalanche).
Audit metadata
audit/auditLog.json
Added audit20251113 entry and mapped GlacisFacet v1.2.0 and IGlacisAirlift v1.1.0 to that audit with report path and commit hash.
Scripts / tooling
script/demoScripts/*, minor JSON edits
Updated demo header notes and changed minor formatting/newline adjustments across some deployment JSON files.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Verify ABI/backwards-compatibility and calldata layout for the extended GlacisData tuple and new overloads.
  • Confirm tests exercise both default routing (bytes32(0)) and non-zero outputToken multibridge paths.
  • Spot-check deployment JSON address updates and the new v1.2.0 entries in the deployments log for correctness.
  • Review audit/auditLog.json additions for correct metadata and paths.

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description uses the required template but is largely incomplete. Critical sections are empty (Jira task, implementation rationale) and most reviewer checklists remain unchecked despite significant contract changes and multiple deployment updates. Fill in the Jira task reference and implementation rationale. Complete all reviewer checklists, particularly confirming the preliminary audit details (date and auditor name) and addressing external/privileged call validations.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: upgrading GlacisFacet to v1.2.0 and IGlacisAirlift to v1.1.0, which aligns with the core objective of adding multibridge routing via the outputToken parameter.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch upgrade-glacis-facet

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8f8a0d5 and 8d98b34.

📒 Files selected for processing (28)
  • deployments/_deployments_log_file.json (28 hunks)
  • deployments/arbitrum.json (1 hunks)
  • deployments/avalanche.json (1 hunks)
  • deployments/base.json (1 hunks)
  • deployments/berachain.json (1 hunks)
  • deployments/blast.json (1 hunks)
  • deployments/bob.json (1 hunks)
  • deployments/celo.json (1 hunks)
  • deployments/corn.json (1 hunks)
  • deployments/etherlink.json (1 hunks)
  • deployments/flare.json (1 hunks)
  • deployments/fraxtal.json (1 hunks)
  • deployments/gnosis.json (1 hunks)
  • deployments/hyperevm.json (1 hunks)
  • deployments/ink.json (1 hunks)
  • deployments/katana.json (1 hunks)
  • deployments/linea.json (1 hunks)
  • deployments/lisk.json (1 hunks)
  • deployments/mainnet.json (1 hunks)
  • deployments/mantle.json (1 hunks)
  • deployments/mode.json (1 hunks)
  • deployments/optimism.json (1 hunks)
  • deployments/polygonzkevm.json (1 hunks)
  • deployments/scroll.json (1 hunks)
  • deployments/soneium.json (1 hunks)
  • deployments/sonic.json (1 hunks)
  • deployments/unichain.json (1 hunks)
  • deployments/vana.json (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • deployments/sonic.json
  • deployments/hyperevm.json
  • deployments/vana.json
🧰 Additional context used
🧠 Learnings (65)
📓 Common learnings
Learnt from: mirooon
Repo: lifinance/contracts PR: 945
File: src/Facets/GlacisFacet.sol:1-3
Timestamp: 2025-01-28T11:28:16.225Z
Learning: The GlacisFacet contract audit will be conducted and added to the audit log in later stages of development. This is acceptable during the initial development phase.
Learnt from: mirooon
Repo: lifinance/contracts PR: 1283
File: deployments/ronin.diamond.json:65-68
Timestamp: 2025-08-07T10:20:01.383Z
Learning: When analyzing deployment PRs in the lifinance/contracts repository, carefully verify that target state configuration files (like script/deploy/_targetState.json) and deployment log files have been updated before flagging missing entries. The AI summary section should be consulted to understand all file changes, as manual searches might miss entries due to formatting differences or search limitations.
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1256
File: deployments/zksync.diamond.json:81-87
Timestamp: 2025-07-04T08:59:08.108Z
Learning: When analyzing deployment PRs in the lifinance/contracts repository, carefully verify that target state configuration files (like script/deploy/_targetState.json) have been updated before flagging missing entries. The AI summary section should be consulted to understand all file changes, as manual searches might miss entries due to formatting differences or search limitations.
Learnt from: mirooon
Repo: lifinance/contracts PR: 945
File: test/solidity/Facets/GlacisFacet.t.sol:214-262
Timestamp: 2025-01-22T12:36:12.699Z
Learning: The GlacisFacet test suite inherits from TestBaseFacet which already covers various failure scenarios including invalid receiver address, invalid amounts, same chain bridging, and insufficient funds, making additional failure scenario tests redundant.
Learnt from: mirooon
Repo: lifinance/contracts PR: 1406
File: src/Facets/UnitFacet.sol:75-81
Timestamp: 2025-10-02T18:10:09.934Z
Learning: In UnitFacet.sol and similar facet contracts in src/Facets/, the LiFiTransferStarted event emission should ALWAYS be at the end of the _startBridge internal function, after all validations and asset transfers have been completed successfully.
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1109
File: deployments/worldchain.json:28-28
Timestamp: 2025-04-21T03:17:53.443Z
Learning: For deployment PRs involving address updates like the RelayFacet to Worldchain, verify the actual presence of entries in files before reporting issues. The RelayFacet exists in the diamond log file and the PR diff already contains the necessary address change.
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1334
File: deployments/mainnet.json:54-54
Timestamp: 2025-08-26T02:20:52.515Z
Learning: For deployment PRs in the lifinance/contracts repository, carefully verify the specific scope mentioned in the PR title and description before suggesting updates to other networks. Not all deployments are cross-network updates - some are targeted to specific chains only.
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1357
File: deployments/lens.diamond.json:48-51
Timestamp: 2025-09-09T10:39:26.383Z
Learning: In the lifinance/contracts repository, when deployment JSON files show address changes (like AcrossFacetV3 address updates in deployments/*.diamond.json), the corresponding _deployments_log_file.json updates may be handled in separate PRs rather than the same PR that updates the diamond configuration files.
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 782
File: script/deploy/_targetState.json:49-49
Timestamp: 2024-11-25T09:05:03.917Z
Learning: The `RelayFacet` contract, when missing from the source code but referenced in deployment configurations, should be treated the same way as `OpBNBBridgeFacet` and can be ignored in code reviews.
Learnt from: ezynda3
Repo: lifinance/contracts PR: 1124
File: script/demoScripts/utils/lib/cowShedSdk.ts:0-0
Timestamp: 2025-06-05T14:50:17.275Z
Learning: For demo scripts and example code, ezynda3 prefers to keep the code simple and focused on demonstrating the core functionality rather than adding extensive input validation or defensive programming measures.
📚 Learning: 2025-09-09T10:39:26.383Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1357
File: deployments/lens.diamond.json:48-51
Timestamp: 2025-09-09T10:39:26.383Z
Learning: In the lifinance/contracts repository, when deployment JSON files show address changes (like AcrossFacetV3 address updates in deployments/*.diamond.json), the corresponding _deployments_log_file.json updates may be handled in separate PRs rather than the same PR that updates the diamond configuration files.

Applied to files:

  • deployments/mode.json
  • deployments/celo.json
  • deployments/linea.json
  • deployments/katana.json
  • deployments/bob.json
  • deployments/berachain.json
  • deployments/ink.json
  • deployments/lisk.json
  • deployments/polygonzkevm.json
  • deployments/fraxtal.json
  • deployments/optimism.json
  • deployments/mantle.json
  • deployments/arbitrum.json
  • deployments/unichain.json
  • deployments/mainnet.json
  • deployments/soneium.json
  • deployments/etherlink.json
  • deployments/flare.json
  • deployments/avalanche.json
  • deployments/base.json
  • deployments/corn.json
  • deployments/gnosis.json
  • deployments/blast.json
  • deployments/scroll.json
  • deployments/_deployments_log_file.json
📚 Learning: 2025-04-21T03:17:53.443Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1109
File: deployments/worldchain.json:28-28
Timestamp: 2025-04-21T03:17:53.443Z
Learning: For deployment PRs updating contract addresses (like RelayFacet on Worldchain), verify the presence of entries in all relevant files (worldchain.json, worldchain.diamond.json, _deployments_log_file.json) before reporting inconsistencies. The RelayFacet entry exists in all required deployment files with the correct address.

Applied to files:

  • deployments/mode.json
  • deployments/celo.json
  • deployments/linea.json
  • deployments/katana.json
  • deployments/bob.json
  • deployments/berachain.json
  • deployments/ink.json
  • deployments/lisk.json
  • deployments/polygonzkevm.json
  • deployments/fraxtal.json
  • deployments/optimism.json
  • deployments/mantle.json
  • deployments/arbitrum.json
  • deployments/unichain.json
  • deployments/mainnet.json
  • deployments/soneium.json
  • deployments/etherlink.json
  • deployments/flare.json
  • deployments/avalanche.json
  • deployments/base.json
  • deployments/corn.json
  • deployments/gnosis.json
  • deployments/blast.json
  • deployments/scroll.json
📚 Learning: 2025-04-21T03:17:53.443Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1109
File: deployments/worldchain.json:28-28
Timestamp: 2025-04-21T03:17:53.443Z
Learning: For deployment PRs involving address updates like the RelayFacet to Worldchain, verify the actual presence of entries in files before reporting issues. The RelayFacet exists in the diamond log file and the PR diff already contains the necessary address change.

Applied to files:

  • deployments/mode.json
  • deployments/celo.json
  • deployments/linea.json
  • deployments/katana.json
  • deployments/bob.json
  • deployments/berachain.json
  • deployments/ink.json
  • deployments/lisk.json
  • deployments/polygonzkevm.json
  • deployments/fraxtal.json
  • deployments/optimism.json
  • deployments/mantle.json
  • deployments/arbitrum.json
  • deployments/unichain.json
  • deployments/mainnet.json
  • deployments/soneium.json
  • deployments/etherlink.json
  • deployments/flare.json
  • deployments/avalanche.json
  • deployments/base.json
  • deployments/corn.json
  • deployments/gnosis.json
  • deployments/blast.json
  • deployments/scroll.json
📚 Learning: 2025-09-22T00:52:26.172Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1388
File: deployments/hyperevm.diamond.json:72-75
Timestamp: 2025-09-22T00:52:26.172Z
Learning: In diamond configuration files (deployments/*.diamond.json), it's acceptable to have multiple versions of the same facet (e.g., GlacisFacet v1.0.0 and v1.1.0) deployed at different contract addresses. This is intentional design for version coexistence, gradual migration, or backward compatibility purposes.

Applied to files:

  • deployments/mode.json
  • deployments/celo.json
  • deployments/katana.json
  • deployments/bob.json
  • deployments/berachain.json
  • deployments/ink.json
  • deployments/lisk.json
  • deployments/fraxtal.json
  • deployments/optimism.json
  • deployments/mantle.json
  • deployments/arbitrum.json
  • deployments/unichain.json
  • deployments/mainnet.json
  • deployments/soneium.json
  • deployments/flare.json
  • deployments/avalanche.json
  • deployments/base.json
  • deployments/corn.json
  • deployments/gnosis.json
  • deployments/blast.json
  • deployments/scroll.json
📚 Learning: 2025-04-21T03:15:12.236Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1109
File: deployments/worldchain.diamond.json:84-85
Timestamp: 2025-04-21T03:15:12.236Z
Learning: In deployment JSON files that contain "diamond" in their filename (located in the deployments folder), periphery contracts may have empty string values for their addresses. This indicates that the contract is not deployed on that particular chain and should not be flagged as an issue during code reviews.

Applied to files:

  • deployments/mode.json
  • deployments/celo.json
  • deployments/linea.json
  • deployments/katana.json
  • deployments/bob.json
  • deployments/berachain.json
  • deployments/ink.json
  • deployments/lisk.json
  • deployments/polygonzkevm.json
  • deployments/optimism.json
  • deployments/mantle.json
  • deployments/arbitrum.json
  • deployments/unichain.json
  • deployments/mainnet.json
  • deployments/soneium.json
  • deployments/etherlink.json
  • deployments/flare.json
  • deployments/avalanche.json
  • deployments/corn.json
  • deployments/blast.json
  • deployments/scroll.json
📚 Learning: 2025-09-16T01:39:54.099Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1381
File: deployments/arbitrum.json:65-69
Timestamp: 2025-09-16T01:39:54.099Z
Learning: When verifying facet deployments across .json and .diamond.json files, search by facet name rather than trying to cross-reference addresses between the files, as the same contract can have different addresses in different deployment files.

Applied to files:

  • deployments/mode.json
  • deployments/celo.json
  • deployments/katana.json
  • deployments/bob.json
  • deployments/berachain.json
  • deployments/lisk.json
  • deployments/polygonzkevm.json
  • deployments/optimism.json
  • deployments/mantle.json
  • deployments/arbitrum.json
  • deployments/unichain.json
  • deployments/mainnet.json
  • deployments/soneium.json
  • deployments/flare.json
  • deployments/avalanche.json
  • deployments/base.json
  • deployments/corn.json
  • deployments/blast.json
📚 Learning: 2025-07-04T08:59:08.108Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1256
File: deployments/zksync.diamond.json:81-87
Timestamp: 2025-07-04T08:59:08.108Z
Learning: When analyzing deployment PRs in the lifinance/contracts repository, carefully verify that target state configuration files (like script/deploy/_targetState.json) have been updated before flagging missing entries. The AI summary section should be consulted to understand all file changes, as manual searches might miss entries due to formatting differences or search limitations.

Applied to files:

  • deployments/mode.json
  • deployments/celo.json
  • deployments/linea.json
  • deployments/katana.json
  • deployments/bob.json
  • deployments/berachain.json
  • deployments/ink.json
  • deployments/lisk.json
  • deployments/polygonzkevm.json
  • deployments/fraxtal.json
  • deployments/optimism.json
  • deployments/mantle.json
  • deployments/unichain.json
  • deployments/mainnet.json
  • deployments/soneium.json
  • deployments/etherlink.json
  • deployments/avalanche.json
  • deployments/base.json
  • deployments/corn.json
  • deployments/gnosis.json
  • deployments/blast.json
  • deployments/scroll.json
  • deployments/_deployments_log_file.json
📚 Learning: 2024-09-27T07:10:15.586Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 812
File: deployments/polygon.diamond.json:4-11
Timestamp: 2024-09-27T07:10:15.586Z
Learning: In `deployments/polygon.diamond.json`, it's acceptable for certain facets to have empty names and versions when specified by the developer.

Applied to files:

  • deployments/mode.json
  • deployments/linea.json
  • deployments/katana.json
  • deployments/bob.json
  • deployments/berachain.json
  • deployments/polygonzkevm.json
  • deployments/fraxtal.json
  • deployments/optimism.json
  • deployments/mantle.json
  • deployments/arbitrum.json
  • deployments/mainnet.json
  • deployments/base.json
📚 Learning: 2024-11-25T09:05:43.045Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 782
File: deployments/base.diamond.json:148-148
Timestamp: 2024-11-25T09:05:43.045Z
Learning: In deployment configuration files (e.g., `deployments/base.diamond.json`), empty addresses for contracts like `Permit2Proxy` may be placeholders and will be updated after approvals are released from the multisig safe.

Applied to files:

  • deployments/mode.json
  • deployments/celo.json
  • deployments/bob.json
  • deployments/berachain.json
  • deployments/ink.json
  • deployments/polygonzkevm.json
  • deployments/optimism.json
  • deployments/arbitrum.json
  • deployments/soneium.json
  • deployments/etherlink.json
  • deployments/flare.json
  • deployments/avalanche.json
  • deployments/corn.json
  • deployments/blast.json
📚 Learning: 2025-08-07T10:20:01.383Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1283
File: deployments/ronin.diamond.json:65-68
Timestamp: 2025-08-07T10:20:01.383Z
Learning: When analyzing deployment PRs in the lifinance/contracts repository, carefully verify that target state configuration files (like script/deploy/_targetState.json) and deployment log files have been updated before flagging missing entries. The AI summary section should be consulted to understand all file changes, as manual searches might miss entries due to formatting differences or search limitations.

Applied to files:

  • deployments/mode.json
  • deployments/celo.json
  • deployments/linea.json
  • deployments/katana.json
  • deployments/berachain.json
  • deployments/ink.json
  • deployments/lisk.json
  • deployments/polygonzkevm.json
  • deployments/fraxtal.json
  • deployments/optimism.json
  • deployments/unichain.json
  • deployments/mainnet.json
  • deployments/soneium.json
  • deployments/etherlink.json
  • deployments/avalanche.json
  • deployments/base.json
  • deployments/corn.json
  • deployments/gnosis.json
  • deployments/scroll.json
  • deployments/_deployments_log_file.json
📚 Learning: 2024-11-25T09:05:03.917Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 782
File: script/deploy/_targetState.json:49-49
Timestamp: 2024-11-25T09:05:03.917Z
Learning: The `RelayFacet` contract, when missing from the source code but referenced in deployment configurations, should be treated the same way as `OpBNBBridgeFacet` and can be ignored in code reviews.

Applied to files:

  • deployments/mode.json
  • deployments/celo.json
  • deployments/linea.json
  • deployments/bob.json
  • deployments/berachain.json
  • deployments/lisk.json
  • deployments/polygonzkevm.json
  • deployments/optimism.json
  • deployments/mantle.json
  • deployments/arbitrum.json
  • deployments/mainnet.json
  • deployments/avalanche.json
  • deployments/base.json
  • deployments/corn.json
  • deployments/gnosis.json
  • deployments/blast.json
  • deployments/scroll.json
📚 Learning: 2025-09-25T07:47:30.735Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 1324
File: src/Facets/EcoFacet.sol:306-336
Timestamp: 2025-09-25T07:47:30.735Z
Learning: In EcoFacet (src/Facets/EcoFacet.sol), the team intentionally uses variable-length validation for nonEVMReceiver addresses (up to 44 bytes) to support cross-ecosystem bridging with different address formats, rather than enforcing fixed 32-byte raw pubkeys.

Applied to files:

  • deployments/mode.json
  • deployments/celo.json
  • deployments/linea.json
  • deployments/katana.json
  • deployments/berachain.json
  • deployments/ink.json
  • deployments/lisk.json
  • deployments/polygonzkevm.json
  • deployments/fraxtal.json
  • deployments/optimism.json
  • deployments/mantle.json
  • deployments/arbitrum.json
  • deployments/unichain.json
  • deployments/mainnet.json
  • deployments/soneium.json
  • deployments/flare.json
  • deployments/avalanche.json
  • deployments/base.json
  • deployments/corn.json
  • deployments/gnosis.json
  • deployments/blast.json
  • deployments/scroll.json
📚 Learning: 2025-01-28T11:28:16.225Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 945
File: src/Facets/GlacisFacet.sol:1-3
Timestamp: 2025-01-28T11:28:16.225Z
Learning: The GlacisFacet contract audit will be conducted and added to the audit log in later stages of development. This is acceptable during the initial development phase.

Applied to files:

  • deployments/mode.json
  • deployments/berachain.json
  • deployments/lisk.json
  • deployments/mantle.json
  • deployments/blast.json
  • deployments/scroll.json
📚 Learning: 2025-02-12T09:44:12.961Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 985
File: script/deploy/_targetState.json:0-0
Timestamp: 2025-02-12T09:44:12.961Z
Learning: The bsca network intentionally maintains different facet versions between staging and production environments, specifically:
1. CalldataVerificationFacet: v1.1.1 in staging vs v1.1.2 in production
2. EmergencyPauseFacet: present only in production
3. Permit2Proxy: present only in production

Applied to files:

  • deployments/mode.json
  • deployments/celo.json
  • deployments/linea.json
  • deployments/berachain.json
  • deployments/lisk.json
  • deployments/polygonzkevm.json
  • deployments/mantle.json
  • deployments/unichain.json
  • deployments/avalanche.json
  • deployments/gnosis.json
  • deployments/blast.json
  • deployments/scroll.json
📚 Learning: 2025-09-04T09:26:35.060Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 1344
File: src/Facets/GardenFacet.sol:124-130
Timestamp: 2025-09-04T09:26:35.060Z
Learning: In src/Facets/GardenFacet.sol, the team has decided that registry lookup validation should only check for zero addresses and not perform additional contract existence checks (like htlcAddress.code.length > 0), preferring minimal validation for Garden HTLC registry addresses.

Applied to files:

  • deployments/mode.json
  • deployments/celo.json
  • deployments/linea.json
  • deployments/katana.json
  • deployments/bob.json
  • deployments/berachain.json
  • deployments/lisk.json
  • deployments/fraxtal.json
  • deployments/optimism.json
  • deployments/mantle.json
  • deployments/arbitrum.json
  • deployments/unichain.json
  • deployments/gnosis.json
  • deployments/blast.json
  • deployments/scroll.json
📚 Learning: 2025-08-27T23:36:40.773Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1328
File: test/solidity/Periphery/GasZipPeriphery.t.sol:223-233
Timestamp: 2025-08-27T23:36:40.773Z
Learning: In bridge facet swap flows with requiresDeposit=false, tokens are already held by the diamond contract from previous swaps. When subsequent contracts like GasZipPeriphery call LibAsset.depositAsset, they pull tokens from msg.sender (the diamond) to themselves via transferFrom, requiring no additional approvals since the diamond already owns the tokens.

Applied to files:

  • deployments/mode.json
  • deployments/linea.json
  • deployments/bob.json
  • deployments/berachain.json
  • deployments/fraxtal.json
  • deployments/arbitrum.json
  • deployments/flare.json
  • deployments/corn.json
  • deployments/blast.json
  • deployments/scroll.json
📚 Learning: 2025-08-27T13:47:28.646Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1328
File: src/Periphery/Lda/Facets/UniV2StyleFacet.sol:0-0
Timestamp: 2025-08-27T13:47:28.646Z
Learning: In src/Periphery/Lda/Facets/UniV2StyleFacet.sol and similar LDA facets, mirooon prefers to rely on backend validation for pool addresses rather than adding contract code-size checks in the smart contract, as pool validation occurs during payload generation and transactions would fail anyway if sent to invalid addresses.

Applied to files:

  • deployments/mode.json
  • deployments/berachain.json
  • deployments/lisk.json
  • deployments/optimism.json
  • deployments/mantle.json
  • deployments/unichain.json
  • deployments/blast.json
  • deployments/scroll.json
📚 Learning: 2025-10-10T10:56:04.861Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1413
File: src/Facets/EverclearFacet.sol:4-13
Timestamp: 2025-10-10T10:56:04.861Z
Learning: LibAllowList is only required for facets that make arbitrary external calls to DEX aggregators (e.g., GenericSwapFacetV3). Bridge facets that call specific protocol contracts (like EverclearFacet calling IEverclearFeeAdapter) do not need to import LibAllowList.

Applied to files:

  • deployments/mode.json
  • deployments/celo.json
  • deployments/linea.json
  • deployments/bob.json
  • deployments/lisk.json
  • deployments/polygonzkevm.json
  • deployments/fraxtal.json
  • deployments/optimism.json
  • deployments/mantle.json
  • deployments/arbitrum.json
  • deployments/unichain.json
  • deployments/mainnet.json
  • deployments/etherlink.json
  • deployments/avalanche.json
  • deployments/base.json
  • deployments/gnosis.json
  • deployments/blast.json
  • deployments/scroll.json
📚 Learning: 2025-01-22T12:36:12.699Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 945
File: test/solidity/Facets/GlacisFacet.t.sol:214-262
Timestamp: 2025-01-22T12:36:12.699Z
Learning: The GlacisFacet test suite inherits from TestBaseFacet which already covers various failure scenarios including invalid receiver address, invalid amounts, same chain bridging, and insufficient funds, making additional failure scenario tests redundant.

Applied to files:

  • deployments/mode.json
  • deployments/linea.json
  • deployments/berachain.json
  • deployments/ink.json
  • deployments/lisk.json
  • deployments/fraxtal.json
  • deployments/optimism.json
  • deployments/mantle.json
  • deployments/arbitrum.json
  • deployments/unichain.json
  • deployments/mainnet.json
  • deployments/soneium.json
  • deployments/gnosis.json
  • deployments/blast.json
  • deployments/scroll.json
📚 Learning: 2025-08-07T10:20:01.383Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1283
File: deployments/ronin.diamond.json:65-68
Timestamp: 2025-08-07T10:20:01.383Z
Learning: When analyzing deployment PRs in the lifinance/contracts repository, understand that _targetState.json tracks contract version numbers (not addresses) and _deployments_log_file.json contains deployment records with addresses that may not be organized in obvious network sections. Always verify the actual file structure before flagging missing entries.

Applied to files:

  • deployments/celo.json
  • deployments/linea.json
  • deployments/ink.json
  • deployments/lisk.json
  • deployments/corn.json
  • deployments/blast.json
  • deployments/scroll.json
  • deployments/_deployments_log_file.json
📚 Learning: 2025-01-28T14:30:06.911Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 924
File: deployments/abstract.json:2-4
Timestamp: 2025-01-28T14:30:06.911Z
Learning: In the LiFi contract architecture, "LiFiDiamond" is the diamond proxy contract that connects all facets into a cohesive system. The facets are individual contracts that provide specific functionality, and the diamond proxy delegates calls to these facets.

Applied to files:

  • deployments/celo.json
  • deployments/katana.json
  • deployments/polygonzkevm.json
  • deployments/etherlink.json
  • deployments/avalanche.json
📚 Learning: 2025-06-13T08:30:26.220Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1207
File: deployments/_deployments_log_file.json:34037-34080
Timestamp: 2025-06-13T08:30:26.220Z
Learning: LiFiDiamond contains generic withdrawal logic, so individual facet contracts (e.g., PioneerFacet) do not need their own Ether-withdraw functions.

Applied to files:

  • deployments/celo.json
  • deployments/katana.json
  • deployments/bob.json
  • deployments/polygonzkevm.json
  • deployments/optimism.json
  • deployments/corn.json
📚 Learning: 2025-10-13T11:13:48.847Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1413
File: src/Facets/EverclearV2Facet.sol:75-96
Timestamp: 2025-10-13T11:13:48.847Z
Learning: In EverclearV2Facet (and all LiFi facets), the team standard is to use msg.sender as the refund address with the refundExcessNative modifier, not requiring an explicit refund address parameter.

Applied to files:

  • deployments/celo.json
  • deployments/ink.json
  • deployments/polygonzkevm.json
  • deployments/soneium.json
📚 Learning: 2025-10-02T18:10:09.934Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1406
File: src/Facets/UnitFacet.sol:75-81
Timestamp: 2025-10-02T18:10:09.934Z
Learning: In UnitFacet.sol and similar facet contracts in src/Facets/, the LiFiTransferStarted event emission should ALWAYS be at the end of the _startBridge internal function, after all validations and asset transfers have been completed successfully.

Applied to files:

  • deployments/celo.json
  • deployments/katana.json
  • deployments/polygonzkevm.json
  • deployments/base.json
📚 Learning: 2024-10-09T03:47:21.269Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 806
File: deployments/_deployments_log_file.json:5780-5793
Timestamp: 2024-10-09T03:47:21.269Z
Learning: The owner address `0x11f11121df7256c40339393b0fb045321022ce44` and the `DiamondCutFacet` address `0xd5cf40a2a18b633cfd6a1ae16d1771596498cf83` in the `LiFiDiamond` deployment on `xlayer` are correct and should not be flagged as issues, even if they are not referenced in the Solidity files.

Applied to files:

  • deployments/celo.json
  • deployments/katana.json
  • deployments/bob.json
  • deployments/ink.json
  • deployments/lisk.json
  • deployments/polygonzkevm.json
  • deployments/mantle.json
  • deployments/arbitrum.json
  • deployments/unichain.json
  • deployments/soneium.json
  • deployments/etherlink.json
  • deployments/flare.json
  • deployments/corn.json
  • deployments/blast.json
📚 Learning: 2024-09-30T03:52:27.281Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 812
File: deployments/_deployments_log_file.json:1914-1927
Timestamp: 2024-09-30T03:52:27.281Z
Learning: Duplicate entries in `deployments/_deployments_log_file.json` that are outdated do not require changes.

Applied to files:

  • deployments/linea.json
  • deployments/_deployments_log_file.json
📚 Learning: 2025-02-11T10:35:03.536Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 988
File: script/tasks/solidity/AddTokenApprovalsToCBridgeFacetPacked.s.sol:17-21
Timestamp: 2025-02-11T10:35:03.536Z
Learning: The CBridgeFacetPacked and cBridge addresses in AddTokenApprovalsToCBridgeFacetPacked.s.sol must not be zero addresses as they are required for token approvals to function properly.

Applied to files:

  • deployments/linea.json
  • deployments/bob.json
  • deployments/ink.json
  • deployments/fraxtal.json
  • deployments/optimism.json
  • deployments/arbitrum.json
  • deployments/mainnet.json
  • deployments/soneium.json
  • deployments/flare.json
  • deployments/avalanche.json
  • deployments/base.json
  • deployments/corn.json
  • deployments/gnosis.json
📚 Learning: 2024-10-31T09:09:38.568Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 843
File: src/Facets/RelayFacet.sol:165-170
Timestamp: 2024-10-31T09:09:38.568Z
Learning: In the `RelayFacet` contract (`src/Facets/RelayFacet.sol`), within the `_startBridge` function, low-level `call` is intentionally used to transfer tokens so that extra bytes can be added to the calldata, as required for integrating with Relay Protocol.

Applied to files:

  • deployments/linea.json
  • deployments/mainnet.json
  • deployments/avalanche.json
  • deployments/base.json
  • deployments/corn.json
📚 Learning: 2025-07-16T01:03:08.106Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1275
File: src/Facets/AllBridgeFacet.sol:164-164
Timestamp: 2025-07-16T01:03:08.106Z
Learning: In src/Facets/AllBridgeFacet.sol, the team has decided that explicit validation for address downcasting from `_bridgeData.sendingAssetId` to `bytes32(uint256(uint160(_bridgeData.sendingAssetId)))` is not required, accepting the potential risk of silent overflow from unsafe downcasting.

Applied to files:

  • deployments/linea.json
  • deployments/arbitrum.json
  • deployments/mainnet.json
  • deployments/base.json
📚 Learning: 2024-10-09T03:47:21.269Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 819
File: deployments/fuse.json:24-25
Timestamp: 2024-10-09T03:47:21.269Z
Learning: The `LiFiDEXAggregator.sol` contract is located in `src/Periphery/`.

Applied to files:

  • deployments/katana.json
  • deployments/polygonzkevm.json
  • deployments/etherlink.json
📚 Learning: 2025-05-27T16:18:53.709Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1165
File: test/solidity/Periphery/GasZipPeriphery.t.sol:39-40
Timestamp: 2025-05-27T16:18:53.709Z
Learning: The correct Gnosis Bridge Router address for the LiFi contracts project is 0x9a873656c19Efecbfb4f9FAb5B7acdeAb466a0B0, which implements the IGnosisBridgeRouter interface used in GnosisBridgeFacet.

Applied to files:

  • deployments/katana.json
📚 Learning: 2025-01-21T11:07:36.236Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 937
File: script/deploy/facets/DeployLiFiDEXAggregator.s.sol:33-35
Timestamp: 2025-01-21T11:07:36.236Z
Learning: In the LiFiDEXAggregator contract deployment (DeployLiFiDEXAggregator.s.sol), the refundWallet address from global.json is used as the owner parameter in the contract's constructor, which is then passed to the WithdrawablePeriphery base contract.

Applied to files:

  • deployments/katana.json
  • deployments/etherlink.json
📚 Learning: 2025-08-27T13:07:58.254Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1328
File: src/Periphery/Lda/Facets/CurveFacet.sol:0-0
Timestamp: 2025-08-27T13:07:58.254Z
Learning: In the LiFi contracts codebase, ICurveLegacy interface is defined inline in src/Periphery/LiFiDEXAggregator.sol with a non-payable exchange function. The CurveFacet diff shows importing it from a separate file that doesn't exist, creating a compilation issue.

Applied to files:

  • deployments/katana.json
📚 Learning: 2025-02-13T08:57:00.095Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 984
File: docs/ChainflipFacet.md:0-0
Timestamp: 2025-02-13T08:57:00.095Z
Learning: The ChainflipData struct in ChainflipFacet has three fields:
1. uint32 dstToken - The destination token identifier in Chainflip
2. bytes32 nonEvmAddress - The non-EVM destination address
3. bytes cfParameters - Additional parameters for Chainflip protocol

Applied to files:

  • deployments/bob.json
  • deployments/fraxtal.json
  • deployments/arbitrum.json
  • deployments/mainnet.json
  • deployments/soneium.json
  • deployments/corn.json
📚 Learning: 2024-11-26T01:01:18.499Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 782
File: deployments/arbitrum.diamond.json:148-150
Timestamp: 2024-11-26T01:01:18.499Z
Learning: In `deployments/*.diamond.json` configuration files, facets that are part of an open PR and not yet merged into the main branch may have missing `Name` and `Version` fields.

Applied to files:

  • deployments/berachain.json
  • deployments/fraxtal.json
  • deployments/base.json
📚 Learning: 2024-12-04T01:59:34.045Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 832
File: deployments/_deployments_log_file.json:23712-23720
Timestamp: 2024-12-04T01:59:34.045Z
Learning: In `deployments/_deployments_log_file.json`, duplicate deployment entries for the same version and address may occur because they correspond to deployments on different networks. These entries are acceptable and should not be flagged as duplicates in future reviews.

Applied to files:

  • deployments/ink.json
  • deployments/avalanche.json
  • deployments/scroll.json
  • deployments/_deployments_log_file.json
📚 Learning: 2025-04-22T09:04:44.244Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1112
File: deployments/soneium.diamond.json:81-81
Timestamp: 2025-04-22T09:04:44.244Z
Learning: In the lifinance/contracts repository, it's normal and expected for periphery contracts to have empty address values in deployment files when they are not deployed on a particular network. This applies to all periphery contracts including ReceiverChainflip, ReceiverStargateV2, and others. PRs should not flag empty periphery contract addresses as issues.

Applied to files:

  • deployments/ink.json
  • deployments/flare.json
📚 Learning: 2024-10-09T03:47:21.269Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 819
File: deployments/boba.diamond.json:68-68
Timestamp: 2024-10-09T03:47:21.269Z
Learning: In the `lifinance/contracts` repository, `ReceiverStargateV2` may not be deployed to all networks, and it's acceptable for its address to remain empty in deployment files when it is not deployed. PRs unrelated to `ReceiverStargateV2` should not raise comments about its absence.

Applied to files:

  • deployments/ink.json
  • deployments/flare.json
📚 Learning: 2025-02-24T09:35:34.908Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 984
File: src/Periphery/ReceiverChainflip.sol:48-62
Timestamp: 2025-02-24T09:35:34.908Z
Learning: Contract address validations for periphery contracts like ReceiverChainflip are handled in deployment scripts rather than in the constructor.

Applied to files:

  • deployments/ink.json
📚 Learning: 2025-01-28T14:27:46.906Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 924
File: script/deploy/zksync/DeployStargateFacetV2.s.sol:23-28
Timestamp: 2025-01-28T14:27:46.906Z
Learning: Zero-address validation is not required in StargateFacetV2 constructor for tokenMessaging parameter.

Applied to files:

  • deployments/ink.json
  • deployments/flare.json
  • deployments/gnosis.json
📚 Learning: 2025-08-28T02:41:07.505Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1321
File: docs/RelayDepositoryFacet.md:9-10
Timestamp: 2025-08-28T02:41:07.505Z
Learning: Unit tests for RelayDepositoryFacet cannot verify fund forwarding behavior after deposits because the facet delegates to external IRelayDepository contracts. The forwarding logic is implemented in the Relay Protocol V2 Depository contracts, not in the facet itself.

Applied to files:

  • deployments/lisk.json
  • deployments/mantle.json
  • deployments/avalanche.json
  • deployments/base.json
  • deployments/corn.json
📚 Learning: 2024-11-26T01:16:27.721Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 782
File: deployments/worldchain.diamond.json:40-43
Timestamp: 2024-11-26T01:16:27.721Z
Learning: Version inconsistencies of 'GenericSwapFacetV3' across deployment configurations are acceptable if they are only due to differences in Solidity pragma directives.

Applied to files:

  • deployments/polygonzkevm.json
  • deployments/fraxtal.json
  • deployments/mantle.json
  • deployments/arbitrum.json
  • deployments/mainnet.json
  • deployments/etherlink.json
  • deployments/flare.json
📚 Learning: 2024-11-01T11:53:57.162Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 846
File: deployments/cronos.diamond.json:28-31
Timestamp: 2024-11-01T11:53:57.162Z
Learning: In `deployments/cronos.diamond.json`, both `GenericSwapFacet` and `GenericSwapFacetV3` are distinct facets that should be included together, as they serve different purposes.

Applied to files:

  • deployments/fraxtal.json
📚 Learning: 2025-08-27T13:07:58.254Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1328
File: src/Periphery/Lda/Facets/CurveFacet.sol:0-0
Timestamp: 2025-08-27T13:07:58.254Z
Learning: The CurveFacet in src/Periphery/Lda/Facets/CurveFacet.sol has fundamental issues: it imports a non-existent ICurveLegacy interface, and attempts to send ETH to non-payable exchange functions in both ICurve and ICurveV2 interfaces. All current Curve interfaces are non-payable and cannot accept native ETH.

Applied to files:

  • deployments/optimism.json
  • deployments/unichain.json
📚 Learning: 2024-11-22T08:49:35.205Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 827
File: src/Facets/DeBridgeDlnFacet.sol:0-0
Timestamp: 2024-11-22T08:49:35.205Z
Learning: In `DeBridgeDlnFacet.sol`, direct access to the `deBridgeChainId` mapping is acceptable, and using the `getDeBridgeChainId` function is not necessary in these instances.

Applied to files:

  • deployments/arbitrum.json
  • deployments/mainnet.json
  • deployments/base.json
📚 Learning: 2024-10-04T09:01:56.514Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 819
File: deployments/base.diamond.json:123-123
Timestamp: 2024-10-04T09:01:56.514Z
Learning: In the `lifinance/contracts` repository, it's acceptable to retain references to the old `LiFuelFeeCollector` address (`0xc4f7A34b8d283f66925eF0f5CCdFC2AF3030DeaE`) in deployment files when updating them is not necessary.

Applied to files:

  • deployments/unichain.json
  • deployments/flare.json
  • deployments/avalanche.json
📚 Learning: 2025-08-27T13:07:58.254Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1328
File: src/Periphery/Lda/Facets/CurveFacet.sol:0-0
Timestamp: 2025-08-27T13:07:58.254Z
Learning: The CurveFacet implementation is fundamentally broken: ICurveLegacy interface doesn't exist in the codebase but is imported and used, and the code attempts to send ETH to non-payable exchange functions. The entire native asset handling logic needs to be redesigned.

Applied to files:

  • deployments/unichain.json
📚 Learning: 2025-08-23T11:07:02.778Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1322
File: src/Facets/MayanFacet.sol:259-272
Timestamp: 2025-08-23T11:07:02.778Z
Learning: In src/Facets/MayanFacet.sol, the offset 0xe4 for parsing receiver addresses from HCDepositInitiator::deposit calldata is correct. The mload operation reads 32-byte words and the address extraction via address(uint160(uint256(receiver))) properly handles ABI padding, so theoretical byte-level offset calculations can be misleading when the actual implementation works correctly with real-world data.

Applied to files:

  • deployments/unichain.json
  • deployments/soneium.json
📚 Learning: 2025-02-17T07:59:54.979Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 975
File: test/solidity/Facets/DeBridgeDlnFacet.t.sol:0-0
Timestamp: 2025-02-17T07:59:54.979Z
Learning: In DeBridgeDlnFacet, chain ID mappings are hardcoded and not designed to be dynamically updated, so tests for mapping updates are not needed.

Applied to files:

  • deployments/mainnet.json
📚 Learning: 2025-08-29T10:02:09.041Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1299
File: src/Facets/AcrossFacetPackedV4.sol:118-136
Timestamp: 2025-08-29T10:02:09.041Z
Learning: In AcrossFacetPackedV4.sol, the team explicitly chooses to omit calldata length validation in gas-optimized packed functions like startBridgeTokensViaAcrossV4NativePacked to save gas, accepting the trade-off of potential out-of-bounds reverts for better gas efficiency.

Applied to files:

  • deployments/soneium.json
📚 Learning: 2025-08-29T10:02:15.095Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1299
File: src/Facets/AcrossFacetPackedV4.sol:186-214
Timestamp: 2025-08-29T10:02:15.095Z
Learning: In AcrossFacetPackedV4.sol, calldata length validation is intentionally omitted to prioritize gas optimization over safety checks. The team accepts the risk of potential out-of-bounds reads in favor of lower gas costs for the packed implementation.

Applied to files:

  • deployments/soneium.json
📚 Learning: 2025-09-01T09:42:45.394Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1299
File: docs/AcrossFacetPackedV4.md:136-143
Timestamp: 2025-09-01T09:42:45.394Z
Learning: In AcrossFacetPackedV4.sol, the transactionId parameter is truncated from bytes32 to bytes8 (8 bytes) in the packed calldata format for gas optimization, even though it's declared as bytes32 in the PackedParameters struct.

Applied to files:

  • deployments/soneium.json
📚 Learning: 2025-09-01T09:40:18.143Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1299
File: docs/AcrossFacetPackedV4.md:109-116
Timestamp: 2025-09-01T09:40:18.143Z
Learning: In AcrossFacetPackedV4.sol, the native packed calldata pre-message length is exactly 192 bytes, as validated by the decode function's minimum length check.

Applied to files:

  • deployments/soneium.json
📚 Learning: 2025-02-11T10:33:52.791Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 988
File: script/deploy/facets/DeployPermit2Proxy.s.sol:33-37
Timestamp: 2025-02-11T10:33:52.791Z
Learning: The Permit2Proxy contract must not be deployed with zero addresses for its critical dependencies (LiFiDiamond, permit2Address, safeAddress). This is enforced by passing `false` to `_getConfigContractAddress` function.

Applied to files:

  • deployments/etherlink.json
📚 Learning: 2024-11-21T08:39:29.530Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 861
File: config/dexs.json:748-752
Timestamp: 2024-11-21T08:39:29.530Z
Learning: In the 'worldchain' network, the addresses `0x50D5a8aCFAe13Dceb217E9a071F6c6Bd5bDB4155`, `0x8f023b4193a6b18C227B4a755f8e28B3D30Ef9a1`, and `0x603a538477d44064eA5A5d8C345b4Ff6fca1142a` are used as DEXs and should be included in `config/dexs.json`.

Applied to files:

  • deployments/etherlink.json
📚 Learning: 2024-10-09T03:47:21.269Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 807
File: src/Periphery/GasZipPeriphery.sol:57-62
Timestamp: 2024-10-09T03:47:21.269Z
Learning: In the `GasZipPeriphery` contract, it's acceptable to let low-level calls like `liFiDEXAggregator.call` fail without explicit error handling, as failing the entire transaction is sufficient and saves gas.

Applied to files:

  • deployments/etherlink.json
📚 Learning: 2025-01-21T11:04:46.116Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 937
File: config/dexs.json:95-99
Timestamp: 2025-01-21T11:04:46.116Z
Learning: In the dexs.json configuration, utility contracts (like FeeCollector, LiFuelFeeCollector, TokenWrapper) can be treated as DEX contracts since they are handled similarly in the system's logic.

Applied to files:

  • deployments/etherlink.json
📚 Learning: 2024-11-21T08:25:26.214Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 861
File: script/deploy/_targetState.json:1364-1390
Timestamp: 2024-11-21T08:25:26.214Z
Learning: For the Cronos network configuration in `script/deploy/_targetState.json`, the absence of bridge facets such as `StargateFacet`, `AcrossFacet`, `HopFacet`, and `SymbiosisFacet` is acceptable and expected.

Applied to files:

  • deployments/avalanche.json
  • deployments/gnosis.json
📚 Learning: 2024-11-26T01:14:58.163Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 782
File: deployments/worldchain.diamond.json:5-63
Timestamp: 2024-11-26T01:14:58.163Z
Learning: When facet versions are set to empty strings in `deployments/*.diamond.json` files, do not report this issue, as it is already known and will be addressed separately.

Applied to files:

  • deployments/base.json
📚 Learning: 2025-08-29T11:12:02.184Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1328
File: src/Periphery/LDA/Facets/SyncSwapV2Facet.sol:33-38
Timestamp: 2025-08-29T11:12:02.184Z
Learning: In LDA facets (src/Periphery/Lda/Facets/**/*.sol), tokenIn parameter validation (checking for address(0)) is intentionally not performed as part of the design architecture.

Applied to files:

  • deployments/corn.json
📚 Learning: 2024-10-08T07:14:52.296Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 825
File: config/networks.json:462-462
Timestamp: 2024-10-08T07:14:52.296Z
Learning: In the `networks.json` file and related configuration files, when updating the `name` property of a network (e.g., from `Scroll` to `zkScroll`), the key of the network object should remain unchanged (e.g., `'scroll'`) to ensure it matches references elsewhere in the codebase.

Applied to files:

  • deployments/scroll.json
📚 Learning: 2025-05-28T17:33:33.959Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1170
File: deployments/_deployments_log_file.json:28060-28072
Timestamp: 2025-05-28T17:33:33.959Z
Learning: Deployment log files like `deployments/_deployments_log_file.json` are historical records that document the actual versions deployed at specific times. They should not be updated to match current contract versions - they must accurately reflect what was deployed when the deployment occurred.

Applied to files:

  • deployments/_deployments_log_file.json
📚 Learning: 2025-05-28T17:33:10.529Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1170
File: deployments/_deployments_log_file.json:28706-28717
Timestamp: 2025-05-28T17:33:10.529Z
Learning: Deployment log files (like `_deployments_log_file.json`) are historical records that should not be updated to match current contract versions. They should accurately reflect the versions that were actually deployed at specific timestamps.

Applied to files:

  • deployments/_deployments_log_file.json
📚 Learning: 2025-01-09T04:17:46.190Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 914
File: deployments/_deployments_log_file.json:26902-26916
Timestamp: 2025-01-09T04:17:46.190Z
Learning: Updates to _deployments_log_file.json can represent backfilling of historical deployment data, not just new deployments. Such updates don't require new audits.

Applied to files:

  • deployments/_deployments_log_file.json
⏰ 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). (2)
  • GitHub Check: enforce-min-test-coverage
  • GitHub Check: run-unit-tests

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.

@lifi-action-bot lifi-action-bot changed the title Upgrade glacis facet Upgrade glacis facet [GlacisFacet v1.2.0, IGlacisAirlift v1.1.0] Nov 10, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
test/solidity/Facets/GlacisFacet.t.sol (1)

402-409: Optional: Consider extracting the outputToken conversion logic.

The pattern outputToken == address(0) ? bytes32(0) : bytes32(uint256(uint160(outputToken))) is repeated in many test functions. While this is acceptable for tests, you could optionally extract it to a helper function in the test base to reduce duplication:

function getOutputTokenBytes32() internal view returns (bytes32) {
    return outputToken == address(0) 
        ? bytes32(0) 
        : bytes32(uint256(uint160(outputToken)));
}

Then use: outputToken: getOutputTokenBytes32()

Also applies to: 456-463, 481-488, 512-519, 539-546, 570-577, 603-610, 632-639, 670-677, 708-715, 740-747

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 00a84b8 and cb32847.

📒 Files selected for processing (5)
  • docs/GlacisFacet.md (3 hunks)
  • script/demoScripts/demoGlacis.ts (5 hunks)
  • src/Facets/GlacisFacet.sol (3 hunks)
  • src/Interfaces/IGlacisAirlift.sol (4 hunks)
  • test/solidity/Facets/GlacisFacet.t.sol (16 hunks)
🧰 Additional context used
🧠 Learnings (39)
📓 Common learnings
Learnt from: mirooon
Repo: lifinance/contracts PR: 945
File: src/Facets/GlacisFacet.sol:1-3
Timestamp: 2025-01-28T11:28:16.225Z
Learning: The GlacisFacet contract audit will be conducted and added to the audit log in later stages of development. This is acceptable during the initial development phase.
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1357
File: deployments/lens.diamond.json:48-51
Timestamp: 2025-09-09T10:39:26.383Z
Learning: In the lifinance/contracts repository, when deployment JSON files show address changes (like AcrossFacetV3 address updates in deployments/*.diamond.json), the corresponding _deployments_log_file.json updates may be handled in separate PRs rather than the same PR that updates the diamond configuration files.
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 782
File: script/deploy/_targetState.json:143-143
Timestamp: 2024-11-25T06:25:01.232Z
Learning: Contracts like `OpBNBBridgeFacet` may be in development and only available in feature branches, resulting in missing source files in the main branch. Before flagging such missing contracts, check for open PRs that might include them.
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1256
File: deployments/zksync.diamond.json:81-87
Timestamp: 2025-07-04T08:59:08.108Z
Learning: When analyzing deployment PRs in the lifinance/contracts repository, carefully verify that target state configuration files (like script/deploy/_targetState.json) have been updated before flagging missing entries. The AI summary section should be consulted to understand all file changes, as manual searches might miss entries due to formatting differences or search limitations.
Learnt from: mirooon
Repo: lifinance/contracts PR: 1283
File: deployments/ronin.diamond.json:65-68
Timestamp: 2025-08-07T10:20:01.383Z
Learning: When analyzing deployment PRs in the lifinance/contracts repository, carefully verify that target state configuration files (like script/deploy/_targetState.json) and deployment log files have been updated before flagging missing entries. The AI summary section should be consulted to understand all file changes, as manual searches might miss entries due to formatting differences or search limitations.
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1109
File: deployments/worldchain.json:28-28
Timestamp: 2025-04-21T03:17:53.443Z
Learning: For deployment PRs involving address updates like the RelayFacet to Worldchain, verify the actual presence of entries in files before reporting issues. The RelayFacet exists in the diamond log file and the PR diff already contains the necessary address change.
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1334
File: deployments/mainnet.json:54-54
Timestamp: 2025-08-26T02:20:52.515Z
Learning: For deployment PRs in the lifinance/contracts repository, carefully verify the specific scope mentioned in the PR title and description before suggesting updates to other networks. Not all deployments are cross-network updates - some are targeted to specific chains only.
Learnt from: mirooon
Repo: lifinance/contracts PR: 1328
File: src/Periphery/Lda/Facets/UniV2StyleFacet.sol:0-0
Timestamp: 2025-08-27T13:47:28.646Z
Learning: In src/Periphery/Lda/Facets/UniV2StyleFacet.sol and similar LDA facets, mirooon prefers to rely on backend validation for pool addresses rather than adding contract code-size checks in the smart contract, as pool validation occurs during payload generation and transactions would fail anyway if sent to invalid addresses.
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 782
File: script/deploy/_targetState.json:49-49
Timestamp: 2024-11-25T09:05:03.917Z
Learning: The `RelayFacet` contract, when missing from the source code but referenced in deployment configurations, should be treated the same way as `OpBNBBridgeFacet` and can be ignored in code reviews.
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1109
File: deployments/worldchain.json:28-28
Timestamp: 2025-04-21T03:17:53.443Z
Learning: For deployment PRs updating contract addresses (like RelayFacet on Worldchain), verify the presence of entries in all relevant files (worldchain.json, worldchain.diamond.json, _deployments_log_file.json) before reporting inconsistencies. The RelayFacet entry exists in all required deployment files with the correct address.
Learnt from: ezynda3
Repo: lifinance/contracts PR: 1124
File: script/demoScripts/utils/lib/cowShedSdk.ts:0-0
Timestamp: 2025-06-05T14:50:17.275Z
Learning: For demo scripts and example code, ezynda3 prefers to keep the code simple and focused on demonstrating the core functionality rather than adding extensive input validation or defensive programming measures.
📚 Learning: 2024-10-31T09:09:38.568Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 843
File: src/Facets/RelayFacet.sol:165-170
Timestamp: 2024-10-31T09:09:38.568Z
Learning: In the `RelayFacet` contract (`src/Facets/RelayFacet.sol`), within the `_startBridge` function, low-level `call` is intentionally used to transfer tokens so that extra bytes can be added to the calldata, as required for integrating with Relay Protocol.

Applied to files:

  • docs/GlacisFacet.md
  • src/Facets/GlacisFacet.sol
  • src/Interfaces/IGlacisAirlift.sol
  • script/demoScripts/demoGlacis.ts
  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-09-22T00:52:26.172Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1388
File: deployments/hyperevm.diamond.json:72-75
Timestamp: 2025-09-22T00:52:26.172Z
Learning: In diamond configuration files (deployments/*.diamond.json), it's acceptable to have multiple versions of the same facet (e.g., GlacisFacet v1.0.0 and v1.1.0) deployed at different contract addresses. This is intentional design for version coexistence, gradual migration, or backward compatibility purposes.

Applied to files:

  • docs/GlacisFacet.md
📚 Learning: 2025-01-28T11:28:16.225Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 945
File: src/Facets/GlacisFacet.sol:1-3
Timestamp: 2025-01-28T11:28:16.225Z
Learning: The GlacisFacet contract audit will be conducted and added to the audit log in later stages of development. This is acceptable during the initial development phase.

Applied to files:

  • docs/GlacisFacet.md
  • src/Facets/GlacisFacet.sol
  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-08-27T23:36:40.773Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1328
File: test/solidity/Periphery/GasZipPeriphery.t.sol:223-233
Timestamp: 2025-08-27T23:36:40.773Z
Learning: In bridge facet swap flows with requiresDeposit=false, tokens are already held by the diamond contract from previous swaps. When subsequent contracts like GasZipPeriphery call LibAsset.depositAsset, they pull tokens from msg.sender (the diamond) to themselves via transferFrom, requiring no additional approvals since the diamond already owns the tokens.

Applied to files:

  • docs/GlacisFacet.md
  • src/Facets/GlacisFacet.sol
  • src/Interfaces/IGlacisAirlift.sol
  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-10-10T10:56:04.861Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1413
File: src/Facets/EverclearFacet.sol:4-13
Timestamp: 2025-10-10T10:56:04.861Z
Learning: LibAllowList is only required for facets that make arbitrary external calls to DEX aggregators (e.g., GenericSwapFacetV3). Bridge facets that call specific protocol contracts (like EverclearFacet calling IEverclearFeeAdapter) do not need to import LibAllowList.

Applied to files:

  • docs/GlacisFacet.md
  • src/Facets/GlacisFacet.sol
  • src/Interfaces/IGlacisAirlift.sol
📚 Learning: 2025-01-22T12:36:12.699Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 945
File: test/solidity/Facets/GlacisFacet.t.sol:214-262
Timestamp: 2025-01-22T12:36:12.699Z
Learning: The GlacisFacet test suite inherits from TestBaseFacet which already covers various failure scenarios including invalid receiver address, invalid amounts, same chain bridging, and insufficient funds, making additional failure scenario tests redundant.

Applied to files:

  • docs/GlacisFacet.md
  • src/Facets/GlacisFacet.sol
  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2024-11-25T09:04:55.880Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 782
File: script/deploy/_targetState.json:143-143
Timestamp: 2024-11-25T09:04:55.880Z
Learning: Errors about the missing `OpBNBBridgeFacet` contract are expected when it is referenced in the target state but not yet merged into the main branch.

Applied to files:

  • docs/GlacisFacet.md
  • src/Interfaces/IGlacisAirlift.sol
  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-07-16T01:03:08.106Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1275
File: src/Facets/AllBridgeFacet.sol:164-164
Timestamp: 2025-07-16T01:03:08.106Z
Learning: In src/Facets/AllBridgeFacet.sol, the team has decided that explicit validation for address downcasting from `_bridgeData.sendingAssetId` to `bytes32(uint256(uint160(_bridgeData.sendingAssetId)))` is not required, accepting the potential risk of silent overflow from unsafe downcasting.

Applied to files:

  • docs/GlacisFacet.md
  • src/Facets/GlacisFacet.sol
  • src/Interfaces/IGlacisAirlift.sol
  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-08-27T13:07:58.254Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1328
File: src/Periphery/Lda/Facets/CurveFacet.sol:0-0
Timestamp: 2025-08-27T13:07:58.254Z
Learning: The CurveFacet in src/Periphery/Lda/Facets/CurveFacet.sol has fundamental issues: it imports a non-existent ICurveLegacy interface, and attempts to send ETH to non-payable exchange functions in both ICurve and ICurveV2 interfaces. All current Curve interfaces are non-payable and cannot accept native ETH.

Applied to files:

  • docs/GlacisFacet.md
  • src/Facets/GlacisFacet.sol
📚 Learning: 2025-09-16T07:56:45.093Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 1324
File: test/solidity/Facets/EcoFacet.t.sol:135-141
Timestamp: 2025-09-16T07:56:45.093Z
Learning: In EcoFacet test setup, the isNative parameter in swap-and-bridge flows refers to the bridge token type (output), not the swap input type. The ERC20 branch (isNative=false) can still swap from native ETH to ERC20 tokens, requiring msg.value = swapData[0].fromAmount for the ETH input to the swap.

Applied to files:

  • docs/GlacisFacet.md
  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-02-13T08:57:00.095Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 984
File: docs/ChainflipFacet.md:0-0
Timestamp: 2025-02-13T08:57:00.095Z
Learning: The ChainflipData struct in ChainflipFacet has three fields:
1. uint32 dstToken - The destination token identifier in Chainflip
2. bytes32 nonEvmAddress - The non-EVM destination address
3. bytes cfParameters - Additional parameters for Chainflip protocol

Applied to files:

  • docs/GlacisFacet.md
  • src/Facets/GlacisFacet.sol
  • src/Interfaces/IGlacisAirlift.sol
  • script/demoScripts/demoGlacis.ts
  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-07-16T01:04:11.083Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1275
File: src/Facets/AllBridgeFacet.sol:175-175
Timestamp: 2025-07-16T01:04:11.083Z
Learning: In AllBridgeFacet.sol, zero fee validation is not required at the contract level because the backend system ensures that calldata and msg.value are properly aligned before transactions reach the contract.

Applied to files:

  • docs/GlacisFacet.md
  • src/Interfaces/IGlacisAirlift.sol
📚 Learning: 2025-08-29T10:02:09.041Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1299
File: src/Facets/AcrossFacetPackedV4.sol:118-136
Timestamp: 2025-08-29T10:02:09.041Z
Learning: In AcrossFacetPackedV4.sol, the team explicitly chooses to omit calldata length validation in gas-optimized packed functions like startBridgeTokensViaAcrossV4NativePacked to save gas, accepting the trade-off of potential out-of-bounds reverts for better gas efficiency.

Applied to files:

  • docs/GlacisFacet.md
  • src/Interfaces/IGlacisAirlift.sol
  • script/demoScripts/demoGlacis.ts
  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-08-29T11:07:57.743Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1328
File: src/Periphery/LDA/Facets/CurveFacet.sol:87-91
Timestamp: 2025-08-29T11:07:57.743Z
Learning: In src/Periphery/LDA/Facets/CurveFacet.sol, modern Curve pools (isV2=true, representing V2/NG pools) should reject native tokenIn by adding an early revert check when LibAsset.isNativeAsset(tokenIn) is true, since ICurveV2 exchange functions are non-payable and cannot accept native ETH.

Applied to files:

  • src/Facets/GlacisFacet.sol
  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-06-13T08:30:26.220Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1207
File: deployments/_deployments_log_file.json:34037-34080
Timestamp: 2025-06-13T08:30:26.220Z
Learning: LiFiDiamond contains generic withdrawal logic, so individual facet contracts (e.g., PioneerFacet) do not need their own Ether-withdraw functions.

Applied to files:

  • src/Facets/GlacisFacet.sol
📚 Learning: 2025-08-27T13:07:58.254Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1328
File: src/Periphery/Lda/Facets/CurveFacet.sol:0-0
Timestamp: 2025-08-27T13:07:58.254Z
Learning: The CurveFacet implementation is fundamentally broken: ICurveLegacy interface doesn't exist in the codebase but is imported and used, and the code attempts to send ETH to non-payable exchange functions. The entire native asset handling logic needs to be redesigned.

Applied to files:

  • src/Facets/GlacisFacet.sol
📚 Learning: 2025-10-02T18:10:09.934Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1406
File: src/Facets/UnitFacet.sol:75-81
Timestamp: 2025-10-02T18:10:09.934Z
Learning: In UnitFacet.sol and similar facet contracts in src/Facets/, the LiFiTransferStarted event emission should ALWAYS be at the end of the _startBridge internal function, after all validations and asset transfers have been completed successfully.

Applied to files:

  • src/Facets/GlacisFacet.sol
📚 Learning: 2025-04-28T07:46:24.084Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 1116
File: src/Libraries/LibAsset.sol:102-108
Timestamp: 2025-04-28T07:46:24.084Z
Learning: In the LiFi contracts, the `LibAsset.transferFromERC20` function is intentionally designed to accept arbitrary `from` parameters, with security ensured through a whitelist mechanism that controls which contracts can call this function.

Applied to files:

  • src/Facets/GlacisFacet.sol
📚 Learning: 2025-02-11T10:35:03.536Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 988
File: script/tasks/solidity/AddTokenApprovalsToCBridgeFacetPacked.s.sol:17-21
Timestamp: 2025-02-11T10:35:03.536Z
Learning: The CBridgeFacetPacked and cBridge addresses in AddTokenApprovalsToCBridgeFacetPacked.s.sol must not be zero addresses as they are required for token approvals to function properly.

Applied to files:

  • src/Interfaces/IGlacisAirlift.sol
  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2024-11-22T08:49:35.205Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 827
File: src/Facets/DeBridgeDlnFacet.sol:0-0
Timestamp: 2024-11-22T08:49:35.205Z
Learning: In `DeBridgeDlnFacet.sol`, direct access to the `deBridgeChainId` mapping is acceptable, and using the `getDeBridgeChainId` function is not necessary in these instances.

Applied to files:

  • src/Interfaces/IGlacisAirlift.sol
📚 Learning: 2025-07-17T04:21:55.549Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1266
File: script/deploy/safe/execute-pending-timelock-tx.ts:334-334
Timestamp: 2025-07-17T04:21:55.549Z
Learning: In the lifinance/contracts repository, 0xDEnYO prefers to keep private key processing simple in scripts like execute-pending-timelock-tx.ts without adding format validation, prioritizing code simplicity over strict validation in controlled environments.

Applied to files:

  • script/demoScripts/demoGlacis.ts
📚 Learning: 2025-09-25T00:12:58.536Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1395
File: src/Periphery/FeeForwarder.sol:78-120
Timestamp: 2025-09-25T00:12:58.536Z
Learning: In src/Periphery/FeeForwarder.sol, the team intentionally uses address(this).balance for refunding remaining native tokens because the contract is designed to never hold funds and not collect dust, making it safe to return the entire balance to the caller.

Applied to files:

  • script/demoScripts/demoGlacis.ts
  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-02-21T09:05:22.118Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 984
File: test/solidity/Facets/ChainflipFacet.t.sol:269-269
Timestamp: 2025-02-21T09:05:22.118Z
Learning: Fixed gas amounts in test files (e.g., ChainflipFacet.t.sol) don't require extensive documentation or configuration as they are only used for testing purposes.

Applied to files:

  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-08-29T11:12:02.184Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1328
File: src/Periphery/LDA/Facets/SyncSwapV2Facet.sol:33-38
Timestamp: 2025-08-29T11:12:02.184Z
Learning: In LDA facets (src/Periphery/Lda/Facets/**/*.sol), tokenIn parameter validation (checking for address(0)) is intentionally not performed as part of the design architecture.

Applied to files:

  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-04-21T03:17:53.443Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1109
File: deployments/worldchain.json:28-28
Timestamp: 2025-04-21T03:17:53.443Z
Learning: For deployment PRs involving address updates like the RelayFacet to Worldchain, verify the actual presence of entries in files before reporting issues. The RelayFacet exists in the diamond log file and the PR diff already contains the necessary address change.

Applied to files:

  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-01-28T11:29:09.566Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 945
File: test/solidity/Facets/GlacisFacet.t.sol:0-0
Timestamp: 2025-01-28T11:29:09.566Z
Learning: Empty test methods with explanatory comments are acceptable in test classes when the feature being tested (e.g., native token bridging) is not supported by the implementation.

Applied to files:

  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-08-29T11:53:38.549Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1328
File: test/solidity/Periphery/LDA/BaseCoreRouteTest.t.sol:379-388
Timestamp: 2025-08-29T11:53:38.549Z
Learning: In test/solidity/Periphery/LDA/BaseCoreRouteTest.t.sol, for the revert-testing helper function _executeAndVerifySwap, only the aggregator branch (CommandType.DistributeSelfERC20) should use amountIn-1 to underfund and trigger insufficient balance errors, while user-funded branches should use the full amountIn to test other error conditions.

Applied to files:

  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2024-10-22T03:24:24.705Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 807
File: test/solidity/Facets/GasZipFacet.t.sol:337-339
Timestamp: 2024-10-22T03:24:24.705Z
Learning: In `GasZipFacet` tests, when expecting a failure due to insufficient balance for sending value, the test should expect a generic revert without specifying a specific error.

Applied to files:

  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-01-22T12:38:37.557Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 945
File: test/solidity/utils/TestBase.sol:446-470
Timestamp: 2025-01-22T12:38:37.557Z
Learning: Test utility functions in TestBase.sol don't require production-level validations like slippage checks and input validation since they operate in a controlled test environment.

Applied to files:

  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-08-20T09:56:24.259Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1327
File: docs/OutputValidator.md:23-29
Timestamp: 2025-08-20T09:56:24.259Z
Learning: In src/Periphery/OutputValidator.sol, the ERC20 token flow that uses balanceOf(msg.sender) to compute actualAmount and transfers the excess via safeTransferFrom is intentional behavior, as confirmed by 0xDEnYO. The design choice to potentially include pre-existing ERC20 balances in the excess calculation is by design and should not be flagged as a security concern in future reviews.

Applied to files:

  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-09-19T14:10:55.064Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 1324
File: src/Facets/EcoFacet.sol:68-71
Timestamp: 2025-09-19T14:10:55.064Z
Learning: In src/Facets/EcoFacet.sol, the team prefers to use msg.sender as the refund address for native tokens in the refundExcessNative modifier, contrary to the general guideline of requiring explicit refund parameters.

Applied to files:

  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-08-27T22:23:51.257Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1328
File: src/Periphery/Lda/Facets/NativeWrapperFacet.sol:0-0
Timestamp: 2025-08-27T22:23:51.257Z
Learning: In src/Periphery/Lda/Facets/NativeWrapperFacet.sol, the wrapNative function should not validate msg.value == amountIn because CoreRouteFacet's DistributeNative command (command type 3) overrides the amountIn parameter with address(this).balance, making such validation incorrect and causing false failures.

Applied to files:

  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-10-13T11:13:48.847Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1413
File: src/Facets/EverclearV2Facet.sol:75-96
Timestamp: 2025-10-13T11:13:48.847Z
Learning: In EverclearV2Facet (and all LiFi facets), the team standard is to use msg.sender as the refund address with the refundExcessNative modifier, not requiring an explicit refund address parameter.

Applied to files:

  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-07-11T09:43:22.393Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1193
File: test/solidity/Facets/AllowListMigratorFacet.t.sol:39-52
Timestamp: 2025-07-11T09:43:22.393Z
Learning: For fork-based tests like AllowListMigratorFacet.t.sol that work with existing deployed contracts (mainnet diamond), initTestBase() is intentionally omitted since the standard test initialization is not needed.

Applied to files:

  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-04-04T07:21:52.878Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1086
File: test/solidity/utils/TestBase.sol:195-205
Timestamp: 2025-04-04T07:21:52.878Z
Learning: In the TestBase.sol file, the Optimism network constants are set correctly with:
- ADDRESS_UNISWAP_OPTIMISM: 0x4A7b5Da61326A6379179b40d00F57E5bbDC962c2 (Uniswap V2 Router)
- ADDRESS_USDC_OPTIMISM: 0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85 (Native USDC)
- USDC.e (bridged USDC from Ethereum) on Optimism has address 0x7f5c764cbc14f9669b88837ca1490cca17c31607

Applied to files:

  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-05-06T09:09:38.108Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1117
File: test/solidity/Periphery/LiFiDEXAggregator.t.sol:111-127
Timestamp: 2025-05-06T09:09:38.108Z
Learning: The `setupApechain()` function in LiFiDEXAggregator tests intentionally avoids calling `initTestBase()` to prevent needing to define standard contracts (like ADDRESS_USDC_PROXY and Uniswap) that aren't needed for Apechain-specific tests.

Applied to files:

  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-08-28T02:41:07.505Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1321
File: docs/RelayDepositoryFacet.md:9-10
Timestamp: 2025-08-28T02:41:07.505Z
Learning: Unit tests for RelayDepositoryFacet cannot verify fund forwarding behavior after deposits because the facet delegates to external IRelayDepository contracts. The forwarding logic is implemented in the Relay Protocol V2 Depository contracts, not in the facet itself.

Applied to files:

  • test/solidity/Facets/GlacisFacet.t.sol
📚 Learning: 2025-06-15T08:47:22.079Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1208
File: test/solidity/utils/TestAMM.sol:18-22
Timestamp: 2025-06-15T08:47:22.079Z
Learning: For test contracts in the lifinance/contracts repository, simpler error handling approaches are acceptable and preferred over more complex error bubbling mechanisms, as the focus is on functionality rather than detailed error reporting.

Applied to files:

  • test/solidity/Facets/GlacisFacet.t.sol
🪛 Gitleaks (8.28.0)
test/solidity/Facets/GlacisFacet.t.sol

[high] 774-774: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


[high] 775-775: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


[high] 793-793: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


[high] 794-794: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

⏰ 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). (2)
  • GitHub Check: run-unit-tests
  • GitHub Check: enforce-min-test-coverage
🔇 Additional comments (11)
docs/GlacisFacet.md (1)

3-88: LGTM! Comprehensive documentation for the multibridge routing feature.

The documentation clearly explains:

  • Version information and compatibility
  • The new outputToken parameter and its behavior
  • Default routing vs. specific token routing with concrete examples
  • Breaking change notice with migration guidance

This will help integrators understand and adopt the new functionality.

src/Facets/GlacisFacet.sol (2)

35-41: LGTM! Struct extension is clean and well-documented.

The new outputToken field is properly documented, and the bytes32 type is appropriate for representing either an address (padded) or the zero value for default routing.


155-168: LGTM! AIRLIFT integration correctly updated.

The 6-parameter send() call properly includes the new outputToken parameter, and the comments clearly explain the routing behavior. Event emission follows the team standard of emitting LiFiTransferStarted at the end of the _startBridge function.

script/demoScripts/demoGlacis.ts (1)

44-46: LGTM! Demo script properly reflects the new API.

The script correctly demonstrates:

  • Using bytes32(0) for default routing in both quoteSend and GlacisData
  • Extended function signature in the calldata output
  • Debug logging for the new parameter

This will help developers understand how to use the multibridge routing feature.

Also applies to: 137-137, 183-183, 220-224, 248-248

test/solidity/Facets/GlacisFacet.t.sol (3)

12-15: LGTM! Test infrastructure properly extended for multibridge routing.

The test base correctly:

  • Documents the new multibridge routing capability
  • Adds outputToken as an address field for test configuration
  • Converts it to bytes32 in GlacisData initialization with proper default handling

The conversion logic outputToken == address(0) ? bytes32(0) : bytes32(uint256(uint160(outputToken))) correctly handles both default routing and specific token scenarios.

Also applies to: 30-30, 139-146


43-60: LGTM! Enhanced test setup for multibridge scenarios.

The setUp now properly funds the diamond and relevant addresses with both tokens and native currency to support multibridge routing tests.


765-801: LGTM! Test configurations for multibridge tokens.

The test contracts for OpenUSDT and USDT0 properly configure:

  • Optimism fork with specific block number for consistency
  • Correct Airlift contract address
  • Source and output token addresses for multibridge routing
  • Destination chain (Unichain)
  • Appropriate fuzzing ranges (1 to 10,000)

Note: The static analysis warnings about "API keys" on lines 774, 775, 793, 794 are false positives—these are legitimate Ethereum contract addresses.

src/Interfaces/IGlacisAirlift.sol (4)

2-2: LGTM! Version bump to 1.1.0 is appropriate.

The minor version increment correctly reflects the addition of new function overloads and data structures.


23-36: LGTM! New data structures support routing functionality.

The TokenFacetConfig and BridgeRoute structs provide the necessary infrastructure for multibridge routing:

  • TokenFacetConfig: Maps entry points and bridge keys to facet configurations
  • BridgeRoute: Defines routing parameters including destination chain, output token, and bridge selection

48-72: LGTM! Function overloads maintain interface compatibility.

The interface extension strategy is sound:

  • Existing send() signature updated to return bytes memory (line 54)
  • New send() overload adds outputToken parameter (lines 65-72)
  • Documentation clearly explains the routing behavior
  • Overload pattern allows callers to choose based on their routing needs

82-108: LGTM! quoteSend overload properly extends the quoting API.

The new quoteSend() overload (lines 100-108) correctly mirrors the send() extension by adding the outputToken parameter, enabling fee estimation for specific routing scenarios. Documentation is clear.

@ezynda3 ezynda3 marked this pull request as ready for review November 10, 2025 14:14
@lifi-action-bot lifi-action-bot marked this pull request as draft November 10, 2025 14:14
@ezynda3 ezynda3 marked this pull request as ready for review November 10, 2025 14:15
@lifi-action-bot lifi-action-bot marked this pull request as draft November 10, 2025 14:15
@lifi-action-bot
Copy link
Collaborator

lifi-action-bot commented Nov 10, 2025

Test Coverage Report

Line Coverage: 85.46% (2828 / 3309 lines)
Function Coverage: 89.08% ( 457 / 513 functions)
Branch Coverage: 63.14% ( 442 / 700 branches)
Test coverage (85.46%) is above min threshold (83%). Check passed.

@ezynda3 ezynda3 marked this pull request as ready for review November 10, 2025 15:12
@lifi-action-bot lifi-action-bot marked this pull request as draft November 10, 2025 15:12
@ezynda3 ezynda3 marked this pull request as ready for review November 11, 2025 12:15
@lifi-action-bot lifi-action-bot marked this pull request as draft November 11, 2025 12:15
@lifinance lifinance deleted a comment from lifi-action-bot Nov 11, 2025
@ezynda3 ezynda3 marked this pull request as ready for review November 11, 2025 12:22
@lifi-action-bot
Copy link
Collaborator

lifi-action-bot commented Nov 11, 2025

🤖 GitHub Action: Security Alerts Review 🔍

🟢 Dismissed Security Alerts with Comments
The following alerts were dismissed with proper comments:

🟢 View Alert - File: src/Facets/GlacisFacet.sol
🔹 External calls to functions with dynamic return types may possibly run out of gas if calling a malicious function. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/external-call-potential-out-of-gas
🔹 Dismiss Reason: Won't fix
🔹 Dismiss Comment: Not an issue

🟢 View Alert - File: src/Facets/GlacisFacet.sol
🔹 Calling a function without checking the return value may lead to silent failures. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unused-return-function-call
🔹 Dismiss Reason: Won't fix
🔹 Dismiss Comment: Not an issue

🟢 View Alert - File: src/Facets/GlacisFacet.sol
🔹 Reentrant functions which emit events after making an external call may lead to out-of-order events. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/reentrancy-events
🔹 Dismiss Reason: Won't fix
🔹 Dismiss Comment: Not an issue

🟢 View Alert - File: src/Facets/GlacisFacet.sol
🔹 Using send() without checking the return value may lead to silent failures of ether transmittal. For more information, visit: http://detectors.olympixdevsectools.com/article/web3-vulnerability/unchecked-send
🔹 Dismiss Reason: False positive
🔹 Dismiss Comment: this is a custom "send" function

No unresolved security alerts! 🎉

@lifi-action-bot lifi-action-bot marked this pull request as draft November 11, 2025 12:22
@ezynda3 ezynda3 marked this pull request as ready for review November 11, 2025 12:24
@lifi-action-bot lifi-action-bot marked this pull request as draft November 11, 2025 12:24
@ezynda3 ezynda3 marked this pull request as ready for review November 11, 2025 12:24
@lifi-action-bot lifi-action-bot marked this pull request as draft November 11, 2025 12:25
@ezynda3 ezynda3 marked this pull request as ready for review November 11, 2025 12:27
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
docs/GlacisFacet.md (1)

61-70: Simplify the address-to-bytes32 casting pattern in examples.

The current casting pattern bytes32(uint160(uint256(...))) is unnecessarily complex and may confuse integrators. Consider simplifying the examples:

For the clearest documentation, use one of these approaches:

Option 1: Use address variables (recommended for clarity):

// Default routing - let Glacis choose the best route
glacisData.outputToken = bytes32(0);

// Specific USDC routing on destination chain
address usdcAddress = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
glacisData.outputToken = bytes32(uint256(uint160(usdcAddress)));

// Specific USDT routing (multibridge scenario)
address usdtAddress = 0xdAC17F958D2ee523a2206206994597C13D831ec7;
glacisData.outputToken = bytes32(uint256(uint160(usdtAddress)));

Option 2: Simplified literal casting:

// Specific USDC routing on destination chain
glacisData.outputToken = bytes32(uint256(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48));

The current triple-cast pattern works correctly but adds unnecessary cognitive overhead for documentation readers.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 13c4296 and 0b0d69c.

📒 Files selected for processing (2)
  • docs/GlacisFacet.md (3 hunks)
  • src/Interfaces/IGlacisAirlift.sol (3 hunks)
🧰 Additional context used
🧠 Learnings (16)
📓 Common learnings
Learnt from: mirooon
Repo: lifinance/contracts PR: 945
File: src/Facets/GlacisFacet.sol:1-3
Timestamp: 2025-01-28T11:28:16.225Z
Learning: The GlacisFacet contract audit will be conducted and added to the audit log in later stages of development. This is acceptable during the initial development phase.
Learnt from: mirooon
Repo: lifinance/contracts PR: 1283
File: deployments/ronin.diamond.json:65-68
Timestamp: 2025-08-07T10:20:01.383Z
Learning: When analyzing deployment PRs in the lifinance/contracts repository, carefully verify that target state configuration files (like script/deploy/_targetState.json) and deployment log files have been updated before flagging missing entries. The AI summary section should be consulted to understand all file changes, as manual searches might miss entries due to formatting differences or search limitations.
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1256
File: deployments/zksync.diamond.json:81-87
Timestamp: 2025-07-04T08:59:08.108Z
Learning: When analyzing deployment PRs in the lifinance/contracts repository, carefully verify that target state configuration files (like script/deploy/_targetState.json) have been updated before flagging missing entries. The AI summary section should be consulted to understand all file changes, as manual searches might miss entries due to formatting differences or search limitations.
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1334
File: deployments/mainnet.json:54-54
Timestamp: 2025-08-26T02:20:52.515Z
Learning: For deployment PRs in the lifinance/contracts repository, carefully verify the specific scope mentioned in the PR title and description before suggesting updates to other networks. Not all deployments are cross-network updates - some are targeted to specific chains only.
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1357
File: deployments/lens.diamond.json:48-51
Timestamp: 2025-09-09T10:39:26.383Z
Learning: In the lifinance/contracts repository, when deployment JSON files show address changes (like AcrossFacetV3 address updates in deployments/*.diamond.json), the corresponding _deployments_log_file.json updates may be handled in separate PRs rather than the same PR that updates the diamond configuration files.
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1109
File: deployments/worldchain.json:28-28
Timestamp: 2025-04-21T03:17:53.443Z
Learning: For deployment PRs involving address updates like the RelayFacet to Worldchain, verify the actual presence of entries in files before reporting issues. The RelayFacet exists in the diamond log file and the PR diff already contains the necessary address change.
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 782
File: script/deploy/_targetState.json:49-49
Timestamp: 2024-11-25T09:05:03.917Z
Learning: The `RelayFacet` contract, when missing from the source code but referenced in deployment configurations, should be treated the same way as `OpBNBBridgeFacet` and can be ignored in code reviews.
Learnt from: ezynda3
Repo: lifinance/contracts PR: 1124
File: script/demoScripts/utils/lib/cowShedSdk.ts:0-0
Timestamp: 2025-06-05T14:50:17.275Z
Learning: For demo scripts and example code, ezynda3 prefers to keep the code simple and focused on demonstrating the core functionality rather than adding extensive input validation or defensive programming measures.
📚 Learning: 2024-10-31T09:09:38.568Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 843
File: src/Facets/RelayFacet.sol:165-170
Timestamp: 2024-10-31T09:09:38.568Z
Learning: In the `RelayFacet` contract (`src/Facets/RelayFacet.sol`), within the `_startBridge` function, low-level `call` is intentionally used to transfer tokens so that extra bytes can be added to the calldata, as required for integrating with Relay Protocol.

Applied to files:

  • docs/GlacisFacet.md
📚 Learning: 2025-09-22T00:52:26.172Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1388
File: deployments/hyperevm.diamond.json:72-75
Timestamp: 2025-09-22T00:52:26.172Z
Learning: In diamond configuration files (deployments/*.diamond.json), it's acceptable to have multiple versions of the same facet (e.g., GlacisFacet v1.0.0 and v1.1.0) deployed at different contract addresses. This is intentional design for version coexistence, gradual migration, or backward compatibility purposes.

Applied to files:

  • docs/GlacisFacet.md
📚 Learning: 2025-01-28T11:28:16.225Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 945
File: src/Facets/GlacisFacet.sol:1-3
Timestamp: 2025-01-28T11:28:16.225Z
Learning: The GlacisFacet contract audit will be conducted and added to the audit log in later stages of development. This is acceptable during the initial development phase.

Applied to files:

  • docs/GlacisFacet.md
📚 Learning: 2025-08-27T23:36:40.773Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1328
File: test/solidity/Periphery/GasZipPeriphery.t.sol:223-233
Timestamp: 2025-08-27T23:36:40.773Z
Learning: In bridge facet swap flows with requiresDeposit=false, tokens are already held by the diamond contract from previous swaps. When subsequent contracts like GasZipPeriphery call LibAsset.depositAsset, they pull tokens from msg.sender (the diamond) to themselves via transferFrom, requiring no additional approvals since the diamond already owns the tokens.

Applied to files:

  • docs/GlacisFacet.md
📚 Learning: 2025-10-10T10:56:04.861Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1413
File: src/Facets/EverclearFacet.sol:4-13
Timestamp: 2025-10-10T10:56:04.861Z
Learning: LibAllowList is only required for facets that make arbitrary external calls to DEX aggregators (e.g., GenericSwapFacetV3). Bridge facets that call specific protocol contracts (like EverclearFacet calling IEverclearFeeAdapter) do not need to import LibAllowList.

Applied to files:

  • docs/GlacisFacet.md
📚 Learning: 2025-01-22T12:36:12.699Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 945
File: test/solidity/Facets/GlacisFacet.t.sol:214-262
Timestamp: 2025-01-22T12:36:12.699Z
Learning: The GlacisFacet test suite inherits from TestBaseFacet which already covers various failure scenarios including invalid receiver address, invalid amounts, same chain bridging, and insufficient funds, making additional failure scenario tests redundant.

Applied to files:

  • docs/GlacisFacet.md
📚 Learning: 2024-11-25T09:04:55.880Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 782
File: script/deploy/_targetState.json:143-143
Timestamp: 2024-11-25T09:04:55.880Z
Learning: Errors about the missing `OpBNBBridgeFacet` contract are expected when it is referenced in the target state but not yet merged into the main branch.

Applied to files:

  • docs/GlacisFacet.md
📚 Learning: 2025-07-16T01:03:08.106Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1275
File: src/Facets/AllBridgeFacet.sol:164-164
Timestamp: 2025-07-16T01:03:08.106Z
Learning: In src/Facets/AllBridgeFacet.sol, the team has decided that explicit validation for address downcasting from `_bridgeData.sendingAssetId` to `bytes32(uint256(uint160(_bridgeData.sendingAssetId)))` is not required, accepting the potential risk of silent overflow from unsafe downcasting.

Applied to files:

  • docs/GlacisFacet.md
📚 Learning: 2025-08-27T13:07:58.254Z
Learnt from: mirooon
Repo: lifinance/contracts PR: 1328
File: src/Periphery/Lda/Facets/CurveFacet.sol:0-0
Timestamp: 2025-08-27T13:07:58.254Z
Learning: The CurveFacet in src/Periphery/Lda/Facets/CurveFacet.sol has fundamental issues: it imports a non-existent ICurveLegacy interface, and attempts to send ETH to non-payable exchange functions in both ICurve and ICurveV2 interfaces. All current Curve interfaces are non-payable and cannot accept native ETH.

Applied to files:

  • docs/GlacisFacet.md
📚 Learning: 2025-09-16T07:56:45.093Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 1324
File: test/solidity/Facets/EcoFacet.t.sol:135-141
Timestamp: 2025-09-16T07:56:45.093Z
Learning: In EcoFacet test setup, the isNative parameter in swap-and-bridge flows refers to the bridge token type (output), not the swap input type. The ERC20 branch (isNative=false) can still swap from native ETH to ERC20 tokens, requiring msg.value = swapData[0].fromAmount for the ETH input to the swap.

Applied to files:

  • docs/GlacisFacet.md
📚 Learning: 2025-02-13T08:57:00.095Z
Learnt from: ezynda3
Repo: lifinance/contracts PR: 984
File: docs/ChainflipFacet.md:0-0
Timestamp: 2025-02-13T08:57:00.095Z
Learning: The ChainflipData struct in ChainflipFacet has three fields:
1. uint32 dstToken - The destination token identifier in Chainflip
2. bytes32 nonEvmAddress - The non-EVM destination address
3. bytes cfParameters - Additional parameters for Chainflip protocol

Applied to files:

  • docs/GlacisFacet.md
📚 Learning: 2025-11-13T00:53:43.762Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1456
File: src/Facets/PolymerCCTPFacet.sol:220-224
Timestamp: 2025-11-13T00:53:43.762Z
Learning: In src/Facets/PolymerCCTPFacet.sol, the PolymerCCTPFeeSent event intentionally emits _bridgeData.minAmount (the pre-fee total) as its first parameter rather than the net bridged amount (bridgeAmount after fee deduction), because off-chain logic requires this pre-fee value to pick up deposits.

Applied to files:

  • docs/GlacisFacet.md
📚 Learning: 2025-07-16T01:04:11.083Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1275
File: src/Facets/AllBridgeFacet.sol:175-175
Timestamp: 2025-07-16T01:04:11.083Z
Learning: In AllBridgeFacet.sol, zero fee validation is not required at the contract level because the backend system ensures that calldata and msg.value are properly aligned before transactions reach the contract.

Applied to files:

  • docs/GlacisFacet.md
📚 Learning: 2025-08-29T10:02:09.041Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1299
File: src/Facets/AcrossFacetPackedV4.sol:118-136
Timestamp: 2025-08-29T10:02:09.041Z
Learning: In AcrossFacetPackedV4.sol, the team explicitly chooses to omit calldata length validation in gas-optimized packed functions like startBridgeTokensViaAcrossV4NativePacked to save gas, accepting the trade-off of potential out-of-bounds reverts for better gas efficiency.

Applied to files:

  • docs/GlacisFacet.md
📚 Learning: 2025-11-13T00:53:25.365Z
Learnt from: 0xDEnYO
Repo: lifinance/contracts PR: 1456
File: test/solidity/Facets/PolymerCCTPFacet.t.sol:325-333
Timestamp: 2025-11-13T00:53:25.365Z
Learning: In src/Facets/PolymerCCTPFacet.sol, the PolymerCCTPFeeSent event must emit the original bridgeData.minAmount (before polymer fee deduction) as the first parameter, not the net bridge amount, because off-chain logic requires this value to properly pick up and process the deposit.

Applied to files:

  • docs/GlacisFacet.md
⏰ 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). (2)
  • GitHub Check: run-unit-tests
  • GitHub Check: enforce-min-test-coverage
🔇 Additional comments (8)
src/Interfaces/IGlacisAirlift.sol (4)

2-2: LGTM! Appropriate version bump for interface extension.

The minor version bump from 1.0.0 to 1.1.0 correctly follows semantic versioning for backward-compatible additions of new function overloads.


24-39: LGTM! Documentation enhancement and backward compatibility maintained.

The addition of the return value documentation improves clarity, and the original function signature is preserved, ensuring backward compatibility.


41-57: LGTM! Well-designed function overload with clear documentation.

The new send overload correctly extends the interface with the outputToken parameter while maintaining the same return type. Documentation clearly explains the routing behavior and default value.


59-93: LGTM! Complete interface coverage for quote operations.

Both quoteSend overloads are well-documented and maintain consistent return types. The addition of the outputToken parameter in the new overload mirrors the pattern established in the send function, providing a cohesive API design.

docs/GlacisFacet.md (4)

3-6: LGTM! Version information is consistent.

The version numbers correctly reflect the facet upgrade (1.2.0) and interface version (1.1.0), maintaining consistency across the codebase.


8-16: LGTM! Clear explanation of new multibridge routing capabilities.

The documentation effectively communicates the new features enabled by outputToken, including multibridge transfers, HyperLiquid support, and backward compatibility.


31-45: LGTM! Struct documentation is clear and complete.

The GlacisData struct documentation accurately reflects the new outputToken field and clearly explains the default routing behavior with bytes32(0).


86-88: LGTM! Clear and actionable breaking change notice.

The breaking change notice is prominent, clearly explains the impact, and provides specific guidance for maintaining backward compatibility by setting outputToken to bytes32(0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants