Smart Contracts encode the financial T&Cs of a Vault account in the form of Python code. One of the main building blocks of a Smart Contract is the contract hooks. Hooks are Python functions called by Vault throughout the Smart Contract lifecycle. This can involve:
Reacting to external account events, such as performing a balance check during an attempted withdrawal of funds
Performing periodic actions such as calculating and paying monthly interest into an account
Triggering hook execution typically produces a set of outputs termed hook directives, or a Python exception. Hook directives typically involve:
Intruction of one or more postings (financial value mutation)
Modification of account state, such as adding an account note or amending an account schedule (resource mutation)
Triggering a Vault Workflow (operational mutation)