LogoLogo
1.0.0
1.0.0
  • About Saddle
  • Automated Market Makers
  • Saddle Pools
  • Community Pools
  • Layer 2 Guide
  • SDL Token
  • veSDL (vote escrowed) SDL
  • Cross Chain Gauges
  • Governance (SIPs)
  • Saddle Incentives
  • Saddle Protocol Stats
  • Yield Farming Tools
  • Build With Saddle
  • Smart Contract Security
  • Asset Specific Risks
  • Saddle FAQ
  • Glossary
  • How to Flash-loan Assets from Saddle
  • Contract Addresses
  • Solidity Docs
    • StakeableTokenWrapper
    • MathUtils
    • Swap
    • Allowlist
    • SwapUtils
    • OwnerPausable
    • LPToken
    • Interfaces
      • ISwap
      • IAllowlist
      • ISwapV1
      • ISwapGuarded
      • ISwapFlashLoan
      • IMetaSwap
      • IFlashLoanReceiver
    • Helper
      • Test
        • TestSwapReturnValues
      • GenericERC20
      • Multicall
      • Multicall2
      • FlashLoanBorrowerExample
    • Meta
      • MetaSwap
      • MetaSwapDeposit
      • MetaSwapUtils
    • Guarded
      • SwapGuarded
      • SwapUtilsGuarded
      • OwnerPausable
      • LPTokenGuarded
      • Allowlist
    • VirtualSwap
      • Bridge
      • Proxy
      • SynthSwapper
      • Target
Powered by GitBook
On this page
  • Functions:
  • Events:
  • Function constructor(contract IERC20 _stakedToken)
  • Parameters:
  • Function balanceOf(address account) → uint256
  • Parameters:
  • Return Values:
  • Function stake(uint256 amount)
  • Parameters:
  • Function withdraw(uint256 amount)
  • Parameters:
  • Event Staked(address user, uint256 amount)
  • Event Withdrawn(address user, uint256 amount)

Was this helpful?

  1. Solidity Docs

StakeableTokenWrapper

PreviousSolidity DocsNextMathUtils

Last updated 3 years ago

Was this helpful?

A wrapper for an ERC-20 that can be staked and withdrawn.

In this contract, staked tokens don't do anything- instead other contracts can inherit from this one to add functionality. / c

Functions:

Events:

Function constructor(contract IERC20 _stakedToken)

Creates a new StakeableTokenWrapper with given _stakedToken address

Parameters:

  • _stakedToken: address of a token that will be used to stake /

Function balanceOf(address account) → uint256

Read how much account has staked in this contract

Parameters:

  • account: address of an account

Return Values:

  • amount of total staked ERC20(this.stakedToken) by account /

Function stake(uint256 amount)

Stakes given amount in this contract

Parameters:

  • amount: amount of ERC20(this.stakedToken) to stake /

Function withdraw(uint256 amount)

Withdraws given amount from this contract

Parameters:

  • amount: amount of ERC20(this.stakedToken) to withdraw /

Event Staked(address user, uint256 amount)

No description

Event Withdrawn(address user, uint256 amount)

No description

constructor(contract IERC20 _stakedToken)
balanceOf(address account)
stake(uint256 amount)
withdraw(uint256 amount)
Staked(address user, uint256 amount)
Withdrawn(address user, uint256 amount)