Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

services/friendbot: support contract addresses #5471

Open
kalepail opened this issue Sep 21, 2024 · 3 comments
Open

services/friendbot: support contract addresses #5471

kalepail opened this issue Sep 21, 2024 · 3 comments

Comments

@kalepail
Copy link

What problem does your feature solve?

Contracts can hold value and with the rise of smart wallets being able to airdrop funds to contracts will be increasingly important.

What would you like to see?

e.g. rpc.requestAirdrop(contractId) should work vs:

{
  "type": "https://stellar.org/horizon-errors/bad_request",
  "title": "Bad Request",
  "status": 400,
  "detail": "The request you sent was invalid in some way.",
  "extras": {
    "invalid_field": "addr",
    "reason": "invalid version byte"
  }
}

What alternatives are there?

You have to fund a G-address and then use the SAC interface to move funds from the G-address to your C-address. It's a bit cumbersome.

@leighmcculloch leighmcculloch transferred this issue from stellar/soroban-rpc Sep 21, 2024
@leighmcculloch leighmcculloch changed the title Friendbot needs to support contract addresses services/friendbot: support contract addresses Sep 21, 2024
@leighmcculloch
Copy link
Member

leighmcculloch commented Sep 21, 2024

I think it makes sense for Friendbot to be able to fund all token holding address types.

However it’s unclear to me how valuable/priority that is, because the main reason folks need the native asset on testnet is to pay fees. Contracts can’t pay fees. Therefore contracts have much less use for native.

For everything else other than fees developers don’t need the native asset, they can use any other issued asset.

Since contracts can’t pay fees, likely a contract developer has a G account and will fund it, and use it to submit transactions involving C. Soon that’ll be an easy command from the cli.

For the edge cases where a developer needs native, they already have a G to get some from. So edge cases have a solution although that’s edge cases, not all devs.

@leighmcculloch
Copy link
Member

@kalepail could you elaborate on there situation where you need a C address to have native?

@kalepail
Copy link
Author

It's one of the easiest transactions to test with on the dapp side. When you're developing with a smart wallet or working with a contract that will deal in an asset, which is nearly always, having easy ready access to the native token would speed up dev time significantly. Dealing with custom assets is very cumbersome as you have to configure trustlines, flags, actually do the issuing, use the CLI or craft some helper function just to get the assets from the G to C address. The native asset makes that all much simpler as you don't have to fiddle with any of the setup or worry about what kind of address you're sending to.

So my angle is from the devX as smart wallets become more popular, or even as a means to ensure their adoption is smooth and painless this would be a very nice and obvious feature to add. It's honestly quite odd that this doesn't work from someone coming at Stellar from the Soroban-first approach.

In my world most devs new to Stellar will know much more about the C-address than the G-address so we should be optimizing for that narrative vs expecting everyone to know and understand both G and C address quirks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants