Oko contract explorer
Contract

Code for 0x360f…747b (Contract, second bZx attacker contract, bZx Exploit)

Since block 9504567

Panoramix decompilation

#
#  Panoramix 17 Feb 2020 
# 

def _fallback() payable: # default function
  stop

def withdraw(): # not payable
  call 0xb8c6ad5fe7cb6cc72f2c4196dca11fbb272a8cbf with:
     value eth.balance(this.address) wei
       gas 2300 * is_zero(value) wei
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]

def unknown7eef37a1(uint256 _param1): # not payable
  require calldata.size - 4 >= 32
  require 0xb8c6ad5fe7cb6cc72f2c4196dca11fbb272a8cbf == tx.origin
  require ext_code.size(0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2)
  call 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.withdraw(uint256 amountWith) with:
       gas gas_remaining wei
      args 7500 * 10^18
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require ext_code.size(0x818e6fecd516ecc3849daf6845e3ec868087b755)
  call 0x818e6fecd516ecc3849daf6845e3ec868087b755.swapEtherToToken(address token, uint256 minConversionRate) with:
     value _param1 wei
       gas gas_remaining wei
      args 0x57ab1ec28d129707052df4df418d58a2d46d5f51, 10
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0x818e6fecd516ecc3849daf6845e3ec868087b755)
  call 0x818e6fecd516ecc3849daf6845e3ec868087b755.swapEtherToToken(address token, uint256 minConversionRate) with:
     value 20 * 10^18 wei
       gas gas_remaining wei
      args 0x57ab1ec28d129707052df4df418d58a2d46d5f51, 10
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0x818e6fecd516ecc3849daf6845e3ec868087b755)
  call 0x818e6fecd516ecc3849daf6845e3ec868087b755.swapEtherToToken(address token, uint256 minConversionRate) with:
     value 20 * 10^18 wei
       gas gas_remaining wei
      args 0x57ab1ec28d129707052df4df418d58a2d46d5f51, 10
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0x818e6fecd516ecc3849daf6845e3ec868087b755)
  call 0x818e6fecd516ecc3849daf6845e3ec868087b755.swapEtherToToken(address token, uint256 minConversionRate) with:
     value 20 * 10^18 wei
       gas gas_remaining wei
      args 0x57ab1ec28d129707052df4df418d58a2d46d5f51, 10
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0x818e6fecd516ecc3849daf6845e3ec868087b755)
  call 0x818e6fecd516ecc3849daf6845e3ec868087b755.swapEtherToToken(address token, uint256 minConversionRate) with:
     value 20 * 10^18 wei
       gas gas_remaining wei
      args 0x57ab1ec28d129707052df4df418d58a2d46d5f51, 10
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0x818e6fecd516ecc3849daf6845e3ec868087b755)
  call 0x818e6fecd516ecc3849daf6845e3ec868087b755.swapEtherToToken(address token, uint256 minConversionRate) with:
     value 20 * 10^18 wei
       gas gas_remaining wei
      args 0x57ab1ec28d129707052df4df418d58a2d46d5f51, 10
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0x818e6fecd516ecc3849daf6845e3ec868087b755)
  call 0x818e6fecd516ecc3849daf6845e3ec868087b755.swapEtherToToken(address token, uint256 minConversionRate) with:
     value 20 * 10^18 wei
       gas gas_remaining wei
      args 0x57ab1ec28d129707052df4df418d58a2d46d5f51, 10
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0x818e6fecd516ecc3849daf6845e3ec868087b755)
  call 0x818e6fecd516ecc3849daf6845e3ec868087b755.swapEtherToToken(address token, uint256 minConversionRate) with:
     value 20 * 10^18 wei
       gas gas_remaining wei
      args 0x57ab1ec28d129707052df4df418d58a2d46d5f51, 10
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0x818e6fecd516ecc3849daf6845e3ec868087b755)
  call 0x818e6fecd516ecc3849daf6845e3ec868087b755.swapEtherToToken(address token, uint256 minConversionRate) with:
     value 20 * 10^18 wei
       gas gas_remaining wei
      args 0x57ab1ec28d129707052df4df418d58a2d46d5f51, 10
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0x818e6fecd516ecc3849daf6845e3ec868087b755)
  call 0x818e6fecd516ecc3849daf6845e3ec868087b755.swapEtherToToken(address token, uint256 minConversionRate) with:
     value 20 * 10^18 wei
       gas gas_remaining wei
      args 0x57ab1ec28d129707052df4df418d58a2d46d5f51, 10
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0x818e6fecd516ecc3849daf6845e3ec868087b755)
  call 0x818e6fecd516ecc3849daf6845e3ec868087b755.swapEtherToToken(address token, uint256 minConversionRate) with:
     value 20 * 10^18 wei
       gas gas_remaining wei
      args 0x57ab1ec28d129707052df4df418d58a2d46d5f51, 10
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0x818e6fecd516ecc3849daf6845e3ec868087b755)
  call 0x818e6fecd516ecc3849daf6845e3ec868087b755.swapEtherToToken(address token, uint256 minConversionRate) with:
     value 20 * 10^18 wei
       gas gas_remaining wei
      args 0x57ab1ec28d129707052df4df418d58a2d46d5f51, 10
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0x818e6fecd516ecc3849daf6845e3ec868087b755)
  call 0x818e6fecd516ecc3849daf6845e3ec868087b755.swapEtherToToken(address token, uint256 minConversionRate) with:
     value 20 * 10^18 wei
       gas gas_remaining wei
      args 0x57ab1ec28d129707052df4df418d58a2d46d5f51, 10
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0x818e6fecd516ecc3849daf6845e3ec868087b755)
  call 0x818e6fecd516ecc3849daf6845e3ec868087b755.swapEtherToToken(address token, uint256 minConversionRate) with:
     value 20 * 10^18 wei
       gas gas_remaining wei
      args 0x57ab1ec28d129707052df4df418d58a2d46d5f51, 10
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0x818e6fecd516ecc3849daf6845e3ec868087b755)
  call 0x818e6fecd516ecc3849daf6845e3ec868087b755.swapEtherToToken(address token, uint256 minConversionRate) with:
     value 20 * 10^18 wei
       gas gas_remaining wei
      args 0x57ab1ec28d129707052df4df418d58a2d46d5f51, 10
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0x818e6fecd516ecc3849daf6845e3ec868087b755)
  call 0x818e6fecd516ecc3849daf6845e3ec868087b755.swapEtherToToken(address token, uint256 minConversionRate) with:
     value 20 * 10^18 wei
       gas gas_remaining wei
      args 0x57ab1ec28d129707052df4df418d58a2d46d5f51, 10
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0x818e6fecd516ecc3849daf6845e3ec868087b755)
  call 0x818e6fecd516ecc3849daf6845e3ec868087b755.swapEtherToToken(address token, uint256 minConversionRate) with:
     value 20 * 10^18 wei
       gas gas_remaining wei
      args 0x57ab1ec28d129707052df4df418d58a2d46d5f51, 10
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0x818e6fecd516ecc3849daf6845e3ec868087b755)
  call 0x818e6fecd516ecc3849daf6845e3ec868087b755.swapEtherToToken(address token, uint256 minConversionRate) with:
     value 20 * 10^18 wei
       gas gas_remaining wei
      args 0x57ab1ec28d129707052df4df418d58a2d46d5f51, 10
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0x818e6fecd516ecc3849daf6845e3ec868087b755)
  call 0x818e6fecd516ecc3849daf6845e3ec868087b755.swapEtherToToken(address token, uint256 minConversionRate) with:
     value 20 * 10^18 wei
       gas gas_remaining wei
      args 0x57ab1ec28d129707052df4df418d58a2d46d5f51, 10
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0x172e09691dfbbc035e37c73b62095caa16ee2388)
  call 0x172e09691dfbbc035e37c73b62095caa16ee2388.0x1f930115 with:
     value 6000 * 10^18 wei
       gas gas_remaining wei
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0x57ab1ec28d129707052df4df418d58a2d46d5f51)
  static call 0x57ab1ec28d129707052df4df418d58a2d46d5f51.balanceOf(address owner) with:
          gas gas_remaining wei
         args this.address
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0x57ab1ec28d129707052df4df418d58a2d46d5f51)
  call 0x57ab1ec28d129707052df4df418d58a2d46d5f51.approve(address spender, uint256 value) with:
       gas gas_remaining wei
      args 0x77f973fcaf871459aa58cd81881ce453759281bc, ext_call.return_data[0]
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0x77f973fcaf871459aa58cd81881ce453759281bc)
  call 0x77f973fcaf871459aa58cd81881ce453759281bc.0xcfb65bb9 with:
       gas gas_remaining wei
      args 0, 0, 2 * 10^18, 168 * 24 * 3600, ext_call.return_data[0], this.address, this.address, 0x57ab1ec28d129707052df4df418d58a2d46d5f51, 256, 0, mem[388]
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  require ext_code.size(0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2)
  call 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.deposit() with:
     value 7500 * 10^18 wei
       gas gas_remaining wei
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require ext_code.size(0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2)
  call 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.transfer(address to, uint256 value) with:
       gas gas_remaining wei
      args 0x77f973fcaf871459aa58cd81881ce453759281bc, 7500 * 10^18
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  return 0

Decompilation generated by Panoramix