Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
9b4a131
feat: add Collateral swapper functionality
GitGuru7 Jul 30, 2025
8dda1c6
chore: downgrade zksolc version to 1.5.0
GitGuru7 Jul 31, 2025
4555faa
fix: renamed CollateralSwapper to PositionSwapper
web3rover Aug 11, 2025
4884ea3
feat: utility to swap wbnb to bnb
web3rover Aug 11, 2025
429a814
feat: added debt swap feature
web3rover Aug 11, 2025
75821c6
fix: added unit tests for debt swap
web3rover Aug 13, 2025
dee3f89
fix: expanded tests
web3rover Aug 13, 2025
528402e
fix: fixed imports
web3rover Aug 13, 2025
9e149df
fix: fixed yarn lock
web3rover Aug 13, 2025
c83bb05
fix: fixed compiler error
web3rover Aug 13, 2025
b15c2d7
fix: fixed fork tests
web3rover Aug 13, 2025
2ba681f
fix: use facets with whitelisted feature
web3rover Aug 14, 2025
055a55f
fix: upgrade vtoken
web3rover Aug 14, 2025
35ebe30
fix: implement fork tests for debt swap
web3rover Aug 14, 2025
35e8411
fix: fixed ut
web3rover Aug 14, 2025
1593207
fix: fixed yarn lock
web3rover Aug 14, 2025
2853954
fix: use forceApprove
web3rover Aug 18, 2025
11b59a1
fix: added missing netspec and forceApprove
web3rover Aug 18, 2025
0943f62
fix: fixed lint
web3rover Aug 18, 2025
ea4c952
fix: renamed file
web3rover Aug 18, 2025
f3088b2
fix: vlp-02
web3rover Aug 24, 2025
e4f3997
fix: vps-13
web3rover Aug 25, 2025
540a95e
fix: vlp-04
web3rover Aug 25, 2025
9063796
fix: vps-02
web3rover Aug 25, 2025
8e1c7f9
fix: vps-03
web3rover Aug 25, 2025
f249d4e
fix: vps-04
web3rover Aug 25, 2025
bc86a53
fix: vps-14
web3rover Aug 25, 2025
11c448d
fix: vps-15
web3rover Aug 25, 2025
454b93e
fix: vps-05 and vps-16
web3rover Aug 25, 2025
aeeb8cf
fix: vps-01
web3rover Aug 25, 2025
6f52088
fix: vps-06
web3rover Aug 25, 2025
991d561
fix: vps-07
web3rover Aug 25, 2025
3852699
fix: vlp-02
web3rover Sep 1, 2025
95a87c0
fix: remove duplicate check
web3rover Sep 1, 2025
b209b9f
fix: vps-03
web3rover Sep 1, 2025
b8e00cf
Merge pull request #4 from VenusProtocol/fix/certik-audit
chechu Sep 1, 2025
2625454
fix: vps-02
web3rover Sep 8, 2025
65cb255
fix: vps-03
web3rover Sep 8, 2025
7d8a6ad
fix: vps-01
web3rover Sep 8, 2025
39a501a
Merge pull request #7 from VenusProtocol/fix/certik-reaudit
web3rover Sep 9, 2025
fbccb32
fix: s1
web3rover Sep 11, 2025
7ab4537
fix: s3
web3rover Sep 11, 2025
e052258
Merge pull request #9 from VenusProtocol/feat/VEN-1193-quantstamp-audit
chechu Sep 19, 2025
cff664c
fix: m02
web3rover Sep 15, 2025
89c2e45
Merge pull request #10 from VenusProtocol/feat/VEN-1193-hashdit
web3rover Sep 30, 2025
0c5d144
fix: fixed event name
web3rover Oct 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"not-rely-on-time": "off",
"no-global-import": "error",
"reason-string": ["warn", { "maxLength": 64 }],
"ordering": "error"
"ordering": "warn"
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Venus Periphery is an extension of the Venus Protocol ecosystem that contains au

# Contracts

The first major addition in this repository is the CollateralSwapper, a flexible module that enables users to swap their supplied collateral from one market to another directly within the Venus ecosystem.
The first major addition in this repository is the PositionSwapper, a flexible module that enables users to swap their collateral or debt from one market to another directly within the Venus ecosystem.

# Development

Expand Down
83 changes: 83 additions & 0 deletions contracts/Interfaces.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.8.25;

import { IERC20Upgradeable } from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import { ResilientOracleInterface } from "@venusprotocol/oracle/contracts/interfaces/OracleInterface.sol";

interface IVToken is IERC20Upgradeable {
function accrueInterest() external returns (uint256);

function redeem(uint256 redeemTokens) external returns (uint256);

function redeemUnderlying(uint256 redeemAmount) external returns (uint256);

function borrowBalanceCurrent(address borrower) external returns (uint256);

function balanceOfUnderlying(address owner) external returns (uint256);

function seize(address liquidator, address borrower, uint seizeTokens) external returns (uint);

function mintBehalf(address receiver, uint mintAmount) external returns (uint);

function borrowBehalf(address borrower, uint borrowAmount) external returns (uint256);

function repayBorrowBehalf(address borrower, uint repayAmount) external returns (uint256);

function comptroller() external view returns (IComptroller);

function borrowBalanceStored(address account) external view returns (uint256);

function underlying() external view returns (address);
}

interface IVBNB is IVToken {
function repayBorrowBehalf(address borrower) external payable;

function liquidateBorrow(address borrower, IVToken vTokenCollateral) external payable;
}

interface IComptroller {
enum Action {
MINT,
REDEEM,
BORROW,
REPAY,
SEIZE,
LIQUIDATE,
TRANSFER,
ENTER_MARKET,
EXIT_MARKET
}

function _setActionsPaused(address[] calldata markets_, Action[] calldata actions_, bool paused_) external;

function enterMarkets(address[] calldata vTokens) external returns (uint256[] memory);

function enterMarket(address user, address vToken) external returns (uint256);

function liquidationIncentiveMantissa() external view returns (uint256);

function vaiController() external view returns (address);

function liquidatorContract() external view returns (address);

function oracle() external view returns (ResilientOracleInterface);

function actionPaused(address market, Action action) external view returns (bool);

function markets(address) external view returns (bool, uint256, bool);

function isForcedLiquidationEnabled(address) external view returns (bool);

function approvedDelegates(address borrower, address delegate) external view returns (bool);

function getAccountLiquidity(address account) external view returns (uint256, uint256, uint256);

function checkMembership(address account, IVToken vToken) external view returns (bool);
}

interface IWBNB is IERC20Upgradeable {
function deposit() external payable;

function withdraw(uint256 amount) external;
}
6 changes: 6 additions & 0 deletions contracts/PositionSwapper/ISwapHelper.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.25;

interface ISwapHelper {
function swapInternal(address tokenA, address tokenB, uint256 amount) external payable;
}
Loading
Loading