Skip to main content

Interfaces

Listed below are all of the interfaces used in the aforementioned Furo contracts.

IBentoBoxMinimal

interface IBentoBoxMinimal {
function balanceOf(address, address) external view returns (uint256);

function toShare(
address token,
uint256 amount,
bool roundUp
) external view returns (uint256 share);

function toAmount(
address token,
uint256 share,
bool roundUp
) external view returns (uint256 amount);

function registerProtocol() external;

function deposit(
address token_,
address from,
address to,
uint256 amount,
uint256 share
) external payable returns (uint256 amountOut, uint256 shareOut);

function withdraw(
address token_,
address from,
address to,
uint256 amount,
uint256 share
) external returns (uint256 amountOut, uint256 shareOut);

function transfer(
address token,
address from,
address to,
uint256 share
) external;

function setMasterContractApproval(
address user,
address masterContract,
bool approved,
uint8 v,
bytes32 r,
bytes32 s
) external;
}

Interface for a minimal version of the BentoBox contract; source code can be found here.

IERC20

interface IERC20 {
function totalSupply() external view returns (uint256);

function balanceOf(address account) external view returns (uint256);

function allowance(address owner, address spender)
external
view
returns (uint256);

function approve(address spender, uint256 amount) external returns (bool);

event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);

/// @notice EIP 2612
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
}

Standard ERC20 interface; source code can be found here.

IFuroStream

interface IFuroStream {
function setBentoBoxApproval(
address user,
bool approved,
uint8 v,
bytes32 r,
bytes32 s
) external;

function createStream(
address recipient,
address token,
uint64 startTime,
uint64 endTime,
uint256 amount, /// @dev in token amount and not in shares
bool fromBento
) external payable returns (uint256 streamId, uint256 depositedShares);

function withdrawFromStream(
uint256 streamId,
uint256 sharesToWithdraw,
address withdrawTo,
bool toBentoBox,
bytes memory taskData
) external returns (uint256 recipientBalance, address to);

function cancelStream(uint256 streamId, bool toBentoBox)
external
returns (uint256 senderBalance, uint256 recipientBalance);

function updateSender(uint256 streamId, address sender) external;

function updateStream(
uint256 streamId,
uint128 topUpAmount,
uint64 extendTime,
bool fromBentoBox
) external returns (uint256 depositedShares);

function streamBalanceOf(uint256 streamId)
external
view
returns (uint256 senderBalance, uint256 recipientBalance);

function getStream(uint256 streamId) external view returns (Stream memory);

event CreateStream(
uint256 indexed streamId,
address indexed sender,
address indexed recipient,
address token,
uint256 amount,
uint256 startTime,
uint256 endTime,
bool fromBentoBox
);

event UpdateStream(
uint256 indexed streamId,
uint128 indexed topUpAmount,
uint64 indexed extendTime,
bool fromBentoBox
);

event Withdraw(
uint256 indexed streamId,
uint256 indexed sharesToWithdraw,
address indexed withdrawTo,
address token,
bool toBentoBox
);

event CancelStream(
uint256 indexed streamId,
uint256 indexed senderBalance,
uint256 indexed recipientBalance,
address token,
bool toBentoBox
);

struct Stream {
address sender;
address token;
uint128 depositedShares;
uint128 withdrawnShares;
uint64 startTime;
uint64 endTime;
}
}

Interface for the FuroStream contract; source code can be found here.

IFuroVesting

interface IFuroVesting {
function setBentoBoxApproval(
address user,
bool approved,
uint8 v,
bytes32 r,
bytes32 s
) external;

function createVesting(
IERC20 token,
address recipient,
uint32 start,
uint32 cliffDuration,
uint32 stepDuration,
uint32 steps,
uint128 cliffAmount,
uint128 stepAmount,
bool fromBentoBox
) external payable returns (uint256 depositedShares, uint256 vestId);

function withdraw(
uint256 vestId,
bytes memory taskData,
bool toBentoBox
) external;

function stopVesting(uint256 vestId, bool toBentoBox) external;

function vestBalance(uint256 vestId) external view returns (uint256);

function updateOwner(uint256 vestId, address newOwner) external;

struct Vest {
address owner;
IERC20 token;
uint32 start;
uint32 cliffDuration;
uint32 stepDuration;
uint32 steps;
uint128 cliffAmount;
uint128 stepAmount;
uint128 claimed;
}

event CreateVesting(
uint256 indexed vestId,
IERC20 token,
address indexed owner,
address indexed recipient,
uint32 start,
uint32 cliffDuration,
uint32 stepDuration,
uint32 steps,
uint128 cliffAmount,
uint128 stepAmount,
bool fromBentoBox
);

event Withdraw(
uint256 indexed vestId,
IERC20 indexed token,
uint256 indexed amount,
bool toBentoBox
);

event CancelVesting(
uint256 indexed vestId,
uint256 indexed ownerAmount,
uint256 indexed recipientAmount,
IERC20 token,
bool toBentoBox
);

event LogUpdateOwner(uint256 indexed vestId, address indexed newOwner);
}

Interface for the FuroVesting contract; source code can be found here.

ITasker

interface ITasker {
function onTaskReceived(
bytes calldata data
) external;
}

Interface for the Tasker contract; source code can be found here.