Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sur Protocol

A modular NFT infrastructure

Key concepts

This protocol is based on a modular architecture comprising multiple interconnected smart contracts, thereby eliminating the need for upgradable proxies. Each smart contract is tailored to fulfill a specific function and can be removed or substituted with a new contract if required. The level of security is attained through a system of roles that establishes the rules governing the interactions between contracts.

Contracts

  • Sur1155Impl
  • Sur1155Proxy
  • SurAuthority
  • SurFactory
  • SurMinter
  • SurTreasury
  • SurGateway

Sur1155Impl

The implementation of ERC-1155, representing an NFT collection.

Features

  • Enriched with a setup function to operate under the proxy (Sur1155Proxy.sol).
  • The tokenId for tokens in the collection will always be a sequential value (ERC1155Sequential.sol).
  • Supports contractURI, which serves as the default metadata URI for tokens, and allows setting a custom URI for a specific tokenId (ERC1155Uri.sol).
  • Supports ownership through OpenZeppelin's Ownable2Step.
  • Introduces the following roles (Roles.sol / Sur1155Roles):
    • SUR_1155_TOKEN_CREATOR
    • SUR_1155_MINTER
    • SUR_1155_BURNER
  • Relies on the authority provided during setup to verify the roles of msg.sender (RoleChecker.sol).
  • Supports the creation of new tokens, minting, and burning based on the mentioned roles.
  • Includes a burn function that allows any holder to burn their owned NFTs.

Sur1155Proxy

A straightforward, non-upgradable ERC-1967 proxy that reduces the cost of NFT deployments and points to the implementation.

SurAuthority

The contract responsible for managing roles. The role system is the fundamental concept of the protocol that prevents contracts from executing actions requested by unvalidated senders. Implements OpenZeppelin's AccessControlDefaultAdminRules. The owner of the Admin role for SurAuthority is the Sur multisig address.

SurFactory

A minimalistic smart contract that streamlines the creation of NFTs within SurProtocol. It creates a new Sur1155Proxy instance pointing to the specified Sur1155Impl and sets the default SurAuthority for managing the collection's roles.

SurMinter

A contract representing minting rules and performing minting. There might be multiple active SurMinter instances in the protocol. Each minter can have any number of Minting Campaigns. A Minting Campaign is described by MintCampaignConfig and linked to a token (collection / tokenId). Each campaign is assigned a campaignId, which is a sequential uint256 mapped to collection / tokenId. One collection / tokenId pair can have multiple campaigns. These campaigns can even be active simultaneously.

V1 features (SurMinter.sol)

  • Supports referral during minting and/or campaign creation.
  • Allows setting mintsPerWallet, supply, startDate, and endDate for each campaign.
  • Adds the ability to leave a comment during minting (emits ISurMinter.MintComment).
  • Introduces the following roles (Roles.sol / SurMinterRoles):
    • SUR_MINTER_COMMENTER
    • SUR_MINTER_CAMPAIGN_CREATOR
    • SUR_MINTER_FREE_MINT
  • Relies on the authority of the collection to verify the roles of msg.sender (RoleChecker.sol).

SurTreasury

A contract made for the distribution of creators' royalties and protocol commissions.

SurGateway

A smart contract implementing the business requirements of Sur App. Allows for:

  • Creating a collection
  • Creating a minting campaign
  • Minting tokens

Schematics

SurProtocolFlow.png

About

A modular NFT infrastructure

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages