a good library would help developers avoid these issues
there's no reason to call functions without side-effects like vector::contains() without using the return result
most modern compilers support flags like [[nodiscard]] or #[must_use] which emit a warning if a return value is ignored
right now, the move compilers and runtime libraries don't support these attributes which help developers avoid writing incorrect code
nodiscard would be a good feature to add to the compiler and move runtimes
gpt-5 caught this bug in one shot after thinking 95 seconds
> Yep — the critical bug is in the “v2” updater’s authority check.
> In update_v2 you call vector::contains but you ignore its return value, so the function never enforces that the tx sender is authorized. Anyone who can pass a reference to the shared UpdateAuthority object can update the oracle
minimal prompt and one-shot response below:


2.23 ألف
20
المحتوى الوارد في هذه الصفحة مُقدَّم من أطراف ثالثة. وما لم يُذكَر خلاف ذلك، فإن OKX ليست مُؤلِّفة المقالة (المقالات) المذكورة ولا تُطالِب بأي حقوق نشر وتأليف للمواد. المحتوى مٌقدَّم لأغراض إعلامية ولا يُمثِّل آراء OKX، وليس الغرض منه أن يكون تأييدًا من أي نوع، ولا يجب اعتباره مشورة استثمارية أو التماسًا لشراء الأصول الرقمية أو بيعها. إلى الحد الذي يُستخدَم فيه الذكاء الاصطناعي التوليدي لتقديم مُلخصَّات أو معلومات أخرى، قد يكون هذا المحتوى الناتج عن الذكاء الاصطناعي غير دقيق أو غير مُتسِق. من فضلك اقرأ المقالة ذات الصِلة بهذا الشأن لمزيدٍ من التفاصيل والمعلومات. OKX ليست مسؤولة عن المحتوى الوارد في مواقع الأطراف الثالثة. والاحتفاظ بالأصول الرقمية، بما في ذلك العملات المستقرة ورموز NFT، فيه درجة عالية من المخاطر وهو عُرضة للتقلُّب الشديد. وعليك التفكير جيِّدًا فيما إذا كان تداوُل الأصول الرقمية أو الاحتفاظ بها مناسبًا لك في ظل ظروفك المالية.