WTF-Solidity icon indicating copy to clipboard operation
WTF-Solidity copied to clipboard

关于第六讲

Open flandre-crimson opened this issue 1 year ago • 4 comments

📝 Details(细节)

原文:因为在Solidity中,如果一个值没有指定type的话,默认就是最小单位的该type,这里 uint 的默认最小单位类型就是uint8。

勘误:unit的默认类型应该是uint256。int的默认类型是int256。

🔢 Reference(参考) 参考:https://docs.soliditylang.org/zh/latest/types.html#integers

ps.确认需要修复的话,可以提任务给我。

flandre-crimson avatar Mar 22 '24 01:03 flandre-crimson

这里的确表达有误,应该改为文档相应的部分

In the example below, the type of [1, 2, 3] is uint8[3] memory, because the type of each of these constants is uint8. If you want the result to be a uint[3] memory type, you need to convert the first element to uint.

欢迎提pr。 https://docs.soliditylang.org/en/latest/types.html#array-literals

AmazingAng avatar Mar 22 '24 01:03 AmazingAng

I will fix it.

XdpCs avatar Mar 26 '24 14:03 XdpCs

@flandre-crimson 大佬 问题已经修复 有空可以关闭一下issue 谢谢

XdpCs avatar Mar 28 '24 06:03 XdpCs

@AmazingAng 问题已经修复 有空可以关闭一下issue

XdpCs avatar Jun 14 '24 14:06 XdpCs