64 lines
1.8 KiB
Solidity
64 lines
1.8 KiB
Solidity
// SPDX-License-Identifier: UNLICENSED
|
|
pragma solidity ^0.8.9;
|
|
|
|
pragma experimental ABIEncoderV2;
|
|
|
|
import "../libraries/Types.sol";
|
|
|
|
interface ISablierAirdrop {
|
|
/**
|
|
* @notice Emits when a stream is successfully created.
|
|
*/
|
|
event CreateStream(
|
|
uint256 indexed streamId,
|
|
address indexed recipient,
|
|
uint256 deposit,
|
|
uint256 initialLockedBalance,
|
|
uint256 startTime,
|
|
uint256 stopTime
|
|
);
|
|
|
|
/**
|
|
* @notice Emits when full airdrop is successfully created.
|
|
*/
|
|
event CreateAirdrop(
|
|
uint256 startTime,
|
|
uint256 stopTime,
|
|
uint256 recipientsAmount,
|
|
uint256 firstStreamId,
|
|
uint256 lastStreamId
|
|
);
|
|
|
|
/**
|
|
* @notice Emits when the recipient of a stream withdraws a portion or all their pro rata share of the stream.
|
|
*/
|
|
event WithdrawFromStream(uint256 indexed streamId, address indexed recipient, uint256 amount);
|
|
|
|
/**
|
|
* @notice Emits when a stream is successfully cancelled and tokens are transferred back on a pro rata basis.
|
|
*/
|
|
event CancelStream(uint256 indexed streamId, address indexed recipient, uint256 remainingBalance);
|
|
|
|
function balanceOf(uint256 streamId, address who) external view returns (uint256 balance);
|
|
|
|
function getStream(
|
|
uint256 streamId
|
|
)
|
|
external
|
|
view
|
|
returns (
|
|
address recipient,
|
|
uint256 deposit,
|
|
uint256 startTime,
|
|
uint256 stopTime,
|
|
uint256 remainingBalance,
|
|
uint256 ratePerSecond
|
|
);
|
|
|
|
function createAirdrop(uint256 startTime, uint256 stopTime, address recipientStorage) external returns (bool);
|
|
|
|
function withdrawFromStream(uint256 streamId) external returns (bool);
|
|
|
|
function cancelStream(uint256 streamId) external returns (bool);
|
|
}
|