Coder Social home page Coder Social logo

contracts-3's Introduction

Fractional contracts

Settings

This is a generic settings contract to be owned by governance. It is gated by some high and low boundary values. It allows for governance to set parameters for all Token Vaults.

Vault Factory

This is a simple factory where a user can call mint to create a new vault with the token that they want to fractionalize. The user must pass in:

  • an ERC20 token desired name
  • an ERC20 token desired symbol
  • the ERC721 token address they wish to fractionalize
  • the ERC721 token id they wish to fractionalize
  • the desired ERC20 token supply
  • the initial listing price of the NFT
  • their desired curator fee

Initialized Proxy

A minimal proxy contract to represent vaults which allows for cheap deployments.

Token Vault

The token vault is the smart contract which holds the logic for NFTs that have been fractionalized.

Token owners are able to update the reserve price with a weighted average of all token owners reserve prices. This is done automatically on token transfer to new accounts or manually through updateUserPrice.

Alongside this logic, is auction logic which allows for an outside user to initial a buyout auction of the NFT. Here there are start, bid, end and cash functions.

Start

The function called to kick off an auction. msg.value must be greater than or equal to the current reserve price.

Bid

The function called for all subsequent auction bids.

End

The function called when the auction timer is up and ended.

Cash

The function called for token owners to cash out their share of the ETH used to purchase the underlying NFT.

There is also some admin logic for the curator (user who initially deposited the NFT). They can reduce their fee or change the auction length. Alongside this, they are able to claim fees in the form of token supply inflation.

IndexERC721

This is a single token ERC721 which is used to custody multiple ERC721 tokens.

depositERC721

Anyone can deposit an ERC721 token into the contract

withdrawERC721

The token owner can withdraw any ERC721 tokens in the contract

withdrawETH

The token owner can withdraw any ETH in the contract

withdrawERC20

The token owner can withdraw any ERC20 token in the contract

Deployments

Mainnet

Vault Factory

Token Vault

Settings

Index ERC721 Factory

Rinkeby

Vault Factory

Token Vault

Settings

Index ERC721 Factory

contracts-3's People

Contributors

andy8052 avatar smaroo avatar

Watchers

James Cloos 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.