Implementation of Regulated Token Standard (R-Token) and ERC 1404 with Regulator Service and Service Registry
It's ERC20 compatible token. It will work with any wallet that can interact with ERC20 standard.
Stores permissions for the token. It has similar features to whitelist. Features:
1. Lock the token (disallow all transfers) - in case of emergency or needed transfer freeze to calculate dividents
To lock the token, one needs to call following funcion:
setLocked with following parameters:
_tokenThe address of the token, the RegulatedTokenERC1404 contract_lockedtrueto lock,falseto unlock
2. Forbid partial transfers. Require full token trasnfers only. It disallows to transfer fractions of token.
To allow/disallow partial token transfers, one needs to call following funcion:
setPartialTransfers with following parameters:
_tokenThe address of the token, the RegulatedTokenERC1404 contract_enabledtrueto allow partial transfers,falseto disallow partial transfers
Each user needs to be assigned proper permission by owner/admin before he/she can trade tokens. Permissions are as follows: 1 - Permission for allowing a participant to send tokens 2 - Permission for allowing a participant to receive tokens 3 - Permission for allowing a participant to send and receive tokens
To assign permission, one needs to call the funciton setPermission with following parameters:
_tokenThe address of the token, the RegulatedTokenERC1404 contract_participantThe address of the trade participant_permissionPermission to be set
RegulatedTokenERC1404 stores a reference to a service registry. That registry stores address to RegulatorService that holds all permissions for token. The purpose of registry is to allow update/change of RegulatorService contract in case when we want to use third-party service for transfers validation.
To update RegulatorService one needs to call replaceService function with parameter _service that is address of a contract that implements new RegulatorService service.
- RegulatedTokenERC1404 https://rinkeby.etherscan.io/address/0x09D9e4A7ADe5e7c32623E3794093d09cbc8865f5#code
- RegulatorService https://rinkeby.etherscan.io/address/0xA325ed31365fdbB5E32fcedF36933081184EC74d#code
- ServiceRegistry https://rinkeby.etherscan.io/address/0x5Fd808eb0C513dDE84FE949e73a4b28b0AB5f27b#code
- Video tutorial: https://youtu.be/voRP7OCTMTA
- Open https://www.myetherwallet.com/#contracts and RegulatedTokenERC1404 on https://rinkeby.etherscan.io/address/0x09D9e4A7ADe5e7c32623E3794093d09cbc8865f5#code
- Copy address and ABI to form and click
access
- Choose
mintfunction from dropdown _tois an address (wallet) that token will be minted to_amountis the amount of token minted. Remember to include 18 decimal point zeros. If you want to mint 1 EVK, you need to put number1000000000000000000as_amount- 1 and 18 following zeros, if 1.5 then 15 and 17 following zeros and so on.- Connect the wallet you are using
- Make sure all variables are correct and click
writeand approve transaction on your wallet
- Video tutorial: https://youtu.be/eVizeg9-vZg
- Open https://www.myetherwallet.com/#contracts and RegulatorService on https://rinkeby.etherscan.io/address/0xA325ed31365fdbB5E32fcedF36933081184EC74d#code
- Choose
setPermissionfunction from dropdown _tokenis an address of our token =>0x09D9e4A7ADe5e7c32623E3794093d09cbc8865f5_participantis the address (wallet) we are assigning permissions for_permissionis the permission to be set. ** 1 - Permission for allowing a participant to send tokens ** 2 - Permission for allowing a participant to receive tokens ** 3 - Permission for allowing a participant to send and receive tokens- Connect the wallet you are using
- Make sure all variables are correct and click
writeand approve transaction on your wallet
- Video tutorial: https://youtu.be/g2oNX8F7zqg
- Open https://www.myetherwallet.com/#contracts and RegulatorService on https://rinkeby.etherscan.io/address/0xA325ed31365fdbB5E32fcedF36933081184EC74d#code
- Copy address and ABI to form and click
access
- Choose
setLockedfunction from dropdown _tokenis an address of our token =>0x09D9e4A7ADe5e7c32623E3794093d09cbc8865f5_lockedistrueorfalse. Ittrue, token will be locked, iffalsetoken will be unlocked- Connect the wallet you are using
- Make sure all variables are correct and click
writeand approve transaction on your wallet
- Video tutorial: https://youtu.be/OnG6zPpe75U
- TX hash should be delivered by user, without it we cannot do anything
- Open TX on etherscan and go to
event logstab - Find
CheckStatusevent and look atDatasection. Choosenumberfrom dropbox on first row. It should return a single number. Copy it.
- Open
RegulatorServicecontract on etherscan and clickRead Contracttab. - Find
messageForReasonfunction and paste error code (the number you copided) to_reasoninput. - Click query and read the reason.
- Open https://www.myetherwallet.com/#contracts and RegulatedTokenERC1404 on https://rinkeby.etherscan.io/address/0x09D9e4A7ADe5e7c32623E3794093d09cbc8865f5#code
- Copy address and ABI to form and click
access
- Choose
burnfunction from dropbox - As
_valueput number of tokens you want to burn. Remember about 18 decinal points so if you want to burn 1 EVK, you need to put number1000000000000000000as_value