Skip to content

Latest commit

 

History

History
60 lines (55 loc) · 2.62 KB

changelog.md

File metadata and controls

60 lines (55 loc) · 2.62 KB

Changes made for version 0.2:

  • updated all payments to call instead of .transfer
  • add record variable lastWinner
  • adjust events based on the docs: Events
    • removed string from NewRider
    • removed indexed from value in TrainFull
    • emit indexed round & winner for ResultArrived
      • include round number
      • include winner as address payable
    • Moved NewRider up out of if/else
    • create event AwaitingRiders
    • add emit AwaitingRiders to else
  • alter getRandomNumber to internal
  • alter fulfillRandomness
    • change index to uint8 from uint to conserve gas
    • sets lastWinner to riders[index]
    • moved riders array reset before payout
    • change payout to lastWinner from riders[index]
    • add to ResultArrived: tripsTaken & change riders[index] to lastWinner
    • kept acceptingRiders as final action to prevent new riders in case of error
  • alter emergencyRefund
    • remove payable
    • switch house removal method to riders.pop;
    • continue using riders.length in for loop iterations
    • adjust house removal from delete riders.length - 1 to for loop using maxRiders
    • change userValue to calculate based on maxRiders to compensate for ignoring house
  • alter emergencyReboot
    • to run by onlyOwner
    • remove payable
  • Remove event emission from buyTicket in if maxRiders reached
  • alter getRandomNumber to internal
  • add getWinner

Troubleshooting:

No Action:

  • Warning for fulfillRandomness, requestId unused
  • Consider receiving funds from rider at time of buyTicket vs added to riders.
    • more consistent revenue
    • more riders = more revenue vs fewer riders, faster rounds, but fewer riders = less chance of house.
    • could add if maxRiders <= 10, add house to riders; else transfer 5% to house

New Deployement (Rinkeby): Contract Address: 0x0E221b24AA33762D1Cc5B75Bb50d1B43cc72853a

Frontend

Frontend Needs:

  • needs event listeners & notifications about round status
  • mining spinner doesn't halt once mined
  • display contract stats (ticket price, payouts, rides taken, current rider count & max riders)