[Contracts] Require auth in mint_stream_position and stop overloading token_address
Overview & Background
mint_stream_position never calls require_auth — anyone can mint position metadata for any stream_id without the sender/recipient consenting, contradicting its own doc ("Position metadata is generated upon stream creation and linked to the stream's sender and recipient"), and no creation path calls it at all. Worse, it saves token_address: sender and token_address: recipient into StreamPositionMetadata.token_address, overloading a token-address field with account addresses, while StreamPositionCreatedEvent emits the real token under the same field name — storage and events disagree about what the field means. update_position_on_transfer later assigns position.token_address = new_recipient, confirming the field is used as an owner slot.
Technical Specification & Architecture
- In
contracts/stream_contract/src/lib.rs:884-954, require the stream's sender/recipient auth (or mint from insidecreate_stream). - Rename the field to
owneror split intoowner+token_address(types.rs:113), and make events consistent. - Add auth-negative tests: a third party minting a position must fail.
Target Files
contracts/stream_contract/src/lib.rscontracts/stream_contract/src/types.rscontracts/stream_contract/src/events.rs
Acceptance Criteria
- [ ]
mint_stream_positionrequires sender or recipient authorization. - [ ] Position metadata distinguishes owner address from token address.
- [ ] Events and storage use consistent field semantics.
- [ ] Negative auth tests exist for all position entrypoints.
@Kami-no-san has applied to work on this issue as part of the Stellar Wave Program's 11th wave.
Hi Maintainer,
I’d like to take this on. I will enforce sender/recipient authorization in
mint_stream_position(contracts/stream_contract/src/lib.rs), separate owner and token address semantics consistently acrossStreamPositionMetadata(types.rs) and events (events.rs), and add negative authorization tests covering unauthorized third-party calls across position entrypoints.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Kami-no-san to this issue.
@wagmiiii has applied to work on this issue as part of the Stellar Wave Program's 11th wave.
i have experience
ℹ️ Repo Maintainers: To accept this application, review their application or assign @wagmiiii to this issue.
Congratulations, @wagmiiii! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on November 25, 2026.
🧑💻 @wagmiiii: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊
This issue has been completed by @wagmiiii as part of the Stellar Wave Program's 11th Wave 🥳
😎 @wagmiiii: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.