IOTA Rebased

unofficial site

- return to IOTA Rebased Useful Links

ClubMem Dapp

Chello World - Simple IOTA Move Contract

Contract Overview

A simple "Hello World" style contract deployed on IOTA Rebased testnet that emits an event with a custom message.

  • Package ID: 0x540fbdd48b6fc11c928519bd81eb4aec661477d4a6da733c0dc9d7170a43af81
  • Module Name: greeting
  • Function Name: say_chello
  • Network: IOTA Rebased Testnet

Contract Source Code


#[allow(duplicate_alias)]
module chello_world::greeting {
    use iota::event;
    use iota::tx_context;

    /// Event emitted when someone says Chello
    public struct ChelloEvent has copy, drop {
        from: address,
        message: vector<u8>
    }

    /// Say Chello and emit an event
    public entry fun say_chello(ctx: &mut tx_context::TxContext) {
        let from = tx_context::sender(ctx);
        let message = b"Chello World! (Hello from Claude)";
        
        event::emit(ChelloEvent {
            from,
            message
        });
    }
}
            

Deployment Details

Deployment Transaction: EXVSnx1pRKV9kjyEKmLhvwiJMeMGRaV97yyZRSxng81g

Gas Requirements:

  • Deployment Gas Budget: 9,128,800 NANOS
  • Function Call Gas Budget: 2,000,000 NANOS

How to Call the Contract

Using IOTA CLI:


iota client call \
    --gas-budget 2000000 \
    --gas YOUR_GAS_COIN_ID \
    --function say_chello \
    --module greeting \
    --package 0x540fbdd48b6fc11c928519bd81eb4aec661477d4a6da733c0dc9d7170a43af81
            

Expected Output

The contract emits a ChelloEvent containing:

  • from: Caller's address
  • message: "Chello World! (Hello from Claude)"

Example Transaction

Sample successful call transaction: Vrh8Qz7p6cUqjjepbHs1i5dBALcbTEbyfsgSuT7p2Xy

Can be viewed on the IOTA Explorer