Lossless Protocol
  • Lossless Whitepaper
  • FAQ
  • Technical reference
    • LERC20
      • Audits
    • Vault and Treasury Protection
      • LosslessControllerV2
      • LosslessGuardian
      • StrategyBase
      • TreasuryProtectionStrategy
      • LiquidityProtectionSingleLimitStrategy
      • Deployments
      • Audits
    • Hack Mitigation Protocol
      • Overview
      • How it works
      • Configuration
        • Current Configuration
      • Audits
      • Deployments
      • Smart Contracts
        • Lossless Controller V3
        • Lossless Governance
        • Lossless Reporting
        • Lossless Staking
    • Lossless Controller
      • Deployments
    • Wrapped Tokens
      • Lossless Wrapped Protection
        • Lossless Wrapped ERC20
        • Lossless Wrapped ERC20 Ownable
      • Extensible Wrapped Tokens
        • Lossless Wrapped ERC20 Extensible
        • Lossless Extensions Core
        • Extensions
          • Lossless Core Extension
      • UMA Protocol Integration
        • DAO Voting
      • Kleros Integration
      • Deployments
  • Guides
    • Wrapped Tokens
    • Committee Voting
    • Lossless Vault Protection User Guide
    • How To Use Vault Protection Smart Contracts
    • Lossless Integration Into The Token
      • Custom Token
      • Standard Token
Powered by GitBook
On this page
  • Lossless protected ERC20
  • Lossless Controller
  • Deploying Lossless protected tokens

Was this helpful?

  1. Guides
  2. Lossless Integration Into The Token

Standard Token

Lossless can be integrated to your token code by using Lossless protected ERC20 token.

PreviousCustom Token

Last updated 3 years ago

Was this helpful?

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:

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. totalSupply_ - amount of tokens to be minted

  2. name_ - token title

  3. symbol_ - symbol of a token

  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. 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. 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.

Example of deploying LERC20 using REMIX IDE:

  1. Right-click on the “contracts” folder below “default_workspace”. Select “New file”, call it for example “LERC20.sol”.

  2. Save it by using Ctrl+S on your keyboard.

  3. 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_ - 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. You can find appropriate controller address .

Go to , an IDE will open.

Copy and paste the code from

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”.

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”.

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.

here
https://remix.ethereum.org
https://github.com/Lossless-Cash/lossless-v3/blob/master/contracts/utils/LERC20.sol
lossless-v4/LERC20.sol at master · Lossless-Cash/lossless-v4GitHub
LERC20
lossless-v4/LERC20Burnable.sol at master · Lossless-Cash/lossless-v4GitHub
LERC20Burnable
lossless-v4/LERC20Mintable.sol at master · Lossless-Cash/lossless-v4GitHub
LERC20Mintable
lossless-v4/LERC20MintableBurnable.sol at master · Lossless-Cash/lossless-v4GitHub
LERC20MintableBurnable
Logo
Logo
Logo
Logo