This video is available to students only

Pixel bidding and structs

Our goal here is to improve this smart contact so that people can bid on each pixel.

These next few videos really get at the heart of smart contracts because we're going to be writing a contract that holds its own funds and releases them according to our code.

The behavior we want is to:

  • require that colorPixel be sent Ether in order to allow coloration.

  • we want to require that the amount sent is higher than the previous amount paid for that pixel

  • if you try to buy a pixel, at too low of a bid, your funds should be returned to you

  • if you are the highest bid, then your funds are stored in the contact

  • if you are outbid by someone else, your funds should be returned to you, and you can try again.

 

This page is a preview of Million Ether Homepage

No discussions yet