PrimaryLendingPlatformWrappedTokenGatewayCore

Overview

License: MIT

abstract contract PrimaryLendingPlatformWrappedTokenGatewayCore is Initializable, AccessControlUpgradeable, ReentrancyGuardUpgradeable

Core contract for the Primary Lending Platform Wrapped Token Gateway Core

Abstract contract that defines the core functionality of the primary lending platform wrapped token gateway.

Events info

SetPrimaryLendingPlatform

event SetPrimaryLendingPlatform(address newPrimaryLendingPlatform)

Emitted when the PrimaryLendingPlatform contract address is updated.

Parameters:

Name
Type
Description

newPrimaryLendingPlatform

address

The new address of the PrimaryLendingPlatform contract.

SetPITLiquidation

event SetPITLiquidation(address newPITLiquidation)

Emitted when the PIT liquidation address is set.

SetPITLeverage

Emitted when the PIT (Pool Interest Token) leverage is set to a new address.

Parameters:

Name
Type
Description

newPITLeverage

address

The address of the new PIT leverage contract.

SetWETH

Emitted when the WETH address is set.

Parameters:

Name
Type
Description

newWETH

address

The address of the new WETH contract.

Constants info

MODERATOR_ROLE (0x797669c9)

State variables info

primaryLendingPlatform (0x92641a7c)

WETH (0xad5c4648)

pitLiquidation (0xf8514cae)

pitLeverage (0x22c7ddee)

Modifiers info

onlyModerator

Modifier that allows only the moderator to execute the function.

isProjectTokenListed

Modifier that checks if the project token is listed.

Parameters:

Name
Type
Description

projectToken

address

Address of the project token.

isLendingTokenListed

Modifier that checks if the lending token is listed.

Parameters:

Name
Type
Description

lendingToken

address

Address of the lending token.

Functions info

initialize (0xf8c8765e)

Initializes the PrimaryLendingPlatformWrappedTokenGateway contract.

Parameters:

Name
Type
Description

pit

address

Address of the primary index token contract.

weth

address

Address of the wrapped Ether (WETH) token contract.

pitLiquidationAddress

address

Address of the primary index token liquidation contract.

pitLeverageAddress

address

Address of the primary index token leverage contract.

setWETH (0x5b769f3c)

Sets the address of the WETH contract.

Requirements:

  • newWETH cannot be the zero address.

  • Caller must be a moderator.

Parameters:

Name
Type
Description

_weth

address

The address of the new WETH contract.

setPrimaryLendingPlatform (0xe801734a)

Sets the address of the primary lending platform contract.

Requirements:

  • newPit cannot be the zero address.

  • Caller must be a moderator.

Parameters:

Name
Type
Description

newPit

address

The address of the new primary lending platform contract.

setPITLiquidation (0x6ccf9e23)

Only the moderator can call this function.

Sets the address of the PrimaryLendingPlatformLiquidation contract for PIT liquidation.

Requirements:

  • newLiquidation cannot be the zero address.

  • Caller must be a moderator.

Parameters:

Name
Type
Description

newLiquidation

address

The address of the new PrimaryLendingPlatformLiquidation contract.

setPITLeverage (0x1a58ed4a)

Sets the Primary Lending Platform Leverage contract address.

Requirements:

  • newLeverage cannot be the zero address.

  • Caller must be a moderator.

Parameters:

Name
Type
Description

newLeverage

address

The address of the new Primary Lending Platform Leverage contract.

getTotalOutstanding (0x75efd575)

Returns the total outstanding balance of a user for a specific project token.

Parameters:

Name
Type
Description

user

address

The address of the user.

projectToken

address

The address of the project token.

Return values:

Name
Type
Description

outstanding

uint256

The total outstanding balance of the user.

deposit (0xd0e30db0)

Deposits Ether into the PrimaryLendingPlatformWrappedTokenGatewayCore contract and wraps it into WETH.

repay (0x22867d78)

Repays the specified amount of the project token's Ether outstanding debt using the lending token.

Parameters:

Name
Type
Description

projectToken

address

The address of the project token.

lendingTokenAmount

uint256

The amount of the lending token to be used for repayment.

receive

Only WETH contract is allowed to transfer ETH here. Prevent other addresses to send Ether to this contract.

fallback

Reverts any fallback calls to the contract.

Last updated