Add Royalties for NFTs
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- solidity, typescript
- 領域
- blockchain, frontend
調査の方向性
まず、ERC721 と ERC1155 のオプションがどのように提示され、コントラクトコードがどのように生成されるかを追跡します。両方の標準規格に royalty 設定と、アクセス制御された royalty メソッドを生成する機能を追加し、ERC1155Supply に重複した import が追加されないようにします。選択したオプションによって、要求されたコンストラクターの動作を持つ有効なコントラクトが生成されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Add options for users to be able to integrate royalties on their ERC721 and ERC1155 contracts. This is a suggested set of changes:
-
Include it on the options after selecting ERC721 or ERC1155.

Populating those fields would inherit from the tokenRoyalty contract and call the setDefaultRoyalty from the constructor. -
Include this parts on the code:
- An import for the new module:
import "@openzeppelin/contracts/token/tokenERC/extensions/tokenERCRoyalty.sol"; - An inheritance:
contract MyToken is ERC721, AccessControl {We'll use Access control to handle the roles of who can set royalties. - This calls to the royalties functions:
- An import for the new module:
function setTokenRoyalty(
uint256 tokenId,
address recipient,
uint96 fraction
) public onlyRole(ROYALTY_SETTER_ROLE) {
_setTokenRoyalty(tokenId, recipient, fraction);
}
function setDefaultRoyalty(address recipient, uint96 fraction) public onlyRole(ROYALTY_SETTER_ROLE) {
_setDefaultRoyalty(recipient, fraction);
}
- [ ] This constructor:
bytes32 public constant ROYALTY_SETTER_ROLE= keccak256("ROYALTY_SETTER_ROLE");
constructor() ERC721("MyToken", "MTK") {
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
_grantRole(ROYALTY_SETTER_ROLE, msg.sender);
}
Take into consideration for the ERC1155, if the user specifies royalties and select ERC1155Supply do not import it btwice into the code, since the royalties contract inherits from this module.
- 主要言語
- TypeScript
- スター
- 296
- フォーク
- 188
- 平均マージ
- 3時間 24分
- マージ済み PR(30日)
- 11
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
OpenZeppelin/contracts-wizard のほかの issue
-
Stellar: Generated test asserts against the contract identifier instead of the stored token nameオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
OpenZeppelin/contracts-wizard#805 ·
メンテナーはふだん 1 日以内に返信
-
Document properly that yarn classic is required (v1.X)対応中かも @0xMayurrr が 245 日前に担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
OpenZeppelin/contracts-wizard#739 ·
メンテナーはふだん 1 日以内に返信
-
Solidity: Governor absolute quorum values accepted by validation generate code that does not compile対応中かも @RaphaelFakhri が 17 日前に担当しました。 オープン
難易度 3/5 半日 初心者へのやさしさ 62/100
OpenZeppelin/contracts-wizard#895 ·
メンテナーはふだん 1 日以内に返信
-
Solidity: Premint amounts below 1 with a leading fractional zero generate code that does not compile対応中かも @RaphaelFakhri が 20 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 20/100
OpenZeppelin/contracts-wizard#893 ·
メンテナーはふだん 1 日以内に返信
-
Follow-ups from the Chainlink CCIP and ACE integration (#880)対応中かも @nahimterrazas が 25 日前に担当しました。 オープン
OpenZeppelin/contracts-wizard#881 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
OpenZeppelin/contracts-wizard の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
jeanibarz/knowledge-base-mcp-server#1268 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
Koenkk/zigbee-herdsman-converters#13820 ·
メンテナーはふだん 2 日以内に返信
-
[prefer-expect-resolves] autofix leaves a stray ")" when the awaited expression is parenthesizedオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
jest-community/eslint-plugin-jest#2052 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
Wallet functions throws TypeError when the wallet has no account ID対応中かも @Medhansh-741 が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
hiero-ledger/hiero-sdk-js#4781 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信