paradigmxyz / rivet

Developer Wallet & DevTools for Anvil
MIT License
844 stars 73 forks source link

Error trying to use a function in a contract #92

Closed jistro closed 7 months ago

jistro commented 7 months ago

Describe the bug It appears that when trying to use a large number or numerous characters for a function makes an undefined error

To Reproduce Steps to reproduce the behaviour:

  1. Use WAGMI's writeContract function
  2. As an input, use a large number (with 10 decimals minimum) or a large string or characters (20 minimum)
  3. Execute the function
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Logs Unexpected Application Error! Cannot read properties of undefined (reading 'length') TypeError: Cannot read properties of undefined (reading 'length') at ds (chrome-extension://mobmnpcacgadhkjfelhpemphmmnggnod/assets/index-enfr707v.js:9:8379) at hx (chrome-extension://mobmnpcacgadhkjfelhpemphmmnggnod/assets/index-enfr707v.js:9:8521) at w1 (chrome-extension://mobmnpcacgadhkjfelhpemphmmnggnod/assets/index-enfr707v.js:26:12176) at Dd (chrome-extension://mobmnpcacgadhkjfelhpemphmmnggnod/assets/index-enfr707v.js:26:12221) at Ol (chrome-extension://mobmnpcacgadhkjfelhpemphmmnggnod/assets/index-enfr707v.js:26:16959) at chrome-extension://mobmnpcacgadhkjfelhpemphmmnggnod/assets/index-enfr707v.js:26:17073 at Array.filter () at oa (chrome-extension://mobmnpcacgadhkjfelhpemphmmnggnod/assets/index-enfr707v.js:26:17041) at sn (chrome-extension://mobmnpcacgadhkjfelhpemphmmnggnod/assets/app-B4-2oi5.js:2:62200) at chrome-extension://mobmnpcacgadhkjfelhpemphmmnggnod/assets/app-B4-2oi5.js:2:60677

Desktop (please complete the following information):

Additional context Using the Bypass Transaction Authorization function doesn't replicate the error

jxom commented 7 months ago

Can you provide more information on the contract and ABI you are using?

jistro commented 7 months ago

Can you provide more information on the contract and ABI you are using?

I'm using a 9 input variable function with some contains address, strings, bytes and uint256 some uint256 are registered with erc20 format

jxom commented 7 months ago

Can you please provide a snippet of the ABI function so I can test this? Thanks.

jistro commented 7 months ago

Can you please provide a snippet of the ABI function so I can test this? Thanks.

function myFunction(
    address _address,
    uint256 _uint1,
    string memory _str,
    uint256 _uint2,
    uint256 _uint3,
    bytes memory _bytes1,
    uint256 _uint4,
    bool _bool,
    bytes memory _bytes2
) public pure returns (bool) {
    // Aquí puedes escribir la lógica de tu función
    // Puedes utilizar los parámetros de entrada para realizar operaciones

    // Ejemplo: Si _bool es verdadero, devuelve true, de lo contrario, devuelve false
    return _bool;
}

In this example _uint3 has at less 6 units maximum (it reads as erc20)

gpxl-dev commented 7 months ago

Hey guys - I hit this error yesterday and haven't had time to investigate properly, but this is what I figured out from a v. short debugging session: