For the complete documentation index, see llms.txt. This page is also available as Markdown.

Helper function to restrict contract calls

Description

Implement access control to ensure functions can only be called by users, not other contracts

Use Cases

  • Preventing contract-to-contract reentrancy attacks

  • Ensuring human-initiated transactions for governance

  • Restricting token minting to direct user actions

  • Protecting admin functions from automated calls

Key Concepts

  • Standard principals - User wallets (SP/ST addresses)

  • Contract principals - Deployed contracts (address.contract-name)

  • contract-caller - The immediate caller of the current function

  • tx-sender - The original transaction initiator

Last updated

Was this helpful?