Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions EIPS/eip-2069.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---

Check warning on line 1 in EIPS/eip-2069.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

preamble is missing header(s): `description`

warning[preamble-req]: preamble is missing header(s): `description` --> EIPS/eip-2069.md | | = help: see https://ethereum.github.io/eipw/preamble-req/
eip: 2069
title: Recommendation for using YAML ABI in ERCs/EIPs

Check warning on line 3 in EIPS/eip-2069.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

preamble header `title` value is too long (max 44)

warning[preamble-len-title]: preamble header `title` value is too long (max 44) --> EIPS/eip-2069.md:3:7 | 3 | title: Recommendation for using YAML ABI in ERCs/EIPs | ----------------------------------------------- too long | = help: see https://ethereum.github.io/eipw/preamble-len-title/
author: Alex Beregszaszi (@axic)
Expand All @@ -7,15 +7,16 @@
type: Informational
created: 2017-02-11
---

Check warning on line 10 in EIPS/eip-2069.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

body is missing section(s): `Abstract`, `Security Considerations`

warning[markdown-req-section]: body is missing section(s): `Abstract`, `Security Considerations` --> EIPS/eip-2069.md | | = help: must be at the second level (`## Heading`) = help: see https://ethereum.github.io/eipw/markdown-req-section/
## Simple Summary

Check warning on line 11 in EIPS/eip-2069.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

body has extra section(s)

warning[markdown-order-section]: body has extra section(s) --> EIPS/eip-2069.md | 11 | ## Simple Summary | ::: EIPS/eip-2069.md | 97 | ## Implementation | = help: see https://ethereum.github.io/eipw/markdown-order-section/

Recommendation for including contract ABI descriptions in EIPs and ERCs as YAML.

## Motivation

In the past, most ERCs/EIPs included an ABI description purely as a Solidity contract and/or interface. This has several drawbacks:
- Prefers a single language over others and could hinder the development of new languages.

- Prefers a single language over others and could hinder the development of new languages.
- Locks the specification to a certain version of the Solidity language.
- Allows the use of syntactical elements and features of the Solidity language, which may not be well representable in the ABI. This puts other languages at even more disadvantage.

Expand All @@ -23,9 +24,9 @@

## Specification

The [Standard Contract ABI] is usually represented as a JSON object. This works well and several tools – including compilers and clients – support it to handle data encoding.

Check warning on line 27 in EIPS/eip-2069.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

warning[markdown-rel-links]: non-relative link or image --> EIPS/eip-2069.md | 27 | The [Standard Contract ABI] is usually represented as a JSON object. This works well and several tools – including compilers and ... | = help: see https://ethereum.github.io/eipw/markdown-rel-links/

One shortcoming of the JSON description is its inability to contain comments. To counter this, we suggest the use of YAML for providing user readable specifications. Given YAML was designed to be compatible with JSON, several tools exists to convert between the two formats.
One shortcoming of the JSON description is its inability to contain comments. To counter this, we suggest the use of YAML for providing user readable specifications. Given YAML was designed to be compatible with JSON, several tools exist to convert between the two formats.

The following example contains a single function, `transfer` with one input and one output in YAML:

Expand All @@ -49,7 +50,7 @@

Specifications are encouraged to include comments in the YAML ABI.

For details on what fields and values are valid in the ABI, please consult the [Standard Contract ABI] specification.

Check warning on line 53 in EIPS/eip-2069.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

warning[markdown-rel-links]: non-relative link or image --> EIPS/eip-2069.md | 53 | For details on what fields and values are valid in the ABI, please consult the [Standard Contract ABI] specification. |

The same in JSON:

Expand Down Expand Up @@ -83,7 +84,7 @@

## Rationale

The aim was to chose a representation which is well supported by tools and supports comments. While inventing a more concise description language seems like a good idea, it felt as an unnecessary layer of complexity.
The aim was to choose a representation which is well supported by tools and supports comments. While inventing a more concise description language seems like a good idea, it felt as an unnecessary layer of complexity.

## Backwards Compatibility

Expand All @@ -95,7 +96,7 @@

## Implementation

[yamabi] is a Javascript tool to convert between the above YAML and the more widely used JSON format.

Check warning on line 99 in EIPS/eip-2069.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

warning[markdown-rel-links]: non-relative link or image --> EIPS/eip-2069.md | 99 | [yamabi] is a Javascript tool to convert between the above YAML and the more widely used JSON format. |

## Copyright

Expand Down
Loading