argotorg / argotorg/solidity

Interfaces should not require data locations for dynamic types

Open
#16,077 4 comments 2 reactions 0 assignees View on GitHub
medium effort medium impact should have
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
21

Description

The following should be a valid interface:
```solidity
interface I {
function f(bytes) external returns (bytes);
}
```

It isn't because solc demands a data location on all dynamic types.

The data location of an argument or return value is an implementation concern that the caller does not care about.

Valid implementations of this interface can use either memory or calldata location internally, and that doesn't change the implementation relation.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the compiler validation that requires data locations on dynamic types in interface function parameters and return values. Check the existing compiler tests for interface declarations, then verify that the shown interface compiles while implementations using memory or calldata remain valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, solidity
Domain
blockchain, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.