Loot

Contract hosting the Loot reward logic. A Loot is a struct holding the data for PAL & extra rewards allocated to an user based on distribution, user voting rewards from Quest and boosting power from their hPAL locks. The PAL rewards in the Loot are vested for a given duration, and can be claimed beforehand but are slashed based on the remaining duration of the vesting. The extra rewards are not vested and not slashed.

LootData

Loot Data strcut

struct LootData {
  uint256 id;
  uint256 palAmount;
  uint256 extraAmount;
  uint256 startTs;
  uint256 endTs;
  bool claimed;
}

pal

contract IERC20 pal

PAL token

extraToken

contract IERC20 extraToken

Extra reward token

tokenReserve

Address of the Reserve contract holding token to be distributed

lootCreator

Loot Creator contract

vestingDuration

Duration of vesting for Loots

userLoots

List of Loot for each user

LootCreated

Event emitted when a Loot is created

LootClaimed

Event emitted when a Loot is claimed

VestingDurationUpdated

Event emitted when the vesting duration is updated

LootCreatorUpdated

Event emitted when the Loot Creator address is updated

setInitialLootCreator

Sets the Loot Creator contract address

Parameters

Name
Type
Description

_lootCreator

address

Address of the Loot Creator contract

getLootData

Returns the data of a Loot for a user & an id

Parameters

Name
Type
Description

user

address

Address of the user

id

uint256

ID of the Loot

Return Values

Name
Type
Description

palAmount

uint256

(uint256) : Amount of PAL

extraAmount

uint256

(uint256) : Amount of extra token

startTs

uint256

(uint256) : Timestamp at which the vesting starts

endTs

uint256

(uint256) : Timestamp at which the vesting ends

claimed

bool

(uint256) : Is Loot already claimed

getAllUserLootIds

Returns all the user Loot IDs

Parameters

Name
Type
Description

user

address

Address of the user

Return Values

Name
Type
Description

[0]

uint256[]

uint256[] : List of Loot IDs

getAllActiveUserLootIds

Returns all the user active Loot IDs

Parameters

Name
Type
Description

user

address

Address of the user

Return Values

Name
Type
Description

[0]

uint256[]

uint256[] : List of active Loot IDs

getAllUserLoot

Returns all the user Loots

Parameters

Name
Type
Description

user

address

Address of the user

Return Values

Name
Type
Description

[0]

struct Loot.LootData[]

LootData[] : List of Loots

getAllActiveUserLoot

Returns all the user active Loots

Parameters

Name
Type
Description

user

address

Address of the user

Return Values

Name
Type
Description

[0]

struct Loot.LootData[]

LootData[] : List of active Loots

createLoot

Creates a new Loot for a user

Parameters

Name
Type
Description

user

address

Address of the user

startTs

uint256

Timestamp at which the vesting starts

palAmount

uint256

Amount of PAL

extraAmount

uint256

Amount of extra token

claimLoot

Claims a Loot for a user

Parameters

Name
Type
Description

id

uint256

ID of the Loot

receiver

address

Address to receive the PAL & extra token

claimMultipleLoot

Claims multiple Loots for a user

Parameters

Name
Type
Description

ids

uint256[]

List of Loot IDs

receiver

address

Address to receive the PAL & extra token

Last updated

Was this helpful?