$ show xian-network/xian-contracting
Xian Contracting is a Python-based smart contract development and execution framework that enables developers to write smart contracts in Python with a secure, metered runtime environment. The system features a modular architecture with components for compilation, execution, storage, and a standard library providing blockchain primitives. Key capabilities include Python-native smart contract authoring, deterministic execution with resource metering to prevent abuse, a secure storage system using Variables and Hashes, and restricted imports to prevent malicious code execution. The framework provides a ContractingClient as the primary interface for deploying and interacting with contracts, and includes comprehensive testing across unit, integration, performance, and security dimensions.
The LLM identified 1 files worth highlighting for reuse:
The ContractingDecimal class provides a self-contained fixed-precision decimal type that enables exact arithmetic operations without floating-point inaccuracies. It implements a complete numeric type with all standard arithmetic operations, automatic precision clamping to prevent overflow, proper quantization, and full operator overloading. The class depends only on Python's standard library decimal module, making it trivial to extract and use in any project requiring precise decimal calculations (such as financial systems, scientific computing, or any domain where numeric accuracy is critical). It demonstrates the numeric type pattern with robust precision boundary handling and complete implementation of all Python numeric protocols.