Blockopoly World and Land Token Contracts
- Using OpenZeppelin 1.11.0 framework for best security and stability
- Token is ERC721 non-fungible token standard
- Using lateset Solidity 0.4.24 at the time of writing
- Using async/awake and Chai for clean and readable test code
- Flattened scripts using truffle-flattener, for deploying to Remix without using truffle
What's Block42 World
A world is a separated planet, which having number of lands. In Block42 universe, there can be unlimited number of parallel worlds (capped by uint32
, i.e. 4.3B, but is way enough). A world is an ERC721 token which can be owned. The owner of first few worlds will be us, and we will give / sell the ownership of world to anyone who are passionate to contribute to Block42 community.
What's Block42 Land
In each world, there's a number of lands. Each land is also an ERC721 token. World creators can create arbitrary number of lands, given the x, y positions, width and height of the land. Positions are capped to be within +/- 1T. Width and height should be under 65k and must be a odd number, to avoid using floating numbers. Lands should not be overlapping each other. A land's uint256
token ID is encoded from (worldId, x, y)
and should always be unique. After world creator creating the new land, he can give / sell to anymore. The land owner then can construct voxel buildings and decorations in his own land, using our web app or standalone client. A voting and rewarding system may be introduced in later stage, for incentivizing players who build good content in their lands, as well as prohibiting illegal content.
Getting Started
Requirements
- Node.js 10.7.x
- truffle
npm install -g truffle
- ganache-cli
npm install -g ganache-cli
- truffle-flattener
npm install -g truffle-flattener
(Optional)
Install dependencies
npm i
Ganache
Start Ganache CLI to run a local private blockchain, or use GUIganache-cli
Compile the contracts
truffle compile
Deploy contracts to the local environment
truffle migrate
Run test
truffle test
Create flattened scripts (Optional to deploy at Remix)
truffle-flattener contracts/World.sol > contracts_flattened/World.sol
truffle-flattener contracts/Land.sol > contracts_flattened/Land.sol
Contract Address
Kovan
- World.sol: 0x59c1f440e53509e29915e2ddcc3b9cafab77179a
- Land.sol: 0xa2b3f2f1ffb050e93807244bcd94886d2b6556ca
TODO
License
Code released under the MIT License.