全面、

智能合约:不要重新发明轮子

SafeMath

SafeMath 是一个库,如果超过整数数据类型的界限,则通过恢复事务来确保安全的算术运算。

安全数学示例。

using 语句向编译器表明合约正在使用定义在 SafeMath uint 操作。 而不是使用算术运算符 (+, -, *, /, %),使用函数 add(), sub(), mul(), div()mod().

来源:https://medium.com/better-programming/smart-contracts-dont-reinvent-the-wheel-63cee4370d19?source=rss——-8——————cryptocurrency