Skip to content

Commit

Permalink
delegate function belongs to Checkpoints abstract contract interface
Browse files Browse the repository at this point in the history
  • Loading branch information
cygnusv committed Oct 6, 2021
1 parent 23664a2 commit 9deee60
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions contracts/test/TestStakingCheckpoints.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,10 @@ contract TestStakingCheckpoints is Checkpoints {

tToken.transfer(msg.sender, amount);
}

function delegate(address delegator, address delegatee)
internal
virtual
override
{}
}
6 changes: 5 additions & 1 deletion contracts/token/T.sol
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ contract T is ERC20WithPermit, MisfundRecovery, Checkpoints {
_moveVotingPower(delegates(from), delegates(to), safeAmount);
}

function delegate(address delegator, address delegatee) internal virtual {
function delegate(address delegator, address delegatee)
internal
virtual
override
{
address currentDelegate = delegates(delegator);
uint96 delegatorBalance = SafeCast.toUint96(balanceOf[delegator]);
_delegates[delegator] = delegatee;
Expand Down
3 changes: 1 addition & 2 deletions contracts/utils/Checkpoints.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ abstract contract Checkpoints {
uint256 newBalance
);

//FIXME: Add this as an abstract function of Checkpoints
// function delegate(address delegator, address delegatee) internal virtual;
function delegate(address delegator, address delegatee) internal virtual;

/**
* @dev Get the `pos`-th checkpoint for `account`.
Expand Down

0 comments on commit 9deee60

Please sign in to comment.