Skip to content

Commit

Permalink
bug(Reserve): move withdrawAccumulator above external transfer call. …
Browse files Browse the repository at this point in the history
…reentrancy protection. (#192)
  • Loading branch information
kamescg committed Oct 6, 2021
1 parent e12a86a commit 582a504
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contracts/Reserve.sol
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ contract Reserve is IReserve, Manageable {
function withdrawTo(address _recipient, uint256 _amount) external override onlyManagerOrOwner {
_checkpoint();

token.safeTransfer(_recipient, _amount);
withdrawAccumulator += uint224(_amount);

token.safeTransfer(_recipient, _amount);

emit Withdrawn(_recipient, _amount);
}
Expand Down

0 comments on commit 582a504

Please sign in to comment.