sinQlarity Docs
  • Developers Documentation
  • INTRODUCTION
    • KEY BENEFITS
    • KEY FEATURES
  • OUR USP's
  • GOALS
  • USE CASES
    • DEFI
    • NFTs
    • GAMING
    • SOCIAL
    • INFRASTRUCTURE
    • GOVERNANCE
    • SECURITY
  • ARCHITECTURE
  • USER FLOW
  • USE CASE FOR CHAINS
  • Getting Started
    • PLATFORM, API & LIBRARY
    • LIBRARY INSTALLATION
    • LIBRARY USAGE
    • HOW TO IMPLEMENT FUNCTIONS
  • CONTRACT DETAILS
    • CROWD FUND
    • DAO
    • DUTCH AUCTION
    • ENGLISH AUCTION
    • ERC-20
    • ERC-20 OPENZEPPLIN
    • ERC-20 SWAP
    • ERC-721
    • ETHER WALLET
    • GAS WHITELIST
    • ICO
    • LIQUIDITY POOL
    • MERKLE PROOF
    • MULTISIG
    • OWNABLE
    • PIGGY BANK
    • STAKING
    • SUBSCRIPTION
    • TIMELOCK
    • TODO
    • UNI-PAYMENT CHANNEL
    • UNISWAP
    • VAULT
    • VOTING
    • WHITELIST
    • CHAINLINK ORACLE
    • BI-DIRECTIONAL PAYMENT
    • AIRDROP
Powered by GitBook
On this page
  • DESCRIPTION
  • FUNCTIONS
  • EXTRA PARAMETERS
  • USES
  1. CONTRACT DETAILS

WHITELIST

DESCRIPTION

The whitelist contract allows users to add their addresses to a whitelist. Only non-whitelisted addresses can be added, and the number of whitelisted addresses cannot exceed the maximum limit. The contract provides a function to add an address to the whitelist and another function to check if an address is already whitelisted. It offers a basic mechanism for managing whitelisted addresses.

FUNCTIONS

  1. addAddressToWhitelist() public: This function allows the sender (caller) to add their address to the whitelist. It performs the following steps:

  • Checks if the sender's address is not already whitelisted.

  • It checks if the maximum number of whitelisted addresses (maxWhitelistedAddresses) has not been reached.

  • Adds the sender's address to the whitelistedAddresses mapping by setting it to true.

  • Increments the numAddressesWhitelisted variable.

  1. checkAddress(address user) public view returns(bool): This function checks whether a given address is whitelisted or not. It takes an address as input and returns a boolean value indicating whether the address is whitelisted (true) or not (false).

  2. numAddressesWhitelisted()

  3. maxWhitelistedAddresses()

EXTRA PARAMETERS

Contract Level: Easy

Utility Tags: Whitelist , Address Whitelist, Access Control

  1. maxWhitelistedAddresses: Integer

USES

  1. Token Sales: A whitelist can be used to ensure that only whitelisted addresses can participate in a token sale or contribute to a crowdfunding campaign.

  2. Restricted Features: Certain features or functionalities of a decentralized application (dApp) can be limited to whitelisted addresses, allowing only authorized users to access or use them.

  3. Membership Systems: Whitelisting addresses can be employed to create membership systems where only whitelisted members can access specific resources, services, or events.

  4. Administrative Actions: The contract can make administrative actions or control over some parts of a system easier by whitelisting certain addresses. For example, it can give authorized participants special rights or privileges.

  5. Compliance and Regulation: Whitelisting can assist in adhering to regulatory requirements by allowing only verified or approved addresses to perform certain activities within a system.

PreviousVOTINGNextCHAINLINK ORACLE

Last updated 1 year ago