Skip to content

Commit

Permalink
Merge pull request #26 from VenusProtocol/develop
Browse files Browse the repository at this point in the history
New release
  • Loading branch information
chechu authored May 14, 2024
2 parents 4de4101 + dd40f8c commit 0d838c8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
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

0 comments on commit 0d838c8

Please sign in to comment.