Skip to content

feat: support oft tokens with non-zero bridge fees#1227

Merged
grasphoper merged 7 commits intofaisal/perp-destination-dexfrom
if/poc-usdt0-with-fees
Feb 2, 2026
Merged

feat: support oft tokens with non-zero bridge fees#1227
grasphoper merged 7 commits intofaisal/perp-destination-dexfrom
if/poc-usdt0-with-fees

Conversation

@grasphoper
Copy link
Copy Markdown
Collaborator

No description provided.

Signed-off-by: Ihor Farion <ihor@umaproject.org>
Signed-off-by: Ihor Farion <ihor@umaproject.org>
Signed-off-by: Ihor Farion <ihor@umaproject.org>
Signed-off-by: Ihor Farion <ihor@umaproject.org>
Signed-off-by: Ihor Farion <ihor@umaproject.org>
Signed-off-by: Ihor Farion <ihor@umaproject.org>
Signed-off-by: Ihor Farion <ihor@umaproject.org>
@grasphoper grasphoper force-pushed the if/poc-usdt0-with-fees branch from 2f99282 to 92f9e84 Compare December 19, 2025 04:40
@fusmanii fusmanii added need to audit This PR needs to be audited externally before deploying do not merge do not merge labels Jan 6, 2026
@grasphoper grasphoper merged commit ff56359 into faisal/perp-destination-dex Feb 2, 2026
10 checks passed
@grasphoper grasphoper deleted the if/poc-usdt0-with-fees branch February 2, 2026 20:45
fusmanii added a commit that referenced this pull request Feb 3, 2026
* feat: Perp destination dex support

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* depositFor for USDC

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* fixed tests

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* trust api with destination dex

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* set spot as source

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* add helper funcs

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* fixed data indexes

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* updated cctp min msg length

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* updated oft min msg length

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* feat: `HyperCore` account creation from user funds (#1224)

* plan out the code

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* dst side impl

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* remove redundant var

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* add account creation mode to encoded / decoded data

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* fix tests and build

Signed-off-by: Ihor Farion <ihor@umaproject.org>

---------

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* correct read indicies + add test

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* update cctp min msg length

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* updated SponsoredDepositForBurn with new fields

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* remove duplicate  check from 2 places

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* fix params.commonParams.amountInEVM == 0 edge case

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* add return after falling back to EVM flow

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* fix account activation amounts logic for when finalizing the swap flow

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* simplify if conditions

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* fix some problems and introduce a stack-too-deep :)

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* fix stack too deep

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* smh fix

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* improve sweepOnCore and fix transferCoreToCore (#1270)

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* improve: address L-02 & L-03 (#1268)

* add early revert instead of implicit revert

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* adjust test behavior

Signed-off-by: Ihor Farion <ihor@umaproject.org>

---------

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* adjust interfaces and comments (#1269)

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* fix: Address L01 (#1271)

* fix: Address L01

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* refactor: Use toUint256() with casting instead of specialized functions

Replace toUint8FromWord, toUint16FromWord, and toUint32FromWord with
direct casting from toUint256() for a cleaner and more minimal diff.

Co-authored-by: Faisal Usmani <fusmanii@users.noreply.github.com>

---------

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Faisal Usmani <fusmanii@users.noreply.github.com>

* fix: revert on invalid signature in receiveMessage to prevent griefing (#1255)

* fix: revert on invalid signature in receiveMessage to prevent griefing

This fix addresses ACP-27 where an attacker could grief users by
front-running receiveMessage with valid CCTP message/attestation but
an invalid signature. Previously, this would cause the transaction to
succeed with fallback behavior, consuming the CCTP nonce and causing
the user to lose sponsorship and custom EVM actions.

Changes:
- Replace _isQuoteValid() with _validateQuoteOrRevert() that reverts
  with specific errors (InvalidSignature, InvalidNonce, InvalidDeadline)
- Remove conditional fallback logic since validation now reverts
- Update tests to expect reverts instead of fallback behavior
- Add griefing attack prevention tests

Now when an attacker submits an invalid signature, the entire transaction
reverts, preserving the CCTP nonce so the legitimate caller can still
submit with the correct signature.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix comp error

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* remove extra sload

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

---------

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* feat: support oft tokens with non-zero bridge fees (#1227)

* impl

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* fix tests

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* comments

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* interim better

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* almost there

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* better

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* polish to a more auditable state

Signed-off-by: Ihor Farion <ihor@umaproject.org>

---------

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* remove deadline data from oft cross-chain message

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* add maxUserSlippageBps to the signed parameters (#1288)

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* fix createLighterDeposit.s.sol script

Signed-off-by: Ihor Farion <ihor@umaproject.org>

---------

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>
Signed-off-by: Ihor Farion <ihor@umaproject.org>
Co-authored-by: Ihor Farion <65650773+grasphoper@users.noreply.github.com>
Co-authored-by: Ihor Farion <ihor@umaproject.org>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Faisal Usmani <fusmanii@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge do not merge need to audit This PR needs to be audited externally before deploying

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants