Assessment reports>Initia>Threat Model>Module zapping.move

Module zapping.move

Function: batch_claim_zapping_script

This function is used by external users to claim expired zapping stakes in a batch.

Inputs

Full prototype: public entry fun batch_claim_zapping_script( account: &signer, zids: vector<u64>, ) acquires ModuleStore, LSStore

  • account: &signer

    • Validation: Must be a signer.

    • Impact: This is the account from which the zappings are unlocked.

  • zids: vector<u64>

    • Validation: Checks that the zids are present under the account.

    • Impact: These zids are unlocked.

Function: batch_claim_reward_script

This function is used by external users to claim the rewards on the staked zappings in a batch.

Inputs

Full prototype: public entry fun batch_claim_reward_script( account: &signer, zids: vector<u64>, ) acquires ModuleStore, LSStore

  • account: &signer

    • Validation: Must be a signer.

    • Impact: This is the account from which the zapping rewards are claimed.

  • zids: vector<u64>

    • Validation: Checks that the zids are present under the account.

    • Impact: These zids will have their staking reward claimed.

Function: claim_zapping_script

This function is used by external users to claim expired zapping stakes.

Inputs

Full prototype: public entry fun claim_zapping_script( account: &signer, zid: u64, ) acquires ModuleStore, LSStore

  • account: &signer

    • Validation: Must be a signer.

    • Impact: This is the account from which the zapping is unlocked.

  • zid: u64

    • Validation: Checks that the zid is present under the account.

    • Impact: This zid is unlocked.

Function: claim_reward_script

This function is used by external users to claim the rewards on the staked zapping.

Inputs

Full prototype: public entry fun claim_reward_script(account: &signer, zid: u64) acquires ModuleStore, LSStore

  • account: &signer

    • Validation: Must be a signer.

    • Impact: This is the account from which the zapping reward is claimed.

  • zid: u64

    • Validation: Checks that the zid is present under the account.

    • Impact: This zid will have its staking reward claimed.

Function: update_lock_period_script

This function is used by the chain special signer to update the lock period on zappings. It does not affect existing zappings.

Inputs

Full prototype: public entry fun update_lock_period_script( chain: &signer, lock_period: u64, ) acquires ModuleStore

  • chain: &signer

    • Validation: Must be chain.

    • Impact: None, used for validation only.

  • lock_period: u64

    • Validation: None necessary as this function will only be called by trusted users.

    • Impact: The new lock period is this value.

Function: claim

Claims an unlocked zapping and returns the inner Delegation and accrued rewards.

Inputs

Full prototype: public fun claim(zapping: Zapping, zid: u64): (Delegation, FungibleAsset)

  • zapping: Zapping

    • Validation: None, but this type can only be created in this module.

    • Impact: This zapping is claimed.

  • zid: u64

    • Validation: None, but this function is only callable by callers with a Zapping, all of which are trusted.

    • Impact: The id is emitted in an event.

Zellic © 2024Back to top ↑