`as-contract` temporarily switches `tx-sender` to the contract's own principal, allowing the contract to transfer its own assets.
clarity (as-contract (stx-transfer? u100 tx-sender 'SP3FG...))
100 XP to Apprentice
Executing actions as the contract principal.
AI translates the explanation and quiz text while preserving code and answer scoring.
`as-contract` temporarily switches `tx-sender` to the contract's own principal, allowing the contract to transfer its own assets.
clarity (as-contract (stx-transfer? u100 tx-sender 'SP3FG...))
1. What does as-contract modify during its execution scope?
2. Why is as-contract essential for vaults and escrows?