Feral File
struct Artwork {
uint256 id
uint256 seriesIndex
string ipfsCID
}
struct MintData {
uint256 tokenID
uint256 seriesIndex
address minter
string ipfsCID
}
address private _signer;
bool private _burnable;
bool private _bridgeable;
string private _tokenBaseURI;
string private _contractURI;
// Total suplies
mapping(uint256 => uint256) internal seriesMaxSupplyMap; // index => max supply
constructor(
string memory name_,
string memory symbol_,
string memory contractURI_,
string memory tokenBaseURI_,
address memory signer_,
bool burnable_,
bool bridgeable_,
uint256[] memory _seriesMaxSuplies, // indexed max supply based on series index
) ERC721(name_, symbol_) {
// Add some validations
// _seriesMaxSuplies.length > 0
// ...
_signer = signer_;
_burnable = burnable_;
_bridgeable = bridgeable_;
_tokenBaseURI = tokenBaseURI_;
_contractURI = contractURI_;
// Initialize total supply map
for (uint256 i = 0; i <_seriesMaxSuplies.length; i++) {
seriesMaxSupplyMap[i] = _seriesMaxSuplies[i]
}
}
function mint(MintData[] memory data)
external
onlyAuthorized {
for (uint256 i = 0; i< data.length; i++) {
_mint(data[i].seriesIndex,
data[i].tokenID,
data[i].ipfsCID,
data[i].minter);
}
}
function _mint(uint256 _seriesIndex,
uint256 _tokenID,
string memory _ipfsCID,
address memory _minter) private {
// TODO
}
function buy(uint256[] memory _tokenIDs,
uint256 _price,
uint256 _expiryTime,
map[address]uint256 memory _royalties,
bytes32 _r,
bytes32 _s,
uint8 _v)
external
payable
{
// TODO
}
AE
, PP
restriction, only maintain max supply for every series from contract side.featuring_index
as long as it's unique in contract.tokenID
derived from the contract address and series index and ensure the uniqueness among the whole system (no matter contract)part1 := contractAddress
part2 := decToHex(1000000 * seriesIndex + tokenIndex) // assume every series has maximum amount of token is 1000000
tokenID := hexToDec(part1 + part2) // literally concatenate
For Feral File generative artworks, it injects pre-defined variables then the collector click to view the software artwork in in frame. This helps artists be able to make variants to their artwork editions. The variables are:
Oct 9, 2023For each query of NFTs, we returns tokens in the following format.
Aug 22, 2023Learn from previous contract design.
Jul 19, 2023Each artwork is its own collection name (in collection_name field):
Jul 12, 2023or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up