# artkdev-whitelist

> [![Build Status](https://app.travis-ci.com/artkdev2020/ArtKDev-WhiteList.svg?branch=main)](https://app.travis-ci.com/artkdev2020/ArtKDev-WhiteList) [![codecov](https://codecov.io/gh/artkdev2020/ArtKDev-WhiteList/branch/main/graph/badge.svg?token=HCWPKJCM

Latest version **1.2.3** (published 2022-10-31) · ISC license · 0 weekly downloads

## Install

```sh
npm install artkdev-whitelist
pnpm add artkdev-whitelist
yarn add artkdev-whitelist
bun add artkdev-whitelist
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.3 |
| Published | 2022-10-31 |
| First published | 2022-09-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 12 |
| Unpacked size | 30.6 KB |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| Author | dmytropodelnik |
| Maintainers | dmytropodelnik |

## Links

- npm: https://www.npmjs.com/package/artkdev-whitelist
- Repository: https://github.com/artkdev2020/ArtKDev-WhiteList
- Homepage: https://github.com/artkdev2020/ArtKDev-WhiteList#readme
- Issues: https://github.com/artkdev2020/ArtKDev-WhiteList/issues
- npm.io page: https://npm.io/package/artkdev-whitelist

## Dependencies (12)

- [truffle](https://npm.io/package/truffle.md) 5.5.28
- [bignumber.js](https://npm.io/package/bignumber.js.md) ^9.1.0
- [artkdev-helper](https://npm.io/package/artkdev-helper.md) ^3.0.0
- [babel-polyfill](https://npm.io/package/babel-polyfill.md) ^6.26.0
- [babel-register](https://npm.io/package/babel-register.md) ^6.26.0
- [solidity-coverage](https://npm.io/package/solidity-coverage.md) ^0.7.22
- [truffle-assertions](https://npm.io/package/truffle-assertions.md) ^0.9.2
- [babel-preset-es2015](https://npm.io/package/babel-preset-es2015.md) ^6.24.1
- [ganache-time-traveler](https://npm.io/package/ganache-time-traveler.md) ^1.0.16
- [@openzeppelin/contracts](https://npm.io/package/@openzeppelin/contracts.md) 4.7.3
- [@openzeppelin/test-helpers](https://npm.io/package/@openzeppelin/test-helpers.md) ^0.5.16
- [@truffle/hdwallet-provider](https://npm.io/package/@truffle/hdwallet-provider.md) 2.0.13

## Recent versions

- 1.2.3 (latest) — 2022-10-31
- 1.2.2 — 2022-10-26
- 1.2.0 — 2022-10-10
- 1.1.1 — 2022-10-03
- 1.1.0 — 2022-09-28
- 1.0.3 — 2022-09-26
- 1.0.2 — 2022-09-13
- 1.0.1 — 2022-09-13
- 1.0.0 — 2022-09-12

## README

# ArtKDev-WhiteList

[![Build Status](https://app.travis-ci.com/artkdev2020/ArtKDev-WhiteList.svg?branch=main)](https://app.travis-ci.com/artkdev2020/ArtKDev-WhiteList)
[![codecov](https://codecov.io/gh/artkdev2020/ArtKDev-WhiteList/branch/main/graph/badge.svg?token=HCWPKJCM39)](https://codecov.io/gh/artkdev2020/ArtKDev-WhiteList)
[![CodeFactor](https://www.codefactor.io/repository/github/artkdev2020/artkdev-whitelist/badge)](https://www.codefactor.io/repository/github/artkdev2020/artkdev-whitelist)

Mainnet contract: [link]()<br>
Testnet contract: [link](https://testnet.bscscan.com/address/0x105762e89127b66241DAcF452BD0484d46bC0a6B#code)

The main idea of the ArtKDev-WhiteList contract is to keep the list of addresses with special privileges.

### Navigation

- [Installation](#installation)
- [Admin](#admin-privileges)
- [Creator](#creator)
- [User](#user)
- [License](#license)

#### Installation

```console
npm install
```

#### Testing

```console
truffle run coverage
```

#### Deploy

```console
truffle dashboard
```

```console
truffle migrate --network dashboard
```

## Admin privileges

### Setting a max users' limit

If you want to set a new max users' limit, you should use a SetMaxUsersLimit() function.

```solidity
  function SetMaxUsersLimit(uint256 _limit) external;
```

Testnet tx: [link](https://testnet.bscscan.com/tx/0xd4d6a61b5a3db19e13da6bda228d48b352a7e9d6d7b9b375dca85c31233cf9bf)

### Setting a whitelist cost

If you want to set a new whitelist cost, you should use a SetWhiteListCost() function.

```solidity
  function SetWhiteListCost(uint256 _newCost) external;
```

Testnet tx: [link](https://testnet.bscscan.com/tx/0x8144a96a7b9be5f54bb6647efc8b303b163e2190f4e1fc36741cdcb6a9bce94d)


### Withdrawing ETH fee

If you want to withdraw fee in ETH, you should use a WithdrawETHFee() function.

```solidity
  function WithdrawETHFee(address payable _to) external;
```

Testnet tx: [link](https://testnet.bscscan.com/tx/0xe808057ecf8de7e5fa0b0b18e7ec7ab29ac14a1d748e588525ccc44652a02781)

## Creator 

### Changing a creator

<pre><b>ATTENTION!
You can change a previous creator to new only if it is still time to edit.</b></pre>

If you want to set a new creator, you should use a ChangeCreator() function.

```solidity
  function ChangeCreator(address _newCreator, uint256 _id) external;
```

Testnet tx: [link](https://testnet.bscscan.com/tx/0x01c948b24606817b0f7d1bab7e9a383aee27aaa9ea30a233e5442e44c3f62df3)

### Changing a contract

<pre><b>ATTENTION!
You can change a previous contract to new only if it is still time to edit.</b></pre>

If you want to set a new contract, you should use a ChangeContract() function.

```solidity
  function ChangeContract(address _newContract, uint256 _id) external;
```

Testnet tx: [link](https://testnet.bscscan.com/tx/0xa59a3ea1a5b87509be86f74f88627c572fe4f0d2e023500f34f30d4715d3afef)

### Adding an address

<pre><b>ATTENTION!
You can add a new address with new users only if the users' array is not overflown of a max user limit.</b></pre>

If you want to add a new address, you should use a AddAddress() function.

```solidity
  function AddAddress(
        address[] calldata _users,
        uint256[] calldata _amount,
        uint256 _id
    ) external;
```

Testnet tx: [link](https://testnet.bscscan.com/tx/0x427c43f16b5a12bb4a76e4da7a46b56235be4d31a117077f4726752b936170a2)

### Removing an address

<pre><b>ATTENTION!
You can remove an address only if the users' array is not overflown of a max user limit.</b></pre>

If you want to remove an address, you should use a RemoveAddress() function.

```solidity
  function RemoveAddress(address[] calldata _users, uint256 _id) external;
```

Testnet tx: [link](https://testnet.bscscan.com/tx/0x511643ad4f4bdcae211500ef196919c8f2878b6afbef90d771a24d915a85eead)

## User 

### Creating a whitelist manually

<pre><b>ATTENTION!
You can create a new whitelist manually only if you pay the fee if it is set.</b></pre>

If you want to create a new whitelist manually, you should use a CreateManualWhiteList() function.

```solidity
      function CreateManualWhiteList(address _contract, uint256 _changeUntil)
        external
        payable
        returns (uint256 Id);
```

Testnet tx: [link](https://testnet.bscscan.com/tx/0x3478bd92b143db0898f2046595b9a8e58f2c597a5f4cc1556feb87e731ef6a88)

### Creating a whitelist manually

<pre><b>ATTENTION!
Only the contract of the whitelist can call this function.</b></pre>

If you want to register, you should use a Register() function.

```solidity
function Register(
        address _subject,
        uint256 _id,
        uint256 _amount
    ) external;
```

Testnet tx: [link](https://testnet.bscscan.com/tx/0x6c5b4cd1652d8a970b9063eae716d731e92dc88f86ff398569ed42b2d7ab7436)

### Creating a whitelist manually

<pre><b>ATTENTION!
Only the contract of the whitelist can call this function.</b></pre>

If you want to register with max amount, you should use a LastRoundRegister() function.

```solidity
  function LastRoundRegister(address _subject, uint256 _id) external;
```

Testnet tx: [link](https://testnet.bscscan.com/tx/0xbefe5d763f7f1b696c7d12ff7a9c9186fc6631321d8e21a34cf40a9b5e3b66a8)

## License

ArtKDev's contracts is released under the MIT License.

---
_Source: https://npm.io/package/artkdev-whitelist · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
