Primitive word is advertised as uint256 but lacks external ABI evidence

Open
#608 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
haskell
Domain
compilers

Research direction

Start by reading ContractDispatch.abiTypeOf and the standard library definitions for SigString, ABIEncode, and ABIDecode mentioned in the issue. Reproduce the failure with the provided contract using ABI output enabled, specialization disabled, and legacy typeclass resolution. Trace how word is handled in selectors and encoding/decoding, including derived ADT fields and type arguments; done means the compiler supports the advertised representation consistently or rejects it before writing misleading ABI metadata.

Written by the indexing model from the issue text.

Description

ABI metadata represents primitive word as uint256, but std lacks the instances needed to use it at the external ABI boundary. With ABI output enabled and specialization disabled, the frontend with legacy typeclass resolution writes the metadata and then rejects the generated dispatch.

import * from std;
import * from std.dispatch;
contract Repro {
  function echo(value: word) public returns (word) {
    return value;
  }
}

Actual: The compiler writes Repro.abi with uint256 input/output entries, then exits with an error:

error[SC0223]: cannot entail: ABIDecoder<word, CalldataWordReader>: ABIDecode<word>

ContractDispatch.abiTypeOf maps word to uint256, but std has no corresponding word: SigString, word: ABIEncode, or ABIDecoder<word, reader>: ABIDecode<word> instances. The gap also matters when word appears in a derived ADT's fields or type arguments.

Expected: Define a consistent external-ABI policy for primitive word. If the advertised uint256 representation is supported, provide the full selector/encode/decode evidence together. Otherwise reject the unsupported ABI type explicitly before emitting apparently usable metadata.

Dominant language
Haskell
Stars
115
Forks
11
Avg merge
20h 29m
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from argotorg/solcore

All issues in argotorg/solcore

Similar issues

More Haskell issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.