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

Was this helpful?

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

Lossless Extensions Core

PreviousLossless Wrapped ERC20 ExtensibleNextExtensions

Last updated 2 years ago

Was this helpful?

Workflow

Overview

The Lossless Extensions Core is the smart contract in charge of managing the extensions installed on the Lossless Wrapped ERC20 Extensible contract.

Through this contracts the users can interact in order to register and unregister extensions. Additionally when an extension is registered it needs to be set as one of the following bases:

  • beforeTransferBase: The logic of the extension is ran before a transfer takes place.

  • afterTransferBase: The logic is ran after a transfer takes place

  • beforeMintBase: The logic is ran before a mint takes place

  • afterMintBase: The logic is ran after a mint takes place

  • beforeBurnBase: The logic is ran before burning takes place

  • afterBurnBase: The logic is ran after burning takes place

Extensions

For instance, when a user interacts with the Lossless WERC20 Extensible to perform a transfer, the wrapping contract will check if abeforeTransferBase is set and if so, if it has an extension registered with the same address. If both of this conditions are true, the call to the extension is made, applying the deployed logic.

More info

Variables

_extensions

Type

EnumerableSet.AddressSet

Visibility

internal

Description

Corresponds to a list of registered extensions.

losslessCoreExtension

Type

address

Visibility

public

Description

Corresponds to the registered address as the lossless core extension.

beforeTransferBase

Type

address

Visibility

public

Description

Corresponds to the registered address as the before transfer base. Executes its logic before performing a transfer.

beforeMintBase

Type

address

Visibility

public

Description

Corresponds to the registered address as the before mint base. Executes its logic before minting.

afterMintBase

Type

address

Visibility

public

Description

Corresponds to the registered address as the after mint base. Executes its logic after minting.

beforeBurnBase

Type

address

Visibility

public

Description

Corresponds to the registered address as the before burn base. Executes its logic before burning.

afterBurnBase

Type

address

Visibility

public

Description

Corresponds to the registered address as the after burn base. Executes its logic after burning.

_CREATOR_CORE_V1

Type

bytes4

Visibility

public constant

Description

Corresponds to the interfaceID of the Extensions Core Contract

Events

ExtensionRegistered

Parameters

Address of the registered extension. Indexed.

Address of the one registering the extension. Indexed.

Description

It is emitted when a new extension is registered.

ExtensionUnregistered

Parameters

Address of the unregistered extension. Indexed.

Address of the one unregistering the extension. Indexed.

Description

It is emitted when a new extension is registered.

BeforeTransferUpdated

Parameters

Address of the set before transfer base.

Description

It is emitted when a new transfer base is registered.

AfterTransferUpdated

Parameters

Address of the set after transfer base.

Description

It is emitted when a new after transfer base is registered.

BeforeMintUpdated

Parameters

Address of the set before mint base.

Description

It is emitted when a new before mint base is registered.

AfterMintUpdated

Parameters

Address of the set after mint base.

Description

It is emitted when a new after mint base is registered.

BeforeBurnUpdated

Parameters

Address of the set before burn base.

Description

It is emitted when a new before burn base is registered.

AfterBurnUpdated

Parameters

Address of the set after burn base.

Description

It is emitted when a new after burn base is registered.

Functions

getExtensions

Type

external view

Restrictions

-

Parameters

-

Returns

Returns an array of addresses

Description

Returns a list of all registered extensions in the contract.

registerExtension

Type

external

Restrictions

Only admin

Parameters

extension address

Returns

-

Description

Adds the address of the extension to the _extensions list.

registerExtension

Type

external

Restrictions

Only admin

Parameters

extension address

Returns

-

Description

Removes the address of the extension from the _extensions list.

setLosslessCoreExtension

Type

external

Restrictions

Only registered extension

Parameters

-

Returns

-

Description

Sets the calling extension as the Lossless Core Extension

setBeforeTransferExtension

Type

external

Restrictions

Only registered extension

Parameters

-

Returns

-

Description

Sets the calling extension as the before transfer base.

setAfterTransferExtension

Type

external

Restrictions

Only registered extension

Parameters

-

Returns

-

Description

Sets the calling extension as the after transfer base.

setBeforeMintExtension

Type

external

Restrictions

Only registered extension

Parameters

-

Returns

-

Description

Sets the calling extension as the before mint base.

setAfterMintExtension

Type

external

Restrictions

Only registered extension

Parameters

-

Returns

-

Description

Sets the calling extension as the after mint base.

setBeforeBurnExtension

Type

external

Restrictions

Only registered extension

Parameters

-

Returns

-

Description

Sets the calling extension as the before burn base.

setAfterBurnExtension

Type

external

Restrictions

Only registered extension

Parameters

-

Returns

-

Description

Sets the calling extension as the after burn base.

In order to properly implement the extensions the has to be implemented.

An extension is a smart contract that implements one or more of the interfaces stated in the .

can be taken as an example of an extension that implements before and after transfer base, effectively expanding the logic by interacting with the Lossless Core Protocol.

corresponding interface
repository
Lossless Core Extension