paradigmxyz/rivet

Error trying to use a function in a contract

Closed this issue · 5 comments

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):

  • OS: POP_OS
  • Browser: Brave
  • Version: 1.64.122

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

jxom commented

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

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

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

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)

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:

  • It comes about when trying to render outputs of a transaction
  • iirc there's a call to outputs.length and outputs is undefined. I couldn't find an instance of outputs.length in the codebase that didn't have an existential operator (?) so was wondering if it might be in a library
  • Could reproduce on calling approve on a token (I think the error was trying to render the outputs of decreaseAllowance or something similar).