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
  • initializeFactory
  • createExchange
  • getExchange
  • getToken
  • getTokenWithId

Was this helpful?

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

Zap

initializeFactory

initializeFactory((template: address));
factoryContract.methods.initializeFactory(template).send();

Parameter

Description

template

Ethereum address of exchange template

createExchange

createExchange(token: address): address
factoryContract.methods.initializeFactory(token).send();

Parameter

Type

Description

token

address

Ethereum address of an ERC20 token

Returns

address

Ethereum address of a Uniswap exchange

getExchange

@constant
getExchange(token: address): address
factoryContract.methods.getExchange(token).call();

Parameter

Type

Description

token

address

Ethereum address of an ERC20 token

Returns

address

Ethereum address of a Uniswap exchange

getToken

@constant
getToken(exchange: address): address
factoryContract.methods.getToken(exchange).call();

Parameter

Type

Description

exchange

address

Ethereum address of a Uniswap exchange

Returns

address

Ethereum address of an ERC20 token

getTokenWithId

@constant
getTokenWithId(token_id: uint256): address
factoryContract.methods.getToken(exchange).call();

Parameter

Type

Description

token_id

uint256

Uniswap ID for an ERC20 token

Returns

address

Ethereum address of an ERC20 token

PreviousiTokenNextSmart Contract Integration

Last updated 4 years ago

Was this helpful?