Skip to content

Commit 12ff9fc

Browse files
committed
fix deposit native
1 parent e55c1ea commit 12ff9fc

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

contracts/VaultAdapter.sol

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,11 @@ contract VaultAdapter is IVaultAdapter, Ownable2StepUpgradeable, UUPSUpgradeable
8383
* @param adapterDeposit The deposit parameters
8484
* @param signature The signature for validation
8585
*/
86-
function depositNative(AdapterDeposit memory adapterDeposit, bytes calldata signature)
87-
external
88-
payable
89-
onlyOperator
90-
{
91-
// Validate native token deposit
92-
if (msg.value != adapterDeposit.amount) {
93-
revert InvalidNativeAmount();
94-
}
95-
86+
function depositNative(AdapterDeposit memory adapterDeposit, bytes calldata signature) external onlyOperator {
9687
// Process the deposit
9788
(uint256 fee, VaultDepositFE memory depositData) = _processDeposit(adapterDeposit, signature);
9889
//Transfer native tokens to the DexVault
99-
uint256 totalValue = msg.value + fee;
90+
uint256 totalValue = adapterDeposit.amount + fee;
10091
IDexVault(dexVault).depositTo{value: totalValue}(adapterDeposit.receiver, depositData);
10192

10293
// Emit event

contracts/interfaces/IVaultAdapter.sol

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ interface IVaultAdapter {
1111
event BrokerAllowedSet(bytes32 brokerHash, bool isAllowed);
1212
event TokenHashToTokenSet(bytes32 tokenHash, address token);
1313
event ProtocolVaultSet(address protocolVault);
14+
1415
//0x82b42900
1516
error Unauthorized();
1617
//0xd92e233d
@@ -24,4 +25,7 @@ interface IVaultAdapter {
2425
error BrokerNotAllowed();
2526
error RecordAlreadyHandled(uint256 recordId);
2627
error InvalidAmount();
28+
29+
function depositTo(AdapterDeposit memory adapterDeposit, bytes calldata signature) external;
30+
function depositNative(AdapterDeposit memory adapterDeposit, bytes calldata signature) external;
2731
}

0 commit comments

Comments
 (0)