mirror of
https://github.com/logos-storage/logos-storage-contracts-eth.git
synced 2026-01-07 15:53:07 +00:00
vault: move Timestamp and TokensPerSecond libraries one level up
This commit is contained in:
parent
0910c83428
commit
ccf91075bf
@ -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(
|
||||||
@ -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.
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user