audit fix

This commit is contained in:
owen05
2021-04-28 00:04:40 +08:00
parent 706e80cf1e
commit ad1126d59b
5 changed files with 31 additions and 16 deletions

View File

@@ -124,13 +124,14 @@ contract FeeDistributor {
function _claim(address sender, address to) internal {
uint256 allBase = _USER_BASE_REWARDS_[sender];
uint256 allQuote = _USER_QUOTE_REWARDS_[sender];
IERC20(_BASE_TOKEN_).safeTransfer(to, allBase);
IERC20(_QUOTE_TOKEN_).safeTransfer(to, allQuote);
_BASE_RESERVE_ = _BASE_RESERVE_.sub(allBase);
_QUOTE_RESERVE_ = _QUOTE_RESERVE_.sub(allQuote);
_USER_BASE_REWARDS_[sender] = 0;
_USER_QUOTE_REWARDS_[sender] = 0;
IERC20(_BASE_TOKEN_).safeTransfer(to, allBase);
IERC20(_QUOTE_TOKEN_).safeTransfer(to, allQuote);
emit Claim(sender, allBase, allQuote);
}