Lossless can be integrated to your token code by using Lossless protected ERC20 token.
Lossless protected ERC20
Any token can be protected by Lossless just by using our ERC20 standard (LERC20) instead of the traditional ERC20. Code for the LERC20 can be found here:
lossless-v1/LERC20.sol at master · Lossless-Cash/lossless-v1
LERC20 has the same interface and methods as the standard ERC20. The only difference is that before and after calling each of standard ERC20 method it does another call to the Lossless Controller.
Lossless Controller is a smart contract that has logic which allows it to check if the transfer or any other ERC20 method can go through. It has the ability to stop the ERC20 method from executing and also is the central contract for the whole Lossless ecosystem. Single Lossless Controller can be used by multiple tokens.
Deploying Lossless protected tokens
Lossless protected token can be deployed just like any other token, all needs is just a few additional properties.
Deploying it requires these parameters:
totalSupply_ - amount of tokens to be minted
name_ - token title
symbol_ - symbol of a token
admin_ - project owner’s administrative wallet address, this will be used in Lossless governance decision. Token creators should set a wallet that they are planning on using to interact with Lossless protocol.
recoveryAdmin_ - project owner’s wallet that is used to change admin_. Token creators should use multisig for this and keep it as secure as possible as this wallet allows changing the admin wallet.
timelockPeriod_ - timelock period in seconds dedicated for turning Lossless turn off. In case project decides to turn off Lossless they would have to wait for this period after initially proposing to turn the Lossless functionality off. Recommended timelockPeriod_ is 24 hours or 86400 seconds. Any lower timelockPeriod_ will be considered unsafe and will be marked as such in Lossless platform.
lossless_ - Lossless protocol controller address. Should be set to Lossless Controller address. Lossless Controller address is different on different chains. Any other address will not allow the token to function properly. See below.
on the left of the screen . We suggest the following settings, select them, left-click “Compile LERC20.sol”.
to open the “DEPLOY & RUN TRANSACTIONS” prompt. Select “Injected Web3”. Use Metamask to connect the wallet that you would like to deploy the contract from with the Remix IDE. Make sure that the wallet address that you prefer shows up as the “ACCOUNT”.
Select “LERC20 - contracts/LERC20.sol” as “CONTRACT”. Click the
downarrow next to “Deploy” in order to access the parameters of the token. Fill them out, see the section above for more details and the image below for an example.
Left-click “transact”, confirm the transaction on Metamask. The token will be deployed to the Environment that was selected in the Remix.