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
  • Proposal breakdown
  • Additional verification
  1. BOB DAO
  2. Governance
  3. Protocol Governance

GP 20: Migrate BOB pool to USDC on Optimism

PreviousGP 19: Accrued Revenue AllocationNextGP 21: BOB inventory reduction

Last updated 1 year ago

The proposal was confirmed and executed.

  • Optimism Safe Transactions and

  • Optimism txs:

    • 16:

    • 17:

Proposal objective

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

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

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

  • Upgrade the pool implementation with the upgradeToAndCall method. The method migrationToUSDC() (selector c4a688b8) is invoked after the upgrade.

  • Configure new Token Seller contract on the pool by setTokenSeller.

  • The remaining two calls invoke setLimits for tier 0 and 1 users. The reinstated 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

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

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

  2. Make sure jq CLI is installed

Transaction in the Safe executes the following calls:

Increase allowance of the pool contract to transfer USDC from Governance Safe by approve made to the USDC token contract .

Remove allowance of the pool contract to transfer USDC from the Governance Safe by approve made to the USDC token contract .

Upgrade the implementation of the direct deposit queue by upgradeTo .

The migration procedure has been verified by using .

To check the safe contract execution run the following script:

πŸ§‘β€πŸ€β€πŸ§‘
#16
#17
https://optimism.blockscout.com/tx/0xf8734380296530c69571251fce0f61451a165e166f4205e967801e7fa86de4f0
https://optimism.blockscout.com/tx/0xc87ce1f36ecff741d76f921f09fed979f9ab0520acc6d30afe2a5964920ec77b
USDC
0x8f4127D3131789a9e2f7380AF903F643d0ae721C
0x9bf586ceB3F3C1bebBE8b0262c2AE7D0952ce3B1
0x48CE9dAb591d737F2fa8955c6283CbcA84A86544
migrationToUSDC()
#16
#17
0x1CA8C2B9B20E18e86d5b9a72370fC6c91814c97C
0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85
0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85
0x15B8C75c024acba8c114C21F42eb515A762c0014
the following Foundry-script
https://gist.github.com/akolotov/9e70b43a75426c8276c061d9176b0968