Skip to content

DimensionDev/MysteryBox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MysteryBox Smart Contract

Brief introduction

MysteryBox Smart Contract is an Ethereum smart contract for people to sell/buy NFT tokens. Inspired by Fukubukuro, people can put NFT(s) in a box and customers/players can pick an NFT(randomly).

For design details, please see API document.

Getting Started

Project setup

This project has git submodules. You need to initialize these submodules first.

git submodule update --init --recursive

To install required node.js modules

npm ci

To compile the solidity source code

npm run compile

To run unit test:

npm run test

To deploy the smart contract on Ethereum rinkeby testnet:

npm run deploy rinkeby

Using the helper.ts script to set up the deployed smart contracts.

Troubleshoot & Tips

  • This project is powered by hardhat.   You can change your network configuration in hardhat.config.ts file.
  • This smart contract involves some randomness, hence, the estimated gas consumption is probably not accurate. To make sure transaction gas limit is large enough, we need to give a larger gas consumption.

Deployed Contract Address

MysteryBox & MaskTestNFT

Chain MysteryBox MaskTestNFT
mainnet 0x294428f0 0x56136E69
ropsten 0xc7387b6A 0x4c73F4DC
rinkeby 0xF8ED169B 0x0c8FB5C9
bsc 0xa8518287
matic 0x02F98667 0x49C2a3D9
goerli 0xd4ABB07c 0xcdE281B3
fantom 0x19f179D7 0x05ee315E
celo 0x578a7Fee 0x066804d9
avalanche 0x05ee315E 0x81246335
optimism_kovan 0x3eadcFB5 0x7DBA5446
optimism 0xF9F7C149 0x578a7Fee
aurora 0x5B966f3a 0x54a0A221
fuse 0x5B966f3a 0x54a0A221
boba 0x5B966f3a
moonriver 0x6cc1b105
conflux_espace_test 0x4c64b524 0xc29afd93
conflux_espace 0x4c64b524 0xc29afd93
harmony_test 0x4fda6d9b 0xd48bc506
harmony 0xDc0905F2 0x677f7bba
metis_test 0x5B966f3a 0x981be454
metis 0x981be454 0x96c7D011
kardia 0xbC7d9898 0x8D03d9b4
astar 0x041Bdc5b 0x7E0aa694
base 0xc3e62b2C 0x081ea643
base_goerli 0x8D03d9b4 0x3387a7e7

Qualification Contract

Chain WhitelistQlf SigVerifyQlf MaskHolderQlf MerkleProofQlf
ropsten 0x3011dF5b
rinkeby 0x50eCEebb 0x9a656528 0x26c3DE14 0x450A1185
goerli 0xfE14631D
aurora 0x83D6b366
fuse 0x83D6b366

testnet $MASK token address

Known issue and limitation

This smart contract only support Enumerable ERC721 NFT.

Contribute

Any contribution is welcomed to make it better.

If you have any questions, please create an issue.

Security report

If you have any security issue, please send to security@mask.io.

License

MIT LICENSE