unsafe_payAllSui to same address

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

Update:
The transactionBlockResponse:

{
  "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
}
1 Like

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

1 Like

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

1 Like

HPO2 is spam, do not interact with it

1 Like

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

1 Like