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:


3,024
24
本页面内容由第三方提供。除非另有说明,欧易不是所引用文章的作者,也不对此类材料主张任何版权。该内容仅供参考,并不代表欧易观点,不作为任何形式的认可,也不应被视为投资建议或购买或出售数字资产的招揽。在使用生成式人工智能提供摘要或其他信息的情况下,此类人工智能生成的内容可能不准确或不一致。请阅读链接文章,了解更多详情和信息。欧易不对第三方网站上的内容负责。包含稳定币、NFTs 等在内的数字资产涉及较高程度的风险,其价值可能会产生较大波动。请根据自身财务状况,仔细考虑交易或持有数字资产是否适合您。