[T]utorial [A]bout




#
#  Panoramix 7 Nov 20:00 
#  Decompiled source of 0xeBE6c7a839A660a0F04BdF6816e2eA182F5d542C
# 
#  Let's make the world open source 
# 

#  Constants

const MAX_UINT256() = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff


#  Storage definitions and getters

def storage:
  ownerAddress is addr # mask(160, 0) at storage #0

def owner() : # not payable
  return with ownerAddress




#  Regular functions

#  you may find the following here:
# 
#  cd[xx]      -- means calldata (function parameter) at position xx
#                 most of it will look better soon
#
#  not/!       -- 'not' == 'iszero'; '!' == binary not 
#

def transfer(address _to, uint256 _value) payable: 
  require (call.value - _value) >= 0
  call addr(_to) with:	# withdraw / default function
       gas 2300 * not _value wei
     value _value wei
  if not ext_call.success:
      return with bool(0)
  log Transfer(address,address,uint256), caller, addr(_to), _value
  return with bool(1)


def transferOwnership(address _newOwner) : # not payable
  require caller == ownerAddress
  ownerAddress = addr(_newOwner)
  log OwnerChanged(address), addr(_newOwner), 0
  stop


def withdraw(address _player, uint256 _withdraw_v) : # not payable
  require caller == ownerAddress
  call addr(_player) with:	# withdraw / default function
       gas 2300 * not (10^18 * _withdraw_v) wei
     value 10^18 * _withdraw_v wei
  if not ext_call.success:
      return with bool(0)
  log Withdraw(address,uint256), addr(_player), (10^18 * _withdraw_v)
  return with bool(1)


def _fallback() payable: # default function
  revert