Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@unique-nft/solidity-interfaces
Advanced tools
Solidity smart contracts and ethers.js/web3 wrappings for Unique network technologies
import {ethers} from 'ethers'
import {Address} from '@unique-nft/utils'
import {
CollectionHelpersFactory,
UniqueNFTFactory,
parseEthersV6TxReceipt,
} from '@unique-nft/solidity-interfaces'
const provider = new ethers.JsonRpcProvider('https://rpc-opal.unique.network')
const wallet = new ethers.Wallet(<Private key>, provider)
console.log(`Going to create a new collection with wallet address ${wallet.address}`)
// or, with browser extension:
// const provider = new ethers.providers.Web3Provider(window.ethereum)
// const wallet = provider.getSigner()
const collectionHelpers = await CollectionHelpersFactory(wallet, ethers) // ethers parameter is optional
//when ethers not provided, it's been asynchronously loaded on demand to reduce package size and TTFP
const txCreateCollection = await (await collectionHelpers.createNFTCollection(
'My Collection', // collection name
'Fancy collection description', // collection description
'MYCL', // token prefix - short, up to 4 letters string
{value: await collectionHelpers.collectionCreationFee()}
)).wait()
const collectionAddress = parseEthersV6TxReceipt(txCreateCollection).events?.CollectionCreated?.collectionId as string
const collectionId = Address.collection.addressToId(collectionAddress)
console.log(`Collection #${collectionId} created (address ${collectionAddress})`)
// make collection ERC721Metadata compatible, to create necessary properties and activate
// corresponding supportsInterface and enable mintWithTokenURI and tokenURI methods
//
// Actually it's optional but if we want to make it compatible with
// common ethereum-world NFT collections, it's better to enable this compatibility.
// anyway, it just improves the collection and doesn't brake or mangle anything.
const txMakeCompatible = await (await collectionHelpers.makeCollectionERC721MetadataCompatible(
collectionAddress,
'' // baseURI
)).wait()
console.log(`Collection #${collectionId} (address ${collectionAddress}) is now ERC721Compatible`)
const collection = await UniqueNFTFactory(collectionAddress, wallet, ethers)
const txMintToken = await (await collection.mintWithTokenURI(
wallet.address,
'ipfs://QmZ8Syn28bEhZJKYeZCxUTM5Ut74ccKKDbQCqk5AuYsEnp'
)).wait()
const parsedMintTx = parseEthersV6TxReceipt(txMintToken)
const tokenId = parsedMintTx.events?.Transfer.tokenId
const owner = parsedMintTx.events?.Transfer.to
const tokenUri = await collection.tokenURI(tokenId)
console.log(`Successfully minted token #${tokenId}, it's URI is: ${tokenUri}. Owner: ${owner}`)
import {...} from '@unique-nft/solidity-interfaces/contracts'
import {...} from '@unique-nft/solidity-interfaces/abi'
Unique interfaces and smart contracts solidity sources:
import {
CollectionHelpers__factory,
ContractHelpers__factory,
UniqueFungible__factory,
UniqueNFT__factory,
UniqueRefungible__factory,
UniqueRefungibleToken__factory,
//typescript types:
CollectionHelpers,
ContractHelpers,
UniqueNFT,
UniqueFungible,
UniqueRefungible,
UniqueRefungibleToken,
} from '@unique-nft/solidity-interfaces/ethers'
import {
CollectionHelpers,
ContractHelpers,
UniqueNFT,
UniqueFungible,
UniqueRefungible,
UniqueRefungibleToken,
} from '@unique-nft/solidity-interfaces/web3'
note: it requires web3.js installed on your own, web3.js is a peer dependency for this project
Interface | Address |
---|---|
collectionHelpers | 0x6C4E9fE1AE37a41E93CEE429e8E1881aBdcbb54F |
contractHelpers | 0x842899ECF380553E8a4de75bF534cdf6fBF64049 |
import {constants} from '@unique-nft/solidity-interfaces'
console.log(constants.STATIC_ADDRESSES.collectionHelpers)
console.log(constants.STATIC_ADDRESSES.contractHelpers)
FAQs
Solidity smart contracts and ethers.js/web3 wrappings for Unique network technologies
We found that @unique-nft/solidity-interfaces demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.