Skip to content

Commit b79cb47

Browse files
Add create a custom pallet page (#1147)
* add create a custom pallet * sync site-index * Update content * Update content * Add genesis to pallet * sync llms * apply grammar and formatting updates * llms --------- Co-authored-by: Erin Shaben <[email protected]>
1 parent 64e08a5 commit b79cb47

File tree

14 files changed

+2303
-729
lines changed

14 files changed

+2303
-729
lines changed

.ai/categories/basics.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3719,7 +3719,26 @@ To create the NFT contract, you can follow the steps below:
37193719
3. Now, paste the following NFT contract code into the editor.
37203720

37213721
```solidity title="MyNFT.sol"
3722-
3722+
// SPDX-License-Identifier: MIT
3723+
// Compatible with OpenZeppelin Contracts ^5.0.0
3724+
pragma solidity ^0.8.22;
3725+
3726+
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
3727+
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
3728+
3729+
contract MyToken is ERC721, Ownable {
3730+
uint256 private _nextTokenId;
3731+
3732+
constructor(address initialOwner)
3733+
ERC721("MyToken", "MTK")
3734+
Ownable(initialOwner)
3735+
{}
3736+
3737+
function safeMint(address to) public onlyOwner {
3738+
uint256 tokenId = _nextTokenId++;
3739+
_safeMint(to, tokenId);
3740+
}
3741+
}
37233742
```
37243743

37253744
The key components of the code above are:

.ai/categories/dapps.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4942,7 +4942,26 @@ To create the NFT contract, you can follow the steps below:
49424942
3. Now, paste the following NFT contract code into the editor.
49434943

49444944
```solidity title="MyNFT.sol"
4945-
4945+
// SPDX-License-Identifier: MIT
4946+
// Compatible with OpenZeppelin Contracts ^5.0.0
4947+
pragma solidity ^0.8.22;
4948+
4949+
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
4950+
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
4951+
4952+
contract MyToken is ERC721, Ownable {
4953+
uint256 private _nextTokenId;
4954+
4955+
constructor(address initialOwner)
4956+
ERC721("MyToken", "MTK")
4957+
Ownable(initialOwner)
4958+
{}
4959+
4960+
function safeMint(address to) public onlyOwner {
4961+
uint256 tokenId = _nextTokenId++;
4962+
_safeMint(to, tokenId);
4963+
}
4964+
}
49464965
```
49474966

49484967
The key components of the code above are:

.ai/categories/infrastructure.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3720,7 +3720,26 @@ To create the NFT contract, you can follow the steps below:
37203720
3. Now, paste the following NFT contract code into the editor.
37213721

37223722
```solidity title="MyNFT.sol"
3723-
3723+
// SPDX-License-Identifier: MIT
3724+
// Compatible with OpenZeppelin Contracts ^5.0.0
3725+
pragma solidity ^0.8.22;
3726+
3727+
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
3728+
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
3729+
3730+
contract MyToken is ERC721, Ownable {
3731+
uint256 private _nextTokenId;
3732+
3733+
constructor(address initialOwner)
3734+
ERC721("MyToken", "MTK")
3735+
Ownable(initialOwner)
3736+
{}
3737+
3738+
function safeMint(address to) public onlyOwner {
3739+
uint256 tokenId = _nextTokenId++;
3740+
_safeMint(to, tokenId);
3741+
}
3742+
}
37243743
```
37253744

37263745
The key components of the code above are:

.ai/categories/networks.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3720,7 +3720,26 @@ To create the NFT contract, you can follow the steps below:
37203720
3. Now, paste the following NFT contract code into the editor.
37213721

37223722
```solidity title="MyNFT.sol"
3723-
3723+
// SPDX-License-Identifier: MIT
3724+
// Compatible with OpenZeppelin Contracts ^5.0.0
3725+
pragma solidity ^0.8.22;
3726+
3727+
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
3728+
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
3729+
3730+
contract MyToken is ERC721, Ownable {
3731+
uint256 private _nextTokenId;
3732+
3733+
constructor(address initialOwner)
3734+
ERC721("MyToken", "MTK")
3735+
Ownable(initialOwner)
3736+
{}
3737+
3738+
function safeMint(address to) public onlyOwner {
3739+
uint256 tokenId = _nextTokenId++;
3740+
_safeMint(to, tokenId);
3741+
}
3742+
}
37243743
```
37253744

37263745
The key components of the code above are:

0 commit comments

Comments
 (0)