Skip to main content

Sushi Strategies

[WIP]

Overview

Primary Methods

exit

function exit(uint256 balance) external nonpayable returns (int256 amountAdded)

Withdraw all assets in the safest way possible. This shouldn't fail.

Parameters

NameTypeDescription
balanceuint256The amount of tokens the caller thinks it has invested.

Returns

NameTypeDescription
amountAddedint256The delta (+profit or -loss) that occured in contrast to balance.

harvest

function harvest(uint256 balance, address) external nonpayable returns (int256 amountAdded)

Parameters

NameTypeDescription
balanceuint256undefined
_1addressundefined

Returns

NameTypeDescription
amountAddedint256undefined

skim

function skim(uint256) external nonpayable

Parameters

NameTypeDescription
_0uint256undefined

withdraw

function withdraw(uint256 amount) external nonpayable returns (uint256 actualAmount)

Withdraw assets. The returned amount can differ from the requested amount due to rounding.

The actualAmount should be very close to the amount. The difference should NOT be used to report a loss. That's what harvest is for.

Parameters

NameTypeDescription
amountuint256The requested amount the caller wants to withdraw.

Returns

NameTypeDescription
actualAmountuint256The real amount that is withdrawn.

Collecting

_harvestProfit

function _harvestProfit() external view returns (int256)

Returns

NameTypeDescription
_0int256undefined

exit

function exit(uint256 balance) external nonpayable returns (int256 amountAdded)

Withdraw all assets in the safest way possible. This shouldn't fail.

Parameters

NameTypeDescription
balanceuint256The amount of tokens the caller thinks it has invested.

Returns

NameTypeDescription
amountAddedint256The delta (+profit or -loss) that occured in contrast to balance.

harvest

function harvest(uint256 balance, address) external nonpayable returns (int256 amountAdded)

Parameters

NameTypeDescription
balanceuint256undefined
_1addressundefined

Returns

NameTypeDescription
amountAddedint256undefined

setHarvestProfit

function setHarvestProfit(int256 val) external nonpayable

Parameters

NameTypeDescription
valint256undefined

skim

function skim(uint256) external nonpayable

Parameters

NameTypeDescription
_0uint256undefined

withdraw

function withdraw(uint256 amount) external nonpayable returns (uint256 actualAmount)

Withdraw assets. The returned amount can differ from the requested amount due to rounding.

The actualAmount should be very close to the amount. The difference should NOT be used to report a loss. That's what harvest is for.

Parameters

NameTypeDescription
amountuint256The requested amount the caller wants to withdraw.

Returns

NameTypeDescription
actualAmountuint256The real amount that is withdrawn.

exit

function exit(uint256 balance) external nonpayable returns (int256 amountAdded)

Withdraw all assets in the safest way possible. This shouldn't fail.

Parameters

NameTypeDescription
balanceuint256The amount of tokens the caller thinks it has invested.

Returns

NameTypeDescription
amountAddedint256The delta (+profit or -loss) that occured in contrast to balance.

harvest

function harvest(uint256 balance, address) external nonpayable returns (int256 amountAdded)

Harvest any profits made converted to the asset and pass them to the caller.

Parameters

NameTypeDescription
balanceuint256The amount of tokens the caller thinks it has invested.
_1addressundefined

Returns

NameTypeDescription
amountAddedint256The delta (+profit or -loss) that occured in contrast to balance.

owner

function owner() external view returns (address)

Returns

NameTypeDescription
_0addressundefined

pendingOwner

function pendingOwner() external view returns (address)

Returns

NameTypeDescription
_0addressundefined

skim

function skim(uint256 amount) external nonpayable

Send the assets to the Strategy and call skim to invest them.

Parameters

NameTypeDescription
amountuint256The amount of tokens to invest.

transferOwnership

function transferOwnership(address newOwner, bool direct, bool renounce) external nonpayable

Transfers ownership to newOwner. Either directly or claimable by the new pending owner. Can only be invoked by the current owner.

Parameters

NameTypeDescription
newOwneraddressAddress of the new owner.
directboolTrue if newOwner should be set immediately. False if newOwner needs to use claimOwnership.
renounceboolAllows the newOwner to be address(0) if direct and renounce is True. Has no effect otherwise.

withdraw

function withdraw(uint256 amount) external nonpayable returns (uint256 actualAmount)

Withdraw assets. The returned amount can differ from the requested amount due to rounding.

The actualAmount should be very close to the amount. The difference should NOT be used to report a loss. That's what harvest is for.

Parameters

NameTypeDescription
amountuint256The requested amount the caller wants to withdraw.

Returns

NameTypeDescription
actualAmountuint256The real amount that is withdrawn.

Events

OwnershipTransferred

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)

Parameters

NameTypeDescription
previousOwner indexedaddressundefined
newOwner indexedaddressundefined