# Deploy Restricted PIM Factory

## Introduction

The restricted pim factory deployment is almost the same process as the default factory. The only difference being that the user has to pass `factoryType: 'restricted-pim'`  approve their collateral tokens for the pim-factory and pass the extra parameters required by the factory.

## **Setup Requirements**

The guide includes code snippets for Inverter Network's TypeScript SDK. Please refer to the relevant code snippets based on the SDK you are using.

1. **Set up Inverter Network SDK**: Refer to the Quick Start guides for detailed instructions. See the [React SDK Guide](https://docs.inverter.network/sdk/react-sdk) or [TypeScript SDK Guide](https://docs.inverter.network/sdk/typescript-sdk) for more information.
2. **Deploy a Workflow**: Refer to the Deploy a Workflow guide for detailed instructions. See the [React SDK Guide ](https://docs.inverter.network/sdk/react-sdk/deploy-a-workflow)or [TypeScript SDK Guide](https://docs.inverter.network/sdk/typescript-sdk/deploy-a-workflow) for more information.
3. **Retrieve a deployed Workflow**: Refer to the Operate a Workflow guide for detailed instructions. See the [React SDK Guide](https://docs.inverter.network/sdk/react-sdk/operate-a-workflow) or [TypeScript SDK Guide](https://docs.inverter.network/sdk/typescript-sdk/operate-a-workflow) for more information.

* **Optionally if your setup needs a specific contract**: Refer to the Deploy a Contract Guide for detailed instructions. See the [React SDK](https://docs.inverter.network/sdk/react-sdk/deploy-a-contract) Guide or [TypeScript SDK](https://docs.inverter.network/sdk/typescript-sdk/deploy-a-contract) Guide for more information.

## Args

<pre class="language-typescript" data-overflow="wrap"><code class="lang-typescript">import type { RequestedModule } from '@inverter-network/sdk'

const requestedModules = {
    fundingManager: 'FM_BC_Restricted_Bancor_Redeeming_VirtualSupply_v1',
    authorizer: 'AUT_Roles_v1',
    paymentProcessor: 'PP_Simple_v1',
  } as const satisfies RequestedModules&#x3C;'restricted-pim'>

<strong>const deploymentParameters = (
</strong>  factoryType: 'restricted-pim',
  requestedModules
}
</code></pre>

## Set Up Arguments

Bancor formula and supported chains can be found here: <https://github.com/InverterNetwork/deployments/tree/main/deployments>&#x20;

{% code overflow="wrap" %}

```typescript
const FORMATTED_MAX_UINT = '115792089237316195423570985008687907853269984665640564039457.584007913129639935' as const // Human Readable MAX_UINT

const curveShape = {
  Basic: {
    reserveRatioForBuying: 333_333, // PPM
    reserveRatioForSelling: 333_333, // PPM
    initialIssuanceSupply: '200002.999999999999998676',
    initialCollateralSupply: '296.306333665498798599',
  },
} as const

const args = {
    authorizer: {
      initialAdmin: <admin_address>,
    },
    fundingManager: {
      bondingCurveParams: {
        formula: <bancor_formula>,
        buyFee: <BPS_Amount>,
        sellFee: <BPS_Amount>,
        buyIsOpen: true,
        sellIsOpen: true,
        ...curveShape.Basic,
      },
      collateralToken: <collateral_token_address>,
    },
    issuanceToken: {
      name: <name_of_the_token>,
      symbol: <symbol_of_the_token>,
      decimals: <decimals_of_the_token>,
      maxSupply: FORMATTED_MAX_UINT
    },
    beneficiary: <beneficiary_address>
  } as const satisfies GeDeployWorkflowArgs<typeof requestedModules, 'restricted-pim'>
```

{% endcode %}

## Run The Deployment

Note: Approving of the initial collateral deposit is handled by the run&#x20;

```typescript
const {
    orchestratorAddress,
    transactionHash
} = await run(args, {
    confirmations: 1,
    onHash: (hash) => {console.log(hash)},
    onConfirmation: (receipt) => {console.log(receipt)},
    onApprove: (receipts) => {console.log(receipts)}
})
```
