smartcontractkit / smartcontractkit/chainlink
[NODE] ETHABIEncode: type json.Number cannot be converted to decimal.Decimal
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 8.2k
- Forks
- 2k
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 202
Description
Description
When trying to convert an array of json.Number to decimal.Decimal using the pipeline task type "ethabiencode", to then pass the array decimal.Decimal as an argument to a fulfill function of type uint256[], an error occurs:
ETHABIEncode: while converting argument '_data' from <nil> to uint256[]: type json.Number cannot be converted to decimal.Decimal: bad input for task
This error occurs both on floating point and integer numbers
Attaching a screenshot of the job error run from our Chainlink node

Archive with client-example.sol, jobspec.toml: chainlink-issue-ETHABIEncode-type-json.Number-cannot-be-converted-to-decimal.Decimal.zip
Environment
- Network - Polygon Mumbai.
- Chainlink Node (Docker Hub) - v1.10.0
- gas limit - 500000
Steps to Reproduce
- Place jobspec.toml on the Chainlink Node. Change contractAddress and submit_tx.to to your operator's contract address if necessary
- Load the contract client-example.sol to Polygon Mumbai. If necessary, change setChainlinkOracle to your operator's contract address
- Fund deployed client-example.sol contract with 0.75 LINK
- Call the function requestArray("https://raw.githubusercontent.com/oraclelabs-link/chainlink-node-public-jobs/master/example-data/numbers.json", "data,prices,otherPrices") on the client-example.sol contract
- Look at the output from the job run on the chainlink node
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the supplied jobspec.toml with client-example.sol and the numbers.json request against the ethabiencode pipeline. Trace the ETHABIEncode conversion path for json.Number to decimal.Decimal. Done means integer and floating-point array values encode successfully as uint256[] without the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, solidity
- Domain
- blockchain
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100