Skip to content

Commit

Permalink
Add support for memos in Soroban auth (CAP-64). (#229) (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmkozh authored Feb 5, 2025
1 parent 770e1f5 commit 57df794
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Stellar-ledger-entries.x
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,8 @@ enum EnvelopeType
ENVELOPE_TYPE_OP_ID = 6,
ENVELOPE_TYPE_POOL_REVOKE_OP_ID = 7,
ENVELOPE_TYPE_CONTRACT_ID = 8,
ENVELOPE_TYPE_SOROBAN_AUTHORIZATION = 9
ENVELOPE_TYPE_SOROBAN_AUTHORIZATION = 9,
ENVELOPE_TYPE_SOROBAN_AUTHORIZATION_V2 = 10
};

enum BucketListType
Expand Down
27 changes: 26 additions & 1 deletion Stellar-transaction.x
Original file line number Diff line number Diff line change
Expand Up @@ -569,10 +569,22 @@ struct SorobanAddressCredentials
SCVal signature;
};

struct SorobanAddressCredentialsV2
{
ExtensionPoint ext;

SCAddress address;
int64 nonce;
uint32 signatureExpirationLedger;
Memo txMemo;
SCVal signature;
};

enum SorobanCredentialsType
{
SOROBAN_CREDENTIALS_SOURCE_ACCOUNT = 0,
SOROBAN_CREDENTIALS_ADDRESS = 1
SOROBAN_CREDENTIALS_ADDRESS = 1,
SOROBAN_CREDENTIALS_ADDRESS_V2 = 2
};

union SorobanCredentials switch (SorobanCredentialsType type)
Expand All @@ -581,6 +593,8 @@ case SOROBAN_CREDENTIALS_SOURCE_ACCOUNT:
void;
case SOROBAN_CREDENTIALS_ADDRESS:
SorobanAddressCredentials address;
case SOROBAN_CREDENTIALS_ADDRESS_V2:
SorobanAddressCredentialsV2 addressV2;
};

/* Unit of authorization data for Soroban.
Expand Down Expand Up @@ -729,6 +743,17 @@ case ENVELOPE_TYPE_SOROBAN_AUTHORIZATION:
uint32 signatureExpirationLedger;
SorobanAuthorizedInvocation invocation;
} sorobanAuthorization;
case ENVELOPE_TYPE_SOROBAN_AUTHORIZATION_V2:
struct
{
ExtensionPoint ext;

Hash networkID;
int64 nonce;
uint32 signatureExpirationLedger;
Memo txMemo;
SorobanAuthorizedInvocation invocation;
} sorobanAuthorizationV2;
};

enum MemoType
Expand Down

0 comments on commit 57df794

Please sign in to comment.