# createService(contract, sender, data, currency)

<table data-header-hidden><thead><tr><th width="145.5"></th><th></th></tr></thead><tbody><tr><td>Feature</td><td>Returns raw operation that creates a new 'Security Token service'. <br><mark style="color:red;"><strong>Note : contract’s owner (or operator) can execute the function</strong></mark></td></tr><tr><td>Parameters</td><td><code>string</code> contract address, <br><code>string</code> sender, <br><code>object</code> sto data, <br><code>string</code> currency ID</td></tr><tr><td>Return Value</td><td><code>object</code> createServiceOperation</td></tr></tbody></table>

```typescript
// [ parameter sto data’s structure ]

{
        granularity: number | string;
        defaultPartition: string;  // Capital letters with length between 3 and 10 (can include numbers)
}
```

example

```javascript
const contractAddress = "0x41EFb6902ADcb1214a7123b01af66b1D13b89864fca";
const sender = "0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca";
const currencyID = "MCC"
const stoData = {
    granularity: 1000,
    defaultPartition : "ABCD",
};

const createServiceOperation = mitum.sto.createService(contractAddress, sender, stoData, currencyID);
console.log(createServiceOperation);

//output
Operation {
  id: 'mitum',
  fact: CreateSecurityTokenFact {
    hint: Hint { s: 'mitum-sto-create-security-token-operation-fact' },
    token: Token { s: '2024-05-20 08:47:34.004 +0000 UTC' },
    _hash: <Buffer a4 98 ff ba 53 d8 da 0b a8 1a c7 90 f1 3e d6 3c c6 4d ea af 20 e6 6e 61 2e 38 1f eb ee 20 45 04>,
    sender: Address {
      s: '0x4874C17C354c498cf44D2946612DBe47fBcE7E87fca',
      type: 'mitum'
    },
    items: [ [CreateSecurityTokenItem] ]
  },
  hint: Hint { s: 'mitum-sto-create-security-token-operation' },
  _factSigns: [],
  _hash: <Buffer >
}
```
