# NFT and Smart-Contracts

### Working with NFTs using the NFT scenario step&#x20;

When this step is completed, its return value (which you can save in any field) will include a hash as the result.

For example:&#x20;

```
{ "hash": "0x...." }
```

### Working with ERC-20 and ERC-721 from [JS SDK](/scenarios/editing-scenarios/action-steps/js-sdk-step.md)&#x20;

{% hint style="info" %}
We are supporting the execution of contracts on **Polygon** network.
{% endhint %}

We have 2 methods to call contracts:

```javascript
executeFunction(contract: String, method: String, in: AnyRef, out: AnyRef)
```

and helper method for quickly transferring Tokens (ERC-20) and NFTs (ERC-721)

<pre class="language-javascript"><code class="lang-javascript"><strong>transfer(`type`: String, contract: String, receiver: String, _value: Any = "")
</strong></code></pre>

### Sending Tokens to Any Address

```javascript
  var network = $D.crypto.network('polygon')
  var contractAddress = "0xc2132D05D31c914a87C6611C10748AEb04B58e8F" //USDT
  var wallet = network.wallet('... secret phrase ...')
  
  var inParam = [
    {"name": "_to", "value":"0x357...", "type": "address"},
    {"name": "_value", "value":1000, "type": "uint256"}             
  ]
  //execute method transfer on contract 0xc2132D05D31c914a87C6611C10748AEb04B58e8F (USDT) and sending 0.01 USDT
  var result = wallet.executeFunction(contractAddress, "transfer", inParam, [])
  $D.console.log("Show transaction on: https://polygonscan.com/tx/" + result['hash'])
```

Helper function for fast call execution contract for ERC-20 or ERC-721

```javascript
//init wallet
var network = $D.crypto.network('polygon')
var contractAddress = "0xc2132D05D31c914a87C6611C10748AEb04B58e8F" //USDT
var wallet = network.wallet('... secret phrase ...')
  
var result = wallet.transfer("erc20", contractAddress, "0x...reciver...", 10000)
$D.console.log("Show transaction on: https://polygonscan.com/tx/" + result['hash'] + '\n')
```

```javascript
//init wallet
var network = $D.crypto.network('polygon')
var contractAddress = "0xc2132D05D31c914a87C6611C10748AEb04B58e8F" //USDT
var wallet = network.wallet('... secret phrase ...')

var nftAddress = "0x2A11c19c33b59E1be2d1A684B0BE9F3e5cEaCf65"
var nftTokenID = "17095719063608835418704764119787869740203281679245365365248102562191638528001"
var result = wallet.transfer("erc721", nftAddress, "0x...reciver....", nftTokenID)
$D.console.log("Show transaction on: https://polygonscan.com/tx/" + result['hash'])
```


---

# 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://readme.directual.com/plugins/using-plugins/blockchain-web3/nft-and-smart-contracts.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.
