mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-09-11 05:45:30 +03:00
Merge pull request #27951 from AleoHQ/cleanup/examples
[Examples] Update default PK in examples .env.
This commit is contained in:
commit
c085bf199e
@ -8,6 +8,7 @@ mapping num_winners:
|
||||
key as u8.public;
|
||||
value as u8.public;
|
||||
|
||||
|
||||
function play:
|
||||
cast self.caller into r0 as Ticket.record;
|
||||
async play into r1;
|
||||
@ -24,3 +25,4 @@ finalize play:
|
||||
assert.eq r3 true;
|
||||
add r2 1u8 into r4;
|
||||
set r4 into num_winners[0u8];
|
||||
|
||||
|
0
.circleci/lottery/run.sh
Normal file → Executable file
0
.circleci/lottery/run.sh
Normal file → Executable file
@ -7,19 +7,20 @@ then
|
||||
fi
|
||||
|
||||
# The private key and address of Alice.
|
||||
# Swap these into program.json, when running transactions as the first bidder.
|
||||
# "private_key": "APrivateKey1zkp1w8PTxrRgGfAtfKUSq43iQyVbdQHfhGbiNPEg2LVSEXR",
|
||||
# "address": "aleo13ssze66adjjkt795z9u5wpq8h6kn0y2657726h4h3e3wfnez4vqsm3008q"
|
||||
# Swap these into .env, when running transactions as the first bidder.
|
||||
# NETWORK=mainnet
|
||||
# PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
||||
# The private key and address of Bob.
|
||||
# Swap these into program.json, when running transactions as the second bidder.
|
||||
# "private_key": "APrivateKey1zkpFo72g7N9iFt3JzzeG8CqsS5doAiXyFvNCgk2oHvjRCzF"
|
||||
# "address": "aleo17vy26rpdhqx4598y5gp7nvaa9rk7tnvl6ufhvvf4calsrrqdaqyshdsf5z"
|
||||
# NETWORK=mainnet
|
||||
# PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
|
||||
|
||||
|
||||
# Swap in the private key of Alice.
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp1w8PTxrRgGfAtfKUSq43iQyVbdQHfhGbiNPEg2LVSEXR
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
" > .env
|
||||
|
||||
# Publicly mint 100 tokens for Alice.
|
||||
@ -53,7 +54,7 @@ leo run mint_public aleo13ssze66adjjkt795z9u5wpq8h6kn0y2657726h4h3e3wfnez4vqsm30
|
||||
# Swap in the private key of Bob.
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpFo72g7N9iFt3JzzeG8CqsS5doAiXyFvNCgk2oHvjRCzF
|
||||
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
|
||||
" > .env
|
||||
|
||||
# Privately mint 100 tokens for Bob.
|
||||
@ -87,7 +88,7 @@ leo run mint_private aleo17vy26rpdhqx4598y5gp7nvaa9rk7tnvl6ufhvvf4calsrrqdaqyshd
|
||||
# Swap in the private key of Alice.
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp1w8PTxrRgGfAtfKUSq43iQyVbdQHfhGbiNPEg2LVSEXR
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
" > .env
|
||||
|
||||
# Publicly transfer 10 tokens from Alice to Bob.
|
||||
@ -121,7 +122,7 @@ leo run transfer_public aleo17vy26rpdhqx4598y5gp7nvaa9rk7tnvl6ufhvvf4calsrrqdaqy
|
||||
# Swap in the private key of Bob.
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpFo72g7N9iFt3JzzeG8CqsS5doAiXyFvNCgk2oHvjRCzF
|
||||
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
|
||||
" > .env
|
||||
|
||||
# Privately transfer 20 tokens from Bob to Alice.
|
||||
@ -159,7 +160,7 @@ leo run transfer_private "{
|
||||
# Swap in the private key of Alice.
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp1w8PTxrRgGfAtfKUSq43iQyVbdQHfhGbiNPEg2LVSEXR
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
" > .env
|
||||
|
||||
# Convert 30 public tokens from Alice into 30 private tokens for Bob.
|
||||
@ -194,7 +195,7 @@ leo run transfer_public_to_private aleo17vy26rpdhqx4598y5gp7nvaa9rk7tnvl6ufhvvf4
|
||||
# Swap in the private key of Bob.
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpFo72g7N9iFt3JzzeG8CqsS5doAiXyFvNCgk2oHvjRCzF
|
||||
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
|
||||
" > .env
|
||||
|
||||
# Convert 40 private tokens from Bob into 40 public tokens for Alice.
|
||||
@ -235,5 +236,5 @@ leo run transfer_private_to_public "{
|
||||
# This is done to ensure that program.json is the same after every execution of ./run.sh.
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp1w8PTxrRgGfAtfKUSq43iQyVbdQHfhGbiNPEg2LVSEXR
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
" > .env
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp5wvamYgK3WCAdpBQxZqQX8XnuN2u11Y6QprZTriVwZVc
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
||||
|
@ -11,14 +11,14 @@ function place_bid:
|
||||
input r0 as address.private;
|
||||
input r1 as u64.private;
|
||||
assert.eq self.caller r0;
|
||||
cast aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh r0 r1 false into r2 as Bid.record;
|
||||
cast aleo1ashyu96tjwe63u0gtnnv8z5lhapdu4l5pjsl2kha7fv7hvz2eqxs5dz0rg r0 r1 false into r2 as Bid.record;
|
||||
output r2 as Bid.record;
|
||||
|
||||
|
||||
function resolve:
|
||||
input r0 as Bid.record;
|
||||
input r1 as Bid.record;
|
||||
assert.eq self.caller aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh;
|
||||
assert.eq self.caller aleo1ashyu96tjwe63u0gtnnv8z5lhapdu4l5pjsl2kha7fv7hvz2eqxs5dz0rg;
|
||||
gte r0.amount r1.amount into r2;
|
||||
ternary r2 r0.owner r1.owner into r3;
|
||||
ternary r2 r0.bidder r1.bidder into r4;
|
||||
@ -30,6 +30,6 @@ function resolve:
|
||||
|
||||
function finish:
|
||||
input r0 as Bid.record;
|
||||
assert.eq self.caller aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh;
|
||||
assert.eq self.caller aleo1ashyu96tjwe63u0gtnnv8z5lhapdu4l5pjsl2kha7fv7hvz2eqxs5dz0rg;
|
||||
cast r0.bidder r0.bidder r0.amount true into r1 as Bid.record;
|
||||
output r1 as Bid.record;
|
||||
|
@ -8,18 +8,19 @@ fi
|
||||
|
||||
# The private key and address of the first bidder.
|
||||
# Swap these into program.json, when running transactions as the first bidder.
|
||||
# "private_key": "APrivateKey1zkpG9Af9z5Ha4ejVyMCqVFXRKknSm8L1ELEwcc4htk9YhVK"
|
||||
# "address": aleo1yzlta2q5h8t0fqe0v6dyh9mtv4aggd53fgzr068jvplqhvqsnvzq7pj2ke
|
||||
# NETWORK=mainnet
|
||||
# PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
||||
# The private key and address of the second bidder.
|
||||
# Swap these into program.json, when running transactions as the second bidder.
|
||||
# "private_key": "APrivateKey1zkpAFshdsj2EqQzXh5zHceDapFWVCwR6wMCJFfkLYRKupug"
|
||||
# "address": aleo1esqchvevwn7n5p84e735w4dtwt2hdtu4dpguwgwy94tsxm2p7qpqmlrta4
|
||||
# NETWORK=mainnet
|
||||
# PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
|
||||
|
||||
|
||||
# The private key and address of the auctioneer.
|
||||
# Swap these into program.json, when running transactions as the auctioneer.
|
||||
# "private_key": "APrivateKey1zkp5wvamYgK3WCAdpBQxZqQX8XnuN2u11Y6QprZTriVwZVc",
|
||||
# "address": "aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh"
|
||||
# NETWORK=mainnet
|
||||
# PRIVATE_KEY=APrivateKey1zkp2GUmKbVsuc1NSj28pa1WTQuZaK5f1DQJAT6vPcHyWokG
|
||||
|
||||
|
||||
echo "
|
||||
@ -38,7 +39,7 @@ echo "
|
||||
# Swap in the private key and address of the first bidder to .env.
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpG9Af9z5Ha4ejVyMCqVFXRKknSm8L1ELEwcc4htk9YhVK
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
" > .env
|
||||
|
||||
# Have the first bidder place a bid of 10.
|
||||
@ -55,12 +56,12 @@ echo "
|
||||
######## ########
|
||||
###############################################################################
|
||||
"
|
||||
leo run place_bid aleo1yzlta2q5h8t0fqe0v6dyh9mtv4aggd53fgzr068jvplqhvqsnvzq7pj2ke 10u64 || exit
|
||||
leo run place_bid aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px 10u64 || exit
|
||||
|
||||
# Swap in the private key and address of the second bidder to .env.
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpAFshdsj2EqQzXh5zHceDapFWVCwR6wMCJFfkLYRKupug
|
||||
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
|
||||
" > .env
|
||||
|
||||
# Have the second bidder place a bid of 90.
|
||||
@ -77,12 +78,12 @@ echo "
|
||||
######## ########
|
||||
###############################################################################
|
||||
"
|
||||
leo run place_bid aleo1esqchvevwn7n5p84e735w4dtwt2hdtu4dpguwgwy94tsxm2p7qpqmlrta4 90u64 || exit
|
||||
leo run place_bid aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t 90u64 || exit
|
||||
|
||||
# Swap in the private key and address of the auctioneer to .env.
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp5wvamYgK3WCAdpBQxZqQX8XnuN2u11Y6QprZTriVwZVc
|
||||
PRIVATE_KEY=APrivateKey1zkp2GUmKbVsuc1NSj28pa1WTQuZaK5f1DQJAT6vPcHyWokG
|
||||
" > .env
|
||||
|
||||
# Have the auctioneer select the winning bid.
|
||||
@ -100,14 +101,14 @@ echo "
|
||||
###############################################################################
|
||||
"
|
||||
leo run resolve "{
|
||||
owner: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh.private,
|
||||
bidder: aleo1yzlta2q5h8t0fqe0v6dyh9mtv4aggd53fgzr068jvplqhvqsnvzq7pj2ke.private,
|
||||
owner: aleo1ashyu96tjwe63u0gtnnv8z5lhapdu4l5pjsl2kha7fv7hvz2eqxs5dz0rg.private,
|
||||
bidder: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
amount: 10u64.private,
|
||||
is_winner: false.private,
|
||||
_nonce: 4668394794828730542675887906815309351994017139223602571716627453741502624516group.public
|
||||
}" "{
|
||||
owner: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh.private,
|
||||
bidder: aleo1esqchvevwn7n5p84e735w4dtwt2hdtu4dpguwgwy94tsxm2p7qpqmlrta4.private,
|
||||
owner: aleo1ashyu96tjwe63u0gtnnv8z5lhapdu4l5pjsl2kha7fv7hvz2eqxs5dz0rg.private,
|
||||
bidder: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
amount: 90u64.private,
|
||||
is_winner: false.private,
|
||||
_nonce: 5952811863753971450641238938606857357746712138665944763541786901326522216736group.public
|
||||
@ -117,7 +118,7 @@ leo run resolve "{
|
||||
echo "
|
||||
###############################################################################
|
||||
######## ########
|
||||
######## STEP 3: The auctioneer completes the auction. ########
|
||||
######## STEP 4: The auctioneer completes the auction. ########
|
||||
######## ########
|
||||
######## ------------------------------- ########
|
||||
######## | CLOSE | A | → B ← | ########
|
||||
@ -128,14 +129,21 @@ echo "
|
||||
###############################################################################
|
||||
"
|
||||
leo run finish "{
|
||||
owner: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh.private,
|
||||
bidder: aleo1esqchvevwn7n5p84e735w4dtwt2hdtu4dpguwgwy94tsxm2p7qpqmlrta4.private,
|
||||
owner: aleo1ashyu96tjwe63u0gtnnv8z5lhapdu4l5pjsl2kha7fv7hvz2eqxs5dz0rg.private,
|
||||
bidder: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
amount: 90u64.private,
|
||||
is_winner: false.private,
|
||||
_nonce: 5952811863753971450641238938606857357746712138665944763541786901326522216736group.public
|
||||
}" || exit
|
||||
|
||||
|
||||
# Restore the .env file to its original state.
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
" > .env
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -17,13 +17,13 @@ program auction.aleo {
|
||||
// - `amount` : The amount of the bid.
|
||||
// Requires that `bidder` matches the function caller.
|
||||
// The owner of the record is set to the entity responsible for running the auction (auction runner).
|
||||
// The address of the auction runner is aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh.
|
||||
// The address of the auction runner is aleo1ashyu96tjwe63u0gtnnv8z5lhapdu4l5pjsl2kha7fv7hvz2eqxs5dz0rg.
|
||||
transition place_bid(bidder: address, amount: u64) -> Bid {
|
||||
// Ensure the caller is the auction bidder.
|
||||
assert_eq(self.caller, bidder);
|
||||
// Return a new 'Bid' record for the auction bidder.
|
||||
return Bid {
|
||||
owner: aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh,
|
||||
owner: aleo1ashyu96tjwe63u0gtnnv8z5lhapdu4l5pjsl2kha7fv7hvz2eqxs5dz0rg,
|
||||
bidder: bidder,
|
||||
amount: amount,
|
||||
is_winner: false,
|
||||
@ -38,7 +38,7 @@ program auction.aleo {
|
||||
// In the event of a tie, the first bid is selected.
|
||||
transition resolve(first: Bid, second: Bid) -> Bid {
|
||||
// Ensure the caller is the auctioneer.
|
||||
assert_eq(self.caller, aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh);
|
||||
assert_eq(self.caller, aleo1ashyu96tjwe63u0gtnnv8z5lhapdu4l5pjsl2kha7fv7hvz2eqxs5dz0rg);
|
||||
// Resolve the winner of the auction.
|
||||
if (first.amount >= second.amount) {
|
||||
return first;
|
||||
@ -53,7 +53,7 @@ program auction.aleo {
|
||||
// Assumes that the function is invoked only after all bids have been resolved.
|
||||
transition finish(bid: Bid) -> Bid {
|
||||
// Ensure the caller is the auctioneer.
|
||||
assert_eq(self.caller, aleo1fxs9s0w97lmkwlcmgn0z3nuxufdee5yck9wqrs0umevp7qs0sg9q5xxxzh);
|
||||
assert_eq(self.caller, aleo1ashyu96tjwe63u0gtnnv8z5lhapdu4l5pjsl2kha7fv7hvz2eqxs5dz0rg);
|
||||
// Return 'is_winner' as 'true' in the winning 'Bid'.
|
||||
return Bid {
|
||||
owner: bid.bidder,
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpHtqVWT6fSHgUMNxsuVf7eaR6id2cj7TieKY1Z8CP5rCD
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
||||
|
@ -12,11 +12,12 @@ mapping balances:
|
||||
function issue:
|
||||
input r0 as address.private;
|
||||
input r1 as u64.private;
|
||||
assert.eq self.caller aleo1t0uer3jgtsgmx5tq6x6f9ecu8tr57rzzfnc2dgmcqldceal0ls9qf6st7a;
|
||||
assert.eq self.caller aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px;
|
||||
cast r0 r1 into r2 as Token.record;
|
||||
output r2 as Token.record;
|
||||
|
||||
|
||||
|
||||
function deposit:
|
||||
input r0 as Token.record;
|
||||
input r1 as u64.private;
|
||||
@ -35,6 +36,7 @@ finalize deposit:
|
||||
set r3 into balances[r0];
|
||||
|
||||
|
||||
|
||||
closure calculate_interest:
|
||||
input r0 as u64;
|
||||
input r1 as u64;
|
||||
@ -542,12 +544,13 @@ closure calculate_interest:
|
||||
output r502 as u64;
|
||||
|
||||
|
||||
|
||||
function withdraw:
|
||||
input r0 as address.private;
|
||||
input r1 as u64.private;
|
||||
input r2 as u64.private;
|
||||
input r3 as u64.private;
|
||||
assert.eq self.caller aleo1t0uer3jgtsgmx5tq6x6f9ecu8tr57rzzfnc2dgmcqldceal0ls9qf6st7a;
|
||||
assert.eq self.caller aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px;
|
||||
hash.bhp256 r0 into r4 as field;
|
||||
call calculate_interest r1 r2 r3 into r5;
|
||||
cast r0 r5 into r6 as Token.record;
|
||||
@ -561,3 +564,4 @@ finalize withdraw:
|
||||
get.or_use balances[r0] 0u64 into r2;
|
||||
sub r2 r1 into r3;
|
||||
set r3 into balances[r0];
|
||||
|
||||
|
@ -7,26 +7,26 @@ then
|
||||
fi
|
||||
|
||||
# The private key and address of the bank.
|
||||
# Swap these into program.json, when running transactions as the first bidder.
|
||||
# "private_key": "APrivateKey1zkpHtqVWT6fSHgUMNxsuVf7eaR6id2cj7TieKY1Z8CP5rCD",
|
||||
# "address": "aleo1t0uer3jgtsgmx5tq6x6f9ecu8tr57rzzfnc2dgmcqldceal0ls9qf6st7a"
|
||||
# Swap these into program.json, when running transactions as the bank.
|
||||
# NETWORK=mainnet
|
||||
# PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
||||
# The private key and address of the user.
|
||||
# Swap these into program.json, when running transactions as the second bidder.
|
||||
# "private_key": "APrivateKey1zkp75cpr5NNQpVWc5mfsD9Uf2wg6XvHknf82iwB636q3rtc"
|
||||
# "address": "aleo1zeklp6dd8e764spe74xez6f8w27dlua3w7hl4z2uln03re52egpsv46ngg"
|
||||
# Swap these into program.json, when running transactions as the user.
|
||||
# NETWORK=mainnet
|
||||
# PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
|
||||
|
||||
# Swap in the private key and address of the bank to .env.
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpHtqVWT6fSHgUMNxsuVf7eaR6id2cj7TieKY1Z8CP5rCD
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
" > .env
|
||||
|
||||
# Have the bank issue 100 tokens to the user.
|
||||
echo "
|
||||
###############################################################################
|
||||
######## ########
|
||||
######## STEP 1: Initialize 100 tokens for aleo1zeklp...v46ngg ########
|
||||
######## STEP 1: Initialize 100 tokens for aleo1s3ws5...em2u4t ########
|
||||
######## ########
|
||||
######## ----------------------------------------- ########
|
||||
######## | ACTION | AMOUNT | ########
|
||||
@ -40,14 +40,14 @@ echo "
|
||||
######## ----------------------------------------- ########
|
||||
######## ########
|
||||
######## ----------------------------------------- ########
|
||||
######## | WALLET | aleo1zeklp...v46ngg | ########
|
||||
######## | WALLET | aleo1s3ws5...em2u4t | ########
|
||||
######## ----------------------------------------- ########
|
||||
######## ----------------------------------------- ########
|
||||
######## | Balance | 100 | ########
|
||||
######## ----------------------------------------- ########
|
||||
######## ########
|
||||
######## ----------------------------------------- ########
|
||||
######## | BANK | aleo1zeklp...v46ngg | ########
|
||||
######## | BANK | aleo1rhgdu...vzp9px | ########
|
||||
######## ----------------------------------------- ########
|
||||
######## ----------------------------------------- ########
|
||||
######## | Balance | 0 | ########
|
||||
@ -63,19 +63,20 @@ echo "
|
||||
######## ########
|
||||
###############################################################################
|
||||
"
|
||||
leo run issue aleo1zeklp6dd8e764spe74xez6f8w27dlua3w7hl4z2uln03re52egpsv46ngg 100u64 || exit
|
||||
leo run issue aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t 100u64 || exit
|
||||
|
||||
|
||||
# Swap in the private key and address of the user to .env.
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp75cpr5NNQpVWc5mfsD9Uf2wg6XvHknf82iwB636q3rtc
|
||||
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
|
||||
" > .env
|
||||
|
||||
# Have the user deposit 50 tokens into the bank.
|
||||
echo "
|
||||
###############################################################################
|
||||
######## ########
|
||||
######## STEP 2: aleo1zeklp...v46ngg deposits 50 tokens ########
|
||||
######## STEP 2: aleo1s3ws5...em2u4t deposits 50 tokens ########
|
||||
######## ########
|
||||
######## ----------------------------------------- ########
|
||||
######## | ACTION | AMOUNT | ########
|
||||
@ -89,14 +90,14 @@ echo "
|
||||
######## ----------------------------------------- ########
|
||||
######## ########
|
||||
######## ----------------------------------------- ########
|
||||
######## | WALLET | aleo1zeklp...v46ngg | ########
|
||||
######## | WALLET | aleo1s3ws5...em2u4t | ########
|
||||
######## ----------------------------------------- ########
|
||||
######## ----------------------------------------- ########
|
||||
######## | Balance | 50 | ########
|
||||
######## ----------------------------------------- ########
|
||||
######## ########
|
||||
######## ----------------------------------------- ########
|
||||
######## | BANK | aleo1zeklp...v46ngg | ########
|
||||
######## | BANK | aleo1rhgdu...vzp9px | ########
|
||||
######## ----------------------------------------- ########
|
||||
######## ----------------------------------------- ########
|
||||
######## | Balance | 50 | ########
|
||||
@ -113,7 +114,7 @@ echo "
|
||||
###############################################################################
|
||||
"
|
||||
leo run deposit "{
|
||||
owner: aleo1zeklp6dd8e764spe74xez6f8w27dlua3w7hl4z2uln03re52egpsv46ngg.private,
|
||||
owner: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
amount: 100u64.private,
|
||||
_nonce: 4668394794828730542675887906815309351994017139223602571716627453741502624516group.public
|
||||
}" 50u64 || exit
|
||||
@ -135,14 +136,14 @@ echo "
|
||||
######## ----------------------------------------- ########
|
||||
######## ########
|
||||
######## ----------------------------------------- ########
|
||||
######## | WALLET | aleo1zeklp...v46ngg | ########
|
||||
######## | WALLET | aleo1s3ws5...em2u4t | ########
|
||||
######## ----------------------------------------- ########
|
||||
######## ----------------------------------------- ########
|
||||
######## | Balance | 50 | ########
|
||||
######## ----------------------------------------- ########
|
||||
######## ########
|
||||
######## ----------------------------------------- ########
|
||||
######## | BANK | aleo1zeklp...v46ngg | ########
|
||||
######## | BANK | aleo1rhgdu...vzp9px | ########
|
||||
######## ----------------------------------------- ########
|
||||
######## ----------------------------------------- ########
|
||||
######## | Balance | 266 | ########
|
||||
@ -162,14 +163,14 @@ echo "
|
||||
# Swap in the private key and address of the bank to .env.
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpHtqVWT6fSHgUMNxsuVf7eaR6id2cj7TieKY1Z8CP5rCD
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
" > .env
|
||||
|
||||
# Have the bank withdraw all of the user's tokens with compound interest over 15 periods at 12.34%.
|
||||
echo "
|
||||
###############################################################################
|
||||
######## ########
|
||||
######## STEP 4: Withdraw tokens of aleo1zeklp...v46ngg w/ interest ########
|
||||
######## STEP 4: Withdraw tokens of aleo1s3ws5...em2u4t w/ interest ########
|
||||
######## ########
|
||||
######## ----------------------------------------- ########
|
||||
######## | ACTION | AMOUNT | ########
|
||||
@ -183,14 +184,14 @@ echo "
|
||||
######## ----------------------------------------- ########
|
||||
######## ########
|
||||
######## ----------------------------------------- ########
|
||||
######## | WALLET | aleo1zeklp...v46ngg | ########
|
||||
######## | WALLET | aleo1s3ws5...em2u4t | ########
|
||||
######## ----------------------------------------- ########
|
||||
######## ----------------------------------------- ########
|
||||
######## | Balance | 316 | ########
|
||||
######## ----------------------------------------- ########
|
||||
######## ########
|
||||
######## ----------------------------------------- ########
|
||||
######## | BANK | aleo1zeklp...v46ngg | ########
|
||||
######## | BANK | aleo1rhgdu...vzp9px | ########
|
||||
######## ----------------------------------------- ########
|
||||
######## ----------------------------------------- ########
|
||||
######## | Balance | 0 | ########
|
||||
|
@ -15,9 +15,9 @@ program basic_bank.aleo {
|
||||
// - `owner` : The address of the account to issue the token to.
|
||||
// - `amount`: The amount of tokens to issue.
|
||||
// Requires that the function caller is the bank.
|
||||
// The bank's address is aleo1t0uer3jgtsgmx5tq6x6f9ecu8tr57rzzfnc2dgmcqldceal0ls9qf6st7a.
|
||||
// The bank's address is aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.
|
||||
transition issue(owner: address, amount: u64) -> Token {
|
||||
assert_eq(self.caller, aleo1t0uer3jgtsgmx5tq6x6f9ecu8tr57rzzfnc2dgmcqldceal0ls9qf6st7a);
|
||||
assert_eq(self.caller, aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px);
|
||||
return Token {
|
||||
owner: owner,
|
||||
amount: amount,
|
||||
@ -57,7 +57,7 @@ program basic_bank.aleo {
|
||||
// - `periods` : The number of periods to compound the interest over.
|
||||
// Requires that the function caller is the bank.
|
||||
async transition withdraw(recipient: address, amount: u64, rate: u64, periods: u64) -> (Token, Future) {
|
||||
assert_eq(self.caller, aleo1t0uer3jgtsgmx5tq6x6f9ecu8tr57rzzfnc2dgmcqldceal0ls9qf6st7a);
|
||||
assert_eq(self.caller, aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px);
|
||||
let hash: field = BHP256::hash_to_field(recipient);
|
||||
|
||||
let total: u64 = calculate_interest(amount, rate, periods);
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp86FNGdKxjgAdgQZ967bqBanjuHkAaoRe19RK24ZCGsHH
|
||||
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
|
||||
|
||||
|
@ -48,14 +48,14 @@ Players will be represented by their Aleo address.
|
||||
You can use the provided player accounts or [generate your own](https://aleohq.github.io/aleo/).
|
||||
```markdown
|
||||
Player 1:
|
||||
Private Key APrivateKey1zkpGKaJY47BXb6knSqmT3JZnBUEGBDFAWz2nMVSsjwYpJmm
|
||||
Private Key APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
View Key AViewKey1fSyEPXxfPFVgjL6qcM9izWRGrhSHKXyN3c64BNsAjnA6
|
||||
Address aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy
|
||||
Address aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px
|
||||
|
||||
Player 2:
|
||||
Private Key APrivateKey1zkp86FNGdKxjgAdgQZ967bqBanjuHkAaoRe19RK24ZCGsHH
|
||||
Private Key APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
|
||||
View Key AViewKey1hh6dvSEgeMdfseP4hfdbNYjX4grETwCuTbKnCftkpMwE
|
||||
Address aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry
|
||||
Address aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t
|
||||
```
|
||||
|
||||
Save the keys and addresses. Set the `program.json` private key and address to one of the newly created aleo accounts. We'll refer to this address as Player 1, and the other address as Player 2.
|
||||
@ -66,9 +66,9 @@ Save the keys and addresses. Set the `program.json` private key and address to o
|
||||
"version": "0.0.0",
|
||||
"description": "Play ZK Battleship",
|
||||
"development": {
|
||||
"private_key": "APrivateKey1zkpGKaJY47BXb6knSqmT3JZnBUEGBDFAWz2nMVSsjwYpJmm",
|
||||
"private_key": "APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH",
|
||||
"view_key": "AViewKey1fSyEPXxfPFVgjL6qcM9izWRGrhSHKXyN3c64BNsAjnA6",
|
||||
"address": "aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy"
|
||||
"address": "aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
@ -82,19 +82,19 @@ Initialize a new board as Player 1 with valid ship inputs and Player 2's address
|
||||
|
||||
**Run**
|
||||
```
|
||||
leo run initialize_board 34084860461056u64 551911718912u64 7u64 1157425104234217472u64 aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry
|
||||
leo run initialize_board 34084860461056u64 551911718912u64 7u64 1157425104234217472u64 aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t
|
||||
```
|
||||
**Output**
|
||||
```bash
|
||||
➡️ Output
|
||||
|
||||
• {
|
||||
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
owner: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 0u64.private,
|
||||
ships: 1157459741006397447u64.private,
|
||||
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_1: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
player_2: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
game_started: false.private,
|
||||
_nonce: 3887646704618532506963887075433683846689834495661101507703164090915348189037group.public
|
||||
}
|
||||
@ -122,12 +122,12 @@ Now, we can offer a battleship game to player 2. Run `leo run offer_battleship '
|
||||
**Run**
|
||||
```
|
||||
leo run offer_battleship '{
|
||||
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
owner: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 0u64.private,
|
||||
ships: 1157459741006397447u64.private,
|
||||
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_1: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
player_2: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
game_started: false.private,
|
||||
_nonce: 3887646704618532506963887075433683846689834495661101507703164090915348189037group.public
|
||||
}'
|
||||
@ -138,20 +138,20 @@ leo run offer_battleship '{
|
||||
➡️ Outputs
|
||||
|
||||
• {
|
||||
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
owner: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 0u64.private,
|
||||
ships: 1157459741006397447u64.private,
|
||||
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_1: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
player_2: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
game_started: true.private,
|
||||
_nonce: 6563064852163330630334088854834332804417910882908622526775624018226782316843group.public
|
||||
}
|
||||
• {
|
||||
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
owner: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
incoming_fire_coordinate: 0u64.private,
|
||||
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_1: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
player_2: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
prev_hit_or_miss: 0u64.private,
|
||||
_nonce: 4374626042494973146987320062571809401151262172766172816829659487584978644457group.public
|
||||
}
|
||||
@ -176,9 +176,9 @@ We must run the program as Player 2 now, so switch the `program.json` file to us
|
||||
"version": "0.0.0",
|
||||
"description": "Play ZK Battleship",
|
||||
"development": {
|
||||
"private_key": "APrivateKey1zkp86FNGdKxjgAdgQZ967bqBanjuHkAaoRe19RK24ZCGsHH",
|
||||
"private_key": "APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh",
|
||||
"view_key": "AViewKey1hh6dvSEgeMdfseP4hfdbNYjX4grETwCuTbKnCftkpMwE",
|
||||
"address": "aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry"
|
||||
"address": "aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
@ -187,7 +187,7 @@ We must run the program as Player 2 now, so switch the `program.json` file to us
|
||||
We'll create a new and different board for Player 2, and make sure to include Player 1's address as the opponent:
|
||||
**Run**
|
||||
```bash
|
||||
leo run initialize_board 31u64 2207646875648u64 224u64 9042383626829824u64 aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy
|
||||
leo run initialize_board 31u64 2207646875648u64 224u64 9042383626829824u64 aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px
|
||||
```
|
||||
|
||||
**Output**
|
||||
@ -195,12 +195,12 @@ leo run initialize_board 31u64 2207646875648u64 224u64 9042383626829824u64 aleo1
|
||||
➡️ Output
|
||||
|
||||
• {
|
||||
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
owner: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 0u64.private,
|
||||
ships: 9044591273705727u64.private,
|
||||
player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_1: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
player_2: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
game_started: false.private,
|
||||
_nonce: 1549419609469324182591325047490602235361156298832591378925133482196483208807group.public
|
||||
}
|
||||
@ -224,19 +224,19 @@ Now, we can accept Player 1's offer. Run `leo run start_battleship 'board_state.
|
||||
**Run**
|
||||
```bash
|
||||
leo run start_battleship '{
|
||||
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
owner: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 0u64.private,
|
||||
ships: 9044591273705727u64.private,
|
||||
player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_1: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
player_2: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
game_started: false.private,
|
||||
_nonce: 1549419609469324182591325047490602235361156298832591378925133482196483208807group.public
|
||||
}' '{
|
||||
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
owner: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
incoming_fire_coordinate: 0u64.private,
|
||||
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_1: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
player_2: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
prev_hit_or_miss: 0u64.private,
|
||||
_nonce: 4374626042494973146987320062571809401151262172766172816829659487584978644457group.public
|
||||
}'
|
||||
@ -247,20 +247,20 @@ leo run start_battleship '{
|
||||
➡️ Outputs
|
||||
|
||||
• {
|
||||
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
owner: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 0u64.private,
|
||||
ships: 9044591273705727u64.private,
|
||||
player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_1: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
player_2: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
game_started: true.private,
|
||||
_nonce: 6222383571142756260765569201308836492199048237638652378826141459336360362251group.public
|
||||
}
|
||||
• {
|
||||
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
owner: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
incoming_fire_coordinate: 0u64.private,
|
||||
player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_1: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
player_2: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
prev_hit_or_miss: 0u64.private,
|
||||
_nonce: 3742551407126138397717446975757978589064777004441277005584760115236217735495group.public
|
||||
}
|
||||
@ -279,19 +279,19 @@ Player 1 now makes the first real move: `leo run play 'board_state.record' 'move
|
||||
**Run**
|
||||
```bash
|
||||
leo run play '{
|
||||
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
owner: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 0u64.private,
|
||||
ships: 1157459741006397447u64.private,
|
||||
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_1: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
player_2: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
game_started: true.private,
|
||||
_nonce: 6563064852163330630334088854834332804417910882908622526775624018226782316843group.public
|
||||
}' '{
|
||||
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
owner: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
incoming_fire_coordinate: 0u64.private,
|
||||
player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_1: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
player_2: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
prev_hit_or_miss: 0u64.private,
|
||||
_nonce: 3742551407126138397717446975757978589064777004441277005584760115236217735495group.public
|
||||
}' 1u64
|
||||
@ -301,20 +301,20 @@ leo run play '{
|
||||
➡️ Outputs
|
||||
|
||||
• {
|
||||
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
owner: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 1u64.private,
|
||||
ships: 1157459741006397447u64.private,
|
||||
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_1: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
player_2: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
game_started: true.private,
|
||||
_nonce: 1474170213684980843727833284550698461565286563122422722760769547002894080093group.public
|
||||
}
|
||||
• {
|
||||
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
owner: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
incoming_fire_coordinate: 1u64.private,
|
||||
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_1: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
player_2: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
prev_hit_or_miss: 0u64.private,
|
||||
_nonce: 5481529266389297320813092061136936339861329677911328036818179854958874588416group.public
|
||||
}
|
||||
@ -334,19 +334,19 @@ and they will also let Player 1 know whether their fire coordinate hit or miss P
|
||||
**Run**
|
||||
```bash
|
||||
leo run play '{
|
||||
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
owner: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 0u64.private,
|
||||
ships: 9044591273705727u64.private,
|
||||
player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_1: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
player_2: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
game_started: true.private,
|
||||
_nonce: 6222383571142756260765569201308836492199048237638652378826141459336360362251group.public
|
||||
}' '{
|
||||
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
owner: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
incoming_fire_coordinate: 1u64.private,
|
||||
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_1: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
player_2: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
prev_hit_or_miss: 0u64.private,
|
||||
_nonce: 5481529266389297320813092061136936339861329677911328036818179854958874588416group.public
|
||||
}' 2048u64
|
||||
@ -358,20 +358,20 @@ leo run play '{
|
||||
➡️ Outputs
|
||||
|
||||
• {
|
||||
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
owner: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 2048u64.private,
|
||||
ships: 9044591273705727u64.private,
|
||||
player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_1: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
player_2: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
game_started: true.private,
|
||||
_nonce: 5254963165391133332409074172682159033621708071536429341861038147524454777097group.public
|
||||
}
|
||||
• {
|
||||
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
owner: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
incoming_fire_coordinate: 2048u64.private,
|
||||
player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_1: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
player_2: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
prev_hit_or_miss: 1u64.private,
|
||||
_nonce: 5851606198769770675504009323414373017067582072428989801313256693053765675198group.public
|
||||
}
|
||||
@ -400,19 +400,19 @@ For example, running `aleo run play 'board_state.record' 'move.record' 1u64` wil
|
||||
**Run**
|
||||
```bash
|
||||
leo run play '{
|
||||
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
owner: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 1u64.private,
|
||||
ships: 1157459741006397447u64.private,
|
||||
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_1: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
player_2: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
game_started: true.private,
|
||||
_nonce: 1474170213684980843727833284550698461565286563122422722760769547002894080093group.public
|
||||
}' '{
|
||||
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
owner: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
incoming_fire_coordinate: 2048u64.private,
|
||||
player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_1: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
player_2: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
prev_hit_or_miss: 1u64.private,
|
||||
_nonce: 5851606198769770675504009323414373017067582072428989801313256693053765675198group.public
|
||||
}' 2u64
|
||||
@ -423,20 +423,20 @@ leo run play '{
|
||||
➡️ Outputs
|
||||
|
||||
• {
|
||||
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
owner: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
hits_and_misses: 1u64.private,
|
||||
played_tiles: 3u64.private,
|
||||
ships: 1157459741006397447u64.private,
|
||||
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_1: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
player_2: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
game_started: true.private,
|
||||
_nonce: 853278652528988609827041334083853520436225751739504321439524466875699631772group.public
|
||||
}
|
||||
• {
|
||||
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
owner: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
incoming_fire_coordinate: 2u64.private,
|
||||
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_1: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
player_2: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
prev_hit_or_miss: 0u64.private,
|
||||
_nonce: 710336412388939616658264778971886770861024495941253598683184288448156545822group.public
|
||||
}
|
||||
@ -465,19 +465,19 @@ The `board_state` record `hits_and_misses` component has also been updated with
|
||||
**Run**
|
||||
```bash
|
||||
leo run play '{
|
||||
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
owner: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 2048u64.private,
|
||||
ships: 9044591273705727u64.private,
|
||||
player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_1: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
player_2: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
game_started: true.private,
|
||||
_nonce: 5254963165391133332409074172682159033621708071536429341861038147524454777097group.public
|
||||
}' '{
|
||||
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
owner: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
incoming_fire_coordinate: 2u64.private,
|
||||
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_1: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
player_2: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
prev_hit_or_miss: 0u64.private,
|
||||
_nonce: 710336412388939616658264778971886770861024495941253598683184288448156545822group.public
|
||||
}' 4u64
|
||||
@ -488,20 +488,20 @@ leo run play '{
|
||||
➡️ Outputs
|
||||
|
||||
• {
|
||||
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
owner: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 2052u64.private,
|
||||
ships: 9044591273705727u64.private,
|
||||
player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_1: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
player_2: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
game_started: true.private,
|
||||
_nonce: 1145182747531998766752104305052328886102707397061849372000385383229513301534group.public
|
||||
}
|
||||
• {
|
||||
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
owner: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
incoming_fire_coordinate: 4u64.private,
|
||||
player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_1: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
player_2: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
prev_hit_or_miss: 2u64.private,
|
||||
_nonce: 5958326936461495382488152485080596366937963499216527548334225566230682598418group.public
|
||||
}
|
||||
|
@ -1,19 +1,19 @@
|
||||
[[package]]
|
||||
name = "board"
|
||||
name = "board.aleo"
|
||||
location = "local"
|
||||
path = "board"
|
||||
checksum = "da94274230d0c0c3deb96d80e07ad9db8bbf53264286c14cc3231b7a8b7ef380"
|
||||
dependencies = []
|
||||
|
||||
[[package]]
|
||||
name = "move"
|
||||
name = "move.aleo"
|
||||
location = "local"
|
||||
path = "move"
|
||||
checksum = "7d9fef5fe083eb24376e63935855e4ec709c17fb5ee46a0bb4594b0f9ef8eb08"
|
||||
dependencies = []
|
||||
|
||||
[[package]]
|
||||
name = "verify"
|
||||
name = "verify.aleo"
|
||||
location = "local"
|
||||
path = "verify"
|
||||
checksum = "2c2035ebd70500b7e5a9a6198bed1a1163cd1ddfd09128db8f4c16cf23ad2c62"
|
||||
|
@ -18,7 +18,7 @@ echo "
|
||||
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpGKaJY47BXb6knSqmT3JZnBUEGBDFAWz2nMVSsjwYpJmm
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
" > .env
|
||||
|
||||
echo "✅ Successfully initialized Player 1."
|
||||
@ -31,7 +31,7 @@ echo "
|
||||
######## ########
|
||||
###############################################################################
|
||||
"
|
||||
leo run initialize_board 34084860461056u64 551911718912u64 7u64 1157425104234217472u64 aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry || exit
|
||||
leo run initialize_board 34084860461056u64 551911718912u64 7u64 1157425104234217472u64 aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px || exit
|
||||
|
||||
echo "
|
||||
✅ Successfully initialized Player 1's board."
|
||||
@ -45,12 +45,12 @@ echo "
|
||||
###############################################################################
|
||||
"
|
||||
leo run offer_battleship '{
|
||||
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
owner: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 0u64.private,
|
||||
ships: 1157459741006397447u64.private,
|
||||
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_1: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
player_2: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
game_started: false.private,
|
||||
_nonce: 3887646704618532506963887075433683846689834495661101507703164090915348189037group.public
|
||||
}' || exit
|
||||
@ -65,14 +65,14 @@ echo "
|
||||
######## ########
|
||||
###############################################################################
|
||||
"
|
||||
(
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp86FNGdKxjgAdgQZ967bqBanjuHkAaoRe19RK24ZCGsHH
|
||||
" > .env
|
||||
|
||||
leo run initialize_board 31u64 2207646875648u64 224u64 9042383626829824u64 aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy || exit
|
||||
)
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
|
||||
" > .env
|
||||
|
||||
leo run initialize_board 31u64 2207646875648u64 224u64 9042383626829824u64 aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t || exit
|
||||
|
||||
echo "
|
||||
✅ Successfully initialized Player 2's board."
|
||||
|
||||
@ -86,19 +86,19 @@ echo "
|
||||
|
||||
"
|
||||
leo run start_battleship '{
|
||||
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
owner: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 0u64.private,
|
||||
ships: 9044591273705727u64.private,
|
||||
player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_1: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
player_2: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
game_started: false.private,
|
||||
_nonce: 1549419609469324182591325047490602235361156298832591378925133482196483208807group.public
|
||||
}' '{
|
||||
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
owner: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
incoming_fire_coordinate: 0u64.private,
|
||||
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_1: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
player_2: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
prev_hit_or_miss: 0u64.private,
|
||||
_nonce: 4374626042494973146987320062571809401151262172766172816829659487584978644457group.public
|
||||
}' || exit
|
||||
@ -113,30 +113,30 @@ echo "
|
||||
######## ########
|
||||
###############################################################################
|
||||
"
|
||||
(
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpGKaJY47BXb6knSqmT3JZnBUEGBDFAWz2nMVSsjwYpJmm
|
||||
" > .env
|
||||
|
||||
leo run play '{
|
||||
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 0u64.private,
|
||||
ships: 1157459741006397447u64.private,
|
||||
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
game_started: true.private,
|
||||
_nonce: 6563064852163330630334088854834332804417910882908622526775624018226782316843group.public
|
||||
}' '{
|
||||
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
incoming_fire_coordinate: 0u64.private,
|
||||
player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
prev_hit_or_miss: 0u64.private,
|
||||
_nonce: 3742551407126138397717446975757978589064777004441277005584760115236217735495group.public
|
||||
}' 1u64 || exit
|
||||
)
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
" > .env
|
||||
|
||||
leo run play '{
|
||||
owner: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 0u64.private,
|
||||
ships: 1157459741006397447u64.private,
|
||||
player_1: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
player_2: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
game_started: true.private,
|
||||
_nonce: 6563064852163330630334088854834332804417910882908622526775624018226782316843group.public
|
||||
}' '{
|
||||
owner: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
incoming_fire_coordinate: 0u64.private,
|
||||
player_1: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
player_2: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
prev_hit_or_miss: 0u64.private,
|
||||
_nonce: 3742551407126138397717446975757978589064777004441277005584760115236217735495group.public
|
||||
}' 1u64 || exit
|
||||
|
||||
echo "
|
||||
✅ Successfully executed Player 1's turn."
|
||||
|
||||
@ -148,31 +148,30 @@ echo "
|
||||
######## ########
|
||||
###############################################################################
|
||||
"
|
||||
(
|
||||
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp86FNGdKxjgAdgQZ967bqBanjuHkAaoRe19RK24ZCGsHH
|
||||
" > .env
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
|
||||
" > .env
|
||||
|
||||
leo run play '{
|
||||
owner: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 0u64.private,
|
||||
ships: 9044591273705727u64.private,
|
||||
player_1: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
player_2: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
game_started: true.private,
|
||||
_nonce: 6222383571142756260765569201308836492199048237638652378826141459336360362251group.public
|
||||
}' '{
|
||||
owner: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
incoming_fire_coordinate: 1u64.private,
|
||||
player_1: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
player_2: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
prev_hit_or_miss: 0u64.private,
|
||||
_nonce: 5481529266389297320813092061136936339861329677911328036818179854958874588416group.public
|
||||
}' 2048u64 || exit
|
||||
|
||||
leo run play '{
|
||||
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 0u64.private,
|
||||
ships: 9044591273705727u64.private,
|
||||
player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
game_started: true.private,
|
||||
_nonce: 6222383571142756260765569201308836492199048237638652378826141459336360362251group.public
|
||||
}' '{
|
||||
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
incoming_fire_coordinate: 1u64.private,
|
||||
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
prev_hit_or_miss: 0u64.private,
|
||||
_nonce: 5481529266389297320813092061136936339861329677911328036818179854958874588416group.public
|
||||
}' 2048u64 || exit
|
||||
)
|
||||
echo "
|
||||
✅ Successfully executed Player 2's turn."
|
||||
|
||||
@ -184,30 +183,30 @@ echo "
|
||||
######## ########
|
||||
###############################################################################
|
||||
"
|
||||
(
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpGKaJY47BXb6knSqmT3JZnBUEGBDFAWz2nMVSsjwYpJmm
|
||||
" > .env
|
||||
|
||||
leo run play '{
|
||||
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 1u64.private,
|
||||
ships: 1157459741006397447u64.private,
|
||||
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
game_started: true.private,
|
||||
_nonce: 1474170213684980843727833284550698461565286563122422722760769547002894080093group.public
|
||||
}' '{
|
||||
owner: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
incoming_fire_coordinate: 2048u64.private,
|
||||
player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
prev_hit_or_miss: 1u64.private,
|
||||
_nonce: 5851606198769770675504009323414373017067582072428989801313256693053765675198group.public
|
||||
}' 2u64 || exit
|
||||
)
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
" > .env
|
||||
|
||||
leo run play '{
|
||||
owner: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 1u64.private,
|
||||
ships: 1157459741006397447u64.private,
|
||||
player_1: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
player_2: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
game_started: true.private,
|
||||
_nonce: 1474170213684980843727833284550698461565286563122422722760769547002894080093group.public
|
||||
}' '{
|
||||
owner: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
incoming_fire_coordinate: 2048u64.private,
|
||||
player_1: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
player_2: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
prev_hit_or_miss: 1u64.private,
|
||||
_nonce: 5851606198769770675504009323414373017067582072428989801313256693053765675198group.public
|
||||
}' 2u64 || exit
|
||||
|
||||
echo "
|
||||
✅ Successfully executed Player 1's turn."
|
||||
|
||||
@ -219,30 +218,36 @@ echo "
|
||||
######## ########
|
||||
###############################################################################
|
||||
"
|
||||
(
|
||||
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp86FNGdKxjgAdgQZ967bqBanjuHkAaoRe19RK24ZCGsHH
|
||||
" > .env
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
|
||||
" > .env
|
||||
|
||||
leo run play '{
|
||||
owner: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 2048u64.private,
|
||||
ships: 9044591273705727u64.private,
|
||||
player_1: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
player_2: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
game_started: true.private,
|
||||
_nonce: 5254963165391133332409074172682159033621708071536429341861038147524454777097group.public
|
||||
}' '{
|
||||
owner: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
incoming_fire_coordinate: 2u64.private,
|
||||
player_1: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
player_2: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
prev_hit_or_miss: 0u64.private,
|
||||
_nonce: 710336412388939616658264778971886770861024495941253598683184288448156545822group.public
|
||||
}' 4u64 || exit
|
||||
|
||||
leo run play '{
|
||||
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
hits_and_misses: 0u64.private,
|
||||
played_tiles: 2048u64.private,
|
||||
ships: 9044591273705727u64.private,
|
||||
player_1: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
player_2: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
game_started: true.private,
|
||||
_nonce: 5254963165391133332409074172682159033621708071536429341861038147524454777097group.public
|
||||
}' '{
|
||||
owner: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
incoming_fire_coordinate: 2u64.private,
|
||||
player_1: aleo15g9c69urtdhvfml0vjl8px07txmxsy454urhgzk57szmcuttpqgq5cvcdy.private,
|
||||
player_2: aleo1wyvu96dvv0auq9e4qme54kjuhzglyfcf576h0g3nrrmrmr0505pqd6wnry.private,
|
||||
prev_hit_or_miss: 0u64.private,
|
||||
_nonce: 710336412388939616658264778971886770861024495941253598683184288448156545822group.public
|
||||
}' 4u64 || exit
|
||||
)
|
||||
echo "
|
||||
✅ Successfully executed Player 2's turn."
|
||||
|
||||
|
||||
# Restore the .env file to its original state
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
" > .env
|
||||
|
@ -1,2 +1,2 @@
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpBvXdKZKaXXcLUnwAVFCQNp41jrX6JqTuJo1JShfPoRfx
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
@ -1,2 +1,2 @@
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpBvXdKZKaXXcLUnwAVFCQNp41jrX6JqTuJo1JShfPoRfx
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
@ -1,2 +1,2 @@
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpBvXdKZKaXXcLUnwAVFCQNp41jrX6JqTuJo1JShfPoRfx
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
@ -1,2 +1,2 @@
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpBvXdKZKaXXcLUnwAVFCQNp41jrX6JqTuJo1JShfPoRfx
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
@ -1,2 +1,2 @@
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpBvXdKZKaXXcLUnwAVFCQNp41jrX6JqTuJo1JShfPoRfx
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
@ -1,2 +1,2 @@
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpBvXdKZKaXXcLUnwAVFCQNp41jrX6JqTuJo1JShfPoRfx
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
@ -1,2 +1,2 @@
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpBvXdKZKaXXcLUnwAVFCQNp41jrX6JqTuJo1JShfPoRfx
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
@ -1,2 +1,2 @@
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpBvXdKZKaXXcLUnwAVFCQNp41jrX6JqTuJo1JShfPoRfx
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
@ -1,2 +1,2 @@
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpBvXdKZKaXXcLUnwAVFCQNp41jrX6JqTuJo1JShfPoRfx
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
@ -1,2 +1,2 @@
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpBvXdKZKaXXcLUnwAVFCQNp41jrX6JqTuJo1JShfPoRfx
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,2 +1,2 @@
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpBvXdKZKaXXcLUnwAVFCQNp41jrX6JqTuJo1JShfPoRfx
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
@ -1,3 +1,2 @@
|
||||
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpBvXdKZKaXXcLUnwAVFCQNp41jrX6JqTuJo1JShfPoRfx
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
@ -1,2 +1,2 @@
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpBvXdKZKaXXcLUnwAVFCQNp41jrX6JqTuJo1JShfPoRfx
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
@ -1,2 +1,2 @@
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpBvXdKZKaXXcLUnwAVFCQNp41jrX6JqTuJo1JShfPoRfx
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
@ -1,2 +1,2 @@
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpBvXdKZKaXXcLUnwAVFCQNp41jrX6JqTuJo1JShfPoRfx
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
@ -8,6 +8,7 @@ mapping num_winners:
|
||||
key as u8.public;
|
||||
value as u8.public;
|
||||
|
||||
|
||||
function play:
|
||||
cast self.caller into r0 as Ticket.record;
|
||||
async play into r1;
|
||||
@ -24,3 +25,4 @@ finalize play:
|
||||
assert.eq r3 true;
|
||||
add r2 1u8 into r4;
|
||||
set r4 into num_winners[0u8];
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpBvXdKZKaXXcLUnwAVFCQNp41jrX6JqTuJo1JShfPoRfx
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
@ -1,2 +1,2 @@
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpBvXdKZKaXXcLUnwAVFCQNp41jrX6JqTuJo1JShfPoRfx
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
@ -1 +1 @@
|
||||
aleo1mgfq6g40l6zkhsm063n3uhr43qk5e0zsua5aszeq5080dsvlcvxsn0rrau 100u64
|
||||
aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px 100u64
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
owner: aleo1mgfq6g40l6zkhsm063n3uhr43qk5e0zsua5aszeq5080dsvlcvxsn0rrau.private,
|
||||
owner: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
amount: 100u64.private,
|
||||
_nonce: 0group.public
|
||||
}
|
||||
aleo1mgfq6g40l6zkhsm063n3uhr43qk5e0zsua5aszeq5080dsvlcvxsn0rrau
|
||||
aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px
|
||||
50u64
|
||||
|
@ -1,2 +1,2 @@
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpBvXdKZKaXXcLUnwAVFCQNp41jrX6JqTuJo1JShfPoRfx
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
@ -34,7 +34,7 @@ closure check_for_win:
|
||||
and r9 r10 into r11;
|
||||
or r6 r11 into r12;
|
||||
is.eq r0.r3.c1 r1 into r13;
|
||||
is.eq r0.r3.c3 r1 into r14;
|
||||
is.eq r0.r3.c2 r1 into r14;
|
||||
and r13 r14 into r15;
|
||||
is.eq r0.r3.c3 r1 into r16;
|
||||
and r15 r16 into r17;
|
||||
@ -46,7 +46,7 @@ closure check_for_win:
|
||||
and r21 r22 into r23;
|
||||
or r18 r23 into r24;
|
||||
is.eq r0.r1.c2 r1 into r25;
|
||||
is.eq r0.r2.c3 r1 into r26;
|
||||
is.eq r0.r2.c2 r1 into r26;
|
||||
and r25 r26 into r27;
|
||||
is.eq r0.r3.c2 r1 into r28;
|
||||
and r27 r28 into r29;
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp1w8PTxrRgGfAtfKUSq43iQyVbdQHfhGbiNPEg2LVSEXR
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
||||
|
@ -9,6 +9,7 @@ mapping account:
|
||||
key as address.public;
|
||||
value as u64.public;
|
||||
|
||||
|
||||
function mint_public:
|
||||
input r0 as address.public;
|
||||
input r1 as u64.public;
|
||||
@ -23,6 +24,7 @@ finalize mint_public:
|
||||
set r3 into account[r0];
|
||||
|
||||
|
||||
|
||||
function mint_private:
|
||||
input r0 as address.private;
|
||||
input r1 as u64.private;
|
||||
@ -30,6 +32,7 @@ function mint_private:
|
||||
output r2 as token.record;
|
||||
|
||||
|
||||
|
||||
function transfer_public:
|
||||
input r0 as address.public;
|
||||
input r1 as u64.public;
|
||||
@ -48,6 +51,7 @@ finalize transfer_public:
|
||||
set r6 into account[r1];
|
||||
|
||||
|
||||
|
||||
function transfer_private:
|
||||
input r0 as token.record;
|
||||
input r1 as address.private;
|
||||
@ -59,6 +63,7 @@ function transfer_private:
|
||||
output r5 as token.record;
|
||||
|
||||
|
||||
|
||||
function transfer_private_to_public:
|
||||
input r0 as token.record;
|
||||
input r1 as address.public;
|
||||
@ -77,6 +82,8 @@ finalize transfer_private_to_public:
|
||||
set r3 into account[r0];
|
||||
|
||||
|
||||
|
||||
|
||||
function transfer_public_to_private:
|
||||
input r0 as address.public;
|
||||
input r1 as u64.public;
|
||||
@ -91,3 +98,4 @@ finalize transfer_public_to_private:
|
||||
get.or_use account[r0] 0u64 into r2;
|
||||
sub r2 r1 into r3;
|
||||
set r3 into account[r0];
|
||||
|
||||
|
@ -8,18 +8,18 @@ fi
|
||||
|
||||
# The private key and address of Alice.
|
||||
# Swap these into program.json, when running transactions as the first bidder.
|
||||
# "private_key": "APrivateKey1zkp1w8PTxrRgGfAtfKUSq43iQyVbdQHfhGbiNPEg2LVSEXR",
|
||||
# "address": "aleo13ssze66adjjkt795z9u5wpq8h6kn0y2657726h4h3e3wfnez4vqsm3008q"
|
||||
# NETWORK=mainnet
|
||||
# PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
||||
# The private key and address of Bob.
|
||||
# Swap these into program.json, when running transactions as the second bidder.
|
||||
# "private_key": "APrivateKey1zkpFo72g7N9iFt3JzzeG8CqsS5doAiXyFvNCgk2oHvjRCzF"
|
||||
# "address": "aleo17vy26rpdhqx4598y5gp7nvaa9rk7tnvl6ufhvvf4calsrrqdaqyshdsf5z"
|
||||
# NETWORK=mainnet
|
||||
# PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
|
||||
|
||||
# Swap in the private key of Alice.
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp1w8PTxrRgGfAtfKUSq43iQyVbdQHfhGbiNPEg2LVSEXR
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
" > .env
|
||||
|
||||
# Publicly mint 100 tokens for Alice.
|
||||
@ -48,12 +48,12 @@ echo "
|
||||
######## ########
|
||||
###############################################################################
|
||||
"
|
||||
leo run mint_public aleo13ssze66adjjkt795z9u5wpq8h6kn0y2657726h4h3e3wfnez4vqsm3008q 100u64
|
||||
leo run mint_public aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px 100u64
|
||||
|
||||
# Swap in the private key of Bob.
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpFo72g7N9iFt3JzzeG8CqsS5doAiXyFvNCgk2oHvjRCzF
|
||||
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
|
||||
" > .env
|
||||
|
||||
# Privately mint 100 tokens for Bob.
|
||||
@ -82,12 +82,12 @@ echo "
|
||||
######## ########
|
||||
###############################################################################
|
||||
"
|
||||
leo run mint_private aleo17vy26rpdhqx4598y5gp7nvaa9rk7tnvl6ufhvvf4calsrrqdaqyshdsf5z 100u64
|
||||
leo run mint_private aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t 100u64
|
||||
|
||||
# Swap in the private key of Alice.
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp1w8PTxrRgGfAtfKUSq43iQyVbdQHfhGbiNPEg2LVSEXR
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
" > .env
|
||||
|
||||
# Publicly transfer 10 tokens from Alice to Bob.
|
||||
@ -116,12 +116,12 @@ echo "
|
||||
######## ########
|
||||
###############################################################################
|
||||
"
|
||||
leo run transfer_public aleo17vy26rpdhqx4598y5gp7nvaa9rk7tnvl6ufhvvf4calsrrqdaqyshdsf5z 10u64
|
||||
leo run transfer_public aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t 10u64
|
||||
|
||||
# Swap in the private key of Bob.
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpFo72g7N9iFt3JzzeG8CqsS5doAiXyFvNCgk2oHvjRCzF
|
||||
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
|
||||
" > .env
|
||||
|
||||
# Privately transfer 20 tokens from Bob to Alice.
|
||||
@ -151,15 +151,15 @@ echo "
|
||||
###############################################################################
|
||||
"
|
||||
leo run transfer_private "{
|
||||
owner: aleo17vy26rpdhqx4598y5gp7nvaa9rk7tnvl6ufhvvf4calsrrqdaqyshdsf5z.private,
|
||||
owner: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
amount: 100u64.private,
|
||||
_nonce: 6586771265379155927089644749305420610382723873232320906747954786091923851913group.public
|
||||
}" aleo13ssze66adjjkt795z9u5wpq8h6kn0y2657726h4h3e3wfnez4vqsm3008q 20u64
|
||||
}" aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px 20u64
|
||||
|
||||
# Swap in the private key of Alice.
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp1w8PTxrRgGfAtfKUSq43iQyVbdQHfhGbiNPEg2LVSEXR
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
" > .env
|
||||
|
||||
# Convert 30 public tokens from Alice into 30 private tokens for Bob.
|
||||
@ -189,12 +189,12 @@ echo "
|
||||
######## ########
|
||||
###############################################################################
|
||||
"
|
||||
leo run transfer_public_to_private aleo17vy26rpdhqx4598y5gp7nvaa9rk7tnvl6ufhvvf4calsrrqdaqyshdsf5z 30u64
|
||||
leo run transfer_public_to_private aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t 30u64
|
||||
|
||||
# Swap in the private key of Bob.
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpFo72g7N9iFt3JzzeG8CqsS5doAiXyFvNCgk2oHvjRCzF
|
||||
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
|
||||
" > .env
|
||||
|
||||
# Convert 40 private tokens from Bob into 40 public tokens for Alice.
|
||||
@ -225,15 +225,15 @@ echo "
|
||||
###############################################################################
|
||||
"
|
||||
leo run transfer_private_to_public "{
|
||||
owner: aleo17vy26rpdhqx4598y5gp7nvaa9rk7tnvl6ufhvvf4calsrrqdaqyshdsf5z.private,
|
||||
owner: aleo1s3ws5tra87fjycnjrwsjcrnw2qxr8jfqqdugnf0xzqqw29q9m5pqem2u4t.private,
|
||||
amount: 80u64.private,
|
||||
_nonce: 1852830456042139988098466781381363679605019151318121788109768539956661608520group.public
|
||||
}" aleo13ssze66adjjkt795z9u5wpq8h6kn0y2657726h4h3e3wfnez4vqsm3008q 40u64
|
||||
}" aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px 40u64
|
||||
|
||||
|
||||
# Swap in the private key of Alice.
|
||||
# This is done to ensure that program.json is the same after every execution of ./run.sh.
|
||||
echo "
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkp1w8PTxrRgGfAtfKUSq43iQyVbdQHfhGbiNPEg2LVSEXR
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
" > .env
|
||||
|
@ -1,2 +1,2 @@
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpBvXdKZKaXXcLUnwAVFCQNp41jrX6JqTuJo1JShfPoRfx
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
@ -1,2 +1,2 @@
|
||||
NETWORK=mainnet
|
||||
PRIVATE_KEY=APrivateKey1zkpBvXdKZKaXXcLUnwAVFCQNp41jrX6JqTuJo1JShfPoRfx
|
||||
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||
|
@ -34,12 +34,14 @@ mapping disagree_votes:
|
||||
key as field.public;
|
||||
value as u64.public;
|
||||
|
||||
|
||||
function propose:
|
||||
input r0 as ProposalInfo.public;
|
||||
assert.eq self.caller r0.proposer;
|
||||
hash.bhp256 r0.title into r1 as field;
|
||||
cast self.caller r1 r0 into r2 as Proposal.record;
|
||||
async propose r1 into r3; output r2 as Proposal.record;
|
||||
async propose r1 into r3;
|
||||
output r2 as Proposal.record;
|
||||
output r3 as vote.aleo/propose.future;
|
||||
|
||||
finalize propose:
|
||||
@ -47,11 +49,14 @@ finalize propose:
|
||||
set 0u64 into tickets[r0];
|
||||
|
||||
|
||||
|
||||
|
||||
function new_ticket:
|
||||
input r0 as field.public;
|
||||
input r1 as address.public;
|
||||
cast r1 r0 into r2 as Ticket.record;
|
||||
async new_ticket r0 into r3; output r2 as Ticket.record;
|
||||
async new_ticket r0 into r3;
|
||||
output r2 as Ticket.record;
|
||||
output r3 as vote.aleo/new_ticket.future;
|
||||
|
||||
finalize new_ticket:
|
||||
@ -61,9 +66,12 @@ finalize new_ticket:
|
||||
set r2 into tickets[r0];
|
||||
|
||||
|
||||
|
||||
|
||||
function agree:
|
||||
input r0 as Ticket.record;
|
||||
async agree r0.pid into r1; output r1 as vote.aleo/agree.future;
|
||||
async agree r0.pid into r1;
|
||||
output r1 as vote.aleo/agree.future;
|
||||
|
||||
finalize agree:
|
||||
input r0 as field.public;
|
||||
@ -72,12 +80,16 @@ finalize agree:
|
||||
set r2 into agree_votes[r0];
|
||||
|
||||
|
||||
|
||||
|
||||
function disagree:
|
||||
input r0 as Ticket.record;
|
||||
async disagree r0.pid into r1; output r1 as vote.aleo/disagree.future;
|
||||
async disagree r0.pid into r1;
|
||||
output r1 as vote.aleo/disagree.future;
|
||||
|
||||
finalize disagree:
|
||||
input r0 as field.public;
|
||||
get.or_use disagree_votes[r0] 0u64 into r1;
|
||||
add r1 1u64 into r2;
|
||||
set r2 into disagree_votes[r0];
|
||||
|
||||
|
@ -23,7 +23,7 @@ echo "
|
||||
leo run propose "{
|
||||
title: 2077160157502449938194577302446444field,
|
||||
content: 1452374294790018907888397545906607852827800436field,
|
||||
proposer: aleo1mgfq6g40l6zkhsm063n3uhr43qk5e0zsua5aszeq5080dsvlcvxsn0rrau
|
||||
proposer: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px
|
||||
}" || exit
|
||||
|
||||
echo "
|
||||
@ -40,7 +40,7 @@ echo "
|
||||
###############################################################################
|
||||
"
|
||||
# Run the `new_ticket` program function
|
||||
leo run new_ticket 2264670486490520844857553240576860973319410481267184439818180411609250173817field aleo1mgfq6g40l6zkhsm063n3uhr43qk5e0zsua5aszeq5080dsvlcvxsn0rrau || exit
|
||||
leo run new_ticket 2264670486490520844857553240576860973319410481267184439818180411609250173817field aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px || exit
|
||||
|
||||
echo "
|
||||
###############################################################################
|
||||
@ -57,7 +57,7 @@ echo "
|
||||
"
|
||||
# Run the `agree` or `disagree` program function
|
||||
leo run agree "{
|
||||
owner: aleo1mgfq6g40l6zkhsm063n3uhr43qk5e0zsua5aszeq5080dsvlcvxsn0rrau.private,
|
||||
owner: aleo1rhgdu77hgyqd3xjj8ucu3jj9r2krwz6mnzyd80gncr5fxcwlh5rsvzp9px.private,
|
||||
pid: 2264670486490520844857553240576860973319410481267184439818180411609250173817field.private,
|
||||
_nonce: 1637267040221574073903539416642641433705357302885235345311606754421919550724group.public
|
||||
}" || exit
|
||||
|
Loading…
Reference in New Issue
Block a user