Skip to content

Ivan-on-Tech-Academy/IotDevsGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published