Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes gates from examples. #31

Merged
merged 1 commit into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions auction/inputs/auction.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ amount: u64 = 90u64;
[resolve]
first: Bid = Bid {
owner: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh,
gates: 0u64,
bidder: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh,
amount: 10u64,
is_winner: false,
_nonce: 6480683131255842390406647532838179519970794442201387718334686863304493823461group,
};
second: Bid = Bid {
owner: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh,
gates: 0u64,
bidder: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh,
amount: 90u64,
is_winner: false,
Expand All @@ -27,7 +25,6 @@ second: Bid = Bid {
[finish]
bid: Bid = Bid {
owner: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh,
gates: 0u64,
bidder: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh,
amount: 90u64,
is_winner: false,
Expand Down
3 changes: 0 additions & 3 deletions auction/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,12 @@ echo "
"
leo run resolve "{
owner: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh.private,
gates: 0u64.private,
bidder: aleo1yzlta2q5h8t0fqe0v6dyh9mtv4aggd53fgzr068jvplqhvqsnvzq7pj2ke.private,
amount: 10u64.private,
is_winner: false.private,
_nonce: 4668394794828730542675887906815309351994017139223602571716627453741502624516group.public
}" "{
owner: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh.private,
gates: 0u64.private,
bidder: aleo1esqchvevwn7n5p84e735w4dtwt2hdtu4dpguwgwy94tsxm2p7qpqmlrta4.private,
amount: 90u64.private,
is_winner: false.private,
Expand All @@ -150,7 +148,6 @@ echo "
"
leo run finish "{
owner: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh.private,
gates: 0u64.private,
bidder: aleo1esqchvevwn7n5p84e735w4dtwt2hdtu4dpguwgwy94tsxm2p7qpqmlrta4.private,
amount: 90u64.private,
is_winner: false.private,
Expand Down
4 changes: 0 additions & 4 deletions auction/src/main.leo
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ program auction.aleo {
// A bid in an auction.
// - `owner` : The address of the account that owns the record associated with this bid.
// This is separate from the address of the account that placed the bid.
// - `gates` : The value associated with the record (always zero).
// - `bidder` : The address of the account that placed the bid.
// - `amount` : The amount of the bid.
// - `is_winner` : Whether the bid is the winning bid.
record Bid {
owner: address,
gates: u64,
bidder: address,
amount: u64,
is_winner: bool,
Expand All @@ -28,7 +26,6 @@ program auction.aleo {
// Return a new 'Bid' record for the auction bidder.
return Bid {
owner: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh,
gates: 0u64,
bidder: bidder,
amount: amount,
is_winner: false,
Expand Down Expand Up @@ -62,7 +59,6 @@ program auction.aleo {
// Return 'is_winner' as 'true' in the winning 'Bid'.
return Bid {
owner: bid.bidder,
gates: bid.gates,
bidder: bid.bidder,
amount: bid.amount,
is_winner: true,
Expand Down
1 change: 0 additions & 1 deletion basic_bank/inputs/basic_bank.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ amount: u64 = 1234u64;
[deposit]
token: Token = Token {
owner: aleo1t0uer3jgtsgmx5tq6x6f9ecu8tr57rzzfnc2dgmcqldceal0ls9qf6st7a,
gates: 0u64,
amount: 1234u64,
_nonce: 0group,
};
Expand Down
1 change: 0 additions & 1 deletion basic_bank/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ echo "
"
leo run deposit "{
owner: aleo1zeklp6dd8e764spe74xez6f8w27dlua3w7hl4z2uln03re52egpsv46ngg.private,
gates: 0u64.private,
amount: 100u64.private,
_nonce: 4668394794828730542675887906815309351994017139223602571716627453741502624516group.public
}" 50u64
Expand Down
5 changes: 0 additions & 5 deletions basic_bank/src/main.leo
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
program basic_bank.aleo {
// A token, issued by a bank.
// - 'owner' : The address of the account that owns the record associated with this token.
// - 'gates' : The value associated with the record (always zero).
// - 'amount' : The amount of tokens owned by the account.
record Token {
owner: address,
gates: u64,
amount: u64,
}

Expand All @@ -23,7 +21,6 @@ program basic_bank.aleo {
assert_eq(self.caller, aleo1t0uer3jgtsgmx5tq6x6f9ecu8tr57rzzfnc2dgmcqldceal0ls9qf6st7a);
return Token {
owner: owner,
gates: 0u64,
amount: amount,
};
}
Expand All @@ -37,7 +34,6 @@ program basic_bank.aleo {

let remaining: Token = Token {
owner: token.owner,
gates: token.gates,
amount: difference,
};

Expand Down Expand Up @@ -69,7 +65,6 @@ program basic_bank.aleo {

let token: Token = Token {
owner: recipient,
gates: 0u64,
amount: total,
};

Expand Down
25 changes: 0 additions & 25 deletions battleship/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ leo run initialize_board 34084860461056u64 551911718912u64 7u64 1157425104234217

• {
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
gates: 0u64.private,
hits_and_misses: 0u64.private,
played_tiles: 0u64.private,
ships: 1157459741006397447u64.private,
Expand Down Expand Up @@ -125,7 +124,6 @@ Now, we can offer a battleship game to player 2. Run `leo run offer_battleship '
```
leo run offer_battleship '{
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
gates: 0u64.private,
hits_and_misses: 0u64.private,
played_tiles: 0u64.private,
ships: 1157459741006397447u64.private,
Expand All @@ -142,7 +140,6 @@ leo run offer_battleship '{

• {
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
gates: 0u64.private,
hits_and_misses: 0u64.private,
played_tiles: 0u64.private,
ships: 1157459741006397447u64.private,
Expand All @@ -153,7 +150,6 @@ leo run offer_battleship '{
}
• {
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
gates: 0u64.private,
incoming_fire_coordinate: 0u64.private,
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
Expand Down Expand Up @@ -201,7 +197,6 @@ leo run initialize_board 31u64 2207646875648u64 224u64 9042383626829824u64 aleo1

• {
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
gates: 0u64.private,
hits_and_misses: 0u64.private,
played_tiles: 0u64.private,
ships: 9044591273705727u64.private,
Expand Down Expand Up @@ -231,7 +226,6 @@ Now, we can accept Player 1's offer. Run `leo run start_battleship 'board_state.
```bash
leo run start_battleship '{
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
gates: 0u64.private,
hits_and_misses: 0u64.private,
played_tiles: 0u64.private,
ships: 9044591273705727u64.private,
Expand All @@ -241,7 +235,6 @@ leo run start_battleship '{
_nonce: 1549419609469324182591325047490602235361156298832591378925133482196483208807group.public
}' '{
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
gates: 0u64.private,
incoming_fire_coordinate: 0u64.private,
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
Expand All @@ -256,7 +249,6 @@ leo run start_battleship '{

• {
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
gates: 0u64.private,
hits_and_misses: 0u64.private,
played_tiles: 0u64.private,
ships: 9044591273705727u64.private,
Expand All @@ -267,7 +259,6 @@ leo run start_battleship '{
}
• {
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
gates: 0u64.private,
incoming_fire_coordinate: 0u64.private,
player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
Expand All @@ -290,7 +281,6 @@ Player 1 now makes the first real move: `leo run play 'board_state.record' 'move
```bash
leo run play '{
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
gates: 0u64.private,
hits_and_misses: 0u64.private,
played_tiles: 0u64.private,
ships: 1157459741006397447u64.private,
Expand All @@ -300,7 +290,6 @@ leo run play '{
_nonce: 6563064852163330630334088854834332804417910882908622526775624018226782316843group.public
}' '{
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
gates: 0u64.private,
incoming_fire_coordinate: 0u64.private,
player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
Expand All @@ -314,7 +303,6 @@ leo run play '{

• {
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
gates: 0u64.private,
hits_and_misses: 0u64.private,
played_tiles: 1u64.private,
ships: 1157459741006397447u64.private,
Expand All @@ -325,7 +313,6 @@ leo run play '{
}
• {
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
gates: 0u64.private,
incoming_fire_coordinate: 1u64.private,
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
Expand All @@ -349,7 +336,6 @@ and they will also let Player 1 know whether their fire coordinate hit or miss P
```bash
leo run play '{
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
gates: 0u64.private,
hits_and_misses: 0u64.private,
played_tiles: 0u64.private,
ships: 9044591273705727u64.private,
Expand All @@ -359,7 +345,6 @@ leo run play '{
_nonce: 6222383571142756260765569201308836492199048237638652378826141459336360362251group.public
}' '{
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
gates: 0u64.private,
incoming_fire_coordinate: 1u64.private,
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
Expand All @@ -375,7 +360,6 @@ leo run play '{

• {
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
gates: 0u64.private,
hits_and_misses: 0u64.private,
played_tiles: 2048u64.private,
ships: 9044591273705727u64.private,
Expand All @@ -386,7 +370,6 @@ leo run play '{
}
• {
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
gates: 0u64.private,
incoming_fire_coordinate: 2048u64.private,
player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
Expand Down Expand Up @@ -419,7 +402,6 @@ For example, running `aleo run play 'board_state.record' 'move.record' 1u64` wil
```bash
leo run play '{
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
gates: 0u64.private,
hits_and_misses: 0u64.private,
played_tiles: 1u64.private,
ships: 1157459741006397447u64.private,
Expand All @@ -429,7 +411,6 @@ leo run play '{
_nonce: 1474170213684980843727833284550698461565286563122422722760769547002894080093group.public
}' '{
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
gates: 0u64.private,
incoming_fire_coordinate: 2048u64.private,
player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
Expand All @@ -444,7 +425,6 @@ leo run play '{

• {
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
gates: 0u64.private,
hits_and_misses: 1u64.private,
played_tiles: 3u64.private,
ships: 1157459741006397447u64.private,
Expand All @@ -455,7 +435,6 @@ leo run play '{
}
• {
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
gates: 0u64.private,
incoming_fire_coordinate: 2u64.private,
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
Expand Down Expand Up @@ -488,7 +467,6 @@ The board_state.record `hits_and_misses` field has also been updated with the re
```bash
leo run play '{
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
gates: 0u64.private,
hits_and_misses: 0u64.private,
played_tiles: 2048u64.private,
ships: 9044591273705727u64.private,
Expand All @@ -498,7 +476,6 @@ leo run play '{
_nonce: 5254963165391133332409074172682159033621708071536429341861038147524454777097group.public
}' '{
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
gates: 0u64.private,
incoming_fire_coordinate: 2u64.private,
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
Expand All @@ -513,7 +490,6 @@ leo run play '{

• {
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
gates: 0u64.private,
hits_and_misses: 0u64.private,
played_tiles: 2052u64.private,
ships: 9044591273705727u64.private,
Expand All @@ -524,7 +500,6 @@ leo run play '{
}
• {
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
gates: 0u64.private,
incoming_fire_coordinate: 4u64.private,
player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
Expand Down
5 changes: 0 additions & 5 deletions battleship/imports/board.leo
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ program board.aleo {
// unplayed squares.
record board_state {
owner: address,
gates: u64,
// The hits and misses registered on the opponent's board.
hits_and_misses: u64,
// The squares that have been played on the opponent's board.
Expand All @@ -28,7 +27,6 @@ program board.aleo {
) -> board_state {
return board_state {
owner: self.caller,
gates: 0u64,
hits_and_misses: 0u64,
played_tiles: 0u64,
ships,
Expand All @@ -49,7 +47,6 @@ program board.aleo {

return board_state {
owner: board.owner,
gates: board.gates,
hits_and_misses: board.hits_and_misses,
played_tiles: board.played_tiles,
ships: board.ships,
Expand Down Expand Up @@ -83,7 +80,6 @@ program board.aleo {

return board_state {
owner: board.owner,
gates: board.gates,
hits_and_misses: board.hits_and_misses,
played_tiles,
ships: board.ships,
Expand All @@ -106,7 +102,6 @@ program board.aleo {

return board_state {
owner: board.owner,
gates: board.gates,
hits_and_misses,
played_tiles: board.played_tiles,
ships: board.ships,
Expand Down
3 changes: 0 additions & 3 deletions battleship/imports/move.leo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
program move.aleo {
record move {
owner: address,
gates: u64,
incoming_fire_coordinate: u64,
player_1: address,
player_2: address,
Expand All @@ -25,7 +24,6 @@ program move.aleo {

return move {
owner: opponent,
gates: move_record.gates,
incoming_fire_coordinate,
player_1: move_record.player_2,
player_2: move_record.player_1,
Expand All @@ -38,7 +36,6 @@ program move.aleo {
transition start_game(player_2: address) -> move {
return move {
owner: player_2,
gates: 0u64,
incoming_fire_coordinate: 0u64,
player_1: self.caller,
player_2: player_2,
Expand Down
Loading