How to Deploy a Smart Contract with GetBlock
Dive straight into our freshly brewed guide from the devs' desk. Your dream of deploying a smart contract on Ontology is about to become a reality with these easy, step-by-step instructions.
1. Get Ready
2. Create Your Smart Contract (Example)
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.2 <0.9.0;
contract FunctionalityContract {
string message;
function setMessage(string memory newMessage) public {
message = newMessage;
}
function getMessage() public view returns (string memory) {
return message;
}
}3. Compile Your Smart Contract
4. Connect to Ontology's RPC Node with Web3.js

5. Deploy Your Smart Contract with Web3.js
6. Test Your Smart Contract
7. Celebrate Your Success! 🎉
Last updated