Skip to content

Commit

Permalink
Merge pull request #14 from VenusProtocol/develop
Browse files Browse the repository at this point in the history
New release
  • Loading branch information
chechu authored Jan 9, 2024
2 parents 20c2ce5 + 6527120 commit 253f28d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [1.3.0-dev.1](https://github.com/VenusProtocol/solidity-utilities/compare/v1.2.0...v1.3.0-dev.1) (2024-01-09)


### Features

* add function to check for non-zero values ([8e5787b](https://github.com/VenusProtocol/solidity-utilities/commit/8e5787bfe8af37077b6f6a68732a33d0551eac79))

## [1.2.0](https://github.com/VenusProtocol/solidity-utilities/compare/v1.1.0...v1.2.0) (2023-12-27)


Expand Down
12 changes: 12 additions & 0 deletions contracts/validators.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ pragma solidity 0.8.13;
/// @notice Thrown if the supplied address is a zero address where it is not allowed
error ZeroAddressNotAllowed();

/// @notice Thrown if the supplied value is 0 where it is not allowed
error ZeroValueNotAllowed();

/// @notice Checks if the provided address is nonzero, reverts otherwise
/// @param address_ Address to check
/// @custom:error ZeroAddressNotAllowed is thrown if the provided address is a zero address
Expand All @@ -12,3 +15,12 @@ function ensureNonzeroAddress(address address_) pure {
revert ZeroAddressNotAllowed();
}
}

/// @notice Checks if the provided value is nonzero, reverts otherwise
/// @param value_ Value to check
/// @custom:error ZeroValueNotAllowed is thrown if the provided value is 0
function ensureNonzeroValue(uint256 value_) pure {
if (value_ == 0) {
revert ZeroValueNotAllowed();
}
}
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": "1.2.0",
"version": "1.3.0-dev.1",
"description": "Solidity code used by other Venus projects",
"files": [
"artifacts",
Expand Down

0 comments on commit 253f28d

Please sign in to comment.