Skip to content

Commit

Permalink
chore: move interaction below effects for deposit
Browse files Browse the repository at this point in the history
  • Loading branch information
jparklev committed Sep 3, 2024
1 parent 62d3706 commit daad4da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contracts/PointTokenVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ contract PointTokenVault is UUPSUpgradeable, AccessControlUpgradeable, Multicall
_setFeeCollector(_feeCollector);
}

// Rebasing and fee-on-transfer tokens must be wrapped before depositing.
// Rebasing and fee-on-transfer tokens must be wrapped before depositing. ie, they are not supported natively.
function deposit(ERC20 _token, uint256 _amount, address _receiver) public {
uint256 cap = caps[address(_token)];

Expand All @@ -122,11 +122,11 @@ contract PointTokenVault is UUPSUpgradeable, AccessControlUpgradeable, Multicall
}
}

_token.safeTransferFrom(msg.sender, address(this), _amount);

balances[_receiver][_token] += _amount;
totalDeposited[address(_token)] += _amount;

_token.safeTransferFrom(msg.sender, address(this), _amount);

emit Deposit(msg.sender, _receiver, address(_token), _amount);
}

Expand Down

0 comments on commit daad4da

Please sign in to comment.