Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
This library types Ethereum strings strictly using Solidity types. With this library, you can explicitly prevent to convert uint256 types to address or bytes20.
yarn add soltypes
import { Bytes32, Uint256, Uint32, Address } from 'soltypes'
> new Bytes32('0x1111111111111111111111111111111111111111111111111111111111111111')
// OK
> Bytes32.from('0x1111111111111111111111111111111111111111111111111111111111111111')
// OK
> Bytes32.from('1111111111111111111111111111111111111111111111111111111111111111')
// ERROR - does not start with 0x
> Bytes32.from('0x111111111111111')
// ERROR - bytes length is not 32
> const hash = new Bytes32('0x1111111111111111111111111111111111111111111111111111111111111111')
> hash.toString()
'0x1111111111111111111111111111111111111111111111111111111111111111'
// returns 0x string
> hash.toUint256().toString()
'7719472615821079694904732333912527190217998977709370935963838933860875309329'
// returns number string
> Uint32.from('11111')
// OK
> Uint32.from('0x1111111')
// ERROR - should not start with 0x
> Uint32.from('111111111111111111111111')
// ERROR - overflow
> const uintA = Uint256('1234')
> uintA.toBytes32().toString()
'0x00000000000000000000000000000000000000000000000000000000000004d2'
// returns 0x string
> Address.from('0x1234343434343434343434343434343434343434')
// OK
> Address.from('0xabcd1234')
// FAILs
FAQs
Typescript wrapped Solidity types w/ @ethersproject/bignumber
The npm package soltypes receives a total of 701 weekly downloads. As such, soltypes popularity was classified as not popular.
We found that soltypes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.