# deploy

Will deploy a compiled smart contract to the blockchain with the provided input parameters. The GAS cost for deploying the contract will be calculated by the provider, and displayed to the user upon tx acceptance or rejection.

## **Input Arguments**

<table><thead><tr><th width="353">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>network?: string</code></td><td>Network to submit this request to. If omitted, will default to network the wallet is currently set to</td></tr><tr><td><code>name: string</code></td><td>The name of the contract to be deployed</td></tr><tr><td><code>version: string</code></td><td>The version of the contract to be deployed</td></tr><tr><td><code>author: string</code></td><td>The author of the contract to be deployed</td></tr><tr><td><code>email: string</code></td><td>The email of the contract to be deployed</td></tr><tr><td><code>description: string</code></td><td>The description of the contract to be deployed</td></tr><tr><td><code>needsStorage?: boolean</code></td><td>Whether or not the contract will use storage</td></tr><tr><td><code>dynamicInvoke?: boolean</code></td><td>Whether or not the contract will be performing dynamic invocations of other smart contracts</td></tr><tr><td><code>isPayable?: boolean</code></td><td>Whether or not the contract will be able to accept native assets</td></tr><tr><td><code>parameterList: string</code></td><td>The list of input argument types for the Main function on the contract. https://docs.neo.org/en-us/sc/Parameter.html</td></tr><tr><td><code>returnType: string</code></td><td>The list of output returnType argument types. https://docs.neo.org/en-us/sc/Parameter.html</td></tr><tr><td><code>code: string</code></td><td>The hex of the compiled smart contract avm</td></tr><tr><td><code>netowrkFee: number</code></td><td>The network fee to execute the transaction, in addition to the deploy fee which will be added automatically</td></tr><tr><td><code>broadcastOverride?: boolean</code></td><td>In the case that the dApp would like to be responsible for broadcasting the signed transaction rather than the wallet provider</td></tr></tbody></table>

## **Success Response**

In the case where the "broadcastOverride" input argument is not set, or set to false.

<table><thead><tr><th width="275">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>txid: string</code></td><td>The transaction ID of the invocation</td></tr><tr><td><code>nodeURL: string</code></td><td>The node which the transaction was broadcast to. Returned if transaction is broadcast by wallet</td></tr></tbody></table>

In the case where the "broadcastOverride" input argument is set to True.

<table><thead><tr><th width="280">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>txid: string</code></td><td>The transaction ID of the invocation</td></tr><tr><td><code>signedTx: string</code></td><td>The serialized signed transaction. Only returned if the broadcastOverride input argument was set to True</td></tr></tbody></table>

## **Error Response**

<table><thead><tr><th width="278">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>type: string</code></td><td>The type of error which has occured</td></tr><tr><td><code>description: string</code></td><td>A description of the error which has occured</td></tr><tr><td><code>data: string</code></td><td>Any raw data associated with the error</td></tr></tbody></table>

## Example

### Request

```js
neoline.deploy({
  network: 'TestNet',
  name: 'Hello world!',
  version: 'v1.0.0',
  author: 'NEOLine',
  email: 'info@neoline.network',
  description: 'My first contract.',
  needsStorage: true,
  dynamicInvoke: false,
  isPayable: false,
  parameterList: '0710',
  returnType: '05',
  code: '53c56b0d57616b652075702c204e454f21680f4e656f2e52756e74696d652e4c6f6761006c7566',
  networkFee: '0.001'
})
.then(({txid, nodeURL}: InvokeOutput) => {
  console.log('Deploy transaction success!');
  console.log('Transaction ID: ' + txid);
  console.log('RPC node URL: ' + nodeURL);
})
.catch((error) => {
  const {type, description, data} = error;
  switch(type) {
    case UNKNOWN_ERROR:
        console.log(description);
        break;
    default:
        // Not an expected error object.  Just write the error to the console.
        console.error(error);
        break;
  }
});
```

### Response

```js
{
  txid: '629b5f35e42aa6b65cd97ae3a95f89547596f4e2783c8778428c7f32df07918e',
  nodeUrl: 'https://testnet.api.neoline.io'
};  
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tutorial.neoline.io/reference/neo2-provider-api/write-methods/deploy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
