Verified contractPartialMIT
RewardsSteward
Address0x2c7f01a1322ce99eeb331d6eb73aff400f11c5cb
- Balance
0 ETH
- Transactions
1
- Compiler
solc 0.8.22
- Same code
Only this contract
Details
- Compiler
- solc 0.8.22+commit.4fc1097e
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- shanghai
- License
- MIT
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 23,126,905
- Creation transaction
- 0x7f9011c44c…f31c41a716
65 files
The source code is large: one file is shown at a time. Choose a file in the list.
- src/finance/RewardsSteward.solmain2.61 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/forge-std/src/Vm.sol116.95 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/access/Ownable.sol3.1 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC1363.sol4.45 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC165.sol192 B
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol181 B
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol2.78 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol9.44 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/Address.sol6.03 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/Context.sol963 B
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/Errors.sol896 B
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol870 B
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/src/contracts/access-control/OwnableWithGuardian.sol1.41 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/src/contracts/access-control/interfaces/IWithGuardian.sol861 B
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/src/contracts/utils/ChainHelpers.sol7.46 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/src/contracts/utils/Rescuable.sol1.11 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/src/contracts/utils/RescuableBase.sol1.04 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/src/contracts/utils/interfaces/IRescuable.sol936 B
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/src/contracts/utils/interfaces/IRescuableBase.sol1.3 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/dependencies/chainlink/AggregatorInterface.sol1.16 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/dependencies/openzeppelin/contracts/IERC20.sol2.57 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/interfaces/IACLManager.sol5.46 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/interfaces/IAToken.sol5.46 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/interfaces/IAaveIncentivesController.sol842 B
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/interfaces/IAaveOracle.sol2.39 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/interfaces/IDefaultInterestRateStrategyV2.sol6.1 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/interfaces/IInitializableAToken.sol2.04 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/interfaces/IPool.sol37.09 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/interfaces/IPoolAddressesProvider.sol8.21 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/interfaces/IPoolConfigurator.sol22.45 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/interfaces/IPoolDataProvider.sol9.49 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/interfaces/IPriceOracleGetter.sol848 B
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/interfaces/IReserveInterestRateStrategy.sol1.12 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/interfaces/IScaledBalanceToken.sol2.74 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/protocol/libraries/helpers/Errors.sol10.66 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/protocol/libraries/types/ConfiguratorInputTypes.sol864 B
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/protocol/libraries/types/DataTypes.sol9.4 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/rewards/interfaces/IRewardsController.sol9.23 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/rewards/interfaces/IRewardsDistributor.sol6.72 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/rewards/interfaces/ITransferStrategyBase.sol1.3 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/rewards/libraries/RewardsDataTypes.sol1.67 KB
- lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/treasury/ICollector.sol6.61 KB
- lib/aave-helpers/lib/aave-address-book/src/AaveV2.sol52.48 KB
- lib/aave-helpers/lib/aave-address-book/src/AaveV3.sol2.06 KB
- lib/aave-helpers/lib/aave-address-book/src/AaveV3Ethereum.sol47.23 KB
- lib/aave-helpers/lib/aave-address-book/src/GovernanceV3.sol856 B
- lib/aave-helpers/lib/aave-address-book/src/GovernanceV3Ethereum.sol3.64 KB
- lib/aave-helpers/lib/aave-address-book/src/governance-v3/Errors.sol9.37 KB
- lib/aave-helpers/lib/aave-address-book/src/governance-v3/IBaseReceiverPortal.sol766 B
- lib/aave-helpers/lib/aave-address-book/src/governance-v3/IDataWarehouse.sol4 KB
- lib/aave-helpers/lib/aave-address-book/src/governance-v3/IExecutor.sol1.51 KB
- lib/aave-helpers/lib/aave-address-book/src/governance-v3/IGovernanceCore.sol19.76 KB
- lib/aave-helpers/lib/aave-address-book/src/governance-v3/IGovernancePowerStrategy.sol1.02 KB
- lib/aave-helpers/lib/aave-address-book/src/governance-v3/IPayloadsControllerCore.sol7.83 KB
- lib/aave-helpers/lib/aave-address-book/src/governance-v3/IVotingMachineWithProofs.sol14.85 KB
- lib/aave-helpers/lib/aave-address-book/src/governance-v3/IVotingPortal.sol3.29 KB
- lib/aave-helpers/lib/aave-address-book/src/governance-v3/IVotingStrategy.sol1.82 KB
- lib/aave-helpers/lib/aave-address-book/src/governance-v3/PayloadsControllerUtils.sol841 B
- lib/aave-helpers/src/CollectorUtils.sol7.3 KB
- lib/aave-helpers/src/interfaces/IChainlinkAggregator.sol683 B
- lib/aave-helpers/src/swaps/AaveSwapper.sol4.75 KB
- lib/aave-helpers/src/swaps/interfaces/IAaveSwapper.sol3.81 KB
- lib/aave-helpers/src/swaps/interfaces/IExpectedOutCalculator.sol381 B
- lib/aave-helpers/src/swaps/interfaces/IMilkman.sol1.47 KB
- src/finance/interfaces/IRewardsSteward.sol1.93 KB
lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/contracts/treasury/ICollector.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import {IERC20} from 'openzeppelin-contracts/contracts/token/ERC20/IERC20.sol';
interface ICollector {
struct Stream {
uint256 deposit;
uint256 ratePerSecond;
uint256 remainingBalance;
uint256 startTime;
uint256 stopTime;
address recipient;
address sender;
address tokenAddress;
bool isEntity;
}
/**
* @dev Withdraw amount exceeds available balance
*/
error BalanceExceeded();
/**
* @dev Deposit smaller than time delta
*/
error DepositSmallerTimeDelta();
/**
* @dev Deposit not multiple of time delta
*/
error DepositNotMultipleTimeDelta();
/**
* @dev Recipient cannot be the contract itself or msg.sender
*/
error InvalidRecipient();
/**
* @dev Start time cannot be before block.timestamp
*/
error InvalidStartTime();
/**
* @dev Stop time must be greater than startTime
*/
error InvalidStopTime();
/**
* @dev Provided address cannot be the zero-address
*/
error InvalidZeroAddress();
/**
* @dev Amount cannot be zero
*/
error InvalidZeroAmount();
/**
* @dev Only caller with FUNDS_ADMIN role can call
*/
error OnlyFundsAdmin();
/**
* @dev Only caller with FUNDS_ADMIN role or stream recipient can call
*/
error OnlyFundsAdminOrRecipient();
/**
* @dev The provided ID does not belong to an existing stream
*/
error StreamDoesNotExist();
/** @notice Emitted when the new stream is created
* @param streamId The identifier of the stream.
* @param sender The address of the collector.
* @param recipient The address towards which the money is streamed.
* @param deposit The amount of money to be streamed.
* @param tokenAddress The ERC20 token to use as streaming currency.
* @param startTime The unix timestamp for when the stream starts.
* @param stopTime The unix timestamp for when the stream stops.
**/
event CreateStream(
uint256 indexed streamId,
address indexed sender,
address indexed recipient,
uint256 deposit,
address tokenAddress,
uint256 startTime,
uint256 stopTime
);
/**
* @notice Emmitted when withdraw happens from the contract to the recipient's account.
* @param streamId The id of the stream to withdraw tokens from.
* @param recipient The address towards which the money is streamed.
* @param amount The amount of tokens to withdraw.
*/
event WithdrawFromStream(uint256 indexed streamId, address indexed recipient, uint256 amount);
/**
* @notice Emmitted when the stream is canceled.
* @param streamId The id of the stream to withdraw tokens from.
* @param sender The address of the collector.
* @param recipient The address towards which the money is streamed.
* @param senderBalance The sender's balance at the moment of cancelling.
* @param recipientBalance The recipient's balance at the moment of cancelling.
*/
event CancelStream(
uint256 indexed streamId,
address indexed sender,
address indexed recipient,
uint256 senderBalance,
uint256 recipientBalance
);
/**
* @notice FUNDS_ADMIN role granted by ACL Manager
**/
function FUNDS_ADMIN_ROLE() external view returns (bytes32);
/** @notice Returns the mock ETH reference address
* @return address The address
**/
function ETH_MOCK_ADDRESS() external pure returns (address);
/**
* @notice Checks if address is funds admin
* @return bool If the address has the funds admin role
**/
function isFundsAdmin(address admin) external view returns (bool);
/**
* @notice Returns the available funds for the given stream id and address.
* @param streamId The id of the stream for which to query the balance.
* @param who The address for which to query the balance.
* @notice Returns the total funds allocated to `who` as uint256.
**/
function balanceOf(uint256 streamId, address who) external view returns (uint256 balance);
/**
* @dev Function for the funds admin to give ERC20 allowance to other parties
* @param token The address of the token to give allowance from
* @param recipient Allowance's recipient
* @param amount Allowance to approve
**/
function approve(IERC20 token, address recipient, uint256 amount) external;
/**
* @notice Function for the funds admin to transfer ERC20 tokens to other parties
* @param token The address of the token to transfer
* @param recipient Transfer's recipient
* @param amount Amount to transfer
**/
function transfer(IERC20 token, address recipient, uint256 amount) external;
/**
* @notice Creates a new stream funded by this contracts itself and paid towards `recipient`.
* @param recipient The address towards which the money is streamed.
* @param deposit The amount of money to be streamed.
* @param tokenAddress The ERC20 token to use as streaming currency.
* @param startTime The unix timestamp for when the stream starts.
* @param stopTime The unix timestamp for when the stream stops.
* @return streamId the uint256 id of the newly created stream.
*/
function createStream(
address recipient,
uint256 deposit,
address tokenAddress,
uint256 startTime,
uint256 stopTime
) external returns (uint256 streamId);
/**
* @notice Returns the stream with all its properties.
* @dev Throws if the id does not point to a valid stream.
* @param streamId The id of the stream to query.
* @notice Returns the stream object.
*/
function getStream(
uint256 streamId
)
external
view
returns (
address sender,
address recipient,
uint256 deposit,
address tokenAddress,
uint256 startTime,
uint256 stopTime,
uint256 remainingBalance,
uint256 ratePerSecond
);
/**
* @notice Withdraws from the contract to the recipient's account.
* @param streamId The id of the stream to withdraw tokens from.
* @param amount The amount of tokens to withdraw.
* @return bool Returns true if successful.
*/
function withdrawFromStream(uint256 streamId, uint256 amount) external returns (bool);
/**
* @notice Cancels the stream and transfers the tokens back on a pro rata basis.
* @param streamId The id of the stream to cancel.
* @return bool Returns true if successful.
*/
function cancelStream(uint256 streamId) external returns (bool);
/**
* @notice Returns the next available stream id
* @return nextStreamId Returns the stream id.
*/
function getNextStreamId() external view returns (uint256);
}
Compiler settingsShow
{
"viaIR": false,
"metadata": {
"appendCBOR": true,
"bytecodeHash": "none",
"useLiteralContent": false
},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "shanghai",
"remappings": [
"aave-address-book/=lib/aave-helpers/lib/aave-address-book/src/",
"aave-helpers/=lib/aave-helpers/",
"aave-v3-origin-tests/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/tests/",
"aave-v3-origin/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/src/",
"ds-test/=lib/aave-helpers/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/aave-helpers/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"forge-std/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/forge-std/src/",
"openzeppelin-contracts-upgradeable/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/",
"solidity-utils/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/src/",
"@openzeppelin/contracts-upgradeable/=lib/aave-helpers/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/contracts/",
"@openzeppelin/contracts/=lib/aave-helpers/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/",
"halmos-cheatcodes/=lib/aave-helpers/lib/aave-address-book/lib/aave-v3-origin/lib/solidity-utils/lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/"
]
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.