Element Protocol Docs
GovernanceCommunityXForum
  • Element Protocol Documentation Portal
  • Getting Started
    • Buying Fixed Rate Assets
    • Earning Variable Rates
    • Providing Liquidity
    • FAQ
    • Glossary
  • Element Protocol
    • Concepts Overview
    • Principal Tokens
      • Use Cases
    • Yield Tokens
      • Use Cases
    • Market Forces
    • Providing Liquidity
    • Element Protocol Smart Contracts
      • Core Protocol Contracts
        • Wrapped Position
        • Tranche
        • Tranche Factory
        • Interest Token
        • User Proxy
      • Integration Contracts
        • Yearn Vault Asset Proxy
      • Custom Balancer Curve
        • Convergent Curve Pool
        • Convergent Curve Pool Factory
  • Developers
    • Public Release Changelog
    • Elf SDK
    • Deployment Guide
    • Security
      • Oracles
    • Github
  • Governance (Council)
    • Council Protocol Overview
      • Voting Vaults and Delegation
      • Governance Steering Council (GSC)
    • Council Protocol Interface
      • Overview
      • Proposals
        • Guide: Voting on a Proposal
      • Delegate
        • Guide: Delegating Voting Power
          • DAO (Social) Proposal Template
          • Protocol (Executable) Proposal Template
    • Element Governance Proposal Framework
      • Guidelines of the Element Governance Proposal Framework (EGPF)
      • Venues For Participating in Governance & Discussion
      • What Governance Controls Today
        • Current Protocol Parameters
        • Current Governance Parameters
      • Current Governance Roles
      • The Governance Process
        • Proposals & Proposal Types
        • The Proposal Process Overview
        • The Proposal Lifecycles
          • DAO (Social) Proposal Lifecycle Breakdown & Criteria
          • Protocol (Executable) Proposal Lifecycle Breakdown & Criteria
        • Off-chain Voting Information (Snapshot)
        • On-chain Voting Information
    • Council Protocol Smart Contracts
      • Core Voting
      • Voting Vaults
        • Locking Vault
        • Vesting Vault
        • Governance Steering Council (GSC) Vault
      • Timelock
      • Treasury
      • Spender
      • Optimistic Grants
      • Optimistic Rewards
      • Simple Proxy
    • Airdrop
      • Storage
      • Guide: Discord ZK Claim Flow
      • History
    • Glossary (Governance)
    • Audits
    • Deployed Contract Addresses
  • ELFIVERSE
    • Guide: Mint Your ELF NFT
  • Community
    • Discord
    • Blog
    • X
    • Telegram Announcements
    • Youtube (Community Calls and Video Guides)
Powered by GitBook
On this page
  • 1. Overview
  • Glossary
  • 2. Contract Details
  • Key Functionality:
  • 3. Key Mechanisms & Concepts
  • 4. Gotchas (Potential source of user error)
  • 5. Failure Modes (Bounds on Operating Conditions & External Risk Factors)

Was this helpful?

  1. Element Protocol
  2. Element Protocol Smart Contracts
  3. Core Protocol Contracts

User Proxy

PreviousInterest TokenNextIntegration Contracts

Last updated 2 years ago

Was this helpful?

  • Contract Name: UserProxy

  • Type/Category: Core/Proxy

  • Associated System Diagram: n/a

  • Contract Source:

1. Overview

The User Proxy is a user convenience contract that consolidates the actions needed to create the principal and interest tokens. It facilitates deposits and withdrawals from and to available tranches.

Glossary

  • Tranche: The contract which locks wrapped Yearn shares and mints yield and principal tokens.

2. Contract Details

Key Functionality:

  • mint: Mints a Principal/Interest token pair from either underlying token or ETH, then returns the tokens to the caller. This function assumes that it already has an allowance for the token in question. This function also accepts an encoded array of permit calls to make prior to minting. This permit call can be used with tokens like USDC and give the contract an allowance before the mint.

  • withdrawWeth: Allows a user to withdraw and unwrap WETH in the same transaction likely quite a bit more expensive than direct unwrapping but useful for those who want to do one transaction instead of two. This function accepts an encoded array of permit calls as well.

Storage: This contract stores the variables needed to derive Tranches, as well as a state variable governing the usability of the contract.

3. Key Mechanisms & Concepts

The User Proxy can be frozen by an authorized address for any reason, it can also be deprecated by the owner. This will completely destroy the contract.

4. Gotchas (Potential source of user error)

A call to withdrawWeth in order to withdraw and unwrap the WETH can be more expensive than a manual withdrawal followed by an unwrapping. The only benefit is that it is conveniently done in a single function.

5. Failure Modes (Bounds on Operating Conditions & External Risk Factors)

If the isFrozen flag is flipped on, the contract will not be able to operate.

https://github.com/delvtech/elf-contracts/blob/main/contracts/UserProxy.sol