Coder Social home page Coder Social logo

Comments (3)

libevm avatar libevm commented on August 21, 2024

It would be great to make this as generic as possible and not limit it to certain standards i.e. ERC20 / ERC721.

My API proposal would be something like:

method: 'eth_balanceDeltaBundle'

params: [{
    balanceDelta: [
        // This should return a uint256, for a future PR, we could add a "formatter" akin to the debug_trace*
        // JavaScript runtime environment
        { address: '0x0...', data: '0x0....' } 
    ],
    txs: [ ], // signed or unsigned txs, same as callBundle
    stateBlockNumber: 1,
    blockNumber: 1
}]

For now we can just assume all balances is uint256, and the response should be roughly:

result: {
    balanceDelta: [
        { delta: 100 }
    ],
    txs: [ ... ] // normal callBundle tx return
}

Let me know your thoughts

from mev-geth.

thegostep avatar thegostep commented on August 21, 2024

For now we can just assume all balances is uint256

I like the simplicity of this api. By convention we can deem a null data field to return the ETH balance.

Care must be taken for the result to be an array of signed 256 bit integers.

from mev-geth.

thegostep avatar thegostep commented on August 21, 2024

An even more generalized api would be a pre-flight and post-flight multicall. Though this is probably overkill.

Something like this:

method: 'eth_balanceDeltaBundle'

params: [{
    preCheck: [
        { address: '0x0...', data: '0x0....' } 
    ],
    postCheck: [
        { address: '0x0...', data: '0x0....' } 
    ],
    txs: [ ], // signed or unsigned txs, same as callBundle
    stateBlockNumber: 1,
    blockNumber: 1
}]

result: {
    preCheck: [
        { result: '0x0....' }
    ],
    postCheck: [
        { result: '0x0....' }
    ],
    txs: [ ... ] // normal callBundle tx return
}

from mev-geth.

Related Issues (20)

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.