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 opcode.
- Support for cross-chain address validation via the isaddrInternal opcode.
Additional opcode usage is currently supported via inline assembly. More details on the usage of etx
and isaddrinternal
can be found on the Opcode Additions page.
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.
Resources
GitHub | The SolidityX Github Repository. |
QRC-20 Token | A QRC-20 token contract written in SolidityX. |
QRC-721 Token | A QRC-721 token contract written in SolidityX. |
Opcode Additions | Additional opcodes added to SolidityX for cross-chain functionality. |
Was this page helpful?