a16z-contracts icon indicating copy to clipboard operation
a16z-contracts copied to clipboard

added token level specificity for CBE licenses

Open koloz193 opened this issue 2 years ago • 2 comments

While for certain projects having a contract level license is sufficient, for platform minting contracts that are shared amongst artists or even in the CryptoArt field there may be the case where a creator wants to have the ability to specify a license at the token level.

Added a new abstract contract that has the concept of a token id to associate a given license to a token. The function function _getLicenseVersion(uint256 _tokenId) internal virtual view returns (LicenseVersion); was left as unimplemented to accommodate contract level licenses as well returning a hardcoded value.

koloz193 avatar Sep 09 '22 20:09 koloz193

This is a really cool idea. I wonder if it might be better to put the mapping, getter, and setter functions into a new CantBeEvilToken.sol contract to make it more modular? And then anyone implementing an ERC721 or even ERC1155 contract can inherit from the CantBeEvilToken.sol and call the setter function in their own customized mint function. Curious to hear your thoughts on this.

Blauyourmind avatar Oct 24 '22 18:10 Blauyourmind

i thought about that but thought the more generic approach of having this overridable, abstract fn was better that way someone who wanted a contract level license could just do

function _getLicenseVersion(uint256) internal virtual override view returns (LicenseVersion) {
  return LicenseVersion.CBE_CC0;
}

but i also see value in having the implementer need to write as little code as possible.

koloz193 avatar Nov 29 '22 16:11 koloz193