Skip to content

#HowToBUIDL (2/n) :: Your First Contract Come One Come All! By the end of this post, you’ll write your very first SmartContract called the GreatestShow.

Notifications You must be signed in to change notification settings

emmonspired/ComeOneComeAll

Repository files navigation

ComeOneComeAll

#HowToBUIDL (2/n) :: Your First Contract Come One Come All! By the end of this post, you’ll write your very first SmartContract called the GreatestShow.

Come one! Come all! Come join the great Digital Railroad! There is no barrier to entry, as long as you participate within the framework of rules known as decentralized consensus. This means you’ll work for it. It won’t come easy but at least you’ve taken the 1st step. Come build the digital railroads of tomorrow! Three meals a day! Roof over your head! Fair and ample wages! Come, make your fortune! Not everyone will be up for the challenge. I guess I’ll leave that up to you. Opportunity awaits you. If you haven’t, be sure to catch BUIDL :: Dev Environment Setup before reading.

Contracts

Please see the contracts/ directory.

Overview

There is one primary contracs: GreatestShow.sol

GreatestShow

This contract constructor accepts a string for the name of the ringMaster. Sufficient gas should be supplied.

  1. set/get Available Seat Count
  2. Define Performance struct and maintain Performance[] performances as well as getPerformance
  3. Maintain a mapping(address => uint256) internal tickets;
  4. Provide a function () payable public fallback function to assign msg.sender a number of tickets based on msg.value.

Develop

Contracts are written in Solidity and tested using Truffle and testrpc. Library contracts sourced from OpenZeppelin.org.

Dependencies

# Install Truffle, testrpc, and dependency packages:
$ npm install
$ truffle compile

About

#HowToBUIDL (2/n) :: Your First Contract Come One Come All! By the end of this post, you’ll write your very first SmartContract called the GreatestShow.

Resources

Stars

Watchers

Forks

Packages

No packages published