СÐÄÖÇÄܺÏÔ¼Îó²î£ºÇø¿éÁ´Éϵġ°¿ÕÆø¡±±Ò

Ðû²¼Ê±¼ä 2018-07-13


 Åä¾°


Çø¿éÁ´ÊǽüÄêÀ´×î¾ß¸ïÃüÐÔµÄÐÂÐËÊÖÒÕÖ®Ò»£¬ÒÔÆäÈ¥ÖÐÐÄ»¯¡¢²»¿É¸Ä¶¯µÈÌص㣬Ç㸲Á˽ðÈÚµÈÖî¶àÐÐÒµµÄÔ­ÓйæÔò¡£Çø¿éÁ´ÏÖÒѽøÈë3.0½×¶Î£¬¡°´ú±ÒºÏÔ¼¡±×÷ΪÇø¿éÁ´ÖÇÄܺÏÔ¼ÖÐÓ¦ÓÃ×îÆÕ±éµÄÒ»À࣬Ҳ³ÉΪ¹¥»÷ÕßÃǵÄÖ÷Òª¹¥»÷¹¤¾ß¡£


ÓÉÓÚÊÖÒÕÉú³¤Ê±ºöÂÔÁËÇå¾²ÏÈÐеÄÀíÄµ¼ÖÂÖÚ¶àÊÖÒÕ±£´æ´ó×ÚÇå¾²ÎÊÌ⣬Óë¹Å°å³ÌÐòÒ»Ñù£¬´ú±ÒºÏÔ¼ÎÞ·¨×èÖ¹µØ±£´æÇå¾²Îó²î¡£¹¥»÷Õß¿ÉÒÔʹÓÃÎó²îΪËùÓûΪµØ¿ØÖÆÊг¡ÉϵÄÇ®±Ò×ÜÁ¿»òí§ÒâÕË»§µÄÇ®±ÒÁ¿£¬ÕâÑùʹԭÀ´¾ÍÎÞêµÄÇ®±Ò³¹µ×ʧȥÐÅÓ㬳ÉΪ¡°¿ÕÆø¡±±Ò¡£



ÖÇÄܺÏÔ¼Éó¼Æ


ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøADLab½üÄêÀ´Ò»Á¬¹Ø×¢Çø¿éÁ´ÊÖÒÕÇå¾²ÎÊÌ⣬ͨ¹ý¶ÔÒÔÌ«·»Ö÷Á´[1]ÖÇÄܺÏÔ¼¾ÙÐÐÑо¿£¬·¢Ã÷ÁË400¶à¸öCVEÎó²î¡£


ÖÇÄܺÏÔ¼Îó²î»á´øÀ´Öî¶à¶ñÐÔЧ¹û£¬ADLabÍŽáÏÖʵµÄÇå¾²ÊÂÎñ£¬ÒÔ¼°×ÔÖ÷·¢Ã÷µÄÎó²î£¬¶ÔÆäÖеÄÈý¸öÀà±ðµÄÎó²î¸ø¸÷ÈË×öÁËÆÊÎö¡£


 ÖØÈëÎó²î


2016Äê6Ô£¬DAO¹¥»÷ÊÂÎñÔÚÇø¿éÁ´ÀúÊ·ÉÏÁôÏÂÁ˼«ÖصÄÒ»±Ê£¬ºÚ¿ÍʹÓÃÖØÈëÎó²î£¬Ö±½Óµ¼ÖÂÒÔÌ«·»µÄÓ²·Ö²æ¡£ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøADLab¾­ÓÉÑо¿·¢Ã÷£¬ÒÔÌ«·»µÄÖÇÄܺÏÔ¼ÄÚÀïÈÔÈ»±£´æÖØÈëÎó²î¡£ÏÂÃæÒÔBANK_SAFEºÏԼΪÀý¾ÙÐоÙÀý˵Ã÷¡£


¡ñ Îó²îʾÀý


BANK_SAFEºÏÔ¼Öб£´æµä·¶µÄ´úÂëÖØÈëÎó²î£¬µ±Í¨Ë×Óû§ÕË»§Å²ÓÃCollectº¯Êýʱ£¬Collectº¯ÊýµÄÂß¼­Ã»ÓÐÈκÎÎÊÌ⣬Óû§¿ÉÒÔ˳ËìµÄÖ´ÐÐÈ¡¿î²Ù×÷£»¿ÉÊǵ±ÁíÒ»¸öÖÇÄܺÏԼŲÓÃBANK_SAFEºÏÔ¼µÄCollectº¯Êýʱ£¬»á±¬·¢ÑÏÖصÄÇå¾²Òþ»¼¡£

 


¡ñ Ô¤·ÀÊÖÒÕ[2]


1. Ê¹ÓÃÄÚÖõÄtransfer()º¯Êý¾ÙÐÐתÕË¡£ÓÉÓÚtranfer()º¯ÊýÖ»·¢ËÍ2300gas£¬Òò´Ëȱ·¦ÒÔºÏÔ¼Ö®¼äµÄÑ­»·Å²Óá£


2. ½ÓÄÉcheck-effects-interactionsģʽµÄ±àÂë¡£ÔÚBANK_SAFEºÏÔ¼ÖУ¬[49]ÐеÄ×ʽð¿Û³ý²Ù×÷Ó¦¸Ã·Åµ½[47]ÐÐ֮ǰ¡£


3. ÒýÈ뻥Ëø»úÖÆ¡£Ìí¼ÓÒ»¸ö״̬±äÁ¿Ëø¶¨ºÏÔ¼£¬Ô¤·ÀÖØÈëŲÓá£


Óâ¶îÖý±Ò


2018Äê2Ô³õ£¬»ùÓÚÒÔÌ«·»µÄMonero Gold(XMRG) TokenÔÚÉúÒâËùµÄ¼ÛÇ®ÏÈÃÍÕÇ787%£¬ºóѸËÙ±©µøÖÁ±ÀÅÌ£¬Ôì³É´ó×ÚÓû§¾­¼ÃËðʧ£¬Æä±³ºó¾ÍÊÇÖÎÀíÍŶÓʹÓÃÔ¤ÁôµÄÕûÊýÒç³öÎó²î¾ÙÐÐÓâ¶îÖý±Ò£¬²¢ÔÚÉúÒâËùÅ×ÊÛÔì³É¶ñÐÔͨ»õÅòÕÍ£¬×îºó¼ÛÖµÏÕЩ¹éÁã¡£ADLabʹÓÃ×Ô¶¯»¯Éó¼Æ¹¤¾ß·¢Ã÷´ó×ÚÖÇÄܺÏÔ¼ÈÔÈ»±£´æͬÀàÎó²î¡£ÏÂÃæÒÔGenesis VisionºÏÔ¼¾ÙÐоÙÀý˵Ã÷¡£


¡ñ Îó²îʾÀý£ºCVE-2018-11335


Genesis VisionÖÇÄܺÏÔ¼ËäÈ»ÒýÈëÁËOpenZepplinµÄSafeMathÊýѧÔËËã¿â£¬µ«Æ俯ÐÐÇ®±ÒµÄº¯Êýmint()ȴûÓÐʹÓÃÇå¾²ÔËË㺯Êý£¬¶øÊÇÖ±½ÓʹÓÃÊýѧÔËËã·û¡£ÈôÊÇÈ«ÐĽṹÊäÈë²ÎÊývalue£¬ÔÚ[188]Ðб¬·¢ÕûÊýÒç³ö£¬Òç³öºóÔËËãЧ¹ûСÓÚTOKEN_LIMIT£¬¾Í¿ÉÒÔÈƹýtoken¿¯ÐÐÉÏÏÞ£¬ÊµÏÖÓâ¶îÖý±Ò£¬×îÖÕµ¼Ö¶ñÐÔͨ»õÅòÕÍ¡£ÕâÀàÖý±Òº¯ÊýµÄÖ´ÐÐÒ»Ñùƽ³£ÐèÒªÖÎÀíԱȨÏÞ£¬Òò´Ë¿ÉÒÔ¿´×÷ÊÇÒ»ÖÖºóÃÅÎó²î¡£

 


¡ñ Ô¤·ÀÊÖÒÕ


եȡʹÓÃÊýѧÔËËã·û£¬Ê¹ÓÃSafeMathÔËËã¿â[3]¡£


ÅúÁ¿×ªÕË


2018Äê4Ô£¬ºÚ¿ÍʹÓÃBECÖÇÄܺÏÔ¼Îó²î¹¥»÷ÃÀÁ´BEC(ÃÀÃÛ±Ò)£¬ÀÖ³ÉÏòÁ½¸öµØµãת³öÁËÌìÁ¿¼¶±ðµÄ BEC´ú±Ò£¬µ¼Öº£Á¿BEC±»Å×ÊÛ£¬Ê¹Êʵ±ÈÕBECµÄ¼ÛÖµÏÕЩ¹éÁ㣬64ÒÚÈËÃñ±Ò˲¼äÕô·¢¡£2018Äê7Ô£¬AMRºÏÔ¼ÖеÄÎó²î±»ºÚ¿Í¶ñÒâʹÓ㬵¼ÖÂAMR´ó×ÚÔö·¢¡£ÕâÁ½´Î¹¥»÷ÊÂÎñ¶¼ÊÇÓÉÓÚÅúÁ¿×ªÕ˺¯ÊýÖб£´æÕûÊýÒç³öÎó²î£¬¾­ADLabÑо¿·¢Ã÷£¬Ï±íÖеÄÖÇÄܺÏÔ¼ÈÔÈ»±£´æͬÀàÎó²î¡£


   

¡ñ Îó²îʾÀý£ºCVE-2018-13836


Rocket Coin (XRC)ºÏÔ¼ÖеÄmultiTransferº¯Êý±£´æÕûÊýÒç³öÎó²î£¬ÓÉÓڸú¯ÊýµÄÊôÐÔÊÇpublic£¬í§ÒâÓû§¿ÉÒÔŲÓøú¯Êý¾ÙÐÐÅúÁ¿×ª±Ò²Ù×÷£¬²»ÐèÒªÖÎÀíԱȨÏÞ¡£

 


´ÓRocket Coin´ú±ÒµÄTokenHoldersÁбí¿ÉÒÔ¿´³öºÚ¿Í¹¥»÷Àֳɵĺۼ£¡£

 


´Óetherscan.io¿ÉÒÔÉó²éºÚ¿Í¹¥»÷ʱÉúÒâ¼Í¼£º


https://etherscan.io/tx/0x606316fc06922ae34e6be865e64b23598d74a5e94712447dca37a7ac4c8b30a8#decodetab


´ÓInput Data¿ÉÒÔ¿´³ö¹¥»÷ÕßÈ«ÐĽṹÁË_amountsÊý×飬Êý×éÖаüÀ¨Á½¸öÔªËØ£¬ÔªËØÖµ½ÔΪ¼«´óÖµ£¬µ±Ö´Ðе½[72]ÐÐʱ½«±¬·¢ÕûÊýÒç³ö¡£Òò´Ë¹¥»÷ÕßÖ»ÆÆ·ÑÁËÉÙÉÙµÄtoken£¬±ãÍê³ÉÅúÁ¿´ó¶îתÕË¡£



¡ñ Ô¤·À²½·¥


եȡʹÓÃÊýѧÔËËã·û£¬Ê¹ÓÃSafeMathÔËËã¿â[3]¡£



×ܽá


ÓÉÓÚÖÇÄܺÏÔ¼ÊÇÒ»´ÎÐÔÐû²¼ÉÏÁ´µÄ£¬Ò»µ©·ºÆðÎó²î½«ÄÑÒÔÖ±½ÓÐÞ²¹¡£


¹ØÓÚ¿ª·¢Õ߶øÑÔ£¬·¢Ã÷Îó²îºóÖ»ÄÜÐû²¼ÐµÄÖÇÄܺÏԼȻºó×öÊÖ¶¯Ó³É䣬ÔÚʱ¼ä¡¢ÈËÁ¦¡¢²ÆÁ¦ÉÏ»áÖ§¸¶ºÜ´óµÄ¼ÛÇ®¡£


¹ØÓÚͶ×ÊÕ߶øÑÔ£¬ÖÇÄܺÏÔ¼ÉϵÄÎó²îºÜ¿ÉÄÜ»áʹÏìÓ¦µÄ´ú±ÒÄð³É¡°¿ÕÆø¡±±Ò£¬´øÀ´¸üΪֱ½ÓµÄ¹¤ÒµËðʧ¡£

 

ÎÂÜ°ÌáÐÑ£º


1¡¢Çø¿éÁ´ÊÇÐÂÐËÊÖÒÕ£¬»¹ÐèÔöÇ¿¶ÔÆäÇå¾²Éó¼ÆºÍî¿ÏµÄÜÁ¦µÄÖØÊÓ¡£

2¡¢³´±ÒÓÐΣº¦£¬ÈëÊÐÐèÉóÉ÷£¬Ïàʶ¶ÔÐÐÇ飬¾Ü¾ø×ö¡°¾Â²Ë¡±¡£

3¡¢ÖØÊÓ¹ú¼ÒÖ´ÂÉÀýÔò£¬ºÏÀíͶ×Ê£¬¿µ½¡Àí²Æ¡£

 


²Î¿¼Á´½Ó


[1] 

https://etherscan.io/contractsVerified

[2] 

https://blog.sigmaprime.io/solidity-security.html

[3] 

https://github.com/OpenZeppelin/zeppelin-solidity


 Åä¾°


Çø¿éÁ´ÊǽüÄêÀ´×î¾ß¸ïÃüÐÔµÄÐÂÐËÊÖÒÕÖ®Ò»£¬ÒÔÆäÈ¥ÖÐÐÄ»¯¡¢²»¿É¸Ä¶¯µÈÌص㣬Ç㸲Á˽ðÈÚµÈÖî¶àÐÐÒµµÄÔ­ÓйæÔò¡£Çø¿éÁ´ÏÖÒѽøÈë3.0½×¶Î£¬¡°´ú±ÒºÏÔ¼¡±×÷ΪÇø¿éÁ´ÖÇÄܺÏÔ¼ÖÐÓ¦ÓÃ×îÆÕ±éµÄÒ»À࣬Ҳ³ÉΪ¹¥»÷ÕßÃǵÄÖ÷Òª¹¥»÷¹¤¾ß¡£


ÓÉÓÚÊÖÒÕÉú³¤Ê±ºöÂÔÁËÇå¾²ÏÈÐеÄÀíÄµ¼ÖÂÖÚ¶àÊÖÒÕ±£´æ´ó×ÚÇå¾²ÎÊÌ⣬Óë¹Å°å³ÌÐòÒ»Ñù£¬´ú±ÒºÏÔ¼ÎÞ·¨×èÖ¹µØ±£´æÇå¾²Îó²î¡£¹¥»÷Õß¿ÉÒÔʹÓÃÎó²îΪËùÓûΪµØ¿ØÖÆÊг¡ÉϵÄÇ®±Ò×ÜÁ¿»òí§ÒâÕË»§µÄÇ®±ÒÁ¿£¬ÕâÑùʹԭÀ´¾ÍÎÞêµÄÇ®±Ò³¹µ×ʧȥÐÅÓ㬳ÉΪ¡°¿ÕÆø¡±±Ò¡£



ÖÇÄܺÏÔ¼Éó¼Æ


ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøADLab½üÄêÀ´Ò»Á¬¹Ø×¢Çø¿éÁ´ÊÖÒÕÇå¾²ÎÊÌ⣬ͨ¹ý¶ÔÒÔÌ«·»Ö÷Á´[1]ÖÇÄܺÏÔ¼¾ÙÐÐÑо¿£¬·¢Ã÷ÁË400¶à¸öCVEÎó²î¡£


ÖÇÄܺÏÔ¼Îó²î»á´øÀ´Öî¶à¶ñÐÔЧ¹û£¬ADLabÍŽáÏÖʵµÄÇå¾²ÊÂÎñ£¬ÒÔ¼°×ÔÖ÷·¢Ã÷µÄÎó²î£¬¶ÔÆäÖеÄÈý¸öÀà±ðµÄÎó²î¸ø¸÷ÈË×öÁËÆÊÎö¡£


 ÖØÈëÎó²î


2016Äê6Ô£¬DAO¹¥»÷ÊÂÎñÔÚÇø¿éÁ´ÀúÊ·ÉÏÁôÏÂÁ˼«ÖصÄÒ»±Ê£¬ºÚ¿ÍʹÓÃÖØÈëÎó²î£¬Ö±½Óµ¼ÖÂÒÔÌ«·»µÄÓ²·Ö²æ¡£ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøADLab¾­ÓÉÑо¿·¢Ã÷£¬ÒÔÌ«·»µÄÖÇÄܺÏÔ¼ÄÚÀïÈÔÈ»±£´æÖØÈëÎó²î¡£ÏÂÃæÒÔBANK_SAFEºÏԼΪÀý¾ÙÐоÙÀý˵Ã÷¡£


¡ñ Îó²îʾÀý


BANK_SAFEºÏÔ¼Öб£´æµä·¶µÄ´úÂëÖØÈëÎó²î£¬µ±Í¨Ë×Óû§ÕË»§Å²ÓÃCollectº¯Êýʱ£¬Collectº¯ÊýµÄÂß¼­Ã»ÓÐÈκÎÎÊÌ⣬Óû§¿ÉÒÔ˳ËìµÄÖ´ÐÐÈ¡¿î²Ù×÷£»¿ÉÊǵ±ÁíÒ»¸öÖÇÄܺÏԼŲÓÃBANK_SAFEºÏÔ¼µÄCollectº¯Êýʱ£¬»á±¬·¢ÑÏÖصÄÇå¾²Òþ»¼¡£

 

ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢


¡ñ Ô¤·ÀÊÖÒÕ[2]


1. Ê¹ÓÃÄÚÖõÄtransfer()º¯Êý¾ÙÐÐתÕË¡£ÓÉÓÚtranfer()º¯ÊýÖ»·¢ËÍ2300gas£¬Òò´Ëȱ·¦ÒÔºÏÔ¼Ö®¼äµÄÑ­»·Å²Óá£


2. ½ÓÄÉcheck-effects-interactionsģʽµÄ±àÂë¡£ÔÚBANK_SAFEºÏÔ¼ÖУ¬[49]ÐеÄ×ʽð¿Û³ý²Ù×÷Ó¦¸Ã·Åµ½[47]ÐÐ֮ǰ¡£


3. ÒýÈ뻥Ëø»úÖÆ¡£Ìí¼ÓÒ»¸ö״̬±äÁ¿Ëø¶¨ºÏÔ¼£¬Ô¤·ÀÖØÈëŲÓá£


Óâ¶îÖý±Ò


2018Äê2Ô³õ£¬»ùÓÚÒÔÌ«·»µÄMonero Gold(XMRG) TokenÔÚÉúÒâËùµÄ¼ÛÇ®ÏÈÃÍÕÇ787%£¬ºóѸËÙ±©µøÖÁ±ÀÅÌ£¬Ôì³É´ó×ÚÓû§¾­¼ÃËðʧ£¬Æä±³ºó¾ÍÊÇÖÎÀíÍŶÓʹÓÃÔ¤ÁôµÄÕûÊýÒç³öÎó²î¾ÙÐÐÓâ¶îÖý±Ò£¬²¢ÔÚÉúÒâËùÅ×ÊÛÔì³É¶ñÐÔͨ»õÅòÕÍ£¬×îºó¼ÛÖµÏÕЩ¹éÁã¡£ADLabʹÓÃ×Ô¶¯»¯Éó¼Æ¹¤¾ß·¢Ã÷´ó×ÚÖÇÄܺÏÔ¼ÈÔÈ»±£´æͬÀàÎó²î¡£ÏÂÃæÒÔGenesis VisionºÏÔ¼¾ÙÐоÙÀý˵Ã÷¡£


¡ñ Îó²îʾÀý£ºCVE-2018-11335


Genesis VisionÖÇÄܺÏÔ¼ËäÈ»ÒýÈëÁËOpenZepplinµÄSafeMathÊýѧÔËËã¿â£¬µ«Æ俯ÐÐÇ®±ÒµÄº¯Êýmint()ȴûÓÐʹÓÃÇå¾²ÔËË㺯Êý£¬¶øÊÇÖ±½ÓʹÓÃÊýѧÔËËã·û¡£ÈôÊÇÈ«ÐĽṹÊäÈë²ÎÊývalue£¬ÔÚ[188]Ðб¬·¢ÕûÊýÒç³ö£¬Òç³öºóÔËËãЧ¹ûСÓÚTOKEN_LIMIT£¬¾Í¿ÉÒÔÈƹýtoken¿¯ÐÐÉÏÏÞ£¬ÊµÏÖÓâ¶îÖý±Ò£¬×îÖÕµ¼Ö¶ñÐÔͨ»õÅòÕÍ¡£ÕâÀàÖý±Òº¯ÊýµÄÖ´ÐÐÒ»Ñùƽ³£ÐèÒªÖÎÀíԱȨÏÞ£¬Òò´Ë¿ÉÒÔ¿´×÷ÊÇÒ»ÖÖºóÃÅÎó²î¡£

 

 

ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢


¡ñ Ô¤·ÀÊÖÒÕ


եȡʹÓÃÊýѧÔËËã·û£¬Ê¹ÓÃSafeMathÔËËã¿â[3]¡£


ÅúÁ¿×ªÕË


2018Äê4Ô£¬ºÚ¿ÍʹÓÃBECÖÇÄܺÏÔ¼Îó²î¹¥»÷ÃÀÁ´BEC(ÃÀÃÛ±Ò)£¬ÀÖ³ÉÏòÁ½¸öµØµãת³öÁËÌìÁ¿¼¶±ðµÄ BEC´ú±Ò£¬µ¼Öº£Á¿BEC±»Å×ÊÛ£¬Ê¹Êʵ±ÈÕBECµÄ¼ÛÖµÏÕЩ¹éÁ㣬64ÒÚÈËÃñ±Ò˲¼äÕô·¢¡£2018Äê7Ô£¬AMRºÏÔ¼ÖеÄÎó²î±»ºÚ¿Í¶ñÒâʹÓ㬵¼ÖÂAMR´ó×ÚÔö·¢¡£ÕâÁ½´Î¹¥»÷ÊÂÎñ¶¼ÊÇÓÉÓÚÅúÁ¿×ªÕ˺¯ÊýÖб£´æÕûÊýÒç³öÎó²î£¬¾­ADLabÑо¿·¢Ã÷£¬Ï±íÖеÄÖÇÄܺÏÔ¼ÈÔÈ»±£´æͬÀàÎó²î¡£


ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢

   

¡ñ Îó²îʾÀý£ºCVE-2018-13836


Rocket Coin (XRC)ºÏÔ¼ÖеÄmultiTransferº¯Êý±£´æÕûÊýÒç³öÎó²î£¬ÓÉÓڸú¯ÊýµÄÊôÐÔÊÇpublic£¬í§ÒâÓû§¿ÉÒÔŲÓøú¯Êý¾ÙÐÐÅúÁ¿×ª±Ò²Ù×÷£¬²»ÐèÒªÖÎÀíԱȨÏÞ¡£

 

ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢


´ÓRocket Coin´ú±ÒµÄTokenHoldersÁбí¿ÉÒÔ¿´³öºÚ¿Í¹¥»÷Àֳɵĺۼ£¡£

 

ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢


 

´Óetherscan.io¿ÉÒÔÉó²éºÚ¿Í¹¥»÷ʱÉúÒâ¼Í¼£º


https://etherscan.io/tx/0x606316fc06922ae34e6be865e64b23598d74a5e94712447dca37a7ac4c8b30a8#decodetab


´ÓInput Data¿ÉÒÔ¿´³ö¹¥»÷ÕßÈ«ÐĽṹÁË_amountsÊý×飬Êý×éÖаüÀ¨Á½¸öÔªËØ£¬ÔªËØÖµ½ÔΪ¼«´óÖµ£¬µ±Ö´Ðе½[72]ÐÐʱ½«±¬·¢ÕûÊýÒç³ö¡£Òò´Ë¹¥»÷ÕßÖ»ÆÆ·ÑÁËÉÙÉÙµÄtoken£¬±ãÍê³ÉÅúÁ¿´ó¶îתÕË¡£


ÓÅ·¢¹ú¼Ê¡¤ËæÓŶø¶¯Ò»´¥¼´·¢


 

¡ñ Ô¤·À²½·¥


եȡʹÓÃÊýѧÔËËã·û£¬Ê¹ÓÃSafeMathÔËËã¿â[3]¡£



×ܽá


ÓÉÓÚÖÇÄܺÏÔ¼ÊÇÒ»´ÎÐÔÐû²¼ÉÏÁ´µÄ£¬Ò»µ©·ºÆðÎó²î½«ÄÑÒÔÖ±½ÓÐÞ²¹¡£


¹ØÓÚ¿ª·¢Õ߶øÑÔ£¬·¢Ã÷Îó²îºóÖ»ÄÜÐû²¼ÐµÄÖÇÄܺÏԼȻºó×öÊÖ¶¯Ó³É䣬ÔÚʱ¼ä¡¢ÈËÁ¦¡¢²ÆÁ¦ÉÏ»áÖ§¸¶ºÜ´óµÄ¼ÛÇ®¡£


¹ØÓÚͶ×ÊÕ߶øÑÔ£¬ÖÇÄܺÏÔ¼ÉϵÄÎó²îºÜ¿ÉÄÜ»áʹÏìÓ¦µÄ´ú±ÒÄð³É¡°¿ÕÆø¡±±Ò£¬´øÀ´¸üΪֱ½ÓµÄ¹¤ÒµËðʧ¡£

 

ÎÂÜ°ÌáÐÑ£º


1¡¢Çø¿éÁ´ÊÇÐÂÐËÊÖÒÕ£¬»¹ÐèÔöÇ¿¶ÔÆäÇå¾²Éó¼ÆºÍî¿ÏµÄÜÁ¦µÄÖØÊÓ¡£

2¡¢³´±ÒÓÐΣº¦£¬ÈëÊÐÐèÉóÉ÷£¬Ïàʶ¶ÔÐÐÇ飬¾Ü¾ø×ö¡°¾Â²Ë¡±¡£

3¡¢ÖØÊÓ¹ú¼ÒÖ´ÂÉÀýÔò£¬ºÏÀíͶ×Ê£¬¿µ½¡Àí²Æ¡£

 


²Î¿¼Á´½Ó


[1] 

https://etherscan.io/contractsVerified

[2] 

https://blog.sigmaprime.io/solidity-security.html

[3] 

https://github.com/OpenZeppelin/zeppelin-solidity