Skip to main content

SushiMaker

SushiMaker handles "serving up" rewards for xSUSHI holders by trading tokens collected from fees for SUSHI.

The full contract can be found here.

Functions

bridgeFor

function bridgeFor(address token) public view returns (address bridge)

Checks and returns address for a bridge to use. !!

Parameters

NameTypeDescription
tokenaddressaddress of token you wish to check bridge for

setBridge

function setBridge(address token, address bridge) external onlyOwner

Sets the bridge to use. Can only be called by the owner of the contract. !!

Parameters

NameTypeDescription
tokenaddressaddress of token you wish to bridge
bridgeaddressaddress of token bridge you wish to use

_convert

function _convert(address token0, address token1) internal

Internal function called by convert, which converts tokens to SUSHI for xSUSHI holders. !!

Parameters

NameTypeDescription
token0addressaddress of token you wish to convert
token1addressaddress of token you wish to convert to

convert

function convert(address token0, address token1) external onlyEOA()

Calls the above internal _convert function to convert tokens to SUSHI for xSUSHI holders. !!

Parameters

NameTypeDescription
token0addressaddress of token you wish to convert
token1addressaddress of token you wish to convert to

convertMultiple

function convertMultiple(
address[] calldata token0,
address[] calldata token1
) external onlyEOA()

Allows batch conversion of tokens to SUSHI for xSUSHI holders. !!

Parameters

NameTypeDescription
token0address[]array of addresses of tokens you wish to convert
token1address[]array of addresses of tokens you wish to convert to

_convertStep

 function _convertStep(
address token0,
address token1,
uint256 amount0,
uint256 amount1
) internal returns (uint256 sushiOut)

Private function that calculates and returns the amount of SUSHI to be given after conversion. !!

Parameters

NameTypeDescription
token0addressaddress of token you wish to convert
token1addressaddress of token you wish to convert to
amount0uint256amount of token to convert
amount1uint256amount of token to convert

_swap

function _swap(
address fromToken,
address toToken,
uint256 amountIn,
address to
) internal returns (uint256 amountOut)

Internal function to swap tokens to SUSHI for xSUSHI holders. !!

Parameters

NameTypeDescription
fromTokenaddressaddress of token you wish to convert
toTokenaddressaddress of token you wish to convert to
amountInuint256amount of token to convert
addressToaddressaddress to send converted tokens to

Returns

NameTypeDescription
amountOutuint256amount of tokens converted

_toSUSHI

function _toSUSHI(address token, uint256 amountIn)
internal
returns (uint256 amountOut)

Internal function that converts a given token to SUSHI.

Parameters

NameTypeDescription
tokenaddressaddress of token you wish to convert to SUSHI
amountInuint256amount of tokens to convert to SUSHI

Returns

NameTypeDescription
amountOutuint256amount of SUSHI converted