Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sender doesn't seem to be forwarded in MulticallerWithSender forge test #37

Closed
stephankmin opened this issue Apr 12, 2024 · 0 comments
Closed

Comments

@stephankmin
Copy link

stephankmin commented Apr 12, 2024

I'm working on a router contract that calls MulticallerWithSender in order to "forward" the router's address as msg.sender.

I set up a test to call transfer on an ERC20 to transfer tokens from the router to bob. But I'm seeing an error that the MulticallerWithSender contract has insufficient balance.

Screenshot 2024-04-12 at 3 07 03 PM

For context, I am using a batch permit2 signature then calling aggregateWithSender:

function permitMulticallWithSender(
        address user,
        ISignatureTransfer.PermitBatchTransferFrom memory permit,
        address[] calldata targets,
        bytes[] calldata data,
        uint256[] calldata values,
        bytes memory permitSignature
    ) external {
        if (permitSignature.length != 0) {
            // Use permit to transfer tokens from user to router
            _handlePermitBatch(user, permit, permitSignature);
        }
        // Perform the multicall and refund to the user
        MULTICALLER_WITH_SENDER.aggregateWithSender(targets, data, values);
    }

This is how I'm calling MulticallerEtcher in setUp():

multicaller = MulticallerEtcher.multicaller();
multicallerWithSender = MulticallerEtcher.multicallerWithSender();

Is there any additional setup I need in my test? Any help would be appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant