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.
* Add new token symbol scripts * Remove old contracts * Remove old js code * Contract test code gen * Try franklin init CI * Try franklin contract build * Ignore yarn errors for now * Clean cache * Add env check script * Use drone CI * Cache in DroneCI * Cache in CI * Working CI version one * Try fix two build per commit * Fix some scripts * Fix fmt * Drone cargo fmt fix * Contract test CI * Cache fix * CI env * Docker ci * Fix test builds * Fix clippy * Add rust test and clippy to CI * Rename db update script * Move contract generation to franklin build-contracts * Add erc20 token script * Fix clippy in data restore
- Loading branch information
Showing
126 changed files
with
553 additions
and
16,847 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
kind: pipeline | ||
type: docker | ||
name: default | ||
|
||
steps: | ||
- name: restore-cache | ||
image: drillster/drone-volume-cache | ||
volumes: | ||
- name: cache | ||
path: /cache | ||
settings: | ||
restore: true | ||
mount: | ||
- ./contracts/node_modules | ||
- ./js/client_js/node_modules | ||
- ./js/explorer/node_modules | ||
- ./js/franklin_lib/node_modules | ||
- ./target/cargo | ||
|
||
- name: init | ||
image: matterlabs/ci | ||
commands: | ||
- export FRANKLIN_HOME=`pwd` | ||
- export PATH=$FRANKLIN_HOME/bin:$PATH | ||
- export CARGO_HOME=$FRANKLIN_HOME/target/cargo | ||
- franklin env ci | ||
- franklin yarn | ||
- franklin db-wait | ||
- franklin db-setup | ||
depends_on: | ||
- restore-cache | ||
|
||
- name: build-contracts | ||
image: matterlabs/ci | ||
commands: | ||
- export FRANKLIN_HOME=`pwd` | ||
- export PATH=$FRANKLIN_HOME/bin:$PATH | ||
- export CARGO_HOME=$FRANKLIN_HOME/target/cargo | ||
- franklin build-contracts | ||
depends_on: | ||
- init | ||
|
||
- name: rust-checks | ||
image: matterlabs/ci | ||
commands: | ||
- export FRANKLIN_HOME=`pwd` | ||
- export PATH=$FRANKLIN_HOME/bin:$PATH | ||
- export CARGO_HOME=$FRANKLIN_HOME/target/cargo | ||
- cargo fmt -- --check | ||
- cargo clippy --tests --benches -- -D warnings | ||
depends_on: | ||
- build-contracts | ||
|
||
- name: rust-tests | ||
image: matterlabs/ci | ||
commands: | ||
- export FRANKLIN_HOME=`pwd` | ||
- export PATH=$FRANKLIN_HOME/bin:$PATH | ||
- export CARGO_HOME=$FRANKLIN_HOME/target/cargo | ||
- cargo test | ||
depends_on: | ||
- rust-checks | ||
|
||
- name: deploy-test | ||
image: matterlabs/ci | ||
commands: | ||
- export FRANKLIN_HOME=`pwd` | ||
- export PATH=$FRANKLIN_HOME/bin:$PATH | ||
- export CARGO_HOME=$FRANKLIN_HOME/target/cargo | ||
- franklin genesis | ||
- franklin redeploy | ||
depends_on: | ||
- rust-tests | ||
|
||
- name: contract-test | ||
image: matterlabs/ci | ||
commands: | ||
- export FRANKLIN_HOME=`pwd` | ||
- export PATH=$FRANKLIN_HOME/bin:$PATH | ||
- export CARGO_HOME=$FRANKLIN_HOME/target/cargo | ||
- franklin test-contracts | ||
depends_on: | ||
- build-contracts | ||
|
||
|
||
- name: rebuild-cache | ||
image: drillster/drone-volume-cache | ||
volumes: | ||
- name: cache | ||
path: /cache | ||
settings: | ||
rebuild: true | ||
mount: | ||
- ./contracts/node_modules | ||
- ./js/client_js/node_modules | ||
- ./js/explorer/node_modules | ||
- ./js/franklin_lib/node_modules | ||
- ./target/cargo | ||
depends_on: | ||
- init | ||
- rust-checks | ||
|
||
|
||
volumes: | ||
- name: cache | ||
host: | ||
path: /tmp/cache | ||
|
||
services: | ||
- name: geth | ||
image: gluk64/franklin:geth | ||
- name: postgres | ||
image: postgres:10.4 | ||
|
||
trigger: | ||
event: | ||
- pull_request |
This file was deleted.
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
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,25 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
check_tool() { | ||
command -v $1 > /dev/null || (echo $1 not found && exit 1) | ||
} | ||
|
||
echo Checking environment | ||
|
||
check_tool yarn | ||
check_tool node | ||
node --version | grep "v10.*" > /dev/null || (echo "Node version 10 is supported" && exit 1) | ||
check_tool docker | ||
check_tool docker-compose | ||
check_tool envsubst | ||
check_tool cargo | ||
check_tool jq | ||
check_tool psql | ||
check_tool pg_isready | ||
check_tool diesel | ||
|
||
( (sed --version | grep GNU) &> /dev/null || (gsed --version | grep GNU) &> /dev/null ) || (echo "sed or gsed should be GNU-sed" && exit 1) | ||
|
||
echo Environment is fine |
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,15 @@ | ||
#!/bin/bash | ||
|
||
# Usage: db-update-token-symbol.sh token_address new_token_symbol | ||
|
||
. .setup_env | ||
|
||
set -e | ||
|
||
TOKEN_ADDRESS=$1 | ||
SYMBOL=$2 | ||
|
||
echo Setting token $2 symbol to $1 | ||
psql "$DATABASE_URL" -c "UPDATE tokens \ | ||
SET symbol = '$SYMBOL' \ | ||
WHERE address = '$TOKEN_ADDRESS'" |
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,10 @@ | ||
#!/bin/bash | ||
|
||
# Usage: governance-add-erc20.sh erc20_token_address | ||
# Adds new ERC20 token to our network | ||
. .setup_env | ||
|
||
.confirm_action || exit 1 | ||
|
||
cd $FRANKLIN_HOME/contracts | ||
f npx ts-node scripts/add-erc20-token.ts $1 |
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 |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
|
||
set -e | ||
|
||
check-environment.sh | ||
|
||
franklin dev-up | ||
franklin env | ||
franklin yarn || true # It can fail. | ||
|
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 |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
|
||
. .setup_env | ||
|
||
cd $FRANKLIN_HOME | ||
|
||
IN_DIR=./contracts/contracts/ | ||
OUT_DIR=./contracts/contracts/generated | ||
|
||
|
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 {bigNumberify} from "ethers/utils"; | ||
import {Contract, ethers} from "ethers"; | ||
import {governanceContractCode} from "../src.ts/deploy"; | ||
import {AddressZero} from "ethers/constants"; | ||
|
||
const provider = new ethers.providers.JsonRpcProvider(process.env.WEB3_URL); | ||
const governorWallet = ethers.Wallet.fromMnemonic(process.env.MNEMONIC, "m/44'/60'/0'/0/1").connect(provider); | ||
const governanceDeployedContract = new Contract(process.env.GOVERNANCE_ADDR, governanceContractCode.interface, governorWallet); | ||
|
||
async function main() { | ||
let tokenAddress = process.argv[process.argv.length - 1]; | ||
console.log("Adding new ERC20 token to network: ", tokenAddress); | ||
let tx = await governanceDeployedContract.addToken(tokenAddress, {gasLimit: bigNumberify("1000000")}); | ||
console.log("tx hash: ",tx.hash); | ||
let receipt = await tx.wait(); | ||
console.log("status: ", receipt.status); | ||
} | ||
|
||
main(); |
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
contracts_old/bin/contracts_DepositVerificationKey_sol_DepositVerificationKey.abi
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
contracts_old/bin/contracts_DepositVerificationKey_sol_DepositVerificationKey.bin
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
contracts_old/bin/contracts_ExitVerificationKey_sol_ExitVerificationKey.abi
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
contracts_old/bin/contracts_ExitVerificationKey_sol_ExitVerificationKey.bin
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.