[CAP-68] Host function for getting executable for Address
#1626
Replies: 5 comments 21 replies
-
This is not stated in the CAP, but the Also if an address is given that has a ledger entry archived, will it panic rather than return None? I assume yes to this also. |
Beta Was this translation helpful? Give feedback.
-
The motivation for the This isn't too alarming to me, but just want to point out that this structure will be stored as a two-level nested Vec and so will cost a few host functions to construct, and it'll need to be constructed twice, the first to get back the value, the second to encode the expected value. For example: #[contracttype]
enum AddressExecutable {
Contract(ContractExecutable),
Account,
}
#[contracttype]
enum ContractExecutable {
Wasm(BytesN<32>),
StellarAsset,
} Those types will be stored as: Account:
Contract:
I suggest we flatten the type, since the depth only emphasises the difference between accoutns and contracts, when that difference isn't meaningful here. For example: #[contracttype]
enum AddressExecutable {
Account,
Asset,
Wasm(BytesN<32>),
} Which will stored as: Account:
Contract:
If the primary goal is to verify during invoking, we could also add an option to pass to invoking so that the type is only constructed guest side once. |
Beta Was this translation helpful? Give feedback.
-
I think these should be split into two more aptly titled CAPs, one for the address executable getter and one for the string<>byte conversions. Lumping them into one aggregated CAP that references a protocol version seems opaque and likely won't age well |
Beta Was this translation helpful? Give feedback.
-
Trying to understand better the stated use cases. Right now to me it seems to only really solve the "Is this a SAC?" use case reliably. Are other ecosystem exposing this type of information like that in a way that is usable? Are there example Soroban contracts for these? I am quite not sure how custom accounts would safely take advantage of this proposal.
|
Beta Was this translation helpful? Give feedback.
-
The CAP sets out to solve two problems noted at the top of the discussion:
The security guarantees of 2️⃣ are imperfect I think, given #1626 (reply in thread). If the change was only to be done for 1️⃣, maybe there are other ways to solve that problem. For example, if we dig into why folks are needing to identify the SAC, we could explore ways to remove that need so that contracts aren't distinguishing between the SAC and other tokens. If this has already been exhausted, no worries. |
Beta Was this translation helpful? Give feedback.
-
This is a discussion thread for CAP-68 - Host function for getting executable for
Address
CAP-68
This CAP provides a solution to the several issues encountered by the ecosystem developers:
Beta Was this translation helpful? Give feedback.
All reactions