Skip to content

feat(escrow): implement relayer staking collateral escrow (sdk 20 com…#313

Open
Danielobito009 wants to merge 1 commit into
StellarFlow-Network:mainfrom
Danielobito009:feature/relayer-staking-escrow
Open

feat(escrow): implement relayer staking collateral escrow (sdk 20 com…#313
Danielobito009 wants to merge 1 commit into
StellarFlow-Network:mainfrom
Danielobito009:feature/relayer-staking-escrow

Conversation

@Danielobito009
Copy link
Copy Markdown

Summary
Implements Issue #259 — Automated Relayer Staking Collateral Escrow

Changes

  • initialize(env, token) — stores SAC token address in instance storage
  • deposit_stake(env, relayer, amount) — pulls tokens from relayer into escrow
  • withdraw_stake(env, relayer, amount) — returns tokens to relayer with auth check
  • get_stake(env, relayer) — returns current staked balance

SDK Compatibility (soroban-sdk 20.0.0)

  • Used token::TokenClient (not TokenClient v21 variant)
  • Used env.register_contract() and register_stellar_asset_contract()
  • Removed sdk 21+ shorthands (register, _v2 variants)

Security

  • require_auth() on all state-changing functions
  • Checks-effects-interactions pattern in withdraw_stake
  • Amount validation (> 0) enforced

Testing

  • All functions covered
  • mock_all_auths() applied correctly
  • Unauthorized access rejection tested

Closes #259

…patible)

- Add deposit_stake, withdraw_stake, get_stake, initialize functions
- Integrate SAC token via token::TokenClient
- Fix sdk 20 compatibility: TokenClient, register_contract, register_stellar_asset_contract
- Apply checks-effects-interactions pattern in withdraw_stake
- Full test suite with mock_all_auths
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@Danielobito009 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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

Successfully merging this pull request may close these issues.

💸 Contracts | Automated Relayer Staking Collateral Escrow

2 participants