Skip to content

Commit

Permalink
fix: properly handle WETH's deposit on fallback in PoolCompressor
Browse files Browse the repository at this point in the history
  • Loading branch information
lekhovitsky committed Mar 4, 2025
1 parent f74f22a commit 80415db
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions contracts/compressors/PoolCompressor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {PoolQuotaKeeperState, QuotaTokenParams} from "../types/PoolQuotaKeeperSt
import {RateKeeperState, Rate} from "../types/RateKeeperState.sol";

import {RAY} from "@gearbox-protocol/core-v3/contracts/libraries/Constants.sol";
import {OptionalCall} from "@gearbox-protocol/core-v3/contracts/libraries/OptionalCall.sol";
import {IRateKeeper} from "@gearbox-protocol/core-v3/contracts/interfaces/base/IRateKeeper.sol";

import {IPoolCompressor} from "../interfaces/IPoolCompressor.sol";
Expand Down Expand Up @@ -46,9 +47,12 @@ contract PoolCompressor is IPoolCompressor {
// CONTRACT PARAMETERS
//
bytes32 defaultContractType = "POOL";
try IUSDT(_pool.underlyingToken()).basisPointsRate() {
defaultContractType = "POOL::USDT";
} catch {}
(bool success,) = OptionalCall.staticCallOptionalSafe({
target: _pool.underlyingToken(),
data: abi.encodeWithSelector(IUSDT.basisPointsRate.selector),
gasAllowance: 10000
});
if (success) defaultContractType = "POOL::USDT";
result.baseParams = BaseLib.getBaseParams(pool, defaultContractType, address(0));

//
Expand Down

0 comments on commit 80415db

Please sign in to comment.