[OLD] Instadapp Docs
  • Introduction
  • DeFi Smart Account (DSA)
  • DSA SDK
    • Running Instadapp SDK
  • πŸ’»Instadapp GUI
    • Integrated Protocols
      • Aave
      • Compound Finance
      • MakerDAO
    • Strategies
    • Multi-Protocol Refinancing
    • Authorities
    • Debt Collateral Ratio
  • πŸ‘©β€πŸ’» DSA SDK
    • Casting Spells
    • Build a Connector
    • Connectors
      • Basic
      • Authority
      • Instapool
      • MakerDAO
      • Compound
      • Comp
      • Aave
      • dYdX
      • 1Inch
      • Uniswap
      • OasisDEX
      • Kyber
      • Curve sBTC
      • Curve sUSD
      • Curve yUSD
    • Resolvers
      • Accounts
      • Balances
      • Instapool
      • MakerDAO
      • Compound
      • Aave
      • dYdX
      • 1inch
      • Uniswap
      • OasisDex
      • Kyber
      • Curve sBTC
      • Curve sUSD
      • Curve yUSD
    • getId/setId
    • Example Use Cases
      • Long ETH
      • Short DAI
      • Debt Swap
      • Lending Bridge
      • Lending Swap
      • Debt Bridge
  • πŸ‘©β€πŸ« Tutorials
    • Getting Started
    • Moving Assets into DSA
    • In-App Swaps
  • Additional Info
    • Contract Infomation
    • FAQs
    • Security Audits
    • Release History
  • 🌏Links
    • Homepage
    • DApp
    • Discord
    • Contact Us
Powered by GitBook
On this page
  • Add Custom Connectors
  • Requirements
  1. πŸ‘©β€πŸ’» DSA SDK

Build a Connector

Add Custom Connectors

  1. Fork and clone it

  2. Create a feature branch: git checkout -b new-connector

  3. Add the connector solidity file to contracts/connectors

  4. Commit changes: git commit -am 'Added a connector'

  5. Push to the remote branch: git push origin new-connector

  6. Create a new Pull Request.

Requirements

Be sure to comply with the requirements while building connectors for better compatibility.

  • Import common files from contracts/common directory.

  • The contracts should not have selfdestruct().

  • The contracts should not have delegatecall().

  • Use uint(-1) for maximum amount everywhere.

  • Use getEthAddr() to denote Ethereum (non-ERC20).

  • Use address(this) instead of msg.sender for fetching balance on-chain, etc.

  • Only approve() limited amount while giving ERC20 allowance, which strictly needs to be 0 by the end of the spell.

  • Use getId() for getting value that saved from previous spell.

  • Use setId() for setting value to save for the future spell.

PreviousCasting SpellsNextConnectors

Last updated 4 years ago