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 6: Upgrade zkBob to support direct deposits

PreviousGP 5: Enable Bob Swap on Ethereum MainnetNextGP 7: Increase Multi-chain Inventory and Update Bob Swap

Last updated 1 year ago

Direct deposits are subject to the newly introduced limits at the time of submission

  • dailyUserDirectDepositCap - limit on the amount for daily direct deposits submitted by a single user

  • directDepositCap - limit on the amount of a single direct deposit

Each direct deposit is subject to a submission fee at the time of its submission:

  • directDepositFee - direct deposit fee

Each direct deposit left unprocessed by the relayer for a certain amount of time can be refunded in full by the user:

  • directDepositTimeout - configured direct deposit refund timeout

Learn more about Direct Deposit functionality and how to use in our hackathon instructions.

Proposal objective

Upgrade existing zkBob pool with the support for direct deposits using the following configuration:

  1. dailyUserDirectDepositCap - 10,000 BOB (18 decimals)

  2. directDepositCap - 1,000 BOB (18 decimals)

  3. directDepositFee - 0.1 BOB (18 decimals)

  4. directDepositTimeout - 24 hours ↔ 86,400 seconds

The module for direct deposits is deployed in a separate contract . It owner is configured to the governance multisig (). See for verification. The direct deposits module address is hardcoded into the new zkBob pool implementation contract proposed for upgrade.

The upgrade also adds a new snark verifier for direct deposit batch verification -

The snark verifier for transfers is redeployed to reflect changes in the transfer verification snark -

Proposal breakdown

Action 1

Action 2

Cap: 1'000'000 BOB
dailyDepositCap: 300'000 BOB
dailyWithdrawalCap: 100'000 BOB
dailyUserDepositCap: 10'000 BOB
depositCap: 10'000 BOB
dailyUserDirectDepositCap: 10'000 BOB
directDepositCap: 1'000 BOB

The event is emitted with the same value.

Action 3

tvlCap: 1'000'000 BOB
dailyDepositCap: 300'000 BOB
dailyWithdrawalCap: 100'000 BOB
dailyUserDepositCap: 100'000 BOB
depositCap: 100'000 BOB
dailyUserDirectDepositCap: 10'000 BOB
directDepositCap: 1'000 BOB

The event is emitted with the same value.

Additional verification

Configuration of proposed contracts can be checked using the following commands:

$ cast call --rpc-url https://rpc.ankr.com/polygon 0x0eDcE5CAf830c6b845503001D8378b0d4F3b89bB 'pool_id() (uint24)'
0

$ cast call --rpc-url https://rpc.ankr.com/polygon 0x0eDcE5CAf830c6b845503001D8378b0d4F3b89bB 'token() (address)'
0xB0B195aEFA3650A6908f15CdaC7D92F8a5791B0B

$ cast call --rpc-url https://rpc.ankr.com/polygon 0x0eDcE5CAf830c6b845503001D8378b0d4F3b89bB 'direct_deposit_queue() (address)'
0x668c5286eAD26fAC5fa944887F9D2F20f7DDF289

$ cast call --rpc-url https://rpc.ankr.com/polygon 0x0eDcE5CAf830c6b845503001D8378b0d4F3b89bB 'transfer_verifier() (address)'
0xA86C511832eAd78d30ad49711874a9F3a1dfb840

$ cast call --rpc-url https://rpc.ankr.com/polygon 0x0eDcE5CAf830c6b845503001D8378b0d4F3b89bB 'tree_verifier() (address)'
0x82907eAeB25D248dC82033E45b00A3E012Ba2d0D

$ cast call --rpc-url https://rpc.ankr.com/polygon 0x0eDcE5CAf830c6b845503001D8378b0d4F3b89bB 'batch_deposit_verifier() (address)'
0x9a7B4198065efE631a962e737bDfE1f44f2CB3EE


$ cast call --rpc-url https://rpc.ankr.com/polygon 0x668c5286eAD26fAC5fa944887F9D2F20f7DDF289 'pool() (address)'
0x72e6B59D4a90ab232e55D4BB7ed2dD17494D62fB

$ cast call --rpc-url https://rpc.ankr.com/polygon 0x668c5286eAD26fAC5fa944887F9D2F20f7DDF289 'token() (address)'
0xB0B195aEFA3650A6908f15CdaC7D92F8a5791B0B

$ cast call --rpc-url https://rpc.ankr.com/polygon 0x668c5286eAD26fAC5fa944887F9D2F20f7DDF289 'pool_id() (uint24)'
0

$ cast call --rpc-url https://rpc.ankr.com/polygon 0x668c5286eAD26fAC5fa944887F9D2F20f7DDF289 'owner() (address)'
0xd4a3D9Ca00fa1fD8833D560F9217458E61c446d8

$ cast call --rpc-url https://rpc.ankr.com/polygon 0x668c5286eAD26fAC5fa944887F9D2F20f7DDF289 'admin() (address)'
0xd4a3D9Ca00fa1fD8833D560F9217458E61c446d8

$ cast call --rpc-url https://rpc.ankr.com/polygon 0x668c5286eAD26fAC5fa944887F9D2F20f7DDF289 'implementation() (address)'
0x7883cfA8D367c433985fa320B4491489e9D3F6cD

$ cast call --rpc-url https://rpc.ankr.com/polygon 0x668c5286eAD26fAC5fa944887F9D2F20f7DDF289 'directDepositTimeout() (uint256)'
86400

$ cast call --rpc-url https://rpc.ankr.com/polygon 0x668c5286eAD26fAC5fa944887F9D2F20f7DDF289 'directDepositFee() (uint256)'
100000000

The snark verifier for tree updates is left unchanged and is reused from the previous deployment -

The corresponding transaction in the governance safe is . The transaction contains 3 actions:

zkBobPool contract upgrade . The new implementation is applied through the upgradeTo call (the selector is 0x3659cfe6).

setLimits call (the selector is 0xe8fd02e4) from the zkBobPool contract . The method is called to update limits related to direct deposits in tier 0. The current limits for the tier 0 set in the pool contract are:

setLimits call (the selector is 0xe8fd02e4) from the zkBobPool contract . The method is called to update limits related to direct deposits in tier 1. The current limits for the tier 1 set in the pool contract are:

Diff between previous and new implementations of ZkBobPool - (auto-generated by )

πŸ§‘β€πŸ€β€πŸ§‘
0x668c5286eAD26fAC5fa944887F9D2F20f7DDF289
0xd4a3D9Ca00fa1fD8833D560F9217458E61c446d8
Additional verification
0x9a7B4198065efE631a962e737bDfE1f44f2CB3EE
0xA86C511832eAd78d30ad49711874a9F3a1dfb840
0x82907eAeB25D248dC82033E45b00A3E012Ba2d0D
transaction #26
0x72e6B59D4a90ab232e55D4BB7ed2dD17494D62fB
0x0eDcE5CAf830c6b845503001D8378b0d4F3b89bB
0x72e6B59D4a90ab232e55D4BB7ed2dD17494D62fB
0x72e6B59D4a90ab232e55D4BB7ed2dD17494D62fB
https://diffy.org/diff/e74278e64eab5
https://github.com/zkBob/zkbob-contracts/actions/runs/4250762810