Skip to content

Commit

Permalink
Merge pull request #55 from Yunbin-Chang/master
Browse files Browse the repository at this point in the history
abi-spec.rst λΆ€λΆ„λ²ˆμ—­
  • Loading branch information
Hyuntae Kim committed Dec 24, 2018
2 parents b492a35 + d0ad218 commit 4713b4a
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions abi-spec.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,36 @@
.. _ABI:

******************************************
Application Binary Interface Specification
μ–΄ν”Œλ¦¬μΌ€μ΄μ…˜ λ°”μ΄λ„ˆλ¦¬ μΈν„°νŽ˜μ΄μŠ€ μ„€λͺ…
******************************************

Basic Design
κΈ°λ³Έ λ””μžμΈ
============

The Application Binary Interface is the standard way to interact with contracts in the Ethereum ecosystem, both
from outside the blockchain and for contract-to-contract interaction. Data is encoded according to its type,
as described in this specification. The encoding is not self describing and thus requires a schema in order to decode.
μ–΄ν”Œλ¦¬μΌ€μ΄μ…˜ λ°”μ΄λ„ˆλ¦¬ μΈν„°νŽ˜μ΄μŠ€λŠ” λΈ”λŸ­μ²΄μΈ λ°–μ—μ„œλ“  μ»¨νŠΈλ ‰νŠΈ λŒ€ μ»¨νŠΈλ ‰νŠΈ μƒν˜Έμž‘μš©μ΄λ“ , 이더리움 μƒνƒœκ³„μ—μ„œ μ»¨νŠΈλ ‰νŠΈλ“€κ³Ό μƒν˜Έμž‘μš© ν•˜λŠ” ν‘œμ€€ 방법 μž…λ‹ˆλ‹€.
이 μ„€λͺ…에 λ‚˜μ™€μžˆλŠ” 것 같이, νƒ€μž…μ— 따라 λ°μ΄ν„°λŠ” 인코딩 λ˜μ–΄ μ§‘λ‹ˆλ‹€.
인코딩은 슀슀둜 μ„€λͺ…ν•˜μ§€ μ•ŠκΈ°λ•Œλ¬Έμ— λ””μ½”λ“œ ν•˜κΈ° μœ„ν•΄ μŠ€ν‚€λ§ˆλ₯Ό μš”κ΅¬ν•©λ‹ˆλ‹€.

We assume the interface functions of a contract are strongly typed, known at compilation time and static. No introspection mechanism will be provided. We assume that all contracts will have the interface definitions of any contracts they call available at compile-time.
μ»¨νŠΈλ ‰νŠΈμ˜ μΈν„°νŽ˜μ΄μŠ€ ν•¨μˆ˜λŠ” 컴파일 νƒ€μž„ 및 μ •μ μœΌλ‘œ μ•Œλ €μ§„ κ°•λ ₯ν•œ ν˜•μ‹μ΄λΌκ³  κ°€μ •ν•©λ‹ˆλ‹€. λ‚΄μ„± λ©”μ»€λ‹ˆμ¦˜μ€ μ œκ³΅λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
λͺ¨λ“  μ»¨νŠΈλ ‰νŠΈμ—λŠ” 컴파일 νƒ€μž„μ— μ‚¬μš©ν•  μˆ˜μžˆλŠ” λͺ¨λ“  μ»¨νŠΈλ ‰νŠΈμ˜ μΈν„°νŽ˜μ΄μŠ€ μ •μ˜κ°€ μžˆλ‹€κ³  κ°€μ •ν•©λ‹ˆλ‹€.

This specification does not address contracts whose interface is dynamic or otherwise known only at run-time. Should these cases become important they can be adequately handled as facilities built within the Ethereum ecosystem.
이 μ„€λͺ…은 μΈν„°νŽ˜μ΄μŠ€κ°€ λ™μ μ΄κ±°λ‚˜ 달리 λŸ°νƒ€μž„μ—λ§Œ μ•Œλ €μ ΈμžˆλŠ” 계약을 닀루지 μ•ŠμŠ΅λ‹ˆλ‹€. μ΄λŸ¬ν•œ 사둀가 μ€‘μš” 해지면 Ethereum μƒνƒœκ³„ 내에 ꡬ좕 된 μ‹œμ„€λ‘œ μ μ ˆν•˜κ²Œ 처리 ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

.. _abi_function_selector:

Function Selector
ν•¨μˆ˜ μ„ νƒμž
=================

The first four bytes of the call data for a function call specifies the function to be called. It is the
first (left, high-order in big-endian) four bytes of the Keccak (SHA-3) hash of the signature of the function. The signature is defined as the canonical expression of the basic prototype, i.e.
the function name with the parenthesised list of parameter types. Parameter types are split by a single comma - no spaces are used.
ν•¨μˆ˜ ν˜ΈμΆœμ„ μœ„ν•œ 호좜 λ°μ΄ν„°μ˜ 첫 4λ°”μ΄νŠΈλŠ” 호좜될 ν•¨μˆ˜λ₯Ό μ§€μ •ν•©λ‹ˆλ‹€. 그것은 ν•¨μˆ˜ μ‹œκ·Έλ‹ˆμ³μ˜ Keccak (SHA-3) ν•΄μ‹œμ˜ 첫 번째(λΉ… μ—”λ””μ•ˆ)μ—μ„œ 4λ°”μ΄νŠΈ μž…λ‹ˆλ‹€. 이 μ‹œκ·Έλ‹ˆμ³λŠ” κΈ°λ³Έ ν”„λ‘œν† μ½œμ˜ 정식 ν‘œν˜„μœΌλ‘œμ¨ μ •μ˜λ©λ‹ˆλ‹€.
λ§€κ°œλ³€μˆ˜ νƒ€μž…μ˜ κ΄„ν˜Έλ‘œ 묢인 λͺ©λ‘μ΄ μžˆλŠ” ν•¨μˆ˜ 이름. 맀개 λ³€μˆ˜ νƒ€μž…μ€ 곡백을 μ‚¬μš©ν•˜μ§€ μ•Šκ³  단일 μ‰Όν‘œλ‘œ κ΅¬λΆ„ν•©λ‹ˆλ‹€.

.. note::
The return type of a function is not part of this signature. In :ref:`Solidity's function overloading <overload-function>` return types are not considered. The reason is to keep function call resolution context-independent.
The JSON description of the ABI however contains both inputs and outputs. See (the :ref:`JSON ABI <abi_json>`)
ν•¨μˆ˜μ˜ λ°˜ν™˜ νƒ€μž…μ€ 이 μ‹œκ·Έλ‹ˆμ³μ˜ 일뢀뢄이 μ•„λ‹™λ‹ˆλ‹€. :ref:`솔리디티 ν•¨μˆ˜ μ˜€λ²„λ‘œλ”© <overload-function>`μ—μ„œ λ°˜ν™˜νƒ€μž…μ€ κ³ λ €ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. κ·Έμ΄μœ λŠ” ν•¨μˆ˜ 호좜 해결을 μ»¨ν…μŠ€νŠΈ λ…λ¦½μ μœΌλ‘œ μœ μ§€ν•˜κΈ° μœ„ν•΄μ„œ μž…λ‹ˆλ‹€. κ·ΈλŸ¬λ‚˜ ABI에 λŒ€ν•œ JSON μ„€λͺ…μ—λŠ” μž…λ ₯κ³Ό 좜λ ₯이 λͺ¨λ‘ λ“€μ–΄ μžˆμŠ΅λ‹ˆλ‹€. (the :ref:`JSON ABI <abi_json>`)λ₯Ό ν™•μΈν•˜μ„Έμš”.

Argument Encoding
인자 인코딩
=================

Starting from the fifth byte, the encoded arguments follow. This encoding is also used in other places, e.g. the return values and also event arguments are encoded in the same way, without the four bytes specifying the function.
λ‹€μ„― 번째 λ°”μ΄νŠΈλΆ€ν„° 인코딩 된 μΈμˆ˜κ°€μ˜΅λ‹ˆλ‹€. 이 인코딩은 λ‹€λ₯Έ μž₯μ†Œμ—μ„œλ„ μ‚¬μš©λ©λ‹ˆλ‹€ (예 : λ°˜ν™˜ κ°’κ³Ό 이벀트 μΈμˆ˜λŠ” ν•¨μˆ˜λ₯Ό μ§€μ •ν•˜λŠ” 4 λ°”μ΄νŠΈκ°€μ—†λŠ” λ™μΌν•œ λ°©μ‹μœΌλ‘œ μΈμ½”λ”©λ©λ‹ˆλ‹€.

Types
=====
Expand Down

0 comments on commit 4713b4a

Please sign in to comment.