0

In the case of this contract code, all the tokens sent to the contract are forever locked? Were they effectively burned?

I don't see any function like the solutions offered in this question, and I can't read the code well enough to tell, hence this question.

Here is the decompiled bytecode:

def storage:
  owner is addr at storage 0
  newOwner is addr at storage 1
  symbol is array of uint256 at storage 2
  name is array of uint256 at storage 3
  decimals is uint8 at storage 4
  _totalSupply is uint256 at storage 5
  balanceOf is mapping of uint256 at storage 6
  allowance is mapping of uint256 at storage 7

def name(): # not payable
  return name[0 len name.length]

def decimals(): # not payable
  return decimals

def _totalSupply(): # not payable
  return _totalSupply

def balanceOf(address _owner): # not payable
  return balanceOf[addr(_owner)]

def owner(): # not payable
  return owner

def symbol(): # not payable
  return symbol[0 len symbol.length]

def newOwner(): # not payable
  return newOwner

def allowance(address _owner, address _spender): # not payable
  return allowance[addr(_owner)][addr(_spender)]

#
#  Regular functions
#

def _fallback() payable: # default function
  revert

def totalSupply(): # not payable
  return (_totalSupply - balanceOf[0])

def transferOwnership(address _newOwner): # not payable
  require caller == owner
  newOwner = _newOwner

def safeSub(uint256 _a, uint256 _b): # not payable
  require _b <= _a
  return (_a - _b)

def safeAdd(uint256 _a, uint256 _b): # not payable
  require _a + _b >= _a
  return (_a + _b)

def safeDiv(uint256 _a, uint256 _b): # not payable
  require _b > 0
  require _b
  return (_a / _b)

def safeMul(uint256 _a, uint256 _b): # not payable
  if _a:
      require _a
      require _a * _b / _a == _b
  return (_a * _b)

def acceptOwnership(): # not payable
  require caller == newOwner
  log OwnershipTransferred(
        address previousOwner=owner,
        address newOwner=newOwner)
  owner = newOwner
  newOwner = 0

def approve(address _spender, uint256 _value): # not payable
  allowance[caller][addr(_spender)] = _value
  log Approval(
        address owner=_value,
        address spender=caller,
        uint256 value=_spender)
  return 1

def transferAnyERC20Token(address _tokenAddress, uint256 _tokens): # not payable
  require caller == owner
  require ext_code.size(_tokenAddress)
  call _tokenAddress.transfer(address to, uint256 value) with:
       gas gas_remaining wei
      args owner, _tokens
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  require return_data.size >= 32
  return bool(ext_call.return_data[0])

def transfer(address _to, uint256 _value): # not payable
  require _value <= balanceOf[caller]
  balanceOf[caller] -= _value
  require balanceOf[addr(_to)] + _value >= balanceOf[addr(_to)]
  balanceOf[addr(_to)] += _value
  log Transfer(
        address from=_value,
        address to=caller,
        uint256 value=_to)
  return 1

def approveAndCall(address _spender, uint256 _amount, bytes _extraData): # not payable
  allowance[caller][addr(_spender)] = _amount
  log Approval(
        address owner=_amount,
        address spender=caller,
        uint256 value=_spender)
  require ext_code.size(_spender)
  call _spender.receiveApproval(address from, uint256 value, address token, bytes extraData) with:
       gas gas_remaining wei
      args caller, _amount, addr(this.address), Array(len=_extraData.length, data=_extraData[all])
  if not ext_call.success:
      revert with ext_call.return_data[0 len return_data.size]
  return 1

def transferFrom(address _from, address _to, uint256 _value): # not payable
  require _value <= balanceOf[addr(_from)]
  balanceOf[addr(_from)] -= _value
  require _value <= allowance[addr(_from)][caller]
  allowance[addr(_from)][caller] -= _value
  require balanceOf[addr(_to)] + _value >= balanceOf[addr(_to)]
  balanceOf[addr(_to)] += _value
  log Transfer(
        address from=_value,
        address to=_from,
        uint256 value=_to)
  return 1
  • "I can't read the code well enough" - there is no code in that link!!! – goodvibration Apr 27 at 12:20
  • You have to click on 'Decompile bytecode'. There is no direct link. – user2066480 Apr 27 at 13:05
  • Welcome to the Ethereum Stack Exchange! Please check the help center for how to improve your question. – eth Apr 28 at 2:51
0

No, they are not locked forever.

The owner can call function transferAnyERC20Token to transfer to itself any ERC20 token assigned to the contract.

The function totalSupply doesn't account zero address (0x0000..000) towards the total supply, so if you sent tokens to zero address it will consider them as burned.

def totalSupply(): # not payable
  return (_totalSupply - balanceOf[0])
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.