Make ERC4626 _deposit and _withdraw internal virtual (#3504)

pull/3508/head
Hadrien Croubois 3 years ago committed by GitHub
parent 450c569d78
commit 74738721dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      contracts/token/ERC20/extensions/ERC4626.sol

@ -175,7 +175,7 @@ abstract contract ERC4626 is ERC20, IERC4626 {
address receiver,
uint256 assets,
uint256 shares
) private {
) internal virtual {
// If _asset is ERC777, `transferFrom` can trigger a reenterancy BEFORE the transfer happens through the
// `tokensToSend` hook. On the other hand, the `tokenReceived` hook, that is triggered after the transfer,
// calls the vault, which is assumed not malicious.
@ -198,7 +198,7 @@ abstract contract ERC4626 is ERC20, IERC4626 {
address owner,
uint256 assets,
uint256 shares
) private {
) internal virtual {
if (caller != owner) {
_spendAllowance(owner, caller, shares);
}

Loading…
Cancel
Save