-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
667 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.16; | ||
|
||
interface IFeeVault { | ||
/// @notice Returns the amount of active balance that an account has. | ||
/// @param token The address of the token to check the balance of. To check native currency | ||
/// balance, use address(0) as the token address. | ||
/// @param account The address of the account to check the balance of. | ||
function balances(address token, address account) external view returns (uint256); | ||
interface IFeeVaultEvents { | ||
event Received(address indexed account, address indexed token, uint256 amount); | ||
event Deducted(address indexed account, address indexed token, uint256 amount); | ||
event Collected(address indexed to, address indexed token, uint256 amount); | ||
} | ||
|
||
/// @notice Deposit the specified amount of native currency from the caller. | ||
/// @dev The native currency is represented by address(0) in balances. | ||
/// @param account The account to deposit the native currency for. | ||
function depositNative(address account) external payable; | ||
interface IFeeVaultErrors { | ||
error InvalidAccount(address account); | ||
error InvalidToken(address token); | ||
error InsufficentAllowance(address token, uint256 amount); | ||
error InsufficientBalance(address token, uint256 amount); | ||
error FailedToSendNative(uint256 amount); | ||
error OnlyDeductor(address sender); | ||
} | ||
|
||
/// @notice Deposit the specified amount of the specified token from the caller. | ||
/// @dev MUST approve this contract to spend at least `amount` of `token` before calling this. | ||
/// @param account The account to deposit the tokens to. | ||
/// @param token The address of the token to deposit. | ||
/// @param amount The amount of the token to deposit. | ||
interface IFeeVault is IFeeVaultEvents, IFeeVaultErrors { | ||
function balances(address token, address account) external view returns (uint256); | ||
function depositNative(address account) external payable; | ||
function deposit(address account, address token, uint256 amount) external; | ||
} |
Oops, something went wrong.