Buttonwood
  • Buttonwood Basics
    • Introduction to Buttonwood
    • First Principles
    • FAQ
    • DeFi for Beginners
  • Learn
    • Glossary
    • Elastic Supply Assets
      • ButtonToken
      • UnbuttonToken
    • Tranche
      • Deposit Flow
      • Redemption Flow
    • ButtonZero
      • System Design
      • Lending
      • Borrowing
    • ButtonAuctions
    • ButtonSwap
      • Core Concepts
      • Pool Interactions
  • User Guides
    • ButtonSwap User Guide
      • Create a Pool
      • Swap
      • Add Liquidity
      • Remove Liquidity
    • ButtonZero User Guide
      • Primer
      • Borrow (Sell & Ask)
      • Lend (Buy & Bid)
      • Redemption
    • ButtonAuctions User Guide
      • Join an Auction
        • Redemptions
      • Create an Auction
      • Settle an Auction
      • Note on Rebasing Assets
    • Provide Liquidity on Uniswap
    • Mint Tranches
      • Mint Tranches via Contract
        • Minting AMPL Tranches
        • Minting ETH Tranches
        • Minting WBTC Tranches
        • Bond List
  • Developers
    • Deployed Contracts
      • Ethereum Mainnet
      • Görli Testnet
      • Kovan Testnet
      • Avalanche C-Chain
      • Base Mainnet
      • Arbitrum
      • Optimism
    • Tranche
      • Tranche
      • TrancheFactory
      • Bond
      • BondFactory
      • UniV3LoanRouter
    • Button Wrappers
      • ButtonToken
      • UnbuttonToken
      • ButtonTokenFactory
      • UnbuttonTokenFactory
    • Audits
    • Bug Bounty
  • Additional Resources
    • Apps
    • Github
    • Discord
    • Twitter
    • Website
    • ButtonZero
    • Zero Whitepaper
Powered by GitBook
On this page
  • API Documentation
  • initialize(address underlying_, string name_, string symbol_, uint256 initialRate) (public)
  • mint(uint256 amount) → uint256 (external)
  • mintFor(address to, uint256 amount) → uint256 (external)
  • burn(uint256 amount) → uint256 (external)
  • burnTo(address to, uint256 amount) → uint256 (external)
  • burnAll() → uint256 (external)
  • burnAllTo(address to) → uint256 (external)
  • deposit(uint256 uAmount) → uint256 (external)
  • depositFor(address to, uint256 uAmount) → uint256 (external)
  • withdraw(uint256 uAmount) → uint256 (external)
  • withdrawTo(address to, uint256 uAmount) → uint256 (external)
  • withdrawAll() → uint256 (external)
  • withdrawAllTo(address to) → uint256 (external)
  • totalUnderlying() → uint256 (external)
  • balanceOfUnderlying(address owner) → uint256 (external)
  • underlyingToWrapper(uint256 uAmount) → uint256 (external)
  • wrapperToUnderlying(uint256 amount) → uint256 (external)

Was this helpful?

  1. Developers
  2. Button Wrappers

UnbuttonToken

The UnbuttonToken wraps elastic balance (rebasing) tokens like AMPL, Chai and AAVE's aTokens, to create a fixed balance representation.

The ratio of a user's balance to the total supply represents their share of the total deposit pool.

API Documentation

initialize(address underlying_, string name_, string symbol_, uint256 initialRate) (public)

Initializes the token with the given parameters.

mint(uint256 amount) → uint256 (external)

Mints the given amount of Unbutton tokens for the user. Transfers an equivalent value of underlying tokens from the user to the contract.

mintFor(address to, uint256 amount) → uint256 (external)

Mints the given amount of Unbutton tokens for to. Transfers an equivalent value of underlying tokens from the caller to the contract.

burn(uint256 amount) → uint256 (external)

Burns the given amount of Unbutton tokens from the caller. Transfers an equivalent value of underlying tokens from the contract to the caller.

burnTo(address to, uint256 amount) → uint256 (external)

Burns the given amount of Unbutton tokens from the caller. Transfers an equivalent value of underlying tokens from the contract to to.

burnAll() → uint256 (external)

Burns all Unbutton tokens from the caller. Transfers an equivalent value of underlying tokens from the contract to the caller.

burnAllTo(address to) → uint256 (external)

Burns all Unbutton tokens from the caller. Transfers an equivalent value of underlying tokens from the contract to to.

deposit(uint256 uAmount) → uint256 (external)

Deposit the given number of underlying tokens from the caller to the contract. Mints an equivalent value of Unbutton tokens to the caller.

depositFor(address to, uint256 uAmount) → uint256 (external)

Deposit the given number of underlying tokens from the caller to the contract. Mints an equivalent value of Unbutton tokens to to.

withdraw(uint256 uAmount) → uint256 (external)

Withdraw the given number of underlying tokens from the contract. Transfers an equivalent value of Unbutton tokens from the caller to the contract.

withdrawTo(address to, uint256 uAmount) → uint256 (external)

Withdraw the given number of underlying tokens to to from the contract. Transfers an equivalent value of Unbutton tokens from the caller to the contract.

withdrawAll() → uint256 (external)

Withdraw caller's entire balance of underlying tokens. Transfers an equivalent value of Unbutton tokens from the caller to the contract.

withdrawAllTo(address to) → uint256 (external)

Withdraw caller's entire balance of underlying tokens for to. Transfers an equivalent value of Unbutton tokens from the caller to the contract.

totalUnderlying() → uint256 (external)

The total number of underlying tokens held by the contract.

balanceOfUnderlying(address owner) → uint256 (external)

Returns owner's balance in terms of the underlying token.

underlyingToWrapper(uint256 uAmount) → uint256 (external)

Returns the equivalent value of Unbutton tokens for the given amount of underlying tokens.

wrapperToUnderlying(uint256 amount) → uint256 (external)

Returns the equivalent value of Unbutton tokens for the given amount of underlying tokens.

PreviousButtonTokenNextButtonTokenFactory

Last updated 3 years ago

Was this helpful?