Skip to content

Commit

Permalink
add addressToUint256 func (#192)
Browse files Browse the repository at this point in the history
* add addressToUint256 func
  • Loading branch information
ilya-korotya authored Nov 21, 2023
1 parent 75185d4 commit 1d6f97e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions contracts/lib/PrimitiveTypeUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,11 @@ library PrimitiveTypeUtils {
) internal pure returns (bytes memory) {
return BytesLib.slice(bys, start, length);
}

/**
* @dev addressToUint256
*/
function addressToUint256(address _addr) internal pure returns (uint256) {
return uint256(uint160(_addr));
}
}
4 changes: 2 additions & 2 deletions contracts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@iden3/contracts",
"description": "Smart Contract library for Solidity",
"version": "1.3.2",
"version": "1.3.3",
"files": [
"**/*.sol",
"/build/contracts/*.json",
Expand Down

0 comments on commit 1d6f97e

Please sign in to comment.