Skip to content

feat: audit feb23#1336

Open
grasphoper wants to merge 6 commits intomasterfrom
audit-feb23
Open

feat: audit feb23#1336
grasphoper wants to merge 6 commits intomasterfrom
audit-feb23

Conversation

@grasphoper
Copy link
Contributor

  • Counterfactual deposit addresses

tbwebb22 and others added 4 commits February 23, 2026 01:16
* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* executor address

* EIP-712 for signatures

* tests passing

* remove executor as state variable in factory

* use OZ clones instead of custom proxy

* cleanup

* Deposit to CCTPSrcPeriphery instead of SpokePool

* rename immutables struct

* only store hash of immutables

* clean up withdraw functions

* add execution fee

* refactor & add OFT/Spoke implementations

* make refund recipient an immutable

* add base abstract contract & correct spoke pool max fee calc

* clean up SpokePool implementation

* polish

* add comments

* exclude counterfactual contracts from hardhat compilation

* more cleanup

* undo hardhat exclusion change

* clean up readme

* user and admin withdraw addresses as address rather than bytes32

* remove unneeded balance check reverts

* only pass in hash of params to deploy functions

* remove try/catch in factory

* rename PRECISION_SCALAR to PRICE_SCALAR

* update readme

* update readme

* change OFT token from bytes32 to address

* make exclusiveRelayer and exclusivityDeadline signed calldata

* rename price to stableExchangeRate

* split immutables structs into separate deposit & execution structs

* make verifyParams a modifier

* make quoteTimestamp signed

* make depositExecution events more descriptive

* add native asset support

* update imports

* add signature deadline

* add counterfactual contracts to hardhat test compilation exclusion

* add comments for caller passing msg.value for LZ fee

* make SpokePool maxFee have fixed and bps components

* make DepositExecuted events separate per implementation

* add deployAndExecuteIfNeeded function to factory

* add AdminWithdrawManager and cleanup withdraw functions & param hash verification

---------

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
Co-authored-by: Matt Rice <matthewcrice32@gmail.com>
…ctual deposits (#1331)

* replace params-hash dispatcher with merkle-dispatched counterfactual deposits

Single dispatcher contract stores a merkle root as its immutable arg. Each
leaf is (implementation, keccak256(params)). Callers prove leaf inclusion
via merkle proof, then the dispatcher delegatecalls the implementation.
Withdrawals become a standard implementation (WithdrawImplementation) rather
than baked-in base logic, enabling one deposit address to support multiple
possible actions.

- Add CounterfactualDeposit dispatcher and ICounterfactualImplementation
- Add WithdrawImplementation with authorized caller + forced recipient
- Adapt SpokePool, CCTP, OFT implementations to ICounterfactualImplementation
- Adapt AdminWithdrawManager for merkle-based withdraw execution
- Delete CounterfactualDepositBase (replaced by dispatcher + WithdrawImpl)
- Rewrite all tests for merkle pattern (90 tests passing)

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

* remove unused bytes return from execute interfaces

The return value was never consumed by any caller (factory, AdminWithdrawManager,
or tests). Removing it simplifies the interfaces and saves gas by avoiding
ABI decode/re-encode of the delegatecall result in the dispatcher.

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

* simplify WithdrawParams to single {admin, user} merkle leaf

Replace {authorizedCaller, forcedRecipient} with {admin, user} so each
clone needs only one withdraw leaf instead of up to three. Both admin
and user can withdraw to any recipient. Recipient enforcement for
signed withdrawals moves to AdminWithdrawManager.signedWithdrawToUser,
which reads the user address from the merkle-committed params.

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

* extract shared NATIVE_ASSET and BPS_SCALAR into CounterfactualConstants

Addresses review feedback: both constants were duplicated across
WithdrawImplementation, CounterfactualDepositSpokePool, and
CounterfactualDepositCCTP. Now defined once as file-level constants
and imported by name.

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…ery (#1329)

* [WIP] feat: add TransferProxy to allow same-chain swaps via SpokePoolPeriphery

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* fix: remove payable from TransferProxy deposit functions

ETH sent to these functions would be permanently trapped since
TransferProxy only handles ERC-20 transfers. Removing payable
causes the EVM to reject any calls that send ETH.

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

---------

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
grasphoper and others added 2 commits February 26, 2026 16:10
Signed-off-by: Ihor Farion <ihor@umaproject.org>
* WIP tron factory compatibility changes

* add foundry Tron profile

* add natspec

* make tron factory inherit from base counterfactual factory

* move TronClones.sol into libraries folder

* add references to OZ libraries forked from in comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants