3

If asset issuer account has been merged with another account what happens to assets by the account and trustlines created to that account?

2

Let's say you want to merge account X to account Y.

X cannot hold any offers or trustlines (therefore, no assets), according to the source code.

https://github.com/stellar/go/blob/e0ffe19f58879d3c31e2976b97a5bf10e13a337b/xdr/xdr_generated.go#L3873


Otherwise, the operation will fail with "op_has_sub_entries".

And account X will be charged 100 stroops txFee, and seq_num += 1.

{
  "type": "https://stellar.org/horizon-errors/transaction_failed",
  "title": "Transaction Failed",
  "status": 400,
  "detail": "The transaction failed when submitted to the stellar network. The `extras.result_codes` field on this response contains further details.  Descriptions of each code can be found at: https://www.stellar.org/developers/learn/concepts/list-of-operations.html",
  "extras": {
    "envelope_xdr": "AAAAAAWb/DbpS8kPxCqdXLV+Az4ibTOwxPLFDqbAmDc3/vG/AAAAZACD6qIAAAACAAAAAAAAAAAAAAABAAAAAAAAAAgAAAAAFZy28/5fhGoXqWueZaco8fRv25qq2EslnODyi8naNNMAAAAAAAAAATf+8b8AAABA/tFZ+/M6he+cbYoLXnBOkT9Hzh0AsliSXNu0vrzbBLHNKIUwAAxhafcPu49EFOKk7/9RooD2Q6zchw8X3pRSDQ==",
    "result_codes": {
      "transaction": "tx_failed",
      "operations": [
        "op_has_sub_entries"
      ]
    },
    "result_xdr": "AAAAAAAAAGT/////AAAAAQAAAAAAAAAI/////AAAAAA="
  }
}

[EDIT]

So, if you want to merge X to Y, you need to destroy all its trustlines and offers first.


[Additional info]

If you possess balance > 0 for an asset and try to directly Change Trust to 0, you will experience "op_invalid_limit" error. You need to transfer away every asset until its balance is 0, and then Change Trust every asset to TrustLimit=0.

1

You cannot merge accounts that have subentries (trustlines, offers, data).

Subentries can be found by going to https://horizon.stellar.org/accounts/<your_account_id> and searching for the subentry_count field.

You can find more information about the merge operation in the docs here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.