GP 14: Migrate BOB pool to USDC on Polygon
Last updated
Last updated
The proposal was confirmed and executed.
Polygon Safe Transactions and
Polygon txs:
32:
33:
This proposal is to replaces the underlying token from BOB to for the zkBob pool on Polygon as .
The migration will replace the zkBob pool implementation to the new contract and the Direct Deposit Queue implementation to . To allow further swaps of USDC to MATIC as part of the withdrawal process the Token Seller contract will be replaced by .
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 method of the pool.
To avoid undesirable interactions with the zkBob pool before the migration the proposal consists of two steps:
Step 1: Disable direct deposits
Transaction 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:
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
upgrade the pool implementation with upgradeToAndCall
. The method migrationToUSDC()
(selector c4a688b8
) is invoked after the upgrade.
configure new Token Seller contract on the pool using setTokenSeller
.
the remaining three calls invoke setLimits
corresponding to tiers 0, 1 and 254. The recovered limits are:
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
Transaction in the Safe executes the following calls:
increase allowance of the pool contract to transfer USDC from the Governance Safe via theapprove
call to the USDC token contract .
remove allowance of the pool contract to transfer USDC from Governance Safe via the approve
call made to the USDC token contract .
upgrade the implementation of the direct deposit queue using the upgradeTo
call.
he migration procedure was verified using .
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