2

I read the guide from stellar.org but still couldn't find a solution. This is the guide:

https://www.stellar.org/developers/guides/issuing-assets.html https://www.stellar.org/developers/guides/concepts/assets.html#revoking-access

In their guide it says that as an anchor, I can freeze credit held by another account. I set the AUTHORIZATION REVOCABLE to true, but I still couldn't find how to freeze a specific account credit.

This was the code in the stellar guide

import org.stellar.sdk.AccountFlag;
Network.useTestNetwork();
Server server = new Server("https://horizon-testnet.stellar.org");
// Keys for issuing account
KeyPair issuingKeys = KeyPair
.fromSecretSeed("SCZANGBA5YHTNYVVV4C3U252E2B6P6F5T3U6MM63WBSBZATAQI3EBTQ4");
 AccountResponse sourceAccount = server.accounts().account(issuingKeys);

 Transaction setAuthorization = new Transaction.Builder(sourceAccount)
 .addOperation(new SetOptionsOperation.Builder()
  .setSetFlags(
   AccountFlag.AUTH_REQUIRED_FLAG.getValue() |
    AccountFlag.AUTH_REVOCABLE_FLAG.getValue())
   .build())
  .build();
 setAuthorization.sign(issuingKeys);
 server.submitTransaction(setAuthorization);

1 Answer 1

0

You can do this by revoking the authorization via the Allow Trust operation. The Bifrost code contains an example how the authorization is set for AUTH_REVOCABLE_FLAG assets.

build.AllowTrust(
    build.SourceAccount{ac.IssuerPublicKey},
    build.Trustor{trustor},
    build.AllowTrustAsset{tokenAssetCode},
    build.Authorize{true},
)

See: https://github.com/stellar/go/blob/master/services/bifrost/stellar/transactions.go#L37

You can revoke it later with the same command by setting build.Authorize{false}

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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