ABI validation misses parameterized types and selector collisions
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
Research direction
Start with src/Solcore/Desugarer/ContractDispatch.hs:457 and the abiTypeOf behavior described in the report. Use the two Solidity reproductions to inspect parameterized ADT ABI generation and selector collision handling before dispatch generation. Done means both cases produce the specified structured rejection or supported output, with no compiler exception, partial ABI, or colliding selectors accepted.
Written by the indexing model from the issue text.
Description
ABI validation misses both unsupported type shapes and selector collisions. These independent cases occur in the frontend with legacy typeclass resolution with ABI output enabled and specialization disabled.
Parameterized ADT metadata
Generating ABI metadata for Box<uint256> reaches an internal exception instead of producing a structured diagnostic.
import * from std;
import * from std.dispatch;
import * from std.Generic;
import * from std.ABIGeneric;
enum Box<t> { Box(t) }
contract Repro {
function echo(value: Box<uint256>) public returns (Box<uint256>) {
return value;
}
}
Actual: The process terminates with an unstructured exception:
sol-core: contractAbiJson: cannot represent type in ABI: ... Box [... uint256 ...]
CallStack (from HasCallStack):
error, called at src/Solcore/Desugarer/ContractDispatch.hs:457:15
Repro.abi is left empty in this reproduction. abiTypeOf handles nullary source names but falls through to error for the parameterized ADT.
Expected: Either emit a deliberately supported representation or reject the type with a structured diagnostic, without a compiler exception or partial ABI output.
Distinct methods with the same selector
These distinct method signatures share the same four-byte selector, but the frontend accepts both methods.
import * from std;
import * from std.dispatch;
contract Repro {
function collision_8764(x: uint256) public returns (uint256) {
return x;
}
function collision_99992(x: uint256) public returns (uint256) {
return x;
}
}
Actual: The frontend exits successfully and emits both methods in Repro.abi, although both signatures have selector 0xd443241f.
Expected: Reject distinct external signatures that share a selector before generating dispatch. This report concerns distinct method names; duplicate method names are already rejected by name resolution.
- 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
- 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.
More from argotorg/solcore
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
user feedback: Rename `lam` to `lambda` and give the unit type a namePossibly taken @rodrigogribeiro claimed this 50 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 4/5 3-5 days Newbie friendliness 57/100
All issues in argotorg/solcore
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
IntersectMBO/cardano-ledger#6276 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
OpenZeppelin/canton-contracts#92 ·
Maintainers usually reply within 1 day