telosnetwork / teloscan

Telos EVM block explorer for viewing blocks, transactions, contracts, staking, and more
https://teloscan.io
Apache License 2.0
22 stars 25 forks source link

Read/write interface doesn’t handle arrays properly #171

Closed poplexity closed 2 years ago

poplexity commented 2 years ago

Overview

When interacting with the contract function interface, some/all array arguments will incorrectly produce an error.

Steps to reproduce

  1. ensure you have a wallet connected
  2. Go to https://www.teloscan.io/address/0xb9239af0697c8efb42cba3568424b06753c6da71#contract
  3. Click on the Write tab
  4. Scroll down to the method swapETHForExactTokens
  5. enter values shown in the screenshot below (any address can be used)
  6. note the error

Current behavior

Method call fails with the error Result (uint256[]): invalid value for array (argument="value", value="[0x160505F3dfD1cb58B91e322c828Ae0F74c043c3C]", code=INVALID_ARGUMENT, version=contracts/5.7.0)

Note: need to determine a set of valid values that should work, not just error in a different way

Expected behavior

method should fail for a different reason, this error suggests an issue with parsing array type arguments (possibly only address[] in this case). The fix for this should be tested to at least not break (or fix, if they're broken) the currently-implemented argument types, uint256 and uint256[] along with introducing a working address[] and address. Implementation of other parameter types as well as improved error UI will be handled in #104

additionally:

poplexity commented 2 years ago

718703BD-A32A-4CBD-83CA-267FA475090E

ezra-sg commented 2 years ago

this issue is a subset of https://github.com/telosnetwork/teloscan/issues/104

ezra-sg commented 2 years ago

Need some more info to work on this, especially steps to reproduce

https://github.com/telosnetwork/.github/blob/main/.github/ISSUE_TEMPLATE/bug_report.md

poplexity commented 2 years ago

You can reproduce on this contract using the write function swapETHForExactTokens and the parameters as noted in the screenshot image

ezra-sg commented 2 years ago

note: the PR for this issue covered parameter types address, address[n?], bool, bool[n?], and string