BOB
  • πŸ‘‹BOB Stablecoin
  • BOB Info
    • πŸ—ΊοΈBOB Ecosystem
      • Mellow Protocol Vaults
    • 🦊MetaMask
      • Swap BOB with Metamask Swap
    • πŸ”BOB Swap
    • πŸ¦„Uniswap v3
    • πŸ™‹β€β™€οΈBOB FAQ
  • BOB CDP
    • ℹ️About
    • πŸ’‘Use Cases
    • πŸ‘¨β€πŸŽ€System actors
    • πŸ“šSystem configurations
    • 🏦Vault health
    • 🏘️User flow examples
    • πŸ‘¨β€πŸ’»Technical docs
      • Position valuation (technical)
      • Liquidations
      • Deployment addresses
      • Smart Contracts
        • NFTVaultRegistry
        • NFTVault
        • UniV3Oracle
        • ChainlinkOracle
        • DebtMinter
        • SurplusMinter
    • πŸ™‹β€β™‚οΈCDP FAQ
  • BOB DAO
    • πŸ§‘β€πŸ€β€πŸ§‘Governance
      • BOB DAO
      • Protocol Governance
        • GP 0: Increase SAFE membership
        • GP 1: Bob Swap beta testing infrastructure
        • GP 2: Upgrade Contracts to v1.0.0
        • GP 3: Enable Bob Swap for Public Use
        • GP 4: Increase Multisig & Upgrade BOB contract on all networks
        • GP 5: Enable Bob Swap on Ethereum Mainnet
        • GP 6: Upgrade zkBob to support direct deposits
        • GP 7: Increase Multi-chain Inventory and Update Bob Swap
        • GP 8: Extend pool limits for KYC'd users
        • GP 9: Deactivate Kyberswap inventory pairs [Emergency Measure]
        • GP 10: Reallocate previous Kyberswap inventory
        • GP 11: Add 24 hour timelock to BOB contract on Optimism
        • GP 12: Raise Polygon limits
        • GP 13: Launch BOB CDP
        • GP 14: Migrate BOB pool to USDC on Polygon
        • GP 15: KYB tiers on Optimism
        • GP 16: Remove excess inventory on Arbitrum and BNB Smart Chain
        • GP 17: Remove excess inventory on Optimism and Ethereum
        • GP 18: Remove excess inventory on Polygon
        • GP 19: Accrued Revenue Allocation
        • GP 20: Migrate BOB pool to USDC on Optimism
        • GP 21: BOB inventory reduction
    • πŸ“‹Inventory
      • Inventory Actions
  • BOB Resources
    • 🧩Visual Assets
    • ⛓️Links
Powered by GitBook
On this page
  • Proposal objective
  • Additional verification
  1. BOB DAO
  2. Governance
  3. Protocol Governance

GP 14: Migrate BOB pool to USDC on Polygon

PreviousGP 13: Launch BOB CDPNextGP 15: KYB tiers on Optimism

Last updated 1 year ago

The proposal was confirmed and executed.

  • Polygon Safe Transactions and

  • Polygon txs:

    • 32:

    • 33:

Proposal objective

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.

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 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:

Tier
Single deposit
Daily user deposit
Daily deposit
Daily withdrawal
Pool size
Single 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

  • 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:

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

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

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

πŸ§‘β€πŸ€β€πŸ§‘
#32
#33
https://polygonscan.com/tx/0xfc792b0693fb6d5951085310d1aa0e1edb6932ceedbeb7a15434f89416778002
https://polygonscan.com/tx/0x7cf8f47d95b7e38eea8c9b2b1110d3ce4602f2936f70cdc44a5fa670923e7d58
USDC
discussed with the community
0x5e93FA8819Bc074C717a92240a1689D1B81aAFcd
0x22299414E9e0E7663f8977a7EA6c1908F2167181
0xDb53D01947252A5bEb488991971D8436AA2828A5
migrationToUSDC()
#32
#33
0x72e6B59D4a90ab232e55D4BB7ed2dD17494D62fB
0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174
0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174
0x668c5286eAD26fAC5fa944887F9D2F20f7DDF289
T
the following Foundry-script
Another script