Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
176 lines (119 sloc) 7.85 KB

Solidity

Solidity logo

Solidity๋Š” ์Šค๋งˆํŠธ ์ปจํŠธ๋ž™ํŠธ๋ฅผ ๊ตฌํ˜„ํ•˜๊ธฐ ์œ„ํ•œ ์ปจํŠธ๋ž™ํŠธ ๊ธฐ๋ฐ˜์˜ ๊ณ ๊ธ‰ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด์ž…๋‹ˆ๋‹ค. Solidity๋Š” C++, Python, ๊ทธ๋ฆฌ๊ณ  JavaScript์˜ ์˜ํ–ฅ์„ ๋ฐ›์•„ ๋งŒ๋“ค์–ด์กŒ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  Ethereum Virtual Machine(EVM)์—์„œ ๊ตฌ๋™๋˜๋„๋ก ์„ค๊ณ„๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

Solidity๋Š” ์ •์  ํƒ€์ž…์ด๋ฉฐ, ์ƒ์†, ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๊ทธ๋ฆฌ๊ณ  ๋ณต์žกํ•œ ์‚ฌ์šฉ์ž ์ •์˜ ์ž๋ฃŒํ˜•์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.

๋ฌธ์„œ์—์„œ ์‚ดํŽด๋ณผ ์ˆ˜ ์žˆ๋“ฏ์ด ํˆฌํ‘œ, ํฌ๋ผ์šฐ๋“œ ํŽ€๋”ฉ, ๋ธ”๋ผ์ธ๋“œ ์˜ฅ์…˜, ๋ฉ€ํ‹ฐ ์‹œ๊ทธ ์›”๋žซ ๋“ฑ ๋‹ค์–‘ํ•œ ์ปจํŠธ๋ž™ํŠธ๋ฅผ ์ž‘์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Note

Solidity๋ฅผ ์—ฐ์Šตํ•˜๊ธฐ ๊ฐ€์žฅ ์ข‹์€ ๋ฐฉ๋ฒ•์€ ํ˜„์žฌ Remix (๋กœ๋”ฉ๋˜๋Š”๋ฐ ๋‹ค์†Œ ์‹œ๊ฐ„์ด ๊ฑธ๋ฆด ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.)๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. Remix๋Š” Solidity ์Šค๋งˆํŠธ ์ปจํŠธ๋ž™ํŠธ๋ฅผ ์ž‘์„ฑํ•˜๊ณ , ๋ฐฐํฌํ•˜๊ณ , ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋Š” ์›น ๋ธŒ๋ผ์šฐ์ € ๊ธฐ๋ฐ˜์˜ IDE์ž…๋‹ˆ๋‹ค.

Warning

์†Œํ”„ํŠธ์›จ์–ด๋Š” ์‚ฌ๋žŒ์— ์˜ํ•ด ๋งŒ๋“ค์–ด์ง€๊ธฐ ๋•Œ๋ฌธ์— ๋ฒ„๊ทธ๊ฐ€ ์ƒ๊ธธ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ์Šค๋งˆํŠธ ์ปจํŠธ๋ž™ํŠธ๋Š” ์ž˜ ์•Œ๋ ค์ง„ ๋ชจ๋ฒ”์‚ฌ๋ก€๋“ค์„ ์ฐธ๊ณ ํ•˜์—ฌ ์ž‘์„ฑ๋˜์–ด์•ผํ•ฉ๋‹ˆ๋‹ค. ์Šค๋งˆํŠธ ์ปจํŠธ๋ž™ํŠธ๋ฅผ ์ž‘์„ฑํ•  ๋•Œ๋Š” ์ฝ”๋“œ๋ฆฌ๋ทฐ, ํ…Œ์ŠคํŒ…, ํšŒ๊ณ  ๊ทธ๋ฆฌ๊ณ  ์ •ํ™•์„ฑ ์ฆ๋ช…์„ ํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค. ๋˜ํ•œ ์‚ฌ์šฉ์ž๊ฐ€ ์ฝ”๋“œ ์ž‘์„ฑ์ž๋ณด๋‹ค ์ฝ”๋“œ๋ฅผ ๋” ์‹ ๋ขฐํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ๊ธฐ์–ตํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค. ๋งˆ์ง€๋ง‰์œผ๋กœ, ๋ธ”๋ก์ฒด์ธ ์ž์ฒด์ ์œผ๋กœ ์ฃผ์˜ํ•ด์•ผํ•  ์‚ฌํ•ญ๋“ค์ด ์žˆ์Šต๋‹ˆ๋‹ค. ๋‹ค์Œ ์„น์…˜์„ ์ฐธ์กฐํ•ด ์ฃผ์„ธ์š”. :ref:`security_considerations`.

Notice for Korean

์•„์ง ๋ฒˆ์—ญ์ด ์ง„ํ–‰์ค‘์ž…๋‹ˆ๋‹ค. ๋ˆ„๊ตฌ๋‚˜ ์ฐธ์—ฌํ•˜์‹ค ์ˆ˜ ์žˆ์œผ๋ฉฐ ํ•ด๋‹น solidity-korea/solidity-docs-kr repo ์— ํŽธํ•˜๊ฒŒ Pull Request ์ฃผ์…”์„œ ์ฐธ์—ฌํ•˜์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋ฒˆ์—ญ

This documentation is translated into several languages by community volunteers, but the English version stands as a reference.

์œ ์šฉํ•œ ๋งํฌ

Solidity ํ†ตํ•ฉ ๋„๊ตฌ๋“ค

  • Remix
    ๋ณ„๋„์˜ ์„œ๋ฒ„์—†์ด ์ปดํŒŒ์ผ๋Ÿฌ์™€ ๋Ÿฐํƒ€์ž„ ํ™˜๊ฒฝ์„ ์ œ๊ณตํ•˜๋Š” ๋ธŒ๋ผ์šฐ์ € ๊ธฐ๋ฐ˜์˜ IDE
  • IntelliJ IDEA plugin
    IntelliJ IDEA ๋ฅผ ์œ„ํ•œ Solidity ํ”Œ๋Ÿฌ๊ทธ์ธ (๊ธฐํƒ€ ๋ชจ๋“  JetBrains IDE ํฌํ•จ)
  • Visual Studio Extension
    Solidity ์ปดํŒŒ์ผ๋Ÿฌ๊ฐ€ ํฌํ•จ๋œ Microsoft Visual Studio ํ”Œ๋Ÿฌ๊ทธ์ธ
  • Package for SublimeText โ€” Solidity language syntax
    Sublime Text ๋ฅผ ์œ„ํ•œ Solidity ๋ฌธ๋ฒ• ๊ฐ•์กฐ๊ธฐ
  • Etheratom
    ๋ฌธ๋ฒ• ๊ฐ•์กฐ, ํŽธ์ง‘, ์‹คํ–‰ ํ™˜๊ฒฝ (๋ฐฑ์—”๋“œ ๋…ธ๋“œ ๋ฐ VM ๊ณผ ํ˜ธํ™˜ ๊ฐ€๋Šฅํ•œ) ์„ ์ œ๊ณตํ•˜๋Š” Atom editor ํ”Œ๋Ÿฌ๊ทธ์ธ
  • Atom Solidity Linter
    Solidity linting ์„ ์ œ๊ณตํ•˜๋Š” Atom editor ํ”Œ๋Ÿฌ๊ทธ์ธ
  • Atom Solium Linter
    Solium ๊ธฐ๋ฐ˜์œผ๋กœ, ์‚ฌ์šฉ์ž ์„ค์ •์ด ๊ฐ€๋Šฅํ•œ Atom editor ์šฉ Solidity linter
  • Solium
    Solidity ์—์„œ ์ฝ”๋“œ ์Šคํƒ€์ผ์ด๋‚˜ ๋ณด์•ˆ ์ด์Šˆ๋ฅผ ์ˆ˜์ •ํ•˜๊ณ  ํ™•์ธํ•˜๊ธฐ ์œ„ํ•œ linter
  • Solhint
    Smart Contract ๊ฒ€์ฆ์„ ์œ„ํ•œ Solidity linter. ๋ณด์•ˆ ์‚ฌํ•ญ ๋ฐ ์Šคํƒ€์ผ ๊ฐ€์ด๋“œ, ์ตœ์ ์˜ ๊ด€๋ก€ ์‚ฌํ•ญ(์—ญ์ฃผ: for-loop ์—์„œ index ๋ณ€์ˆ˜๋ช…์„ i ๋กœ ์ถ•์•ฝํ•˜๋Š” ๊ฒƒ ๋“ฑ)์„ ์ œ๊ณตํ•จ.
  • Visual Studio Code extension
    ๋ฌธ๋ฒ• ๊ฐ•์กฐ ๊ธฐ๋Šฅ๊ณผ ์ปดํŒŒ์ผ๋Ÿฌ๋ฅผ ์ œ๊ณตํ•˜๋Š” Microsoft Visual Studio Code ํ”Œ๋Ÿฌ๊ทธ์ธ
  • Emacs Solidity
    ๋ฌธ๋ฒ• ๊ฐ•์กฐ ๊ธฐ๋Šฅ๊ณผ ํŽธ์ง‘ ์—๋Ÿฌ ์•Œ๋ฆผ์„ ์ œ๊ณตํ•˜๋Š” Emacs editor ํ”Œ๋Ÿฌ๊ทธ์ธ
  • Vim Solidity
    ๋ฌธ๋ฒ• ๊ฐ•์กฐ ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•˜๋Š” Vim editor ํ”Œ๋Ÿฌ๊ทธ์ธ
  • Vim Syntastic
    ์ปดํŒŒ์ผ ํ™•์ธ์ด ๊ฐ€๋Šฅํ•œ Vim editor ํ”Œ๋Ÿฌ๊ทธ์ธ

์ง€์›์ด ์ค‘์ง€๋œ ๋„๊ตฌ๋“ค:

  • Mix IDE
    ์Šค๋งˆํŠธ ์ปจํŠธ๋ž™์— ๋Œ€ํ•ด ๋””์ž์ธ, ๋””๋ฒ„๊น…, ํ…Œ์ŠคํŒ…์ด ๊ฐ€๋Šฅํ•œ Qt ๊ธฐ๋ฐ˜์˜ IDE
  • Ethereum Studio
    ์™„๋ฒฝํ•œ Ethereum ํ™˜๊ฒฝ์— ๋Œ€ํ•œ shell ์•ก์„ธ์Šค๋ฅผ ์ œ๊ณตํ•˜๋Š” ํŠน์ˆ˜(ํŠนํ™”๋œ) ์›น IDE. Specialized web IDE that also provides shell access to a complete Ethereum environment.

Solidity ๋„๊ตฌ๋“ค

  • Dapp
    Solidity ๋ฅผ ์œ„ํ•œ ๋นŒ๋“œ ๋„๊ตฌ, ํŒจํ‚ค์ง€ ๋งค๋‹ˆ์ €, ๋ฐฐํฌ ๋„์šฐ๋ฏธ ๋„๊ตฌ
  • Solidity REPL
    ์ปค๋งจ๋“œ ๋ผ์ธ ๊ธฐ๋ฐ˜์œผ๋กœ Solidity ๋ฅผ ๋ฐ”๋กœ ์‚ฌ์šฉํ•ด๋ณผ ์ˆ˜ ์žˆ๋Š” ๋„๊ตฌ
  • solgraph
    Solidity ํ๋ฆ„์„ ์‹œ๊ฐํ™” ํ•˜๊ณ , ์ž ์žฌ์ ์ธ ๋ณด์•ˆ ์œ„ํ˜‘์„ ๊ฐ•์กฐํ•ด์ฃผ๋Š” ๋„๊ตฌ
  • evmdis
    Raw EVM operations ๋ณด๋‹ค ๋†’์€ ์ถ”์ƒํ™”๋ฅผ ์ œ๊ณตํ•˜๊ธฐ ์œ„ํ•ด ๋ฐ”์ดํŠธ ์ฝ”๋“œ์— ์ง์ ‘ ์ •์  ๋ถ„์„์„ ์ˆ˜ํ–‰ํ•˜๋Š” EVM Disassembler
  • Doxity
    Solidity ๋ฅผ ์œ„ํ•œ ๋ฌธ์„œ ์ƒ์„ฑ๊ธฐ

์„œ๋“œํŒŒํ‹ฐ Solidity ํŒŒ์„œ์™€ ๋ฌธ๋ฒ•

Language Documentation

๋‹ค์Œ ํŽ˜์ด์ง€๋“ค ๋ถ€ํ„ฐ, Solidity ๋กœ ์ž‘์„ฑ๋œ :ref:`๊ฐ„๋‹จํ•œ smart contract <simple-smart-contract>` ๊ณผ :ref:`blockchains <blockchain-basics>`์˜ ๊ธฐ์ดˆ, ๊ทธ๋ฆฌ๊ณ  :ref:`Ethereum Virtual Machine <the-ethereum-virtual-machine>`. ์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

๋‹ค์Œ ์„น์…˜์€ Solidity ์—์„œ ์ œ๊ณตํ•˜๋Š” ๋ช‡๊ฐ€์ง€ ์œ ์šฉํ•œ *๊ธฐ๋Šฅ*์„ ์‚ดํŽด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. :ref:`example contracts <voting>` ๋˜ํ•œ ์ง€๊ธˆ ์‚ฌ์šฉํ•˜์‹œ๋Š” ๋ธŒ๋ผ์šฐ์ €! ์—์„œ๋„ ์ €ํฌ ์ฝ”๋“œ๋ฅผ ์‹คํ–‰์‹œ์ผœ๋ณผ ์ˆ˜ ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ์žŠ์ง€๋งˆ์„ธ์š”!

๋งˆ์ง€๋ง‰ ์„น์…˜์—์„œ๋Š” Solidity ์˜ ๋ชจ๋“  ์ธก๋ฉด์— ๋Œ€ํ•ด์„œ ์‹ฌ๋„ ์žˆ๊ฒŒ ๋‹ค๋ฃน๋‹ˆ๋‹ค.

์ด์™ธ์— ์งˆ๋ฌธ์ด ์žˆ์œผ์‹œ๋‹ค๋ฉด, Ethereum Stackexchange ์—์„œ ๊ฒ€์ƒ‰์ด๋‚˜ ์ง์ ‘ ์งˆ๋ฌธํ•˜์‹ค ์ˆ˜ ์žˆ์œผ๋ฉฐ gitter ์ฑ„๋„ ์—์„œ๋„ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

Solidity ๋‚˜ ์ด ๋ฌธ์„œ์— ๋Œ€ํ•ด ๋ฐœ์ „์„ ์œ„ํ•œ ์•„์ด๋””์–ด๋Š” ํ•ญ์ƒ ํ™˜์˜ํ•ฉ๋‹ˆ๋‹ค. :)

Contents

:ref:`Keyword Index <genindex>`, :ref:`Search Page <search>`

.. toctree::
   :maxdepth: 2

   introduction-to-smart-contracts.rst
   installing-solidity.rst
   solidity-by-example.rst
   solidity-in-depth.rst
   security-considerations.rst
   resource.rst
   using-the-compiler.rst
   metadata.rst
   abi-spec.rst
   yul.rst
   style-guide.rst
   common-patterns.rst
   bugs.rst
   contributing.rst
   frequently-asked-questions.rst
   lll.rst