# Transfer ERC1155 from contract to user

**URL:** <https://forum.openzeppelin.com/t/transfer-erc1155-from-contract-to-user/33069>\
**Category:** Smart Contracts\
**Tags:** erc1155\
**Created:** [November 11, 2022, 3:53am UTC](https://forum.openzeppelin.com/t/transfer-erc1155-from-contract-to-user/33069 "2022-11-11T03:53:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexbakers](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/alexbakers/32/16092_2.png) [@alexbakers](https://forum.openzeppelin.com/u/alexbakers)\
**Post date:** [November 11, 2022, 3:53am UTC](https://forum.openzeppelin.com/t/transfer-erc1155-from-contract-to-user/33069/1 "2022-11-11T03:53:07Z")

</div>

Hello.

How to transfer ERC1155 from contract `address(this)` to user?

Contract owner erc1155 -\> User

ERC20 - Nice

```auto
        IERC20(0x326C977E6efc84E512bB9C30f76E30c160eD06FB).transfer(
            0x7aD5F9a2d9c4AaaE19FCAd229d9652d9E6eC7c63,
            3 wei
        );

```

ERC20 - Error

```auto
        IERC20(0x326C977E6efc84E512bB9C30f76E30c160eD06FB).transferFrom(
            address(this),
            0x7aD5F9a2d9c4AaaE19FCAd229d9652d9E6eC7c63,
            3 wei
        );

```

ERC1155 - Error

```auto
        uint256[] memory a;
        a[0] = 10;
        uint256[] memory b; 
        b[0] = 2;
        IERC1155(0x1b0024Bd52F837B36eF73A507FC6e26212dB3324).safeBatchTransferFrom(
            address(this),
            0x7aD5F9a2d9c4AaaE19FCAd229d9652d9E6eC7c63,
            a,
            b,
            ""
        );

```

Is there an similar function `ERC20.transfer` in `ERC1155`?

---

<div class="post-metadata">

**Author:** ![alexbakers](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/alexbakers/32/16092_2.png) [@alexbakers](https://forum.openzeppelin.com/u/alexbakers)\
**Post date:** [November 11, 2022, 4:34am UTC](https://forum.openzeppelin.com/t/transfer-erc1155-from-contract-to-user/33069/2 "2022-11-11T04:34:13Z")

</div>

> [@alexbakers](#):
>
> ```auto
> uint256[] memory a;
> a[0] = 10;
> uint256[] memory b; 
> b[0] = 2;
> 
> ```

Hmm..

Success:

```auto
        uint256[] memory a = new uint256[](1);
        a[0] = 10;
        uint256[] memory b = new uint256[](1); 
        b[0] = 1;
        IERC1155(0x1b0024Bd52F837B36eF73A507FC6e26212dB3324).safeBatchTransferFrom(
            address(this),
            0x7aD5F9a2d9c4AaaE19FCAd229d9652d9E6eC7c63,
            a,
            b,  
            ""
        );

```

Error:

```auto
        uint256[] memory a;
        a[0] = 10;
        uint256[] memory b; 
        b[0] = 2;
        IERC1155(0x1b0024Bd52F837B36eF73A507FC6e26212dB3324).safeBatchTransferFrom(
            address(this),
            0x7aD5F9a2d9c4AaaE19FCAd229d9652d9E6eC7c63,
            a,
            b,
            ""
        );

```

---

<div class="post-metadata">

**Author:** ![frangio](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/frangio/32/15251_2.png) [@frangio](https://forum.openzeppelin.com/u/frangio)\
**Post date:** [November 24, 2022, 12:09am UTC](https://forum.openzeppelin.com/t/transfer-erc1155-from-contract-to-user/33069/4 "2022-11-24T00:09:49Z")

</div>

ERC1155's `safeTransferFrom` and `safeBatchTransferFrom` should have worked in this situation. The error is somewhere else.
