maintenance-pool::sweep has no test proving it requires the admin's authorization

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

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

@urielit1313-creator がすでに取り組んでいます。

2026年10月13日 から。

  • #580 @urielit1313-creator による — オープン

評価

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

調査の方向性

Start in contracts/maintenance-pool/src/test.rs and compare the targeted authorization mocks used for upgrade with the tests that call sweep under env.mock_all_auths(). Add positive coverage for admin authorization and negative coverage for another address, asserting the host auth error; the tests should fail if sweep does not require the admin's authorization. A linked open pull request (#580) indicates work may already be underway.

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

説明

security testing

Problem

Every maintenance-pool test that calls sweep runs under env.mock_all_auths(), which authorises every address. No test uses targeted env.mock_auths(&[MockAuth { address: <admin>, invoke: … fn_name: "sweep" … }]) or checks that a call signed by a different address fails. (In contracts/maintenance-pool/src/test.rs, targeted mocks exist only for upgrade.) If the require_auth() call were deleted or pointed at the wrong address, the suite would still pass. sweep moves arbitrary 'surplus' to any recipient.

Suggested fix

Add a positive test that mocks only the admin's auth for sweep, 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 を短くまとめたダイジェスト。