What problem does your feature solve?
PR #21 (closing #6) adds support for funding contract addresses (C addresses) via the native Stellar Asset Contract (SAC). However, there's no guarantee that the native asset's SAC has been deployed on a given network and that change doesn't address this.
On established networks like testnet, the SAC is deployed as part of routine network setup. But on new or private networks (such as those created by the quickstart docker image), the SAC is not deployed by default.
When friendbot attempts to fund a contract address and the native asset's SAC is not deployed, the following error is returned:
{
"detail": "An error occurred while processing this request. This is usually due to a bug within the server software. Trying this request again may succeed if the bug is transient. Otherwise, please contact the system administrator.",
"status": 500,
"title": "Internal Server Error",
"type": "https://stellar.org/friendbot-errors/server_error"
}
This 500 error misleadingly suggests that friendbot has a bug or has been misconfigured, when the actual issue is simply that the network hasn't had its native asset SAC deployed.
What would you like to see?
Return a meaningful error message when contract funding fails due to the native asset's SAC not being deployed. For example:
{
"detail": "Contract funding is not possible because the native asset Stellar Asset Contract is not deployed. Deploy the contract and try again.",
"status": 400,
"title": "Bad Request",
"type": "https://stellar.org/friendbot-errors/bad_request"
}
The failure occurs during the RPC simulation phase. It would be reasonable to:
- Map simulation failures (likely a missing value error) to this user-friendly error message
- Continue returning 500 for other unexpected failures
What alternatives are there?
- Friendbot could deploy the SAC itself, but this seems outside its responsibilities as a faucet
- Keep the current behavior, but this creates confusion for developers on private networks
What problem does your feature solve?
PR #21 (closing #6) adds support for funding contract addresses (C addresses) via the native Stellar Asset Contract (SAC). However, there's no guarantee that the native asset's SAC has been deployed on a given network and that change doesn't address this.
On established networks like testnet, the SAC is deployed as part of routine network setup. But on new or private networks (such as those created by the quickstart docker image), the SAC is not deployed by default.
When friendbot attempts to fund a contract address and the native asset's SAC is not deployed, the following error is returned:
{ "detail": "An error occurred while processing this request. This is usually due to a bug within the server software. Trying this request again may succeed if the bug is transient. Otherwise, please contact the system administrator.", "status": 500, "title": "Internal Server Error", "type": "https://stellar.org/friendbot-errors/server_error" }This 500 error misleadingly suggests that friendbot has a bug or has been misconfigured, when the actual issue is simply that the network hasn't had its native asset SAC deployed.
What would you like to see?
Return a meaningful error message when contract funding fails due to the native asset's SAC not being deployed. For example:
{ "detail": "Contract funding is not possible because the native asset Stellar Asset Contract is not deployed. Deploy the contract and try again.", "status": 400, "title": "Bad Request", "type": "https://stellar.org/friendbot-errors/bad_request" }The failure occurs during the RPC simulation phase. It would be reasonable to:
What alternatives are there?