2.1.0 • Published 2 years ago

artkdev-registration v2.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Registration

The main idea of the ArtKDev-Registration contracts is to introduce an automation to the SignUp registration process.

Navigation

Installation

npm install

Testing

truffle run coverage

Deploy

truffle dashboard
truffle migrate --network dashboard

Admin settings

Setting a new fee amount for registering pool

If you want to set a new fee amount for registering a new pool, you should use a SetFeeAmout() function.

    function SetFeeAmount(uint256 _amount) public;

Testnet tx: link

Setting a new fee token for registering pool

If you want to set a new fee for registering a new pool as a token, you should use a SetFeeToken() function.

function SetFeeToken(address _token) public;

Testnet tx: link

Pool owner settings

Registering a new pool

First of all, you should define the info keys, which users will have to fill with values. In addition, you have to pay a fee, which admin set for creation a new registration pool. Likewise, you can set a fee for registering a new SignUp by user. You should use the CreateNewPool() function to create a new registration pool.

    function CreateNewPool(
        address _token,
        uint256 _fee,
        string[] memory _keys
    ) external payable

Testnet tx: link

Setting a register fee

You should use the SetRegisterFee() function to set a new SignUp fee. If you want to set a register fee token you need to specify a token address otherwise set it a zero address.

    function SetRegisterFee(
        uint256 _poolId,
        address _token,
        uint256 _price
    ) public;

Testnet tx: link

Deactivating a pool

If you deactivate a pool, users won't be able to sign up. To do this, you should use a DeactivatePool() function.

    function DeactivatePool(uint256 _poolId) external;

Testnet tx: link

Activating a pool

If you activate a pool, users will be able to sign up again. To do this, you should use a ActivatePool() function.

    function ActivatePool(uint256 _poolId) external;

Testnet tx: link

User settings

Signing up

Firstly, you need to specify a pool id and values, that will be filled in to the keys. Actually, you need to pay a fee, that pool owner defined for a new SignUp. After that you should use the SignUp() function to register a new SignUp.

    function SignUp(uint256 _poolId, string[] memory _values) external payable;

Testnet tx: link

Getting my pools' ids

Find all of your pool IDs.

    function GetMyPoolIds() external view returns (uint256[] memory);

Getting my SignUps' ids

Find all of your SignUp IDs.

    function GetAllMySignUpIds(uint256 _poolId)
        external
        view
        returns (uint256[] memory);

Getting a pool's sign up fee

Find a pool's signUp fee.

    function GetPoolSignUpFee(uint256 _poolId)
        external
        view
        returns (uint256 fee, address feeToken)
    {

License

ArtKDev Contracts is released under the MIT License.