Skip to content

Latest commit

 

History

History
438 lines (302 loc) · 20.5 KB

README.md

File metadata and controls

438 lines (302 loc) · 20.5 KB

FXXX LandRush

The FxxxLandRush.sol smart contract allow users to purchase of FXXX parcels of land using GZE:0x4AC0 (GazeCoin Metaverse Token) or ethers (ETH).

Purchase price:

There are 17 sectors containing parcels of land that will be sold at different timeframes. Each of these sectors will have a unique FxxxLandRush.sol smart contract, and an associated BTTSToken smart contract to record the purchases of these parcels.

When the parcels of land are later available for development, the BTTSToken parcel tokens are exchanged for ERC721 Non-Fungible Token tokens representing the ownership of the FXXX parcels of land.



Table Of Contents



Deployment Addresses

See deployment for deployment details. See scripts/genData.sh, scripts/deployment.js and scripts/FxxxLandRushSummary.json for deployment statistics.


Purchasing Contract And Token Contract

See Purchasing for instructions to purchase parcels of land from the FxxxLandRush contract.

FxxxLand purchasing contract and token contract for each zone:

Token Symbol / Name Purchasing Contract / Token Contract Address Purchase From Purchase To
FxxxHub / Fantasy Hub 0x3b0c1b99fAAfd625aACD70521d8Da167807B3b82 / 0x5B98a13e7c6Aef063551643B0171d5Cd681BF4da Oct 16 2018 15:00 PST Nov 16 2018 15:00 PST
FxxxRk / Fantasy Riot Kitty 0x460E0e607eBD39C8927210A7f32ef7bD170F7d40 / 0xd73b9d06bffA9d8B6D2E5f03de578103531215fF Nov 19 2018 15:00 PST Dec 08 2018 15:00 PST
FxxxDude / Fantasy Dude Sweet 0xbF68F58CE089b97b2F7146d2EC097F5Af9Ac217F / 0xc70ABb3546D0976d91D91AaD2773fAE69e106599 Nov 19 2018 15:00 PST Dec 08 2018 15:00 PST
FxxxBooty / Fantasy Booty Sector 0xf9A6d564217c44ab64E28C7F34CB8fE246f57539 / 0xBC844A541855Cb797163e7f4344616a97a89ccB2 Nov 19 2018 15:00 PST Dec 08 2018 15:00 PST

Time Conversions:

PST Time UTC Time AEST Time Unix Time new Date(Unix Time * 1000).toUTCString()
Oct 16 2018 15:00 Oct 16 2018 23:00 Oct 17 2018 10:00 1539730800 "Tue, 16 Oct 2018 23:00:00 UTC"
Nov 16 2018 15:00 Nov 16 2018 23:00 Nov 17 2018 10:00 1542409200 "Fri, 16 Nov 2018 23:00:00 UTC"
Nov 19 2018 15:00 Nov 19 2018 23:00 Nov 20 2018 10:00 1542668400 "Mon, 19 Nov 2018 23:00:00 UTC"
Dec 08 2018 15:00 Dec 08 2018 23:00 Dec 09 2018 10:00 1544310000 "Sat, 08 Dec 2018 23:00:00 UTC"

Available Parcels:

The presale parcels are available for purchase through these FxxxLandRush contracts.

Zone Presale # Total # USD per Parcel
FxxxHub 141 689 1500
FxxxRk 38 200 2500
FxxxDude 12 125 25000
FxxxBooty 16 79 5000

Other Contracts

Contract Address
MakerDAOETHUSDPriceFeedAdaptor:0xF31A 0xF31AA1dFbEd873Ab957896a0204a016F5E123e02
GZEETHPriceFeed:0xD649 0xD649c9b68BB78e8fd25c0B7a9c22c42f57768c91
BonusList:0x57D2 0x57D2F4B8F55A26DfE8Aba3c9f1c73CADbBc55C46


Deployment And Configuration Of FxxxLandRush Contracts

An FxxxLandRush contract will be deployed for each sector.


Deployment Of FxxxLandRush Contract

Following are the constructor parameters

No Type Notes
address _parcelToken FxxxLandRush sector token
address _gzeToken GZE:0x4AC0 address 0x4AC00f287f36A6Aad655281fE1cA6798C9cb727b
address _ethUsdPriceFeed MakerDAOETHUSDPriceFeedAdaptor:0xF31A address 0xF31AA1dFbEd873Ab957896a0204a016F5E123e02
address _gzeEthPriceFeed GazeCoin maintained GZEETHPriceFeed:0xD649 address 0xD649c9b68BB78e8fd25c0B7a9c22c42f57768c91
address _bonusList BonusList:0x57D2 address 0x57D2F4B8F55A26DfE8Aba3c9f1c73CADbBc55C46
address _wallet Wallet for GZE and ETH
uint _startDate Start date, in seconds since Jan 01 1970
uint _endDate End date, in seconds since Jan 01 1970
uint _maxParcels Maximum parcels of land for the sector
uint _parcelUsd Price of a parcel of land, in USD. e.g., USD 1,500 is specified as 1,500 * 10^18
uint _usdLockAccountThreshold Lock transfers for purchasing account if USD amount exceeds this threshold. e.g. USD 7,000 is specified as 7,000 * 10^18
uint _gzeBonusOffList Bonus for accounts not listed in the BonusList contract. e.g. 20% is specified as 20
uint _gzeBonusOnList Bonus for accounts listed in the BonusList contract. e.g., 30% is specified as 30

FxxxLandRush Contract Configuration

setWallet

function setWallet(address _wallet)

Parameters:

No Type Notes
address _wallet Wallet for GZE and ETH

setStartDate

function setStartDate(uint _startDate)

Parameters:

No Type Notes
uint _startDate Start date, in seconds since Jan 01 1970

setEndDate

function setEndDate(uint _endDate)

Parameters:

No Type Notes
uint _endDate End date, in seconds since Jan 01 1970

setMaxParcels

function setMaxParcels(uint _maxParcels)

Parameters:

No Type Notes
uint _maxParcels Maximum parcels of land for the sector

setParcelUsd

function setParcelUsd(uint _parcelUsd)

Parameters:

No Type Notes
uint _parcelUsd Price of a parcel of land, in USD. e.g., USD 1,500 is specified as 1,500 * 10^18

setUsdLockAccountThreshold

function setUsdLockAccountThreshold(uint _usdLockAccountThreshold)

Parameters:

No Type Notes
uint _usdLockAccountThreshold Lock transfers for purchasing account if USD amount exceeds this threshold. e.g. USD 7,000 is specified as 7,000 * 10^18

setGzeBonusOffList

function setGzeBonusOffList(uint _gzeBonusOffList)

Parameters:

No Type Notes
uint _gzeBonusOffList Bonus for accounts not listed in the BonusList contract. e.g. 20% is specified as 20

setGzeBonusOnList

function setGzeBonusOnList(uint _gzeBonusOnList)

Parameters:

No Type Notes
uint _gzeBonusOnList Bonus for accounts listed in the BonusList contract. e.g., 30% is specified as 30


Updating The GZE/ETH PriceFeed

The GZE/ETH PriceFeed has been deployed to [GZEETHPriceFeed:0x4604]. See Deployment - GZE/ETH PriceFeed for scripts to update the price feed.

Contract address:

0xD649c9b68BB78e8fd25c0B7a9c22c42f57768c91

Contract ABI:

[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"operators","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRate","outputs":[{"name":"_rate","type":"uint256"},{"name":"_live","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_rate","type":"uint256"},{"name":"_live","type":"bool"}],"name":"setRate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnershipImmediately","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"live","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_operator","type":"address"}],"name":"addOperator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_operator","type":"address"}],"name":"removeOperator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"newOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_name","type":"string"},{"name":"_rate","type":"uint256"},{"name":"_live","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"oldRate","type":"uint256"},{"indexed":false,"name":"oldLive","type":"bool"},{"indexed":false,"name":"newRate","type":"uint256"},{"indexed":false,"name":"newLive","type":"bool"}],"name":"SetRate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_operator","type":"address"}],"name":"OperatorAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_operator","type":"address"}],"name":"OperatorRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

addOperator

The contract owner adds an operator account that is then permissioned to update the rates. Multiple operators can be permissioned.

function addOperator(address _operator)

Parameters:

No Type Notes
uint _operator Operator account

removeOperator

The contract owner can remove an operator account's permission.

function removeOperator(address _operator)

Parameters:

No Type Notes
uint _operator Operator account

setRate

Any permissioned operator account can set the GZE/ETH rate.

function setRate(uint _rate, bool _live)

Parameters:

No Type Notes
uint _rate GZE/ETH market rate. e.g., 0.00004199 is specified as 0.00004199 * 10^18
bool _live Is the price live? If the price is not live, user's will not be able to purchase FxxxLandRush parcels with GZE


Updating The BonusList

The BonusList has been deployed to BonusList:0x57D2. See Deployment - BonusList for scripts to update the bonus list.

Contract address:

0x57D2F4B8F55A26DfE8Aba3c9f1c73CADbBc55C46

Contract ABI:

[{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"operators","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"accounts","type":"address[]"}],"name":"remove","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"bonusList","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnershipImmediately","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"isInBonusList","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_operator","type":"address"}],"name":"addOperator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_operator","type":"address"}],"name":"removeOperator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"accounts","type":"address[]"}],"name":"add","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"newOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"account","type":"address"},{"indexed":false,"name":"status","type":"bool"}],"name":"AccountListed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_operator","type":"address"}],"name":"OperatorAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_operator","type":"address"}],"name":"OperatorRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

addOperator

The contract owner adds an operator account that is then permissioned to update the bonus list. Multiple operators can be permissioned.

function addOperator(address _operator)

Parameters:

No Type Notes
uint _operator Operator account

removeOperator

The contract owner can remove an operator account's permission.

function removeOperator(address _operator)

Parameters:

No Type Notes
uint _operator Operator account

add

Any permissioned operator account can add one or more addresses to the bonus list.

function add(address[] accounts)

Parameters:

No Type Notes
address[] accounts Array of accounts to add to the bonus list

remove

Any permissioned operator account can remove one or more addresses from the bonus list.

function remove(address[] accounts)

Parameters:

No Type Notes
address[] accounts Array of accounts to remove from the bonus list


Code Review


Outside Scope

Outside scope as the following have been audited:

  • contracts/BTTSTokenInterface110.sol
    • contract ApproveAndCallFallBack
    • contract BTTSTokenInterface is ERC20Interface
  • contracts/BTTSTokenFactory110.sol
    • contract ERC20Interface
    • contract ApproveAndCallFallBack
    • contract BTTSTokenInterface is ERC20Interface
    • library BTTSLib
    • contract BTTSToken is BTTSTokenInterface
      • using BTTSLib for BTTSLib.Data;
    • contract Owned
    • contract BTTSTokenFactory is Owned


Thanks to Adrian Guerrera for helping to validate these contracts.

(c) BokkyPooBah / Bok Consulting Pty Ltd for GazeCoin - Oct 08 2018. The MIT Licence.