> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# SolidityX

> The SolidityX smart contract programming language.

## Overview

SolidityX is a fork of Solidity that adds additional features and functionality to the language. SolidityX is a superset of Solidity, meaning that all Solidity code is valid SolidityX code. *It retains all of the features of Solidity*, while adding support for **Quai Network's cross-chain functionality** natively into the EVM.

The key additions to SolidityX include:

* Support for cross-chain transactions via the [etx](https://docs.qu.ai/build/smart-contracts/opcode-additions.md#etx) opcode.
* Support for cross-chain address validation via the [isaddrInternal](https://docs.qu.ai/build/smart-contracts/opcode-additions.md#isaddrinternal) opcode.

Additional opcode usage is currently supported via [inline assembly](https://docs.soliditylang.org/en/latest/assembly.html). More details on the usage of `etx` and `isaddrinternal` can be found on the [Opcode Additions page](https://docs.qu.ai/build/smart-contracts/opcode-additions.md).

## Example Implementation

Below is a simple implementation of the `isaddrinternal` opcode using inline assembly in a QRC20 contract. The function checks whether an address is on the same shard as the deployed contract and then decides whether to execute a local transfer or an external transfer.

```solidity theme={null}
function transfer(address to, uint256 amount) public payable  returns (bool) {
        bool isInternal;
        assembly {
            isInternal := isaddrinternal(to)  // This opcode returns true if an address is internal
        }
        require(isInternal, "Address is external. Use cross-chain transfer function.");
        _transfer(msg.sender, to, amount);
        return true;
    }
```

## Resources

| | |
| - | - |
| [GitHub](https://github.com/dominant-strategies/SolidityX) | The SolidityX Github Repository. |
| [QRC-20 Token](https://github.com/dominant-strategies/SolidityX-Contracts/blob/main/QRC20X.sol) | A QRC-20 token contract written in SolidityX. |
| [QRC-721 Token](https://github.com/dominant-strategies/SolidityX-Contracts/blob/main/QRC721X.sol) | A QRC-721 token contract written in SolidityX. |
| [Opcode Additions](https://docs.qu.ai/build/smart-contracts/opcode-additions.md) | Additional opcodes added to SolidityX for cross-chain functionality. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.