From 8ea6b3ca0b06927e1b9019fc11609b35933db60e Mon Sep 17 00:00:00 2001 From: LHerskind Date: Sat, 16 Sep 2023 16:17:44 +0000 Subject: [PATCH] feat: update `up-quick-start` --- docs/docs/external/up-quick-start.md | 2 +- .../end-to-end/src/guides/up_quick_start.sh | 61 +++++++++++++------ 2 files changed, 43 insertions(+), 20 deletions(-) diff --git a/docs/docs/external/up-quick-start.md b/docs/docs/external/up-quick-start.md index d6fb502788c9..b62d371cd884 100644 --- a/docs/docs/external/up-quick-start.md +++ b/docs/docs/external/up-quick-start.md @@ -12,7 +12,7 @@ The sandbox is preloaded with two [accounts](../concepts/foundation/accounts/mai #include_code declare-accounts yarn-project/end-to-end/src/guides/up_quick_start.sh bash noTitle,noLineNumbers,noSourceLink -Start by deploying a private token [contract](../concepts/foundation/contracts.md), minting an initial supply of private tokens to Alice: +Start by deploying a token [contract](../concepts/foundation/contracts.md), initializing it and minting tokens to Alice: #include_code deploy yarn-project/end-to-end/src/guides/up_quick_start.sh bash noTitle,noLineNumbers,noSourceLink diff --git a/yarn-project/end-to-end/src/guides/up_quick_start.sh b/yarn-project/end-to-end/src/guides/up_quick_start.sh index c27ff3454f37..7b25a747dd6f 100755 --- a/yarn-project/end-to-end/src/guides/up_quick_start.sh +++ b/yarn-project/end-to-end/src/guides/up_quick_start.sh @@ -4,48 +4,71 @@ set -eux # docs:start:declare-accounts -ALICE="0x2e13f0201905944184fc2c09d29fcf0cac07647be171656a275f63d99b819360" -BOB="0x0d557417a3ce7d7b356a8f15d79a868fd8da2af9c5f4981feb9bcf0b614bd17e" +ALICE="0x296904eaff80711ddd5fd39d75920bfc22725cc0ae3089f16a09a4ceb91be141" +BOB="0x1106245c5c50798338e55094c38025db4053a25e96dd8cbc1e87c6dcbfb9d2ba" +ALICE_PRIVATE_KEY="0x2153536ff6628eee01cf4024889ff977a18d9fa61d0e414422f7681cf085c281" # docs:end:declare-accounts # docs:start:deploy aztec-cli deploy \ - PrivateTokenContractAbi \ - --args 1000000 $ALICE \ + TokenContractAbi \ --salt 0 + +aztec-cli check-deploy --contract-address 0x2d23acefa3ce07b3c308caf78d86c064cdf8957bcea48b38753cf58441796c8c + +aztec-cli send _initialize \ + --args $ALICE \ + --contract-abi TokenContractAbi \ + --contract-address 0x2d23acefa3ce07b3c308caf78d86c064cdf8957bcea48b38753cf58441796c8c \ + --private-key $ALICE_PRIVATE_KEY # docs:end:deploy -aztec-cli check-deploy --contract-address 0x03b030d48607ba8a0562f0f1f82be26c3f091e45e10f74c2d8cebb80d526a69f +# docs:start:mint-private +SECRET="0x29bf6afaf29f61cbcf2a4fa7da97be481fb418dc08bdab5338839974beb7b49f" +SECRET_HASH="0x0a42b1fe22b652cc8610e33bb1128040ce2d2862e7041ff235aa871739822b74" + +aztec-cli send mint_private \ + --args 1000 $SECRET_HASH \ + --contract-abi TokenContractAbi \ + --contract-address 0x2d23acefa3ce07b3c308caf78d86c064cdf8957bcea48b38753cf58441796c8c \ + --private-key $ALICE_PRIVATE_KEY + +aztec-cli send redeem_shield \ + --args $ALICE 1000 $SECRET \ + --contract-abi TokenContractAbi \ + --contract-address 0x2d23acefa3ce07b3c308caf78d86c064cdf8957bcea48b38753cf58441796c8c \ + --private-key $ALICE_PRIVATE_KEY +# docs:end:mint-private # docs:start:get-balance -aztec-cli call getBalance \ +aztec-cli call balance_of_private \ --args $ALICE \ - --contract-abi PrivateTokenContractAbi \ - --contract-address 0x03b030d48607ba8a0562f0f1f82be26c3f091e45e10f74c2d8cebb80d526a69f + --contract-abi TokenContractAbi \ + --contract-address 0x2d23acefa3ce07b3c308caf78d86c064cdf8957bcea48b38753cf58441796c8c # docs:end:get-balance # docs:start:transfer aztec-cli send transfer \ - --args 500 $ALICE $BOB \ - --contract-abi PrivateTokenContractAbi \ - --contract-address 0x03b030d48607ba8a0562f0f1f82be26c3f091e45e10f74c2d8cebb80d526a69f \ - --private-key 0xb2803ec899f76f6b2ac011480d24028f1a29587f8a3a92f7ee9d48d8c085c284 + --args $ALICE $BOB 500 0 \ + --contract-abi TokenContractAbi \ + --contract-address 0x2d23acefa3ce07b3c308caf78d86c064cdf8957bcea48b38753cf58441796c8c \ + --private-key $ALICE_PRIVATE_KEY -aztec-cli call getBalance \ +aztec-cli call balance_of_private \ --args $ALICE \ - --contract-abi PrivateTokenContractAbi \ - --contract-address 0x03b030d48607ba8a0562f0f1f82be26c3f091e45e10f74c2d8cebb80d526a69f + --contract-abi TokenContractAbi \ + --contract-address 0x2d23acefa3ce07b3c308caf78d86c064cdf8957bcea48b38753cf58441796c8c -aztec-cli call getBalance \ +aztec-cli call balance_of_private \ --args $BOB \ - --contract-abi PrivateTokenContractAbi \ - --contract-address 0x03b030d48607ba8a0562f0f1f82be26c3f091e45e10f74c2d8cebb80d526a69f + --contract-abi TokenContractAbi \ + --contract-address 0x2d23acefa3ce07b3c308caf78d86c064cdf8957bcea48b38753cf58441796c8c # docs:end:transfer aztec-cli get-logs # Test end result -BOB_BALANCE=$(aztec-cli call getBalance --args $BOB --contract-abi PrivateTokenContractAbi --contract-address 0x03b030d48607ba8a0562f0f1f82be26c3f091e45e10f74c2d8cebb80d526a69f) +BOB_BALANCE=$(aztec-cli call balance_of_private --args $BOB --contract-abi TokenContractAbi --contract-address 0x2d23acefa3ce07b3c308caf78d86c064cdf8957bcea48b38753cf58441796c8c) if ! echo $BOB_BALANCE | grep -q 500; then echo "Incorrect Bob balance after transaction (expected 500 but got $BOB_BALANCE)" exit 1