Skip to content

Commit

Permalink
fix: init failing because of zero address in getTokensIn
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlak committed Jun 12, 2024
1 parent da287bc commit 6670583
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/RMM.sol
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,11 @@ contract RMM is ERC20 {
{
// curly braces scope avoids stack too deep
address[] memory tokensIn = SY.getTokensIn();
for (uint256 i; i < tokensIn.length; ++i) {
uint256 length = tokensIn.length;

for (uint256 i; i < length; ++i) {
ERC20 token = ERC20(tokensIn[i]);
token.approve(address(SY), type(uint256).max);
if (address(token) != address(0)) token.approve(address(SY), type(uint256).max);
}
}

Expand Down

0 comments on commit 6670583

Please sign in to comment.