-
Notifications
You must be signed in to change notification settings - Fork 7
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
1 parent
f6f0d56
commit 105248e
Showing
4 changed files
with
127 additions
and
0 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
16 changes: 16 additions & 0 deletions
16
src/base/DecodersAndSanitizers/Protocols/PumpBTCDecoderAndSanitizer.sol
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: MIT | ||
pragma solidity 0.8.21; | ||
|
||
import { BaseDecoderAndSanitizer } from "src/base/DecodersAndSanitizers/BaseDecoderAndSanitizer.sol"; | ||
|
||
abstract contract PumpBTCDecoderAndSanitizer is BaseDecoderAndSanitizer { | ||
//============================== PumpBTC =============================== | ||
|
||
function stake(uint256 amount) external pure virtual returns (bytes memory addressesFound) { | ||
// nothing to sanitize | ||
} | ||
|
||
function unstakeInstant(uint256 amount) external pure virtual returns (bytes memory addressFound) { | ||
// nothing to sanitize | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/base/DecodersAndSanitizers/Protocols/swBTCDecoderAndSanitizer.sol
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,31 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.21; | ||
|
||
import { BaseDecoderAndSanitizer } from "src/base/DecodersAndSanitizers/BaseDecoderAndSanitizer.sol"; | ||
|
||
abstract contract swBTCDecoderAndSanitizer is BaseDecoderAndSanitizer { | ||
//============================== swBTCDecoderAndSanitizer =============================== | ||
|
||
error swBTCDecoderAndSanitizer_ThirdPartyNotSupported(); | ||
|
||
function deposit(uint256, address receiver) external pure virtual returns (bytes memory addressesFound) { | ||
addressesFound = abi.encodePacked(receiver); | ||
} | ||
|
||
function requestWithdraw( | ||
address asset, | ||
uint96 shares, | ||
uint16 maxLoss, | ||
bool allowThirdPartyToComplete | ||
) | ||
external | ||
pure | ||
virtual | ||
returns (bytes memory addressesFound) | ||
{ | ||
if (allowThirdPartyToComplete) { | ||
revert swBTCDecoderAndSanitizer_ThirdPartyNotSupported(); | ||
} | ||
addressesFound = abi.encodePacked(asset); | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
src/base/DecodersAndSanitizers/earnBTCDecoderAndSanitizer.sol
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,55 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity 0.8.21; | ||
|
||
import { | ||
PendleRouterDecoderAndSanitizer, | ||
BaseDecoderAndSanitizer | ||
} from "src/base/DecodersAndSanitizers/Protocols/PendleRouterDecoderAndSanitizer.sol"; | ||
import { PumpBTCDecoderAndSanitizer } from "src/base/DecodersAndSanitizers/Protocols/PumpBTCDecoderAndSanitizer.sol"; | ||
import { swBTCDecoderAndSanitizer } from "src/base/DecodersAndSanitizers/Protocols/swBTCDecoderAndSanitizer.sol"; | ||
import { UniswapV3DecoderAndSanitizer } from "src/base/DecodersAndSanitizers/Protocols/UniswapV3DecoderAndSanitizer.sol"; | ||
import { OneInchDecoderAndSanitizer } from "src/base/DecodersAndSanitizers/Protocols/OneInchDecoderAndSanitizer.sol"; | ||
import { BalancerV2DecoderAndSanitizer } from | ||
"src/base/DecodersAndSanitizers/Protocols/BalancerV2DecoderAndSanitizer.sol"; | ||
import { CurveDecoderAndSanitizer } from "src/base/DecodersAndSanitizers/Protocols/CurveDecoderAndSanitizer.sol"; | ||
|
||
contract earnBTCDecoderAndSanitizer is | ||
PendleRouterDecoderAndSanitizer, | ||
PumpBTCDecoderAndSanitizer, | ||
swBTCDecoderAndSanitizer, | ||
UniswapV3DecoderAndSanitizer, | ||
OneInchDecoderAndSanitizer, | ||
BalancerV2DecoderAndSanitizer, | ||
CurveDecoderAndSanitizer | ||
{ | ||
constructor( | ||
address _boringVault, | ||
address _uniswapV3NonFungiblePositionManager | ||
) | ||
UniswapV3DecoderAndSanitizer(_uniswapV3NonFungiblePositionManager) | ||
BaseDecoderAndSanitizer(_boringVault) | ||
{ } | ||
|
||
function deposit( | ||
uint256, | ||
address receiver | ||
) | ||
external | ||
pure | ||
override(BalancerV2DecoderAndSanitizer, swBTCDecoderAndSanitizer, CurveDecoderAndSanitizer) | ||
returns (bytes memory addressesFound) | ||
{ | ||
addressesFound = abi.encodePacked(receiver); | ||
} | ||
|
||
function withdraw(uint256) | ||
external | ||
pure | ||
override(BalancerV2DecoderAndSanitizer, CurveDecoderAndSanitizer) | ||
returns (bytes memory addressesFound) | ||
{ | ||
// Nothing to sanitize or return | ||
return addressesFound; | ||
} | ||
} |