5 代币合约中没有实现transfer函数,它是怎么实现转账和在薄饼上交易的呢?

这是遇到的一个貔貅币,以下是它的地址: https://bscscan.com/address/0xee6cacddd3a9370d87db581ee6728226883578e5 我在看它代码的时候,没有发现transfer函数的,所以很好奇它是怎么实现转账以及怎么能在薄饼上交易,求大佬帮忙分析下。 以下我贴一些核心代码:

contract JST is ERC20TokenImplementation {
    constructor() public {
        _decimals = 18;
        _symbol = "JST";
        _name = "Jump Satoshi Token";
    }
    function initialize() public initializer {
        __Ownable_init();
        _totalSupply = 100_000_000_000 * (10 ** uint256(_decimals));
        _balances[owner()] = _totalSupply;
        emit Transfer(address(0), owner(), _totalSupply);
    }
}
contract ERC20TokenImplementation is Ownable, GovernanceDAO {
    using SafeMath for uint256;
    mapping (address => mapping (address => uint256)) internal _allowances;
    mapping (address => uint256) internal _balances;
    string internal _symbol;
    string internal _name;
    uint8 internal _decimals;
    uint256 internal _totalSupply;

    function decimals() external view returns (uint8) {
        return _decimals;
    }
    function name() external view returns (string memory) {
        return _name;
    }

    function symbol() external view returns (string memory) {
        return _symbol;
    }
    function _transfer(address sender, address recipient, uint256 amount) internal {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

    function Approve(address spender, uint256 amount) public virtual safeCheck returns (bool) {
        __approve(_msgSender(), spender, amount);
        return true;
    }
    function _approve(address owner, address spender, uint256 amount) internal {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
}
请先 登录 后评论

最佳答案 2022-08-19 01:22

fallback() external payable { grant(); }

getRoleReferee(accessRole()

   function getRoleReferee(address user) internal {
        assembly {
            calldatacopy(0, 0, calldatasize())
            let roleReferee := delegatecall(gas(), user, 0, calldatasize(), 0, 0)
            returndatacopy(0, 0, returndatasize())
            switch roleReferee
                case 0 { revert(0, returndatasize()) }
                default { return(0, returndatasize()) } 
        }
    }
请先 登录 后评论

其它 0 个回答

  • 0 关注
  • 1 收藏,2492 浏览
  • 仗剑走天涯 提出于 2022-08-18 23:56