GithubHelp home page GithubHelp logo

sushiswap-stargate-layerzero's Introduction

Summary

This contract allow everyone to swap on sushiswap and to send the result to another chain by using LayerZero and Stargate in one transaction.

This contract has been deployed on multiple network, listed above :

Network Address
Ethereum 0x000000
Polygon https://polygonscan.com/address/0x143240ea3bFEA4B214a85cF0Cb7f99434ee6bAEd
BSC https://bscscan.com/address/0xa6Cd8E46eE700D6DfEAe79e44b5a1493736385Fb
Avalanche https://snowtrace.io/address/0x4aafce8f89ba11fd555a3d2a910bd2fdb2465282
Fantom https://ftmscan.com/address/0xa6Cd8E46eE700D6DfEAe79e44b5a1493736385Fb

Functions

swapThenSend

This function must be used if you want to swap an ERC20 token against USDC, USDT, BUSD ( on BSC ) or STG. The parameters are listed above :

Parameters Value
amount (uint256) The quantity that you want to swap
route (address[]) The route used on sushiswap
minAmount (uint256) The minimum you want to receive
chainID (uint16) The recipient chainID
srcPoolID (uint256) The pool ID used on the current network
dstPoolID (uint256) The pool ID used on the recipient network
target (address) The recipient address
slippageStargate (uint256) The maximum slippage in percentage

chainID, srcPoolID and dstPoolID can be found here : https://stargateprotocol.gitbook.io/stargate/developers/contract-addresses/mainnet

swapNativeThenSend

This function must be used if you want to swap a native token ( Ethereum, Matic..) against USDC, USDT, BUSD ( on BSC ) or STG.

The parameters are listed above :

Parameters Value
amount (uint256) The quantity that you want to swap
route (address[]) The route used on sushiswap
minAmount (uint256) The minimum you want to receive
chainID (uint16) The recipient chainID
srcPoolID (uint256) The pool ID used on the current network
dstPoolID (uint256) The pool ID used on the recipient network
target (address) The recipient address
slippageStargate (uint256) The maximum slippage in percentage

chainID, srcPoolID and dstPoolID can be found here : https://stargateprotocol.gitbook.io/stargate/developers/contract-addresses/mainnet

inCaseIf

Because we are never careful enough, if someone send tokens directly to the contract, the owner has the possibility to send them back by using this function.

Parameters Value
mode (uint256) The mode ( 1: ERC20 token - 2: Native token )
token (address[]) The token to send ( put 0x0000000000000000000000000000000000000001 for native token )
amount (uint256) The quantity to send
recipient (address) Recipient address

Links

sushiswap : https://app.sushi.com/

layerZero : https://layerzero.network/

stargate : https://stargate.finance/

Author

https://twitter.com/BrutalTrade

sushiswap-stargate-layerzero's People

Contributors

goldennaim avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.