top of page

  ⛓️ Guess Guess Game

 

- 2022

- Blockchain, game page

 

Guess Guess Game is a blockchain-based web guessing game that delves into the themes of inertial thinking versus new memory, as well as the hidden expressions of those who have lost their sovereignty of language under the control of power and rules.

Another Blockchain Work:

How to play?

- Click the button "Play now" or open the link: https://emair2.github.io/EM927/em-guess/GuessGuessGame/

- Answer questions to earn EM tokens.

You should know before you play:

1. You should download "Meta Mask" and connect the Mumbai Chain Testnet;

2. You will get 10 free EM Tokens;

3. You can answer each question by paying a specific amount of EM Tokens until you get it right;
4. If you get it right, you will get the corresponding EM Tokens, but you can only redeem the reward for the correct answer once per account.

5. Good luck 🤞 

截屏2023-01-09 21.24.07.png
截屏2023-01-09 21.24.32.png

 - Coding    

// Part of the content has been deleted!
//Copy please do not delete this line. This code is derived from Yimei Zhu's work Guess Guess Game, 2022. Coding by Yimei and Douglas.

pragma solidity ^0.8.4;

 

import "@openzeppelin/contracts@4.7.3/token/ERC20/ERC20.sol";

import "@openzeppelin/contracts@4.7.3/token/ERC20/extensions/ERC20Burnable.sol";

contract EM is ERC20, ERC20Burnable, Ownable {

constructor() ERC20("EM", "MTK") {

_mint(msg.sender, 30000 * 10 ** decimals());

}

 

uint256 public num;

mapping(address => bool) addressToHasRedeemedFreeTokens;

mapping(address => mapping(uint => bool)) public addressToAnswerTable;

uint256 public constant FREE_TOKEN_AMOUNT = 10;

event AnswerEvent(bool wrongOrCorrect);

function InitialEMCoin() public view returns (uint) {

return address(this).balance;

}

 

uint256[] public FEES = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

uint256[] public REWARDS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

function mint(address to, uint256 amount) public onlyOwner {

_mint(to, amount);

}

 

function redeemFreeTokens() public {

require(addressToHasRedeemedFreeTokens[msg.sender] == false, "Already redeemed free tokens");

_mint(msg.sender, FREE_TOKEN_AMOUNT * 10 ** decimals());

addressToHasRedeemedFreeTokens[msg.sender] = true;

}

 

function answer1(string memory _guess) public {

uint256 FEE = FEES[1] * 10 ** decimals();

uint256 REWARD = REWARDS[1] * 10 ** (decimals()-2);

 

require(addressToAnswerTable[msg.sender][1] == false,

"You already got your EM Coin!!!!");

transfer(address(this), FEE);

 

if(keccak256(abi.encodePacked(_guess)) != Yimei's accound {

emit AnswerEvent(false);

return;

}

_mint(msg.sender, REWARD);

addressToAnswerTable[msg.sender][1] = true;

emit AnswerEvent(true);

}

 

function answer2(string memory _guess) public {

uint256 FEE = FEES[2] * 10 ** decimals();

uint256 REWARD = REWARDS[2] * 10 ** (decimals()-2);

require(addressToAnswerTable[msg.sender][2] == false,

"You already got your EM Coin!!!!");

require(addressToAnswerTable[msg.sender][1] == true, "Please answer the previous challenge correctly first");

transfer(address(this), FEE);

if(keccak256(abi.encodePacked(_guess)) != 0x53cd20a71c8974d8e317a7323d3f45d878d5529670789c7a0ea65b6ff4bf5bf7) {

emit AnswerEvent(false);

return;

}

_mint(msg.sender, REWARD);

addressToAnswerTable[msg.sender][2] = true;

}

 

function answer3(string memory _guess) public {

uint256 FEE = FEES[3] * 10 ** decimals();

uint256 REWARD = REWARDS[3] * 10 ** (decimals()-2);

require(addressToAnswerTable[msg.sender][3] == false,

"You already got your EM Coin!!!!");

require(addressToAnswerTable[msg.sender][2] == true, "Please answer the previous challenge correctly first");

transfer(address(this), FEE);

if(keccak256(abi.encodePacked(_guess)) != 0x5c7d18be0b53c6c839ab2c61a64b224ac3898baced1823dcfd1a0eaa48a1c85e) {

emit AnswerEvent(false);

return;

}

_mint(msg.sender, REWARD);

addressToAnswerTable[msg.sender][3] = true;

}

 

function answer4(string memory _guess) public {

uint256 FEE = FEES[1] * 10 ** decimals();

uint256 REWARD = REWARDS[1] * 10 ** (decimals()-2);

require(addressToAnswerTable[msg.sender][4] == false,

"You already got your EM Coin!!!!");

require(addressToAnswerTable[msg.sender][3] == true, "Please answer the previous challenge correctly first");

transfer(address(this), FEE);

if(keccak256(abi.encodePacked(_guess)) != My accound {

emit AnswerEvent(false);

return;

}

_mint(msg.sender, REWARD);

addressToAnswerTable[msg.sender][4] = true;

}

... Same like Question 1-4

}

Hey! You know?

- There are no absolute winners in the casino, and neither is society.
- Power can seal people's mouths but not their minds.
- It's really a scam.
- It is not a game, but a hidden poem.

- Just kidding, it's just a crazy person talking seriously.

- Nice to see you.

bottom of page