Skip to content

Commit f79aa66

Browse files
committed
fix: small balancer v3 fixes
1 parent be5bdf8 commit f79aa66

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

contracts/adapters/balancer/BalancerV3RouterAdapter.sol

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ contract BalancerV3RouterAdapter is AbstractAdapter, IBalancerV3RouterAdapter {
2222
bytes32 public constant override contractType = "ADAPTER::BALANCER_V3_ROUTER";
2323
uint256 public constant override version = 3_10;
2424

25-
/// @dev Mapping from pool address to whether it can be traded through the adapter
26-
mapping(address => bool) internal _poolStatus;
27-
2825
/// @dev Set of all pools that are currently allowed
2926
EnumerableSet.AddressSet internal _allowedPools;
3027

@@ -82,7 +79,7 @@ contract BalancerV3RouterAdapter is AbstractAdapter, IBalancerV3RouterAdapter {
8279

8380
address creditAccount = _creditAccount();
8481

85-
uint256 amount = IERC20(address(tokenIn)).balanceOf(creditAccount);
82+
uint256 amount = tokenIn.balanceOf(creditAccount);
8683
if (amount <= leftoverAmount) return false;
8784
unchecked {
8885
amount -= leftoverAmount;
@@ -104,7 +101,7 @@ contract BalancerV3RouterAdapter is AbstractAdapter, IBalancerV3RouterAdapter {
104101

105102
/// @notice Returns whether the pool is allowed to be traded through the adapter
106103
function isPoolAllowed(address pool) public view override returns (bool) {
107-
return _poolStatus[pool];
104+
return _allowedPools.contains(pool);
108105
}
109106

110107
/// @notice Returns the list of all pools that were ever allowed in this adapter
@@ -135,7 +132,6 @@ contract BalancerV3RouterAdapter is AbstractAdapter, IBalancerV3RouterAdapter {
135132
}
136133
}
137134

138-
_poolStatus[pool] = status;
139135
if (status) {
140136
_allowedPools.add(pool);
141137
} else {

0 commit comments

Comments
 (0)