God.GameÖÇÄܺÏÔ¼¹¥»÷ÊÂÎñÆÊÎö
Ðû²¼Ê±¼ä 2018-08-24Ò»¡¢¹¥»÷»ØËÝ
ͨ¹ýetherscan¿ÉÒÔ¿´µ½¹¥»÷ÕßµÄÒÔÌ«±ÒÌáÈ¡ÉúÒ⣺

ÉúÒâÏêÇéÈçÏ£¬¼´¹¥»÷Õß0xc30e89db73798e4cb3b204be0a4c735c453e5c74£¨¼ò³Æ¹¥»÷Õß1£©Å²ÓÃÁËGodºÏÔ¼µÄwithdrawº¯Êý¾ÙÐÐÌá±Ò£º

Éó²é¹¥»÷Õß1ÔÚGodºÏÔ¼ÖÐÊÇ·ñ³ÖÓÐtoken£¬¿¿½ü20ÍòµÄÊýÄ¿¡£

Éó²é¹¥»÷Õß1ÔÚwithdrawŲÓÃ֮ǰ¶ÔGodºÏÔ¼µÄŲÓã¬ÈçÏ£º

´Ó¹¥»÷Õß1µÄÉúÒâÀ´¿´£¬Ëü·¢ÍùGodºÏÔ¼µÄ×îÔçÉúÒâÊÇsellŲÓã¬ËµÃ÷ÔÚsell֮ǰËü¾ÍÒѾÓÐÁËGodºÏÔ¼µÄtoken¡£ÄÇô¹¥»÷ºÏÔ¼ÔÚ´Ë֮ǰ£¬Ò»¶¨ÓÐÆäËüÕË»§¸øËüתÒƹýtoken¡£²»È»£¬Ëü²»»áÓпÉÒÔsellµÄtoken¡£
ÔÚ×·×Ù¹¥»÷Õß1µÄtokenת±äÀú³ÌÖУ¬ÎÒÃÇ·¢Ã÷ÁíÍâÒ»¸ö¹¥»÷Õߣ¨¼ò³Æ¹¥»÷Õß2£¬µØµãΪ0x2368beb43da49c4323e47399033f5166b5023cda£©£¬ËüŲÓÃÁËÒ»¸ö¹¥»÷ºÏÔ¼£¨µØµãΪ0x7f325efc3521088a225de98f82e6dd7d4d2d02f8£©¸ø¹¥»÷Õß1תÒÆÁË20Íòtoken£º

¹¥»÷Õß2ŲÓù¥»÷ºÏÔ¼µÄtransferº¯Êý£¬Ä¿µÄµØµãΪ¹¥»÷Õß1£¬ÊýĿΪ20Íò¡£ÓÉÓÚ¹¥»÷ºÏÔ¼²¢Ã»Óпª·ÅÔ´Â룬Òò´ËÕâÀïµÄtransferº¯Êý½ö½öÊǺ¯ÊýÊðÃûÆ¥ÅäµÄЧ¹û(ÓÐÒ»¶¨¼¸ÂÊÊÇÆäËüÃû×Ö)¡£ÄÇô£¬¹¥»÷ºÏÔ¼µÄ20ÍòtokenÊÇ´ÓÄÇÀï»ñµÃµÄ£¿
¼ÌÐø¸ú×Ù¹¥»÷Õß2ºÍ¹¥»÷ºÏÔ¼£¬·¢Ã÷¹¥»÷ºÏÔ¼ÊÇÓɹ¥»÷Õß2½¨ÉèµÄ£¬ÇÒ¹¥»÷Õß2¶Ô¹¥»÷ºÏÔ¼µÄŲÓþÍÊÇÔÚGodºÏÔ¼±»¹¥»÷ÌáÏÖµÄʱ¼ä´°¿ÚÖС£

´Ó¹¥»÷Õß2µÄÉúÒâÐÐΪ£¬¿ÉÒÔ¿´³öËûÏȸø¹¥»÷ºÏԼתÈë4.3 token£¬È»ºó´Ó¹¥»÷ºÏԼת³ö4.3 token¡£´Ëʱ£¬¹¥»÷ºÏÔ¼µÄtokenΪ0¡£Ëæºó£¬¹¥»÷ºÏÔ¼Ö±½Óת20Íòtoken¸ø¹¥»÷Õß1£¨»¹×ªÒÆÁË21Íò¸øÁíÍâÒ»¸öµØµã£©£¬ÕâÅú×¢¹¥»÷ÕßÔÚŲÓÃreinvestº¯ÊýʱӦ¸Ãʹ¹¥»÷ºÏÔ¼µÄtoken±¬·¢ÁËijÖÖת±ä¡£
½Ó×ÅÆÊÎöÕâ¸öreinvestÉúÒ⣬ËüÊÇÖ±½ÓŲÓò»¿ªÔ´µÄ¹¥»÷ºÏÔ¼£¬ÆäÄÚ²¿»úÖÆÎÒÃDz¢²»ÇåÎú¡£¿ÉÊÇ£¬Õâ¸öÉúÒâÀú³Ì»á´¥·¢GodºÏÔ¼µÄÁ½¸öÊÂÎñ£¬onTokenPurchaseºÍonReinvestment£º

ͨ¹ýÕâ¸öÊÂÎñµÄ¼Í¼Êý¾Ý£¬¿ÉÒÔ¿´µ½¸ÃreinvestŲÓÃʹµÃºÏÔ¼ÅжϹºÖÃtokenµÄÒÔÌ«´ú±ÒÊýĿΪһ¸ö´óÊý£¬²¢ÇÒÔ¶Ô¶Áè¼ÝÒÔÌ«±Ò¿¯ÐÐ×ÜÁ¿¡£Õâ¸öÐÅÏ¢Ò²·´Ó¦³öreinvestº¯ÊýÄÚ²¿Âß¼Ò»¶¨±¬·¢ÁËijÖÖ·ÇÔ¤ÆÚµÄÐÐΪ¡£
̫ͨ¹ýÎöGodºÏÔ¼Ô´Â룬·¢Ã÷onReinvestmentÊÂÎñ½öÔÚGodºÏÔ¼µÄreinvestº¯ÊýÖд¥·¢£º

¿É¼û£¬onReinvestmentµÄÒÔÌ«±Ò²ÎÊýµÄ×îÖÕÅÌËã·½·¨Îª£º

ÕâÒ»ÐдúÂëÏÔ×ű£´æÕûÊýÒç³öµÄÀíÂÛ¿ÉÄÜ£¬ÓÉÓÚËüûÓÐʹÓÃSafeMathµÈÀàËÆÇå¾²ÔËËã²Ù×÷¡£µ«ÕâÀïÒç³öµÄÖµ²¢²»ÊǾµä0xfffff¡µÈÀàËƵĴóÊý£¬¶øÊÇÒ»¸ö¹»´óµ«ÓÖԶȱ·¦uint256¼«´óÖµµÄÊý¡£
×ÐϸÊӲ췢Ã÷£¬magnitude±äÁ¿ÊÇ2µÄ64´Î·½£¬È»ºóÎÒÃÇ×öÒ»¸öµÈʽ±ä»»£º

ÕâÑùÎÒÃǾÍÕÒµ½Á˾µäÕûÊýÒç³öµÄµÚÒ»ÏÖ³¡Ö¸ÎÆ£¬Ö»ÐèÒªÉÏÃæ¼õ·¨²Ù×÷µÄµÚÒ»²Ù×÷Êý±ÈµÚ¶þ²Ù×÷ÊýÂÔС¼´¿É¡£ºÜÏÔÈ»£¬µÚÒ»²Ù×÷ÊýÓÖ¿É»®·ÖΪÁ½¸ö×Ó²Ù×÷ÊýµÄ³Ë·¨£¬Ö»ÒªÈÎÒ»¸öΪÁã¼´µ¼ÖÂЧ¹ûΪÁã¡£´Ëʱ£¬µÚ¶þ²Ù×÷ÊýÖ»ÒªÊÇí§ÒâÒ»¸öСÕýÊý¼´¿É±¬·¢ÉÏÃæµÄ¾µäÖ¸ÎÆ¡£
¼ÌÐø½á¹¹ÉÏÊöµÄ²Ù×÷Êý¡£Ê×ÏÈ£¬tokenBalanceLedger_[_customerAddress]ÔÚºÏԼŲÓõÄÉÏÏÂÎÄÖÐÌåÏÖŲÓÃÕß³ÖÓеÄtoken¡£Òò´Ë£¬Ö»ÒªÅ²ÓÃÕß²»³ÖÓкÏÔ¼token£¬Õâ¸öÖµ¾ÍÊÇÁã¡£´ËʱÎÞÂÛprofitPerShare_ֵΪ¼¸¶à£¬³Ë·¨Ð§¹û¶¼ÎªÁã¡£ÕâÑù¼õ·¨µÄµÚÒ»²Ù×÷ÊýΪÁãµÄÌõ¼þ£¬¾ÍÈÝÒ׽ṹ³öÀ´ÁË£¬¼´Å²ÓÃÕß²»³ÖÓÐGodºÏÔ¼token¡£È»ºó£¬payoutsTo_ÊÇÒ»¸ömapping¹¤¾ß£¬ºÏԼŲÓÃÕߵijõʼֵΪÁ㣬ÐèҪʹÆäΪһ¸öÕýÊý¡£

ÆÊÎöGodºÏÔ¼ÖÐÐÞ¸ÄpayoutsTo_µÄ´úÂëÓУº

¹¥»÷ºÏÔ¼ÔÚreinvestŲÓÃ֮ǰִֻÐйýtransferŲÓúÍwithdrawŲÓá£ÆäÖÐtransferŲÓôӹ¥»÷ºÏԼתtokenµ½ÍⲿÕË»§£¬ÒÔÊDz»»áÐ޸ĺÏÔ¼µÄpayoutsTo_Öµ£¬µ«withdrawº¯Êý»áÖ±½ÓÐ޸ĺÏÔ¼µÄpayoutsTo_Öµ¡£Òò´Ë£¬Ö»ÒªÔÚreinvest֮ǰŲÓÃÒ»´Îwithdrawº¯Êý¾Í¿ÉÒÔʹµÃ¼õ·¨µÄµÚ¶þ²Ù×÷ÊýΪһ¸öÕýÊý¡£
×îºó£¬µÚÒ»¸ö²Ù×÷ÊýΪÁãÖµ£¬µÚ¶þ¸ö²Ù×÷ÊýΪÕýÊý£¬²¢ÇÒ¼õ·¨Ð§¹ûÇ¿ÖÆת»»ÎªÎÞ·ûºÅÕûÊý£¬ÔÚûÓÐÔËÓÃÇå¾²ÔËËã¿âµÄÌõ¼þÏÂÖ±½ÓʹÓüõ·¨²Ù×÷¾Í»áµ¼ÖÂÒç³ö£¬Ð§¹ûΪһ¸öºÜ´óµÄÕýÊý¡£ÖÁ´Ë£¬¹¥»÷ÕßµÄÍêÕû¹¥»÷Àú³ÌÈçÏ£º

¶þ¡¢Remix¸´ÏÖ
ÔÚÆÊÎöÁËÍêÕû¹¥»÷·¾¶ºó£¬ÎÒÃÇ¿ÉÒԽṹ³öÈçÏµĹ¥»÷ºÏÔ¼£º

ÔÚremixÖÐƾ֤ÈçÏ°취¾ÙÐвÙ×÷£º
£¨1£©°²ÅÅGodºÏÔ¼£¨ÎªÁËÀû±ã×·×ÙÄÚ²¿Êý¾Ý½á¹¹µÄת±ä£¬Ö±½Ó°ÑËùÓгÉÔ±ºÍº¯Êý¶¼ÖØнç˵Ϊpublic£©£»
£¨2£©ÓÃ1eth£¬¹ºÖõÚÒ»´Îtoken£¬ÒýÓõصãÉèÖÃΪ0x00¡£»

£¨3£©ÔÙÓÃÏàͬµÄ²ÎÊýÀ´¹ºÖÃÒ»´Î£¨Ò»¶¨ÒªÔÙÀ´Ò»´Î£¬ÓÉÓÚ´ËʱºÏÔ¼µÄprofitPerShare_ÈÔÈ»ÊÇÁãÖµ£¬Õâ»áµ¼ÖÂwithdrawŲÓõĺ¯ÊýÐÞÊηûʧ°Ü£©£»

£¨4£©°²ÅŹ¥»÷ºÏÔ¼Test£¨×ª´ïGodºÏÔ¼µØµã¸øTest£©£»
£¨5£©Å²ÓÃGodºÏÔ¼µÄTransfer¸øTest·¢ËÍToken£¨ÕâÀïÖ±½Ó°Ñ¹ºÖõÄËùÓÐtoken¶¼·¢ËÍÒÑÍù£©£»

£¨6£©Å²Óù¥»÷ºÏÔ¼TestµÄwithdrawº¯Êý£¬¹¥»÷ºÏÔ¼µÄpayoutsTo_ÒѾ±»ÐÞ¸ÄΪ´óÊý£»

£¨7£©Å²Óù¥»÷ºÏÔ¼TestµÄtransferº¯Êý°ÑtokenËùÓиø½¨ÉèÕߣ¬Test´ËʱӵÓеÄtokenΪ0£¬payoutsTo_Ϊ´óÊý£»

£¨8£©Å²Óù¥»÷ºÏÔ¼µÄreinvestº¯Êý£¬ÔÚÈÕÖ¾ÖпÉÒÔ¿´µ½¼Í¼¹ºÖÃtokenµÄethΪº£Á¿£¬²¢ÇÒÀֳɹºÖÃÁË´ó×Útoken£»

£¨9£©¹¥»÷ºÏÔ¼Testͨ¹ýÒç³ö»ñµÃÁË´ó×Útoken£¬¹¥»÷Õ߾ͿÉÒÔ´ÓÕâ¸öºÏÔ¼¸øÆäËüµØµãתÒÆtoken£¬²¢¾ÙÐÐÊÛÂôÌ×È¡eth¡£
Èý¡¢Ð¡½á
GodºÏÔ¼±»¹¥»÷µÄÎó²îµã½ÏÁ¿¼òÆÓ£¬¼´±ê×¼µÄÕûÊýÒç³ö¡£ËüµÄÖØ´óÔÚÓÚÕûÊýÒç³öµÄʹÓÃÓжà¸öÔ¼ÊøÌõ¼þ£¬²¢ÇÒÊÇÔÚ²î±ðµÄÓªÒµÂß¼ÖУº
£¨1£©ÔÚÒç³ö¹¥»÷µÄÓªÒµÂß¼ÖУ¬¹¥»÷Õß±ØÐèûÓÐGodµÄtoken£¬ÇÒpayoutsTo_Öµ±ØÐèΪÕýÊý£»
£¨2£©ÒªÊ¹payoutsTo_ΪÕýÊý£¬¹¥»÷Õ߾ͱØÐèÔÚÆäËüÓªÒµÂß¼ÖÐÐ޸ģ¬ºÃ±Èwithdraw£»
£¨3£©ÒªÖ´ÐÐwithdraw£¬¹¥»÷Õ߾ͱØÐè³ÖÓÐGodµÄtoken£¨×îÖÕÒç³öʱÓÖ²»¿É³ÖÓÐtoken£©¡£
Òò´Ë£¬¹¥»÷ÕßÐèҪͨ¹ý¶à´Î´¥·¢GodºÏÔ¼µÄ²î±ðÓªÒµÂß¼²Å»ª×îÖÕÔì³ÉÕûÊýÒç³ö¡£
GodºÏÔ¼µÄ´úÂë±àд±£´æ¶à´¦È±ÏÝ£º
£¨1£©¸øÖÎÀíÔ±ÁôÏÂí§ÒâµØµãµÄtoken²Ù¿ØÄÜÁ¦£¬²¢ÇҲٿز»´¥·¢ÊÂÎñ¡£ÕâÒâζ×ÅÐÞ¸ÄÊÇÇÄÎÞÉùÏ¢µÄ£¬³ý·ÇÓÐÈËÈ¥ÂÖѯ¼à¿Øÿ¸öµØµãµÄtokenת±ä£»
£¨2£©TokenµÄijЩתÒÆÀú³ÌûÓÐŲÓñê×¼ERC20ÊÂÎñ½Ó¿Ú£¬µ¼ÖÂetherscanÉÏ¿´µ½µÄtokenת±äÊǼ«¶Ë½û¾øÈ·µÄ£¬µ¹ÔËÓÚ¹ûÕæ͸Ã÷¼àÊÓ£»
£¨3£©´úÂëÖв»Ë¼Á¿ÏÞÖÆÑ»·£¬ÎÞÒâÒåµÄgasÆÌÕÅ£¨ÕâÒ²µ¼ÖÂÁËÔÚRemixµ÷ÊÔÖо³£Í߽⣩£»
£¨4£©ºÏÔ¼ÖеÄÓªÒµÂ߼ûÓÐ˵Ã÷¹æ·¶£¬½ö¿ª·ÅºÏÔ¼´úÂë²¢²»¿ÉµÈ¼ÛÓÚÏîĿ͸Ã÷¡£