Coder Social home page Coder Social logo

a16z-contracts's Introduction

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:

  1. CC0 (“CBE-CC0”) – All copyrights are waived under the terms of CC0 1.0 Universal developed by Creative Commons.
  2. Exclusive Commercial Rights with No Creator Retention (“CBE-ECR”) – Full exclusive commercial rights granted, with no hate speech termination. Creator does not retain any exploitation rights.
  3. Non-Exclusive Commercial Rights (“CBE-NECR”) – Full non-exclusive commercial rights granted, with no hate speech termination. Creator retains exploitation rights.
  4. Non-Exclusive Commercial Rights with Creator Retention & Hate Speech Termination (“CBE-NECR-HS”) – Full non-exclusive commercial rights granted, with hate speech termination. Creator retains exploitation rights.
  5. Personal License (“CBE-PR”) – Personal rights granted, without hate speech termination.
  6. Personal License with Hate Speech Termination (“CBE-PR-HS”) – Personal rights granted, with hate speech termination.

Installation

Install the Cant Be Evil License smart contracts in your hardhat project:

npm i @a16z/contracts

Usage

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

enum LicenseVersion {
    CBE_CC0,
    CBE_ECR,
    CBE_NECR,
    CBE_NECR_HS,
    CBE_PR,
    CBE_PR_HS
}

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

import {LicenseVersion, CantBeEvil} from "@a16z/contracts/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 and getLicenseName methods.

contracts/examples/MyToken.sol

An example NFT contract that inherits CantBeEvil.

a16z-contracts's People

Contributors

fmhall avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.