Skip to content

tcichowicz/foosball-chain-contracts

Repository files navigation

Foosball Chain Contracts

Simple smart contracts for free betting on foosball matches results.

Uses zeppelin-solidity for base ERC20 token implementation.

Requirements

  1. npm

  2. Truffle Framework

     npm install -g truffle
    
  3. Ganache CLI

     npm install -g ganache-cli
    

Project structure

  1. contracts/FoosballToken.sol - ERC20 mintable token "FOO" for betting purposes
  2. contracts/Game.sol - the initialization point and contract where users can register to obtain 1000 FOO
  3. contracts/Match.sol - model for a match, holding the data, result and bets; settles the bets as well
  4. contracts/MatchFactory.sol - allows anybody to create a match
  5. migrations/2_deploy_game.js - creates a Game contract which creates all other necessary contracts

Running the project

  1. npm install - install dependencies.

  2. truffle compile - (optional) compile the contracts.

  3. ganache-cli -m "category all reduce guess speed cradle inherit valley gap gasp federal junior" - run the local Ethereum test node with predefined seed so that importing MetaMask accounts can be done only once.

  4. truffle migrate - deploy the contracts.

  5. Note the Game smart contract address and put it into web/integration.js in the UI:

     Running migration: 2_deploy_game.js
         Deploying Game...
         ... 0x83fb3d7d279f7b9d939dc6e84347f5f79eb82d3b35b710c9b2429c47da4b7d36
     Game: 0x4dffc407e3d65e8cccfeb73661fc62e559cccde5
    
  6. Import these seed words into MetaMask to use accounts that are pre-loaded with ETH:

     category all reduce guess speed cradle inherit valley gap gasp federal junior
    

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published