mirror of
https://github.com/status-im/codex-contracts-eth.git
synced 2025-01-31 02:35:36 +00:00
23 lines
569 B
Solidity
23 lines
569 B
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity 0.8.28;
|
|
|
|
import "./Timestamps.sol";
|
|
|
|
type TokensPerSecond is int256;
|
|
|
|
using {_tokensPerSecondNegate as -} for TokensPerSecond global;
|
|
using {_tokensPerSecondEquals as ==} for TokensPerSecond global;
|
|
|
|
function _tokensPerSecondNegate(
|
|
TokensPerSecond rate
|
|
) pure returns (TokensPerSecond) {
|
|
return TokensPerSecond.wrap(-TokensPerSecond.unwrap(rate));
|
|
}
|
|
|
|
function _tokensPerSecondEquals(
|
|
TokensPerSecond a,
|
|
TokensPerSecond b
|
|
) pure returns (bool) {
|
|
return TokensPerSecond.unwrap(a) == TokensPerSecond.unwrap(b);
|
|
}
|