Function: claim(address _pool)

This function is used to allow a user to claim their shares from a specific pool.

Inputs

  • _pool

    • Control: Arbitrary.

    • Constraints: Nonzero address.

    • Impact: Address of the pool from which to claim shares.

Branches and code coverage

Intended branches

  • Get the bond token and coupon token from the pool.

  • Get the current period and the user's balance and calculate the user's shares.

  • Subtract the user's shares from the pool's amount to distribute and the coupon amounts to distribute.

  • Reset the user's indexed assets and transfer the user's shares to the user's address.

Negative behavior

  • Revert if the contract is paused.

  • Revert if the pool address is zero.

  • Revert if the address of the bond token or coupon token is zero.

  • Revert if the coupon-token balance is less than the user's shares.

  • Revert if the pool does not have enough shares to distribute.

  • Revert if the distributor does not have enough coupon tokens to distribute.

Zellic © 2025Back to top ↑