[CAP-68] Host function for getting executable for Address
#1626
Replies: 4 comments 12 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.
-
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