strange-labs-uk / ethereum-raffle

Simple raffle style lottery DApp
7 stars 2 forks source link

Help start a new game and participate #13

Open ccdle12 opened 6 years ago

ccdle12 commented 6 years ago

I've deployed the HashKeyLottery contract to the Ropsten Test Network.

Looking for players to join the Raffle, take it for a spin and also a few malicious attackers to attack it

ccdle12 commented 6 years ago

Realise that this a temp solution to deploying to Ropsten and interacting with the contract

Setup:

0.1. Login into MetaMask

0.2. If you need Ropsten Testnet Ethers, go to this faucet and request Eth: https://faucet.metamask.io/

  1. Go to: https://remix.ethereum.org

  2. Create 3 contracts: Crypto Lottery , Ownable, SafeMath

  3. Paste into Crypto Lottery:

    
    pragma solidity ^0.4.18;

import "./Ownable.sol"; import "./SafeMath.sol";

contract HashKeyLottery is Ownable {

using SafeMath for uint256;

// split up the structs otherwise we get a stack depth error struct GameSettings { uint256 price; // ticket price in wei uint feePercent; // what percentage the owner will take as fees uint start; // timestamp of game start uint end; // timestamp of game end uint complete; // record what time the game was paid out or refunded - effectively closed uint drawPeriod; // how many seconds the owner has to call draw after end // triggers a refund is this time is passed and draw has not been called }

struct GameSecurity { bytes32 entropy; // allow the user to add entropy at any point bytes32 lastBlockHash; // save the blockhash that was used in the draw bytes32 secretKeyHash; // the hash of the secret key for this game string secretKey; // the final secret key saved once the game is complete }

struct GameResults { bool refunded; // did the owner not submit the secretKey in time? address winner; // record the final winning address uint256 prizePaid; // record how much the winner was paid uint256 feesPaid; // record what fees were taken }

struct GameEntries { // the balance of each player - used for refunds mapping (address => uint256) balances; // unique list of all entrants that have a balance address[] players; }

/**

  1. Paste into Ownable:
    
    pragma solidity ^0.4.18;

/**

}


5. Paste into `SafeMaths`:

pragma solidity ^0.4.18;

/**

  1. Click on Run in the Remix Compiler Web App

  2. In Environment select Injected Web3 - This should inject web3 instance from MetaMask

  3. You will see your address from MetaMask appear in Account

  4. In At Address paste the address of the deployed lottery 0x9c7c7f0040e29a201b77ae337cf5ab1efdbed90c

  5. Click on At Address to retrieve the ADB of the deployed contract,

  6. All publicly available functions should appear under the Contract Name and address

  7. Select Play function to buy a ticket