Skip to main content

ReducedPenaltyRewardFacet

The {ReducedPenaltyRewardFacet} implements the custom reward,withdraw, vaultWithdraw logic for the {ReducedPenaltyReward} NFT.

Functions

rPRAddress

the reduced Penalty Address is the address of the NFT

Declaration

  function rPRAddress(
) public returns (address)

Modifiers:

No modifiers

Returns:

TypeDescription
addresslocation of NFT on blockchain

rPRReward

reduced penalty reward is charged with minting the NFT and updating the diamonds internal state relative to this NFT.

Declaration

  function rPRReward(
address to,
address token,
uint256 amount
) external onlyDiamond

Modifiers:

Modifier
onlyDiamond

Args:

ArgTypeDescription
toaddressaddress of the user receiving the reward
tokenaddressthe underlying asset the reduced penalty provides (eg USDT)
amountuint256the amount of the underlying asset that the NFT can reduce

rPRReductionAmount

returns {RPRAmount} for the nft id in question

Declaration

  function rPRReductionAmount(
uint256 id
) external returns (struct RPRAmount)

Modifiers:

No modifiers

Args:

ArgTypeDescription
iduint256the nft id

Returns:

TypeDescription
RPRAmountthe amount of reduction it can provide in what token

rPRWithdraw

reduced Penalty Withdraw substitutes for the withdraw function of {TokenFarm} when withdrawing a {UserPosition} that has the {ReducedPenaltyReward} nft address associated with it. Provides compensating the user the reduction amount in the even of an early withdraw

Declaration

  function rPRWithdraw(
uint256 pid,
uint256 positionid
) public

Modifiers:

No modifiers

Args:

ArgTypeDescription
piduint256the poolid of the pool in question
positioniduint256the position id in question, retreived from the array postion of {UserInfo}

rPRWithdrawVault

reduced Penalty Withdraw vaults substitutes the withdrawVault function in {SdexVaultFacet} in the event the {UserPosition} in {VaultUserInfo} has the reduced penalty nft address associated with it

Declaration

  function rPRWithdrawVault(
uint256 positionid
) external

Modifiers:

No modifiers

Args:

ArgTypeDescription
positioniduint256the id of the associated position, found in the {UserPosition} array length - 1 of {VaultUserInfo}

Events

RewardNFT

No description

WithdrawVault

No description