Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New release #26

Merged
merged 6 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [2.0.2-dev.1](https://github.com/VenusProtocol/solidity-utilities/compare/v2.0.1...v2.0.2-dev.1) (2024-05-13)


### Bug Fixes

* TimeManagerV5 remove function pointer and add conditional logic ([d3b0ebf](https://github.com/VenusProtocol/solidity-utilities/commit/d3b0ebf3b175b3e14c6783c8c659d09f47b0cf7b))

## [2.0.1](https://github.com/VenusProtocol/solidity-utilities/compare/v2.0.0...v2.0.1) (2024-04-19)


Expand Down
10 changes: 3 additions & 7 deletions contracts/TimeManagerV5.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ contract TimeManagerV5 {
/// @dev Sets true when contract is initialized
bool private isInitialized;

/**
* @dev Retrieves the current slot
* @return Current slot
*/
function() view returns (uint256) private _getCurrentSlot;
/// @notice Deprecated slot for _getCurrentSlot function pointer
bytes32 private __deprecatedSlot1;

/**
* @dev This empty reserved space is put in place to allow future versions to add new
Expand All @@ -32,7 +29,7 @@ contract TimeManagerV5 {
* @return Current block number or block timestamp
*/
function getBlockNumberOrTimestamp() public view returns (uint256) {
return _getCurrentSlot();
return isTimeBased ? _getBlockTimestamp() : _getBlockNumber();
}

/**
Expand All @@ -53,7 +50,6 @@ contract TimeManagerV5 {

isTimeBased = timeBased_;
blocksOrSecondsPerYear = timeBased_ ? SECONDS_PER_YEAR : blocksPerYear_;
_getCurrentSlot = timeBased_ ? _getBlockTimestamp : _getBlockNumber;
isInitialized = true;
}

Expand Down
1 change: 1 addition & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const config: HardhatUserConfig = {
enabled: true,
runs: 200,
},
evmVersion: "paris",
outputSelection: {
"*": {
"*": ["storageLayout"],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@venusprotocol/solidity-utilities",
"version": "2.0.1",
"version": "2.0.2-dev.1",
"description": "Solidity code used by other Venus projects",
"files": [
"artifacts",
Expand Down