-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into typo-fixes
- Loading branch information
Showing
29 changed files
with
1,100 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': minor | ||
--- | ||
|
||
`SafeERC20`: Add `trySafeTransfer` and `trySafeTransferFrom` that do not revert and return false if the transfer is not successful. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': minor | ||
--- | ||
|
||
`ER6909TokenSupply`: Add an extension of ERC6909 which tracks total supply for each token id. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': minor | ||
--- | ||
|
||
`ERC6909ContentURI`: Add an extension of ERC6909 which adds content URI functionality. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': minor | ||
--- | ||
|
||
`ERC6909Metadata`: Add an extension of ERC6909 which adds metadata functionality. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'openzeppelin-solidity': minor | ||
--- | ||
|
||
`ERC6909`: Add a standard implementation of ERC6909. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.20; | ||
|
||
import {ERC6909Metadata} from "../../../../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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
= ERC-6909 | ||
|
||
[.readme-notice] | ||
NOTE: This document is better viewed at https://docs.openzeppelin.com/contracts/api/token/erc6909 | ||
|
||
This set of interfaces and contracts are all related to the https://eips.ethereum.org/EIPS/eip-6909[ERC-6909 Minimal Multi-Token Interface]. | ||
|
||
The ERC consists of four interfaces which fulfill different roles--the interfaces are as follows: | ||
|
||
. {IERC6909}: Base interface for a vanilla ERC6909 token. | ||
. {IERC6909ContentURI}: Extends the base interface and adds content URI (contract and token level) functionality. | ||
. {IERC6909Metadata}: Extends the base interface and adds metadata functionality, which exposes a name, symbol, and decimals for each token id. | ||
. {IERC6909TokenSupply}: Extends the base interface and adds total supply functionality for each token id. | ||
|
||
Implementations are provided for each of the 4 interfaces defined in the ERC. | ||
|
||
== Core | ||
|
||
{{ERC6909}} | ||
|
||
== Extensions | ||
|
||
{{ERC6909ContentURI}} | ||
|
||
{{ERC6909Metadata}} | ||
|
||
{{ERC6909TokenSupply}} |
Oops, something went wrong.