0xProject / 0x-monorepo

0x protocol monorepo - includes our smart contracts and many developer tools
Other
1.41k stars 467 forks source link

geth eth_call support. #2620

Closed dorothy-zbornak closed 4 years ago

dorothy-zbornak commented 4 years ago

Description

This add the types necessary to support geth eth_calls in web3-wrapper and therefore our generated contract wrappers.

Example:

const erc20 = new IERC20TokenContract(TOKEN_ADDRESS, provider, ...);
erc20.balanceOf(...).callAsync({
    overrides: {
        // Override some state of `TOKEN_ADDRESS` during this call to `balanceOf()`.
        // All fields are optional.
        [TOKEN_ADDRESS]: {
            // Override deployed bytecode at `TOKEN_ADDRESS`
            code: '0x....',
            // Override the ETH balance of `TOKEN_ADDRESS`
            balance: 12345,
            // Override the nonce of `TOKEN_ADDRESS`
            nonce: 3,
        },
    },
});

Testing instructions

Types of changes

Checklist: