> For the complete documentation index, see [llms.txt](https://docs.artinals.com/artinals-protocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.artinals.com/artinals-protocol/building-on-top-of-the-artinals-contract/best-practices.md).

# Best Practices

* **Error Handling**
  * Always check return values and handle errors appropriately
  * Use assertions to validate input parameters
  * Include meaningful error messages
* **Security Considerations**
  * Validate permissions using collection caps
  * Implement proper access controls
  * Check balances before operations
* **Gas Optimization**
  * Batch operations when possible
  * Minimize storage operations
  * Use appropriate data structures
