Skip to content

Instantly share code, notes, and snippets.

@mounibec
Last active October 21, 2023 09:08
Show Gist options
  • Save mounibec/69be6621a03974126cf94e44b0174ec9 to your computer and use it in GitHub Desktop.
Save mounibec/69be6621a03974126cf94e44b0174ec9 to your computer and use it in GitHub Desktop.
ParaSwap's AugustusSwapper Interface
pragma solidity 0.5.11;
pragma experimental ABIEncoderV2;
interface IAugustusSwapper {
struct Route {
address payable exchange;
address targetExchange;
uint percent;
bytes payload;
uint256 networkFee;//Network fee is associated with 0xv3 trades
}
struct Path {
address to;
uint256 totalNetworkFee;//Network fee is associated with 0xv3 trades
Route[] routes;
}
function getPartnerRegistry() external view returns(address);
function getWhitelistAddress() external view returns(address);
function getFeeWallet() external view returns(address);
function getTokenTransferProxy() external view returns (address);
function paused() external view returns (bool);
/**
* @dev The function which performs the multi path swap.
* @param fromToken Address of the source token
* @param toToken Address of the destination token
* @param fromAmount Amount of source tokens to be swapped
* @param toAmount Minimum destination token amount expected out of this swap
* @param expectedAmount Expected amount of destination tokens without slippage
* @param path Route to be taken for this swap to take place
* @param mintPrice Price of gas at the time of minting of gas tokens, if any. In wei. 0 means gas token will not be used
* @param beneficiary Beneficiary address
* @param donationPercentage Percentage of returned amount to be transferred to beneficiary, if beneficiary is available. If this is passed as
* 0 then 100% will be transferred to beneficiary. Pass 10000 for 100%
* @param referrer referral id
*/
function multiSwap(
IERC20 fromToken,
IERC20 toToken,
uint256 fromAmount,
uint256 toAmount,
uint256 expectedAmount,
Path[] calldata path,
uint256 mintPrice,
address payable beneficiary,
uint256 donationPercentage,
string calldata referrer
)
external
payable
returns (uint256);
}
@jameshuntt
Copy link

can you help me implement this with an example of implementing this into a smart contract

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment