forked from lambdaclass/mina_bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
Contracts Deployment & Bridge Token From Mina to Ethereum & Refactor #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
coldstar1993
wants to merge
92
commits into
main
Choose a base branch
from
feat/token-acct-verify
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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 21d4ce9
update config
coldstar1993 bbf2a74
update import info
coldstar1993 cad9cb0
update graphql definition
coldstar1993 d6d6b42
add token_id on command
coldstar1993 078cab2
improve log
coldstar1993 386938f
improve log
coldstar1993 9931d78
improve log
coldstar1993 a9f31af
improve log
coldstar1993 c895032
improve account query script
coldstar1993 c25db6a
improve account query script2
coldstar1993 8ce0fbe
print graphql response
coldstar1993 9af0b70
change debug to info
coldstar1993 2769cfc
change get to fetch
coldstar1993 6acb109
for test: change to accoun_query_response.json
coldstar1993 824f214
for test: add UnlockNoriToken
coldstar1993 7c4c17e
for test: mv NoriTokenBridge.sol for deployment
coldstar1993 841e723
for test: read accoun_query_response.json
coldstar1993 5ebb68c
enable optimizer compiling
coldstar1993 01bdb05
change to endpoint to query account
coldstar1993 acf2916
add NoriTokenBridge deploy code
coldstar1993 b5438ef
improve unlockToken() method
coldstar1993 3780f8d
add hourly task to submit state
coldstar1993 8c53a08
adjust env name and read manner
coldstar1993 539faf0
add execute_example_unlock_nori_token command
coldstar1993 9ee5195
adjust log file path
coldstar1993 ee0121e
copy to example/app/abi/NoriTokenBridge.json
coldstar1993 16156f0
no need reference
coldstar1993 74efd5e
read env param
coldstar1993 1895ce9
rm extra space
coldstar1993 3762b27
adjust .env template
coldstar1993 5901cda
add hex lib
coldstar1993 cf1a88c
temp print key
coldstar1993 94043aa
add Command::Transfer
coldstar1993 d09b077
adjust hourly task
coldstar1993 768837b
add command execute_example_transfer
coldstar1993 14b0768
improve command
coldstar1993 139c514
adjust the mathod name
coldstar1993 96a0f23
deploy nori contract with some wei
coldstar1993 e359c4a
deploy only nori token bridge contract
coldstar1993 39742e2
for test: deploy noriTokenBridge with value
coldstar1993 f9492cc
for test: tmp comment line: deduct totalLocked
coldstar1993 c075d6e
add comment for TEST code
coldstar1993 61bbe64
no need check vkhash in solidity
coldstar1993 523f109
rm extra lines
coldstar1993 6b41073
adjust lines
coldstar1993 5a22d0c
init refactor
coldstar1993 b5253c8
adjust command position
coldstar1993 a260187
rm extra sudoku example
coldstar1993 09cdc15
adjust command position
coldstar1993 594815d
adjust method param position
coldstar1993 c0200b2
adjust .env
coldstar1993 bfb47a9
improve .env
coldstar1993 15e14b8
rm extra wallet module
coldstar1993 14033d8
rm extra comments
coldstar1993 5a8a85d
check if devnet
coldstar1993 448e287
imprv .env template
coldstar1993 7241d98
improve privatekey env template
coldstar1993 2e9753d
fix wrong match return
coldstar1993 5decdae
log in file
coldstar1993 b678204
improve log file
coldstar1993 d2fae29
add time to file name
coldstar1993 9fdb2ac
add chrono dependency
coldstar1993 c6fa52c
improve LOG
coldstar1993 115f061
rm extra file prefix
coldstar1993 0decf46
Update README.md
coldstar1993 611b5d9
add setter for Mina State&Acct contracts
coldstar1993 42dc9f9
adjust deployment for setting Mina State&Acct contracts
coldstar1993 aa778e4
update cargo.lock file
coldstar1993 d8fb830
add timing log for align proof submit&query
coldstar1993 a11a529
Merge branch 'feat/token-acct-verify' into feat/proxy-pattern
coldstar1993 128d049
improve & add more env params
coldstar1993 abc8cc8
update unlock-nori-token command
coldstar1993 c7b214a
improve env with testnet param
coldstar1993 a2fa361
rename BATCHER_ETH_ADDR to BATCHER_PAYEMENT_SERVICE_ADDRESS
coldstar1993 b7e4d60
add calc size of verification data before send to batcher
coldstar1993 2f8cea1
add print zkapp account
coldstar1993 acd65b9
add print tx status & print state_hash
coldstar1993 911d02a
updates
coldstar1993 44db262
no need --release flag in dev mode
coldstar1993 da0ba4d
append network types for dev net
coldstar1993 e030356
mv alignedlayer's mina_state_verifier to local
coldstar1993 712e796
append mina_state_verifier into core as pre-check
coldstar1993 dabccbc
adjust .gitignore
coldstar1993 8442279
adjust BRIDGE_TRANSITION_FRONTIER_LEN to 17 for test locally
coldstar1993 44888f5
update cargo.lock
coldstar1993 4498106
update contract abi files
coldstar1993 51b4b31
update smart contract
coldstar1993 5623c53
update deployment of sc
coldstar1993 7626aed
add compute keccak256 of vk
coldstar1993 3e02058
add vk_hash & token_id at core
coldstar1993 563ee78
revert back BRIDGE_TRANSITION_FRONTIER_LEN to 16
coldstar1993 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| # options: devnet,hoodi,sepolia,mainnet | ||
| ETH_CHAIN=hoodi |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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