Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error trying to use a function in a contract #92

Closed
jistro opened this issue Apr 23, 2024 · 5 comments
Closed

Error trying to use a function in a contract #92

jistro opened this issue Apr 23, 2024 · 5 comments

Comments

@jistro
Copy link

jistro commented Apr 23, 2024

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
Copy link
Member

jxom commented Apr 23, 2024

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

@jistro
Copy link
Author

jistro commented Apr 23, 2024

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
Copy link
Member

jxom commented Apr 23, 2024

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

@jistro
Copy link
Author

jistro commented Apr 23, 2024

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
Copy link

gpxl-dev commented Apr 24, 2024

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

@jxom jxom closed this as completed in b8c1828 May 4, 2024
jxom added a commit that referenced this issue May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants