forked from matter-labs/zksync
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Store tx result and block ops in db + function to get block ops from db * Fix formatting * ETH watcher upgrade done * Create dummy prover * Store tokens to db * Update deps * Revive eth sender * Deploy scripts * No exit queue address * Make franklin init work * Improve wallet * txs fix * Add withdraw functions * Integration test
- Loading branch information
Showing
41 changed files
with
1,876 additions
and
1,332 deletions.
There are no files selected for viewing
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 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 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,16 @@ | ||
#!/bin/bash | ||
|
||
. .setup_env | ||
|
||
set -e | ||
|
||
cargo run --bin server -- --genesis | tee genesis.log | ||
|
||
GENESIS_ROOT_NEW_VALUE=`grep GENESIS_ROOT genesis.log` | ||
|
||
export LABEL=$FRANKLIN_ENV-Genesis_gen-`date +%Y-%m-%d-%H%M%S` | ||
mkdir -p logs/$LABEL/ | ||
cp ./$ENV_FILE logs/$LABEL/$FRANKLIN_ENV.bak | ||
cp genesis.log logs/$LABEL/ | ||
echo $GENESIS_ROOT_NEW_VALUE | ||
python3 bin/replace-env-variable.py ./$ENV_FILE $GENESIS_ROOT_NEW_VALUE |
This file contains 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 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,19 @@ | ||
#!/usr/bin/python3 | ||
|
||
import fileinput | ||
import sys | ||
|
||
def process_line(line, env_name, env_val): | ||
line_env_name = line.split("=")[0] | ||
if line_env_name == env_name: | ||
print("%s=%s" % (env_name, env_val)) | ||
else: | ||
print(line, end = '') | ||
|
||
if __name__ == "__main__": | ||
file = sys.argv[1] | ||
env = sys.argv[2].split("=") | ||
env_name = env[0] | ||
env_val = env[1] | ||
for line in fileinput.input(file, inplace=True): | ||
process_line(line, env_name, env_val) |
This file contains 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 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 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,19 @@ | ||
import {franklinContractCode} from "../src.ts/deploy"; | ||
import {parseEther} from "ethers/utils"; | ||
import {Contract, ethers} from "ethers"; | ||
|
||
const provider = new ethers.providers.JsonRpcProvider(process.env.WEB3_URL); | ||
const wallet = ethers.Wallet.fromMnemonic(process.env.MNEMONIC, "m/44'/60'/0'/0/1").connect(provider); | ||
const franklinAddress = "010203040506070809101112131415161718192021222334252627"; | ||
const franklinAddressBinary = Buffer.from(franklinAddress, "hex"); | ||
|
||
async function main() { | ||
const franklinDeployedContract = new Contract(process.env.CONTRACT_ADDR, franklinContractCode.interface, wallet); | ||
const depositValue = parseEther("0.3"); | ||
const depositFee = parseEther("0.01"); | ||
const tx = await franklinDeployedContract.depositETH(franklinAddressBinary, {value: depositValue}); | ||
const receipt = await tx.wait(); | ||
console.log(receipt); | ||
} | ||
|
||
main(); |
This file contains 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,14 @@ | ||
import 'ethers' | ||
import {ethers} from "ethers"; | ||
import {Wallet} from "../../js/franklin_lib/src/wallet"; | ||
|
||
async function main() { | ||
const provider = new ethers.providers.JsonRpcProvider(process.env.WEB3_URL); | ||
const operatorAccountPrivateKey = process.env.OPERATOR_PRIVATE_KEY; | ||
let ethWallet = new ethers.Wallet(operatorAccountPrivateKey); | ||
let franklinWallet = await Wallet.fromEthWallet(ethWallet); | ||
console.log(`OPERATOR_ETH_ADDRESS=${ethWallet.address}`); | ||
console.log(`OPERATOR_FRANKLIN_ADDRESS=${franklinWallet.address}`); | ||
} | ||
|
||
main(); |
This file contains 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 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 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 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 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 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 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.