Assessment reports>Session Token>Threat Model>Function: contributeFunds()

Function: contributeFunds()

This function allows any caller to contribute SENT tokens. The caller will be added to the contributorAddresses list. When the necessary amount of contribution is reached, the stakingRewardsContract.addBLSPublicKey() function will be called for service-node registration.

Inputs

  • amount

    • Validation: The caller should have enough tokens to send.

    • Impact: The amount of SENT tokens to send to this contract.

Branches and code coverage (including function calls)

Intended branches

Function call analysis

  • SENT.safeTransferFrom(msg.sender, address(this), amount);

    • External/Internal? External.

    • Argument control: amount.

    • Impact: Transfer SENT amount of tokens from the caller to the contract.

  • finalizeNode() -> SENT.approve(address(stakingRewardsContract), stakingRequirement);

    • External/Internal? External.

    • Argument control: stakingRequirement.

    • Impact: Give the contract stakingRewardsContract the approval to spend stakingRequirement amount of SENT tokens.

  • finalizeNode() -> stakingRewardsContract.addBLSPublicKey(blsPubkey, blsSignature, serviceNodeParams, contributors)

    • External/Internal? External.

    • Argument control: N/A.

    • Impact: The stakingRequirement of SENT tokens will be transferred to the stakingRewardsContract contract.

Zellic © 2024Back to top ↑