Deploy a simple contract
Prerequisites
Step 1: Set Up Your Project
mkdir iotex-contract-tutorial
cd iotex-contract-tutorial
npm init -y
npm install --save-dev hardhat
npx hardhatStep 2: Write the Contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract MessageBoard {
event MessagePosted(address sender, string message);
function postMessage(string calldata message) external {
emit MessagePosted(msg.sender, message);
}
}Step 3: Configure for IoTeX
Step 4: Deploy the Contract
Part 2: Interact with Your Contract Using JavaScript
Last updated

