> For the complete documentation index, see [llms.txt](https://zenofchain.gitbook.io/spark-wen-dang-geng-xin-zhong-spark-docupdating/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zenofchain.gitbook.io/spark-wen-dang-geng-xin-zhong-spark-docupdating/kai-fa-zhe-developers/10.-ji-yu-wei-ci-de-ding-dan-bo-predicatebased-order-book/10.2-chuang-jian-ding-dan-jiao-ben-create-order-script.md).

# 10.2 创建订单脚本 (Create order script)

<https://github.com/compolabs/spark/tree/master/services/predicate-orders-builder/create_order_script>

Create order script performs two actions: it sends funds to the predicate, thereby initiating the creation of an order and makes a log with the parameters of the order, which will help in indexing the order.

创建订单脚本执行两个动作：它向谓词发送资金，从而启动订单的创建，并将订单的参数做成日志，这将有助于为订单建立索引。

```
script;
use std::token::transfer_to_address;
use std::logging::log;

struct CreateOrderParams {
    id: str[30],
    predicate_address: Address,
    amount0: u64,
    asset0: ContractId,
    amount1: u64,
    asset1: ContractId,
    owner: Address,
}
fn main(params: CreateOrderParams) {
    log(params);
    transfer_to_address(params.amount0, params.asset0, params.predicate_address);
}

```
