Skip to content

Commit 4884ce7

Browse files
committed
Fix lints
1 parent 7ec4c39 commit 4884ce7

File tree

4 files changed

+93
-39
lines changed

4 files changed

+93
-39
lines changed

docs/0_internal/3_a_upgrade_contracts.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,19 @@ If you deployed the contract using a Multisig wallet, you can follow the [Upgrad
1111
- You need to have installed git and make.
1212

1313
- Clone the repository
14-
```
14+
15+
```sh
1516
git clone https://github.com/yetanotherco/aligned_layer.git
1617
```
1718

1819
- Install foundry
19-
```shell
20+
21+
```sh
2022
make install_foundry
2123
foundryup -v nightly-a428ba6ad8856611339a6319290aade3347d25d9
2224
```
2325

24-
- Add the following variables to the `.env` file:
26+
- Add the following variables to the `.env` file:
2527

2628
```makefile
2729
MULTISIG=false
@@ -50,4 +52,3 @@ To upgrade the Batcher Payment Service, run:
5052
```bash
5153
make upgrade_batcher_payment_service
5254
```
53-

docs/0_internal/3_b_1_deploy_new_impl.md

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,39 @@
22

33
To deploy a new implementation, you can follow the steps below.
44

5-
65
## Prerequisites
76

87
1. Make sure you have set variables as specified in the [Deploy Contracts Guide](./2_deploy_contracts.md).
98

109
2. Set ```MULTISIG=true``` on the ```.env``` used to deploy. ```contracts/scripts/.env.mainnet``` or ```contracts/scripts/.env.holesky``` or ```contracts/scripts/.env.sepolia```
1110

12-
1311
## Deploy New Implementation for AlignedLayerServiceManager
1412

1513
1. Deploy the new implementation by running:
1614

1715
For **Mainnet** deployment:
18-
16+
1917
```bash
2018
make upgrade_aligned_contracts NETWORK=mainnet
2119
```
2220

2321
For **Holesky** deployment:
24-
22+
2523
```bash
2624
make upgrade_aligned_contracts NETWORK=holesky
2725
```
28-
26+
2927
For **Sepolia** deployment:
30-
28+
3129
```bash
3230
make upgrade_aligned_contracts NETWORK=sepolia
3331
```
3432

3533
If the new implementation is correctly deployed, the terminal will show the following message:
3634

37-
```
35+
```html
3836
The new aligned layer service manager implementation is <new_aligned_layer_service_manager_implementation>
39-
37+
4038
You can propose the upgrade transaction with the multisig using this calldata
4139
<calldata>
4240
```
@@ -45,43 +43,41 @@ To deploy a new implementation, you can follow the steps below.
4543

4644
2. Create a PR with the new address for the AlignedLayerServiceManagerImplementation.
4745

48-
4946
## Deploy New Implementation for BatcherPaymentService
5047

5148
1. Deploy the new implementation by running:
5249

5350
For **Mainnet** deployment:
54-
51+
5552
```bash
5653
make upgrade_batcher_payment_service NETWORK=mainnet
5754
```
58-
55+
5956
For **Holesky** deployment:
60-
57+
6158
```bash
6259
make upgrade_batcher_payment_service NETWORK=holesky
6360
```
64-
61+
6562
For **Sepolia** deployment:
66-
63+
6764
```bash
6865
make upgrade_batcher_payment_service NETWORK=sepolia
6966
```
7067

7168
If the new implementation is correctly deployed, the script will show the following message:
7269

73-
```
70+
```html
7471
The new Batcher Payment Service Implementation is <new_batcher_payment_service_implementation>
75-
76-
You can propose the upgrade transaction with the multisig using this calldata
72+
73+
You can propose the upgrade transaction with the multisig using this calldata
7774
<calldata>
7875
```
79-
76+
8077
Also, the ```contracts/script/output/mainnet/alignedlayer_deployment_output.json``` or ```contracts/script/output/holesky/alignedlayer_deployment_output.json``` or ```contracts/script/output/sepolia/alignedlayer_deployment_output.json``` file will be updated with the new implementation address depending on the network you are deploying.
8178

8279
2. Create a PR with the new address for the BatcherPaymentServiceImplementation.
8380

84-
8581
## Next Steps
8682

8783
Once you have deployed the new implementation of the contract you want to upgrade, you need to propose the upgrade transaction to the mulstisig, following this [guide](./3_b_2_propose_upgrade.md).

docs/0_internal/3_b_2_propose_upgrade.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,50 +9,49 @@ To propose the upgrade transaction you can follow the steps below:
99
1. Go to [Safe](https://app.safe.global/home)
1010

1111
2. Click on `New transaction` -> `Transaction Builder`
12-
12+
1313
![New transaction](./images/3_b_2_multisig_1.png)
1414

1515
![Transaction Builder](./images/3_b_2_multisig_2.png)
1616

17-
4. Get the `alignedLayerProxyAdmin` address from ```contracts/script/output/mainnet/alignedlayer_deployment_output.json``` or ```contracts/script/output/holesky/alignedlayer_deployment_output.json``` or ```contracts/script/output/sepolia/alignedlayer_deployment_output.json```, and paste it on `Enter Address or ENS Name`
17+
3. Get the `alignedLayerProxyAdmin` address from ```contracts/script/output/mainnet/alignedlayer_deployment_output.json``` or ```contracts/script/output/holesky/alignedlayer_deployment_output.json``` or ```contracts/script/output/sepolia/alignedlayer_deployment_output.json```, and paste it on `Enter Address or ENS Name`
1818

19-
5. Once you paste the address, the ABI should be automatically filled.
19+
4. Once you paste the address, the ABI should be automatically filled.
2020

21-
6. Choose the method ```upgrade``` in ```Contract method selector```.
21+
5. Choose the method ```upgrade``` in ```Contract method selector```.
2222

23-
7. Get the ```alignedLayerServiceManager``` and ```alignedServiceManagerImplementation``` address from ```contracts/script/output/mainnet/alignedlayer_deployment_output.json``` or ```contracts/script/output/holesky/alignedlayer_deployment_output.json``` or ```contracts/script/output/sepolia/alignedlayer_deployment_output.json```.
23+
6. Get the ```alignedLayerServiceManager``` and ```alignedServiceManagerImplementation``` address from ```contracts/script/output/mainnet/alignedlayer_deployment_output.json``` or ```contracts/script/output/holesky/alignedlayer_deployment_output.json``` or ```contracts/script/output/sepolia/alignedlayer_deployment_output.json```.
2424

25-
8. Paste ```alignedLayerServiceManager``` address in ```proxy (address)```
25+
7. Paste ```alignedLayerServiceManager``` address in ```proxy (address)```
2626

27-
9. Paste ```alignedServiceManagerImplementation``` address in ```implementation (address)```
27+
8. Paste ```alignedServiceManagerImplementation``` address in ```implementation (address)```
2828

29-
10. Click on `Create batch` to create the transaction.
29+
9. Click on `Create batch` to create the transaction.
3030

3131
![Create batch](./images/3_b_2_multisig_7.png)
3232

33-
11. Review and confirm the transaction.
34-
33+
10. Review and confirm the transaction.
34+
3535
To make sure everything is fine, simulate the transaction by clicking on `Simulate batch`
36-
36+
3737
Once the simulation is successful, click on `Send Batch` to send the transaction.
3838

3939
![Simulate batch](./images/3_b_2_multisig_8.png)
4040

41-
12. Confirm the transaction checking the function being called is correct and the contract address is the one you deployed.
41+
11. Confirm the transaction checking the function being called is correct and the contract address is the one you deployed.
4242

4343
If everything is correct, click on `Sign` to send the transaction.
4444

4545
![Confirm transaction](./images/3_b_2_multisig_9.png)
4646

47-
13. Now in your transactions, you should be able to see the newly created transaction.
47+
12. Now in your transactions, you should be able to see the newly created transaction.
4848

4949
![New transaction](./images/3_b_2_multisig_10.png)
5050

51-
14. If the transaction is correctly created, you have to wait until the required Multisig member signs the transaction to send it.
51+
13. If the transaction is correctly created, you have to wait until the required Multisig member signs the transaction to send it.
5252

5353
A guide on how to sign the transaction can be found [here](./3_b_3_approve_upgrade.md)
5454

55-
5655
## Propose transaction for BatcherPaymentService
5756

5857
1. Go to [Safe](https://app.safe.global/home)
@@ -98,4 +97,3 @@ A guide on how to sign the transaction can be found [here](./3_b_3_approve_upgra
9897
12. If the transaction is correctly created, you have to wait until the required Multisig member signs the transaction to send it.
9998

10099
A guide on how to sign the transaction can be found [here](./3_b_3_approve_upgrade.md)
101-
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# ZK Quiz
2+
3+
## Introduction
4+
5+
This program leverages Aligned's ZK verification infrastructure to run a small quiz. The proof allows any party to check that the quiz was answered right or wrong. If answered correctly, the user receives an NFT.
6+
7+
The process is as follows:
8+
9+
1. The user runs ZKQuiz and answers the questions.
10+
2. ZKQuiz generates a ZK Proof of correct answers.
11+
3. The proof is posted on Aligned.
12+
4. Upon verification, ZKQuiz mints an NFT via a Smart Contract.
13+
14+
The NFT is only granted if the user's answers correctly.
15+
Incorrect answers or tampering with the ZKQuiz code will result in proof generation failure or mismatched checksums,
16+
preventing NFT minting.
17+
18+
Next, we will see how to execute ZKQuiz to get your own ZKQuiz NFT!
19+
20+
## Requirements
21+
22+
1. [Rust](https://www.rust-lang.org/tools/install)
23+
2. [Foundry](https://getfoundry.sh)
24+
25+
## Usage
26+
27+
### 1 - Create Keystore
28+
29+
You can use cast to create a local keystore.
30+
If you already have one, you can skip this step.
31+
32+
```bash
33+
cast wallet new-mnemonic
34+
```
35+
36+
Then you can import your created keystore using:
37+
38+
```bash
39+
cast wallet import --interactive <path_to_keystore.json>
40+
```
41+
42+
Then you need to get some funds to pay for gas and proof verification.
43+
You can do this by using this [faucet](https://cloud.google.com/application/web3/faucet/ethereum/holesky)
44+
45+
### 2 - Answer Quiz
46+
47+
To answer quiz questions run:
48+
49+
```bash
50+
make answer_quiz KEYSTORE_PATH=<path_to_keystore.json>
51+
```
52+
53+
This will:
54+
55+
1. Ask quiz questions
56+
2. Generate ZK proof
57+
3. Pay & submit proof to aligned for verification
58+
4. Wait for proof to be verified in aligned
59+
5. Claim NFT if proof is verified

0 commit comments

Comments
 (0)