Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soenkeba/a2db4a7aac88d6e2c1d996e610973cbe to your computer and use it in GitHub Desktop.
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=
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