Skip to content

Commit

Permalink
Added natspec
Browse files Browse the repository at this point in the history
  • Loading branch information
asselstine committed Oct 6, 2021
1 parent bc03760 commit 978431c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion contracts/Ticket.sol
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ contract Ticket is ControlledToken, ITicket {
_delegate(msg.sender, _to);
}

/// @notice Delegates a users chance to another
/// @param _user The user whose balance should be delegated
/// @param _to The delegate
function _delegate(address _user, address _to) internal {
uint256 balance = balanceOf(_user);
address currentDelegate = delegates[_user];
Expand Down Expand Up @@ -281,6 +284,7 @@ contract Ticket is ControlledToken, ITicket {
return averageBalances;
}

// @inheritdoc ERC20
function _beforeTokenTransfer(address _from, address _to, uint256 _amount) internal override {
address _fromDelegate;
if (_from != address(0)) {
Expand Down Expand Up @@ -378,7 +382,8 @@ contract Ticket is ControlledToken, ITicket {
}
}

/// @notice Increases the total supply twab. Should be called anytime
/// @notice Decreases the total supply twab. Should be called anytime a balance moves from delegated to undelegated
/// @param _amount The amount to decrease the total by
function _decreaseTotalSupplyTwab(uint256 _amount) internal {
if (_amount == 0) {
return;
Expand All @@ -402,6 +407,8 @@ contract Ticket is ControlledToken, ITicket {
}
}

/// @notice Increases the total supply twab. Should be called anytime a balance moves from undelegated to delegated
/// @param _amount The amount to increase the total by
function _increaseTotalSupplyTwab(uint256 _amount) internal {
if (_amount == 0) {
return;
Expand Down

0 comments on commit 978431c

Please sign in to comment.