milestones::set_treasury has no test proving it requires the admin's authorization

オープン
#556 コメント 4 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@sladeoj がすでに取り組んでいます。

2026年10月21日 から。

  • #582 @urielit1313-creator による — オープン
  • #757 @sladeoj による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
rust

調査の方向性

Read contracts/milestones/src/test.rs and inspect the existing set_treasury tests and authorization mocks. Add a positive test mocking only the admin and a negative test using another address, then run the milestones contract tests and verify the unauthorized call fails with the host auth error. A linked open pull request (#582) indicates this work may already be underway.

索引モデルが issue の本文から書いたものです。

説明

security Stellar Wave testing

Problem

Every milestones test that calls set_treasury runs under env.mock_all_auths(), which authorises every address. No test uses targeted env.mock_auths(&[MockAuth { address: <admin>, invoke: … fn_name: "set_treasury" … }]) or checks that a call signed by a different address fails. (In contracts/milestones/src/test.rs, targeted mocks exist only for no function at all.) If the require_auth() call were deleted or pointed at the wrong address, the suite would still pass. Escrow's equivalent test exists (though it currently fails, see the separate issue).

Suggested fix

Add a positive test that mocks only the admin's auth for set_treasury, and a negative test that mocks another address's auth and asserts the host auth error.

Related: #50

主要言語
Rust
スター
1
フォーク
102
平均マージ
4時間 12分
マージ済み PR(30日)
30

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

MergeFi/contracts のほかの issue

MergeFi/contracts の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。