How to Run a Chronos Application and Call Cross-Chain Data with Helios Oracle and how to make goverance vote

:hammer_and_wrench: Governance Vote + Useful dApp Features on Helios (Chronos + Oracle)

Helios enables building powerful modular smart contracts using Move — including governance tools, time-based logic with Chronos, and external data fetch via Oracles. Here’s how to build a basic governance voting system+ ideas for useful dApps.

:white_check_mark: What You’ll Build

  • A simple voting system (For/Against)
  • Use Chronos for proposal expiry
  • Optional: Call external data via Helios Oracle
  • Extendable to any dApp logic (faucet, triggers, automation)

:brick: Step-by-Step Guide

:one: Create Your Governance Module

Basic voting contract using Move

module governance::VoteModule {

struct Proposal has key {
id: u64,
title: vector,
for_votes: u64,
against_votes: u64,
end_time: u64,
executed: bool,
}

public fun create_proposal(sender: &signer, id: u64, title: vector, end_time: u64) {
move_to(sender, Proposal {
id,
title,
for_votes: 0,
against_votes: 0,
end_time,
executed: false,
});
}

public fun vote(sender: &signer, id: u64, support: bool) {
let proposal = borrow_global_mut(signer::address_of(sender));
if (support) {
proposal.for_votes = proposal.for_votes + 1;
} else {
proposal.against_votes = proposal.against_votes + 1;
}
}

public fun execute(sender: &signer, id: u64) {
let proposal = borrow_global_mut(signer::address_of(sender));
assert(!proposal.executed, 1);
assert(proposal.end_time < chrono::now(), 2);

if (proposal.for_votes > proposal.against_votes) {
  // EXECUTE LOGIC HERE
}

proposal.executed = true;

}
}

:two: Add Chronos Support (Time Automation)

Helios Chronos gives you block timestamp access:

use chrono::now;

public fun get_current_time(): u64 {
now()
}

Use this to:

  • Automatically end proposals
  • Limit token claims
  • Reset contract behavior

:test_tube: Tutorial: Build & Run a Chronos Smart Contract with External Oracle Data (Helios Testnet)
:white_check_mark: Prerequisites

  • Node.js + npm installed
  • Git installed
  • A Helios wallet (MetaMask or Leap)
  • Testnet tokens from Helios faucet
  • Basic understanding of smart contracts (Rust/Move/Solidity-like syntax)

:one: Clone the Example Repo

git clone GitHub - helios-network/smart-contract-examples: This repository contains examples contracts that can be executed on the Helios blockchain, like Chronos schedules or External chain data reader
cd smart-contract-examples/helios-hyperion-oracle

:two: Explore the Project Structure

  • contracts/oracle_consumer.move: Smart contract using oracle data
  • scripts/deploy.ts: Script to deploy the contract
  • helios.config.ts: Configuration file for testnet setup

:three: Install Dependencies

npm install

:four: Configure the Environment

Update helios.config.ts with your wallet private key and RPC URL:

export const config = {
privateKey: ‘YOUR_WALLET_PRIVATE_KEY’,
rpcUrl: ‘https://rpc.testnet.helios.com’, // Example
network: ‘testnet’,
};
:five: Deploy the Oracle-Integrated Contract

Run the deploy script:

npx ts-node scripts/deploy.ts

This will:

:white_check_mark: Deploy your contract
:white_check_mark: Register it with the Chronos oracle
:white_check_mark: Log the deployed contract address

:six: Interact with Your Contract

Example: Call a function to get cross-chain data (e.g. ETH price)

npx ts-node scripts/interact.ts

:seven: Use-Case Example: Display Live ETH Price

Create a simple frontend using React + ethers.js to:

  • Connect wallet
  • Call your deployed contract
  • Show real-time ETH price from the oracle

:eight: Optional: Governance Vote Sample

Extend your contract with governance module:

public fun propose_change(sender: address, new_val: u64) {
// add vote logic
}

thanks for this oppourunity