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.
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
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.
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.
Handles the renting of SPACE tokens. Each rental lasts for 1 year and will cost 1/10 of the current SPACE purchase price.
Handles adding/removing admins from control of the contract
$ npm install
truffle compile --all
truffle migrate --network development
Make sure to have a running Ganache instance in the background.
$ npm run test