|
| 1 | +// SPDX-License-Identifier: MIT |
| 2 | +pragma solidity 0.8.17; |
| 3 | + |
| 4 | +/// @title IProtocolRewards |
| 5 | +/// @notice The interface for deposits & withdrawals for Protocol Rewards |
| 6 | +interface IProtocolRewards { |
| 7 | + /// @notice Rewards Deposit Event |
| 8 | + /// @param creator Creator for NFT rewards |
| 9 | + /// @param createReferral Creator referral |
| 10 | + /// @param mintReferral Mint referral user |
| 11 | + /// @param firstMinter First minter reward recipient |
| 12 | + /// @param zora ZORA recipient |
| 13 | + /// @param from The caller of the deposit |
| 14 | + /// @param creatorReward Creator reward amount |
| 15 | + /// @param createReferralReward Creator referral reward |
| 16 | + /// @param mintReferralReward Mint referral amount |
| 17 | + /// @param firstMinterReward First minter reward amount |
| 18 | + /// @param zoraReward ZORA amount |
| 19 | + event RewardsDeposit( |
| 20 | + address indexed creator, |
| 21 | + address indexed createReferral, |
| 22 | + address indexed mintReferral, |
| 23 | + address firstMinter, |
| 24 | + address zora, |
| 25 | + address from, |
| 26 | + uint256 creatorReward, |
| 27 | + uint256 createReferralReward, |
| 28 | + uint256 mintReferralReward, |
| 29 | + uint256 firstMinterReward, |
| 30 | + uint256 zoraReward |
| 31 | + ); |
| 32 | + |
| 33 | + /// @notice Deposit Event |
| 34 | + /// @param from From user |
| 35 | + /// @param to To user (within contract) |
| 36 | + /// @param reason Optional bytes4 reason for indexing |
| 37 | + /// @param amount Amount of deposit |
| 38 | + /// @param comment Optional user comment |
| 39 | + event Deposit(address indexed from, address indexed to, bytes4 indexed reason, uint256 amount, string comment); |
| 40 | + |
| 41 | + /// @notice Withdraw Event |
| 42 | + /// @param from From user |
| 43 | + /// @param to To user (within contract) |
| 44 | + /// @param amount Amount of deposit |
| 45 | + event Withdraw(address indexed from, address indexed to, uint256 amount); |
| 46 | + |
| 47 | + /// @notice Cannot send to address zero |
| 48 | + error ADDRESS_ZERO(); |
| 49 | + |
| 50 | + /// @notice Function argument array length mismatch |
| 51 | + error ARRAY_LENGTH_MISMATCH(); |
| 52 | + |
| 53 | + /// @notice Invalid deposit |
| 54 | + error INVALID_DEPOSIT(); |
| 55 | + |
| 56 | + /// @notice Invalid signature for deposit |
| 57 | + error INVALID_SIGNATURE(); |
| 58 | + |
| 59 | + /// @notice Invalid withdraw |
| 60 | + error INVALID_WITHDRAW(); |
| 61 | + |
| 62 | + /// @notice Signature for withdraw is too old and has expired |
| 63 | + error SIGNATURE_DEADLINE_EXPIRED(); |
| 64 | + |
| 65 | + /// @notice Low-level ETH transfer has failed |
| 66 | + error TRANSFER_FAILED(); |
| 67 | + |
| 68 | + /// @notice Generic function to deposit ETH for a recipient, with an optional comment |
| 69 | + /// @param to Address to deposit to |
| 70 | + /// @param to Reason system reason for deposit (used for indexing) |
| 71 | + /// @param comment Optional comment as reason for deposit |
| 72 | + function deposit(address to, bytes4 why, string calldata comment) external payable; |
| 73 | + |
| 74 | + /// @notice Generic function to deposit ETH for multiple recipients, with an optional comment |
| 75 | + /// @param recipients recipients to send the amount to, array aligns with amounts |
| 76 | + /// @param amounts amounts to send to each recipient, array aligns with recipients |
| 77 | + /// @param reasons optional bytes4 hash for indexing |
| 78 | + /// @param comment Optional comment to include with mint |
| 79 | + function depositBatch(address[] calldata recipients, uint256[] calldata amounts, bytes4[] calldata reasons, string calldata comment) external payable; |
| 80 | + |
| 81 | + /// @notice Used by Zora ERC-721 & ERC-1155 contracts to deposit protocol rewards |
| 82 | + /// @param creator Creator for NFT rewards |
| 83 | + /// @param creatorReward Creator reward amount |
| 84 | + /// @param createReferral Creator referral |
| 85 | + /// @param createReferralReward Creator referral reward |
| 86 | + /// @param mintReferral Mint referral user |
| 87 | + /// @param mintReferralReward Mint referral amount |
| 88 | + /// @param firstMinter First minter reward |
| 89 | + /// @param firstMinterReward First minter reward amount |
| 90 | + /// @param zora ZORA recipient |
| 91 | + /// @param zoraReward ZORA amount |
| 92 | + function depositRewards( |
| 93 | + address creator, |
| 94 | + uint256 creatorReward, |
| 95 | + address createReferral, |
| 96 | + uint256 createReferralReward, |
| 97 | + address mintReferral, |
| 98 | + uint256 mintReferralReward, |
| 99 | + address firstMinter, |
| 100 | + uint256 firstMinterReward, |
| 101 | + address zora, |
| 102 | + uint256 zoraReward |
| 103 | + ) external payable; |
| 104 | + |
| 105 | + /// @notice Withdraw protocol rewards |
| 106 | + /// @param to Withdraws from msg.sender to this address |
| 107 | + /// @param amount amount to withdraw |
| 108 | + function withdraw(address to, uint256 amount) external; |
| 109 | +} |
0 commit comments