stellar / rs-soroban-sdk

Rust SDK for Soroban contracts.
Apache License 2.0
112 stars 61 forks source link

Add a token interface for the SAC. #945

Open sisuresh opened 1 year ago

sisuresh commented 1 year ago

There have been some questions around if functions like clawback and set_admin (some context around set_admin) should be included in the token interface. We should add another interface in the SDK that users should implement, and leave the existing one in there if you want to use SAC specific admin functionality. My thoughts on this from here are quoted below -

I have been thinking about if there are any admin methods in the interface that should be pulled out because they're specific to Stellar assets and can be implemented as an extension to the interface (clawback() is a good example of this). I can see the argument for removing set_admin as well since administrative type methods are typically used as one-off calls (and are more likely to require custom logic/function signature). Custom tokens shouldn't have to implement methods that they don't need either. The EIP-20 interface is actually quite bare, which makes it easier to implement tokens.

Discord thread with a discussion about this here.

sisuresh commented 1 year ago

The interfaces were split in https://github.com/stellar/rs-soroban-sdk/pull/1012. We still need to provide a single interface to interact with the SAC. This can be done by exposing a trait that combines the Client and AdminClient.