Skip to content

Latest commit

 

History

History
60 lines (38 loc) · 1.65 KB

README.md

File metadata and controls

60 lines (38 loc) · 1.65 KB

IotDevsGame

A game for Solidity developers.

How does it work?

Once a new player sign in, it gets a NFT token which represents her/him in the game.
For each level completed, the NFT will level up
Main.sol is the main contract which contains the functions necessary to create a new instance of the level, and check if the level has been successfully completed.
Mentors can create new contracts (levels) to test player's fundaments,logic, and in general Solidity skills.
A new level can be added to the game by the contract owner.
In order to have the level added to the game it needs two smart contract :

  • The game instance;
  • The game deployer;

Instance && Deployer

Once created the game, the developer needs also to provide a Deployer contract which must contain:
function newInstance () && function check (address _instance, address _player)

The function newInstance () will deploy a new instance of the game;
The function check (address _instance, address _player) will verify if the level has been completed and will return true if positive.

A test.js file needs to be provided with the two smart contracts.

Examples

Contracts > Game > Levels.

Starter kit

Register on Infura

https://infura.io/register

Deploy on Ropsten

Go to truffle-config.js and add your Infura api and your mnemonic

const infuraApi = "** Your Infura apy key **";
const mnemonic = "** Your mnemonic **";

migrate the main contract to Ropsten

truffle migrate --reset --network ropsten

Once the migration has been done

truffle console --network ropsten