Skip to content

Commit

Permalink
Changed links to https://eips.ethereum.org
Browse files Browse the repository at this point in the history
  • Loading branch information
genkifs committed Mar 3, 2025
1 parent 121060c commit 64c08a8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions EIPS/eip-7899.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This enables interoperability between smart contracts, particularly in cases whe

## Motivation

Currently, Solidity does not provide a standardized on-chain method for discovering the return types of a function without source code access. Existing workarounds (such as off-chain ABI parsing or predefined mappings) introduce trust assumptions and inefficiencies. [EIP-165](./eip-165.md) is used to confirm if a contract has implemented this EIP to provide encoded return types. This makes the approach an optional parallel implementation that augments existing ABI practices without interference. The contract requesting and decoding return type information is not required to implement any interface or functionality.
Currently, Solidity does not provide a standardized on-chain method for discovering the return types of a function without source code access. Existing workarounds (such as off-chain ABI parsing or predefined mappings) introduce trust assumptions and inefficiencies. [EIP-165](https://eips.ethereum.org/EIPS/eip-165) is used to confirm if a contract has implemented this EIP to provide encoded return types. This makes the approach an optional parallel implementation that augments existing ABI practices without interference. The contract requesting and decoding return type information is not required to implement any interface or functionality.

Check failure on line 24 in EIPS/eip-7899.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

references to proposals with a `category` of `ERC` must use a prefix of `ERC`

error[markdown-refs]: references to proposals with a `category` of `ERC` must use a prefix of `ERC` --> EIPS/eip-7899.md | 24 | Currently, Solidity does not provide a standardized on-chain method for discovering the return types of a function without source co... | = help: see https://ethereum.github.io/eipw/markdown-refs/

Check failure on line 24 in EIPS/eip-7899.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

error[markdown-rel-links]: non-relative link or image --> EIPS/eip-7899.md | 24 | Currently, Solidity does not provide a standardized on-chain method for discovering the return types of a function without source co... | = help: use `./eip-165.md` instead = help: see https://ethereum.github.io/eipw/markdown-rel-links/


**Use Cases**
Expand All @@ -39,7 +39,7 @@ On-Chain Oracles & Data Feeds: Allow consumers to verify the expected structure

### Encoding Scheme

A function’s return type **MUST** be encoded as a `bytes32` word, where each byte represents a type token. The first `N` bytes (starting at index `0`) **MUST** contain type tokens, while unused bytes **MUST** be set to `0x00`, marking the end of the stream. To identify that the contract can broadcast return types, it **MUST** implement the [EIP-165](./eip-165.md) standard with the `ITypeReturn` interface exposing the function `funcReturn(bytes4)`.
A function’s return type **MUST** be encoded as a `bytes32` word, where each byte represents a type token. The first `N` bytes (starting at index `0`) **MUST** contain type tokens, while unused bytes **MUST** be set to `0x00`, marking the end of the stream. To identify that the contract can broadcast return types, it **MUST** implement the [EIP-165](https://eips.ethereum.org/EIPS/eip-165) standard with the `ITypeReturn` interface exposing the function `funcReturn(bytes4)`.

Check failure on line 42 in EIPS/eip-7899.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

references to proposals with a `category` of `ERC` must use a prefix of `ERC`

error[markdown-refs]: references to proposals with a `category` of `ERC` must use a prefix of `ERC` --> EIPS/eip-7899.md | 42 | A function’s return type **MUST** be encoded as a `bytes32` word, where each byte represents a type token. The first `N` bytes (st... |

Check failure on line 42 in EIPS/eip-7899.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

error[markdown-rel-links]: non-relative link or image --> EIPS/eip-7899.md | 42 | A function’s return type **MUST** be encoded as a `bytes32` word, where each byte represents a type token. The first `N` bytes (st... | = help: use `./eip-165.md` instead


### Token Definitions

Check failure on line 45 in EIPS/eip-7899.md

View workflow job for this annotation

GitHub Actions / Markdown Linter

Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### Token Definitions"]

EIPS/eip-7899.md:45 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### Token Definitions"]
Expand Down Expand Up @@ -131,7 +131,7 @@ This EIP brings a clear, built-in labeling system for smart contracts, just like
### Why Not Use keccak256(ABI)?
[EIP-712](./eip-712.md) encodes types and creates a TYPEHASH from the return string. A simple hash-based approach (e.g., keccak256(abi.encodePacked(returnTypes))) does not allow decoding on-chain without an extensive mapping. Additionally, a hash is not an efficient store of data. This solution fully preserves type structure, allowing contracts to interpret data without off-chain or on-chain lookups.
[EIP-712](https://eips.ethereum.org/EIPS/eip-712) encodes types and creates a TYPEHASH from the return string. A simple hash-based approach (e.g., keccak256(abi.encodePacked(returnTypes))) does not allow decoding on-chain without an extensive mapping. Additionally, a hash is not an efficient store of data. This solution fully preserves type structure, allowing contracts to interpret data without off-chain or on-chain lookups.

Check failure on line 134 in EIPS/eip-7899.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

error[markdown-rel-links]: non-relative link or image --> EIPS/eip-7899.md | 134 | [EIP-712](https://eips.ethereum.org/EIPS/eip-712) encodes types and creates a TYPEHASH from the return string. A simple hash-based ... | = help: use `./eip-712.md` instead
### Gas Efficiency
Expand Down

0 comments on commit 64c08a8

Please sign in to comment.