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
  • Overview
  • Workflow
  • Variables
  • Functions

Was this helpful?

  1. Technical reference
  2. Wrapped Tokens
  3. Extensible Wrapped Tokens

Lossless Wrapped ERC20 Extensible

PreviousExtensible Wrapped TokensNextLossless Extensions Core

Last updated 2 years ago

Was this helpful?

Overview

The smart contract is one of the types of wrapping a protocol is able to choose.

This particular smart contract provides a base to be able to extend its logic by registering . The contract itself, when launched, doesn’t provide any type of protection. Only the logic required to add extensions is provided.

Lossless will provide a set of extensions for the protocol to chose in the . The is the most popular one as it add Lossless Core Protocol protection to the wrapped token. Nonetheless, other extensions such as Aegis Extension and Rugpull prevention are provided. They can also be taken as an example for the protocol to write and deploy their own extensions.

Once the protocol choses, or writes their own, extension it has to be deployed to the blockchain. When the deployment process is done, first the admin can register the extension by using the registerExtension function. As a second step, the admin has to interact from the extension itself with the wrapped token in order to configure what type of extension it is. For example, the Lossless Core Extension will provide before and after transfer logic, so the function setBeforeTransfer must be called.

In this scenario, when a transfer takes place, the lwERC20 Extensible will check if there is a transfer base set and if that’s true it will divert the first part of the call to the extension. Effectively applying the logic written in the extension.

Extra logic can be added via extensions for the following scenarios:

  • Before Transfer

  • After Transfer

  • Before Mint

  • After Mint

  • Before Burn

  • After Burn

Workflow

Variables

admin

Type

address

Visibility

public

Description

Address of the admin.

underlying

Type

IERC20

Visibility

public immutable

Description

Address of the underlying token allowed for wrapping.

Functions

supportsInterface

Type

external view

Restrictions

-

Parameters

bytes4

Returns

bool

Description

Returns true if the smart contract supports an interface ID.

registerExtension

Type

external

Restrictions

Only Admin

Parameters

address

Returns

-

Description

Registers an extension to be used by the lwERC20

unregisterExtension

Type

external

Restrictions

Only Admin

Parameters

address

Returns

-

Description

Removes an extension to be used by the lwERC20

Lossless Wrapped ERC20 Extensible
extensions
wrapped tokens repository
Lossless Core Extension