GP 20: Migrate BOB pool to USDC on Optimism

Proposal objective

Following the successful transition from BOB to USDC on Polygon, this proposal replaces the underlying token from BOB to USDC for the zkBob pool on Optimism.

The migration replaces the zkBob pool implementation to the new contract 0x8f4127D3131789a9e2f7380AF903F643d0ae721C and the Direct Deposit Queue implementation to 0x9bf586ceB3F3C1bebBE8b0262c2AE7D0952ce3B1. To allow further swaps of USDC to ETH as part of withdrawals, the Token Seller contract is replaced by 0x48CE9dAb591d737F2fa8955c6283CbcA84A86544.

During proposal execution all BOB owned by the zkBob pool contract is swapped to USDC using UniswapV3. The amount of BOB tokens paid as fees on Uniswap 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() pool method.

Proposal breakdown

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

Step 1: Disable direct deposits

Transaction #16 in the Safe on Optimism contains two setLimits calls to disallow users to transfer tokens directly to the pool by setting limits for tier 0 and 1 to zero for direct deposits. New interim limits are:

Tier
Single deposit
Daily user deposit
Daily deposit
Daily withdrawal
Pool size
Single DD
Daily user DD

Default, id 0

10,000 BOB

10,000 BOB

300,000 BOB

300,000 BOB

10,000,000 BOB

0 BOB

0 BOB

Partners, id 1

100,000 BOB

100,000 BOB

300,000 BOB

300,000 BOB

10,000,000 BOB

0 BOB

0 BOB

This step is executed 20 minutes prior to step 2.

Step 2: Migrate the pool from BOB to USDC

Transaction #17 in the Safe executes the following calls:

Tier
Single deposit
Daily user deposit
Daily deposit
Daily withdrawal
Pool size
Single DD
Daily user DD

Default, id 0

10,000 USDC

10,000 USDC

300,000 USDC

300,000 USDC

10,000,000 USDC

1,000 USDC

10,000 USDC

Partners, id 1

100,000 USDC

100,000 USDC

300,000 USDC

300,000 USDC

10,000,000 USDC

1,000 USDC

10,000 USDC

Additional verification

The migration procedure has been verified by using the following Foundry-script.

To check the safe contract execution run the following script: https://gist.github.com/akolotov/9e70b43a75426c8276c061d9176b0968

  1. forge test --match-path ./script/scripts/VerifySafeTx_Gov44.t.sol --ffi -vvvv

  2. Make sure jq CLI is installed

Last updated