-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSablierMerkleInstant.sol
61 lines (49 loc) · 4.18 KB
/
SablierMerkleInstant.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.22;
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import { SablierMerkleBase } from "./abstracts/SablierMerkleBase.sol";
import { ISablierMerkleInstant } from "./interfaces/ISablierMerkleInstant.sol";
import { MerkleBase } from "./types/DataTypes.sol";
/*
███████╗ █████╗ ██████╗ ██╗ ██╗███████╗██████╗
██╔════╝██╔══██╗██╔══██╗██║ ██║██╔════╝██╔══██╗
███████╗███████║██████╔╝██║ ██║█████╗ ██████╔╝
╚════██║██╔══██║██╔══██╗██║ ██║██╔══╝ ██╔══██╗
███████║██║ ██║██████╔╝███████╗██║███████╗██║ ██║
╚══════╝╚═╝ ╚═╝╚═════╝ ╚══════╝╚═╝╚══════╝╚═╝ ╚═╝
███╗ ███╗███████╗██████╗ ██╗ ██╗██╗ ███████╗ ██╗███╗ ██╗███████╗████████╗ █████╗ ███╗ ██╗████████╗
████╗ ████║██╔════╝██╔══██╗██║ ██╔╝██║ ██╔════╝ ██║████╗ ██║██╔════╝╚══██╔══╝██╔══██╗████╗ ██║╚══██╔══╝
██╔████╔██║█████╗ ██████╔╝█████╔╝ ██║ █████╗ ██║██╔██╗ ██║███████╗ ██║ ███████║██╔██╗ ██║ ██║
██║╚██╔╝██║██╔══╝ ██╔══██╗██╔═██╗ ██║ ██╔══╝ ██║██║╚██╗██║╚════██║ ██║ ██╔══██║██║╚██╗██║ ██║
██║ ╚═╝ ██║███████╗██║ ██║██║ ██╗███████╗███████╗ ██║██║ ╚████║███████║ ██║ ██║ ██║██║ ╚████║ ██║
╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚══════╝ ╚═╝╚═╝ ╚═══╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝
*/
/// @title SablierMerkleInstant
/// @notice See the documentation in {ISablierMerkleInstant}.
contract SablierMerkleInstant is
ISablierMerkleInstant, // 2 inherited components
SablierMerkleBase // 4 inherited components
{
using SafeERC20 for IERC20;
/*//////////////////////////////////////////////////////////////////////////
CONSTRUCTOR
//////////////////////////////////////////////////////////////////////////*/
/// @dev Constructs the contract by initializing the immutable state variables.
constructor(
MerkleBase.ConstructorParams memory baseParams,
address campaignCreator
)
SablierMerkleBase(baseParams, campaignCreator)
{ }
/*//////////////////////////////////////////////////////////////////////////
INTERNAL NON-CONSTANT FUNCTIONS
//////////////////////////////////////////////////////////////////////////*/
/// @inheritdoc SablierMerkleBase
function _claim(uint256 index, address recipient, uint128 amount) internal override {
// Interaction: withdraw the tokens to the recipient.
TOKEN.safeTransfer(recipient, amount);
// Log the claim.
emit Claim(index, recipient, amount);
}
}