Skip to content

An ERC721 & Bonding Curve implementation for unique one-of-a-kind tokens

Notifications You must be signed in to change notification settings

easonchai/bonding-curve-erc721

Repository files navigation

One-Of-A-Kind ERC721 & Bonding Curve

This experiment is a playground for the development of unique SPACE tokens for the Decentramall project. 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 SPACE whose price follows a bonding curve. An owner can only own one SPACE token, preventing anyone from gaining control of the entire mall by purchasing all the SPACE available

Breakdown

🌌 SPACE Token

The SPACE token is created in the DecentramallToken.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 SPACE tokens.
Since the SPACE 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 SPACE tokens. Each rental lasts for 1 year and will cost 1/10 of the current SPACE purchase price.

🗳️ Administration

Handles adding/removing admins from control of the contract

Pre Requisites

Install 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

About

An ERC721 & Bonding Curve implementation for unique one-of-a-kind tokens

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published