array Byte32 [byte; 32];
vector Bytes <byte>;

table Script {
    code_hash: Byte32,
    hash_type: byte,
    args: Bytes,
}

union Address {
    Script,
}

/* Actions for Spore */

table MintSpore {
    spore_id: Byte32,
    to: Address,
    data_hash: Byte32,
}

table TransferSpore {
    spore_id: Byte32,
    from: Address,
    to: Address,
}

table BurnSpore {
    spore_id: Byte32,
    from: Address,
}

/* Actions for Cluster */

table MintCluster {
    cluster_id: Byte32,
    to: Address,
    data_hash: Byte32,
}

table TransferCluster {
    cluster_id: Byte32,
    from: Address,
    to: Address,
}

/* Actions for Cluster/Proxy */

table MintProxy {
    cluster_id: Byte32,
    proxy_id: Byte32,
    to: Address,
}

table TransferProxy {
    cluster_id: Byte32,
    proxy_id: Byte32,
    from: Address,
    to: Address,
}

table BurnProxy {
    cluster_id: Byte32,
    proxy_id: Byte32,
    from: Address,
}

/* Actions for Cluster/Agent */

table MintAgent {
    cluster_id: Byte32,
    proxy_id: Byte32,
    to: Address,
}

table TransferAgent {
    cluster_id: Byte32,
    from: Address,
    to: Address,
}

table BurnAgent {
    cluster_id: Byte32,
    from: Address,
}

/* Action in ScriptInfo */

union SporeAction {
    MintSpore,
    TransferSpore,
    BurnSpore,

    MintCluster,
    TransferCluster,

    MintProxy,
    TransferProxy,
    BurnProxy,

    MintAgent,
    TransferAgent,
    BurnAgent,
}
