Update docs
This commit is contained in:
@ -5,10 +5,10 @@ pragma solidity ^0.8.20;
|
||||
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";
|
||||
|
||||
contract AccessControlModified is AccessControl {
|
||||
error AccessControlNonRevokable();
|
||||
error AccessControlNonRevocable();
|
||||
|
||||
// Override the revokeRole function
|
||||
function revokeRole(bytes32, address) public pure override {
|
||||
revert AccessControlNonRevokable();
|
||||
revert AccessControlNonRevocable();
|
||||
}
|
||||
}
|
||||
|
||||
26
docs/modules/api/examples/token/ERC6909/ERC6909GameItems.sol
Normal file
26
docs/modules/api/examples/token/ERC6909/ERC6909GameItems.sol
Normal file
@ -0,0 +1,26 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
import {ERC6909Metadata} from "@openzeppelin/contracts/token/ERC6909/extensions/draft-ERC6909Metadata.sol";
|
||||
|
||||
contract ERC6909GameItems is ERC6909Metadata {
|
||||
uint256 public constant GOLD = 0;
|
||||
uint256 public constant SILVER = 1;
|
||||
uint256 public constant THORS_HAMMER = 2;
|
||||
uint256 public constant SWORD = 3;
|
||||
uint256 public constant SHIELD = 4;
|
||||
|
||||
constructor() {
|
||||
_setDecimals(GOLD, 18);
|
||||
_setDecimals(SILVER, 18);
|
||||
// Default decimals is 0
|
||||
_setDecimals(SWORD, 9);
|
||||
_setDecimals(SHIELD, 9);
|
||||
|
||||
_mint(msg.sender, GOLD, 10 ** 18);
|
||||
_mint(msg.sender, SILVER, 10_000 ** 18);
|
||||
_mint(msg.sender, THORS_HAMMER, 1);
|
||||
_mint(msg.sender, SWORD, 10 ** 9);
|
||||
_mint(msg.sender, SHIELD, 10 ** 9);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user