Build on Onchain AI
For the Builders
Last updated
For the Builders
Last updated
Given the EVM compatibility of Onchain AI, deploying smart contracts to the platform is straightforward for developers familiar with Ethereum's ecosystem. One of the most widely used tools for this purpose is . Below, you'll find a guide on deploying smart contracts on Onchain AI using Remix.
A smart contract written in Solidity.
The Onchain AI Wallet or a compatible web3 wallet with OCAI tokens on the testnet or mainnet.
Familiarity with Remix and its interface.
Open your web browser and navigate to .
Click on the +
button (located top-left) to create a new file, then paste your Solidity code. Ensure that the compiler version in Remix matches the one specified in your smart contract.
Navigate to the Solidity Compiler
tab.
Click on the Compile
button.
After successful compilation, any warnings or errors will be displayed. Address them before deploying.
Move to the Deploy & Run Transactions
tab.
From the Environment
dropdown, select Injected Web3
. This option leverages the web3 provider injected by your Onchain AI Wallet (or a compatible wallet).
Confirm that Remix now displays the correct network (OCAI Testnet) and your account address.
Select the contract you wish to deploy from the Contract
dropdown.
If your contract has a constructor that requires arguments, provide them.
Click on the Deploy
button.
A confirmation window from your wallet will appear. Confirm the transaction details and gas fee, then approve the transaction.
Once deployed, your contract will be listed under the Deployed Contracts
section in Remix. Here, you can interact with your contract's functions directly.
Deploying smart contracts to Onchain AI using Remix provides a familiar and efficient process for developers. Thanks to the EVM compatibility of Onchain AI, the transition for developers from Ethereum or other EVM-compatible chains is seamless.
To verify your smart contract and see its details, head over to the Onchain AI Testnet Explorer at . Input your contract's address to view transactions, function calls, and other associated details.