YEARN
v2
v2
  • Introduction to Yearn
  • FAQ
  • DeFi Glossary
  • How-To Guides
    • How to Add a Custom Token to MetaMask
    • How To Make a YIP
    • How to Mint yUSD
    • How To Participate in a yVault
    • How to Understand CRV Vote Locking
    • How To Understand yVault ROI
    • How To Withdraw from yEarn and yVaults
  • YFI and yTokens
  • yUSD
  • Products
    • yVaults
      • V2 yVaults
        • Strategies and yVaults available
      • V1 yVaults
    • Earn
    • Zap
    • yInsure
    • yGift
  • R&D
    • yBorrow
    • yLiquidate
    • ySwap
    • yTrade
    • Delegated Funding DAO Vaults
    • StableCredit
  • Developers
    • Naming Conventions
    • Deployed Contracts Registry
    • Code Repositories
    • Integration Guide
    • yVaults Documentation
      • Vaults Overview
      • Vault Interfaces
    • Misc Resources
      • YIP Boilerplate
      • Admin Access Policy
      • Smart Contract API
        • APR
        • iToken
        • Zap
      • Smart Contract Integration
        • 1split
        • aave
        • apr
        • aprmap
        • aprmapwithpool
        • aprwithpool
        • compound
        • curvefi
        • dydx
        • fulcrum
        • imanage
        • interface
        • itoken
        • uniswap
        • uniswapapr
        • uniswaproi
        • ybtc
        • ybusd
        • ycrv
        • ydai
        • ysusd
        • ytusd
        • yusdc
        • yusdt
        • zap
  • Additional Resources
    • Team
    • Github
    • Medium
    • Gov Forum
    • Discord
    • Telegram
    • Reddit
  • Contributors
    • Contribute
    • Contributor Tools
    • Writing Style Guide
Powered by GitBook
On this page
  • IySUSD Interface
  • ERC20 Token Interface

Was this helpful?

  1. Developers
  2. Misc Resources
  3. Smart Contract Integration

ysusd

Contract

ABI

Address

ySUSD

ySUSDv2

IySUSD Interface

// Solidity Interface

interface IySUSD {

  function withdraw(uint256 _shares) external;
  function deposit(uint256 _amount) external;

  function balance() external view returns (uint256);
  function balanceDydx() external view returns (uint256);
  function balanceCompound() external view returns (uint256);
  function balanceCompoundInToken() external view returns (uint256);
  function balanceFulcrumInToken() external view returns (uint256);
  function balanceFulcrum() external view returns (uint256);
  function balanceAave() external view returns (uint256);

  function recommend() external view returns (uint256);
  function rebalance() external;

  function supplyDydx(uint256 amount) external returns(uint);
  function supplyAave(uint amount) external;
  function supplyFulcrum(uint amount) external;
  function supplyCompound(uint amount) external;

  function calcPoolValueInToken() external view returns (uint256);
  function getPricePerFullShare() external view returns (uint256);
}

ERC20 Token Interface

// https://theethereum.wiki/w/index.php/ERC20_Token_Standard
contract ERC20Interface {
    function totalSupply() public view returns (uint);
    function balanceOf(address tokenOwner) public view returns (uint balance);
    function allowance(address tokenOwner, address spender) public view returns (uint remaining);
    function transfer(address to, uint tokens) public returns (bool success);
    function approve(address spender, uint tokens) public returns (bool success);
    function transferFrom(address from, address to, uint tokens) public returns (bool success);
    // optional
    function name() external view returns (string);
    function symbol() external view returns (string);
    function decimals() external view returns (string);

    event Transfer(address indexed from, address indexed to, uint tokens);
    event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
PreviousydaiNextytusd

Last updated 4 years ago

Was this helpful?

JSON
ysusd.iearn.eth
JSON
ysusd.iearn.eth