JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 12
  • Score
    100M100P100Q62948F
  • License MIT

a16z Smart Contract library for Solidity

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@a16z/contracts) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    a16z Contracts

    A repository for contracts written by a16z.

    CantBeEvil License

    The purpose of this repository is to provide an on-chain representation of the CantBeEvil license.

    The CantBeEvil license is made available as a contract that can be inherited by any other contract.

    There are six variants of the CantBeEvil license:

    TODO: update these to 6

    Usage

    The license versions are represented on-chain as an enum.

    enum LicenseVersion {
        CB_CC0,
        CB_ECR,
        CB_NECR,
        CB_NECR_HS,
        CB_PR,
        CB_PR_HS
    }
    

    Pass the desired version into the CantBeEvil constructor, as shown:

    import {LicenseVersion, CantBeEvil} from "@a16z/licenses/CantBeEvil.sol";
    
    contract MyContract is CantBeEvil(LicenseVersion.CC0) {
        ...
    }

    You can now call MyContract.getLicenseURI(), which will return an Arweave gateway link to the license text file.

    MyContract.getLicenseURI() // => "https://arweave.net/d2k7..."

    contracts/licenses/CantBeEvil.sol

    This contract is meant to be inherited by NFT contracts and any contract that wishes to expose the getLicenseURI method.

    contracts/examples/MyToken.sol

    An example NFT contract that inherits CantBeEvil.