# unsafe\_payAllSui to same address

**URL:** <https://forums.sui.io/t/unsafe-payallsui-to-same-address/45638>\
**Category:** General\
**Tags:** feature\
**Created:** [May 28, 2024, 9:56am UTC](https://forums.sui.io/t/unsafe-payallsui-to-same-address/45638 "2024-05-28T09:56:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![uyabayu999](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/uyabayu999/32/30798_2.png) [@uyabayu999](https://forums.sui.io/u/uyabayu999)\
**Post date:** [May 28, 2024, 9:56am UTC](https://forums.sui.io/t/unsafe-payallsui-to-same-address/45638/1 "2024-05-28T09:56:31Z")

</div>

Hi there, I’ve tried to build a transaction using unsafe\_payAllSui using a same address as the signer and recipient. I did this to try to merge multiple (more than 2) coin objects into one instead of using unsafe\_mergeCoins which can only merge 2 coins at a time.

I thought it should reduce the SUI balance by the amount of the gas fee. But instead it added the gas fee amount to the balance.

I want to confirm, is this a bug or as expected?

This is the tx that I used:  
7RpPsey5HGp93LszXRhwWH7vrZWnCQpkrh4zKs5GmoP3

 ![Screenshot 2024-05-28 at 4.56.06 PM](https://europe1.discourse-cdn.com/sui/original/3X/e/0/e072a6d3a5eb65769a12d63503555f9c633d8bcb.png)

Update:  
The transactionBlockResponse:

```auto
{
  "jsonrpc": "2.0",
  "result": {
    "digest": "7RpPsey5HGp93LszXRhwWH7vrZWnCQpkrh4zKs5GmoP3",
    "transaction": {
      "data": {
        "messageVersion": "v1",
        "transaction": {
          "kind": "ProgrammableTransaction",
          "inputs": [
            {
              "type": "pure",
              "valueType": "address",
              "value": "0xab381cdbf66142a5c56459a04bcf6b409303c31631248aac00a8ecf8bd1483de"
            }
          ],
          "transactions": [
            {
              "TransferObjects": [
                [
                  "GasCoin"
                ],
                {
                  "Input": 0
                }
              ]
            }
          ]
        },
        "sender": "0xab381cdbf66142a5c56459a04bcf6b409303c31631248aac00a8ecf8bd1483de",
        "gasData": {
          "payment": [
            {
              "objectId": "0x09c1e0f2301fa6c2d76c97db9a7ceec03fdda1dd1ee9c6a10801c6ee9fe2348f",
              "version": 165659991,
              "digest": "E4HJRr8Ae6EBXSgEkB4VBw9Dnp41ZpHCaQY4suafedNq"
            },
            {
              "objectId": "0xad5a0e08a45ecf6b4aafbca800dc40383c0110aa58fca86704e2139c5d939a3e",
              "version": 165659992,
              "digest": "2gYBGwPEiQ8CYaaoAhJ4qzhZZAagDspmNGssssY7RK8z"
            }
          ],
          "owner": "0xab381cdbf66142a5c56459a04bcf6b409303c31631248aac00a8ecf8bd1483de",
          "price": "750",
          "budget": "10000000"
        }
      },
      "txSignatures": [
        "AGkFAi1hjrnU9GSttw1riGGsdDid9Dtj5vkq9QZCIlp+6qxTz4ZAdekvC106UWfKyazp3z4X5rbmD6Vm1TosZQO+Uuc14czHc1oMZOl39j9VUKSZzewN3Cx7PDiaO8LHDA=="
      ]
    },
    "effects": {
      "messageVersion": "v1",
      "status": {
        "status": "success"
      },
      "executedEpoch": "410",
      "gasUsed": {
        "computationCost": "750000",
        "storageCost": "988000",
        "storageRebate": "1956240",
        "nonRefundableStorageFee": "19760"
      },
      "modifiedAtVersions": [
        {
          "objectId": "0x09c1e0f2301fa6c2d76c97db9a7ceec03fdda1dd1ee9c6a10801c6ee9fe2348f",
          "sequenceNumber": "165659991"
        },
        {
          "objectId": "0xad5a0e08a45ecf6b4aafbca800dc40383c0110aa58fca86704e2139c5d939a3e",
          "sequenceNumber": "165659992"
        }
      ],
      "transactionDigest": "7RpPsey5HGp93LszXRhwWH7vrZWnCQpkrh4zKs5GmoP3",
      "mutated": [
        {
          "owner": {
            "AddressOwner": "0xab381cdbf66142a5c56459a04bcf6b409303c31631248aac00a8ecf8bd1483de"
          },
          "reference": {
            "objectId": "0x09c1e0f2301fa6c2d76c97db9a7ceec03fdda1dd1ee9c6a10801c6ee9fe2348f",
            "version": 165659993,
            "digest": "BhVLpjgT3XyaAw252upvKd63UodsdqfntQJdBGvRG8vA"
          }
        }
      ],
      "deleted": [
        {
          "objectId": "0xad5a0e08a45ecf6b4aafbca800dc40383c0110aa58fca86704e2139c5d939a3e",
          "version": 165659993,
          "digest": "7gyGAp71YXQRoxmFBaHxofQXAipvgHyBKPyxmdSJxyvz"
        }
      ],
      "gasObject": {
        "owner": {
          "AddressOwner": "0xab381cdbf66142a5c56459a04bcf6b409303c31631248aac00a8ecf8bd1483de"
        },
        "reference": {
          "objectId": "0x09c1e0f2301fa6c2d76c97db9a7ceec03fdda1dd1ee9c6a10801c6ee9fe2348f",
          "version": 165659993,
          "digest": "BhVLpjgT3XyaAw252upvKd63UodsdqfntQJdBGvRG8vA"
        }
      },
      "dependencies": [
        "8d4C837B6EXRBo16PAJQ1EWWKFxLgNEAnR152pS713dW",
        "E4vxWTzwcLPr9M8gcnEFMQUhDqViCy3Qx352wzSnJPPA"
      ]
    },
    "objectChanges": [
      {
        "type": "mutated",
        "sender": "0xab381cdbf66142a5c56459a04bcf6b409303c31631248aac00a8ecf8bd1483de",
        "owner": {
          "AddressOwner": "0xab381cdbf66142a5c56459a04bcf6b409303c31631248aac00a8ecf8bd1483de"
        },
        "objectType": "0x2::coin::Coin<0x2::sui::SUI>",
        "objectId": "0x09c1e0f2301fa6c2d76c97db9a7ceec03fdda1dd1ee9c6a10801c6ee9fe2348f",
        "version": "165659993",
        "previousVersion": "165659991",
        "digest": "BhVLpjgT3XyaAw252upvKd63UodsdqfntQJdBGvRG8vA"
      }
    ],
    "balanceChanges": [
      {
        "owner": {
          "AddressOwner": "0xab381cdbf66142a5c56459a04bcf6b409303c31631248aac00a8ecf8bd1483de"
        },
        "coinType": "0x2::sui::SUI",
        "amount": "218240"
      }
    ],
    "confirmedLocalExecution": true
  },
  "id": 1
}

```

---

<div class="post-metadata">

**Author:** ![uyabayu999](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/uyabayu999/32/30798_2.png) [@uyabayu999](https://forums.sui.io/u/uyabayu999)\
**Post date:** [May 29, 2024, 2:49am UTC](https://forums.sui.io/t/unsafe-payallsui-to-same-address/45638/4 "2024-05-29T02:49:13Z")

</div>

No, I haven’t. Maybe I’ll try to reproduce it to check the result again.

---

<div class="post-metadata">

**Author:** ![uyabayu999](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/uyabayu999/32/30798_2.png) [@uyabayu999](https://forums.sui.io/u/uyabayu999)\
**Post date:** [May 30, 2024, 2:53am UTC](https://forums.sui.io/t/unsafe-payallsui-to-same-address/45638/6 "2024-05-30T02:53:23Z")

</div>

Sorry, I can’t find the live chat button. Where can I find it?

---

<div class="post-metadata">

**Author:** ![fastfrank](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/fastfrank/32/1138_2.png) [@fastfrank](https://forums.sui.io/u/fastfrank)\
**Post date:** [May 30, 2024, 9:27am UTC](https://forums.sui.io/t/unsafe-payallsui-to-same-address/45638/8 "2024-05-30T09:27:59Z")

</div>

HPO2 is spam, do not interact with it

---

<div class="post-metadata">

**Author:** ![uyabayu999](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/uyabayu999/32/30798_2.png) [@uyabayu999](https://forums.sui.io/u/uyabayu999)\
**Post date:** [May 30, 2024, 9:34am UTC](https://forums.sui.io/t/unsafe-payallsui-to-same-address/45638/9 "2024-05-30T09:34:39Z")

</div>

Yeah thanks for the heads up. I opened the link and it showed unsafe site warning.
