Coder Social home page Coder Social logo

multicaller's Introduction

Hi there ๐Ÿ‘‹ I'm Vectorized

Open-source Solidity repositories I'm currently maintaining:

  • Solady Optimized Solidity snippets.
  • ERC721A ERC721 implementation optimized for batch minting.
  • Multicaller Efficient multicaller contracts.
  • DN404 Implementation of a co-joined ERC20 <-> ERC721 pair.

Contact

Direct message or tag me on ๐• for the best response times.

multicaller's People

Contributors

byteevm avatar rustfix avatar vectorized avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

multicaller's Issues

`sender` slot is not always reset

At line 89, the function aggregateWithSender can return early if the data is empty.

// Early return if no data.
if iszero(data.length) { return(returndatasize(), 0x40) }

It happens after the writing in the storage of the sender.

// Set the sender slot temporarily for the span of this transaction.
sstore(returndatasize(), caller())

So in this case the sender is not reset to shl(160, 1).

I would suggest to move the early return above the lines 83-84, or completely remove it.

NB: it saves some gas, because the 3 lines above are not executed then.

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

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.