##shib.aleo
A simple monopoly game in Leo.
This program is a game of two(owner and addr2) where each gets 10,000 NGN to buy buildings
- Each user in the game is issue 10,000 NGN to
buy
a property - The owner may buy a property and
rent
it to the next user(addr2).rent
cost 100 NGN Sale
of property is possible when the other addr2 send a request to buy off owner property, doubling hisrent
fee ownership
Note that the program can be easily extended to include addition features such as a fractional investing
function, which would allow owner to invest partly to other users or owner.
You may have already guessed that this program has a few bugs. We list some of them below:
rent fee after sale maybe a problem since no desired input
Can you find any others?
record
declarations- record ownership
Leo provides users with a command line interface for compiling and running Leo programs.
Users may either specify input values via the command line or provide an input file in inputs/
.
The program.json
file contains a private key and address.
This is the account that will be used to sign transactions and is checked for record ownership.
When executing programs as different parties, be sure to set the private_key
and address
fields in program.json
to the appropriate values.
See ./run.sh
for an example of how to run the program as different parties.
The Aleo SDK provides a command line interface for generating new accounts. To generate a new account, run
leo account new
- Modify
inputs/shib.in
with the desired inputs. - Run
leo run <function_name>
For example,
leo run monopoly
leo run monopoly_buy
leo run monopoly_rent
leo run monopoly_sale