Request form
Cookbook may introduce a token in the future. Share and contribute to be eligible for future airdrops.
close icon
ERC20
Token
Deployable

SynthSwap

This contract allows users to swap between different synthetic assets (Synths) on the Synthetix platform. It uses a decentralized exchange mechanism to ensure fair and transparent trading. (autogenerated description)

*Visit desktop site to download or deploy

Last Publish

3/15/2023
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
swapInto(bytes32,bytes) :
supports ETH -> Synth conversions - _data: is the transaction data returned by the 1inch API - _destSynthCurrencyKey: is the bytes32 representation of a Synthetix currency key
swapOutOf(bytes32,uint256,bytes) :
make sure synthetix is approved to spend sourceAmountsupports Synth -> ETH conversions - _data: is the transaction data returned by the 1inch API - _sourceAmount: is the amount of sourceSynth to swap out of - _sourceSynthCurrencyKey: is the bytes32 representation of a Synthetix currency key
uniswapSwapInto(bytes32,address,uint256,bytes) :
supports ETH -> Synth conversions - _amount: is the amout of source token to be swapped - _data: is the transaction data returned by the 1inch API - _destSynthCurrencyKey: is the bytes32 representation of a Synthetix currency key - _sourceTokenAddress: is the address of the source token
uniswapSwapOutOf(bytes32,address,uint256,uint256,bytes) :
make sure synthetix is approved to spend sourceAmountsupports Synth -> ETH conversions - _amountOfSynth: is the amount of sourceSynth to swap out of - _data: is the transaction data returned by the 1inch API - _expectedAmountOfSUSDFromSwap: is expected amount of sUSD to be returned from 1inch portion of swap - _sourceSynthCurrencyKey: is the bytes32 representation of a Synthetix currency key
swapInto(bytes32) :
This function swaps a given token into a specified Synth on Synthetix, using 1inch for the initial swap. (autogenerated documentation)
swapOutOf(bytes32) :
This function swaps a given amount of a Synth for another token using 1inch exchange, and transfers the resulting token to the caller. (autogenerated documentation)
uniswapSwapInto(bytes32,address) :
This function swaps a given amount of a token into a specified Synth on Uniswap, and then transfers the resulting Synth to the caller. (autogenerated documentation)
uniswapSwapOutOf(bytes32,address) :
This function swaps a specified amount of a Synth for another token using Uniswap, and transfers the resulting tokens to the caller. (autogenerated documentation)
rescueFunds(uint256) :
This function transfers a specified amount of tokens to the contract owner's address. It uses the safeTransfer function to ensure secure transfer. (autogenerated documentation)
synthetix() :
This function returns the address of the Synthetix contract using the Address Resolver. (autogenerated documentation)
swapOn1inch(bool) :
This function swaps tokens using the 1inch aggregator, approves token transfer, and returns the amount and destination token. (autogenerated documentation)
swapOnSynthetix(bytes32,bytes32) :
This function swaps a given amount of one Synth currency for another on the Synthetix exchange, using a tracking code and volume rewards. (autogenerated documentation)
proxyForSynth(address) :
This function returns the proxy address for a given synth implementation by calling its "proxy()" function. (autogenerated documentation)

Get Cookin'
share iconShare

copy iconNo-Code Deploy
copy iconDownload Source
copy iconnpx cookbookdev i SynthSwap
copy icon

Bytecode

Download

Verification

Download

Last Publish

3/15/2023

Solidity Compiler

v0.8.4+commit.c7e474f2

Version

1.0.0

Cookbook is free.
Any contract you deploy is yours.
Your contract is owned and controlled by you.