Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
e2ab507
Add Solana Portal program implementation for entry bridge to Arbitrum
vanja-obradovic Mar 19, 2026
95a1ae6
feat: initial tests pass
vanja-obradovic Mar 19, 2026
573a5ef
Added changelog files
lazartravica Mar 23, 2026
0db2109
Merge pull request #646 from 0xCurvy/develop
lazartravica Mar 23, 2026
a71d7cf
feat: tempo portal factory contract
vanja-obradovic Apr 2, 2026
5d72b2e
recovery functions in PortalFactory contract
radojevicMihailo Apr 7, 2026
74c8a39
move script with all networks covered to sdk and backend endpoints
radojevicMihailo Apr 1, 2026
f960dc1
fix portal recovery flow
radojevicMihailo Apr 8, 2026
5c88ecc
Merge pull request #709 from 0xCurvy/contracts-update
radojevicMihailo Apr 8, 2026
9abc921
portal factory deployment artifacts for staging
radojevicMihailo Apr 9, 2026
ef522c9
removing portal recovery script from contract package
radojevicMihailo Apr 9, 2026
7889685
deployPortal private function
radojevicMihailo Apr 9, 2026
652b291
Merge remote-tracking branch 'origin/develop' into solana
vanja-obradovic Apr 9, 2026
90a353e
fixed portal factory deployment artifacts
radojevicMihailo Apr 9, 2026
b0ee069
production deployment artifacts
radojevicMihailo Apr 14, 2026
872cb5f
Merge remote-tracking branch 'origin/develop' into solana
vanja-obradovic Apr 15, 2026
1c9a661
artifacts for local testing on sepolia
radojevicMihailo Apr 21, 2026
8214154
Merge pull request #714 from 0xCurvy/solana
vanja-obradovic Apr 22, 2026
db4e912
Missing Smart Contract address check
vanja-obradovic Apr 28, 2026
516db43
Short-circuit guard bug/operator precedence bug
vanja-obradovic Apr 28, 2026
2f2f58c
No Error Handling for Invalid JSON
vanja-obradovic Apr 28, 2026
6dfda3b
Missing Null/Undefined Return Handling
vanja-obradovic Apr 28, 2026
614abf4
No Validation of Address Format
vanja-obradovic Apr 28, 2026
2c394a9
Moving constant to JSON
vanja-obradovic Apr 28, 2026
d47eea4
Deprecated fields
vanja-obradovic Apr 28, 2026
39e337a
Lost gas for transaction payment
vanja-obradovic Apr 28, 2026
7b43525
LiFi error message not propagated
vanja-obradovic Apr 28, 2026
8e8aac1
No way to query which portals were deployed and when
vanja-obradovic Apr 28, 2026
eed9949
Missing Address Validation for LiFi Diamond
vanja-obradovic Apr 28, 2026
3ce3e67
Inconsistent Parameter Naming
vanja-obradovic Apr 28, 2026
d80a5c2
Collecting zero fees
vanja-obradovic Apr 28, 2026
10dd9b2
EOA as tokenAddress
vanja-obradovic Apr 28, 2026
10be722
Modifier instead of error
vanja-obradovic Apr 28, 2026
aa180b3
Gas optimization
vanja-obradovic Apr 28, 2026
19f8d40
Wrong data in event
vanja-obradovic Apr 28, 2026
22deea2
Deregister token does not check vault balance
vanja-obradovic Apr 28, 2026
8b51f7f
No upper limit for fee
vanja-obradovic Apr 28, 2026
c43f9eb
Burning balance during recovery
vanja-obradovic Apr 28, 2026
6c94c0b
Difference between amount and note.amount
vanja-obradovic Apr 28, 2026
daf895f
Operator/authority modification
vanja-obradovic Apr 28, 2026
20ea009
Reset function
vanja-obradovic Apr 28, 2026
7ddad09
Event emission
vanja-obradovic Apr 28, 2026
a59b7a1
Solana specific exit bridge
vanja-obradovic Apr 28, 2026
8c47a86
Merge pull request #772 from 0xCurvy/audit-fixes
lazartravica Apr 28, 2026
8cae6af
Merge pull request #720 from 0xCurvy/kohaku
lazartravica Apr 29, 2026
77c9a91
Difference between amount and note.amount
vanja-obradovic Apr 28, 2026
72b5508
Operator/authority modification
vanja-obradovic Apr 28, 2026
f46feed
Reset function
vanja-obradovic Apr 28, 2026
a8c075a
Event emission
vanja-obradovic Apr 28, 2026
fbc371f
Solana specific exit bridge
vanja-obradovic Apr 28, 2026
57bad05
artifacts for local testing on sepolia
radojevicMihailo Apr 21, 2026
95cf076
feat: flatten ignition scripts
vanja-obradovic Apr 29, 2026
868ef48
Duplicated functionality for collecting fees
vanja-obradovic Apr 30, 2026
d78c4b2
fix: devenv module
vanja-obradovic Apr 30, 2026
7c0997b
Merge remote-tracking branch 'origin/develop' into audit-flatten
vanja-obradovic Apr 30, 2026
56de990
feat: move legacy-proxy-addresses to network-parameters
vanja-obradovic Apr 30, 2026
1012c9d
Merge pull request #787 from 0xCurvy/audit-flatten
vanja-obradovic Apr 30, 2026
daf0cdc
onlyRole modifier for deploySolanaExitBridgePortal function
radojevicMihailo May 5, 2026
d0974f1
Merge remote-tracking branch 'origin/develop' into develop
lazartravica May 5, 2026
ca9d1a7
Merge branch 'develop' of github.com:0xCurvy/contracts into develop
radojevicMihailo May 7, 2026
5187c8d
fix onlyCurvyAggregator modifier
radojevicMihailo May 7, 2026
d232edb
onlyCurvyAggregator modifier in deposit function
radojevicMihailo May 7, 2026
43292e0
Add audit report
horohronos May 8, 2026
0f06673
Rename Curvy 2026 Audit Report Final.pdf to audits/Curvy 2026 Audit R…
horohronos May 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added audits/Curvy 2026 Audit Report Final.pdf
Binary file not shown.
149 changes: 41 additions & 108 deletions contracts/aggregator-alpha/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,110 +1,43 @@
# CurvyAggregatorAlpha Changelog

## V6

### Fee Deduction in AutoShield

- `autoShield` now calculates a deposit fee: `note.amount * curvyVault.depositFee() / 10000`
- The note committed to the Merkle tree uses `note.amount - feeAmount` instead of `note.amount`, so the committed note reflects the post-fee amount
- Vault interface upgraded from `ICurvyVaultV2` to `ICurvyVaultV3`
- `curvyVault` state variable type changed from `ICurvyVaultV2` to `ICurvyVaultV3`

---

## V5

### Meta-Transaction Removal & Circuit Layout Change

#### Removed
- **`depositNote` function removed** — the meta-transaction-based deposit path (with EIP-712 signatures) is gone entirely

#### Changed: `autoShield`
- `tokenAddress` parameter removed from signature — now resolved internally via `curvyVault.getTokenAddress(note.token)`
- Access control changed from `require(...)` string to custom error `PortalNotRegistered()`
- Vault deposit call changed from 4 args `(tokenAddress, address(this), note.amount, 0)` to 3 args `(tokenAddress, address(this), note.amount)` (gas sponsorship parameter removed), matching `ICurvyVaultV2`

#### Changed: `commitDepositBatch`
- Return type `bool success` removed (now returns nothing)
- All `require(...)` replaced with custom errors: `NoteNotScheduledForDeposit()`, `InvalidNotesRoot()`, `InvalidProof()`

#### Changed: `commitAggregationBatch`
- Return type `bool` removed
- All `require(...)` replaced with custom errors: `CurrentNoteTreeRootMismatch()`, `CurrentNullifierTreeRootMismatch()`, `InvalidProof()`

#### Changed: `commitWithdrawalBatch`
- `publicInputs` array size changed from `uint256[10]` to `uint256[9]` (new circuit layout)
- Public input index offsets shifted: old notes tree root moved from `[2]` to `[1]`, old nullifiers tree root from `[3]` to `[2]`, withdrawal amounts from `[4+i]` to `[3+i]`, destinations from `[4+maxWithdrawals+i]` to `[3+maxWithdrawals+i]`
- Withdrawal mechanism changed from `curvyVault.transfer(MetaTransaction(...))` to `curvyVault.withdraw(tokenId, destinationAddress, amount)` — direct withdraw instead of meta-transaction pattern
- Fee collection step removed entirely
- Return type `bool` removed
- All `require(...)` replaced with custom errors

#### Changed: View Functions
- `getNullifierTreeRoot()` renamed to `getNullifiersTreeRoot()` (added "s")

#### Interface & Imports
- Interface changed from `ICurvyAggregatorAlpha` to `ICurvyAggregatorAlphaV2` (removes `tokenAddress` param from `autoShield`)
- Vault interface changed from `ICurvyVault` to `ICurvyVaultV2`
- `withdrawVerifier` type changed from `ICurvyWithdrawVerifier` to `ICurvyWithdrawVerifierV3`
- Added `ICurvyWithdrawVerifierV3` import

#### Comments
- NatSpec comment added to `reset` documenting it as emergency-only
- Improved comments on `maxAggregations`, `maxWithdrawals`, `_pendingIdsQueue`

---

## V4

### Portal Factory Integration

#### Added
- `IPortalFactory public portalFactory` state variable
- Portal registration check in `autoShield`: `require(portalFactory.portalIsRegistered(msg.sender), ...)` — only registered portals can call `autoShield`

#### Changed: `initialize`
- `curvyVaultProxyAddress` parameter removed — vault must now be configured post-deployment via `updateConfig`
- Default max values (`maxDeposits`, `maxWithdrawals`, `maxAggregations`) no longer set during initialization

#### Changed: `updateConfig`
- Parameter type changed from `AggregatorConfigurationUpdate` to `AggregatorConfigurationUpdateV2`
- Added `portalFactory` configuration support

---

## V3

### AutoShield & SafeERC20

#### Added
- `autoShield(CurvyTypes.Note memory note, address tokenAddress) external payable` — new function for portal-based deposits. Handles ERC-20 via `safeTransferFrom` + `forceApprove`, then calls `curvyVault.deposit`. Computes `noteId` via `PoseidonT4.hash`, adds to `_pendingIdsQueue`, emits `DepositedNote`. No access control in this version.
- `NATIVE_ETH` constant (`0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE`) — sentinel address for native ETH handling
- `using SafeERC20 for IERC20` directive

#### Changed: Inheritance
- Added `ICurvyAggregatorAlpha` interface to inheritance chain

#### New Imports
- `ICurvyAggregatorAlpha` from `./ICurvyAggregatorAlpha.sol`
- `SafeERC20` and `IERC20` from OpenZeppelin

---

## V2

### Withdrawal MetaTransaction Type Fix

#### Changed: `commitWithdrawalBatch`
- Per-user withdrawal transfers changed from `CurvyTypes.MetaTransactionType.Withdraw` to `CurvyTypes.MetaTransactionType.Transfer`

---

## V1

Initial release. Core aggregator contract with:
- `initialize`, `_authorizeUpgrade`, `updateConfig`, `reset`
- `depositNote` — meta-transaction-based note deposit with EIP-712 signature verification
- `commitDepositBatch` — batch deposit commitment with ZK insertion proof verification
- `commitAggregationBatch` — batch aggregation with ZK proof verification
- `commitWithdrawalBatch` — batch withdrawal with ZK proof verification and vault transfers
- View functions: `getNotesTreeRoot`, `getNullifierTreeRoot`, `getConfig`, `getPendingNoteIds`
## V1 — Post-Audit Launch

Initial production release. The pre-launch implementation chain (V1–V6) was
flattened to a single audited V1 prior to this release; the historical
versions and their changelog entries are preserved in the repository's git
history.

### Surface

- UUPS-upgradeable proxy, owner-bound `_authorizeUpgrade` gated by
`AUTHORITY_ROLE`.
- Single deposit entry point: `autoShield(CurvyTypes.Note)` — gated to
registered portals via `portalFactory.portalIsRegistered(msg.sender)`.
Deposit fee (`note.amount * curvyVault.depositFee() / 10000`) is deducted
before the note is committed to the Merkle tree.
- ZK-verified batches: `commitDepositBatch`, `commitAggregationBatch`,
`commitWithdrawalBatch` — each verified against the corresponding verifier
configured via `updateConfig`.
- Withdrawals delegated to `curvyVault.withdraw(tokenId, to, amount)` (direct,
no meta-transactions).
- Role-based access control (OZ `AccessControlUpgradeable`):
- `AUTHORITY_ROLE` — upgrades, `updateConfig`.
- `OPERATOR_ROLE` — operational role (`forceWithdrawal`, …).

### Production verifier set

Trees of depth 30, dimensional suffixes encode circuit shape (not contract
version):

- `CurvyInsertionVerifierAlpha_2_30` — `maxDeposits = 2`
- `CurvyAggregationVerifierAlpha_2_2_2_30` — `maxAggregations = 2`
- `CurvyWithdrawVerifierAlpha_2_2_30` — `maxWithdrawals = 2`

### Bootstrap path for existing proxies

`bootstrapAccessControl()` is `external reinitializer(2) onlyOwner` and is
called atomically via `upgradeToAndCall` during the V1 upgrade. It seeds
`AUTHORITY_ROLE` and `OPERATOR_ROLE` on `owner()`. The pre-AC
`_authorizeUpgrade(onlyOwner)` gate authorises the upgrade itself; the
`reinitializer(2)` modifier guarantees the bootstrap can only run once per
proxy.
Loading