-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into VEN-1831
- Loading branch information
Showing
202 changed files
with
70,761 additions
and
6,579 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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
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
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 |
---|---|---|
@@ -0,0 +1,95 @@ | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
pragma solidity ^0.8.25; | ||
|
||
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; | ||
|
||
/** | ||
* @title INativeTokenGateway | ||
* @author Venus | ||
* @notice Interface for NativeTokenGateway contract | ||
*/ | ||
interface INativeTokenGateway { | ||
/** | ||
* @dev Emitted when native currency is supplied | ||
*/ | ||
event TokensWrappedAndSupplied(address indexed sender, address indexed vToken, uint256 amount); | ||
|
||
/** | ||
* @dev Emitted when tokens are redeemed and then unwrapped to be sent to user | ||
*/ | ||
event TokensRedeemedAndUnwrapped(address indexed sender, address indexed vToken, uint256 amount); | ||
|
||
/** | ||
* @dev Emitted when native tokens are borrowed and unwrapped | ||
*/ | ||
event TokensBorrowedAndUnwrapped(address indexed sender, address indexed vToken, uint256 amount); | ||
|
||
/** | ||
* @dev Emitted when native currency is wrapped and repaid | ||
*/ | ||
event TokensWrappedAndRepaid(address indexed sender, address indexed vToken, uint256 amount); | ||
|
||
/** | ||
* @dev Emitted when token is swept from the contract | ||
*/ | ||
event SweepToken(address indexed token, address indexed receiver, uint256 amount); | ||
|
||
/** | ||
* @dev Emitted when native asset is swept from the contract | ||
*/ | ||
event SweepNative(address indexed receiver, uint256 amount); | ||
|
||
/** | ||
* @notice Thrown if transfer of native token fails | ||
*/ | ||
error NativeTokenTransferFailed(); | ||
|
||
/** | ||
* @notice Thrown if the supplied address is a zero address where it is not allowed | ||
*/ | ||
error ZeroAddressNotAllowed(); | ||
|
||
/** | ||
* @notice Thrown if the supplied value is 0 where it is not allowed | ||
*/ | ||
error ZeroValueNotAllowed(); | ||
|
||
/** | ||
* @dev Wrap Native Token, get wNativeToken, mint vWNativeTokens, and supply to the market | ||
* @param minter The address on behalf of whom the supply is performed | ||
*/ | ||
function wrapAndSupply(address minter) external payable; | ||
|
||
/** | ||
* @dev Redeem vWNativeTokens, unwrap to Native Token, and send to the user | ||
* @param redeemAmount The amount of underlying tokens to redeem | ||
*/ | ||
function redeemUnderlyingAndUnwrap(uint256 redeemAmount) external; | ||
|
||
/** | ||
* @dev Redeem vWNativeTokens, unwrap to Native Token, and send to the user | ||
* @param redeemTokens The amount of vWNative tokens to redeem | ||
*/ | ||
function redeemAndUnwrap(uint256 redeemTokens) external; | ||
|
||
/** | ||
* @dev Borrow wNativeToken, unwrap to Native Token, and send to the user | ||
* @param amount The amount of underlying tokens to borrow | ||
*/ | ||
function borrowAndUnwrap(uint256 amount) external; | ||
|
||
/** | ||
* @dev Wrap Native Token, repay borrow in the market, and send remaining Native Token to the user | ||
*/ | ||
function wrapAndRepay() external payable; | ||
|
||
/** | ||
* @dev Sweeps input token address tokens from the contract and sends them to the owner | ||
*/ | ||
function sweepToken(IERC20 token) external; | ||
|
||
/** | ||
* @dev Sweeps native assets (Native Token) from the contract and sends them to the owner | ||
*/ | ||
function sweepNative() external; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
pragma solidity ^0.8.25; | ||
|
||
interface IVToken { | ||
function mintBehalf(address receiver, uint256 mintAmount) external returns (uint256); | ||
|
||
function redeemUnderlyingBehalf(address redeemer, uint256 redeemAmount) external returns (uint256); | ||
|
||
function redeemBehalf(address redeemer, uint256 redeemTokens) external returns (uint256); | ||
|
||
function repayBorrowBehalf(address borrower, uint256 repayAmount) external returns (uint256); | ||
|
||
function borrowBehalf(address borrower, uint256 borrowAmount) external returns (uint256); | ||
|
||
function borrowBalanceCurrent(address account) external returns (uint256); | ||
|
||
function underlying() external returns (address); | ||
|
||
function exchangeRateCurrent() external returns (uint256); | ||
|
||
function transferFrom(address from, address to, uint256 amount) external returns (bool); | ||
|
||
function redeem(uint256 redeemTokens) external returns (uint256); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
pragma solidity ^0.8.25; | ||
|
||
interface IWrappedNative { | ||
function deposit() external payable; | ||
|
||
function withdraw(uint256) external; | ||
|
||
function approve(address guy, uint256 wad) external returns (bool); | ||
|
||
function transferFrom(address src, address dst, uint256 wad) external returns (bool); | ||
|
||
function transfer(address dst, uint256 wad) external returns (bool); | ||
|
||
function balanceOf(address account) external view returns (uint256); | ||
} |
Oops, something went wrong.