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,74 tn
22
Innehållet på den här sidan tillhandahålls av tredje part. Om inte annat anges är OKX inte författare till den eller de artiklar som citeras och hämtar inte någon upphovsrätt till materialet. Innehållet tillhandahålls endast i informationssyfte och representerar inte OKX:s åsikter. Det är inte avsett att vara ett godkännande av något slag och bör inte betraktas som investeringsrådgivning eller en uppmaning att köpa eller sälja digitala tillgångar. I den mån generativ AI används för att tillhandahålla sammanfattningar eller annan information kan sådant AI-genererat innehåll vara felaktigt eller inkonsekvent. Läs den länkade artikeln för mer detaljer och information. OKX ansvarar inte för innehåll som finns på tredje parts webbplatser. Innehav av digitala tillgångar, inklusive stabila kryptovalutor och NFT:er, innebär en hög grad av risk och kan fluktuera kraftigt. Du bör noga överväga om handel med eller innehav av digitala tillgångar är lämpligt för dig mot bakgrund av din ekonomiska situation.