Coder Social home page Coder Social logo

erc721-bonding-curve's Introduction

ERC721 & Bonding Curve

This experiment is a playground for the development of unique PROPERTY tokens for the Realestate. We use Truffle as a development environment for compiling, testing, and deploying our contracts. They were written in Solidity.

Idea

The idea is for an owner to purchase a retail PROPERTY whose price follows a bonding curve. An owner can only own one PROPERTY token, preventing anyone from gaining control of the entire mall by purchasing all the PROPERTY available

PROPERTY Token

The PROPERTY token is created in the RealestateToken.sol file. It follows a basic ERC721 implementation with nothing unique in particular.
However, to achieve the unique one-of-a-kind ownership and restriction, the ERC721 tokenID is based a keccak256 hash of the owner's address, making it impossible for an owner to mint an ERC721 token twice.

Estate Agent

The EstateAgent houses the bonding curve function as well as purchasing and selling of PROPERTY tokens.
Since the PROPERTY tokens have to be minted only when a buyer exists, the bonding curve requires a slight modification to its implementation. It allows for continuous minting of tokens but only up to a certain threshold which is declared during initialization under _currentLimit.

Rental Agent

Handles the renting of PROPERTY tokens. Each rental lasts for 1 year and will cost 1/10 of the current PROPERTY purchase price.

Admin

Handles adding/removing admins from control of the contract

Pre Requisites

Install node Modules

$ npm install

Usage

truffle compile --all
truffle migrate --network development

Make sure to have a running Ganache instance in the background.

Test

$ npm run test

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.