Ver3.5 ๐ ๋ธ๋ก์ฒด์ธ ๊ธฐ๋ฐ ์ค์๊ฐ ๊ฒฝ๋งค ์์คํ ๊ตฌ์กฐ

๐ ๋ธ๋ก์ฒด์ธ ๊ธฐ๋ฐ ์ค์๊ฐ ๊ฒฝ๋งค ์์คํ ๊ตฌ์กฐ
์ค๋งํธ ์ปจํธ๋ํธ๋ถํฐ ์ค์๊ฐ ์
์ฐฐ ์ฒ๋ฆฌ๊น์ง,
ํ์ค์ํ ๊ฒฝ๋งค์ ๋ชจ๋ ๊ฒ์ ํํค์ณ๋ณด์!
์ผ, ์์งํ ๋งํด๋ด. ๊ฒฝ๋งค๋ผ๊ณ ํ๋ฉด ๋ญ๊ฐ ๋ ์ฌ๋ผ? ๐ค
๋ง์น ํ! ์น๋ ์์ ์จ? ์๋๋ฉด ์์ฆ ํซํ NFT ๊ฒฝ๋งค? ๋ ๋ค ๋ง์.
๊ทผ๋ฐ ์ฌ๊ธฐ์ ํ ๊ฐ์ง ๋ฌธ์ ๊ฐ ์์ด. ๊ธฐ์กด ๊ฒฝ๋งค ์์คํ
์ ์ค์ํ๋ ์๋ฒ์ ์์กดํ๊ธฐ ๋๋ฌธ์ ์กฐ์ ๊ฐ๋ฅ์ฑ, ํฌ๋ช
์ฑ ๋ถ์กฑ, ๋จ์ผ ์ฅ์ ์ (Single Point of Failure) ๊ฐ์ ๋ฌธ์ ๊ฐ ํญ์ ๋ฐ๋ผ๋ค๋
๊ฑฐ๋ .
๊ทธ๋์ ๋ฑ์ฅํ ๊ฒ ๋ฐ๋ก ๋ธ๋ก์ฒด์ธ ๊ธฐ๋ฐ ์ค์๊ฐ ๊ฒฝ๋งค ์์คํ
์ด์ผ! ๐
์ค๋งํธ ์ปจํธ๋ํธ๊ฐ ์ฌํ ์ญํ ์ ํ๊ณ , ๋ชจ๋ ์
์ฐฐ ๊ธฐ๋ก์ ์ฒด์ธ์ ์๊ตฌ ์ ์ฅ๋๊ณ , ๋์ฐฐ์์๊ฒ ์๋์ผ๋ก ์์ฐ์ด ์ด์ ๋๋ ๊ตฌ์กฐ.
์ด๊ฒ ์ผ๋ง๋ ์ฟจํ ๊ฑด์ง ์ง๊ธ๋ถํฐ ํ๋ํ๋ ๋ฏ์ด๋ณผ๊ฒ.
๐ค ์ ๊ตณ์ด ๋ธ๋ก์ฒด์ธ์ผ๋ก ๊ฒฝ๋งค๋ฅผ ํด์ผ ํด?
๊ธฐ์กด ๊ฒฝ๋งค ํ๋ซํผ๋ค, ์๋ฅผ ๋ค์ด ์ด๋ฒ ์ด๋ ์๋๋น ๊ฐ์ ๊ณณ๋ค์ ์ค์ ์๋ฒ๊ฐ ๋ชจ๋ ๊ฑธ ๊ด๋ฆฌํด.
๊ทธ๊ฒ ๋ญ๊ฐ ๋ฌธ์ ๋๊ณ ? ์๊ฐํด๋ด:
๐ค ๊ธฐ์กด ์ค์ํ ๊ฒฝ๋งค์ ๋ฌธ์ ์
๋ธ๋ก์ฒด์ธ ๊ฒฝ๋งค์ ํต์ฌ ๊ฐ์น๋ ๋ฑ ์ธ ๋จ์ด์ผ: ํฌ๋ช
์ฑ(Transparency), ๋ถ๋ณ์ฑ(Immutability), ์๋ํ(Automation).
์ด ์ธ ๊ฐ์ง๊ฐ ํฉ์ณ์ง๋ฉด ๊ธฐ์กด ๊ฒฝ๋งค ์์คํ
์ด ๊ฐ์ง ๋ฌธ์ ๋ค์ ๊ตฌ์กฐ์ ์ผ๋ก ํด๊ฒฐํ ์ ์์ด.
๐๏ธ ์์คํ ์ํคํ ์ฒ ์ ์ฒด ๊ตฌ์กฐ
๋ธ๋ก์ฒด์ธ ๊ฒฝ๋งค ์์คํ
์ ํฌ๊ฒ 4๊ฐ์ ๋ ์ด์ด๋ก ๋๋ ์ ์์ด.
๊ฐ ๋ ์ด์ด๊ฐ ์ด๋ค ์ญํ ์ ํ๋์ง ํ๋์ฉ ๋ฏ์ด๋ณด์.
๐ต ๋ ์ด์ด 1: ํ๋ ์ ํ ์ด์ ๋ ์ด์ด (Frontend)
์ฌ์ฉ์๊ฐ ์ง์ ๋ณด๊ณ ์ํธ์์ฉํ๋ ๋ถ๋ถ์ด์ผ. ์ฃผ์ ๊ธฐ์ ์คํ:
React.js / Next.js Web3.js / Ethers.js MetaMask SDK WebSocket IPFS Gateway์ฌ๊ธฐ์ ํต์ฌ์ ์ค์๊ฐ์ฑ์ด์ผ. ๊ฒฝ๋งค๋ ์ด ๋จ์๋ก ์ํฉ์ด ๋ฐ๋์์.
WebSocket์ด๋ ๋ธ๋ก์ฒด์ธ ์ด๋ฒคํธ ๋ฆฌ์ค๋์ ํตํด ์
์ฐฐ๊ฐ ๋ณ๋์ ์ฆ์ ๋ฐ์ํด์ผ ํด.
๐ฃ ๋ ์ด์ด 2: ์ค๋งํธ ์ปจํธ๋ํธ ๋ ์ด์ด (Business Logic)
๊ฒฝ๋งค์ ๋ชจ๋ ๋น์ฆ๋์ค ๋ก์ง์ด ์ฌ๊ธฐ ์์ด. ์ด๊ฒ ์ง์ง ํต์ฌ์ด์ผ.
Solidity๋ก ์์ฑ๋๊ณ , ์ด๋๋ฆฌ์์ด๋ ํด๋ฆฌ๊ณค ๊ฐ์ EVM ํธํ ์ฒด์ธ์ ๋ฐฐํฌ๋ผ.
๐ข ๋ ์ด์ด 3: ๋ธ๋ก์ฒด์ธ ๋ ์ด์ด (Data & Consensus)
์ค์ ๋ฐ์ดํฐ๊ฐ ์ ์ฅ๋๊ณ ํฉ์๊ฐ ์ด๋ฃจ์ด์ง๋ ๊ณณ์ด์ผ.
์ด๋๋ฆฌ์ ๋ฉ์ธ๋ท ํด๋ฆฌ๊ณค (์ ๋ ดํ ๊ฐ์ค๋น) Arbitrum (L2) Optimism (L2)์ด๋ค ์ฒด์ธ์ ์ ํํ๋๋์ ๋ฐ๋ผ ๊ฐ์ค๋น, ์ฒ๋ฆฌ ์๋, ๋ณด์์ฑ์ด ๋ฌ๋ผ์ ธ.
์ค์๊ฐ ๊ฒฝ๋งค๋ผ๋ฉด ๋น ๋ฅธ ๋ธ๋ก ์์ฑ ์๊ฐ๊ณผ ๋ฎ์ ๊ฐ์ค๋น๊ฐ ์ค์ํด์ L2 ์๋ฃจ์
์ ๋ง์ด ์จ.
๐ด ๋ ์ด์ด 4: ์คํ ๋ฆฌ์ง ๋ ์ด์ด (Off-chain Data)
๋ธ๋ก์ฒด์ธ์ ๋ชจ๋ ๊ฑธ ์ ์ฅํ๋ฉด ๊ฐ์ค๋น๊ฐ ํญ๋ฐํด. ๊ทธ๋์ ๋์ฉ๋ ๋ฐ์ดํฐ๋ ์คํ์ฒด์ธ์ ์ ์ฅํด.
IPFS Arweave Filecoin Pinata์ด๋ฏธ์ง, ๋์์, ์์ธ ์ค๋ช
๊ฐ์ ๊ฑด IPFS์ ์ฌ๋ฆฌ๊ณ , ๊ทธ ํด์๊ฐ(CID)๋ง ์ฒด์ธ์ ์ ์ฅํ๋ ๋ฐฉ์์ด์ผ.
์ด๋ ๊ฒ ํ๋ฉด ๋ฐ์ดํฐ ๋ฌด๊ฒฐ์ฑ์ ๋ณด์ฅํ๋ฉด์ ๊ฐ์ค๋น๋ ์ต์ํํ ์ ์์ด.
๐ ์ค๋งํธ ์ปจํธ๋ํธ ์ค๊ณ - ์ฝ๋๋ก ๋ณด๋ ๊ฒฝ๋งค ๋ก์ง
์, ์ด์ ์ง์ง ์ฌ๋ฐ๋ ๋ถ๋ถ์ด์ผ. ์ค์ Solidity ์ฝ๋๋ฅผ ๋ณด๋ฉด์ ์ด๋ป๊ฒ ๊ฒฝ๋งค ๋ก์ง์ด ๊ตฌํ๋๋์ง ์ดํด๋ณด์.
๊ฒ๋จน์ง ๋ง, ํ๋์ฉ ์ค๋ช
ํด์ค๊ฒ! ๐
๐ง ๊ธฐ๋ณธ ๊ฒฝ๋งค ์ปจํธ๋ํธ ๊ตฌ์กฐ
<span class="tx-cm">// SPDX-License-Identifier: MIT</span>
<span class="tx-kw">pragma solidity</span> ^0.8.19;
<span class="tx-kw">import</span> <span class="tx-str">"@openzeppelin/contracts/security/ReentrancyGuard.sol"</span>;
<span class="tx-kw">import</span> <span class="tx-str">"@openzeppelin/contracts/access/Ownable.sol"</span>;
<span class="tx-kw">import</span> <span class="tx-str">"@openzeppelin/contracts/security/Pausable.sol"</span>;
<span class="tx-kw">contract</span> <span class="tx-fn">BlockchainAuction</span> <span class="tx-kw">is</span> ReentrancyGuard, Ownable, Pausable {
<span class="tx-cm">// ===== ์ํ ๋ณ์ =====</span>
<span class="tx-kw">struct</span> <span class="tx-fn">Auction</span> {
address seller; <span class="tx-cm">// ํ๋งค์ ์ฃผ์</span>
string itemCID; <span class="tx-cm">// IPFS CID (์์ดํ
๋ฉํ๋ฐ์ดํฐ)</span>
uint256 startPrice; <span class="tx-cm">// ์์๊ฐ (wei ๋จ์)</span>
uint256 reservePrice; <span class="tx-cm">// ์ต์ ๋์ฐฐ๊ฐ</span>
uint256 highestBid; <span class="tx-cm">// ํ์ฌ ์ต๊ณ ์
์ฐฐ๊ฐ</span>
address highestBidder; <span class="tx-cm">// ํ์ฌ ์ต๊ณ ์
์ฐฐ์</span>
uint256 startTime; <span class="tx-cm">// ๊ฒฝ๋งค ์์ ์๊ฐ</span>
uint256 endTime; <span class="tx-cm">// ๊ฒฝ๋งค ์ข
๋ฃ ์๊ฐ</span>
bool ended; <span class="tx-cm">// ๊ฒฝ๋งค ์ข
๋ฃ ์ฌ๋ถ</span>
bool settled; <span class="tx-cm">// ์ ์ฐ ์๋ฃ ์ฌ๋ถ</span>
}
<span class="tx-cm">// ๊ฒฝ๋งค ID โ ๊ฒฝ๋งค ์ ๋ณด ๋งคํ</span>
<span class="tx-kw">mapping</span>(uint256 => Auction) <span class="tx-kw">public</span> auctions;
<span class="tx-cm">// ์
์ฐฐ์๋ณ ํ๋ถ ๊ฐ๋ฅ ๊ธ์ก (Pull Payment ํจํด)</span>
<span class="tx-kw">mapping</span>(uint256 => <span class="tx-kw">mapping</span>(address => uint256)) <span class="tx-kw">public</span> pendingReturns;
uint256 <span class="tx-kw">public</span> auctionCount; <span class="tx-cm">// ์ด ๊ฒฝ๋งค ์</span>
uint256 <span class="tx-kw">public</span> platformFee = 250; <span class="tx-cm">// 2.5% (basis points)</span>
<span class="tx-cm">// ===== ์ด๋ฒคํธ =====</span>
<span class="tx-kw">event</span> <span class="tx-fn">AuctionCreated</span>(
uint256 <span class="tx-kw">indexed</span> auctionId,
address <span class="tx-kw">indexed</span> seller,
uint256 startPrice,
uint256 endTime
);
<span class="tx-kw">event</span> <span class="tx-fn">BidPlaced</span>(
uint256 <span class="tx-kw">indexed</span> auctionId,
address <span class="tx-kw">indexed</span> bidder,
uint256 amount,
uint256 timestamp
);
<span class="tx-kw">event</span> <span class="tx-fn">AuctionEnded</span>(
uint256 <span class="tx-kw">indexed</span> auctionId,
address winner,
uint256 finalPrice
);
}
๐ฐ ์ ์ฐฐ ํจ์ - ๊ฐ์ฅ ์ค์ํ ๋ก์ง
<span class="tx-kw">function</span> <span class="tx-fn">placeBid</span>(uint256 _auctionId)
<span class="tx-kw">external</span>
<span class="tx-kw">payable</span>
nonReentrant <span class="tx-cm">// ์ฌ์ง์
๊ณต๊ฒฉ ๋ฐฉ์ด</span>
whenNotPaused <span class="tx-cm">// ๊ธด๊ธ ์ ์ง ์ ์ฐจ๋จ</span>
{
Auction <span class="tx-kw">storage</span> auction = auctions[_auctionId];
<span class="tx-cm">// ===== ๊ฒ์ฆ ๋ก์ง =====</span>
<span class="tx-kw">require</span>(block.timestamp >= auction.startTime, <span class="tx-str">"๊ฒฝ๋งค ์์ง ์์ ์๋จ"</span>);
<span class="tx-kw">require</span>(block.timestamp < auction.endTime, <span class="tx-str">"๊ฒฝ๋งค ์ข
๋ฃ๋จ"</span>);
<span class="tx-kw">require</span>(!auction.ended, <span class="tx-str">"์ด๋ฏธ ์ข
๋ฃ๋ ๊ฒฝ๋งค"</span>);
<span class="tx-kw">require</span>(msg.sender != auction.seller, <span class="tx-str">"ํ๋งค์๋ ์
์ฐฐ ๋ถ๊ฐ"</span>);
<span class="tx-kw">require</span>(
msg.value > auction.highestBid,
<span class="tx-str">"ํ์ฌ ์ต๊ณ ๊ฐ๋ณด๋ค ๋์์ผ ํจ"</span>
);
<span class="tx-kw">require</span>(
msg.value >= auction.startPrice,
<span class="tx-str">"์์๊ฐ ์ด์์ด์ด์ผ ํจ"</span>
);
<span class="tx-cm">// ===== ์ด์ ์ต๊ณ ์
์ฐฐ์ ํ๋ถ ์ฒ๋ฆฌ =====</span>
<span class="tx-kw">if</span> (auction.highestBidder != address(0)) {
<span class="tx-cm">// Pull Payment ํจํด: ์ฆ์ ์ ์ก ๋์ ์ถ๊ธ ๊ฐ๋ฅ ๊ธ์ก ๊ธฐ๋ก</span>
pendingReturns[_auctionId][auction.highestBidder] += auction.highestBid;
}
<span class="tx-cm">// ===== ์ต๊ณ ์
์ฐฐ ๊ฐฑ์ =====</span>
auction.highestBid = msg.value;
auction.highestBidder = msg.sender;
<span class="tx-cm">// ===== ๋ง๊ฐ ์๋ฐ ์ ์๊ฐ ์ฐ์ฅ (Anti-sniping) =====</span>
<span class="tx-kw">if</span> (auction.endTime - block.timestamp < <span class="tx-num">5 minutes</span>) {
auction.endTime += <span class="tx-num">5 minutes</span>;
}
<span class="tx-cm">// ===== ์ด๋ฒคํธ ๋ฐ์ =====</span>
<span class="tx-kw">emit</span> <span class="tx-fn">BidPlaced</span>(_auctionId, msg.sender, msg.value, block.timestamp);
}
๐ ๊ฒฝ๋งค ์ข ๋ฃ ๋ฐ ์ ์ฐ ๋ก์ง
<span class="tx-kw">function</span> <span class="tx-fn">endAuction</span>(uint256 _auctionId) <span class="tx-kw">external</span> nonReentrant {
Auction <span class="tx-kw">storage</span> auction = auctions[_auctionId];
<span class="tx-kw">require</span>(block.timestamp >= auction.endTime, <span class="tx-str">"๊ฒฝ๋งค ์์ง ์งํ ์ค"</span>);
<span class="tx-kw">require</span>(!auction.ended, <span class="tx-str">"์ด๋ฏธ ์ข
๋ฃ๋จ"</span>);
auction.ended = <span class="tx-kw">true</span>;
<span class="tx-cm">// ์ต์ ๋์ฐฐ๊ฐ ๋ฏธ๋ฌ ์ ์ ์ฐฐ ์ฒ๋ฆฌ</span>
<span class="tx-kw">if</span> (auction.highestBid < auction.reservePrice) {
<span class="tx-cm">// ์ต๊ณ ์
์ฐฐ์์๊ฒ ์ ์ก ํ๋ถ</span>
pendingReturns[_auctionId][auction.highestBidder] += auction.highestBid;
<span class="tx-kw">emit</span> <span class="tx-fn">AuctionEnded</span>(_auctionId, address(0), 0); <span class="tx-cm">// ์ ์ฐฐ</span>
<span class="tx-kw">return</span>;
}
<span class="tx-cm">// ํ๋ซํผ ์์๋ฃ ๊ณ์ฐ (2.5%)</span>
uint256 fee = (auction.highestBid * platformFee) / <span class="tx-num">10000</span>;
uint256 sellerAmount = auction.highestBid - fee;
auction.settled = <span class="tx-kw">true</span>;
<span class="tx-cm">// ํ๋งค์์๊ฒ ๋์ฐฐ๊ธ ์ ์ก</span>
(bool sellerPaid, ) = payable(auction.seller).call{value: sellerAmount}(<span class="tx-str">""</span>);
<span class="tx-kw">require</span>(sellerPaid, <span class="tx-str">"ํ๋งค์ ์ ์ก ์คํจ"</span>);
<span class="tx-cm">// ํ๋ซํผ ์์๋ฃ ์ ์ก</span>
(bool feePaid, ) = payable(owner()).call{value: fee}(<span class="tx-str">""</span>);
<span class="tx-kw">require</span>(feePaid, <span class="tx-str">"์์๋ฃ ์ ์ก ์คํจ"</span>);
<span class="tx-kw">emit</span> <span class="tx-fn">AuctionEnded</span>(_auctionId, auction.highestBidder, auction.highestBid);
}
<span class="tx-cm">// Pull Payment ํจํด: ๋ฏธ๋์ฐฐ์ ์ง์ ์ถ๊ธ</span>
<span class="tx-kw">function</span> <span class="tx-fn">withdraw</span>(uint256 _auctionId) <span class="tx-kw">external</span> nonReentrant {
uint256 amount = pendingReturns[_auctionId][msg.sender];
<span class="tx-kw">require</span>(amount > 0, <span class="tx-str">"์ถ๊ธ ๊ฐ๋ฅ ๊ธ์ก ์์"</span>);
pendingReturns[_auctionId][msg.sender] = 0; <span class="tx-cm">// ๋จผ์ 0์ผ๋ก ์ด๊ธฐํ!</span>
(bool sent, ) = payable(msg.sender).call{value: amount}(<span class="tx-str">""</span>);
<span class="tx-kw">require</span>(sent, <span class="tx-str">"์ถ๊ธ ์คํจ"</span>);
}
โก ์ค์๊ฐ ์ ์ฐฐ ์ฒ๋ฆฌ ๋ฉ์ปค๋์ฆ
๋ธ๋ก์ฒด์ธ ๊ฒฝ๋งค์์ ๊ฐ์ฅ ๊น๋ค๋ก์ด ๋ถ๋ถ์ด ๋ฐ๋ก "์ค์๊ฐ์ฑ"์ด์ผ.
๋ธ๋ก์ฒด์ธ์ ๊ธฐ๋ณธ์ ์ผ๋ก ํธ๋์ญ์
์ด ๋ธ๋ก์ ํฌํจ๋๊ธฐ๊น์ง ์๊ฐ์ด ๊ฑธ๋ฆฌ๊ฑฐ๋ .
์ด๋๋ฆฌ์ ๋ฉ์ธ๋ท์ ์ฝ 12์ด, ํด๋ฆฌ๊ณค์ ์ฝ 2์ด ์ ๋์ผ.
์ด ์๊ฐ ๋์ ์ฌ์ฉ์ ๊ฒฝํ์ ์ด๋ป๊ฒ ์ ์งํ๋๋๊ฐ ํต์ฌ์ด์ผ.
๐ก ์ด๋ฒคํธ ๋ฆฌ์ค๋ ๊ตฌ์กฐ (Frontend)
<span class="tx-cm">// Web3.js๋ฅผ ์ด์ฉํ ์ค์๊ฐ ์ด๋ฒคํธ ๊ตฌ๋
</span>
<span class="tx-kw">import</span> { ethers } <span class="tx-kw">from</span> <span class="tx-str">'ethers'</span>;
<span class="tx-kw">class</span> <span class="tx-fn">AuctionEventListener</span> {
<span class="tx-kw">constructor</span>(contractAddress, abi, provider) {
<span class="tx-kw">this</span>.contract = <span class="tx-kw">new</span> ethers.<span class="tx-fn">Contract</span>(contractAddress, abi, provider);
<span class="tx-kw">this</span>.listeners = {};
}
<span class="tx-cm">// ์
์ฐฐ ์ด๋ฒคํธ ์ค์๊ฐ ๊ตฌ๋
</span>
<span class="tx-fn">subscribeToBids</span>(auctionId, callback) {
<span class="tx-kw">const</span> filter = <span class="tx-kw">this</span>.contract.filters.<span class="tx-fn">BidPlaced</span>(auctionId);
<span class="tx-kw">this</span>.contract.<span class="tx-fn">on</span>(filter, (auctionId, bidder, amount, timestamp, event) => {
<span class="tx-fn">callback</span>({
auctionId: auctionId.<span class="tx-fn">toString</span>(),
bidder,
amount: ethers.utils.<span class="tx-fn">formatEther</span>(amount),
timestamp: <span class="tx-kw">new</span> <span class="tx-fn">Date</span>(timestamp.<span class="tx-fn">toNumber</span>() * <span class="tx-num">1000</span>),
txHash: event.transactionHash
});
});
}
<span class="tx-cm">// ๊ฒฝ๋งค ์ข
๋ฃ ์ด๋ฒคํธ ๊ตฌ๋
</span>
<span class="tx-fn">subscribeToAuctionEnd</span>(auctionId, callback) {
<span class="tx-kw">const</span> filter = <span class="tx-kw">this</span>.contract.filters.<span class="tx-fn">AuctionEnded</span>(auctionId);
<span class="tx-kw">this</span>.contract.<span class="tx-fn">on</span>(filter, (auctionId, winner, finalPrice) => {
<span class="tx-fn">callback</span>({
winner,
finalPrice: ethers.utils.<span class="tx-fn">formatEther</span>(finalPrice),
isSuccessful: winner !== ethers.constants.AddressZero
});
});
}
<span class="tx-cm">// ๊ตฌ๋
ํด์ (๋ฉ๋ชจ๋ฆฌ ๋์ ๋ฐฉ์ง)</span>
<span class="tx-fn">unsubscribeAll</span>() {
<span class="tx-kw">this</span>.contract.<span class="tx-fn">removeAllListeners</span>();
}
}
๐ Optimistic UI ์ ๋ฐ์ดํธ ํจํด
ํธ๋์ญ์
์ด ํ์ ๋๊ธฐ๊น์ง ๊ธฐ๋ค๋ฆฌ๋ฉด UX๊ฐ ๋๋ฌด ๋ต๋ตํด.
๊ทธ๋์ Optimistic UI ํจํด์ ์จ. ํธ๋์ญ์
์ ๋ณด๋ด์๋ง์ UI๋ฅผ ๋จผ์ ์
๋ฐ์ดํธํ๊ณ , ๋์ค์ ์ค์ ํ์ ์ฌ๋ถ๋ฅผ ํ์ธํ๋ ๋ฐฉ์์ด์ผ.
<span class="tx-kw">const</span> <span class="tx-fn">handleBid</span> = <span class="tx-kw">async</span> (auctionId, bidAmount) => {
<span class="tx-kw">try</span> {
<span class="tx-cm">// 1. UI ์ฆ์ ์
๋ฐ์ดํธ (Optimistic)</span>
<span class="tx-fn">setCurrentBid</span>(bidAmount);
<span class="tx-fn">setBidStatus</span>(<span class="tx-str">'pending'</span>);
<span class="tx-fn">showToast</span>(<span class="tx-str">'์
์ฐฐ ์ฒ๋ฆฌ ์ค... โณ'</span>);
<span class="tx-cm">// 2. ํธ๋์ญ์
์ ์ก</span>
<span class="tx-kw">const</span> tx = <span class="tx-kw">await</span> contract.<span class="tx-fn">placeBid</span>(auctionId, {
value: ethers.utils.<span class="tx-fn">parseEther</span>(bidAmount.<span class="tx-fn">toString</span>()),
gasLimit: <span class="tx-num">200000</span>
});
<span class="tx-cm">// 3. ํธ๋์ญ์
ํด์ ์ฆ์ ํ์</span>
<span class="tx-fn">setTxHash</span>(tx.hash);
<span class="tx-cm">// 4. ๋ธ๋ก ํ์ ๋๊ธฐ (1 confirmation)</span>
<span class="tx-kw">const</span> receipt = <span class="tx-kw">await</span> tx.<span class="tx-fn">wait</span>(1);
<span class="tx-kw">if</span> (receipt.status === <span class="tx-num">1</span>) {
<span class="tx-fn">setBidStatus</span>(<span class="tx-str">'confirmed'</span>);
<span class="tx-fn">showToast</span>(<span class="tx-str">'๐ ์
์ฐฐ ์ฑ๊ณต!'</span>);
} <span class="tx-kw">else</span> {
<span class="tx-cm">// ์คํจ ์ UI ๋กค๋ฐฑ</span>
<span class="tx-fn">setCurrentBid</span>(previousBid);
<span class="tx-fn">setBidStatus</span>(<span class="tx-str">'failed'</span>);
<span class="tx-fn">showToast</span>(<span class="tx-str">'โ ์
์ฐฐ ์คํจ. ๋ค์ ์๋ํด์ฃผ์ธ์.'</span>);
}
} <span class="tx-kw">catch</span> (error) {
<span class="tx-cm">// ์ฌ์ฉ์ ๊ฑฐ์ ๋๋ ๊ฐ์ค ๋ถ์กฑ ๋ฑ ์ฒ๋ฆฌ</span>
<span class="tx-fn">handleError</span>(error);
}
};
โฑ๏ธ ์ค์๊ฐ ์นด์ดํธ๋ค์ด ํ์ด๋จธ ๊ตฌํ
๊ฒฝ๋งค ์ข
๋ฃ ์๊ฐ์ ๋ธ๋ก์ฒด์ธ์ block.timestamp๋ฅผ ๊ธฐ์ค์ผ๋ก ํ๋๋ฐ,
์ด๊ฑธ ํ๋ก ํธ์๋์์ ์ค์๊ฐ์ผ๋ก ํ์ํ๋ ค๋ฉด ์ฃผ์ํ ์ ์ด ์์ด.
๋ธ๋ก ํ์์คํฌํ vs ์ค์ ์๊ฐ: ๋ธ๋ก ํ์์คํฌํ๋ ์ฑ๊ตด์๊ฐ ์ค์ ํ๋ ๊ฐ์ด๋ผ ์ฝ๊ฐ์ ์ค์ฐจ๊ฐ ์์ ์ ์์ด.
๊ทธ๋์ ์นด์ดํธ๋ค์ด์ Date.now()๋ฅผ ๊ธฐ์ค์ผ๋ก ํ๋, ์ฃผ๊ธฐ์ ์ผ๋ก ์ปจํธ๋ํธ์ endTime์ ์กฐํํด์ ๋๊ธฐํํ๋ ๊ฒ ์ข์.
<span class="tx-kw">const</span> <span class="tx-fn">useAuctionTimer</span> = (auctionId) => {
<span class="tx-kw">const</span> [timeLeft, setTimeLeft] = <span class="tx-fn">useState</span>(null);
<span class="tx-fn">useEffect</span>(() => {
<span class="tx-kw">const</span> <span class="tx-fn">syncEndTime</span> = <span class="tx-kw">async</span> () => {
<span class="tx-kw">const</span> auction = <span class="tx-kw">await</span> contract.<span class="tx-fn">auctions</span>(auctionId);
<span class="tx-kw">const</span> endTime = auction.endTime.<span class="tx-fn">toNumber</span>() * <span class="tx-num">1000</span>;
<span class="tx-kw">const</span> interval = <span class="tx-fn">setInterval</span>(() => {
<span class="tx-kw">const</span> remaining = endTime - Date.<span class="tx-fn">now</span>();
<span class="tx-kw">if</span> (remaining <= 0) {
<span class="tx-fn">clearInterval</span>(interval);
<span class="tx-fn">setTimeLeft</span>(0);
} <span class="tx-kw">else</span> {
<span class="tx-fn">setTimeLeft</span>(remaining);
}
}, <span class="tx-num">1000</span>);
<span class="tx-kw">return</span> () => <span class="tx-fn">clearInterval</span>(interval);
};
<span class="tx-fn">syncEndTime</span>();
<span class="tx-cm">// 30์ด๋ง๋ค ์ฒด์ธ๊ณผ ๋๊ธฐํ</span>
<span class="tx-kw">const</span> syncInterval = <span class="tx-fn">setInterval</span>(syncEndTime, <span class="tx-num">30000</span>);
<span class="tx-kw">return</span> () => <span class="tx-fn">clearInterval</span>(syncInterval);
}, [auctionId]);
<span class="tx-kw">return</span> timeLeft;
};
๐จ NFT ๊ฒฝ๋งค ํนํ ๊ตฌ์กฐ (ERC-721 ์ฐ๋)
์์ฆ ๋ธ๋ก์ฒด์ธ ๊ฒฝ๋งค์ ๋๋ถ๋ถ์ NFT๋ฅผ ๋ค๋ค. NFT ๊ฒฝ๋งค๋ ์ผ๋ฐ ๊ฒฝ๋งค์ ๋ค๋ฅด๊ฒ
ERC-721 ํ ํฐ ํ์ค๊ณผ ์ฐ๋ํด์ผ ํด์ ๊ตฌ์กฐ๊ฐ ์กฐ๊ธ ๋ ๋ณต์กํด.
๐ NFT ์์คํฌ๋ก ๋ฉ์ปค๋์ฆ
๊ฒฝ๋งค ์์ ์ ์ ํ๋งค์์ NFT๋ฅผ ์ปจํธ๋ํธ๊ฐ ๋ณด๊ด(์์คํฌ๋ก)ํ๊ณ ,
๋์ฐฐ ์ ๋์ฐฐ์์๊ฒ ์๋ ์ด์ ํ๋ ๊ตฌ์กฐ์ผ.
<span class="tx-kw">import</span> <span class="tx-str">"@openzeppelin/contracts/token/ERC721/IERC721.sol"</span>;
<span class="tx-kw">function</span> <span class="tx-fn">createNFTAuction</span>(
address _nftContract,
uint256 _tokenId,
uint256 _startPrice,
uint256 _reservePrice,
uint256 _duration
) <span class="tx-kw">external</span> {
IERC721 nft = IERC721(_nftContract);
<span class="tx-cm">// ํ๋งค์๊ฐ ์ปจํธ๋ํธ์ NFT ์ ์ก ๊ถํ ๋ถ์ฌํ๋์ง ํ์ธ</span>
<span class="tx-kw">require</span>(
nft.<span class="tx-fn">getApproved</span>(_tokenId) == address(<span class="tx-kw">this</span>) ||
nft.<span class="tx-fn">isApprovedForAll</span>(msg.sender, address(<span class="tx-kw">this</span>)),
<span class="tx-str">"NFT ์ ์ก ๊ถํ ์์"</span>
);
<span class="tx-cm">// NFT๋ฅผ ์ปจํธ๋ํธ๋ก ์ด์ (์์คํฌ๋ก)</span>
nft.<span class="tx-fn">transferFrom</span>(msg.sender, address(<span class="tx-kw">this</span>), _tokenId);
<span class="tx-cm">// ๊ฒฝ๋งค ์์ฑ</span>
uint256 auctionId = ++auctionCount;
auctions[auctionId] = Auction({
seller: msg.sender,
nftContract: _nftContract,
tokenId: _tokenId,
startPrice: _startPrice,
reservePrice: _reservePrice,
highestBid: 0,
highestBidder: address(0),
startTime: block.timestamp,
endTime: block.timestamp + _duration,
ended: <span class="tx-kw">false</span>,
settled: <span class="tx-kw">false</span>
});
<span class="tx-kw">emit</span> <span class="tx-fn">AuctionCreated</span>(auctionId, msg.sender, _startPrice, block.timestamp + _duration);
}
<span class="tx-cm">// ๋์ฐฐ ์ NFT ์๋ ์ด์ </span>
<span class="tx-kw">function</span> <span class="tx-fn">_settleNFT</span>(uint256 _auctionId) <span class="tx-kw">internal</span> {
Auction <span class="tx-kw">storage</span> auction = auctions[_auctionId];
IERC721 nft = IERC721(auction.nftContract);
<span class="tx-kw">if</span> (auction.highestBid >= auction.reservePrice) {
<span class="tx-cm">// ๋์ฐฐ์์๊ฒ NFT ์ด์ </span>
nft.<span class="tx-fn">transferFrom</span>(address(<span class="tx-kw">this</span>), auction.highestBidder, auction.tokenId);
} <span class="tx-kw">else</span> {
<span class="tx-cm">// ์ ์ฐฐ ์ ํ๋งค์์๊ฒ ๋ฐํ</span>
nft.<span class="tx-fn">transferFrom</span>(address(<span class="tx-kw">this</span>), auction.seller, auction.tokenId);
}
}
approve()๋ ํน์ ํ ํฐ ํ๋์ ๋ํ ๊ถํ๋ง ๋ถ์ฌํ๊ณ , setApprovalForAll()์ ํด๋น ์ปฌ๋ ์
์ ๋ชจ๋ ํ ํฐ์ ๋ํ ๊ถํ์ ๋ถ์ฌํด. ๊ฒฝ๋งค ํ๋ซํผ์์๋ ๋ณดํต setApprovalForAll()์ ์ฌ์ฉํด์ ์ฌ๋ฌ NFT๋ฅผ ํธํ๊ฒ ๋ฑ๋กํ ์ ์๊ฒ ํด.
๐ก๏ธ ๋ณด์ ๊ณ ๋ ค์ฌํญ - ์ด๊ฑฐ ๋ชจ๋ฅด๋ฉด ํดํน๋นํด
์ค๋งํธ ์ปจํธ๋ํธ๋ ํ๋ฒ ๋ฐฐํฌํ๋ฉด ์์ ์ด ๋ถ๊ฐ๋ฅํด. (์
๊ทธ๋ ์ด๋ ํจํด ์ ์ธ)
๊ทธ๋์ ๋ณด์์ด ์ง์ง ์ค์ํด. ์ค์ ๋ก ์์ฒ์ต ์์ด ํดํน๋นํ ์ฌ๋ก๋ค์ด ์๊ฑฐ๋ .
๊ฒฝ๋งค ์์คํ
์์ ํนํ ์ฃผ์ํด์ผ ํ ๋ณด์ ์ด์๋ค์ ์ ๋ฆฌํด์ค๊ฒ.
| ์ทจ์ฝ์ | ์ค๋ช | ๋ฐฉ์ด ๋ฐฉ๋ฒ |
|---|---|---|
| ์ฌ์ง์
๊ณต๊ฒฉ (Reentrancy) |
ETH ์ ์ก ์ค ์ ์์ ์ปจํธ๋ํธ๊ฐ ๋ค์ ํจ์๋ฅผ ํธ์ถํ๋ ๊ณต๊ฒฉ. DAO ํดํน ์ฌ๋ก๊ฐ ๋ํ์ . | ReentrancyGuard ์ฌ์ฉ, CEI ํจํด ์ ์ฉ, Pull Payment ํจํด |
| ์ ์ ์ค๋ฒํ๋ก์ฐ (Integer Overflow) |
ํฐ ์ซ์ ์ฐ์ฐ ์ ์ค๋ฒํ๋ก์ฐ ๋ฐ์. ๊ฐ๊ฒฉ ์กฐ์์ ์ ์ฉ ๊ฐ๋ฅ. | Solidity 0.8+ ์๋ ์ฒดํฌ, SafeMath ๋ผ์ด๋ธ๋ฌ๋ฆฌ |
| ํ์์คํฌํ ์กฐ์ (Timestamp Manipulation) |
์ฑ๊ตด์๊ฐ block.timestamp๋ฅผ ์ฝ 15์ด ๋ฒ์ ๋ด์์ ์กฐ์ ๊ฐ๋ฅ. | 15์ด ์ดํ์ ์ ๋ฐํ ์๊ฐ ๋ก์ง ๊ธ์ง, ๋ธ๋ก ๋ฒํธ ํ์ฉ |
| ํ๋ก ํธ๋ฌ๋ (Front-running) |
๋ฉคํ์์ ์ ์ฐฐ ํธ๋์ญ์ ์ ๋ณด๊ณ ๋ ๋์ ๊ฐ์ค๋น๋ก ๋จผ์ ๋ผ์ด๋๋ ๊ณต๊ฒฉ. | Commit-Reveal ํจํด, ํ๋ผ์ด๋น ๋ฉคํ ์ฌ์ฉ |
| DoS ๊ณต๊ฒฉ (Denial of Service) |
์ ์์ ์ปจํธ๋ํธ๊ฐ ETH ์์ ์ ๊ฑฐ๋ถํด์ ๊ฒฝ๋งค ์งํ์ ๋ง๋ ๊ณต๊ฒฉ. | Pull Payment ํจํด, ๊ฐ์ค ํ๋ ์ค์ |
| ์ค๋ผํด ์กฐ์ (Oracle Manipulation) |
์ธ๋ถ ๊ฐ๊ฒฉ ๋ฐ์ดํฐ๋ฅผ ์กฐ์ํด์ ๊ฒฝ๋งค ๊ฒฐ๊ณผ์ ์ํฅ์ ์ฃผ๋ ๊ณต๊ฒฉ. | Chainlink ๊ฐ์ ํ์ค์ํ ์ค๋ผํด ์ฌ์ฉ, TWAP ๊ฐ๊ฒฉ ์ฌ์ฉ |
๐ Commit-Reveal ํจํด (ํ๋ก ํธ๋ฌ๋ ๋ฐฉ์ด)
๋ธ๋ผ์ธ๋ ๊ฒฝ๋งค๋ฅผ ๊ตฌํํ ๋ ์ฐ๋ ํจํด์ด์ผ.
์
์ฐฐ ๊ธ์ก์ ํด์๋ก ์ํธํํด์ ๋จผ์ ์ ์ถํ๊ณ (Commit), ๊ฒฝ๋งค ์ข
๋ฃ ํ ์ค์ ๊ธ์ก์ ๊ณต๊ฐ(Reveal)ํ๋ ๋ฐฉ์์ด์ผ.
<span class="tx-cm">// 1๋จ๊ณ: ์
์ฐฐ ์ปค๋ฐ (๊ธ์ก ์จ๊น)</span>
<span class="tx-kw">function</span> <span class="tx-fn">commitBid</span>(uint256 _auctionId, bytes32 _bidHash) <span class="tx-kw">external payable</span> {
<span class="tx-cm">// ์ค์ ์
์ฐฐ๊ฐ + ๋น๋ฐ๊ฐ์ ํด์๋ฅผ ์ ์ถ</span>
commits[_auctionId][msg.sender] = BidCommit({
hash: _bidHash,
deposit: msg.value,
revealed: <span class="tx-kw">false</span>
});
}
<span class="tx-cm">// 2๋จ๊ณ: ๊ณต๊ฐ ๋จ๊ณ์์ ์ค์ ๊ธ์ก ๊ณต๊ฐ</span>
<span class="tx-kw">function</span> <span class="tx-fn">revealBid</span>(uint256 _auctionId, uint256 _amount, bytes32 _secret) <span class="tx-kw">external</span> {
BidCommit <span class="tx-kw">storage</span> commit = commits[_auctionId][msg.sender];
<span class="tx-cm">// ํด์ ๊ฒ์ฆ: keccak256(๊ธ์ก + ๋น๋ฐ๊ฐ) == ์ ์ถํ ํด์</span>
bytes32 checkHash = keccak256(abi.<span class="tx-fn">encodePacked</span>(_amount, _secret));
<span class="tx-kw">require</span>(checkHash == commit.hash, <span class="tx-str">"ํด์ ๋ถ์ผ์น"</span>);
<span class="tx-kw">require</span>(commit.deposit >= _amount, <span class="tx-str">"์์น๊ธ ๋ถ์กฑ"</span>);
commit.revealed = <span class="tx-kw">true</span>;
<span class="tx-cm">// ์ต๊ณ ๊ฐ ๊ฐฑ์ ๋ก์ง...</span>
}
โฝ ๊ฐ์ค ์ต์ ํ - ๋ ์๋ผ๋ ์ฝ๋ฉ ๊ธฐ์
์ด๋๋ฆฌ์์์ ๋ชจ๋ ์ฐ์ฐ์ ๊ฐ์ค๋น๊ฐ ๋ค์ด. ๊ฒฝ๋งค ์์คํ
์์ ๊ฐ์ค๋น๋ฅผ ์ต์ ํํ๋ ๊ฑด
์ฌ์ฉ์ ๊ฒฝํ์ ์ง๊ฒฐ๋๋ ๋ฌธ์ ์ผ. ํนํ ์
์ฐฐ์ด ์์ฃผ ์ผ์ด๋๋ ๊ฒฝ๋งค์์๋ ๋์ฑ ์ค์ํด.
๐ก ์ฃผ์ ๊ฐ์ค ์ต์ ํ ๊ธฐ๋ฒ
storage๋ ์๊ตฌ ์ ์ฅ์ด๋ผ ๋น์ธ๊ณ , memory๋ ์์ ์ ์ฅ์ด๋ผ ์ ๋ ดํด.๋ฐ๋ณต ์ ๊ทผํ๋ storage ๋ณ์๋ memory์ ์บ์ฑํด์ ์ฌ์ฉํด.
<span class="tx-cm">// โ ๋นํจ์จ์ : storage์ ๋ฐ๋ณต ์ ๊ทผ</span>
<span class="tx-kw">function</span> <span class="tx-fn">badExample</span>(uint256 id) <span class="tx-kw">external</span> {
auctions[id].highestBid += 1;
auctions[id].highestBid += 1;
}
<span class="tx-cm">// โ
ํจ์จ์ : memory์ ์บ์ฑ</span>
<span class="tx-kw">function</span> <span class="tx-fn">goodExample</span>(uint256 id) <span class="tx-kw">external</span> {
Auction <span class="tx-kw">storage</span> auction = auctions[id]; <span class="tx-cm">// ํฌ์ธํฐ ์ฌ์ฉ</span>
auction.highestBid += 2; <span class="tx-cm">// ํ ๋ฒ๋ง ์ ๊ทผ</span>
}
EVM์ 32๋ฐ์ดํธ ์ฌ๋กฏ ๋จ์๋ก ์ ์ฅํด. ์์ ๋ณ์๋ค์ ๋ฌถ์ด์ ๊ฐ์ ์ฌ๋กฏ์ ๋ฃ์ผ๋ฉด ๊ฐ์ค ์ ์ฝ!
<span class="tx-cm">// โ ๋นํจ์จ: ๊ฐ๊ฐ 32๋ฐ์ดํธ ์ฌ๋กฏ ์ฌ์ฉ</span>
uint256 startPrice; <span class="tx-cm">// ์ฌ๋กฏ 1</span>
bool ended; <span class="tx-cm">// ์ฌ๋กฏ 2 (๋ญ๋น!)</span>
uint256 endTime; <span class="tx-cm">// ์ฌ๋กฏ 3</span>
<span class="tx-cm">// โ
ํจ์จ: ํจํน์ผ๋ก ์ฌ๋กฏ ์ ์ฝ</span>
uint128 startPrice; <span class="tx-cm">// ์ฌ๋กฏ 1 (16๋ฐ์ดํธ)</span>
uint120 endTime; <span class="tx-cm">// ์ฌ๋กฏ 1 (15๋ฐ์ดํธ) - ๊ฐ์ ์ฌ๋กฏ!</span>
bool ended; <span class="tx-cm">// ์ฌ๋กฏ 1 (1๋ฐ์ดํธ) - ๊ฐ์ ์ฌ๋กฏ!</span>
์ ์ฐฐ ํ์คํ ๋ฆฌ ๊ฐ์ ๋ฐ์ดํฐ๋ storage์ ๋ฐฐ์ด๋ก ์ ์ฅํ๋ฉด ๋น์ธ.
๋์ ์ด๋ฒคํธ๋ก ๋ฐ์์ํค๊ณ , ํ๋ก ํธ์๋์์ ์ด๋ฒคํธ ๋ก๊ทธ๋ฅผ ์กฐํํ๋ ๋ฐฉ์์ด ํจ์ฌ ์ ๋ ดํด.
ํด๋ฆฌ๊ณค, Arbitrum, Optimism ๊ฐ์ L2์์๋ ๊ฐ์ค๋น๊ฐ ์ด๋๋ฆฌ์ ๋ฉ์ธ๋ท์ 1/100 ์์ค์ด์ผ.
์ค์๊ฐ ๊ฒฝ๋งค์ฒ๋ผ ํธ๋์ญ์ ์ด ๋ง์ ์๋น์ค์๋ L2๊ฐ ํ์์ผ.
๐ The Graph - ๋ธ๋ก์ฒด์ธ ๋ฐ์ดํฐ ์ธ๋ฑ์ฑ
๋ธ๋ก์ฒด์ธ์์ ๋ฐ์ดํฐ๋ฅผ ์กฐํํ๋ ๊ฑด ์๊ฐ๋ณด๋ค ๋ณต์กํด.
"์ง๊ธ๊น์ง ์งํ๋ ๋ชจ๋ ๊ฒฝ๋งค ๋ชฉ๋ก์ ๊ฐ์ ธ์" ๊ฐ์ ์ฟผ๋ฆฌ๋ฅผ ์ง์ ์ฒด์ธ์ ๋ ๋ฆฌ๋ฉด ์์ฒญ ๋๋ฆฌ๊ณ ๋น์ธ.
๊ทธ๋์ The Graph ๊ฐ์ ์ธ๋ฑ์ฑ ํ๋กํ ์ฝ์ ์ฌ์ฉํด.
๐ The Graph ์๋ธ๊ทธ๋ํ ์ค์
์ด๋ฒคํธ๋ฅผ ์ธ๋ฑ์ฑํด์ GraphQL๋ก ๋น ๋ฅด๊ฒ ์กฐํํ ์ ์๊ฒ ํด์ฃผ๋ ์๋น์ค์ผ.
<span class="tx-cm"># schema.graphql - ๋ฐ์ดํฐ ์คํค๋ง ์ ์</span>
type Auction @entity {
id: ID!
seller: Bytes!
itemCID: String!
startPrice: BigInt!
highestBid: BigInt!
highestBidder: Bytes
endTime: BigInt!
ended: Boolean!
bids: [Bid!]! @derivedFrom(field: "auction")
}
type Bid @entity {
id: ID!
auction: Auction!
bidder: Bytes!
amount: BigInt!
timestamp: BigInt!
txHash: Bytes!
}
<span class="tx-cm">// ํ๋ก ํธ์๋์์ GraphQL๋ก ๊ฒฝ๋งค ์กฐํ</span>
<span class="tx-kw">const</span> GET_ACTIVE_AUCTIONS = gql`
query GetActiveAuctions($currentTime: BigInt!) {
auctions(
where: { ended: false, endTime_gt: $currentTime }
orderBy: endTime
orderDirection: asc
first: 20
) {
id
seller
itemCID
startPrice
highestBid
highestBidder
endTime
bids(orderBy: timestamp, orderDirection: desc, first: 5) {
bidder
amount
timestamp
}
}
}
`;
๋ธ๋ก์ฒด์ธ ์ด๋ฒคํธ๊ฐ ๋ฐ์ํ ๋๋ง๋ค ์๋์ผ๋ก ์ธ๋ฑ์ค๊ฐ ์ ๋ฐ์ดํธ๋๋๊น ์ค์๊ฐ์ฑ๋ ์ ์ง๋ผ.
๐ ์ค์ ๋ฐฐํฌ ์ ๋ต ๋ฐ ์ ๊ทธ๋ ์ด๋ ํจํด
์ค๋งํธ ์ปจํธ๋ํธ๋ ๋ฐฐํฌ ํ ์์ ์ด ๋ถ๊ฐ๋ฅํ๋ค๊ณ ํ์์.
๊ทผ๋ฐ ๋ฒ๊ทธ๊ฐ ๋ฐ๊ฒฌ๋๊ฑฐ๋ ๊ธฐ๋ฅ์ ์ถ๊ฐํด์ผ ํ ๋๋ ์ด๋ป๊ฒ ํด?
๊ทธ๋์ ์
๊ทธ๋ ์ด๋ ๊ฐ๋ฅํ ์ปจํธ๋ํธ ํจํด์ด ํ์ํด.
๐ ํ๋ก์ ํจํด (Proxy Pattern)
์ฌ์ฉ์๋ ํญ์ ํ๋ก์ ์ปจํธ๋ํธ์ ์ํธ์์ฉํ๊ณ , ์ค์ ๋ก์ง์ ๋ณ๋ ์ปจํธ๋ํธ์ ์์ด.
๋ก์ง ์ปจํธ๋ํธ๋ฅผ ๊ต์ฒดํด๋ ํ๋ก์ ์ฃผ์๋ ๋ณํ์ง ์์์ ์ฌ์ฉ์ ์
์ฅ์์๋ ํฌ๋ช
ํด.
๐ ๋ฉํฐ์ฒด์ธ ๋ฐฐํฌ ์ ๋ต
ํ๋์ ์ฒด์ธ์๋ง ๋ฐฐํฌํ๋ฉด ํด๋น ์ฒด์ธ์ ๋ฌธ์ ์ ์ทจ์ฝํด.
์ฌ๋ฌ ์ฒด์ธ์ ๋ฐฐํฌํ๊ณ ํฌ๋ก์ค์ฒด์ธ ๋ธ๋ฆฟ์ง๋ก ์ฐ๊ฒฐํ๋ ์ ๋ต์ ์ฐ๊ธฐ๋ ํด.
| ์ฒด์ธ | ํน์ง | ์ ํฉํ ๊ฒฝ์ฐ |
|---|---|---|
| ์ด๋๋ฆฌ์ ๋ฉ์ธ๋ท | ์ต๊ณ ๋ณด์, ๋์ ๊ฐ์ค๋น, ๋๋ฆฐ ์๋ | ๊ณ ๊ฐ NFT ๊ฒฝ๋งค |
| ํด๋ฆฌ๊ณค | ์ ๋ ดํ ๊ฐ์ค๋น, ๋น ๋ฅธ ์๋, EVM ํธํ | ์ผ๋ฐ NFT, ๊ฒ์ ์์ดํ |
| Arbitrum | ์ด๋๋ฆฌ์ L2, ๋ฎ์ ๊ฐ์ค๋น, ๋์ ๋ณด์ | DeFi ์ฐ๊ณ ๊ฒฝ๋งค |
| Optimism | ์ด๋๋ฆฌ์ L2, OP Stack ์ํ๊ณ | ์์ NFT ๊ฒฝ๋งค |
| BNB Chain | ์ ๋ ดํ ๊ฐ์ค๋น, ๋์ ์ฌ์ฉ์ ๊ธฐ๋ฐ | ๋์ค์ ๊ฒฝ๋งค ํ๋ซํผ |
๐ ์ค์ ๋ธ๋ก์ฒด์ธ ๊ฒฝ๋งค ํ๋ซํผ ์ฌ๋ก
์ด๋ก ๋ง ์๋ฉด ์ฌ๋ฏธ์์์. ์ค์ ๋ก ์ด ๊ธฐ์ ๋ค์ด ์ด๋ป๊ฒ ์ฐ์ด๊ณ ์๋์ง ์ดํด๋ณด์!
๐จ OpenSea
์ธ๊ณ ์ต๋ NFT ๋ง์ผํ๋ ์ด์ค. ์๊ตญ์ ๊ฒฝ๋งค(์ต๊ณ ๊ฐ ๋์ฐฐ)์ ๋ค๋๋๋์ ๊ฒฝ๋งค(์๊ฐ์ ๋ฐ๋ผ ๊ฐ๊ฒฉ ํ๋ฝ) ๋ชจ๋ ์ง์ํด.
Seaport ํ๋กํ ์ฝ์ ์ฌ์ฉํด์ ๊ฐ์ค ํจ์จ์ ๊ทน๋ํํ์ด.
์ด๋๋ฆฌ์, ํด๋ฆฌ๊ณค, Klaytn ๋ฑ ๋ฉํฐ์ฒด์ธ์ ์ง์ํ๊ณ , ์คํ์ฒด์ธ ์๋ช
์ ํ์ฉํด์ ๊ฐ์ค๋น ์์ด ๋ฆฌ์คํ
์ด ๊ฐ๋ฅํด.
๐๏ธ Foundation
ํฌ๋ฆฌ์์ดํฐ ์ค์ฌ์ NFT ๊ฒฝ๋งค ํ๋ซํผ. 24์๊ฐ ๊ฒฝ๋งค ๋ฐฉ์์ ์ฌ์ฉํ๊ณ ,
๋ง์ง๋ง 15๋ถ ๋ด ์
์ฐฐ ์ ์๋์ผ๋ก 15๋ถ ์ฐ์ฅํ๋ Anti-sniping ๋ฉ์ปค๋์ฆ์ ์ ์ฉํ์ด.
ํฌ๋ฆฌ์์ดํฐ ๋ก์ดํฐ๋ฅผ ์ค๋งํธ ์ปจํธ๋ํธ ๋ ๋ฒจ์์ ์๋ ์ฒ๋ฆฌํ๋ ๊ฒ ํน์ง์ด์ผ.
๐ Nouns DAO
๋งค์ผ ํ๋์ NFT๋ฅผ ๊ฒฝ๋งคํ๋ ๋
ํนํ ํ๋ก์ ํธ. ๋์ฐฐ๊ธ์ DAO ํธ๋ ์ ๋ฆฌ๋ก ๋ค์ด๊ฐ๊ณ ,
NFT ๋ณด์ ์๋ค์ด ๊ฑฐ๋ฒ๋์ค์ ์ฐธ์ฌํด. ์์ ํ ์จ์ฒด์ธ์ผ๋ก ์ด์๋๋ ๊ฒฝ๋งค ์์คํ
์ ์ข์ ์์ผ.
์ง์ ๊ฒฝ๋งค ์์คํ ์ ๊ตฌ์ถํ๊ธฐ ์ด๋ ต๋ค๋ฉด ์ ๋ฌธ๊ฐ์ ๋์์ ๋ฐ๋ ๊ฒ๋ ์ข์ ๋ฐฉ๋ฒ์ด์ผ!
๐ท ๋ค๋๋๋์ ๊ฒฝ๋งค (Dutch Auction) ๊ตฌํ
์๊ตญ์ ๊ฒฝ๋งค(๊ฐ๊ฒฉ์ด ์ฌ๋ผ๊ฐ๋ ๋ฐฉ์)๋ง ์๋ ๊ฒ ์๋์ผ.
๋ค๋๋๋์ ๊ฒฝ๋งค๋ ์์๊ฐ์์ ์๊ฐ์ด ์ง๋ ์๋ก ๊ฐ๊ฒฉ์ด ๋ด๋ ค๊ฐ๋ ๋ฐฉ์์ด์ผ.
์ํ๋ ๊ฐ๊ฒฉ์ ๋๋ฌํ๋ฉด ์ฆ์ ๊ตฌ๋งคํ ์ ์์ด. NFT ๋ฏผํ
์์ ์์ฃผ ์ฐ์ด๋ ๋ฐฉ์์ด์ผ.
<span class="tx-kw">contract</span> <span class="tx-fn">DutchAuction</span> {
uint256 <span class="tx-kw">public</span> startPrice; <span class="tx-cm">// ์์๊ฐ (์ต๊ณ ๊ฐ)</span>
uint256 <span class="tx-kw">public</span> endPrice; <span class="tx-cm">// ์ต์ ๊ฐ (๋ฐ๋ฅ๊ฐ)</span>
uint256 <span class="tx-kw">public</span> startTime; <span class="tx-cm">// ๊ฒฝ๋งค ์์ ์๊ฐ</span>
uint256 <span class="tx-kw">public</span> duration; <span class="tx-cm">// ๊ฒฝ๋งค ๊ธฐ๊ฐ</span>
<span class="tx-cm">// ํ์ฌ ๊ฐ๊ฒฉ ๊ณ์ฐ (์ ํ ๊ฐ์)</span>
<span class="tx-kw">function</span> <span class="tx-fn">getCurrentPrice</span>() <span class="tx-kw">public view returns</span> (uint256) {
<span class="tx-kw">if</span> (block.timestamp <= startTime) <span class="tx-kw">return</span> startPrice;
<span class="tx-kw">if</span> (block.timestamp >= startTime + duration) <span class="tx-kw">return</span> endPrice;
uint256 elapsed = block.timestamp - startTime;
uint256 priceDrop = (startPrice - endPrice) * elapsed / duration;
<span class="tx-kw">return</span> startPrice - priceDrop;
}
<span class="tx-cm">// ํ์ฌ ๊ฐ๊ฒฉ์ผ๋ก ์ฆ์ ๊ตฌ๋งค</span>
<span class="tx-kw">function</span> <span class="tx-fn">buy</span>() <span class="tx-kw">external payable</span> {
uint256 currentPrice = <span class="tx-fn">getCurrentPrice</span>();
<span class="tx-kw">require</span>(msg.value >= currentPrice, <span class="tx-str">"๊ฐ๊ฒฉ ๋ถ์กฑ"</span>);
<span class="tx-cm">// ์ด๊ณผ ์ง๋ถ ๊ธ์ก ํ๋ถ</span>
uint256 refund = msg.value - currentPrice;
<span class="tx-kw">if</span> (refund > 0) {
payable(msg.sender).transfer(refund);
}
<span class="tx-cm">// NFT ์ด์ ๋ก์ง...</span>
}
}
NFT ํ๋ก์ ํธ ๋ฐ์นญ ์ ๊ณต์ ํ ๊ฐ๊ฒฉ ๋ฐ๊ฒฌ ๋ฉ์ปค๋์ฆ์ผ๋ก ๋ง์ด ํ์ฉ๋ผ.
๐งช ์ค๋งํธ ์ปจํธ๋ํธ ํ ์คํธ ์ ๋ต
๋ฐฐํฌ ์ ์ฒ ์ ํ ํ
์คํธ๋ ์ ํ์ด ์๋๋ผ ํ์์ผ.
Hardhat์ด๋ Foundry๋ฅผ ์ฌ์ฉํด์ ๋ค์ํ ์๋๋ฆฌ์ค๋ฅผ ํ
์คํธํด์ผ ํด.
<span class="tx-cm">// Hardhat + Chai๋ฅผ ์ด์ฉํ ํ
์คํธ ์์</span>
<span class="tx-kw">const</span> { expect } = <span class="tx-fn">require</span>(<span class="tx-str">"chai"</span>);
<span class="tx-kw">const</span> { ethers } = <span class="tx-fn">require</span>(<span class="tx-str">"hardhat"</span>);
<span class="tx-kw">const</span> { time } = <span class="tx-fn">require</span>(<span class="tx-str">"@nomicfoundation/hardhat-network-helpers"</span>);
describe(<span class="tx-str">"BlockchainAuction"</span>, <span class="tx-kw">function</span>() {
it(<span class="tx-str">"์ ์ ์
์ฐฐ ์๋๋ฆฌ์ค"</span>, <span class="tx-kw">async function</span>() {
<span class="tx-kw">const</span> [seller, bidder1, bidder2] = <span class="tx-kw">await</span> ethers.<span class="tx-fn">getSigners</span>();
<span class="tx-cm">// ๊ฒฝ๋งค ์์ฑ</span>
<span class="tx-kw">await</span> auction.<span class="tx-fn">createAuction</span>(
ethers.utils.<span class="tx-fn">parseEther</span>(<span class="tx-str">"1"</span>), <span class="tx-cm">// ์์๊ฐ 1 ETH</span>
ethers.utils.<span class="tx-fn">parseEther</span>(<span class="tx-str">"0.5"</span>), <span class="tx-cm">// ์ต์ ๋์ฐฐ๊ฐ 0.5 ETH</span>
<span class="tx-num">3600</span> <span class="tx-cm">// 1์๊ฐ</span>
);
<span class="tx-cm">// ์
์ฐฐ์1 ์
์ฐฐ</span>
<span class="tx-kw">await</span> auction.connect(bidder1).<span class="tx-fn">placeBid</span>(1, {
value: ethers.utils.<span class="tx-fn">parseEther</span>(<span class="tx-str">"1.5"</span>)
});
<span class="tx-cm">// ์
์ฐฐ์2 ๋ ๋์ ๊ฐ๊ฒฉ์ผ๋ก ์
์ฐฐ</span>
<span class="tx-kw">await</span> auction.connect(bidder2).<span class="tx-fn">placeBid</span>(1, {
value: ethers.utils.<span class="tx-fn">parseEther</span>(<span class="tx-str">"2"</span>)
});
<span class="tx-cm">// ์
์ฐฐ์1์ ํ๋ถ ๊ธ์ก ํ์ธ</span>
<span class="tx-kw">const</span> refund = <span class="tx-kw">await</span> auction.<span class="tx-fn">pendingReturns</span>(1, bidder1.address);
expect(refund).to.<span class="tx-fn">equal</span>(ethers.utils.<span class="tx-fn">parseEther</span>(<span class="tx-str">"1.5"</span>));
<span class="tx-cm">// ์๊ฐ ์ด๋ (๊ฒฝ๋งค ์ข
๋ฃ)</span>
<span class="tx-kw">await</span> time.<span class="tx-fn">increase</span>(<span class="tx-num">3601</span>);
<span class="tx-cm">// ๊ฒฝ๋งค ์ข
๋ฃ</span>
<span class="tx-kw">await</span> auction.<span class="tx-fn">endAuction</span>(1);
<span class="tx-cm">// ๋์ฐฐ์ ํ์ธ</span>
<span class="tx-kw">const</span> auctionData = <span class="tx-kw">await</span> auction.<span class="tx-fn">auctions</span>(1);
expect(auctionData.highestBidder).to.<span class="tx-fn">equal</span>(bidder2.address);
});
it(<span class="tx-str">"์ฌ์ง์
๊ณต๊ฒฉ ๋ฐฉ์ด ํ
์คํธ"</span>, <span class="tx-kw">async function</span>() {
<span class="tx-cm">// ์
์์ ์ปจํธ๋ํธ ๋ฐฐํฌ ํ ๊ณต๊ฒฉ ์๋</span>
<span class="tx-cm">// ReentrancyGuard๋ก ์ธํด revert ๋์ด์ผ ํจ</span>
<span class="tx-kw">await</span> expect(
maliciousContract.<span class="tx-fn">attack</span>(auctionId)
).to.be.<span class="tx-fn">revertedWith</span>(<span class="tx-str">"ReentrancyGuard: reentrant call"</span>);
});
});
๐ ํ ์คํธ ์ฒดํฌ๋ฆฌ์คํธ
๐ฎ ๋ธ๋ก์ฒด์ธ ๊ฒฝ๋งค์ ๋ฏธ๋ ํธ๋ ๋
๊ธฐ์ ์ ๊ณ์ ๋ฐ์ ํ๊ณ ์์ด. ๋ธ๋ก์ฒด์ธ ๊ฒฝ๋งค ์์คํ
๋ ๋ง์ฐฌ๊ฐ์ง์ผ.
์์ผ๋ก ์ด๋ค ๋ฐฉํฅ์ผ๋ก ๋ฐ์ ํ ์ง ์ดํด๋ณด์.
๐ค AI + ๋ธ๋ก์ฒด์ธ ๊ฒฝ๋งค
AI๊ฐ ๊ฒฝ๋งค ๊ฐ๊ฒฉ์ ์์ธกํ๊ณ , ์๋ ์
์ฐฐ ๋ด์ ๊ด๋ฆฌํ๋ ์์คํ
์ด ๋ฑ์ฅํ๊ณ ์์ด.
์ฌ์ฉ์๊ฐ ์ต๋ ์
์ฐฐ๊ฐ์ ์ ๋ต์ ์ค์ ํ๋ฉด AI๊ฐ ์ต์ ์ ํ์ด๋ฐ์ ์๋์ผ๋ก ์
์ฐฐํ๋ ๋ฐฉ์์ด์ผ.
๋จ, ์ด๋ฐ ๋ด๋ค์ด ๊ณต์ ์ฑ์ ํด์น ์ ์์ด์ ๊ท์ ๋
ผ์๋ ํ๋ฐํด.
๐ ํฌ๋ก์ค์ฒด์ธ ๊ฒฝ๋งค
์ด๋๋ฆฌ์์ NFT๋ฅผ ํด๋ฆฌ๊ณค์์ ์
์ฐฐํ๊ณ , ์๋ผ๋์ ์์ฐ์ผ๋ก ๊ฒฐ์ ํ๋ ํฌ๋ก์ค์ฒด์ธ ๊ฒฝ๋งค๊ฐ ํ์คํ๋๊ณ ์์ด.
LayerZero, Wormhole ๊ฐ์ ํฌ๋ก์ค์ฒด์ธ ๋ฉ์์ง ํ๋กํ ์ฝ์ด ์ด๋ฅผ ๊ฐ๋ฅํ๊ฒ ํด.
๐ ZK-Proof ๊ธฐ๋ฐ ํ๋ผ์ด๋ฒ์ ๊ฒฝ๋งค
์์ง์ ์ฆ๋ช
(Zero-Knowledge Proof)์ ํ์ฉํด์ ์
์ฐฐ ๊ธ์ก์ ๊ณต๊ฐํ์ง ์๊ณ ๋
์ต๊ณ ๊ฐ ์
์ฐฐ์๋ฅผ ๊ฒ์ฆํ ์ ์๋ ์์ ํ ํ๋ผ์ด๋ฒ์ ๊ฒฝ๋งค ์์คํ
์ด ์ฐ๊ตฌ๋๊ณ ์์ด.
๊ธฐ์
๊ฐ ๋น๋ฐ ๊ฒฝ๋งค๋ ์ ๋ถ ์กฐ๋ฌ ๊ฒฝ๋งค์ ํ์ฉ ๊ฐ๋ฅ์ฑ์ด ๋์.
๐๏ธ DAO ๊ฑฐ๋ฒ๋์ค ์ฐ๊ณ ๊ฒฝ๋งค
๊ฒฝ๋งค ์์ต์ด DAO ํธ๋ ์ ๋ฆฌ๋ก ๋ค์ด๊ฐ๊ณ , ์ปค๋ฎค๋ํฐ๊ฐ ๊ฒฝ๋งค ๊ท์น์ ํฌํ๋ก ๊ฒฐ์ ํ๋ ๋ฐฉ์.
Nouns DAO๊ฐ ์ด๋ฏธ ์ด ๋ชจ๋ธ์ ์ฑ๊ณต์ ์ผ๋ก ์ด์ํ๊ณ ์๊ณ , ๋ค์ํ ๋ณํ ๋ชจ๋ธ๋ค์ด ๋ฑ์ฅํ๊ณ ์์ด.
์ฌ๋ฅ๋ท์์ Web3 ๊ฐ๋ฐ, Solidity ์ค๋งํธ ์ปจํธ๋ํธ, ZK-Proof ๊ตฌํ ๋ฑ ๋ค์ํ ๋ธ๋ก์ฒด์ธ ์ ๋ฌธ๊ฐ๋ค์ ์ฌ๋ฅ์ ํ์ฉํด๋ณผ ์ ์์ด!
๐ฏ ํต์ฌ ์ ๋ฆฌ - ์ด๊ฒ๋ง ๊ธฐ์ตํด!
๋ธ๋ก์ฒด์ธ ๊ธฐ๋ฐ ์ค์๊ฐ ๊ฒฝ๋งค ์์คํ ์ ํต์ฌ์ ํ ๋ฒ์ ์ ๋ฆฌํด์ค๊ฒ:
์ ์ค๊ณ๋ ์ปจํธ๋ํธ๋ ์์ฒ๋ง ๋ฌ๋ฌ์ ๊ฑฐ๋๋ฅผ ์ ๋ขฐ ์์ด๋ ์์ ํ๊ฒ ์ฒ๋ฆฌํ ์ ์์ด.
๋ธ๋ก์ฒด์ธ ๊ธฐ๋ฐ ์ค์๊ฐ ๊ฒฝ๋งค ์์คํ
์ ๋จ์ํ ๊ธฐ์ ๊ตฌํ์ ๋์ด์,
์ ๋ขฐ์ ํจ๋ฌ๋ค์์ ๋ฐ๊พธ๋ ํ์ ์ด์ผ. ๐
์ค์ํ๋ ๊ถ๋ ฅ ์์ด๋ ๊ณต์ ํ๊ณ ํฌ๋ช
ํ ๊ฑฐ๋๊ฐ ๊ฐ๋ฅํ๋ค๋ ๊ฑธ ์ฆ๋ช
ํ๋ ์์คํ
์ด๊ฑฐ๋ .
๋ฌผ๋ก ์์ง ํด๊ฒฐํด์ผ ํ ๊ณผ์ ๋ค(ํ์ฅ์ฑ, UX, ๊ท์ ๋ฑ)์ด ๋จ์์์ง๋ง,
๊ธฐ์ ์ ๊ณ์ ๋ฐ์ ํ๊ณ ์๊ณ , ์ด ๋ถ์ผ์ ๊ฐ๋ฅ์ฑ์ ๋ฌด๊ถ๋ฌด์งํด.
์, ์ด์ ๋๋ ๋ธ๋ก์ฒด์ธ ๊ฒฝ๋งค ์์คํ
์ ๋ง๋ค ์ค๋น๊ฐ ๋์ด? ๐ช
์ฝ๋ ํ ์ค ํ ์ค์ด ์๋ก์ด ๊ฒฝ์ ์์คํ
์ ๋ง๋ค์ด๊ฐ๋ ๊ฑฐ์ผ. ํ์ดํ
! ๐ฅ
๊ด๋ จ ํค์๋
๋๊ธ ์์ฑ
์ด ๊ธ์ ๋ํ ์ฌ๋ฌ๋ถ์ ์๊ฐ์ ๋ค๋ ค์ฃผ์ธ์
๋ก๊ทธ์ธ์ด ํ์ํฉ๋๋ค
๋๊ธ์ ์์ฑํ๋ ค๋ฉด ๋จผ์ ๋ก๊ทธ์ธํด์ฃผ์ธ์.
๋๊ธ 0
์ง์์ธ์ ์ฒ - ์ง์ ์ฌ์ฐ๊ถ ๋ณดํธ ๊ณ ์ง
์ง์ ์ฌ์ฐ๊ถ ๋ณดํธ ๊ณ ์ง
- ์ ์๊ถ ๋ฐ ์์ ๊ถ: ๋ณธ ์ปจํ ์ธ ๋ ์ฌ๋ฅ๋ท์ ๋ ์ AI ๊ธฐ์ ๋ก ์์ฑ๋์์ผ๋ฉฐ, ๋ํ๋ฏผ๊ตญ ์ ์๊ถ๋ฒ ๋ฐ ๊ตญ์ ์ ์๊ถ ํ์ฝ์ ์ํด ๋ณดํธ๋ฉ๋๋ค.
- AI ์์ฑ ์ปจํ ์ธ ์ ๋ฒ์ ์ง์: ๋ณธ AI ์์ฑ ์ปจํ ์ธ ๋ ์ฌ๋ฅ๋ท์ ์ง์ ์ฐฝ์๋ฌผ๋ก ์ธ์ ๋๋ฉฐ, ๊ด๋ จ ๋ฒ๊ท์ ๋ฐ๋ผ ์ ์๊ถ ๋ณดํธ๋ฅผ ๋ฐ์ต๋๋ค.
- ์ฌ์ฉ ์ ํ: ์ฌ๋ฅ๋ท์ ๋ช ์์ ์๋ฉด ๋์ ์์ด ๋ณธ ์ปจํ ์ธ ๋ฅผ ๋ณต์ , ์์ , ๋ฐฐํฌ, ๋๋ ์์ ์ ์ผ๋ก ํ์ฉํ๋ ํ์๋ ์๊ฒฉํ ๊ธ์ง๋ฉ๋๋ค.
- ๋ฐ์ดํฐ ์์ง ๊ธ์ง: ๋ณธ ์ปจํ ์ธ ์ ๋ํ ๋ฌด๋จ ์คํฌ๋ํ, ํฌ๋กค๋ง, ๋ฐ ์๋ํ๋ ๋ฐ์ดํฐ ์์ง์ ๋ฒ์ ์ ์ฌ์ ๋์์ด ๋ฉ๋๋ค.
- AI ํ์ต ์ ํ: ์ฌ๋ฅ๋ท์ AI ์์ฑ ์ปจํ ์ธ ๋ฅผ ํ AI ๋ชจ๋ธ ํ์ต์ ๋ฌด๋จ ์ฌ์ฉํ๋ ํ์๋ ๊ธ์ง๋๋ฉฐ, ์ด๋ ์ง์ ์ฌ์ฐ๊ถ ์นจํด๋ก ๊ฐ์ฃผ๋ฉ๋๋ค.
์์ง ๋๊ธ์ด ์์ต๋๋ค.