> This page is for Taurus PROTECT, version v3.58 (default).
> For other versions, use one of these documentation indexes:
> - v3.58 (default): https://docs.taurushq.com/protect-capital/v3.58/llms.txt
> - v3.56: https://docs.taurushq.com/protect-capital/v3.56/llms.txt
> - v3.54: https://docs.taurushq.com/protect-capital/v3.54/llms.txt
> - v3.52: https://docs.taurushq.com/protect-capital/v3.52/llms.txt
> - v3.50: https://docs.taurushq.com/protect-capital/v3.50/llms.txt
> - v3.48: https://docs.taurushq.com/protect-capital/v3.48/llms.txt
> - v3.46: https://docs.taurushq.com/protect-capital/v3.46/llms.txt
> - v3.44: https://docs.taurushq.com/protect-capital/v3.44/llms.txt
> - v3.42: https://docs.taurushq.com/protect-capital/v3.42/llms.txt
> - v3.40: https://docs.taurushq.com/protect-capital/v3.40/llms.txt
> - v3.38: https://docs.taurushq.com/protect-capital/v3.38/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.taurushq.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.taurushq.com/_mcp/server.

# Smart contracts on EVM blockchains: step by step (API)

> **In short**
>
> * You create a contract template, or use the genuine contract template provided from Taurus
> * You create the contract and issue it
> * Taurus-PROTECT approves and sends the deployment, then automatically asks for approval to whitelist the new smart contract's address.
> * Once both are approved, the smart contract is live, and Taurus-PROTECT can call it.
> * To fully view and manage the token in Taurus-CAPITAL, you import it as a digital asset.

* This page applies to Ethereum and other EVM blockchains.
* On these blockchains, the token is a smart contract:
  * you deploy it from a contract template;
  * the smart contract defines which controls the issuer has.

All examples use `https://your-protect-instance.example.com`. Replace it with your own Taurus-PROTECT instance.

## Before you start

### Your technical users have the right roles

* **To create the template and deploy:** Capital Operator and RequestCreator.
* **To call a function after deployment, for example mint:** RequestCreator and TPUser.
* **To approve the deployment, a mint, or a control:** RequestApprover, in the group your governance rule names.
* **To approve the whitelisting of the smart contract:** WhitelistedAddressApprover.
* **Every approver needs a registered signing key:** an ECDSA key on the P-256 curve. See [Signing for approval](/protect-capital/reference/signing-for-approval).

### Your issuer is registered

* Every digital asset is linked to an issuer in Taurus-CAPITAL.
* Find its ID with [List issuers info](/protect-capital/reference/capital/issuers/list-info). If it is not there, create it with [Create an issuer](/protect-capital/reference/capital/issuers/create).

### The deploying address can pay the fees

* The address that sends the deployment pays its fees in the blockchain's own currency, for example ETH on Ethereum.
* Find its ID with [List addresses](/protect-capital/reference/addresses/list).
* Choose the address that will also be the smart contract's admin. It then holds the right to mint, and later calls can be sent from it.

### The smart contract is not deployed yet

* If it already is, import it instead with [Import a digital asset](/protect-capital/reference/capital/digital-assets/import).

## The IDS you will need

The flow uses several IDs. Each one comes from a different call, and they are easy to mix up.

| ID                                   | What it identifies                                                                                                            | How to get it                                                                                                                       |
| ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| **Template ID**                      | The contract template                                                                                                         | The response of step 2, or [List contract templates info](/protect-capital/reference/capital/contracts-template/get-contracts-info) |
| **Address ID**                       | Address ID ≠ Address itself. The Taurus-PROTECT ID to identify the address that deploys, pays the fees, and sends later calls | [List addresses](/protect-capital/reference/addresses/list)                                                                         |
| **Request ID**                       | The deployment request ID, and later each mint or control                                                                     | [List requests for approval](/protect-capital/reference/requests/list-for-approval-v-2)                                             |
| **Whitelisted address ID** (`wlaId`) | The whitelisted address of the new smart contract                                                                             | *Get a request* (`GET /api/rest/v1/requests/{id}`), after the broadcast. Also returned in step 6.                                   |
| **Contract instance ID**             | The deployed smart contract in Taurus-CAPITAL                                                                                 | [List contract instances info](/protect-capital/reference/capital/contracts-instance/get-contracts-info)                            |
| **Issuer ID**                        | The issuer of the token                                                                                                       | [List issuers info](/protect-capital/reference/capital/issuers/list-info)                                                           |
| **Digital asset ID**                 | The token in Taurus-CAPITAL                                                                                                   | The response of step 8                                                                                                              |

## Steps

### 1. Check the governance rules

**Who:** SuperAdmin.

Two kinds of **Governance > Transaction rules** must exist for your EVM blockchain:

* **Contract deployment:** who approves a new smart contract on this blockchain.
* **Contract interaction:** one rule for each function you plan to call, for each contract type, for example `mint(address,uint256)` or `burn(address,uint256)`.

Read the rules in force with [List governance rules](/protect-capital/reference/governance-rules/get-rules).

> **Rules are tied to the contract type**
>
> * A rule for one contract type does not cover another.

> **Note**
>
> A change to the governance rules only takes effect after SuperAdmins sign it.

### 2. Create the contract template

**Who:** Capital Operator.

* Skip this step if you deploy from an existing template. Find its ID with [List contract templates info](/protect-capital/reference/capital/contracts-template/get-contracts-info).
* Otherwise, create it with [Create a contract template](/protect-capital/reference/capital/contracts-template/create-contract):

```bash
POST https://your-protect-instance.example.com/api/rest/v1/capital/contract-templates
```

**`Request body`**

```json Request body
{
  "name": "My token v1",
  "blockchain": "ETH",
  "contractType": "Custom",
  "contractCode": "<base64-build-json>",
  "tokenTypes": ["equity"],
  "author": "<author>",
  "supportFeepayer": false,
  "isUpgradeable": false
}
```

| Field             | What to enter                                                                                                                                                                              |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `name`            | A name for internal use, for example the contract type and version                                                                                                                         |
| `blockchain`      | The blockchain the template can be deployed on. A template can only be used on this blockchain.                                                                                            |
| `contractType`    | The type of smart contract. With `Custom`, Taurus-PROTECT uses `GENERIC` for governance rules and calls (see step 1).                                                                      |
| `contractCode`    | The build JSON from your compiler, encoded in standard base64, on **one line**.                                                                                                            |
| `tokenTypes`      | The asset types the template can be used for, as a list: `asset`, `equity`, `debt`, `convertible`, `utility_token`, `currency`, `fund_shares`, `structured_products`, `commodity` or `nft` |
| `author`          | Who is responsible for the template                                                                                                                                                        |
| `supportFeepayer` | `true` only if the smart contract lets a fee payer pay its transaction fees                                                                                                                |
| `isUpgradeable`   | Marks the template as upgradeable. Upgrading a deployed proxy to a new implementation is done separately, with *Upgrade an EVM proxy*.                                                     |

**Keep from the response:** the template ID.

**Check:** the template's ABI contains every function you plan to call, for example `mint`. A smart contract without a mint function can never create new units.

### 3. Deploy the contract instance

**Who:** Capital Operator, with the RequestCreator role.

Deploy it with [Deploy an EVM contract instance](/protect-capital/reference/capital/contracts-evm-instance/deploy-evm-contract-instance). This creates the deployment request in Taurus-PROTECT.

```bash
POST https://your-protect-instance.example.com/api/rest/v1/capital/contract-instances/evm/deploy
```

This example uses a template whose constructor takes `admin` and a tuple `ERC20Attributes_`. Use the constructor of your own template.

**`Request body`**

```json Request body
{
  "genericData": {
    "contractTemplateID": "<template-id>",
    "blockchain": "ETH",
    "network": "mainnet",
    "fromAddressID": "<address-id>",
    "whitelistContract": true
  },
  "parameters": {
    "constructorParameters": {
      "admin": "<admin-address>",
      "ERC20Attributes_": "{\"name\":\"My Token\",\"symbol\":\"MTK\",\"decimalsIrrevocable\":18}"
    }
  }
}
```

**Address ID ≠ Address itself.** The Taurus-PROTECT address that deploys, pays the fees, and sends later calls. Find your addressID with [List addresses](/protect-capital/reference/addresses/list).

| Field                              | What to enter                                                                                                    |
| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `contractTemplateID`               | The template ID from step 2                                                                                      |
| `blockchain`, `network`            | The blockchain and network of the template, for example `ETH` and `mainnet`                                      |
| `fromAddressID`                    | The AddressID that sends the deployment and pays its fees                                                        |
| `whitelistContract`                | `true`: Taurus-PROTECT then requests the whitelisting of the new smart contract's address automatically (step 5) |
| `gasLimit`, `gasPrice`, `feeLimit` | Optional. Leave them out unless your technical team advises otherwise.                                           |
| `feepayerID`                       | Optional. A fee payer that pays the fees instead of the deploying address, if the template supports it.          |
| `constructorParameters`            | The constructor values, as a map of argument name to value. See the table below.                                 |

**How to write the constructor values**

| Rule                                                                              | Example                                                                   |
| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| The key is the constructor argument's name, exactly as in the ABI, including case | `admin`, `ERC20Attributes_`                                               |
| A tuple is a JSON object with the component names, written as a string            | `"{\"name\":\"My Token\",\"symbol\":\"MTK\",\"decimalsIrrevocable\":18}"` |

> **Constructor values are permanent**
>
> Once deployed, the constructor values, including the admin and the decimals, can never be changed.

### 4. Approve the deployment

**Who:** the approvers named in the contract deployment rule, with the RequestApprover role.

Approving takes three actions: get the request's hash, sign it on your side, then send the signature.

**a. Get the request ID and the hash of the request**

Call [List requests for approval](/protect-capital/reference/requests/list-for-approval-v-2):

```bash
GET https://your-protect-instance.example.com/api/rest/v1/requests/for-approval
```

**Keep from the response:** the request ID. The list shows every request waiting for your approval, so check that you pick the right one, usually the most recent.

Call *Get a request* with the request ID from step 3:

```bash
GET https://your-protect-instance.example.com/api/rest/v1/requests/<request-id>
```

Copy **`metadata.hash`** from the response: 64 hexadecimal characters.

**b. Sign the hash**

Sign it with the approver's private key, as described in [Signing for approval](https://docs.taurushq.com/protect-capital/reference/signing-for-approval). The result is the **signature**: Base64 text.

Keep the private key on the approver's machine. Never share it.

**c. Send the approval**

Call [Approve a request](/protect-capital/reference/requests/approve) with the request ID and the signature:

```bash
POST https://your-protect-instance.example.com/api/rest/v1/requests/approve
```

**`Request body`**

```json Request body
{
  "ids": ["<request-id>"],
  "comment": "Approve deployment of My token",
  "signature": "<base64-signature>"
}
```

The response confirms the signature: `{"signedRequests": "1", "signatures": "1"}`. Once all approvals are in, the deployment is signed in the HSM and sent to the blockchain.

**Check the request status** with *Get a request*: `status` moves to `APPROVED`, then `BROADCASTING`. You will need the request ID to call the API.
Taurus-PROTECT has signed the deployment in the HSM and queues it for the blockchain.

### 5. Wait for the broadcast, then approve the whitelisting

**Who:** the approvers named in the address whitelisting rules, with the WhitelistedAddressApprover role.

The whitelisting request does not exist until the deployment is broadcast, usually a few minutes after the approval in step 4.

**a. Wait for the broadcast**

To check the request status, call *Get a request* with the deployment's request ID.

```bash
GET https://your-protect-instance.example.com/api/rest/v1/requests/<request-id>
```

When the status moved to 'CONFIRMED', it means that the deployment has been broadcast.

**The smart contract is now LIVE on the chain.**

* Once the deployment has been broadcast, `signedRequests[].hash` is the transaction hash. You can look it up in a public blockchain explorer.
* While the contract is deployed, Taurus-PROTECT creates the whitelisting request within a few minutes.
* Look for the `contractAddress` entry in the response. You need it for the next step. It looks like this:

  ```json
  {
    "id": "<attribute-id>",
    "key": "contractAddress",
    "value": "<contract-address>",
    "contentType": "text/plain"
  }
  ```

**b. Check on the whitelisting request**

Call [List whitelisted addresses for approval](/protect-capital/reference/whitelisted-addresses/list-for-approval), filtered on the new smart contract's address (from the step above):

```bash
GET https://your-protect-instance.example.com/api/rest/v1/whitelists/addresses/for-approval?addressType=contract&query=<contract-address>
```

* The entry's `id` is the `wlaId`. It is labelled `<contract type> - <contract address> (request <request-id>)`.
* Copy its **`metadata.hash`**. This list is the only place to get it: the hash is not returned when the whitelisting request is created.

**c. Sign the hash**

Sign it as in step 4. This needs a new signature: the previous one does not work here.

**d. Send the approval**

Call [Approve a whitelisted address](/protect-capital/reference/whitelisted-addresses/approve):

```bash
POST https://your-protect-instance.example.com/api/rest/v1/whitelists/addresses/approve
```

**`Request body`**

```json Request body
{
  "ids": ["<wlaId>"],
  "comment": "Whitelist My token contract",
  "signature": "<base64-signature>"
}
```

After the approval of the whitelisted address request, Taurus-PROTECT can now call the smart contract.

### 6. Find the contract instance

Once the deployment is confirmed, Taurus-CAPITAL records the smart contract as a **contract instance**. Note that the contract instance is not visible in the Taurus-CAPITAL interface yet. It appears there once you import it as a digital asset later.

Call [List contract instances info](/protect-capital/reference/capital/contracts-instance/get-contracts-info), using the `contract address`.

```bash
GET https://your-protect-instance.example.com/api/rest/v1/capital/contract-instances/info?address=<contract-address>&limit=10
```

**`Response`**

```json Response
{
  "result": {
    "contractInstancesInfo": [
      {
        "id": "<contract-instance-id>",
        "address": "<contract-address>",
        "contractTemplateID": "<template-id>",
        "wlaId": "<wlaId>",
        "blockchain": "ETH",
        "network": "mainnet",
        "contractName": "My token v1",
        "contractType": "custom"
      }
    ],
    "totalItems": "1"
  }
}
```

**Keep from the response:** the contract instance `id`.

### 7. Check that the smart contract answers

Read its name with [Execute an EVM call](/protect-capital/reference/capital/contracts-evm-instance/call-evm). It is **read-only**: no approval and no fee.

Use the contract instance id (from step 6) here.

```bash
POST https://your-protect-instance.example.com/api/rest/v1/capital/contract-instances/<contract-instance-id>/evm/call
```

**`Request body`**

```json Request body
{
  "fromAddressID": "<address-id>",
  "data": "0x06fdde03"
}
```

Tip: You should be able to find the `fromAddressID` in the call you ran in step 3. Address ID ≠ Address itself.

`data` is the function selector: it tells the smart contract which function to run. `0x06fdde03` is the standard selector of `name()`. To read another value, use that function's selector, for example `0x95d89b41` for `symbol()`.

The answer in the sample is the token name, ABI-encoded in hexadecimal: its position, its length, then its characters. For "My Token":

```
…0020  …0008  4d7920546f6b656e…
 start  length  M y   T o k e n
```

### 8. Import it as a digital asset

**Who:** Capital Operator.

For you to view and manage the contract as a 'digital asset' in Taurus CAPITAL, import it with [Import a digital asset](/protect-capital/v3.58/reference/capital/digital-assets/import)

```bash
POST https://your-protect-instance.example.com/api/rest/v1/capital/digital-assets/import
```

**`Request body`**

```json Request body
{
  "issuerID": "<issuer-id>",
  "contractTemplateID": "<template-id>",
  "contractAddress": "<contract-address>",
  "contractInstanceID": "<contract-instance-id>",
  "digitalAssetType": "Equity",
  "issuanceName": "My token",
  "blockchain": "ETH",
  "network": "mainnet"
}
```

| Field                   | What to enter                                                                                                    |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `issuerID`              | The issuer of the token. Find it with [List issuers info](/protect-capital/reference/capital/issuers/list-info). |
| `contractTemplateID`    | The template ID from step 2                                                                                      |
| `contractAddress`       | The `contractAddress`                                                                                            |
| `contractInstanceID`    | The contract instance ID from step 6                                                                             |
| `digitalAssetType`      | The asset type, for example `Equity`                                                                             |
| `issuanceName`          | The name shown in Taurus-CAPITAL. It is not written to the blockchain.                                           |
| `blockchain`, `network` | The same as in step 3                                                                                            |

**Keep from the response:** the digital asset `id`.

The token now appears in Taurus-CAPITAL under **Digital assets → Smart contracts**, marked as imported.

## Errors

| Error                                        | Cause                                                                                                           | What to do                                                                                                     |
| -------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `E002-MISSING_GOVERNANCE_RULE`               | No contract interaction rule for this function and contract type. No request is created, and no fee is charged. | A SuperAdmin creates the rule, with `GENERIC` for a `Custom` template; once it is signed, send the call again. |
| `invalid signature`                          | The signature was made over a different hash, for example that of another request                               | Sign the `metadata.hash` of the request you approve. The error message shows the expected hash.                |
| The token is not listed in Taurus-CAPITAL    | The deployment creates a contract instance, not a digital asset                                                 | Import it (step 8).                                                                                            |
| A call rejected (reverted) by the blockchain | The function or its values do not match the smart contract, or the sending address does not hold the role       | Check the ABI and the sending address's role. The fee is still charged.                                        |