2026. 1. 26. 19:36ใComputerScience
1. ETH Advanced
* Trillema – 1. Security - The ability of the blockchain system to operate as expected, defend itself from attacks, bugs, and other unforeseen issues : ๋ณด์
2. Scalability - The ability for a blockchain system to handle an increasingly growing amount of transactions : ํ์ฅ์ฑ
3. Decentralization - Creating a blockchain system that does not rely on a central point of control
- ์ด๋๋ฆฌ์์ ๋ณด์์ ํฌ๊ธฐํ๊ธฐ ์ด๋ ค์, ๋จ์ ๋ ์ค ํ์ค์์ฑ์ ์ฒซ๋ฒ์งธ๋ก ์ ํ
+ ์ด๋๋ฆฌ์ ์์์ ๋กค์ ์ฒด์ธ๋ค์ด ํ์ฅ์ฑ์ ๊ฐ์ ธ๊ฐ๋๋ก ์ค๊ณ
- ๋ค๋ฅธ ์ฒด์ธ๋ค, ์๋ผ๋ -> ํ์ค์์ฑ ํฌ๊ธฐ, ํ์ฅ์ฑ ์ ํ : ์ค์ ๋ก ์ฌ๋๋ค์ด ์ธ๋งํ๋๋ก ๋ง๋ค์
- ๋นํธ์ฝ์ธ (BTH) = ์น๊ตฌํํ ๋๋ณด๋ด๋๋ฐ 10๋ถ์ฉ ๊ฑธ๋ฆฌ๋ ๊ฒ
- How to solve scalability? - 10๊ฐ๋ฅผ 1์ด์ ์ฒ๋ฆฌ vs 100๊ฐ๋ฅผ 10์ด์ ์ฒ๋ฆฌ -> ๋์ ๋ค๋ฆ
- Bandwidth = throughput (๋ ๋ค 10์ผ๋ก ๋์ผ)
- Latency = ๊ฐ์ธ์ ์ ์ฅ์์ 10์ด, 1์ด๋ง๋ค ๊ฒฐ๊ณผ๊ฐ ๋์ค๋ ๊ฒ์ ๋ค๋ฆ
* Layer 1 (ETH) - Data availability layer / Security layer
* Layer 2 - Faster confirmation / Lower transaction cost / Customization
+ 2์ ๋ชจ๋ ๋ด์ฉ layer 1์ ์ฐ์ -> shut-down ๋๋๋ผ๋, 1์์ ๋ฐ์ดํฐ(๋) ํ์ ๊ฐ๋ฅ
= Layer 2์ ๋ชจ๋ tx๋ค์ด layer 1์๋ ์๋ค + ๊ฒ์ฆ์ด ๊ฐ๋ฅํ๋ค (security ์ธก๋ฉด)

- Layer 1๊ณผ 2 ์ฐ๊ฒฐํ๋ smart contract
- ์ฒด์ธ ์ฌ๋จ์์ ์ด์ํ๋ sequencer : tx๋ค์ ๋ธ๋ญ์ ๋ฃ๋๋ค (ํ์ค์ํ ์ด์ O)
- transaction order ์ ์ํจ - MEV : Maximal Extractable Value : ์ต๋์ถ์ถ ๊ฐ๋ฅ๊ฐ์น ๋ฌธ์ O
- Layer 2 tx๋ค์ด ์์ธ ๋ธ๋ญ์ด 1์ tx ํ๋์ ๋ค์ด๊ฐ -> ๋ฌธ์ ๊ฐ ์๊ธฐ๋ฉด ํด๋น tx๋ฅผ 1์ด ์คํ ๊ฐ๋ฅ
- Layer 3๋ Layer 2์ ๊ธฐ๋ก๋จ (Layer1์ security์ ๊ธฐ๋๊ณ ์๋๊ฐ๋ ์๋ฌธ)
- ์ค์ computation (balance ๋ณํ, coin swap ๋ฑ)์ layer 2์์ ๋น ๋ฅด๊ฒ ์ฒ๋ฆฌ, User์๊ฒ ์ ๊ณต


* Types of Rollups
1. Optimistic Rollup - Assume that blocks are generated in a valid way
If there is a single honest validator at least, we can find out invalid blocks in a certain amount of time (๊ฒ์ฆ ์ผ์ฃผ์ผ ๊ฑธ๋ฆผ)
- ํธ๋์ ์ ์ด ๋ฌธ์ ๊ฐ ์๋ค๊ณ ๊ฐ์ ํ๊ณ ์คํ, ํ๋๋ผ๋ ์ ์งํ validator๊ฐ ์๋ค๋ฉด, ๋ฌธ์ ๋ฐ๊ฒฌ, ์ ๋ณด O
- Layer 1์ ์ ๋ถ ์ฌ๋ ค์ ์คํ -> TPS ๋ฎ์ / ๋ฐ์ดํฐ ๋ชจ๋ ์ฌ๋ ค์ผ ํ๋๊น, Privacy ๊ตฌ์ฑ ์ด๋ ต๊ณ ๋น์
- EVM ๊ฑฐ์ ๊ทธ๋๋ก ์ฌ๋ฆด ์ ์๋ค
2. Zero-Knowledge Rollup
- The validity of a block can be proven by zero knowledge
- No need to check validity by the nodes / But generating proof is computationally heavy
- ์์ง์ ๊ธฐ์ – tx ๋ชจ๋ ์คํํ์ง ์์๋, ํธ๋์ญ์ ์ ์ ํจ์ฑ ๊ฒ์ฆ ๊ฐ๋ฅ
- ์ํ์ ๊ฒ์ฆ : ์ฆ๋ช ์ ์์ฑํ๋ ๊ฒ์ด computation ๋ง๋ค / ๋์ ๋งค์ฐ ๋น ๋ฅด๋ค.
- Layer 1์ ๋ชจ๋ ์ฌ๋ฆด ํ์X -> ๋์ TPS / ์์ง์ ์ฆ๋ช ์ด ๊ฐ๋ฅํ ํํ ๋ณํ, ๋ชจ๋ ์๋ฆฌ๋ํฐ์ฝ๋๋ X
- Layer 2์์ Proof ๋ง๋ค ๋๋ง๋ค ์ฐ์ฐ ๋ง์ด ํ์ / ์ฆ๋ช ํ ๋ ์์ง์์ผ๋ก ๋์ฑ trust ๊ฐ๋ฅ
- ETH๋ ์๋ monolithic -> roll up์ด ๋๋ฉด์, exec๋ L2, ๋๋จธ์ง ๋์ L1์ผ๋ก ๊ฐ๊ฒ ๋จ
- Sui, Aptos : monolithic / ์ด๋๋ฆฌ์ ์ง์์์ ํ์๋๋ ๋ง์ ๋ ์ด์ด๋ค -> Modular - celestia : cosmos ๋ณ๋์ ์ฒด์ธ
2. ZKP Zero Knowledge Proof
- A protocol in which one party can convince another party
- some given statement is true / without conveying to the verifier any information
- beyond the mere fact of the statement’s truth (์๋ณธ๋ฐ์ดํฐ ๋ ธ์ถ ์์ด, ์๋๋ฅผ ๊ฒ์ฆ ๊ฐ๋ฅ)
- Prover vs Validator : The Ali Baba Cave
– P๊ฐ B๋ก ๊ฐ๋ ๊ธธ์ ํํจ -> V๊ฐ A๋ก ๋์ค๋ผ ํจ -> P๊ฐ ๋น๋ฒ์ ์์์ผ๋ง ๊ฐ๋ฅ 1
. Completeness : ์์ ์ฑ - Peggy ์ง์ง๋ผ๋ฉด ํ ์คํธ๋ฅผ ๊ณ์ ํต๊ณผ
2. Soundness : ๊ฑด์ ์ฑ - Peggy๊ฐ ๊ฑฐ์ง๋ง์์ด๋ผ๋ฉด ํ๋ฅ ์ ์ผ๋ก ๋คํต๋จ
3. Zero-Knowledge :์์ง์์ฑ - Victor๋ ๋น๋ฐ๋ฒํธ๋, ๋ฌธ ์ฌ๋ ์๋ฆฌ๋ ๋ชจ๋ฆ
- P์ ์ง์์ ์ฆ๋ช ๋ฐ์์ ๋ฟ, ๊ทธ ์ง์ ์์ฒด๋ ๋ชจ๋ฆ
- Peggy proved that she knows the password of the gate without revealing the password.
* Efficiently Verifiable Proofs (NP-proofs)
- Claim ์ฆ๋ช ํ๊ณ ์ ํ๋ ๋ช ์ / P: ์ฆ๋ช ํ๋ ค๋ ์ฌ๋ / V: ๊ฒ์ฆํ๋ ค๋ ์ฌ๋
- Prover : ์๊ฐ ์ ํ X - Verifier : ๋คํญ์๊ฐ: O(n), O(n²), O(n³) ๋ฑ
* NP ๋ฌธ์ = V ๋งค์ฐ ๋น ๋ฆ, P๋ ์ค๋ ๊ณ์ฐ๋ ok - ๊ฒ์ฆ์ด ๋๋ฌด ๋๋ฆฌ๋ฉด ํ๋กํ ์ฝ ์๋ฏธ X
- NP: ๋ต ๊ฒ์ฆํ๊ธฐ๋ ์ฌ์ฐ๋, ๋ต ์ฐพ๊ธฐ๋ ์ด๋ ค์

- P๋ ์๋ก ๋ค๋ฅธ ์ ์ฃผ์ฅ / V๋ ์๋งน = ๋ค๋ฅธ ์์ธ์ง ์ง์ ๋ณผ ์ X, but ๊ฑฐ์ง๋ง์ ์ก์๋ผ ๋ฐฉ๋ฒ์ O
- ๊ฒ์ฆ์ ๋ฌด์์ ๋ค์ง๊ธฐ -> ์ฆ๋ช ์๊ฐ ์ ํ์ ๋ฐ๋ผ์ฌ ์ ์๋์ง ํ์ธ -> ๋ ์ ๋ค๋ฆ์ ZKP ์ฆ๋ช
- ๊ฒ์ฆ์ ๋์ก๋ ๋์ A์ ๊ฒฐ๊ณผ == ์ฆ๋ช ์ ์ถ์ธก -> accept, ๋ค๋ฅด๋ฉด reject (P ๊ฑฐ์ง์ด๋ฉด 1/2 ์ฐ๊ธฐ ing)
- Def: L is an NP-language (or NP-decision problem), if there is a poly (|x|) time verifier V where
- Completeness = True claims have (short) proofs
- Soundness = False theorems have no proofs

* Why do we need random bit b?
- If we only use b = 0, soundness cannot be satisfied. (50% ํ๋ฅ ๋ก๋ ๋ง์ถ ์ ์์)
- z^2 = s * y mod N / we can find s even if we don’t know x (s = z^2 / y mod N)
- Cheating prover can provide the same s repeatedly, but there is no way to verify.
- b๊ฐ random์ด์ด์ผ, ์ ๋ฐ ํ๋ฅ ๋ก ๋ฐ๋ณตํ์ ๋ ์ฌ๊ธฐ๊พผ์ด ๊ฑธ๋ฆผ (soundness ์ถฉ์กฑ๋จ)
+ ZCash (zk-SNARK) – ZKP ์ฌ์ฉ, ์์ ์ ๊ฐ ๊ฐ์ธ์ ๋ณด ๋ ธ์ถ ์์ด, ์ํธ ์ฝ์ธ ์ ์ก ๊ฐ๋ฅ
3. Decentralized Finance
- DeFi = Decentralized Finance
- Decentralized : ์ค์ ๊ธฐ๊ด์ด ์์ ๊ถ์ ๊ฐ์ง X / ์์ฐ์ ์์ ํ ์ฌ๋๋ง์ด ์์ฐ์ ์ด๋์ํด
- Finance : ๊ธ์ต ์๋น์ค (์๊ธ, ๋์ถ, ์์ฐ ๊ฑฐ๋ ๋ฑ)
- KYC = ๊ณ ๊ฐ ํ์ธ : Know Your Customer
- AML = ์๊ธ์ธํ๋ฐฉ์ง : Anti-Money Laundering

* Landscape of DeFi Protocols
- ํ๋กํ ์ฝ ์ค ์ฌ๋ก : staking, lending, DEX, Advanced

3-1. Staking
- ํ ํฐ์ ์์นํ๋ฉด ์ด์ ์ง๊ธ / ์ด์์ ์์ฒ = ํ๋กํ ์ฝ์์ ๋ฐ์ํ๋ ์ธํ๋ ์ด์ ์ ์ด์๋ก ์ง๊ธ
- PoS(Proof of Stake) ํฉ์ ์๊ณ ๋ฆฌ์ฆ์ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ ๋ง์ด ์ฌ์ฉ
* ETH Consensus - The Merge ์ดํ PoS ์ฒด์ธ ์ ํ / ๋ ธ๋ ๊ฒ์ฆ์ ๋๋ ค๋ฉด 32 ETH ํ์
- ๊ฒ์ฆ์๋ ๋ธ๋ก ์ ์ + ์ ์๋ ๋ธ๋ก์ ์ ํจ์ฑ ๊ฒ์ฆ / ์ ์ · ๊ฒ์ฆ ๊ฒฐ๊ณผ์ ๋ฐ๋ผ ๋ฆฌ์๋ ์์ทจ
* ETH Staking (1, 2 = 32 ETH need vs 3, 4 = ๊ผญ 32๊ฐ ์์ด๋ ๋จ)
1. Solo Staking = ๋ณธ์ธ์ด ์ง์ ๋ ธ๋ ์ด์ํ๋ฉฐ, ๋ธ๋ก์ ๊ฒ์ฆํ๊ณ , ๊ทธ์ ๋ง๋ ์ธ์ผํฐ๋ธ๋ฅผ ์์ทจ
2. Staking as a Service = ํด๋ผ์ฐ๋ ์๋น์ค ๋ฑ ํ๋์จ์ด ์ธํ๋ผ๋ฅผ ์ ๊ณตํ๋ ์๋น์ค
+ ์ง์ ๋ ธ๋๋ฅผ ์ด์ํ๋ฏ 32 ETH ์์นํด์ผ ํ๋ฉฐ, ์์ต ๋ชจ๋ ๊ฐ์ ธ๊ฐ ์ ์์ but ๋ ธ๋ ์ด์๋น ์ง์ถ
3. Pool Staking = 32 ETH๋ณด๋ค ์ ์ ์(์์ก)์ผ๋ก ๋ค๋ฅธ ์๋น์ค๋ฅผ ํตํด ์์น, ์ฌ๋ฌ ์ฌ๋ ๋ชจ์์ ์ด์
4. CEX Staking = ์ค์ํ ๊ฑฐ๋์์ ํ ํฐ์ ์ ๊ธํ๊ณ ์ ๊ธ๋ ์์ ๊ธฐ๋ฐ์ผ๋ก ์คํ ์ดํน ๋ฆฌ์๋ ์ง๊ธ
- ์ ์ถ๊ธ ๋น๋ฒ, staking to unstaking 1์ฃผ์ผ ์ ๋ ๊ฑธ๋ฆผ, 100๊ฐ ์ค 50๊ฐ ์ ๋๋ง ์์น ๊ฐ๋ฅ
* Liquid Staking Token, Liquid Staking Derivatives
- ๋จ์ํ ์คํ ์ดํน ๊ธฐ๋ฅ์ ์ ๊ณต X, ์คํ ์ดํนํ๋ฉด ๋ณ๋์ ํ ํฐ์ ์ง๊ธ (10 ETH -> 10 stETH)
- Utility of LST = ETH-stETH ํตํด ์ฆ์ unstake = stETH ์์ฅ์์ ๋ฐ๋ก ํ๋ฉด ์ฆ์ ETH ์ ํ ๊ฐ๋ฅ
- stETH ๋งก๊ธฐ๊ณ ๋ค๋ฅธ ํ ํฐ ๋์ถ (ETH, USDT, etc) -> looping, ๋ ๋ฒ๋ฆฌ์ง (10 -> 15, 20 ๊ฐ๋ฅ)
- wstETH(wrapped) ํตํด compounding ๊ฐ์น ํํํ๋ ํ ํฐ์ผ๋ก ์ ํํ์ฌ DeFi ์ด์ฉ (์นํ์ )
- ETH : stETH = 1:1 ๊ฑฐ์ ๋น์จ ๊ณ ์ , but ์ด์ ์ปดํ์ด๋ฉ X, ์๋ ์ฆ๊ฐ (rebase)
- wstETH = ์๋ ๊ณ ์ , ํ ํฐ์ ๊ฐ์น๊ฐ ์์์ ์ฌ๋ผ๊ฐ, ์ด์ ์ปดํ์ด๋ฉ O
- Liquid = ์ ๋์ฑ, ์คํ ์ดํน์ ํ์์๋, ์๊ธ์ด ๋ฌถ์ด์ง ์๊ณ ๊ณ์ ์ธ ์ ์๋ค๋ ์๋ฏธ
* Kaia Consensus - PoS + PBFT ์ปจ์ผ์์ค ํ์ฉ / ์นด์นด์ค์์ ๊ฐ๋ฐ
- ๋ ธ๋ ๊ฒ์ฆ์๊ฐ ๋๊ธฐ ์ํด์๋ 5M KLAY ํ์ / ๊ฒ์ฆ์๋ ๋ธ๋ก์ ์ ์ or ์ ์๋ ๋ธ๋ก ์ ํจ์ฑ ๊ฒ์ฆ
- ๋งค epoch๋ง๋ค round-robin ๋ฐฉ์์ผ๋ก proposer ์ ์
- Block reward = Validator 50% + Klaytn Community Fund 30% + Klaytn Foundation Fund 20%
3-2. Lending
- Lending · DEX = Protocol ์ฝ์ธ๋ค๊ณผ ์ฐ๊ด์ฑ์ด ๊น์ง๋ ์์, ๋ณ๋์ ์๋น์ค
- ํน์ ํ ํฐ์ ์์น(Deposit)ํ๋ฉด ๋ค๋ฅธ ํ ํฐ์ ๋น๋ฆด(Borrow)์ ์์ like ์ํ
- 10 ETH ์์นํ๊ณ 1000 USDC ๋น๋ฆผ / Deposit์ ๋ํ ์ด์๋ ์ผ๋ง๋ ๋ง์ด ๋น๋ ค๊ฐ๋์ง์ ๋ฐ๋ผ ๋ณ๋
* AAVE – borrow ์ด์์จ๊ณผ supply ์ด์์จ์ ์ฐจ์ด๊ฐ ์๋ฒ ์ ์์ต๋ฅ ์ด ๋จ (์ํ ๊ฐ๋ )
- ๊ณผ๋ด๋ณด๋์ถ (Overcollateralization)
- ๋์ถ์ ๋ฐ๊ธฐ ์ํด์๋ ๋์ถ๋ฐ์ ๊ฐ์น๋ณด๋ค ๋ ๋์ ๊ฐ์น์ ์์น(Deposit)ํด์ผ ํจ (๋ด๋ณด๋ณด๋ค ์ ์ ๋)
- $100๊ฐ์น์ ETH ์์น -> $70์ USDT ๋น๋ฆผ๊ฐ๋ฅ / ๋์ถ๋ฐ์ ๊ฐ์น > ์์น๊ฐ์น ํ๋ฝ -> ์ฒญ์ฐ๋ฐ์
- $100๊ฐ์น์ ETH๊ฐ ํ ํฐ ๊ฐ๊ฒฉ ํ๋ฝ์ ์ํด $70 ๊ฐ์น๊ฐ ๋๋ฉด ์ฒญ์ฐ์ด ์ผ์ด๋ ์ ์๋ค. (์กฐ์ ๊ฐ๋ฅ)
- ํ๋์ ๋ก (Flash Loan)
- ๋ด๋ณด ์์ด ๋์ถ์ ์คํํ๋, ํ ํธ๋์ญ์ ๋ด์์ ๋์ถ์ํ์ด ์๋ฃ๋์ด์ผ ํจ
- ํ๋์ ๋ก ๊ณต๊ฒฉ์ ์ํ ํดํน ์ฌ๋ก ์ฃผ์ ํ์
* Compound (like AAVE)
- cToken - ๋ด๋ณด ํ ํฐ๋ณ๋ก ์์ฑ๋๋ ์ปจํธ๋ํธ / ๋ด๋ณด ํ ํฐ์ ์์นํ๋ฉด ๋น์จ์ ๋ง๊ฒ cToken ๋ฐํ
- mint/redeem/borrow/repay/liquidate / ERC-20 ๊ธฐ๋ฐ ํ ํฐ ํ์ค ์ฌ์ฉ, ๋ค๋ฅธ DeFi์ ๋ค์ ์ด์ฉ ๊ฐ๋ฅ
- ๊ณผ๋ด๋ณด๋์ถ - cToken์ ๊ณ์ข ์ ๋์ฑ์ ๊ธฐ๋ฐ์ผ๋ก ๋์ถ ๊ฐ๋ฅํ ์์ฐ์ ํ์ธ
- ๋ฏธ๋ฆฌ ์ค์ ๋ ๋์ถํ๋๋ณด๋ค ์์ ๊ฒฝ์ฐ์๋ง ๋์ถ ์คํ
* MakerDAO
- DAI – MakerDAO์์ ๋ฐํํ๋ 1๋ฌ๋ฌ์ ๊ฐ์น๋ฅผ ์ ์งํ๋ ํ ํฐ
- ETH๋ ๋ค๋ฅธ ํ ํฐ๋ค์ ๋ด๋ณด๋ก ๋ฐํ๋จ / ๋ด๋ณด์ ๊ฐ์น๊ฐ ๋ถ์กฑํด์ง ๊ฒฝ์ฐ ์ฒญ์ฐ๋จ
- MKR - ๊ฑฐ๋ฒ๋์ค ํ ํฐ
- ์ด๋ค ๋ด๋ณด๋ฌผ๋ค์ ์ธ์ ํ ์ง, ๋ด๋ณด ๋น์จ ๋ฑ์ ํ๋ผ๋ฏธํฐ ์กฐ์ ์ ์ฌ์ฉ / ์์๋ฃ์ ๋ฒ๊ธ์ ์ฌ์ฉ
3-3. DEX
- ๊ฑฐ๋์: CEX (like upbit) vs DEX (ํ์ค์ ๊ฑฐ๋์)
- Decentralized Exchanges
- ์ค๋ ๋ถ์ ์ฑ์ธ ๋๋ง๋ค ํธ๋์ญ์ ์ ๋ง๋ค๊ธฐ ํ๋ฆ : ํธ๋์ญ์ ์์๋ฃ, ํธ๋์ญ์ ์คํ์๊ฐ
- ํ์ค์ํ ๊ฑฐ๋์๋ ๋ค๋ฅธ ํํ์ ๊ตฌํ์ด ํ์ / DB๊ฐ ๋ธ๋ก์ฒด์ธ์ด๊ธฐ ๋๋ฌธ์!
* Uniswap V2
* IL = ๋น์๊ตฌ์ ์์ค / ํ ํฐ ๋ณด์ ๋๋น ์์ค = LP(์ ๋์ฑ ํ์ ๋์ ๋ฃ์ ์ฌ๋)๊ฐ ์ ๋ ์ํด
* Uniswap (DEX) : CEX ์ค๋๋ถ ๋์ , Liquidity Pool์ ์ฝ์ธ์ ๋ฃ์ด๋๊ณ , ์ํ ๊ณต์ ์๋ ๊ฐ๊ฒฉ ๊ฒฐ์
- ์ ๋์ฑ K๋ ์ผ์ , ์ ๋์ฑ ํ์ ๋ฃ์๋ค = ๋งค์/๋งค๋ ๋ฐ์
- V2 : ๋ชจ๋ ๊ฐ๊ฒฉ ๊ตฌ๊ฐ์ ์๊ฒ ์ ๋์ฑ ์ ๊ณต, LP ์์ฐ์ด ๊ฑฐ์ ์ ์ฐ์ด๋ ๊ฐ๊ฒฉ ๊ตฌ๊ฐ์ ๋ฌถ์
- V3 : ํ์ํ ๊ตฌ๊ฐ๋ง ์ ๋์ฑ ์ง์ค, ํจ์จ ์ฆ๊ฐ, ์์ต ์ฆ๊ฐ, ๊ฐ๊ฒฉ์ด ๋ฒ์๋ฅผ ๋์ด๊ฐ๋ฉด ๋นํ์ฑํ (์์ต 0)


+ Slippage : ํ์ ๋(์ ๋์ฑ)์ด ์ ์ผ๋ฉด, ์กฐ๊ธ๋ง ๋ฐ๋์ด๋ ๊ฐ๊ฒฉ ๋ณ๋ ์ฌํด์ ์ํด ๋ฐ์, ๊ฑฐ๋ ๋ถ์์
- V3: ํน์ ๊ตฌ๊ฐ์๋ง ๋์ ๋ชฐ์ ๋ฃ์ผ๋ฉด, ํด๋น ๊ตฌ์ญ์ ์ ๋์ฑ ์ปค์ง -> slippage ๊ฐ์
- but IL ์ฆ๊ฐ ๊ฐ๋ฅ : LP ๊ตฌ๊ฐ์ ๋๊ฐ๋ฉด, (ETH 2000 ๋๋ฌ -> USDT๋ง ๊ฐ๊ฒ ๋จ, ๋ ์ฌ๋ผ๋ ๊ณ์ ๋์นจ)
- V2์ ๋์จ ํ๋กํ ์ฝ, V3์์๋ ํฐ ์๋ฏธ X : ์ข์ ๊ณต๊ฐ์ ์ ๋์ฑ์ ๊น๋ฉด ๋๋๊น
- Curve : ์คํ ์ด๋ธ์ฝ์ธ ๊ฐ ์ค์ ์, ์ฌ๋ฆฌํผ์ง ๊ฑฐ์ X
- 3๊ฐ์ component ์๋ก ์ํธ๋ณด์์ : Staking, Lending, DEX
3-4. Advanced
* DEX Aggregator = ์ฌ๋ฌ DEX์ ๋๋ ์ swap์์ฒญ ๋ณด๋ด๋ฉด slippage ์ต์ํ ๊ฐ๋ฅ
- ์ฌ๋ฌ DEX์์ ์ค์ ๊ฐ๋ฅํ ํ ํฐ์ด ๋ค๋ฅผ ์ ์๋๋ฐ, ์ด๋ฅผ ๋ชจ์์ ํ ๊ตฐ๋ฐ์ ์ค์ ๊ฐ๋ฅ
- ํ๋์ DEX๋ง ์ฌ์ฉํ๋๋ผ๋ routing(pool)์ ์ฌ๋ฌ ๊ฒฝ๋ก๋ฅผ ์ฌ์ฉํ๋ฉด slippage ์ต์ํ ๊ฐ๋ฅ
- ์ต๊ทผ์๋ ์ฌ๋ฌ ์ฒด์ธ์ ๊ฑฐ์น๋ cross-chain aggregator๋ ์กด์ฌ
* Pandle – Yield Tokenization : ์ ํต ๊ธ์ต์ด ๋ธ๋ก์ฒด์ธ De-fi ์ฌ๋ผ์ค๋ ค๊ณ ํจ
- ์ด์ ํ ํฐ๊ณผ ์๊ธ ํ ํฐ์ผ๋ก ๋ถ๋ฆฌ (Principal Token ์๊ธ + Yield Token ์ด์)
- ETH → stETH (์ด์ + ์๊ธ) → SY-stETH → PT-stETH (์๊ธ) + YT-stETH (์ด์)
* Summary
1. Staking : ๋คํธ์ํฌ์ ๋ณด์์ ๊ธฐ์ฌ / ์ด์๋ฅผ ๋ฐ์ ์ ์์ / ์ค์ ์์ฌ๊ฒฐ์ ์ ํฌํํ ์ ์์
- LST๋ฅผ ํตํด ๋ค์ DeFi๋ฅผ ์ด์ฉํ ์ ์์
2. Lending : DeFi์ ์ํ / ์๊ธ · ๋์ถ์ ํตํ ๋ ๋ฒ๋ฆฌ์ง / ๊ณผ๋ด๋ณด๋์ถ / ํ๋์๋ก
3. DEX : Uniswap V2 - CPMM, ์ฌ๋ฆฌํผ์ง(Slippage), ๋น์๊ตฌ์ ์์ค(Impermanent Loss)
- Uniswap V3 - ์ง์คํ๋ ์ ๋์ฑ(Concentrated Liquidity)
- Curve StableSwap - ๊ฐ์น๋ณ๋์ฑ์ด ์ ์ ํ ํฐ์ slippage ์ต์ ํ
4. Advanced : DEX aggregator ํตํ swap ๋น์ฉ ์ต์ ํ
: ํ๋๋ง ์ฌ์ฉํ๋ฉด slippage ์ฆ๊ฐ ๊ฐ๋ฅ, ๋ชจ๋ ๊ฑฐ๋๊ฐ ํ ๊ณณ์ ๋ชฐ๋ฆฌ์ง X (DEX ๋ณ ํ ํฐ ์ ๋์ฑ ๋ค๋ฆ)
- Bridge-DEX aggregator ํตํ multichain swap ๋น์ฉ ์ต์ ํ
- Pendle - ์ด์์ ์๊ธ์ ๋ถ๋ฆฌํ์ฌ ๋ณ๋์ ํ ํฐ์ผ๋ก DeFi ์ด์ฉ
4. Blockchain Service Development
- Web 1.0 : ๋จ๋ฐฉํฅ, ์ง์ ์๋ PC(HW)
- Web 2.0 : ์๋ฐฉํฅ, ํ์ด์ค๋ถ(SNS), ๊ฐ์ธํ๋ ์ปจํ ์ธ ํ๊ฒฝ, ์ค์๊ฐ ์ ๋ณด ๊ตํ
- Web 3.0 : ๋ด ๋ฐ์ดํฐ์ ๋ํ ์ฃผ๊ถ, ๋ธ๋ก์ฒด์ธ, ์ ๋ณด๋ฅผ ๋์ด์ ๊ฐ์น ๊ตํ
+ 2.0์ ์ถ๊ฐ๋ features -> 3.0

- Web 2.0 = ํ๋ก ํธ + ๋ฐฑ์๋ ๋๋จ - ํฐ ํ์์ ๊ฐ๋จํ components
- Web 3.0 = ๋ธ๋ก์ฒด์ธ์ ๋ ํ์ O = Smart Contract / Wallet + Endpoint Node / Indexer / Oracle
+ ๋ธ๋ก์ฒด์ธ ๋คํธ์ํฌ ์์ฒด๊ฐ ๋ฐ๋ก ์ ๊ณตํ ์ ์๋ ๋ฐ์ดํฐ๋ค = indexer
1. Frontend
- Development process is similar to normal Web2 (HTML5/css/javascript/react/vue /flutter)
- The differences : (์ด๋ป๊ฒ ๋ธ๋ก์ฒด์ธ ๊ธฐ์ ๋ค๊ณผ ์ํธ์์ฉ ํ ์ง ๊ณ ๋ฏผ ํ์)
- Wallet / Web3 SDK / RPC request to Blockchain nodes / Blockchain Indexed data
2. Backend
- When designing API/DB schema, need to consider how to interact with blockchain data
- Sometimes, need to listen to the changes of blockchain data / Then, put the changes into DB
3. Smart Contract
- A program deployed on a blockchain network
- This program can be executed only via submitting a transaction
- Anyone can see the change / The change cannot be rolled back (immutable ํน์ฑ)
4. Oracle
- Data outside of the chain can be brought into blockchain
- Typical data = Price feed / Verifiable Random Function to verify lottery-like games
: ์จ์ฒด์ธ ๋ฐ์ดํฐ ์กฐ์์ ์๋์ ์ผ๋ก ์ฌ์, ๋ฐ์ด๋ธ์ค(CEX, ์ธ๋ถ ๊ฐ๊ฒฉ์ ์๋ฏธ)๋ ๊ฐ๊ฒฉ ์กฐ์ ๊ฑฐ์ ๋ถ๊ฐ๋ฅ
5. Wallet
- One of the important components in Web3 industry (like ์ธํฐ๋ท ๋ธ๋ผ์ฐ์ ์ญํ )
- Tx is signed by the wallet
1. Custodial wallet - Private key is owned by the service
- Service can manage the funds of the users / Needs to be regulated
2. non-custodial wallet - Private key is owned by the user (์ฌ์ฉ์ ์์ ์ด ํค ๊ฐ์ง, ๋ณต๊ตฌ๋ถ๊ฐ)
- Service cannot manage the funds of the users / Irrecoverable if the user lost his private key
6. Endpoint Node
- Full node of a blockchain network / entrypoint to read/write the blockchain data
- The node can be managed by : Each service / Endpoint node service providers
- Some of the service names (Ankr, pokt.network, All that node, Quicknode, etc.)
7. Indexer
- Blockchain node itself is insufficient to provide data to the service
- It is inefficient for a node to produce an output of :
the transaction history of an account / events generated by a contract
- For this, indexer is needed (KAS, Etherscan API, Moralis, Alchemy, Covalent, Tatum, The graph)
+ ๋ธ๋ก์ฒด์ธ ๋ ธ๋๋ง์ ์ ๋ณด๋ก๋ ๋ถ์ถฉ๋ถ, ๊ฑฐ๋ ๋ด์ญ ์ถ์ ๋ฑ ์๋น์ค๋ฅผ ์ํ ๋ณ๋์ indexer protocols
5. Solidity
- Smart Contract Language for Ethereum
- Why new language? -> To make language constructs reflecting the blockchain system
- Language for EVM (Ethereum Virtual Machine)


- ์ผ๋ฐ ์ธ์ด: ํ๋ก๊ทธ๋จ ์์ฑ ์, CPU – MEM ๊ณ ๋ ค, ๊ธฐํ ์ฃผ๋ณ ๊ธฐ๊ธฐ – ์ธ์ด์์ ํ์ฅ๋ library ํ์ฉ
- ๋ธ๋ก์ฒด์ธ – storage ํน์ฑ๊น์ง ์ธ์ด๊ฐ ๊ณ ๋ ค (์ฌ๋ฌ ๋์ ์ฅ๋น๊ฐ ๋ชจ๋ ๋์ผํ ๊ตฌ์กฐ, ๊ทธ ์์์ ์ฝ๋ฉ)
+ ํ๋ฐ์ฑ X, A to B ์ก๊ธ ๊ธฐ๋ก์ด ์ฌ๋ผ์ง๋ฉด ์๋๊ณ , ์ ์ฅ๋์ด์ผ ํจ -> ์คํ ๋ฆฌ์ง ๊ณ ๋ ค ํ์
- ๋คํธ์ํฌ ์ฐ๊ฒฐ or ํค๋ณด๋ ๋ฑ ์ฃผ๋ณ ์ฅ์น ์ฐ๊ฒฐ control = ๋ธ๋ก์ฒด์ธ์์๋ ๋ถ๊ฐ๋ฅํจ
- f(x) = y / ๋ธ๋ก์ฒด์ธ์์๋ old state ๋ง x์ ๋ค์ด๊ฐ. Input(N, K) ์ด๋ฐ ๊ฑด ๋ชป ๋ค์ด๊ฐ
* Blockchain Programming Environment
- Smart Contract ์ฌ๋ฌ ์ปดํจํฐ ์์ ๊ฐ์ด ์ฌ๋ผ๊ฐ์ ๋์ํด์ผ ํ๋ค.
- tx๋ฅผ ์ด๋ค ์ปดํจํฐ์์ ์คํํ๋ , ์คํ ๊ฒฐ๊ณผ๋ ๋์ผํด์ผ ํจ -> ๊ทธ๋์ผ consensus ํฉ์ ๊ฐ๋ฅ
- old state์ ์๋ก์ด ์ธํ ๋ค์ด์ฌ ๋, new state๋ ์ด๋ค ์ปดํจํฐ์์ ์คํํ๋ Tx ๊ฒฐ๊ณผ ๋์ผํด์ผ ํจ
- Outside of Blockchain data can’t be accessible -> ์ธ๋ถ์ ์๋ ๋ฐ์ดํฐ๋ ์ ๊ทผ X
- ๋ฐ์ดํฐ ์กฐ์์ transaction์ ํํ๋ก๋ง ์ด๋ฃจ์ด์ ธ์ผ ํ๋ค.

* EVM : Ethereum Virtual Machine
- ์คํ ํ๊ฒฝ = computation <-> data
- stack-based VM (๊ฐ์๋จธ์ ์ ๋๋ถ๋ถ ์คํ ๊ธฐ๋ฐ) vs register-based (์ผ๋ฐ HW, processor)
- EVM : Stack-based VM / Word size: 256 bits = 32 B (x86 = 32, 64bit ๊ตฌ์กฐ๊ฐ ๋ค๋ฆ)
- Precompiled contracts: special & complicated instructions (ecrecover, SHA2-256, RIPEMD-160)
- Gas is measured to pay the transaction fee / gas is calculated based on opcode and operand
: ์ฐ์ฐ๋ง๋ค gas ์ฌ์ฉ์ด ์ฆ๊ฐํจ (gas table)
* Data Types = Value Types / Reference Types / Mapping Types
1. Value Type – ํ๋์ ๊ฐ์ ๊ฐ๊ณ ๊ฐ๋ ๊ฒ (word 1 size = copy ๊ฐ๋ฅ)
* integer (= int 256, **EXP) + overflow, underflow (์๊ณ ์ค๋ฒํ๋ก์ฐ ๋๋ฉด, 10์ต ์ด์ ๋ ์๊ฐ)
: ์๋๋ just wraps, safe math ๋ฑ์ ์ฌ์ฉ -> solidity 0.8.0๋ถํฐ tx revert ๋จ
- floating point ์ฌ์ฉ X / Fixed point number -> int + decimal ์ด๋ ๊ฒ ํํํจ
* Address (20 byte) / Address Payable (์ค์ง์ ์ผ๋ก ๋์ ๋ณด๋ด๋ ์ฃผ์)
- payable -> address : implicit conversion is allowed
- address -> payable : To convert, payable(<address>) is required
- other types -> address : Explicitly convertible from uint160, integer literals, bytes20, contract
- other types -> payable : only address and contract are allowed
- Members
- balance (ETH ์๊ณ , read native coin balance of the account)
- transfer : revert if (not enough balance, rejected from the recipient account)
ex) x.transfer(10) -> x์ ์๊ณ ๊ฐ 10๋งํผ ์๋ค๋ฉด -> ํธ๋์ญ์ ์คํจ
+ Tansfer๋ ์คํจํ๋ฉด Revert, send๋ ์คํจํ๋๋ผ๋ false return (๋ค๋ฅธ ๋์ ๊ตฌํ ๊ฐ๋ฅ)
- Send : low level counterpart of transfer
- returns false if the execution fails
- call, delegatecall, staticcall : low level interface, interact with other contracts
- input parameter should be encoded by using abi.encodeWithSignature
- gas and value can be manually set <- call์ ๋ณด๋ผ ๊ฐ์ค๋ ์ด๋๋ฅผ ์ ์
- storage ๋ณ๊ฒฝ ๊ถํ call, delegate ๋ ๋ค ๊ฐ๋ฅํ๋ฐ ์ฃผ์ฒด๊ฐ ๋ค๋ฆ (B์์ A( )์ ํจ์๋ฅผ ์คํ ์ํด)
- call (B read/write), static(B read only), delegate (A read/write – A์ ์คํ ๋ฆฌ์ง๋ฅผ ๋ณ๊ฒฝํจ)
- ๋๋จธ์ง ๋์ ํธ์ถํ ์ ๊ฐ A / delegate = B์ ์๋ ์ฝ๋๋ก A์ ์คํ ๋ฆฌ์ง์ ์ ๊ทผํ ๊ฒ
- contract ๋ฐฐํฌํ๋ฉด ์์ ๋ถ๊ฐ๋ฅ -> upgradable ๊ฐ๋ (by delegate call)
- context๋ A(์๋ณธ๋ฐ์ดํฐ, storage)๋ฅผ ์ฌ์ฉ, implementation์ ๊ณ์ ๋ฐ๊ฟ ์ ์๊ฒ (B -> C -> D ๋ฑ)
- ์ค์ ๋ก A์์ B๋ก ๋์ ๋ณด๋ผ ์ X (delegate: value X) – ๋ชจ๋ state์ ๋ํ context ๋ A์ ์์
- code : get the code of a contract
- codehash : get the code hash of a contract (To check whether the address is contract or not)
: contract๊ฐ ์๋๋ผ๋ฉด, hash ๊ฐ์ด nil์ด ๋์ค๊ฒ ๋จ (์ฃผ์๊ฐ contract or EOA์ธ์ง ์ ์ ์์)
* Contract
- User-defined type / Represents a deployed smart contract / Can deploy a contract runtime
- Explicitly converted from address / Accessible members (Functions/variables declared as public)
* User-defined Value Types (type C is V)
- C is a new user-defined type / V has to be a built-in value type
- C.wrap() and C.unwrap() are the only operators defined implicitly
-> stateMath ๊ตฌํ ๊ฐ๋ฅ (์ค๋ฒํ๋ก์ฐ ๋ฐ์ ์ฌ๋ถ๋ฅผ ์ฒดํฌ)
* Function Types
- function (<parameter types>) {internal|external} [pure|view|payable] [returns <return types>)]
- conversion between functype A and B allowed if and only if
: parameter types are identical / return types are identical / internal/external property is identical
- state mutability of A is more restrictive than B
: pure => view and non-payable / view => non-payable / payable => non-payable
- Pure๋ ํจ์ ๋ด member ๋ณ์ ์ ๊ทผ X, only params๋ง ์ฌ์ฉ
- View๋ ๋ฉค๋ฒ ์ ๊ทผ O, read only / pure view๋ ์๋ ์ผ๋ฐ ํจ์๋ ๋ฉค๋ฒ ์ ๊ทผ O, ์์ ๋ ๊ฐ๋ฅ
- Member
- .address : the address of the contract of the function
- .selector : ABI function selector (func์ด๋ฆ + parameter ์ ์ฒด๋ฅผ string์ผ๋ก hash, 32B ์ค ์์ 4B)
2. Reference Type – copy ํ๊ธฐ์ ํฐ ๊ฐ๋ค, ref ์ง์นญ (structs, arrays, and mappings Data Location)
1. memory : stored in memory / lifetime is limited to a function call
2. storage : stored in the contract storage / lifetime is limited to the lifetime of the contract
3. calldata : special data location for function call / read-only, non-persistent (ํ๋ฐ์ฑ)
- lifetime is limited to a function call
+ ๋ด๊ฐ pointing ํ๋๊ฒ ๋ฉ๋ชจ๋ฆฌ๋ฉด ๋ฐ๋ก ์ฐ๋๋ฐ, ์คํ ๋ฆฌ์ง๋ฉด ๋ถ๋ฌ์์ผ ํจ, ๋ ๊ณต๊ฐ ๋ถ๋ฆฌ
- ์คํ ๋ฆฌ์ง์ ๋ฉ๋ชจ๋ฆฌ ๊ฐ ์ด๋ = gas ์๋ชจ, ์ข์ ํ๋ก๊ทธ๋๋ฐ ์๋
- Assignment between storage and memory = always create an independent copy
- Assignment from memory to memory = only create references, changes will be visible in both
- Assignment from storage to a local storage variable = create a reference
- Other assignments to storage = always copy
- func ๋ฐ๊นฅ์ ์๋ค๋ฉด? = Storage, ๋ฉ๋ชจ๋ฆฌ๋ฅผ ๋ฐ๊นฅ์ ์ ์๋ ๋ณ์ x์ ํ ๋นํ๋ ค๋ฉด, ์ ๋ถ copy ํด์ผํจ
- ๋ฉ๋ชจ๋ฆฌ์ธ๊ฐ ์คํ ๋ฆฌ์ง์ธ๊ฐ์ ๋ฐ๋ผ, ๋ณต์ฌ๊ฐ ๋ ์ง, ref๋ง ๊ฐ์ ธ๊ฐ ์ง๊ฐ ๊ฒฐ์ ๋จ
- dynamic size์ storage array๋ push๋ก ๊ณ์ ๋๋ ค๋๊ฐ ์ ์๋๋ฐ, memory array๋ ๋๋ฆด ์ X
* Array
- Compile-time fixed size (uint[5]) or runtime dynamic size (uint[])
- .push() : initialized with zero and returns the reference
- .push(value) : appends ‘value’ to the end of array
- bytes.concat and string.concat : concatenation of bytes or strings
* Allocating memory arrays
- using new
- Unlike storage arrays, .push() is not allowed. impossible to resize
- Members - length : number of elements / push() : Allowed for dynamic storage arrays
- Append zero-initialized element to the end / Returns the reference / e.g., x.push() = 2;
- push(x) : append x to the end / e.g., x.push(2);
- pop() remove the last element / returns nothing (push ์ฐ์ด์ด ํธ์ถ X)
* Structure - User-defined types / Cannot contain itself
- struct { uint8, uint, uint8 } vs struct { uint8, uint8, uint } = packing ์ฐจ์ด
- ์ฒซ๋ฒ์งธ๋ ์๋ 1๊ฐ 1๊ฐ 1๊ฐ, ์ด 3๊ฐ (32B * 3) / ๋๋ฒ์งธ๋ ์์ ๋์ ์๋ 1๊ฐ, ์๋ 1๊ฐ (32B * 2)
3. Mapping Type
- KeyType = any built-in value type, bytes, string, contract, or enum
- ValueType = any type - KeyName, ValueName = optional
* key data is not stored, keccak256(key) is used for lookup : ๋งคํ์ ์ ์ฒด ๊ธธ์ด ์ด๋ฐ๊ฑฐ ๋ถ๊ฐ๋ฅ
* Layout of a Solidity Source File
- SPDX License Identifier : SPDX (System Package Data Exchange) / MIT, GPL-3.0, Apache-2.0
- pragma: ์ด๋ค ์ปดํ์ผ๋ฌ ๋ฒ์ ์ด์๋ถํฐ, ์๋ ์ฝ๋๋ฅผ ์ ๋๋ก ๋๋ฆด ์ ์๋ค๋ ๋ช ์
+ ABI Coder (Application Binary Interface) = v1 or v2
- Importing other files : import “filename”; // ๋ค๋ฅธ smart contract import ํด์ฌ ์ ์์
- import "@klaytn/contracts/KIP/token/KIP7/KIP7.sol";
* Constructor ๋ถ๋ฆฌ๋ ์์ = ๋ธ๋ก์ฒด์ธ์ ์ค๋งํธ ์ปจํธ๋ํธ๊ฐ ๋ฐฐํฌ๋๋ ์์
- ์๋ class์ constructor๋ object instantiation (๊ทธ๋ ์์ฑ์๊ฐ ๋ถ๋ฆผ)
- ๋ธ๋ก์ฒด์ธ์์๋ ์ฝ๋๊ฐ ์ค์ ๋ก deploy๊ฐ ๋์์ ๋, ๋ธ๋ก์ฒด์ธ ์์ ์ฌ๋ผ์ฌ ๋, Constructor๊ฐ ๋ถ๋ฆผ
- Only one constructor is allowed /Constructor arguments should be passed when deploying
* State Variable Visibility
1. public : Automatically generates getter functions for public variables
- The value is accessible via getter function
2. internal : Can only be accessed within the contract / Default visibility level
- inaccessible to derived contracts
3. private : same as internal / Not visible in derived contracts
- pure๋ params ๋ฐ์ ๊ฒ๋ง ์ ๊ทผ ๊ฐ๋ฅ / ๋ฉค๋ฒ๋ณ์ ์ ๊ทผํ์ง ์๋ ํจ์ = ์ปดํ์ผ๋ฌ ์ต์ ํ ๊ฐ๋ฅ
- E๊ฐ C๋ฅผ ์์ -> compute ์ ๊ทผ ๊ฐ๋ฅ
* Function Modifiers
- Mostly used to check conditions prior to execution of a function : ํจ์ ์คํ ์ , ์ฒดํฌ์ ํ์ฉ
- Can be overridden if it has virtual
- Multiple modifiers = whitespace-separated list = ์ฌ๋ฌ ๊ฐ ํธ์ถ ์ ๋น ์นธ์ผ๋ก ๋ถ๋ฆฌ
- ‘_’ placeholder = used to denote where the function should be inserted
= _ ์ด ์์น์์ ํจ์๊ฐ ์คํ๋จ
* Function Modifiers
- if ๊ตฌ๋ฌธ ์ถฉ์กฑํ ๋์๋ง ํจ์๋ฅผ ์คํํจ, _ ์์ผ๋ฉด function ์คํ ์๋ ์ ์์
modifier checkSomething() { = ํจ์ ํธ์ถ ์ /ํ์ ์ถ๊ฐ ๋ก์ง์ ์คํํ๋๋ก ํ๋ ๋ฌธ๋ฒ (๋ฏธ๋ค์จ์ด)
// ํจ์ ์คํ ์ ์ ์คํ๋ ์ฝ๋
doCheck();
_ ; // ← ์ฌ๊ธฐ์ ์๋ ํจ์๊ฐ ์คํ๋จ = modifier ๋ด๋ถ์์ ์ฌ๊ธฐ ์๋ ํจ์ ์คํํด๋ผ๋ ์์น ํ์
// ํจ์ ์คํ ํ์ ์คํ๋ ์ฝ๋
doAfter();
}
- constant = ๊ณ ์ ๊ฐ (์ปดํ์ผ ํ์)
- immutable = ์์ฑ์ ์์์๋ง(์ด๊ธฐ ๋ฐฐํฌ) ์ ๋ฐ์ดํธ ๊ฐ๋ฅ, ๋ค๋ฅธ ๊ณณ์ read๋ง ๊ฐ๋ฅ
- ์ค์ contract ๊ฐ ๋ธ๋ก์ฒด์ธ ์์ ๋ฐฐํฌ๊ฐ ๋ ๋ ๊ฒฐ์ ๋๋ ๊ฐ ์๋ฏธ
* receive
- External = ์ธ๋ถ์์ ํธ์ถ ๊ฐ๋ฅํ ํจ์ / payable = ์ด ์ปจํธ๋ํธ๊ฐ ETH๋ฅผ ์ด ํจ์ ํตํด ๋ฐ์ ๊ฑฐ์ผ.
- ๋๊ฐ ๋์๊ฒ ๋ณด๋๋? Or ์ผ๋ง๋งํผ ๋ณด๋๋?
* fallback
- ์์ํ์ง ๋ชปํ ํธ์ถ์ ๋ฐ์ ๋, ์คํ๋๋ ์๋น ์ฒ๋ฆฌ ํจ์
-> ์ ๋ค ๋ง์ง ์์ -> fallback ํธ์ถ
* Events
- Logging functionality of contracts
- Applications can subscribe and listen events
- Add the attributed indexed : up to three parameters : shown as “topics” of the events
- ์ง๊ฐ์ด ๊ณ์ ๋ชจ๋ ์ฃผ์์ ๋ํด call ํธ์ถ X -> ๋ณ๊ฒฝ ์์ ์ ์๋น์ค๋ก ์ ๋ณด ๋์ ธ์ค๋ค๋ฉด ์ข์
- block explorer = ๊ทธ๋ฅ ์๋ฒ์์ DB๋ฅผ ๋ณด์ฌ์ฃผ๋ ๊ฒ (์ฌ์ฉ์๊ฐ ๋ณด๊ธฐ ์ฝ๊ฒ) : etherscan, tx ์ ๋ณด ํ์ธ
* Inheritance : ์์
- base 1 or 2? * Units and Globally Available Variables
- Ether unit = ์ ์ผ ์์ ๋จ์๊ฐ wei (1)
- ๋นํธ์ฝ์ธ = ์ฌํ ์ / 1 ether ๋ก ์จ์ผํจ
'ComputerScience' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| ์คํํธ์ ํ๋ก์ ํธ ์ค๊ฐ ๋ฐํ (0) | 2025.11.03 |
|---|---|
| [๋ธ๋ก์ฒด์ธ] Blockchain ยท BTC ยท ETH ์ค๊ฐ๊ณ ์ฌ ์ ๋ฆฌ (0) | 2025.11.03 |
| ํด๋ผ์ฐ๋ํ๋ก์ ํธ SPEC ๋ฐํ (0) | 2025.10.07 |
| [RaspberryPi] ๋ผ์ฆ๋ฒ ๋ฆฌํ์ด๋ก NAS ์๋ฒ ๋ง๋ค๊ธฐ (0) | 2024.05.16 |
| [์๋ฃ๊ตฌ์กฐ] ๊ธฐ๋ง๊ณ ์ฌ Summary (0) | 2023.07.21 |