2024-01-31 15:04:44 +03:00
|
|
|
// SPDX-License-Identifier: UNLICENSED
|
2024-02-12 12:27:34 +03:00
|
|
|
pragma solidity ^0.8.9;
|
2024-01-31 15:04:44 +03:00
|
|
|
|
|
|
|
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
|
|
|
|
);
|
|
|
|
|
2024-02-10 21:43:54 +03:00
|
|
|
/**
|
|
|
|
* @notice Emits when full airdrop is successfully created.
|
|
|
|
*/
|
|
|
|
event CreateAirdrop(
|
|
|
|
uint256 startTime,
|
|
|
|
uint256 stopTime,
|
|
|
|
uint256 recipientsAmount,
|
|
|
|
uint256 firstStreamId,
|
|
|
|
uint256 lastStreamId
|
|
|
|
);
|
|
|
|
|
2024-01-31 15:04:44 +03:00
|
|
|
/**
|
|
|
|
* @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
|
|
|
|
);
|
|
|
|
|
2024-02-10 21:43:54 +03:00
|
|
|
function createAirdrop(uint256 startTime, uint256 stopTime, address recipientStorage) external returns (bool);
|
2024-01-31 15:04:44 +03:00
|
|
|
|
2024-02-12 12:27:34 +03:00
|
|
|
function withdrawFromStream(uint256 streamId) external returns (bool);
|
2024-01-31 15:04:44 +03:00
|
|
|
|
|
|
|
function cancelStream(uint256 streamId) external returns (bool);
|
|
|
|
}
|