πŸ“’Contract

Documentation for contract actions

Github

Loot Contract Actions

πŸ“ User Registration (regnewuser)

  • Purpose: Registers a user on the contract, enabling participation in NFT staking and rewards.

  • Parameters:

    • user: Account name to be registered.

    • referrer: (Optional) Account name of the referrer, if any.

πŸ’° Claiming Rewards (claim)

  • Purpose: Allows users to claim accumulated rewards from staked NFTs.

  • Parameters:

    • user: Account name claiming the rewards.

    • collection: Name of the NFT collection from which to claim rewards.

πŸ”„ Unstaking NFTs (unstake)

  • Purpose: Enables users to remove their NFTs from staking, halting reward accumulation.

  • Parameters:

    • user: Account name performing the unstake action.

    • asset_ids: List of NFT asset IDs to be unstaked.

πŸ”„ Resetting User Data (resetuser)

  • Purpose: Clears a user's staking data and returns any staked NFTs.

  • Parameters:

    • user: Account name whose data is to be reset.

πŸ’Έ Refunding Tokens (refund)

  • Purpose: Issues a refund of tokens to a user under specific conditions.

  • Parameters:

    • user: Recipient of the refund.

    • collection: Collection associated with the refund.

    • refund_amount: Amount of tokens to be refunded.

🌐 Registering NFT Collection (setnftcolrew)

  • Purpose: Sets up a new NFT collection for staking with specific reward parameters.

  • Parameters:

    • user: Account initiating the registration.

    • collection: Collection name.

    • token_symbol: Token symbol for rewards.

    • token_contract: Contract managing the reward tokens.

    • time_unit_length: Length of time units for reward calculation.

    • unstake_period: Minimum staking period before NFTs can be unstaked.

    • reward_series_referral: Series for calculating referral rewards.

    • reward_coefficient_referral: Coefficient for referral reward calculation.

    • reward_series_hodl: Series for calculating holding rewards.

    • reward_coefficient_hodl: Coefficient for holding reward calculation.

βž• Adding Eligible NFT Templates (addtemplates)

  • Purpose: Includes NFT templates in the staking program of a collection.

  • Parameters:

    • user: Account adding the templates.

    • template_id: ID of the template to be added.

    • collection: Collection to which the template belongs.

    • timeunit_rate: Reward rate per time unit for the template.

βž– Removing NFT Templates (rmtemplates)

  • Purpose: Excludes NFT templates from the staking program of a collection.

  • Parameters:

    • user: Account removing the templates.

    • template_id: ID of the template to be removed.

    • collection: Collection from which the template is removed.

πŸ”” Receiving NFTs (receiveassets)

  • Purpose: Automatically stakes NFTs sent to the contract and updates user staking data.

  • Parameters:

    • Handled through atomicassets::transfer notifications; no direct user parameters.

πŸ“ˆ Handling Token Transfers (on_transfer)

  • Purpose: Manages incoming token transfers to fund the contract's reward pool.

  • Parameters:

    • Handled through token transfer notifications; the memo should contain the collection name.

Last updated