# Smart Contract - Write

Write a function means that you can basically run smart contract functions that will "Write" data on blockchain. \
For example, minting a NFT token is writing a function, so you write (basically store like in a database) data on blockchain that you have minted an NFT.

### &#x20;<mark style="background-color:blue;">Parameters</mark>&#x20;

<table><thead><tr><th width="183">Parameter name</th><th width="98.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>Contract address</td><td>Text</td><td>Smart Contract Address</td></tr><tr><td>ABI</td><td>Text</td><td>Contract ABI. After contract deployment the ABI doesn't change, therefore it can be saved in your database and get it from there when needed.<br>More about ABI see <a href="../smart-contract-read#more-about-abi">here</a></td></tr><tr><td>Action name</td><td>Text</td><td>This is the function name from the contract that you want to use. Case sensitive, make sure it is exactly as in the contract, for example: <em>isOwner</em> or <em>balanceOf</em><br>See <a href="../smart-contract-read#find-all-contract-functions-and-parameters">here</a> where to find all contract functions and its parameters</td></tr><tr><td>Parameter 1 - Parameter 8</td><td>Text</td><td>All are optional, if the contract requires 1 parameter, for example a wallet address, set it in the <em>Parameter 1</em> and leave the rest empty</td></tr><tr><td>Transaction Value</td><td>Text</td><td>Optional.<br>This parameter is used when the write action needs to be paid in ETH (chain native token). It will be auto-converted to wei.<br>For example a <em>mint</em> function that requires ETH as payment, use this parameter in that case, instead of the parameters from the above.</td></tr><tr><td>Gas Price</td><td>Text</td><td>Optional.<br>Useful when you want to make sure the tx will confirm fast. There's no need to indicate a <em>priority fee</em> separately, just use this parameter.</td></tr><tr><td>Gas Limit</td><td>Number</td><td>Optional. Max amount to be spent on gas.</td></tr></tbody></table>

### More about parameters:

Even if the parameters are text type, when you set a boolean or a number, it will be auto converted from text in the plugin.

For example, if it is a simple 1 parameter that must be a number (let's say 42), it will look like this:\
\
**Parameter 1**:

```
42
```

\
Another example, If a parameter is an array type with multiple data, set it all in one parameter by indicating the square brackets, make sure to use double quotes when it is string type.\
For example:\
\
**Parameter 1**:

```
["0x10ed43c718714eb63d5aa57b78b54704e256024e",true,1]
```

### &#x20;<mark style="background-color:blue;">Events</mark>&#x20;

See all [from common events](https://docs.novabloq.com/web3-metamask/elements-details/web3-and-metamask/..#common-events)

### &#x20;<mark style="background-color:blue;">States</mark>&#x20;

<table><thead><tr><th width="224.33333333333331">State name</th><th width="87">Type</th><th>Description</th></tr></thead><tbody><tr><td>Contract Write - Result</td><td>Text</td><td>Result will be converted to text, for example if it is JSON, you will have to parse it using regex or if it is number you will have to convert it to number type</td></tr></tbody></table>

Also *Transaction status* and *Transaction Hash ID* see in [common states](https://docs.novabloq.com/web3-metamask/elements-details/web3-and-metamask/..#common-states)
