Contact
Reports

Smart Contract Security Assessment

Twyne AAVE operators

Protocol
Twyne
Timeline
Nov 24, 2025 - Nov 24, 2025
Audit Team
Adriro, HHK
Contents

Protocol Overview

Twyne is a credit delegation protocol that lets borrowers rent unused borrowing power from other lenders to boost their Liquidation LTV. Lenders earn additional yield while borrowers get to ramp up their leverage or insulate their debt.
This audit covers 5 smart contracts totaling approximately 541 lines of code across 1 day of review.

Severity Classification

SeverityDescriptionPotential Impact
CriticalImmediate threat to user funds or protocol integrityDirect loss of funds, protocol compromise
HighSignificant security risk requiring urgent attentionPotential fund loss, major functionality disruption
MediumImportant issue that should be addressedLimited fund risk, functionality concerns
LowMinor issue with minimal impactBest practice violations, minor inefficiencies
UndeterminedFindings whose impact could not be fully assessed within the time constraints of the engagement. These issues may range from low to critical severity, and although their exact consequences remain uncertain, they present a sufficient potential risk to warrant attention and remediation.Varies based on actual severity
GasFindings that can improve the gas efficiency of the contracts.Increased transaction costs
InformationalCode quality and best practice recommendationsReduced maintainability and readability

Key Findings

0
Critical
0
High
0
Medium
1
Low
4
Informational
1
Gas

Overall Assessment

The audit of Twyne's Aave operators identified no critical or high-severity vulnerabilities, indicating a solid implementation that maintains the security standards of the protocol's foundation. The informational and gas findings outlined mostly minor improvements, with the exception of one finding where the Euler controller was not deactivated properly. No funds were at risk from this issue.

Findings Summary

L-1Finding

L-1: Incorrect disable controller call

Low

Description:

The leverage and deleverage operators that use Euler as the flashloan provider first enable the controller via EVC.enableController() and then disable it via EVC.disableController(), which is incorrect, since the controller must disable itself.

120:         eulerFL_items[0] = IEVC.BatchItem({
121:             targetContract: address(EULER_EVC),
122:             onBehalfOfAccount: address(0),
123:             value: 0,
124:             data: abi.encodeCall(IEVC.enableController, (address(this), address(targetVault)))
125:         });
...          ...
147:         // 5) Disable controller
148:         eulerFL_items[4] = IEVC.BatchItem({
149:             targetContract: address(EULER_EVC),
150:             onBehalfOfAccount: address(0),
151:             value: 0,
152:             data: abi.encodeCall(IEVC.disableController, (address(this)))
153:         });

Impact:

Low. The controller is not properly disabled and will remain enabled after the leverage or deleverage call.

Recommendation:

In LeverageOperator_EulerFL and DeleverageOperator_EulerFL, change the last element of the Euler batch and call disableController() directly through the targetVault / collateralAsset.

Developer Response:

Fixed in PR#204.

I-1Finding

I-1: Inaccurate comment in `DeleverageOperator_EulerFL`

Informational

Description:

The following comment in onFlashLoan() hints that an automatic pull of assets would settle the Euler debt. However, repayment is explicitly performed using collateralAsset.repay().

177:         // Collateral asset will automatically pull the repayment amount

Impact:

Informational.

Recommendation:

Remove the comment.

Developer Response:

Fixed in PR#206.

I-2Finding

I-2: Unbounded debt repayment in AaveV3TeleportOperator

Informational

Description:

The teleport operation takes the debtAmount as user input and forwards that amount when repaying the debt using AAVE_POOL.repay(). Given that the inner implementation of repay() silently limits the repayment amount to the actual debt, using a higher amount would result in a leftover in the operator.

Impact:

Informational.

Recommendation:

Cap debtAmount to the user's current debt.

Developer Response:

Fixed in PR#208.

I-3Finding

I-3: Morpho references in Euler flashloan operators

Informational

Description:

The LeverageOperator_EulerFL and DeleverageOperator_EulerFL contracts refer to Morpho when checking the caller in the flashloan callbacks.

Impact:

Informational.

Recommendation:

Rename the error.

Developer Response:

Fixed in PR#207.

I-4Finding

I-4: Unnecessary 10 wei addition to flashloan amount

Informational

Description:

The executeTeleport() function inside AaveV3TeleportOperator adds 10 wei to the Morpho flashloan amount. It's unclear why this value is added, especially if a user already provides the full debt amount or type(uint256).max.

Inside onMorphoFlashLoan(), debtAmount is used for repayment which ignores this 10 wei addition, resulting in useless extra wei being flashloaned.

Impact:

Informational.

Recommendation:

Remove the + 10 from the call.

Developer Response:

Fixed in PR#205.

G-1Finding

G-1: Potential zero value transfers in `DeleverageOperator_EulerFL`

Gas

Description:

The implementation of executeDeleverage() returns the leftovers to the caller without checking if the actual amounts are zero.

134:         IERC20(targetAsset).safeTransfer(msgSender, IERC20(targetAsset).balanceOf(address(this)));
135:         IERC20(underlyingCollateral).safeTransfer(msgSender, IERC20(underlyingCollateral).balanceOf(address(this)));

Impact:

Gas savings.

Recommendation:

Check if balances are zero before transferring the assets.

Developer Response:

Acknowledged.

Final Remarks

The review focused on new operators for AAVE as well as rework on Euler operators. The AAVE operators will be a welcome addition to Twyne's new AAVE integration, while the Euler operators update will allow the use of Euler directly for flashloans instead of Morpho as in the previous version. The review did not discover any medium severity or above issues, highlighting the seriousness of the Twyne team.