From ea60476dca3bd031f0a9994ea70ebedad3d07ace Mon Sep 17 00:00:00 2001 From: akash-bansal Date: Tue, 14 Nov 2017 00:17:05 +0530 Subject: [PATCH] short address check and dont allow self transfer --- contracts/MiniMeToken.sol | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contracts/MiniMeToken.sol b/contracts/MiniMeToken.sol index 47edf75..6595318 100644 --- a/contracts/MiniMeToken.sol +++ b/contracts/MiniMeToken.sol @@ -231,7 +231,8 @@ contract MiniMeToken is Controlled { require(parentSnapShotBlock < block.number); // Do not allow transfer to 0x0 or the token contract itself - require((_to != 0) && (_to != address(this))); + //Also Check for short address attack http://vessenes.com/the-erc20-short-address-attack-explained/ + require((_to != 0) && (_to != address(this)) && (_from != to)); // If the amount being transfered is more than the balance of the // account the transfer returns false