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 rb
20
Konten pada halaman ini disediakan oleh pihak ketiga. Kecuali dinyatakan lain, OKX bukanlah penulis artikel yang dikutip dan tidak mengklaim hak cipta atas materi tersebut. Konten ini disediakan hanya untuk tujuan informasi dan tidak mewakili pandangan OKX. Konten ini tidak dimaksudkan sebagai dukungan dalam bentuk apa pun dan tidak dapat dianggap sebagai nasihat investasi atau ajakan untuk membeli atau menjual aset digital. Sejauh AI generatif digunakan untuk menyediakan ringkasan atau informasi lainnya, konten yang dihasilkan AI mungkin tidak akurat atau tidak konsisten. Silakan baca artikel yang terkait untuk informasi lebih lanjut. OKX tidak bertanggung jawab atas konten yang dihosting di situs pihak ketiga. Kepemilikan aset digital, termasuk stablecoin dan NFT, melibatkan risiko tinggi dan dapat berfluktuasi secara signifikan. Anda perlu mempertimbangkan dengan hati-hati apakah trading atau menyimpan aset digital sesuai untuk Anda dengan mempertimbangkan kondisi keuangan Anda.