-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[KRYS-1496] NFT contracts support (#33)
* 1st draft of NFT contracts * use upgradable * upgradable NFT contract and added proxy multisig * add staging nft contract * minor * redeploy to ropsten
- Loading branch information
Jarvis
authored
Sep 13, 2021
1 parent
1230b35
commit c8be582
Showing
12 changed files
with
452 additions
and
168 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
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,13 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity 0.7.6; | ||
|
||
import "./KrystalCollectiblesStorage.sol"; | ||
import "@openzeppelin/contracts/proxy/TransparentUpgradeableProxy.sol"; | ||
|
||
contract KrystalCollectibles is TransparentUpgradeableProxy { | ||
constructor( | ||
address _logic, | ||
address _admin, | ||
bytes memory _data | ||
) TransparentUpgradeableProxy(_logic, _admin, _data) {} | ||
} |
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,36 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity 0.7.6; | ||
|
||
import "./KrystalCollectiblesStorage.sol"; | ||
import "@openzeppelin/contracts/utils/Strings.sol"; | ||
|
||
contract KrystalCollectiblesImpl is KrystalCollectiblesStorage { | ||
using Strings for uint256; | ||
|
||
function initialize( | ||
string memory _name, | ||
string memory _symbol, | ||
string memory _uri | ||
) public initializer { | ||
super.initialize(_uri); | ||
name = _name; | ||
symbol = _symbol; | ||
tokenUriPrefix = _uri; | ||
} | ||
|
||
// Overriding original ERC-1155 format | ||
function uri(uint256 tokenId) external view override returns (string memory) { | ||
return string(abi.encodePacked(tokenUriPrefix, tokenId.toString())); | ||
} | ||
|
||
// ERC-721 Compatible | ||
function tokenUri(uint256 tokenId) external view returns (string memory) { | ||
return string(abi.encodePacked(tokenUriPrefix, tokenId.toString())); | ||
} | ||
|
||
function setURI(string memory newuri) external { | ||
require(hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "setURI: admin required"); | ||
super._setURI(newuri); | ||
tokenUriPrefix = newuri; | ||
} | ||
} |
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,11 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity 0.7.6; | ||
|
||
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; | ||
import "@openzeppelin/contracts-upgradeable/presets/ERC1155PresetMinterPauserUpgradeable.sol"; | ||
|
||
contract KrystalCollectiblesStorage is ERC1155PresetMinterPauserUpgradeable, ReentrancyGuard { | ||
string public name; | ||
string public symbol; | ||
string public tokenUriPrefix; | ||
} |
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
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
Oops, something went wrong.