Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
43c8fe4
refactor: update contract hashes and SDK package name
0xSacha Sep 18, 2025
35d11fc
remove useless mint limit
0xSacha Sep 23, 2025
3a04533
update vault hash
0xSacha Sep 23, 2025
a43e4f7
feat: implement comprehensive vault curator SDK
0xSacha Sep 26, 2025
c532caf
chore: bump version to 0.1.1
0xSacha Sep 26, 2025
1672369
feat: remove id from claim redeem das
0xSacha Oct 3, 2025
18a9b54
refactor: streamline vault fee calculation and remove redundant test
0xSacha Oct 3, 2025
6699c7e
fix: add missing #[flat] attributes to component events
0xSacha Oct 3, 2025
efc010d
feat: add SRC5 component with ERC721 receiver support
0xSacha Oct 5, 2025
de13f33
feat: implement ERC721 receiver support and safe transfer functionality
0xSacha Oct 8, 2025
a078c0a
feat: new classes
EvolveArt Oct 8, 2025
582a3c9
Merge pull request #3 from EvolveArt/0x/new-deploy
0xSacha Oct 8, 2025
1e40ead
fix: non custodial vault deployment
EvolveArt Oct 15, 2025
895df7c
feat: add Starkgate and Extended integration components
0xSacha Oct 16, 2025
7d2eaf7
Add get started guide
0xSacha Oct 17, 2025
e8f3a5c
fix: starkgate merkle integration
EvolveArt Oct 22, 2025
563a385
fix: starkgate interface
EvolveArt Oct 22, 2025
8876b22
Merge pull request #4 from EvolveArt/0x/fix-script
0xSacha Oct 23, 2025
2c1efab
Merge pull request #5 from EvolveArt/0x/fix-integrations
0xSacha Oct 23, 2025
5a34cff
Feat: add pods
0xSacha Nov 1, 2025
dae73cf
Feat: Add paradex gigavault
0xSacha Nov 1, 2025
415d0e3
Feat add paradex deployments scripts
0xSacha Nov 1, 2025
adeff1c
Feat: deploy paradex sepolia
0xSacha Nov 1, 2025
9be8e05
Feat: Add Starkgate middleware integration
0xSacha Nov 3, 2025
f3f48c8
Refactor: Improve Starkgate middleware interface and implementation
0xSacha Nov 6, 2025
e3e4524
feat: Add L1 recipient validation to Starkgate middleware
0xSacha Nov 10, 2025
1d0113b
Feat: fix decoder and sanitizer
0xSacha Nov 10, 2025
4cf502c
Feat: declare default decoder + starkgateMiddleware
0xSacha Nov 10, 2025
af75bd4
Feat: add vault allocator setter
0xSacha Nov 10, 2025
0ddb231
Add starkgate related methods to SDK
jo-es Nov 18, 2025
e4c61bd
Merge pull request #6 from vesuxyz/feat/starkgate
0xSacha Nov 19, 2025
7a9d170
Check balance of token_to_receive of middleware
nbundi Nov 20, 2025
489f466
Merge pull request #7 from vesuxyz/fix/starkgate-middleware
0xSacha Nov 20, 2025
31ce22d
Port merkle tree generation script to ts
jo-es Nov 20, 2025
d4e97ff
Add starknet-foundry to .tool-verions
jo-es Nov 20, 2025
c500f18
Add working multi route swap examples
nbundi Nov 28, 2025
ab5d229
Merge pull request #10 from vesuxyz/main
0xSacha Nov 28, 2025
ca45766
Fix multiRouteSwap SDK helpers
nbundi Nov 29, 2025
4203923
Add hyperlane support
nbundi Dec 3, 2025
2b117e8
Check for non-zero balance of token_to_claim
nbundi Dec 3, 2025
a32836a
Add hyperlane decoders
nbundi Dec 3, 2025
63d12c1
Fix build errors
nbundi Dec 3, 2025
2ec6fa3
Add hyperlane leafs
nbundi Dec 4, 2025
56a88a1
Add bridge fee handling
nbundi Dec 4, 2025
6a4af31
Add missing hyperlane decoders & sanitizers
nbundi Dec 4, 2025
0dbf229
Merge branch 'ForgeYields:main' into main
nbundi Dec 4, 2025
a01bc2c
Add support for hyperlane
nbundi Dec 4, 2025
89b4839
Fix hyperlane decoder and add to simple decoder
nbundi Dec 5, 2025
16d949a
Merge pull request #2 from vesuxyz/feat/hyperlane
nbundi Dec 5, 2025
06ea049
Merge pull request #8 from vesuxyz/feat/merkle-ts
0xSacha Dec 7, 2025
d07988a
Merge pull request #9 from vesuxyz/fix/starkgate-middleware
0xSacha Dec 7, 2025
a9d8f27
Fix multiRouteSwap SDK helpers
nbundi Nov 29, 2025
ddfbff7
Add hyperlane support
nbundi Dec 3, 2025
017bcde
Check for non-zero balance of token_to_claim
nbundi Dec 3, 2025
a5e3c6b
Add hyperlane decoders
nbundi Dec 3, 2025
dbb5604
Fix build errors
nbundi Dec 3, 2025
7d55af8
Add hyperlane leafs
nbundi Dec 4, 2025
d1dff67
Add bridge fee handling
nbundi Dec 4, 2025
eb34923
Add missing hyperlane decoders & sanitizers
nbundi Dec 4, 2025
11a1a6d
Fix hyperlane decoder and add to simple decoder
nbundi Dec 5, 2025
a7a8089
Merge branch 'main' of https://github.com/vesuxyz/starknet_vault_kit …
0xSacha Dec 7, 2025
f6b55c8
Merge pull request #13 from ForgeYields/hyperlane-support
0xSacha Dec 7, 2025
31570f7
Feat: Add ekubo adapter
0xSacha Dec 5, 2025
68e39cf
Merge pull request #12 from ForgeYields/Ekubo
0xSacha Dec 7, 2025
1949adb
Support hyperlane bridge in SDK
nbundi Dec 7, 2025
011e246
feat: Add harvest functionality to Ekubo adapter and fyWBTC support
0xSacha Dec 8, 2025
d6c0339
refactor: Rename vault to vault_allocator in AssetTransferPod and add…
0xSacha Dec 10, 2025
34eeecf
feat: Add CCTP (Cross-Chain Transfer Protocol) support
0xSacha Dec 10, 2025
2f452bc
Merge branch 'ForgeYields:main' into main
nbundi Dec 11, 2025
8ae7ade
Merge pull request #14 from vesuxyz/main
0xSacha Dec 11, 2025
e969fbb
feat: Add CCTP SDK support for cross-chain transfers
0xSacha Dec 11, 2025
6611c0e
refactor: Extract BaseMiddleware component and separate direct/middle…
0xSacha Dec 15, 2025
09d404e
Update creator_fyWBTC.cairo
0xSacha Dec 15, 2025
aa4ea66
feat: Add middleware test infrastructure
0xSacha Dec 15, 2025
ff6de6f
refactor: Remove Vesu V1 support from curator SDK
0xSacha Dec 15, 2025
aa04bd4
feat: Add modular integration helpers for curator SDK
0xSacha Dec 15, 2025
85cea75
Create test.json
0xSacha Dec 15, 2025
ca01b96
docs: Update SDK README with curator integrations
0xSacha Dec 15, 2025
559aac7
Merge pull request #3 from ForgeYields/main
nbundi Dec 18, 2025
5fa3c7f
Fix _add_starkgate_leafs call in test
nbundi Dec 18, 2025
90e895a
Support bridgin with StarkGate middleware in SDK
nbundi Dec 19, 2025
4f9022b
Merge pull request #16 from vesuxyz/main
0xSacha Dec 19, 2025
64bf6f9
fix: Use BigInt comparison for leaf matching and rename bridge functions
0xSacha Dec 19, 2025
f13b8c6
chore: bump Cairo to 2.14.0 and starknet.js to 9.2.1
0xSacha Dec 19, 2025
9c5e502
Merge pull request #17 from ForgeYields/bump-version
0xSacha Dec 19, 2025
92f5a76
fix: improve Vesu V2 leaf matching with BigInt comparison and argumen…
0xSacha Dec 20, 2025
20c9f06
chore: remove unused vesu_complete_decoder_and_sanitizer module
0xSacha Jan 13, 2026
66e03a2
feat: add LayerZero OFT integration with middleware support
0xSacha Jan 21, 2026
cfca1aa
fix: add debt asset approval in Vesu V2 integration
0xSacha Jan 29, 2026
e22d6b0
chore: update gitignore with dev tool artifacts
0xSacha Jan 30, 2026
a51e3f1
feat: add USDC migration decoder/sanitizer and merkle tree integration
0xSacha Feb 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
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,15 @@ target
# Deployment files (user-specific)
scripts/deployments.json

.env
.env

# Claude Code
.claude/

# TLDR tool
.tldr/
.tldrignore

# Test artifacts
leafs/testMerkl.json
leafs/testMerkl.log
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scarb 2.13.1
127 changes: 127 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,133 @@ scarb build
snforge test
```

## Get Started as a Vault Builder

This guide walks you through deploying and configuring vaults as a builder, covering both custodial and non-custodial approaches.

### Step 1: Deploy Your Vault

Use the deployment script to create your vault with the desired configuration:

```bash
cd scripts
npm run deploy:vault
```

The script (`scripts/deployVault.ts`) will prompt you for:
- **Vault Details**: Name, symbol, underlying asset address
- **Fee Configuration**: Management, performance, and redemption fees
- **Operational Parameters**: Report delay, max delta percentage, fees recipient
- **Vault Type**: Choose between custodial or non-custodial

#### Custodial vs Non-Custodial Vaults

**Custodial Vaults:**
- Use an existing, pre-deployed VaultAllocator
- Suitable when you trust a third-party allocator
- Faster deployment (vault + redeem request only)
- Limited control over fund allocation strategies

**Non-Custodial Vaults:**
- Deploy a new VaultAllocator and Manager specific to your vault
- Full control over fund allocation and strategy management
- Requires additional setup for Merkle tree verification system
- Higher security and customization capabilities

### Step 2: Non-Custodial Setup (Advanced Fund Management)

For non-custodial vaults, you need to set up the Merkle tree verification system for secure fund allocation:

#### 2.1 Configure Allocation Strategies

The VaultAllocator (`packages/vault_allocator`) provides secure fund allocation through:
- **Manager Contract**: Merkle proof-based call verification
- **Decoders & Sanitizers**: Pre-built integrations for protocols (AVNU, Vesu, ERC-4626)
- **Merkle Tree Verification**: Whitelist system for allowed operations

#### 2.2 Generate Merkle Tree Configuration

Run the merkle tree generation script to create your allocation whitelist:

```bash
./export_merkle.sh [config_name]
```

This script:
1. Executes test scenarios to generate valid operation leafs
2. Creates a Merkle tree with allowed operations
3. Outputs a JSON configuration file in `leafs/[config_name].json`

The generated file contains:
- **Metadata**: Vault, allocator, and manager addresses
- **Leafs**: Whitelisted operations with their proofs
- **Tree**: Complete Merkle tree structure

#### 2.3 Set Management Root

Configure the Manager contract with your Merkle root:

```typescript
// Using the deployed manager address from step 1
const manager = new Contract(managerAbi, managerAddress, account);
await manager.set_manage_root(vaultAddress, merkleRoot);
```

### Step 3: Off-Chain Integration with Curator SDK

Use the Curator SDK (`sdk/src/curator/index.ts`) to generate secure calldata for vault operations:

#### 3.1 Initialize the SDK

```typescript
import { VaultCuratorSDK } from './sdk/src/curator';

// Load configuration from generated merkle file
const curator = VaultCuratorSDK.fromFile('./leafs/your_config.json');
```

#### 3.2 Generate Operation Calldata

The SDK provides helper methods for common operations:

```typescript
// Bring liquidity to vault
const calls = curator.bringLiquidityHelper(true, amount); // true = with approval

// Multi-step operations (approve + deposit)
const calls = curator.depositHelper({
target: vaultAddress,
assets: depositAmount,
receiver: userAddress,
withApproval: true
});

// Advanced DeFi operations
const calls = curator.multiRouteSwapHelper(swapParams, { withApproval: true });
const calls = curator.ModifyPositionV1Helper(vesuParams, approvalParams);
```

#### 3.3 Execute Operations

```typescript
// Execute the generated calls
const response = await account.execute(calls);
```

### Key Benefits

- **Security**: Merkle proof verification ensures only whitelisted operations
- **Flexibility**: Support for multiple DeFi protocols (AVNU, Vesu, ERC-4626)
- **Efficiency**: Batch operations with automatic approval handling
- **Auditability**: All operations are pre-defined and verifiable

### Next Steps

1. **Monitor**: Use the backend services for vault monitoring and analytics
2. **Optimize**: Adjust strategies based on performance metrics
3. **Scale**: Deploy multiple vaults with different strategies
4. **Integrate**: Use the SDK in your applications for seamless vault management

### Scripts & Backend

For deployment scripts and configuration utilities, see [scripts/README.md](scripts/README.md).
Expand Down
89 changes: 55 additions & 34 deletions Scarb.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,37 @@
# Code generated by scarb DO NOT EDIT.
version = 1

[[package]]
name = "alexandria_bytes"
version = "0.6.1"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:b1a402330fe5356ca0a4f24d2b8dd1fb0a7e2568bf35c349319cadb53f0ed6fd"
dependencies = [
"alexandria_data_structures",
"alexandria_math",
]

[[package]]
name = "alexandria_data_structures"
version = "0.6.1"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:f011951982ca26ce64c212ca5aa739bd16461dae96a4fb9a8f8e360b1c5e7b94"

[[package]]
name = "alexandria_math"
version = "0.6.0"
version = "0.6.1"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:1e08ebba0ed9f7217b8efc283d2ad41730257cf41a47ca88a94fb0fafad22e9e"
checksum = "sha256:19160f0993a6643e8e71a3bce03e54a37f26b8cad94f21668d7cc9afd08d2047"

[[package]]
name = "ekubo"
version = "0.1.0"
source = "git+https://github.com/ekuboprotocol/starknet-contracts#cf2e95fd124bfb19491e1a7da9ffba4b63cc6c4e"

[[package]]
name = "openzeppelin"
version = "3.0.0-alpha.1"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#a2bdd1bdbdf96a9291ba0f2269f1e11c451fddb9"
version = "3.0.0-alpha.3"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#1e5a44ec50d7625395ca8322eec971ce8abb5bc1"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
Expand All @@ -28,17 +49,17 @@ dependencies = [

[[package]]
name = "openzeppelin_access"
version = "3.0.0-alpha.1"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#a2bdd1bdbdf96a9291ba0f2269f1e11c451fddb9"
version = "3.0.0-alpha.3"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#1e5a44ec50d7625395ca8322eec971ce8abb5bc1"
dependencies = [
"openzeppelin_interfaces",
"openzeppelin_introspection",
]

[[package]]
name = "openzeppelin_account"
version = "3.0.0-alpha.1"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#a2bdd1bdbdf96a9291ba0f2269f1e11c451fddb9"
version = "3.0.0-alpha.3"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#1e5a44ec50d7625395ca8322eec971ce8abb5bc1"
dependencies = [
"openzeppelin_interfaces",
"openzeppelin_introspection",
Expand All @@ -47,8 +68,8 @@ dependencies = [

[[package]]
name = "openzeppelin_finance"
version = "3.0.0-alpha.1"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#a2bdd1bdbdf96a9291ba0f2269f1e11c451fddb9"
version = "3.0.0-alpha.3"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#1e5a44ec50d7625395ca8322eec971ce8abb5bc1"
dependencies = [
"openzeppelin_access",
"openzeppelin_interfaces",
Expand All @@ -57,11 +78,10 @@ dependencies = [

[[package]]
name = "openzeppelin_governance"
version = "3.0.0-alpha.1"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#a2bdd1bdbdf96a9291ba0f2269f1e11c451fddb9"
version = "3.0.0-alpha.3"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#1e5a44ec50d7625395ca8322eec971ce8abb5bc1"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
"openzeppelin_interfaces",
"openzeppelin_introspection",
"openzeppelin_token",
Expand All @@ -70,26 +90,26 @@ dependencies = [

[[package]]
name = "openzeppelin_interfaces"
version = "2.1.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#a2bdd1bdbdf96a9291ba0f2269f1e11c451fddb9"
version = "2.1.0-alpha.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#1e5a44ec50d7625395ca8322eec971ce8abb5bc1"

[[package]]
name = "openzeppelin_introspection"
version = "3.0.0-alpha.1"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#a2bdd1bdbdf96a9291ba0f2269f1e11c451fddb9"
version = "3.0.0-alpha.3"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#1e5a44ec50d7625395ca8322eec971ce8abb5bc1"
dependencies = [
"openzeppelin_interfaces",
]

[[package]]
name = "openzeppelin_merkle_tree"
version = "3.0.0-alpha.1"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#a2bdd1bdbdf96a9291ba0f2269f1e11c451fddb9"
version = "3.0.0-alpha.3"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#1e5a44ec50d7625395ca8322eec971ce8abb5bc1"

[[package]]
name = "openzeppelin_presets"
version = "3.0.0-alpha.1"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#a2bdd1bdbdf96a9291ba0f2269f1e11c451fddb9"
version = "3.0.0-alpha.3"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#1e5a44ec50d7625395ca8322eec971ce8abb5bc1"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
Expand All @@ -103,48 +123,47 @@ dependencies = [

[[package]]
name = "openzeppelin_security"
version = "3.0.0-alpha.1"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#a2bdd1bdbdf96a9291ba0f2269f1e11c451fddb9"
version = "3.0.0-alpha.3"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#1e5a44ec50d7625395ca8322eec971ce8abb5bc1"
dependencies = [
"openzeppelin_interfaces",
]

[[package]]
name = "openzeppelin_token"
version = "3.0.0-alpha.1"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#a2bdd1bdbdf96a9291ba0f2269f1e11c451fddb9"
version = "3.0.0-alpha.3"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#1e5a44ec50d7625395ca8322eec971ce8abb5bc1"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
"openzeppelin_interfaces",
"openzeppelin_introspection",
"openzeppelin_utils",
]

[[package]]
name = "openzeppelin_upgrades"
version = "3.0.0-alpha.1"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#a2bdd1bdbdf96a9291ba0f2269f1e11c451fddb9"
version = "3.0.0-alpha.3"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#1e5a44ec50d7625395ca8322eec971ce8abb5bc1"

[[package]]
name = "openzeppelin_utils"
version = "3.0.0-alpha.1"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#a2bdd1bdbdf96a9291ba0f2269f1e11c451fddb9"
version = "2.1.0-alpha.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts#1e5a44ec50d7625395ca8322eec971ce8abb5bc1"
dependencies = [
"openzeppelin_interfaces",
]

[[package]]
name = "snforge_scarb_plugin"
version = "0.48.0"
version = "0.48.1"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:8630dcf3fa4df36a3d45e6a2d053cf84c548ab154e829fece99373ae5852921c"
checksum = "sha256:2dd27e8215eea8785b3930e9f452e11b429ca262b1c1fbb071bfc173b9ebc125"

[[package]]
name = "snforge_std"
version = "0.48.0"
version = "0.48.1"
source = "registry+https://scarbs.xyz/"
checksum = "sha256:981139c83359089540652c44f4a1a888c77409eedaa148377927cc63a604b67b"
checksum = "sha256:89f759fa685d48ed0ba7152d2ac2eb168da08dfa8b84b2bee96e203dc5b2413e"
dependencies = [
"snforge_scarb_plugin",
]
Expand Down Expand Up @@ -172,7 +191,9 @@ dependencies = [
name = "vault_allocator"
version = "0.1.0"
dependencies = [
"alexandria_bytes",
"alexandria_math",
"ekubo",
"openzeppelin",
"snforge_std",
]
10 changes: 6 additions & 4 deletions Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ edition.workspace = true
[workspace.package]
version = "0.1.0"
edition = "2024_07"
cairo-version = "2.12.0"
scarb-version = "2.12.0"
cairo-version = "2.14.0"
scarb-version = "2.14.0"
authors = ["ForgeYields <forge.fi.contact@gmail.com>"]
description = "Standard vault infrastructure for Starknet"
documentation = ""
Expand All @@ -27,10 +27,12 @@ keywords = [
]

[workspace.dependencies]
starknet = "2.12.0"
starknet = "2.14.0"
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts" }
snforge_std = "0.48.0"
snforge_std = "0.48.1"
alexandria_math = "0.6.0"
alexandria_bytes = "0.6.0"
ekubo = { git = "https://github.com/ekuboprotocol/starknet-contracts" }


[dependencies]
Expand Down
Loading