Skip to content

Commit f53cce1

Browse files
authored
docs: fix validationg public input example (#987)
2 parents 423beb6 + 8c87195 commit f53cce1

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

docs/3_guides/3_validating_public_input.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,17 @@ pragma solidity ^0.8.12;
4242
4343
contract FibonacciValidator {
4444
address public alignedServiceManager;
45+
address public paymentServiceAddr;
4546
bytes32 public fibonacciProgramId;
4647
4748
bytes32 public fibonacciProgramIdCommitment =
4849
0x069ed9f3972550a2901523723f4beb5e240749dcafa30e1623d0778e17d69d70;
4950
5051
event FibonacciNumbers(uint32 fibN, uint32 fibNPlusOne);
5152
52-
constructor(address _alignedServiceManager) {
53+
constructor(address _alignedServiceManager, address _paymentServiceAddr) {
5354
alignedServiceManager = _alignedServiceManager;
55+
paymentServiceAddr = _paymentServiceAddr;
5456
}
5557
5658
function verifyBatchInclusion(
@@ -78,14 +80,15 @@ contract FibonacciValidator {
7880
bytes memory proofIsIncluded
7981
) = alignedServiceManager.staticcall(
8082
abi.encodeWithSignature(
81-
"verifyBatchInclusion(bytes32,bytes32,bytes32,bytes20,bytes32,bytes,uint256)",
83+
"verifyBatchInclusion(bytes32,bytes32,bytes32,bytes20,bytes32,bytes,uint256,address)",
8284
proofCommitment,
8385
pubInputCommitment,
8486
programIdCommitment,
8587
proofGeneratorAddr,
8688
batchMerkleRoot,
8789
merkleProof,
88-
verificationDataBatchIndex
90+
verificationDataBatchIndex,
91+
paymentServiceAddr
8992
)
9093
);
9194
@@ -146,14 +149,15 @@ require(
146149
bytes memory proofIsIncluded
147150
) = alignedServiceManager.staticcall(
148151
abi.encodeWithSignature(
149-
"verifyBatchInclusion(bytes32,bytes32,bytes32,bytes20,bytes32,bytes,uint256)",
152+
"verifyBatchInclusion(bytes32,bytes32,bytes32,bytes20,bytes32,bytes,uint256,address)",
150153
proofCommitment,
151154
pubInputCommitment,
152155
programIdCommitment,
153156
proofGeneratorAddr,
154157
batchMerkleRoot,
155158
merkleProof,
156-
verificationDataBatchIndex
159+
verificationDataBatchIndex,
160+
paymentServiceAddr
157161
)
158162
);
159163
@@ -192,6 +196,7 @@ To deploy the contract, first you will need to set up the `.env` file in the con
192196
RPC_URL=<rpc_url> #You can use publicnode RPC: https://ethereum-holesky-rpc.publicnode.com
193197
PRIVATE_KEY=<private_key>
194198
ALIGNED_SERVICE_MANAGER_ADDRESS=<service_manager_address> #0x58F280BeBE9B34c9939C3C39e0890C81f163B623 for Holesky
199+
PAYMENT_SERVICE_ADDRESS=<payment_service_address> #0x815aeCA64a974297942D2Bbf034ABEe22a38A003 for Holesky
195200
```
196201

197202
Then, run `make deploy_fibonacci_validator`.

0 commit comments

Comments
 (0)