Skip to content

Commit

Permalink
Merge #1547
Browse files Browse the repository at this point in the history
1547: Additions for exit-tool descriptions r=Deniallugo a=StanislavBreadless



Co-authored-by: Stanislav Bezkorovainyi <[email protected]>
  • Loading branch information
2 parents fd5c287 + 1d5a6a2 commit 59e6def
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
21 changes: 14 additions & 7 deletions infrastructure/exit-tool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ This tool handles these steps as follows:

## Usage

Prior to the state restoring, application must be initialized
Prior to the state restoring, application must be initialized.

Firstly, you need to create the `volumes/postgres` folder. Then run the initialization script with the following command

```sh
./exit-tool.sh init
Expand Down Expand Up @@ -59,6 +61,9 @@ In this example, we use Rinkeby Ethereum testnet, generate a proof for account w
0x3b48b21a2f4910c04c04de00a23f7c07bf3cb04f and token with ID 0 (Ether), and use the API located at
`http://127.0.0.1:8545`

If during the process you encounter any error with the database, you should reset the database and run the
`./exit-tool init` again.

**Note:** Synchronizing the state will scan a big part of Ethereum blockchain, and that's a lot of work to do. It may
take hours or even days to complete, depending on the size of zkSync blockchain.

Expand Down Expand Up @@ -136,19 +141,21 @@ The last entry (`token_address`) is needed for the [`withdrawPendingBalance`][wd

What user has to do after that:

1. Create transaction for an `exit` method call, sign it and broadcast to register balance to withdraw.
1. Create transaction for an [`performExodus`][pe] method call, sign it and broadcast to register balance to withdraw.
2. Send a transaction which invokes [`withdrawPendingBalance`][wd] method of contract to obtain their funds.

[pe]:
https://github.com/matter-labs/zksync/blob/5f47fe9990ec87e3087d32d083d13e6cab331ff1/contracts/contracts/ZkSync.sol#L574
[wd]: https://github.com/matter-labs/zksync/blob/master/contracts/contracts/ZkSync.sol#L262

## What if I need proofs for multiple tokens

After generating proof, run `./exit-tool.sh continue` with the new token ID. The state is already synchronized at this
moment, so it won't take as long.

## Sending exodus L1 transactions

In case you have the private key for the wallet you want to perform exodus for, you may use
[`perform_exodus`](perform_exodus) script for that matter.

Otherwise, please check your wallet documentation in order to know how to execute arbitrary transactions from it.

## What if I need proofs for multiple tokens

After generating proof, run `./exit-tool.sh continue` with the new token ID. The state is already synchronized at this
moment, so it won't take as long.
4 changes: 3 additions & 1 deletion infrastructure/exit-tool/perform_exodus/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ async function main() {
console.log('performExodus confirmed');

console.log('Sending withdrawPendingBalance transaction');
const withdrawTx = await zkSyncContract.withdrawPendingBalance(owner, tokenAddress, amount);
const withdrawTx = await zkSyncContract.withdrawPendingBalance(owner, tokenAddress, amount, {
gasLimit: 500_000
});
console.log('withdrawPendingBalance sent, waiting for confirmation...');
await withdrawTx.wait();
console.log('withdrawPendingBalance confirmed');
Expand Down

0 comments on commit 59e6def

Please sign in to comment.