vault: move Timestamp and TokensPerSecond libraries one level up

This commit is contained in:
Mark Spanbroek 2025-02-26 10:36:04 +01:00
parent 0910c83428
commit ccf91075bf
4 changed files with 5 additions and 5 deletions

View File

@ -43,7 +43,7 @@ function _tokensPerSecondAtMost(
return TokensPerSecond.unwrap(a) <= TokensPerSecond.unwrap(b); return TokensPerSecond.unwrap(a) <= TokensPerSecond.unwrap(b);
} }
library TokenFlows { library Tokens {
/// Calculates how many tokens are accumulated when a token flow is maintained /// Calculates how many tokens are accumulated when a token flow is maintained
/// for a duration of time. /// for a duration of time.
function accumulate( function accumulate(

View File

@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
pragma solidity 0.8.28; pragma solidity 0.8.28;
import "./TokenFlows.sol"; import "../Tokens.sol";
import "./Timestamps.sol"; import "../Timestamps.sol";
/// Used to identify an account. The first 20 bytes consist of the address of /// Used to identify an account. The first 20 bytes consist of the address of
/// the account holder, and the last 12 bytes consist of a discriminator value. /// the account holder, and the last 12 bytes consist of a discriminator value.
@ -38,7 +38,7 @@ struct Flow {
library Accounts { library Accounts {
using Accounts for Account; using Accounts for Account;
using TokenFlows for TokensPerSecond; using Tokens for TokensPerSecond;
using Timestamps for Timestamp; using Timestamps for Timestamp;
/// Creates an account id from the account holder address and a discriminator. /// Creates an account id from the account holder address and a discriminator.

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
pragma solidity 0.8.28; pragma solidity 0.8.28;
import "./Timestamps.sol"; import "../Timestamps.sol";
struct Fund { struct Fund {
/// The time-lock unlocks at this time /// The time-lock unlocks at this time