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, пов’язане з високим ризиком, а вартість таких активів може сильно коливатися. Перш ніж торгувати цифровими активами або утримувати їх, ретельно оцініть свій фінансовий стан.