Skip to content

Commit

Permalink
move implementation-specific dev comments to contract
Browse files Browse the repository at this point in the history
  • Loading branch information
trmid committed Oct 31, 2023
1 parent d467a17 commit 70aeccc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 9 additions & 1 deletion src/TwabRewards.sol
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,14 @@ contract TwabRewards is ITwabRewards {

/* ============ External Functions ============ */

/// @inheritdoc ITwabRewards
/**
* @inheritdoc ITwabRewards
* @dev For sake of simplicity, `msg.sender` will be the creator of the promotion.
* @dev `_latestPromotionId` starts at 0 and is incremented by 1 for each new promotion.
* So the first promotion will have id 1, the second 2, etc.
* @dev The transaction will revert if the amount of reward tokens provided is not equal to `_tokensPerEpoch * _numberOfEpochs`.
* This scenario could happen if the token supplied is a fee on transfer one.
*/
function createPromotion(
address _vault,
IERC20 _token,
Expand Down Expand Up @@ -333,6 +340,7 @@ contract TwabRewards is ITwabRewards {
}

/// @inheritdoc ITwabRewards
/// @dev Epoch ids and their boolean values are tightly packed and stored in a uint256, so epoch id starts at 0.
function getCurrentEpochId(uint256 _promotionId) external view override returns (uint256) {
return _getCurrentEpochId(_getPromotion(_promotionId));
}
Expand Down
6 changes: 0 additions & 6 deletions src/interfaces/ITwabRewards.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ struct Promotion {
interface ITwabRewards {
/**
* @notice Creates a new promotion.
* @dev For sake of simplicity, `msg.sender` will be the creator of the promotion.
* @dev `_latestPromotionId` starts at 0 and is incremented by 1 for each new promotion.
* So the first promotion will have id 1, the second 2, etc.
* @dev The transaction will revert if the amount of reward tokens provided is not equal to `_tokensPerEpoch * _numberOfEpochs`.
* This scenario could happen if the token supplied is a fee on transfer one.
* @param vault Address of the vault that the promotion applies to
* @param token Address of the token to be distributed
* @param startTimestamp Timestamp at which the promotion starts
Expand Down Expand Up @@ -105,7 +100,6 @@ interface ITwabRewards {

/**
* @notice Get the current epoch id of a promotion.
* @dev Epoch ids and their boolean values are tightly packed and stored in a uint256, so epoch id starts at 0.
* @param promotionId Id of the promotion to get current epoch for
* @return Current epoch id of the promotion
*/
Expand Down

0 comments on commit 70aeccc

Please sign in to comment.