GithubHelp home page GithubHelp logo

2022-06-nibbl's Introduction

Nibbl contest details

Nibbl is a fractionalization protocol that creates ERC20 tokens representing fractional ownership of an ERC721.

Nibbl uses a Bonding curve to facilitate trading of the ERC20 tokens.

The protocol also implements a valuation-based buyout mechanism so that the ERC721 isn’t locked in a contract/vault forever. A user can initiate a buyout and they need to pay an upfront cost for that. The cost is decided based on the current valuation of tokens. If the valuation goes above a certain level within a predefined duration the buyout is rejected. Therefore, the community can buy more tokens in order to reject a buyout. If the buyout isn’t rejected it is automatically considered successful and the user who initiated the buyout can withdraw the asset.

Important Links

Code Repository: https://github.com/NibblNFT/nibbl-smartcontracts

Documentation: https://github.com/NibblNFT/nibbl-smartcontracts/blob/master/README.md

Code and Architecture Walkthrough: https://youtu.be/dJFOgo58qVg

Product Beta: http://beta.nibbl.xyz/

To run tests

To run tests, run following commands:

$ npm install
$ npx hardhat test

Contracts in Scope

File LoC External Calls Description
NibblVaultFactory.sol 70 0 Vault Factory that deploys vault and handles governance and access control.
NibblVault.sol 290 0 Vault which holds NFT and has logic for trading and buyout
Basket.sol 80 0 Basket that can be used to fractionalize multiple NFTs.
Twav.sol 25 0 Implements time-weighted valuation to be consumed in NibblVault for buyouts
ProxyVault.sol 17 0 Proxy contract that gets deployed with implementation as NibblVault
ProxyBasket.sol 17 0 Proxy contract that gets deployed with implementation as Basket
AccessControlMechanism.sol 19 0 Inherited in NibblVaultFactory for access control on certain actions
EIP712Base.sol 21 0 To implement permit functionality with EIP712 signing.

Out of scope

  1. Admin can pause and change certain parameters of the contract.
  2. BancorFormula.sol: Implementation of Bancor Formula.

Areas of concern

  1. Trade Accounting
  • The secondary and primary reserve balances (including fictitious primary reserve balance) should update correctly in all 3 trade scenarios - trade in primary curve, trade in secondary curve, trade in both primary and secondary curve.
  • Admin fee, curator fee and curve fee should update correctly.
  1. Upgradablity, pausability and access control

  2. TWAV

  • Values get updated and computed correctly
  1. Buyout
  • Game theoretical issues in the buyout game
  • Accounting issues while initiating buyout and token redemption
  • Possible manipulation scenarios with TWAV array
  • Potential issue with minimum buyout time as that is recently added feature
  • Only successful bidder should be able to withdraw NFT

Previous Audit

  1. https://github.com/NibblNFT/nibbl-smartcontracts/tree/master/audits

2022-06-nibbl's People

Contributors

mundhrakeshav avatar kartoonjoy avatar itsmetechjay avatar c4-staff avatar jacobheun avatar

Stargazers

Varun Verma avatar

Watchers

Ashok avatar  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.