The lottery game of Mamba Coin
The Mamba Game is the lottery game of Mamba Coin. This repository contains the solidity
code of smart contracts, the javascript dApp wrapper of smart contract, test code with
truffle framework, and a simple html sample code.
We followed the folder structure of truffle framework.
Path | Description |
---|---|
contracts\ | Contains the smart contract code. |
contracts\GameLogic.sol | Source code file of game logic library. |
contracts\GamePool.sol | Source code file of game pool contract. This contract is the main entry for all game operations. |
contracts\GamePoolTestProxy.sol | Source code file of game pool proxy contract. Used for testing. |
contracts\Migrations.sol | Contract for truffle migration. |
doc\ | Contains the documents. |
doc\JavascriptApi.md | The API document of javascript dApp warpper. |
doc\GamePool_Contract_Operations.md | The operation document of GamePool contract. |
jslib\ | Contains the javascript code of dApp wrapper. |
jslib\dist\mambagame.js | The javascript code of dApp wrapper. |
migrations\ | Contains the truffle migration scripts. |
migrations\1_initial_migration.js | The migration script of truffle. |
migrations\2_deploy_contracts.js | The migration script of truffle. |
samplewww\ | Contains the sample code to used dApp wrapper. |
test\ | Contains the truffle test scripts. |
test\gamepooltest.js | Automatic test script for smart contracts. |
test\mambagametest.js | Automatic test script for dApp wrapper. |
third-contracts\ | Contains the dependency of the 3rd smart contracts. We depends on openzeppelin and oraclize. |
bs-config.json | Config file for lite-server. We use lite-server for sample code testing. |
LICENSE | License file. |
package.json | Node.js config file. |
README.md | This file. |
truffle.js | Truffle config file. |
ethereum-bridge -H localhost:8545 -a 10
. Please don’t use the default account or oraclize, because we use the default account to interact smart contracts in test cases.git clone --recursive https://github.com/YSYouJack/MambaGame.git
npm install
truffle test
Sometimes you will see some errors when the test cases called contract method but not the test failed.
truffle migration
.mambaGamePool.address
field.npm run dev