Skip to content

Commit

Permalink
Update docs in TwabLib.sol
Browse files Browse the repository at this point in the history
Corrected some typos and modified some text for clarity.
  • Loading branch information
bk62 committed May 5, 2022
1 parent e6f2d9d commit 8639b9f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions contracts/libraries/TwabLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import "./ObservationLib.sol";
* @author PoolTogether Inc Team
* @dev Time-Weighted Average Balance Library for ERC20 tokens.
* @notice This TwabLib adds on-chain historical lookups to a user(s) time-weighted average balance.
Each user is mapped to an Account struct containing the TWAB history (ring bufffer) and
Each user is mapped to an Account struct containing the TWAB history (ring buffer) and
ring buffer parameters. Every token.transfer() creates a new TWAB checkpoint. The new TWAB
checkpoint is stored in the circular ring buffer, as either a new checkpoint or rewriting
a previous checkpoint with new parameters. The TwabLib (using existing blocktimes 1block/15sec)
a previous checkpoint with new parameters. The TwabLib (using existing blocktimes of 1block/15sec)
guarantees minimum 7.4 years of search history.
*/
library TwabLib {
Expand All @@ -25,9 +25,9 @@ library TwabLib {
/**
* @notice Sets max ring buffer length in the Account.twabs Observation list.
As users transfer/mint/burn tickets new Observation checkpoints are
recorded. The current max cardinality guarantees a six month minimum,
of historical accurate lookups with current estimates of 1 new block
every 15 seconds - the of course contain a transfer to trigger an
recorded. The current max cardinality guarantees a seven year minimum,
of accurate historical lookups with current estimates of 1 new block
every 15 seconds - assuming each block contains a transfer to trigger an
observation write to storage.
* @dev The user Account.AccountDetails.cardinality parameter can NOT exceed
the max cardinality variable. Preventing "corrupted" ring buffer lookup
Expand Down

0 comments on commit 8639b9f

Please sign in to comment.