To deploy a smart contract on Quai Network, you simply send a transaction containing the contract bytecode without specifying a recipient. Once deployed, your smart contract will be available to any user on the network to interact with.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.
How to Deploy a Smart Contract
Requirements
To deploy a smart contract on Quai, you’ll need a few things:- QUAI to cover gas: similar to a normal transaction, you’ll need to set your gas limit. Be aware that contract deployment requires significantly more gas than a simple transfer.
- Contract Bytecode: generated using a compiler.
- Deployment script or plugin
- Access to a Quai node: you can do this either by running your own node, accessing a publicly available node, or through API key via a node service.
Deployment
Smart contracts on Quai Network can be deployed using a number of different methods. The most straightforward and widely used methods are using deployment tools like Hardhat. Contracts can also be deployed using the quais.js library, which offers increased flexibility and the ability to deploy via frontend or simple script. Information on how to deploy a simple smart contract with hardhat can be found in the Solidity Deployment Tutorial.Cross-Chain Smart Contracts
Contrary to monolithic blockchains, Quai Network’s multi-threaded architecture allows for the deployment of cross-chain smart contracts. These are smart contracts present in a single network context that contain references to sister contracts in alternate context(s). Multi-chain referencing smart contracts allow you as a developer to create seamless cross-chain applications that can:- Asynchronously track the state of contracts within other chains in the network
- Natively transfer value and tokens to different contexts without bridges
- Create a network secured mesh of smart contracts
