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;
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.
Contracts > Game > Levels.
Go to truffle-config.js and add your Infura api and your mnemonic
const infuraApi = "** Your Infura apy key **";
const mnemonic = "** Your mnemonic **";
truffle migrate --reset --network ropsten
Once the migration has been done
truffle console --network ropsten