Lossless
Search…
Lossless Integration
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
GitHub
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

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:
  1. 1.
    totalSupply_ - amount of tokens to be minted
  2. 2.
    name_ - token title
  3. 3.
    symbol_ - symbol of a token
  4. 4.
    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.
  5. 5.
    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.
  6. 6.
    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.
  7. 7.
    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.
Chain
Lossless Controller Address
ETH
0xe91D7cEBcE484070fc70777cB04F7e2EfAe31DB4
POLYGON
0x66622e2C1b991983e88132da19b2C31f71009035
BSC
0xDBB5125CEEaf7233768c84A5dF570AeECF0b4634
AVALANCHE
0xe5b5753cFEaD850f7069b05B3A76645Af63A9102
HARMONY (SHARD 0)
0xDBB5125CEEaf7233768c84A5dF570AeECF0b4634

Example of deploying LERC20 using REMIX IDE:

  1. 1.
    Go to https://remix.ethereum.org, an IDE will open.
  2. 2.
    Right-click on the “contracts” folder below “default_workspace”. Select “New file”, call it for example “LERC20.sol”.
  3. 4.
    Save it by using Ctrl+S on your keyboard.
  4. 5.
    Open the “Solidity compiler” by clicking on
    on the left of the screen . We suggest the following settings, select them, left-click “Compile LERC20.sol”.
  5. 6.
    Left-click
    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”.
  6. 7.
    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.
  7. 8.
    Left-click “transact”, confirm the transaction on Metamask. The token will be deployed to the Environment that was selected in the Remix.

Video tutorial:

Lossless Controller on Testnets

Chain
Address
ROPSTEN
0x27fce20D62f1DE73B0Ae1Dc7572F881061692de9
BSC TESTNET
0xC46236F780f1294B2C2a8c3cE5B4d62258dC2619
HARMONY TESTNET (SHARD 0)
0xe91D7cEBcE484070fc70777cB04F7e2EfAe31DB4
MUMBAI (POLYGON TESTNET)
0x29C2541d25091B565c6999f20549EB2c75b7c269
Last modified 2d ago