Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
b654426
add new style: token holder account
coldstar1993 Nov 20, 2025
21d4ce9
update config
coldstar1993 Nov 22, 2025
bbf2a74
update import info
coldstar1993 Nov 22, 2025
cad9cb0
update graphql definition
coldstar1993 Nov 22, 2025
d6d6b42
add token_id on command
coldstar1993 Nov 22, 2025
078cab2
improve log
coldstar1993 Nov 22, 2025
386938f
improve log
coldstar1993 Nov 22, 2025
9931d78
improve log
coldstar1993 Nov 22, 2025
a9f31af
improve log
coldstar1993 Nov 22, 2025
c895032
improve account query script
coldstar1993 Nov 22, 2025
c25db6a
improve account query script2
coldstar1993 Nov 22, 2025
8ce0fbe
print graphql response
coldstar1993 Nov 22, 2025
9af0b70
change debug to info
coldstar1993 Nov 27, 2025
2769cfc
change get to fetch
coldstar1993 Nov 22, 2025
6acb109
for test: change to accoun_query_response.json
coldstar1993 Nov 30, 2025
824f214
for test: add UnlockNoriToken
coldstar1993 Dec 1, 2025
7c4c17e
for test: mv NoriTokenBridge.sol for deployment
coldstar1993 Dec 2, 2025
841e723
for test: read accoun_query_response.json
coldstar1993 Dec 2, 2025
5ebb68c
enable optimizer compiling
coldstar1993 Dec 5, 2025
01bdb05
change to endpoint to query account
coldstar1993 Dec 5, 2025
acf2916
add NoriTokenBridge deploy code
coldstar1993 Dec 5, 2025
b5438ef
improve unlockToken() method
coldstar1993 Dec 5, 2025
3780f8d
add hourly task to submit state
coldstar1993 Dec 7, 2025
8c53a08
adjust env name and read manner
coldstar1993 Dec 11, 2025
539faf0
add execute_example_unlock_nori_token command
coldstar1993 Dec 11, 2025
9ee5195
adjust log file path
coldstar1993 Dec 11, 2025
ee0121e
copy to example/app/abi/NoriTokenBridge.json
coldstar1993 Dec 11, 2025
16156f0
no need reference
coldstar1993 Dec 11, 2025
74efd5e
read env param
coldstar1993 Dec 11, 2025
1895ce9
rm extra space
coldstar1993 Dec 11, 2025
3762b27
adjust .env template
coldstar1993 Dec 12, 2025
5901cda
add hex lib
coldstar1993 Dec 15, 2025
cf1a88c
temp print key
coldstar1993 Dec 15, 2025
94043aa
add Command::Transfer
coldstar1993 Dec 15, 2025
d09b077
adjust hourly task
coldstar1993 Dec 16, 2025
768837b
add command execute_example_transfer
coldstar1993 Dec 16, 2025
14b0768
improve command
coldstar1993 Dec 16, 2025
139c514
adjust the mathod name
coldstar1993 Dec 16, 2025
96a0f23
deploy nori contract with some wei
coldstar1993 Dec 16, 2025
e359c4a
deploy only nori token bridge contract
coldstar1993 Dec 16, 2025
39742e2
for test: deploy noriTokenBridge with value
coldstar1993 Dec 16, 2025
f9492cc
for test: tmp comment line: deduct totalLocked
coldstar1993 Dec 17, 2025
c075d6e
add comment for TEST code
coldstar1993 Dec 17, 2025
61bbe64
no need check vkhash in solidity
coldstar1993 Dec 19, 2025
523f109
rm extra lines
coldstar1993 Dec 22, 2025
6b41073
adjust lines
coldstar1993 Dec 22, 2025
5a22d0c
init refactor
coldstar1993 Dec 30, 2025
b5253c8
adjust command position
coldstar1993 Dec 30, 2025
a260187
rm extra sudoku example
coldstar1993 Dec 30, 2025
09cdc15
adjust command position
coldstar1993 Dec 31, 2025
594815d
adjust method param position
coldstar1993 Dec 31, 2025
c0200b2
adjust .env
coldstar1993 Dec 31, 2025
bfb47a9
improve .env
coldstar1993 Dec 31, 2025
15e14b8
rm extra wallet module
coldstar1993 Dec 31, 2025
14033d8
rm extra comments
coldstar1993 Dec 31, 2025
5a8a85d
check if devnet
coldstar1993 Dec 31, 2025
448e287
imprv .env template
coldstar1993 Dec 31, 2025
7241d98
improve privatekey env template
coldstar1993 Dec 31, 2025
2e9753d
fix wrong match return
coldstar1993 Dec 31, 2025
5decdae
log in file
coldstar1993 Dec 31, 2025
b678204
improve log file
coldstar1993 Dec 31, 2025
d2fae29
add time to file name
coldstar1993 Dec 31, 2025
9fdb2ac
add chrono dependency
coldstar1993 Dec 31, 2025
c6fa52c
improve LOG
coldstar1993 Dec 31, 2025
115f061
rm extra file prefix
coldstar1993 Dec 31, 2025
0decf46
Update README.md
coldstar1993 Dec 31, 2025
611b5d9
add setter for Mina State&Acct contracts
coldstar1993 Jan 10, 2026
42dc9f9
adjust deployment for setting Mina State&Acct contracts
coldstar1993 Jan 10, 2026
aa778e4
update cargo.lock file
coldstar1993 Jan 10, 2026
d8fb830
add timing log for align proof submit&query
coldstar1993 Jan 14, 2026
a11a529
Merge branch 'feat/token-acct-verify' into feat/proxy-pattern
coldstar1993 Jan 15, 2026
128d049
improve & add more env params
coldstar1993 Jan 20, 2026
abc8cc8
update unlock-nori-token command
coldstar1993 Jan 20, 2026
c7b214a
improve env with testnet param
coldstar1993 Jan 21, 2026
a2fa361
rename BATCHER_ETH_ADDR to BATCHER_PAYEMENT_SERVICE_ADDRESS
coldstar1993 Jan 21, 2026
b7e4d60
add calc size of verification data before send to batcher
coldstar1993 Feb 12, 2026
2f8cea1
add print zkapp account
coldstar1993 Feb 12, 2026
acd65b9
add print tx status & print state_hash
coldstar1993 Feb 12, 2026
911d02a
updates
coldstar1993 Feb 26, 2026
44db262
no need --release flag in dev mode
coldstar1993 Feb 26, 2026
da0ba4d
append network types for dev net
coldstar1993 Feb 26, 2026
e030356
mv alignedlayer's mina_state_verifier to local
coldstar1993 Feb 26, 2026
712e796
append mina_state_verifier into core as pre-check
coldstar1993 Feb 26, 2026
dabccbc
adjust .gitignore
coldstar1993 Feb 26, 2026
8442279
adjust BRIDGE_TRANSITION_FRONTIER_LEN to 17 for test locally
coldstar1993 Feb 26, 2026
44888f5
update cargo.lock
coldstar1993 Feb 26, 2026
4498106
update contract abi files
coldstar1993 Feb 26, 2026
51b4b31
update smart contract
coldstar1993 Mar 4, 2026
5623c53
update deployment of sc
coldstar1993 Mar 4, 2026
7626aed
add compute keccak256 of vk
coldstar1993 Mar 6, 2026
3e02058
add vk_hash & token_id at core
coldstar1993 Mar 6, 2026
563ee78
revert back BRIDGE_TRANSITION_FRONTIER_LEN to 16
coldstar1993 Mar 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# options: devnet,hoodi,sepolia,mainnet
ETH_CHAIN=hoodi
Empty file removed .env copy.devnet
Empty file.
29 changes: 29 additions & 0 deletions .env.devnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
MINA_RPC_URL=https://api.minascan.io/node/devnet/v1/graphql
#MINA_RPC_URL=https://mina-node.devnet.nori.it.com/graphql
STATE_SETTLEMENT_ETH_ADDR=0xf56AA3aCedDf88Ab12E494d0B96DA3C09a5d264e
ACCOUNT_VALIDATION_ETH_ADDR=0xDFD787c807DEA8d7e53311b779BC0c6a4704D286
NORI_TOKEN_BRIDGE_ETH_ADDRESS=0x4C073a92B1C8Fb55313102Ab412fb7F1704bcBdD
SAVE_PROOF=true/false # also false if other than "true" or variable were to be not defined

BATCHER_ADDR=ws://localhost:8080
BATCHER_PAYEMENT_SERVICE_ADDRESS=0x7bc06c482DEAd17c0e297aFbC32f6e63d3846650
ETH_RPC_URL=http://localhost:8545
PROOF_GENERATOR_ADDR=0x66f9664f97F2b50F62D13eA064982f936dE76657
ALIGNED_SERVICE_MANAGER_ADDR=0x851356ae760d987E095750cCeb3bC6014560891C

# 0: Default; 1: Instant; 2: Custom-(require BATCH_MAX_FEE's value)
BATCHER_FEE_ESTM_TYPE=1
BATCHER_MAX_FEE=691654288189150

NORI_STORAGE_ZKAPP_ACCT_VK_HASH_KECCAK256=0x1234567890123456789012345678901234567890123456789012345678901234
NORI_STORAGE_ZKAPP_TOKEN_ID=0x1234567890123456789012345678901234567890123456789012345678901234

# if keystore instead of PRIVATE_KEY, then uncomment it
# KEYSTORE_PATH=

# optional: default, polling
ALIGNED_SUBMISSION_MODE=polling
# seconds
ALIGNED_POLL_INTERVAL_SECS=10
# seconds
ALIGNED_POLL_TIMEOUT_SECS=600
30 changes: 30 additions & 0 deletions .env.hoodi
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#MINA_RPC_URL=https://api.minascan.io/node/devnet/v1/graphql
MINA_RPC_URL=https://mina-node.devnet.nori.it.com/graphql
STATE_SETTLEMENT_ETH_ADDR=0xC38d0E13c69124Bb10944E6E3612D6cf5366410B
ACCOUNT_VALIDATION_ETH_ADDR=0xEe6A1D89694e741564363224C084b38AB5e38Bd4
NORI_TOKEN_BRIDGE_ETH_ADDRESS=0xcAF8ECC34fFF8a39899D0CA820c5f828B0441BE4

SAVE_PROOF=true/false # also false if other than "true" or variable were to be not defined

BATCHER_ADDR=wss://hoodi.batcher.alignedlayer.com
BATCHER_PAYEMENT_SERVICE_ADDRESS=0x041af25Fce2413570aaa0029D36DeA1eFdeff083
ETH_RPC_URL=https://ethereum-hoodi-rpc.publicnode.com
PROOF_GENERATOR_ADDR=0x66f9664f97F2b50F62D13eA064982f936dE76657
ALIGNED_SERVICE_MANAGER_ADDR=0x87CD431F160e88EC34fA48EC6F6cF7F2C0E8248c

# 0: Default; 1: Instant; 2: Custom-(require BATCH_MAX_FEE's value)
BATCHER_FEE_ESTM_TYPE=1
BATCHER_MAX_FEE=691654288189150

NORI_STORAGE_ZKAPP_ACCT_VK_HASH_KECCAK256=0x1234567890123456789012345678901234567890123456789012345678901234
NORI_STORAGE_ZKAPP_TOKEN_ID=0x1234567890123456789012345678901234567890123456789012345678901234

# if keystore instead of PRIVATE_KEY, then uncomment it
# KEYSTORE_PATH=

# optional: default, polling
ALIGNED_SUBMISSION_MODE=default
# seconds
ALIGNED_POLL_INTERVAL_SECS=10
# seconds
ALIGNED_POLL_TIMEOUT_SECS=1000
29 changes: 29 additions & 0 deletions .env.mainnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
MINA_RPC_URL=https://api.minascan.io/node/devnet/v1/graphql
#MINA_RPC_URL=https://mina-node.devnet.nori.it.com/graphql
STATE_SETTLEMENT_ETH_ADDR=0xf56AA3aCedDf88Ab12E494d0B96DA3C09a5d264e
ACCOUNT_VALIDATION_ETH_ADDR=0xDFD787c807DEA8d7e53311b779BC0c6a4704D286
NORI_TOKEN_BRIDGE_ETH_ADDRESS=0x4C073a92B1C8Fb55313102Ab412fb7F1704bcBdD
SAVE_PROOF=true/false # also false if other than "true" or variable were to be not defined

BATCHER_ADDR=wss://mainnet.batcher.alignedlayer.com
BATCHER_PAYEMENT_SERVICE_ADDRESS=0xb0567184A52cB40956df6333510d6eF35B89C8de
ETH_RPC_URL=https://ethereum-rpc.publicnode.com
PROOF_GENERATOR_ADDR=0x66f9664f97F2b50F62D13eA064982f936dE76657
ALIGNED_SERVICE_MANAGER_ADDR=0xeF2A435e5EE44B2041100EF8cbC8ae035166606c

# 0: Default; 1: Instant; 2: Custom-(require BATCH_MAX_FEE's value)
BATCHER_FEE_ESTM_TYPE=1
BATCHER_MAX_FEE=691654288189150

NORI_STORAGE_ZKAPP_ACCT_VK_HASH_KECCAK256=0x1234567890123456789012345678901234567890123456789012345678901234
NORI_STORAGE_ZKAPP_TOKEN_ID=0x1234567890123456789012345678901234567890123456789012345678901234

# if keystore instead of PRIVATE_KEY, then uncomment it
# KEYSTORE_PATH=

# optional: default, polling
ALIGNED_SUBMISSION_MODE=polling
# seconds
ALIGNED_POLL_INTERVAL_SECS=10
# seconds
ALIGNED_POLL_TIMEOUT_SECS=1000
30 changes: 30 additions & 0 deletions .env.sepolia
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
MINA_RPC_URL=https://api.minascan.io/node/devnet/v1/graphql
#MINA_RPC_URL=https://mina-node.devnet.nori.it.com/graphql
STATE_SETTLEMENT_ETH_ADDR=0x9BE7c134F06A638Ec1E06ae46bAA862f72Edf3E6
ACCOUNT_VALIDATION_ETH_ADDR=0xf00D03ed0DA24bD83ED968E632546Fc4096837AA
NORI_TOKEN_BRIDGE_ETH_ADDRESS=0xE185126CA39e2D0FE3943E74b22a7A0F569D2264

SAVE_PROOF=true/false # also false if other than "true" or variable were to be not defined

BATCHER_ADDR=wss://sepolia.batcher.alignedlayer.com
BATCHER_PAYEMENT_SERVICE_ADDRESS=0x403dE630751e148bD71BFFcE762E5667C0825399
ETH_RPC_URL=https://ethereum-sepolia-rpc.publicnode.com
PROOF_GENERATOR_ADDR=0x66f9664f97F2b50F62D13eA064982f936dE76657
ALIGNED_SERVICE_MANAGER_ADDR=0xFf731AB7b3653dc66878DC77E851D174f472d137

# 0: Default; 1: Instant; 2: Custom-(require BATCH_MAX_FEE's value > 0)
BATCHER_FEE_ESTM_TYPE=1
BATCHER_MAX_FEE=691654288189150

NORI_STORAGE_ZKAPP_ACCT_VK_HASH_KECCAK256=0x1234567890123456789012345678901234567890123456789012345678901234
NORI_STORAGE_ZKAPP_TOKEN_ID=0x1234567890123456789012345678901234567890123456789012345678901234

# if keystore instead of PRIVATE_KEY, then uncomment it
# KEYSTORE_PATH=

# optional: default, polling
ALIGNED_SUBMISSION_MODE=polling
# seconds
ALIGNED_POLL_INTERVAL_SECS=10
# seconds
ALIGNED_POLL_TIMEOUT_SECS=1000
23 changes: 0 additions & 23 deletions .env.template

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will have to git ignore the .envs but we need the examples

Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ mina_state.proof
mina_account.pub
mina_account.proof
aligned_verification_data
.env
nonce_*.bin
.generated.contract.addresses.*
24 changes: 9 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
.PHONY: submit_mainnet_state submit_devnet_state submit_account gen_contract_abi deploy_example_bridge_contracts

submit_mainnet_state:
@cargo run --manifest-path core/Cargo.toml --release -- submit-state

submit_devnet_state:
@cargo run --manifest-path core/Cargo.toml --release -- submit-state --devnet
@cargo run --manifest-path core/Cargo.toml -- submit-state --devnet

submit_account:
@cargo run --manifest-path core/Cargo.toml --release -- submit-account $(PUBLIC_KEY) $(STATE_HASH)
@cargo run --manifest-path core/Cargo.toml --release -- submit-account $(PUBLIC_KEY) $(TOKEN_ID) $(STATE_HASH)

gen_contract_abis:
forge build --root contract/
forge build --root example/eth_contract
cp contract/out/MinaStateSettlementExample.sol/MinaStateSettlementExample.json core/abi/MinaStateSettlementExample.json
cp contract/out/MinaAccountValidationExample.sol/MinaAccountValidationExample.json core/abi/MinaAccountValidationExample.json
cp example/eth_contract/out/SudokuValidity.sol/SudokuValidity.json example/app/abi/SudokuValidity.json
cp contract/out/NoriTokenBridge.sol/NoriTokenBridge.json core/abi/NoriTokenBridge.json

deploy_example_bridge_contracts:
@cargo run --manifest-path contract_deployer/Cargo.toml --release
deploy_all_bridge_contracts:
@cargo run --manifest-path contract_deployer/Cargo.toml --release -- deploy-all-contracts ${NORI_TOKEN_BRIDGE_INITIAL_BALANCE}

deploy_example_app_contracts:
@cargo run --manifest-path example/app/Cargo.toml --release -- deploy-contract
deploy_nori_token_bridge_contract:
@cargo run --manifest-path contract_deployer/Cargo.toml --release -- deploy-nori-bridge ${NORI_TOKEN_BRIDGE_INITIAL_BALANCE}

execute_example:
cd example/mina_zkapp; \
npm run build; \
node build/src/run.js
cargo run --manifest-path example/app/Cargo.toml --release -- validate-solution
unlock_nori_token:
@cargo run --manifest-path core/Cargo.toml --release -- unlock-nori-token --to-unlock-amount $(TO_UNLOCK_AMOUNT) $(PUBLIC_KEY) $(TOKEN_ID)
72 changes: 28 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Docs and utils for the Zero-knowledge state bridge from Mina to Ethereum

- [About](#about)
- [Usage](#usage)
- [Example use case](#example-use-case)
- [Table of Contents](#table-of-contents)
- [Specification](#specification)
- [core](#core)
Expand Down Expand Up @@ -132,73 +131,58 @@ git checkout staging

1. Setup the `.env` file of the Bridge. A template is available in `.env.template`.
1. Set `ETH_CHAIN` to `devnet`.
1. Set `MINA_RPC_URL` to the URL of the Mina node GraphQL API (See [Mina node section](#mina-node)).
2. Set `MINA_RPC_URL` to the URL of the Mina node GraphQL API (See [Mina node section](#mina-node)).

2. In the root folder, deploy the example Bridge's contracts with:

```sh
make deploy_example_bridge_contracts
```

In the `.env` file, set `STATE_SETTLEMENT_ETH_ADDR` and `ACCOUNT_VALIDATION_ETH_ADDR` to the corresponding deployed contract addresses.

3. Submit a Mina state proof to verify:

- Run `make submit_devnet_state` if you are using Mina Devnet or `make submit_mainnet_state` if you are using Mina Mainnet.

4. Submit an account to verify:
gen_contract_abis

```sh
make submit_account PUBLIC_KEY=<string> STATE_HASH=<string>
make deploy_all_bridge_contracts NORI_TOKEN_BRIDGE_INITIAL_BALANCE=<string>
```

Where:
- `PUBLIC_KEY` is the public key of the Mina account you want to verify
- `STATE_HASH` is the hash of a Mina state that was verified in Ethereum
- NORI_TOKEN_BRIDGE_INITIAL_BALANCE is expressed in **ether** (e.g., `1` means 1 $ETH, `1.123` means 1.123 $ETH).

## Example use case

The `example/` folder contains a project that uses the Sudoku zkApp example from Mina and bridges its state to a SudokuValidity Ethereum smart contract.

For running the example you need to:

1. [Setup Aligned Devnet locally](https://github.com/yetanotherco/aligned_layer/blob/staging/docs/3_guides/6_setup_aligned.md#booting-devnet-with-default-configs)

2. Deploy the example bridge smart contracts by executing
In the `.env` file, set `STATE_SETTLEMENT_ETH_ADDR`, `ACCOUNT_VALIDATION_ETH_ADDR` and `NORI_TOKEN_BRIDGE_ETH_ADDRESS` to the corresponding deployed contract addresses.

If you expect to re-deploy NoriTokenBridge contract only, kindly re-exec

```sh
make deploy_example_bridge_contracts
make deploy_nori_token_bridge_contract NORI_TOKEN_BRIDGE_INITIAL_BALANCE=<string>
```

and later update `NORI_TOKEN_BRIDGE_ETH_ADDRESS` in `.env`.

3. Deploy the SudokuValidity smart contract by executing
3. Submit a Mina state proof to verify:

```sh
make deploy_example_app_contracts
```
- Run `make submit_devnet_state` if you are using Mina Devnet or `make submit_mainnet_state` if you are using Mina Mainnet.

4. Install `zkapp-cli`:
4. Submit an account to verify:

```sh
npm install -g zkapp-cli
make submit_account PUBLIC_KEY=<string> TOKEN_ID=<string> STATE_HASH=<string>
```

5. Inside the `example/mina_zkapp` directory, configure the zkApp and deploy the contract following [this guide](https://docs.minaprotocol.com/zkapps/writing-a-zkapp/introduction-to-zkapps/how-to-deploy-a-zkapp) on the Mina Protocol documentation

6. After deployment, set the `zkappAddress` field on `example/mina_zkapp/config.json`

7. Set the environment variables in a `.env` file accordingly. A template can be found in `.env.template`.
Where:
- `PUBLIC_KEY` is the public key of the Mina account you want to verify
- `TOKEN_ID` is the token id of the fungible token owned by `NoriBridgeController` Mina Contract.
- `STATE_HASH` is the hash of a Mina state that was verified in Ethereum

8. Run the example by executing from the root folder:
5. Unlock $ETH from NoriTokenBridge smart contract

```sh
make execute_example
```
You first need trigger `NoriBridgeController.alignedLock()` to burn $ETH fungible token on Mina side.

this will upload a new Sudoku, submit a solution to it and run the example Rust app that will bridge the new state of the zkApp and update the SudokuValidty smart contract on Ethereum.
and then:

The zkApp will wait until both Mina transactions are included in a block, so this may take a while. Below is a diagram explaining the execution flow:
```sh
make unlock_nori_token PUBLIC_KEY=<string> TOKEN_ID=<string> TO_UNLOCK_AMOUNT=<string>
```

![Example diagram](/img/example_diagram.png)
Where:
- `PUBLIC_KEY` is the public key of the Mina account you want to verify
- `TOKEN_ID` is the token id of the fungible token owned by `NoriBridgeController` Mina Contract.
- `TO_UNLOCK_AMOUNT` is expressed in **ether** (e.g., `1` means 1 $ETH, `1.123` means 1.123 $ETH).

## Specification

Expand Down
4 changes: 4 additions & 0 deletions contract/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ src = "src"
out = "out"
libs = ["lib"]

optimizer = true
optimizer_runs = 200
via_ir = true

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
6 changes: 2 additions & 4 deletions contract/src/MinaStateSettlementExample.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ contract MinaStateSettlementExample {

/// @notice Returns true if this snarked ledger hash was bridged.
function isLedgerVerified(bytes32 ledgerHash) external view returns (bool) {
for (uint256 i = 0; i < BRIDGE_TRANSITION_FRONTIER_LEN; i++) {
if (chainLedgerHashes[BRIDGE_TRANSITION_FRONTIER_LEN - 1 - i] == ledgerHash) {
return true;
}
if (chainLedgerHashes[0] == ledgerHash) {
return true;
}
return false;
}
Expand Down
Loading
Loading