
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@allowlist/dev
Advanced tools
The easiest and most-flexible library for adding Allowlists to Solidity smart contracts.
The easiest and most-flexible library for adding Allowlists to Solidity smart contracts.
For a complete guide on installation and usage, visit https://allowlist.dev.
npm add @allowlist/dev
allowlist gen winners.csv
? Enter your BIP39 mnemonic seed phrase: ...
This will generate an allowlist.json
file in the current directory, and tell you which signer addresses to use:
Generated the following allowlist groups:
Group: 0x12345...
Wallets: 1234
Note - if you need to generate a BIP39 mnemonic, use:
allowlist bip39
Add the mint groups to your contract, and use the allowlist helpers for your mint function.
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import "@allowlist/dev/contracts/AllowList.sol";
import "erc721a/contracts/ERC721A.sol";
contract MyNFT is ERC721A, AllowList {
constructor() ERC721A("My NFT", "NFT") {
_addAllowList(
address(0x12345...), // group address
0.1 ether, // the mint price
1672552800, // start timestamp
1675231200, // end timestamp
1 // max per wallet
);
}
function allowListMint(
address _address,
uint256 _count,
bytes calldata _signature,
uint256 _nonce
)
external
payable
useSignature(_address, _count, _signature, _nonce)
{
_mint(_address, _count);
}
}
Call the mint function from your frontend of choice.
Example with React + wagmi
:
import { useAccount, useContract } from 'wagmi'
import { useSignature } from "@allowlist/dev"
const signatures = require("path/to/allowlist.json")
function MyComponent() {
const contract = useContract({
address: '0x...',
abi: [ /* ... your abi ... */ ]
})
const { address } = useAccount()
const sig = useSignature(address)
const handleMint = () => {
if (!sig) return
const amountToMint = 1 // or mint the full allotment of sig.n
contract
.allowListMint(address, amountToMint, sig.s, sig.n)
.then((tx) => tx.wait())
.then((receipt) => {
console.log("Mint Successful, tx: ", receipt.transactionHash)
})
.catch((err) => {
console.error("Mint Failed", err)
})
}
return <>
<button onClick={handleMint}>Mint</button>
</>
}
FAQs
The easiest and most-flexible library for adding Allowlists to Solidity smart contracts.
The npm package @allowlist/dev receives a total of 1 weekly downloads. As such, @allowlist/dev popularity was classified as not popular.
We found that @allowlist/dev 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.