Skip to content

Commit

Permalink
add documentation comment to RevenueTrader._distributeTokenToBuy()
Browse files Browse the repository at this point in the history
  • Loading branch information
tbrent committed Oct 10, 2023
1 parent 3b2b579 commit 233eec6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contracts/p0/RevenueTrader.sol
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ contract RevenueTraderP0 is TradingP0, IRevenueTrader {
uint256 bal = tokenToBuy.balanceOf(address(this));
tokenToBuy.safeApprove(address(main.distributor()), 0);
tokenToBuy.safeApprove(address(main.distributor()), bal);
// do not need to use AllowanceLib.safeApproveFallbackToCustom here because
// tokenToBuy can be assumed to be either RSR or the RToken

main.distributor().distribute(tokenToBuy, bal);
}
}
3 changes: 3 additions & 0 deletions contracts/p1/RevenueTrader.sol
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ contract RevenueTraderP1 is TradingP1, IRevenueTrader {
uint256 bal = tokenToBuy.balanceOf(address(this));
tokenToBuy.safeApprove(address(distributor), 0);
tokenToBuy.safeApprove(address(distributor), bal);

// do not need to use AllowanceLib.safeApproveFallbackToCustom here because
// tokenToBuy can be assumed to be either RSR or the RToken
distributor.distribute(tokenToBuy, bal);
}

Expand Down

0 comments on commit 233eec6

Please sign in to comment.