Skip to main content

SushiMakerKashi

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

The full contract can be found here.

Functions

setBridge

function setBridge(address token, address bridge) external onlyOwner

Sets the bridge for the given token and bridge addresses. 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(IKashiWithdrawFee kashiPair) external onlyEOA

Calls the private _convert function which converts the given Kashi Pair into Bento shares, then into the underlying Kashi asset.

Parameters

NameTypeDescription
kashiPairIKashiWithdrawFeekashi pair to convert

convertMultiple

function convertMultiple(IKashiWithdrawFee[] calldata kashiPair) external onlyEOA

Calls the private _convert function which converts the given Kashi Pairs into Bento shares, then into the underlying Kashi assets.

Parameters

NameTypeDescription
kashiPairIKashiWithdrawFee[]array of kashi pairs to convert

_convert

function _convert(IKashiWithdrawFee kashiPair) private

Private function used in convert and convertMultiple which converts the given Kashi Pair into Bento shares, then into the underlying Kashi asset.

Parameters

NameTypeDescription
kashiPairIKashiWithdrawFeekashi pair to convert

_convertStep

function _convertStep(address token0, uint256 amount0) private 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
amount0uint256amount of token to convert

Returns

NameTypeDescription
sushiOutuint256amount of SUSHI after conversion

_swap

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

Private function that swaps the tokens with the bridge and returns the amount of the new token. !!

Parameters

NameTypeDescription
fromTokenaddressaddress of token you wish to bridge
toTokenaddressaddress of token you wish to swap to
amountInuint256amount of token to swap
toaddressaddress of token bridge you wish to use

Returns

NameTypeDescription
amountOutuint256amount of toToken after conversion from fromToken