ERC-2981 Contract
Royalty
NFT ์์ฅ์์๋ Royalty ๋ผ๋ ๊ฐ๋ ์ด ์๋ค.
์ฝ๊ฒ ์ค๋ช ํ๋ฉด, ๋ด๊ฐ ๋ง๋ NFT(๋์ ์ฐฝ์๋ฌผ)์ ๋ํด์, ๋ชจ๋ 2์ฐจํ๋งค๊ฐ ์ผ์ด๋๋ ๊ฒฝ์ฐ ์ ์ฐฝ์์(๋)์๊ฒ ์ผ์ ๊ธ์ก์ ์ง๋ถํ๋ ๊ฒ์ด๋ค.
์ ์๊ถ๋ฃ๋ผ๊ณ ์๊ฐํ๋ฉด ์ดํด๊ฐ ์ฝ๋ค.
๊ธฐ์กด NFT๋ฅผ ๋ฐํํ๊ธฐ ์ํด์ ์๋ง์ ์ฌ๋๋ค์ด ERC-721 ์ปจํธ๋ํธ๋ฅผ ๋ฐฐํฌํด ์ฌ์ฉํ๊ณ ์์๋๋ฐ, Royalty ์์คํ
์ ๊ตฌํํ ๊ฒ์ ๊ฐ ๋ง์ผํ๋ ์ด์ค๋ ํ๋ก์ ํธ ๋ณ๋ก ๋ฌ๋๋ค.
๊ทธ ํ์ค์ ์ ๋ฆฝํ ๊ฒ์ด ๋ฐ๋ก ERC-2981 ์ปจํธ๋ํธ์ด๋ค.
Royalty Info
/// @notice Called with the sale price to determine how much royalty
// is owed and to whom.
/// @param _tokenId - the NFT asset queried for royalty information
/// @param _salePrice - the sale price of the NFT asset specified by _tokenId
/// @return receiver - address of who should be sent the royalty payment
/// @return royaltyAmount - the royalty payment amount for _salePrice
function royaltyInfo(
uint256 _tokenId,
uint256 _salePrice
) external view returns (
address receiver,
uint256 royaltyAmount
);EIP ๋ฌธ์์์ ์ดํด๋ณด๋ฉด, ์์ ๊ฐ์ด Royalty Info๋ฅผ ์กฐํํ๋ ํจ์๊ฐ ์๋ค.
receiver๊ฐ ์ ์ฐฝ์์๊ฐ ๋ ๊ฒ์ด๊ณ , royaltyAmount๋ salePrice๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ๊ณ์ฐ๋ ๊ฐ๊ฒฉ์ ๋ฆฌํดํ๊ฒ ๋ ๊ฒ์ด๋ค.
Last updated