Skip to content

Commit 6664c73

Browse files
authored
Merge pull request #20 from threshold-network/checkpoints-followup
Follow-up: Optimize storage of balance checkpoints in T token contract
2 parents 913c04d + 240367c commit 6664c73

File tree

2 files changed

+219
-165
lines changed

2 files changed

+219
-165
lines changed

contracts/governance/Checkpoints.sol

+7
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ abstract contract Checkpoints {
104104
}
105105

106106
/// @notice Change delegation for `delegator` to `delegatee`.
107+
// slither-disable-next-line dead-code
107108
function delegate(address delegator, address delegatee) internal virtual;
108109

109110
/// @notice Moves voting power from one delegate to another
@@ -117,6 +118,8 @@ abstract contract Checkpoints {
117118
) internal {
118119
if (src != dst && amount > 0) {
119120
if (src != address(0)) {
121+
// https://github.com/crytic/slither/issues/960
122+
// slither-disable-next-line variable-scope
120123
(uint256 oldWeight, uint256 newWeight) = writeCheckpoint(
121124
_checkpoints[src],
122125
subtract,
@@ -126,6 +129,8 @@ abstract contract Checkpoints {
126129
}
127130

128131
if (dst != address(0)) {
132+
// https://github.com/crytic/slither/issues/959
133+
// slither-disable-next-line uninitialized-local
129134
(uint256 oldWeight, uint256 newWeight) = writeCheckpoint(
130135
_checkpoints[dst],
131136
add,
@@ -155,6 +160,7 @@ abstract contract Checkpoints {
155160

156161
if (pos > 0) {
157162
uint32 fromBlock = decodeBlockNumber(ckpts[pos - 1]);
163+
// slither-disable-next-line incorrect-equality
158164
if (fromBlock == block.number) {
159165
ckpts[pos - 1] = encodeCheckpoint(
160166
fromBlock,
@@ -214,6 +220,7 @@ abstract contract Checkpoints {
214220
}
215221

216222
/// @notice Maximum token supply. Defaults to `type(uint96).max` (2^96 - 1)
223+
// slither-disable-next-line dead-code
217224
function maxSupply() internal view virtual returns (uint96) {
218225
return type(uint96).max;
219226
}

0 commit comments

Comments
 (0)