最近我从pancakeswap购买了一个代币。看起来,它被欺骗了——它是新的,只有买入操作,没有卖出操作。我也不能把它换回来。
我正在提供它的合同源代码,如果有人解释为什么它不能出售,我会很高兴:
#
# Panoramix v4 Oct 2019
# Decompiled source of bsc:0xEF45178482b5868668D4ae8f2556D4F23c4Ffe51
#
# Let's make the world open source
#
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
stor5 is uint256 at storage 5
unknown1ee59f20Address is addr at storage 6
balanceOf is mapping of uint256 at storage 7
allowance is mapping of uint256 at storage 8
def name(): # not payable
return name[0 len name.length]
def unknown1ee59f20(): # not payable
return unknown1ee59f20Address
def decimals(): # not payable
return decimals
def balanceOf(address _owner): # not payable
require calldata.size - 4 >= 32
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
require calldata.size - 4 >= 64
return allowance[addr(_owner)][addr(_spender)]
#
# Regular functions
#
def _fallback() payable: # default function
revert
def totalSupply(): # not payable
require balanceOf[0] <= stor5
return (stor5 - balanceOf[0])
def transferOwnership(address _newOwner): # not payable
require calldata.size - 4 >= 32
require caller == owner
newOwner = _newOwner
def unknown81f4f399(addr _param1): # not payable
require calldata.size - 4 >= 32
require caller == owner
unknown1ee59f20Address = _param1
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
require calldata.size - 4 >= 64
allowance[caller][addr(_spender)] = _value
log Approval(
address owner=_value,
address spender=caller,
uint256 value=_spender)
return 1
def transfer(address _to, uint256 _value): # not payable
require calldata.size - 4 >= 64
if unknown1ee59f20Address == _to:
revert with 0, 'Please wait'
require _value <= balanceOf[caller]
balanceOf[caller] -= _value
require _value + balanceOf[_to] >= balanceOf[_to]
balanceOf[addr(_to)] = _value + balanceOf[_to]
log Transfer(
address from=_value,
address to=caller,
uint256 value=_to)
return 1
def approveAndCall(address _spender, uint256 _amount, bytes _extraData): # not payable
require calldata.size - 4 >= 96
require _extraData <= 4294967296
require _extraData + 36 <= calldata.size
require _extraData.length <= 4294967296 and _extraData + _extraData.length + 36 <= calldata.size
allowance[caller][addr(_spender)] = _amount
mem[ceil32(_extraData.length) + 128] = _amount
log Approval(address owner, address spender, uint256 value):
Mask(8 * -ceil32(_extraData.length) + _extraData.length + 32, 0, 0),
mem[_extraData.length + 160 len -_extraData.length + ceil32(_extraData.length)],
caller,
_spender,
require ext_code.size(_spender)
call _spender with:
gas gas_remaining wei
args caller, _amount, 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 0, 1
def transferFrom(address _from, address _to, uint256 _value): # not payable
require calldata.size - 4 >= 96
if not _from:
if unknown1ee59f20Address == _to:
revert with 0, 'Please wait'
else:
if unknown1ee59f20Address:
if unknown1ee59f20Address == _to:
revert with 0, 'Please wait'
else:
unknown1ee59f20Address = _to
require _value <= balanceOf[addr(_from)]
balanceOf[addr(_from)] -= _value
require _value <= allowance[addr(_from)][caller]
allowance[addr(_from)][caller] -= _value
require _value + balanceOf[addr(_to)] >= balanceOf[addr(_to)]
balanceOf[addr(_to)] += _value
log Transfer(
address from=_value,
address to=_from,
uint256 value=_to)
return 1
如果能帮我把它换回来并归还我的投资,我将不胜感激。
此合约将从合约发送令牌的最后一个地址列入黑名单。
这是什么意思
这意味着,如果你从DeFi合同池(如Pancake swap/uniswap、1In等(购买代币,你就不能立即通过它们出售(转移代币(,因为池地址将被列入黑名单。
如果你想出售代币,你可以:
- 在不同的Defi交易所出售(如果是Pancakeswap,则将其设为uniswap或1inc等(
- 或者创建一个为您保存代币的合同,然后将其释放。这将(不可收回(
他们是怎么做到的
合同包含一个存储地址的变量。它恢复该地址的所有操作from
。
这是他收到TransferFrom:代币的最后一个地址
def storage:
...
unknown1ee59f20Address is addr at storage 6
...
当有人从PancakeSwap/Uniswap这样的池中购买代币时,它会调用transferFrom
方法,记录最后一个收到代币的地址。
def transferFrom(address _from, address _to, uint256 _value): # not payable
require calldata.size - 4 >= 96
if not _from:
if unknown1ee59f20Address == _to:
revert with 0, 'Please wait'
else:
if unknown1ee59f20Address:
if unknown1ee59f20Address == _to:
revert with 0, 'Please wait'
else:
unknown1ee59f20Address = _to # <-- Address Blacklisted HERE !!!!
由于此合约只全局存储一个addess,因此使用不同的合约将覆盖此变量。