Created
October 24, 2021 08:09
-
-
Save soenkeba/a2db4a7aac88d6e2c1d996e610973cbe to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
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
pragma solidity ^0.8.0; | |
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; | |
import "openzeppelin/contracts/utils/Strings.sol" | |
contract sciencefaction is ERC1155 { | |
uint256 public constant NFThistory = 0x01559ae4021a99b0d373d7bc8a80504bad782367abe12c21373c83adc6bf6a7e; | |
function mint( | |
address to, | |
uint256 id, | |
uint256 amount, | |
bytes memory data | |
) virtual public { | |
_mint(to, id, amount, data); | |
} | |
constructor() public ERC1155("ipfs://f0{id}") { | |
_mint(msg.sender, NFThistory, 1, ""); | |
} | |
function uri(uint256 _tokenID) override public view returns (string memory) { | |
string memory hexstringtokenID; | |
hexstringtokenID = uint2hexstr(_tokenID); | |
return string( | |
abi.encodePacked( | |
"ipfs://f0", | |
hexstringtokenID) | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment