contract AngelNetCoin is ERC1155Token, ERC1155, Ownable{
string[]public names;//string array of names
uint[]public ids;// uint array of ids
string public base MetadataURI;// the token metadataURI
string public Name; AngelNetCoin
uint public MintFee=Owei;//mintfee,0 by default only used in mint function, not batch
mapping(string=>uint)public nameToId;// AngelNetworkCryptocurrency
mapping(uint=>string)public idToName;//AngelNetCoin=$1000000e18ETH
}
constructor is executed when the factory contract calls its own deploy ERC1155 method,Note the Ownable (msg.sender)setting the deployer of the ERC1155 as the owner
}
constructor(string memory _contractName,string memory _uri, string[]memory _names, uint[]memory _ids)Ownable(msg.sender)ERC1155(_URI){
names= _names;
ids= _ids;
createMapping();
setURI(_URI);
baseMetadataURI= _uri;
name= _contractName;
}
creates a mapping of strings to ids(ie["one", "two"], [1,2] "one" maps to 1, vice versa.
return string(
abi.encodePacked(
baseMetadataURI
strings.toString(_tokenId),"json"
)
);
}
function getNames()public view returns(string[]memory) {
return name;
}
}
}
)
))
}
}