-
Notifications
You must be signed in to change notification settings - Fork 396
Expand file tree
/
Copy pathverify.py
More file actions
34 lines (25 loc) · 1.16 KB
/
verify.py
File metadata and controls
34 lines (25 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from web3 import Web3
from argparse import ArgumentParser
from encode_verification_data import encode_call
def main():
parser = ArgumentParser()
parser.add_argument('--rpc-url', default='https://ethereum-holesky-rpc.publicnode.com',
help='RPC URL (default: https://ethereum-holesky-rpc.publicnode.com)')
parser.add_argument('--aligned-verification-data', help='Path to JSON file with the verification data',
required=True)
parser.add_argument('--contract-address', help='Verifier Contract address', required=True)
parser.add_argument('--sender-address', help='Address that sent the batch to Aligned')
args = parser.parse_args()
provider = Web3(Web3.HTTPProvider(args.rpc_url))
data = encode_call(args.aligned_verification_data, args.sender_address)
result = provider.eth.call({
'to': args.contract_address,
'data': data
})
# Check result last byte is 1
if result[-1] == 1:
print("Submitted proof with associated data is verified in ethereum blockchain")
else:
print("Not verified in ethereum blockchain")
if __name__ == "__main__":
main()