Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
637fb40
some scaffolding
sparrowDom Dec 5, 2025
7630f6d
add basic necessities for unit tests
sparrowDom Dec 5, 2025
6a97767
checkpoint
shahthepro Dec 11, 2025
9517fca
Fix compiling issues
shahthepro Dec 11, 2025
41f1fd9
Add fork test scaffolding
shahthepro Dec 12, 2025
7a109cc
Fix stuffs
shahthepro Dec 12, 2025
48d317e
Prettify and change salt
shahthepro Dec 13, 2025
c6a254a
Add auto-verification
shahthepro Dec 13, 2025
8f4e39e
Fix checkBalance
shahthepro Dec 13, 2025
f7a9b97
Make CCTPHookWrapper more resilient
shahthepro Dec 15, 2025
b3c1eb4
refactor message version and type checks
sparrowDom Dec 15, 2025
d3c4a39
add some comments
sparrowDom Dec 16, 2025
792c890
add comment
sparrowDom Dec 16, 2025
70166bc
fix compile errors
sparrowDom Dec 16, 2025
1e700b1
Change addresses
shahthepro Dec 17, 2025
7d60614
Cross chain changes (#2718)
sparrowDom Dec 18, 2025
ada1546
Merge branch 'master' into shah/cross-chain-strategy-cctpv2
shahthepro Dec 18, 2025
987dc0a
Fix compilation issues
shahthepro Dec 18, 2025
b63bd5f
Fix deployment files a bit
shahthepro Dec 18, 2025
bf1fbe2
Fix Message relayer
shahthepro Dec 18, 2025
a0dd07b
Clean up master strategy
shahthepro Dec 18, 2025
4071943
Fix deployment file name
shahthepro Dec 18, 2025
9e36485
move around stuff
shahthepro Dec 18, 2025
e401fa1
Fix CCTP Integrator
shahthepro Dec 18, 2025
73abf6c
clean up fork
shahthepro Dec 19, 2025
266ec01
Fix race condition (#2720)
shahthepro Dec 19, 2025
122fa32
Cleanup code
shahthepro Dec 19, 2025
7507994
decode payloads in fork tests
shahthepro Dec 19, 2025
7998ffa
Add library for message handling
shahthepro Dec 19, 2025
e34706a
More changes
shahthepro Dec 19, 2025
df59d53
Add comments and prettify
shahthepro Dec 20, 2025
29ee0e6
WIP Unit test setup (#2722)
sparrowDom Dec 22, 2025
a0d5379
Add more fork tests
shahthepro Dec 22, 2025
3585d9d
Add token transfer tests
shahthepro Dec 23, 2025
e694906
WIP Unit tests for OUSD Simplified strategy (#2724)
sparrowDom Dec 24, 2025
77bc730
Fix master fork tests
shahthepro Dec 24, 2025
6dca3cc
linter
shahthepro Dec 24, 2025
7de74b4
add direct withdrawal paths and additional checks
sparrowDom Dec 24, 2025
fb31b79
Fix Remote strategy tests
shahthepro Dec 25, 2025
54ca3c0
Update comments and clean up code
shahthepro Dec 26, 2025
5ac664c
Fix comment
shahthepro Dec 26, 2025
b16c7fd
Fix failing unit test
shahthepro Dec 26, 2025
a4c2968
fix: withdraw only if balance is lower than requested amount
shahthepro Dec 30, 2025
fca3df2
Document crosschain strategy
shahthepro Dec 30, 2025
e322fe3
Merge branch 'master' into shah/cross-chain-strategy-cctpv2
shahthepro Jan 2, 2026
b2feed1
Update deployment file numbers
shahthepro Jan 2, 2026
4150f9a
adjust the charts
sparrowDom Jan 5, 2026
7c32c01
change the function visibility to pure
sparrowDom Jan 5, 2026
cbc0745
fix: create2 proxy without using deployer address
shahthepro Jan 5, 2026
8bd5edc
fix: impersonate a single deployer on fork
shahthepro Jan 5, 2026
4557836
deploy script bug fix
shahthepro Jan 5, 2026
31b9f50
Store create2 proxy addresses
shahthepro Jan 5, 2026
057bd78
fix: await
shahthepro Jan 5, 2026
f4bff9e
more logging
shahthepro Jan 5, 2026
2948739
fix opts
shahthepro Jan 5, 2026
801eacf
Fix env for deploy action
shahthepro Jan 5, 2026
8d9ace2
Change writeFileSync to writeFile
shahthepro Jan 5, 2026
cb19da2
add log
shahthepro Jan 5, 2026
8dd21bd
Add more logs
shahthepro Jan 5, 2026
b54ef4b
fix callback
shahthepro Jan 5, 2026
c0a277e
Add empty file
shahthepro Jan 5, 2026
bfb411c
Cleanup logs
shahthepro Jan 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion contracts/.solhintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
contracts/interfaces/morpho/Types.sol
contracts/interfaces/morpho/Types.sol
contracts/mocks/**/*.sol
24 changes: 24 additions & 0 deletions contracts/abi/createx.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,30 @@
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "salt",
"type": "bytes32"
},
{
"internalType": "bytes",
"name": "initCode",
"type": "bytes"
}
],
"name": "deployCreate3",
"outputs": [
{
"internalType": "address",
"name": "newContract",
"type": "address"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
Expand Down
75 changes: 75 additions & 0 deletions contracts/contracts/interfaces/cctp/ICCTP.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

interface ICCTPTokenMessenger {
function depositForBurn(
uint256 amount,
uint32 destinationDomain,
bytes32 mintRecipient,
address burnToken,
bytes32 destinationCaller,
uint256 maxFee,
uint32 minFinalityThreshold
) external;

function depositForBurnWithHook(
uint256 amount,
uint32 destinationDomain,
bytes32 mintRecipient,
address burnToken,
bytes32 destinationCaller,
uint256 maxFee,
uint32 minFinalityThreshold,
bytes memory hookData
) external;

function getMinFeeAmount(uint256 amount) external view returns (uint256);
}

interface ICCTPMessageTransmitter {
function sendMessage(
uint32 destinationDomain,
bytes32 recipient,
bytes32 destinationCaller,
uint32 minFinalityThreshold,
bytes memory messageBody
) external;

function receiveMessage(bytes calldata message, bytes calldata attestation)
external
returns (bool);
}

interface IMessageHandlerV2 {
/**
* @notice Handles an incoming finalized message from an IReceiverV2
* @dev Finalized messages have finality threshold values greater than or equal to 2000
* @param sourceDomain The source domain of the message
* @param sender The sender of the message
* @param finalityThresholdExecuted the finality threshold at which the message was attested to
* @param messageBody The raw bytes of the message body
* @return success True, if successful; false, if not.
*/
function handleReceiveFinalizedMessage(
uint32 sourceDomain,
bytes32 sender,
uint32 finalityThresholdExecuted,
bytes calldata messageBody
) external returns (bool);

/**
* @notice Handles an incoming unfinalized message from an IReceiverV2
* @dev Unfinalized messages have finality threshold values less than 2000
* @param sourceDomain The source domain of the message
* @param sender The sender of the message
* @param finalityThresholdExecuted The finality threshold at which the message was attested to
* @param messageBody The raw bytes of the message body
* @return success True, if successful; false, if not.
*/
function handleReceiveUnfinalizedMessage(
uint32 sourceDomain,
bytes32 sender,
uint32 finalityThresholdExecuted,
bytes calldata messageBody
) external returns (bool);
}
166 changes: 166 additions & 0 deletions contracts/contracts/mocks/MockERC4626Vault.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.0;

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { IERC4626 } from "../../lib/openzeppelin/interfaces/IERC4626.sol";
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

contract MockERC4626Vault is IERC4626, ERC20 {
using SafeERC20 for IERC20;

address public asset;
uint8 public constant DECIMALS = 18;

constructor(address _asset) ERC20("Mock Vault Share", "MVS") {
asset = _asset;
}

// ERC20 totalSupply is inherited

// ERC20 balanceOf is inherited

function deposit(uint256 assets, address receiver)
public
override
returns (uint256 shares)
{
shares = previewDeposit(assets);
IERC20(asset).safeTransferFrom(msg.sender, address(this), assets);
_mint(receiver, shares);
return shares;
}

function mint(uint256 shares, address receiver)
public
override
returns (uint256 assets)
{
assets = previewMint(shares);
IERC20(asset).safeTransferFrom(msg.sender, address(this), assets);
_mint(receiver, shares);
return assets;
}

function withdraw(
uint256 assets,
address receiver,
address owner
) public override returns (uint256 shares) {
shares = previewWithdraw(assets);
if (msg.sender != owner) {
// No approval check for mock
}
_burn(owner, shares);
IERC20(asset).safeTransfer(receiver, assets);
return shares;
}

function redeem(
uint256 shares,
address receiver,
address owner
) public override returns (uint256 assets) {
assets = previewRedeem(shares);
if (msg.sender != owner) {
// No approval check for mock
}
_burn(owner, shares);
IERC20(asset).safeTransfer(receiver, assets);
return assets;
}

function totalAssets() public view override returns (uint256) {
return IERC20(asset).balanceOf(address(this));
}

function convertToShares(uint256 assets)
public
view
override
returns (uint256 shares)
{
uint256 supply = totalSupply(); // Use ERC20 totalSupply
return
supply == 0 || assets == 0
? assets
: (assets * supply) / totalAssets();
}

function convertToAssets(uint256 shares)
public
view
override
returns (uint256 assets)
{
uint256 supply = totalSupply(); // Use ERC20 totalSupply
return supply == 0 ? shares : (shares * totalAssets()) / supply;
}

function maxDeposit(address receiver)
public
view
override
returns (uint256)
{
return type(uint256).max;
}

function maxMint(address receiver) public view override returns (uint256) {
return type(uint256).max;
}

function maxWithdraw(address owner) public view override returns (uint256) {
return convertToAssets(balanceOf(owner));
}

function maxRedeem(address owner) public view override returns (uint256) {
return balanceOf(owner);
}

function previewDeposit(uint256 assets)
public
view
override
returns (uint256 shares)
{
return convertToShares(assets);
}

function previewMint(uint256 shares)
public
view
override
returns (uint256 assets)
{
return convertToAssets(shares);
}

function previewWithdraw(uint256 assets)
public
view
override
returns (uint256 shares)
{
return convertToShares(assets);
}

function previewRedeem(uint256 shares)
public
view
override
returns (uint256 assets)
{
return convertToAssets(shares);
}

function _mint(address account, uint256 amount) internal override {
super._mint(account, amount);
}

function _burn(address account, uint256 amount) internal override {
super._burn(account, amount);
}

// Inherited from ERC20
}
Loading
Loading