Skip to content

Commit

Permalink
Merge pull request #38 from Hyuntae-91/master
Browse files Browse the repository at this point in the history
Bugs.rst ๋ฒˆ์—ญ์™„๋ฃŒ
  • Loading branch information
Hyuntae Kim committed Dec 6, 2018
2 parents 200f4a9 + 72c1460 commit f711644
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 54 deletions.
105 changes: 53 additions & 52 deletions bugs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,60 @@
.. _known_bugs:

##################
List of Known Bugs
์•Œ๋ ค์ง„ ๋ฒ„๊ทธ ๋ฆฌ์ŠคํŠธ
##################

Below, you can find a JSON-formatted list of some of the known security-relevant bugs in the
Solidity compiler. The file itself is hosted in the `Github repository
<https://github.com/ethereum/solidity/blob/develop/docs/bugs.json>`_.
The list stretches back as far as version 0.3.0, bugs known to be present only
in versions preceding that are not listed.

There is another file called `bugs_by_version.json
<https://github.com/ethereum/solidity/blob/develop/docs/bugs_by_version.json>`_,
which can be used to check which bugs affect a specific version of the compiler.

Contract source verification tools and also other tools interacting with
contracts should consult this list according to the following criteria:

- It is mildly suspicious if a contract was compiled with a nightly
compiler version instead of a released version. This list does not keep
track of unreleased or nightly versions.
- It is also mildly suspicious if a contract was compiled with a version that was
not the most recent at the time the contract was created. For contracts
created from other contracts, you have to follow the creation chain
back to a transaction and use the date of that transaction as creation date.
- It is highly suspicious if a contract was compiled with a compiler that
contains a known bug and the contract was created at a time where a newer
compiler version containing a fix was already released.

The JSON file of known bugs below is an array of objects, one for each bug,
with the following keys:

name
Unique name given to the bug
summary
Short description of the bug
description
Detailed description of the bug
link
URL of a website with more detailed information, optional
introduced
The first published compiler version that contained the bug, optional
fixed
The first published compiler version that did not contain the bug anymore
publish
The date at which the bug became known publicly, optional
severity
Severity of the bug: very low, low, medium, high. Takes into account
discoverability in contract tests, likelihood of occurrence and
potential damage by exploits.
conditions
Conditions that have to be met to trigger the bug. Currently, this
is an object that can contain a boolean value ``optimizer``, which
means that the optimizer has to be switched on to enable the bug.
If no conditions are given, assume that the bug is present.

์•„๋ž˜๋ฅผ ํ™•์ธํ•ด๋ณด๋ฉด, Solidity ์ปดํŒŒ์ผ๋Ÿฌ์—์„œ ์•Œ๋ ค์ง„ ๋ณด์•ˆ ๊ด€๋ จ ๋ฒ„๊ทธ์˜ JSON ํฌ๋งทํ˜•์‹ ๋ฆฌ์ŠคํŠธ๋ฅผ ์ฐพ์„
์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํŒŒ์ผ ์ž์ฒด๋Š” `Github repository
<https://github.com/ethereum/solidity/blob/develop/docs/bugs.json>`_ ์—์„œ ํ˜ธ์ŠคํŒ…๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
์ด ๋ฆฌ์ŠคํŠธ๋Š” 0.3.3 ๋ฒ„์ „๊นŒ์ง€ ๊ฑฐ์Šฌ๋Ÿฌ ์˜ฌ๋ผ๊ฐ€๋ฉฐ, ๊ทธ ์ด์ „์˜ ๋ฒ„์ „์—์„œ ์กด์žฌํ–ˆ์œผ๋‚˜ ์ง€๊ธˆ์€ ์‚ฌ๋ผ์ง„
์•Œ๋ ค์ง„ ๋ฒ„๊ทธ๋“ค์€ ๋ฆฌ์ŠคํŠธ์— ๋„ฃ์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค.

`bugs_by_version.json
<https://github.com/ethereum/solidity/blob/develop/docs/bugs_by_version.json>`_
๋ผ๊ณ  ๋ถˆ๋ฆฌ๋Š” ๋‹ค๋ฅธ ํŒŒ์ผ์ด ์กด์žฌํ•˜๋ฉฐ, ์ด๋Š” ํŠน์ • ์ปดํŒŒ์ผ๋Ÿฌ ๋ฒ„์ „์— ์˜ํ–ฅ์„ ์ฃผ๋Š” ๋ฒ„๊ทธ๋ฅผ
ํ™•์ธํ•˜๋Š”๋ฐ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.




์ปจํŠธ๋ž™ํŠธ ์†Œ์Šค ํ™•์ธ ํˆด๊ณผ ์ปจํŠธ๋ž™ํŠธ์™€ ์ƒํ˜ธ์ž‘์šฉํ•˜๋Š” ํˆด๋“ค์€ ๋‹ค์Œ ๊ธฐ์ค€์— ๋”ฐ๋ผ
๋‹ค์Œ ๋ฆฌ์ŠคํŠธ๋ฅผ ์ฐธ์กฐํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

- ์ปจํŠธ๋ž™ํŠธ๊ฐ€ ๋ฆด๋ฆฌ์ฆˆ๋œ ๋ฒ„์ „์ด ์•„๋‹Œ ์•ŒํŒŒํ…Œ์ŠคํŠธ ์ปดํŒŒ์ผ๋Ÿฌ ๋ฒ„์ „(Nightly compiler version)
์œผ๋กœ ์ปดํŒŒ์ผ ๋œ ๊ฒฝ์šฐ ๋‹ค์†Œ ์˜์‹ฌ์Šค๋Ÿฝ์Šต๋‹ˆ๋‹ค. ์ด ๋ฆฌ์ŠคํŠธ๋Š” ๋ฆด๋ฆฌ์ฆˆ ๋˜์ง€ ์•Š์•˜๊ฑฐ๋‚˜
์•ŒํŒŒํ…Œ์ŠคํŠธ ๋ฒ„์ „์„ ํŠธ๋ž˜ํ‚นํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
- ๋˜ํ•œ ์ปจํŠธ๋ž™ํŠธ๋ฅผ ์ž‘์„ฑํ•œ ์‹œ์ ์—์„œ ๊ฐ€์žฅ ์ตœ์‹  ๋ฒ„์ „์ด ์•„๋‹Œ ์ปดํŒŒ์ผ๋Ÿฌ๋กœ ์ปดํŒŒ์ผ ๋˜์—ˆ๋‹ค๋ฉด
๋‹ค์†Œ ์˜์‹ฌ์Šค๋Ÿฝ์Šต๋‹ˆ๋‹ค. ๋‹ค๋ฅธ ์ปจํŠธ๋ž™ํŠธ๋“ค์— ์˜ํ•ด ๋งŒ๋“ค์–ด์ง„ ์ปจํŠธ๋ž™ํŠธ์˜ ๊ฒฝ์šฐ, ํŠธ๋žœ์ ์…˜์œผ๋กœ
๋Œ์•„๊ฐ€ ์ƒ์„ฑ์ฒด์ธ์„ ๋”ฐ๋ฅด๊ณ  ๊ทธ ํŠธ๋ Œ์ ์…˜์˜ ๋‚ ์งœ๋ฅผ ์ƒ์„ฑ ๋‚ ์งœ๋กœ์จ ์‚ฌ์šฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
- ์•Œ๋ ค์ง„ ๋ฒ„๊ทธ๋ฅผ ํฌํ•จํ•˜๊ณ  ์žˆ๋Š” ์ปดํŒŒ์ผ๋Ÿฌ๋กœ ์ปจํŠธ๋ž™ํŠธ๋ฅผ ์ปดํŒŒ์ผ ํ–ˆ์„ ๊ฒฝ์šฐ, ๊ทธ๋ฆฌ๊ณ 
์ˆ˜์ •๋ณธ์ด ํฌํ•จ๋œ ์ตœ์‹  ์ปดํŒŒ์ผ๋Ÿฌ ๋ฒ„์ „์ด ์ด๋ฏธ ๋ฆด๋ฆฌ์ฆˆ ๋œ ์‹œ์ ์—์„œ ์ปจํŠธ๋ž™ํŠธ๊ฐ€ ๋งŒ๋“ค์–ด์กŒ์„
๊ฒฝ์šฐ, ๋งค์šฐ ์˜์‹ฌ์Šค๋Ÿฝ์Šต๋‹ˆ๋‹ค.

์•„๋ž˜์— ๋‚˜์—ด๋œ ์•Œ๋ ค์ง„ ๋ฒ„๊ทธ๊ฐ€ ์žˆ๋Š” JSON ํŒŒ์ผ์€ ๊ฐ ๋ฒ„๊ทธ๋งˆ๋‹ค ํ•˜๋‚˜์”ฉ ๋‹ค์Œ ํ‚ค๊ฐ€ ์žˆ๋Š”
๊ฐ์ฒด ๋ฐฐ์—ด์ž…๋‹ˆ๋‹ค.

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

.. literalinclude:: bugs.json
:language: js
4 changes: 2 additions & 2 deletions common-patterns.rst
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ fallbackํ•จ์ˆ˜๋ฅผ ๊ฐ€์ง„ ์ปจํŠธ๋ž™ํŠธ ์ฃผ์†Œ๋ฅผ ``richest`` ๋กœ ๋งŒ๋“ค์–ด
// ํŠน์ • ์š”๊ธˆ์„ ์š”๊ตฌํ•ฉ๋‹ˆ๋‹ค.
// ํ˜ธ์ถœ์ž๊ฐ€ ๋„ˆ๋ฌด ๋งŽ์€ ๊ธˆ์•ก์„ ์†ก๊ธˆํ–ˆ์„์‹œ,
// ํ•จ์ˆ˜ ๋ณธ๋ฌธ ์ดํ›„์—๋งŒ ํ™˜๊ธ‰์ด ๋ฉ๋‹ˆ๋‹ค.
// ์ด๋Š” ์†”๋ฆฌ๋””ํ‹ฐ 0.4.0 ์ด์ „์˜ ๋ฒ„์ „์—์„œ๋Š” ์œ„ํ—˜ํ–ˆ์—ˆ๋‹ค.
// `_;` ์ดํ›„์˜ ๋ถ€๋ถ„์€ ์Šคํ‚ต๋  ๊ฐ€๋Šฅ์„ฑ์ด ์žˆ์—ˆ๋‹ค.
// ์ด๋Š” ์†”๋ฆฌ๋””ํ‹ฐ 0.4.0 ์ด์ „์˜ ๋ฒ„์ „์—์„œ๋Š” ์œ„ํ—˜ํ•˜์˜€์Šต๋‹ˆ๋‹ค.
// `_;` ์ดํ›„์˜ ๋ถ€๋ถ„์€ ์Šคํ‚ต๋  ๊ฐ€๋Šฅ์„ฑ์ด ์žˆ์Šต๋‹ˆ๋‹ค.
modifier costs(uint _amount) {
require(msg.value >= _amount);
_;
Expand Down

0 comments on commit f711644

Please sign in to comment.