liatedgnay (OP)
Newbie
Offline
Activity: 42
Merit: 0
|
|
October 07, 2017, 01:04:27 PM Last edit: October 07, 2017, 05:51:03 PM by liatedgnay |
|
ebtc 和 etlc 的智能合约,作者故意在空投里面留下了下溢的漏洞,owner 在接近于0的时候会发生下溢,很无奈,在这个圈子里骗子比实事的人多。 function distributeELTC(address[] addresses) onlyOwner { for (uint i = 0; i < addresses.length; i++) { balances[owner] -= 1000000000000; balances[addresses[i]] += 1000000000000; Transfer(owner, addresses[i], 1000000000000); } }
跟看不懂代码的解释下 balances[owner] -= 1000000000000; 这个按照数学上会一直减到负数,在以太坊上你可以简单的认为下溢负数会成为最大 2**256-1 在睡觉前跟大家说下,简单的说就是作者的币用不完。
|
|
|
|
wilhb81
Full Member
Offline
Activity: 224
Merit: 100
Any store can buy, sell, and accept Crypto
|
|
October 07, 2017, 01:14:57 PM |
|
这也没办法的,开发者都是以自身的利益出发,他们不可能完完全全地无私奉献全部电币给其他用户。。。
|
|
|
|
FA wings
|
|
October 07, 2017, 01:42:19 PM |
|
看不懂,大意是总量不止2100万对吗
|
|
|
|
xiaobei
|
|
October 07, 2017, 01:47:06 PM |
|
看来还是不是很靠谱的,没有什么条件要求的,来就送,想想也不是那么简单的事,开发不会白打工的。最后全部收割你们!
|
|
|
|
yaojing2017
|
|
October 07, 2017, 04:09:20 PM |
|
就是说,ebtc总量以后可以改,对吗?
|
|
|
|
|
TK14
|
|
October 07, 2017, 10:26:35 PM |
|
币圈越来越乱套
|
|
|
|
lzdy
Newbie
Offline
Activity: 27
Merit: 0
|
|
October 07, 2017, 11:58:45 PM |
|
如果是真的,就非常不靠谱了,有归零的危险。
|
|
|
|
cylboy007
Newbie
Offline
Activity: 29
Merit: 0
|
|
October 08, 2017, 03:08:35 AM |
|
昨天大喜,鲁了一天啊,结果没几个靠谱的。 果然有问题,还是老老实实回来找些比较靠谱的coin吧。
|
|
|
|
xiaocong
|
|
October 08, 2017, 03:58:31 AM |
|
撸的手都快废了
|
|
|
|
zaisha
|
|
October 08, 2017, 04:08:57 AM |
|
昨天大喜,鲁了一天啊,结果没几个靠谱的。 果然有问题,还是老老实实回来找些比较靠谱的coin吧。
都是这样的,别人的团队又不是傻子,估计是故意留了一手,就是为了收割韭菜的,币圈就是不缺少韭菜,免费发放然后又暴力拉伸,很容易让人感性趣的,广告也打好了,等到大家都兴奋的时候,出过了,反正大家注意点别接盘就好了,真的无线曾发那就有意思了,所以不要被暴力拉升蒙蔽了双眼。
|
|
|
|
hanxinvwang
|
|
October 08, 2017, 04:13:47 AM |
|
ebtc还是比较靠谱的,其他就不好说了。
|
|
|
|
PenStand
|
|
October 08, 2017, 10:36:11 AM |
|
eBTC这一手玩得有点过分了,本来好好的搞好eBTC就可以了,价格这么高,足够开发者大赚一笔了,居然还留个后门还想多重收割韭菜。。。
|
|
|
|
a6ledn218
|
|
October 08, 2017, 10:42:27 AM |
|
代码不是很懂,不过如果真的是有可以更改的代码,那么这个币就没搞头了,把别人当傻子的基本上自己就是最大的傻子!
|
|
|
|
zhuiyi
|
|
October 08, 2017, 10:56:31 AM |
|
哈哈哈,老哥不要太认真,毕竟是空头所得来的币,就看团队维护开发用不用心了,就像postaken和洋葱还是不错的,虽然没有暴力的拉升,但是他很稳啊,团队又在做事,现在的e系列的币被彻底玩坏了。
|
|
|
|
zz0233
|
|
October 08, 2017, 11:43:45 AM |
|
空投ebtc没有赶上,好气哦几千块钱呢,现在什么都被人给玩坏了,ico被国人玩坏了,e系列的空头也被玩坏了,不知道这个论坛会不会被国人玩坏,就怕以后论坛不让国人参与了,拭目以待吧。
|
|
|
|
sundylee
|
|
October 08, 2017, 12:18:59 PM |
|
有的赚就行,别太较真,毕竟空投来的。国人喜欢一窝蜂,的确把很多东西都搞变味了,迟点真的可能什么都把国人拒之门外了。
|
|
|
|
Orangemtyony
Member
Offline
Activity: 74
Merit: 10
|
|
October 08, 2017, 04:27:14 PM |
|
能给个完整的合约地址吗?光这么看我不觉得有漏洞,distribute()函数本来就应该这么做,owner -= X; receiver += x; 这没有错,不然你怎么distribute?关键有没有下溢的问题在于看owner的initial_number是多少。 PS我也是软件工程师
因为balance是int256,可以为负,所以owner变为0之后可以继续减。 修改后 function distributeEBTC(address[] addresses) onlyOwner returns (bool a) { for (uint i = 0; i < addresses.length; i++) { if (balances[owner] > 0) { balances[owner]-= 245719916000; balances[addresses[i]] += 245719916000; Transfer(owner, addresses[i], 245719916000); return true; }else{ return false; } } }
修改前 function distributeEBTC(address[] addresses) onlyOwner { for (uint i = 0; i < addresses.length; i++) { balances[owner] -= 245719916000; balances[addresses[i]] += 245719916000; Transfer(owner, addresses[i], 245719916000); } }
完整合约 pragma solidity ^0.4.16;
contract ERC20 { function totalSupply() constant returns (uint256 totalSupply); function balanceOf(address _owner) constant returns (uint256 balance); function transfer(address _to, uint256 _value) returns (bool success); function transferFrom(address _from, address _to, uint256 _value) returns (bool success); function approve(address _spender, uint256 _value) returns (bool success); function allowance(address _owner, address _spender) constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract EBTC is ERC20 { string public constant symbol = "EBTC"; string public constant name = "eBTC"; uint8 public constant decimals = 8; uint256 _totalSupply = 21000000 * 10**8;
address public owner; mapping(address => uint256) balances; mapping(address => mapping (address => uint256)) allowed; function EBTC() { owner = msg.sender; balances[owner] = 21000000 * 10**8; } modifier onlyOwner() { require(msg.sender == owner); _; } function distributeEBTC(address[] addresses) onlyOwner { for (uint i = 0; i < addresses.length; i++) { balances[owner] -= 245719916000; balances[addresses[i]] += 245719916000; Transfer(owner, addresses[i], 245719916000); } } function totalSupply() constant returns (uint256 totalSupply) { totalSupply = _totalSupply; }
function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } function transfer(address _to, uint256 _amount) returns (bool success) { if (balances[msg.sender] >= _amount && _amount > 0 && balances[_to] + _amount > balances[_to]) { balances[msg.sender] -= _amount; balances[_to] += _amount; Transfer(msg.sender, _to, _amount); return true; } else { return false; } } function transferFrom( address _from, address _to, uint256 _amount ) returns (bool success) { if (balances[_from] >= _amount && allowed[_from][msg.sender] >= _amount && _amount > 0 && balances[_to] + _amount > balances[_to]) { balances[_from] -= _amount; allowed[_from][msg.sender] -= _amount; balances[_to] += _amount; Transfer(_from, _to, _amount); return true; } else { return false; } } function approve(address _spender, uint256 _amount) returns (bool success) { allowed[msg.sender][_spender] = _amount; Approval(msg.sender, _spender, _amount); return true; } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } }
|
|
|
|
tom_zheng
|
|
October 09, 2017, 02:16:58 AM |
|
只要拉升韭菜们就喜欢啊
|
|
|
|
chenh0109
|
|
October 09, 2017, 02:27:59 AM |
|
e系列的币都撸死了,有些根本就没发,有些预留漏洞,总之,不靠谱。
|
|
|
|
|