Skip to content

Commit

Permalink
feat: tests PendleSwapper
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeNervoXS committed Mar 12, 2024
1 parent 5d8dc69 commit 7609455
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 303 deletions.
1 change: 1 addition & 0 deletions contracts/swapper/LevSwapper/pendle/PendleLevSwapper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ abstract contract PendleLevSwapper is BaseLevSwapper {
function _remove(uint256 amount, bytes memory data) internal override {
uint256 minAmountOut = abi.decode(data, (uint256));
PT().safeTransfer(address(market()), amount);
// We send the SY to the contract itself as it needs a non null balance for the redeem
(uint256 amountSy, ) = market().swapExactPtForSy(address(SY()), amount, hex"");
SY().redeem(address(this), amountSy, address(collateral()), minAmountOut, true);
}
Expand Down
13 changes: 9 additions & 4 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,20 @@ libs = ['node_modules', 'lib']
script = 'scripts/foundry'
cache_path = 'cache-forge'
gas_reports = ["*"]
optimizer_runs=1000000
sizes = true
optimizer = true
optimizer_runs=1000
solc_version = '0.8.22'
# For vaultManagerListing
# optimizer_runs=100


solc_version = '0.8.22'
evm_version = 'shanghai'

ffi = true

[profile.dev]
optimizer = true
via_ir = false

[fuzz]
runs = 500

Expand Down
Loading

0 comments on commit 7609455

Please sign in to comment.