mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-09-11 05:45:30 +03:00
WIP update examples
This commit is contained in:
parent
ee4bc2f856
commit
61a98cb8f8
@ -8,6 +8,7 @@ mapping num_winners:
|
|||||||
key as u8.public;
|
key as u8.public;
|
||||||
value as u8.public;
|
value as u8.public;
|
||||||
|
|
||||||
|
|
||||||
function play:
|
function play:
|
||||||
cast self.caller into r0 as Ticket.record;
|
cast self.caller into r0 as Ticket.record;
|
||||||
async play into r1;
|
async play into r1;
|
||||||
@ -24,3 +25,4 @@ finalize play:
|
|||||||
assert.eq r3 true;
|
assert.eq r3 true;
|
||||||
add r2 1u8 into r4;
|
add r2 1u8 into r4;
|
||||||
set r4 into num_winners[0u8];
|
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
|
fi
|
||||||
|
|
||||||
# The private key and address of Alice.
|
# The private key and address of Alice.
|
||||||
# Swap these into program.json, when running transactions as the first bidder.
|
# Swap these into .env, when running transactions as the first bidder.
|
||||||
# "private_key": "APrivateKey1zkp1w8PTxrRgGfAtfKUSq43iQyVbdQHfhGbiNPEg2LVSEXR",
|
# NETWORK=mainnet
|
||||||
# "address": "aleo13ssze66adjjkt795z9u5wpq8h6kn0y2657726h4h3e3wfnez4vqsm3008q"
|
# PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||||
|
|
||||||
# The private key and address of Bob.
|
# The private key and address of Bob.
|
||||||
# Swap these into program.json, when running transactions as the second bidder.
|
# Swap these into program.json, when running transactions as the second bidder.
|
||||||
# "private_key": "APrivateKey1zkpFo72g7N9iFt3JzzeG8CqsS5doAiXyFvNCgk2oHvjRCzF"
|
# NETWORK=mainnet
|
||||||
# "address": "aleo17vy26rpdhqx4598y5gp7nvaa9rk7tnvl6ufhvvf4calsrrqdaqyshdsf5z"
|
# PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
|
||||||
|
|
||||||
|
|
||||||
# Swap in the private key of Alice.
|
# Swap in the private key of Alice.
|
||||||
echo "
|
echo "
|
||||||
NETWORK=mainnet
|
NETWORK=mainnet
|
||||||
PRIVATE_KEY=APrivateKey1zkp1w8PTxrRgGfAtfKUSq43iQyVbdQHfhGbiNPEg2LVSEXR
|
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||||
" > .env
|
" > .env
|
||||||
|
|
||||||
# Publicly mint 100 tokens for Alice.
|
# Publicly mint 100 tokens for Alice.
|
||||||
@ -53,7 +54,7 @@ leo run mint_public aleo13ssze66adjjkt795z9u5wpq8h6kn0y2657726h4h3e3wfnez4vqsm30
|
|||||||
# Swap in the private key of Bob.
|
# Swap in the private key of Bob.
|
||||||
echo "
|
echo "
|
||||||
NETWORK=mainnet
|
NETWORK=mainnet
|
||||||
PRIVATE_KEY=APrivateKey1zkpFo72g7N9iFt3JzzeG8CqsS5doAiXyFvNCgk2oHvjRCzF
|
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
|
||||||
" > .env
|
" > .env
|
||||||
|
|
||||||
# Privately mint 100 tokens for Bob.
|
# Privately mint 100 tokens for Bob.
|
||||||
@ -87,7 +88,7 @@ leo run mint_private aleo17vy26rpdhqx4598y5gp7nvaa9rk7tnvl6ufhvvf4calsrrqdaqyshd
|
|||||||
# Swap in the private key of Alice.
|
# Swap in the private key of Alice.
|
||||||
echo "
|
echo "
|
||||||
NETWORK=mainnet
|
NETWORK=mainnet
|
||||||
PRIVATE_KEY=APrivateKey1zkp1w8PTxrRgGfAtfKUSq43iQyVbdQHfhGbiNPEg2LVSEXR
|
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||||
" > .env
|
" > .env
|
||||||
|
|
||||||
# Publicly transfer 10 tokens from Alice to Bob.
|
# Publicly transfer 10 tokens from Alice to Bob.
|
||||||
@ -121,7 +122,7 @@ leo run transfer_public aleo17vy26rpdhqx4598y5gp7nvaa9rk7tnvl6ufhvvf4calsrrqdaqy
|
|||||||
# Swap in the private key of Bob.
|
# Swap in the private key of Bob.
|
||||||
echo "
|
echo "
|
||||||
NETWORK=mainnet
|
NETWORK=mainnet
|
||||||
PRIVATE_KEY=APrivateKey1zkpFo72g7N9iFt3JzzeG8CqsS5doAiXyFvNCgk2oHvjRCzF
|
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
|
||||||
" > .env
|
" > .env
|
||||||
|
|
||||||
# Privately transfer 20 tokens from Bob to Alice.
|
# Privately transfer 20 tokens from Bob to Alice.
|
||||||
@ -159,7 +160,7 @@ leo run transfer_private "{
|
|||||||
# Swap in the private key of Alice.
|
# Swap in the private key of Alice.
|
||||||
echo "
|
echo "
|
||||||
NETWORK=mainnet
|
NETWORK=mainnet
|
||||||
PRIVATE_KEY=APrivateKey1zkp1w8PTxrRgGfAtfKUSq43iQyVbdQHfhGbiNPEg2LVSEXR
|
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||||
" > .env
|
" > .env
|
||||||
|
|
||||||
# Convert 30 public tokens from Alice into 30 private tokens for Bob.
|
# 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.
|
# Swap in the private key of Bob.
|
||||||
echo "
|
echo "
|
||||||
NETWORK=mainnet
|
NETWORK=mainnet
|
||||||
PRIVATE_KEY=APrivateKey1zkpFo72g7N9iFt3JzzeG8CqsS5doAiXyFvNCgk2oHvjRCzF
|
PRIVATE_KEY=APrivateKey1zkp2RWGDcde3efb89rjhME1VYA8QMxcxep5DShNBR6n8Yjh
|
||||||
" > .env
|
" > .env
|
||||||
|
|
||||||
# Convert 40 private tokens from Bob into 40 public tokens for Alice.
|
# 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.
|
# This is done to ensure that program.json is the same after every execution of ./run.sh.
|
||||||
echo "
|
echo "
|
||||||
NETWORK=mainnet
|
NETWORK=mainnet
|
||||||
PRIVATE_KEY=APrivateKey1zkp1w8PTxrRgGfAtfKUSq43iQyVbdQHfhGbiNPEg2LVSEXR
|
PRIVATE_KEY=APrivateKey1zkp8CZNn3yeCseEtxuVPbDCwSyhGW6yZKUYKfgXmcpoGPWH
|
||||||
" > .env
|
" > .env
|
||||||
|
Loading…
Reference in New Issue
Block a user