Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/easonchai/bonding-curve-erc721
An ERC721 & Bonding Curve implementation for unique one-of-a-kind tokens
https://github.com/easonchai/bonding-curve-erc721
bonding-curves decentramall erc721 solidity
Last synced: 3 months ago
JSON representation
An ERC721 & Bonding Curve implementation for unique one-of-a-kind tokens
- Host: GitHub
- URL: https://github.com/easonchai/bonding-curve-erc721
- Owner: easonchai
- Created: 2020-07-19T08:55:42.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T03:26:50.000Z (about 2 years ago)
- Last Synced: 2024-04-21T13:45:04.310Z (9 months ago)
- Topics: bonding-curves, decentramall, erc721, solidity
- Language: JavaScript
- Homepage:
- Size: 4.69 MB
- Stars: 4
- Watchers: 0
- Forks: 1
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# One-Of-A-Kind ERC721 & Bonding Curve
This experiment is a playground for the development of unique SPACE tokens for the [Decentramall project](https://github.com/decentramall/decentramall). We use [Truffle](https://github.com/trufflesuite/truffle) as a development environment for compiling, testing, and deploying our contracts. They were written in [Solidity](https://github.com/ethereum/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
```bash
$ npm install
```## Usage
```bash
truffle compile --all
truffle migrate --network development
```Make sure to have a running [Ganache](https://truffleframework.com/ganache) instance in the background.
### Test
```bash
$ npm run test
```