GP 14: Migrate BOB pool to USDC on Polygon

Proposal objective

This proposal is to replaces the underlying token from BOB to USDC for the zkBob pool on Polygon as discussed with the community.

The migration will replace the zkBob pool implementation to the new contract 0x5e93FA8819Bc074C717a92240a1689D1B81aAFcd and the Direct Deposit Queue implementation to 0x22299414E9e0E7663f8977a7EA6c1908F2167181. To allow further swaps of USDC to MATIC as part of the withdrawal process the Token Seller contract will be replaced by 0xDb53D01947252A5bEb488991971D8436AA2828A5.

All BOB owned by the zkBob pool contract will be swapped to USDC using BobSwap. The amount of BOB tokens paid as fees on BobSwap will be reimbursed with the corresponding amount of USDC from the Governance Safe account. The logic of the tokens swap is defined in the migrationToUSDC() method of the pool.

Proposal breakdown

To avoid undesirable interactions with the zkBob pool before the migration the proposal consists of two steps:

Step 1: Disable direct deposits

Transaction #32 in the Safe on Polygon contains two three setLimits calls to disallow users from transfering tokens directly to the pool by setting limits for tier 0, 1 and 254 to zero for direct deposits. Interim limits are set to the following values:

TierSingle depositDaily user depositDaily depositDaily withdrawalPool sizeSingle DD

Default, id 0

10,000 BOB

10,000 BOB

300,000 BOB

300,000 BOB

2,000,000 BOB

0 BOB

KYC, id 254

20,000 BOB

20,000 BOB

300,000 BOB

300,000 BOB

2,000,000 BOB

0 BOB

Partners, id 1

100,000 BOB

100,000 BOB

300,000 BOB

300,000 BOB

2,000,000 BOB

0 BOB

Step 1 is executed 15 minutes prior to step 2.

Step 2: Migrate the pool from BOB to USDC

Transaction #33 in the Safe executes the following calls:

TierSingle depositDaily user depositDaily depositDaily withdrawalPool sizeSingle DDDaily user DD

Default, id 0

10,000 USDC

10,000 USDC

300,000 USDC

300,000 USDC

2,000,000 USDC

1,000 USDC

10,000 USDC

KYC, id 254

20,000 USDC

20,000 USDC

300,000 USDC

300,000 USDC

2,000,000 USDC

1,000 USDC

10,000 USDC

Partners, id 1

100,000 USDC

100,000 USDC

300,000 USDC

300,000 USDC

2,000,000 USDC

1,000 USDC

10,000 USDC

Additional verification

The migration procedure was verified using the following Foundry-script.

Another script verifies the correctness of the Safe transactions execution. The script could be placed to script/scripts directory of the zkBob contracts repo. The command to run the script is forge script -vvv -rpc-url <https://rpc.ankr.com/polygon> script/scripts/BOBPoolMigrationVerification.s.sol

Last updated