0

The child contract's method is: (1)

function redeem(
        uint256 shares,
        address receiver,
        address owner
    ) public override andSync returns (uint256 assets) {
        return super.redeem(shares, receiver, owner);
    }

The parent contract's method is: (2)

function redeem(
        uint256 shares,
        address receiver,
        address owner
    ) public virtual returns (uint256 assets) {
        if (msg.sender != owner) {
            uint256 allowed = allowance[owner][msg.sender]; // Saves gas for limited approvals.

            if (allowed != type(uint256).max) allowance[owner][msg.sender] = allowed - shares;
        }

        // Check for rounding error since we round down in previewRedeem.
        require((assets = previewRedeem(shares)) != 0, "ZERO_ASSETS");

        beforeWithdraw(assets, shares);

        _burn(owner, shares);

        emit Withdraw(msg.sender, receiver, owner, assets, shares);

        asset.safeTransfer(receiver, assets);
    }

Who is the msg.sender in (2) when called from (1)?

The child contract inherits the parent contract:

contract MPERC4626 is xERC4626 { ... }

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.