Socket
Socket
Sign inDemoInstall

a16z-contracts

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    a16z-contracts

a16z Smart Contract library for Solidity


Version published
Maintainers
1
Created

Readme

Source

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

  • Creator Retention (“CR”) – Full non-exclusive commercial rights granted, with no hate speech revocation.

  • Creator Retention with Hate Speech Revocation (“CR-HS”) – Full non-exclusive commercial rights granted, with hate speech revocation.

  • Exclusive Rights with No Creator Retention (“ER”) – Full exclusive commercial rights granted, with no hate speech revocation.

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.

Keywords

FAQs

Last updated on 07 Aug 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc