Overview

LGT-NFT
Rank #N/A

Profile Summary

Skynet Trust Score

81%
  • Project is Relatively Decentralized
  • Large Market Cap (top 25%)
  • Long-running Project
  • Trust Score is #1 amongst all projects
Security Score
81 / 100
Market & Community
93 / 100

LGT-NFT Info

Metaverse NFT platform project

Audits

Onboarded Date

13/Dec/2022

Contracts

0x162...2eb68

Website

How do you feel about this project's security?
Documents
File Name Type Size Upload Date Action
Zip File 4.57 MB 12 Dec 2021
PDF File 8.89 MB 24 Nov 2021
MP4 File 14.62 MB 19 Nov 2021
XSL File 2.38 KB 14 Nov 2021
Floder File 87.24 MB 08 Nov 2021
PNG File 879 KB 02 Nov 2021
Activities
Oliver Phillips New

We talked about a project on linkedin.

Today
N
Nancy Martino In Progress

Create new project Buildng product

Yesterday
Natasha Carey Completed

Adding a new event with attachments

25 Nov
Bethany Johnson

added a new member to velzon dashboard

19 Nov
Your order is placed Out of Delivery

These customers can rest assured their order has been placed.

16 Nov
Lewis Pratt

They all have something to say beyond the words on the page. They can come across as casual or neutral, exotic or graphic.

22 Oct
Monthly sales report

2 days left notification to submit the monthly sales report. Reports Builder

15 Oct
New ticket received Completed

User Erica245 submitted a ticket.

26 Aug
Nancy Martino

Team Leader & HR

225

Projects

197

Tasks

HB
Henry Baird

Full Stack Developer

352

Projects

376

Tasks

Frank Hook

Project Manager

164

Projects

182

Tasks

Jennifer Carter

UI/UX Designer

225

Projects

197

Tasks

ME
Megan Elmore

Team Leader & Web Developer

201

Projects

263

Tasks

Alexis Clarke

Backend Developer

132

Projects

147

Tasks

NC
Nathan Cole

Front-End Developer

352

Projects

376

Tasks

Joseph Parker

Team Leader & HR

64

Projects

93

Tasks

Erica Kernan

Web Designer

345

Projects

298

Tasks

DP
Donald Palmer

Wed Developer

97

Projects

135

Tasks

Showing 1 to 10 of 12 entries

Code Audit History

1 Audit available
Last Audit was delivered on 13 December 2022

LGT-NFT -Audit

View Findings
5

All Findings

0

Acknowledge

0

Partially

5

Resolved

1
Critical privilege
1
Major privilege
0
Medium none
2
Minor privilege
0
Optimization none
1
Informational privilege
0
Discussion none

Method

Audited Files/SHA256

Contracts

0x16243911e0...2eb68

Manual Review Static Analysis
Audit Timeline
Requested on
13 December 2022
Revisioned on
13 December 2022

Formal Verification Result

9 / 38 Properties True
80%

Token Standard

ERC-20

Functions

6

Verified Contract

LGT-NFT (LGT-NGTToken.sol) 1

LGT-NFT Smart Contract Code

                        
                        

/**

 *Submitted for verification at BscScan.com on 2022-09-08

*/


/**

 *Submitted for verification at BscScan.com on 2022-05-15

*/


// SPDX-License-Identifier: MIT

pragma solidity ^0.8.4;


interface IERC20 {

    /**

     * @dev Returns the amount of tokens in existence.

     */

    function totalSupply() external view returns (uint256);


    /**

     * @dev Returns the amount of tokens owned by `account`.

     */

    function balanceOf(address account) external view returns (uint256);


    /**

     * @dev Moves `amount` tokens from the caller's account to `recipient`.

     *

     * Returns a boolean value indicating whether the operation succeeded.

     *

     * Emits a {Transfer} event.

     */

    function transfer(address recipient, uint256 amount) external returns (bool);


    /**

     * @dev Returns the remaining number of tokens that `spender` will be

     * allowed to spend on behalf of `owner` through {transferFrom}. This is

     * zero by default.

     *

     * This value changes when {approve} or {transferFrom} are called.

     */

    function allowance(address owner, address spender) external view returns (uint256);


    /**

     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.

     *

     * Returns a boolean value indicating whether the operation succeeded.

     *

     * IMPORTANT: Beware that changing an allowance with this method brings the risk

     * that someone may use both the old and the new allowance by unfortunate

     * transaction ordering. One possible solution to mitigate this race

     * condition is to first reduce the spender's allowance to 0 and set the

     * desired value afterwards:

     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729

     *

     * Emits an {Approval} event.

     */

    function approve(address spender, uint256 amount) external returns (bool);


    /**

     * @dev Moves `amount` tokens from `sender` to `recipient` using the

     * allowance mechanism. `amount` is then deducted from the caller's

     * allowance.

     *

     * Returns a boolean value indicating whether the operation succeeded.

     *

     * Emits a {Transfer} event.

     */

    function transferFrom(

        address sender,

        address recipient,

        uint256 amount

    ) external returns (bool);


    /**

     * @dev Emitted when `value` tokens are moved from one account (`from`) to

     * another (`to`).

     *

     * Note that `value` may be zero.

     */

    event Transfer(address indexed from, address indexed to, uint256 value);


    /**

     * @dev Emitted when the allowance of a `spender` for an `owner` is set by

     * a call to {approve}. `value` is the new allowance.

     */

    event Approval(address indexed owner, address indexed spender, uint256 value);

}


abstract contract Context {

    function _msgSender() internal view virtual returns (address) {

        return msg.sender;

    }


    function _msgData() internal view virtual returns (bytes calldata) {

        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691

        return msg.data;

    }

}


interface IUniswapV2Router01 {

    function factory() external pure returns (address);

    function addLiquidity(

        address tokenA,

        address tokenB,

        uint amountADesired,

        uint amountBDesired,

        uint amountAMin,

        uint amountBMin,

        address to,

        uint deadline

    ) external returns (uint amountA, uint amountB, uint liquidity);


    function swapExactTokensForTokens(

        uint amountIn,

        uint amountOutMin,

        address[] calldata path,

        address to,

        uint deadline

    ) external returns (uint[] memory amounts);


    function swapTokensForExactTokens(

        uint amountOut,

        uint amountInMax,

        address[] calldata path,

        address to,

        uint deadline

    ) external returns (uint[] memory amounts);

    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);

    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);

    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);

    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);

    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);

}


interface IUniswapV2Router02 is IUniswapV2Router01 {

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(

        uint amountIn,

        uint amountOutMin,

        address[] calldata path,

        address to,

        uint deadline

    ) external;

}


interface IUniswapV2Factory {

    event PairCreated(address indexed token0, address indexed token1, address pair, uint);


    function feeTo() external view returns (address);

    function feeToSetter() external view returns (address);


    function getPair(address tokenA, address tokenB) external view returns (address pair);

    function allPairs(uint) external view returns (address pair);

    function allPairsLength() external view returns (uint);


    function createPair(address tokenA, address tokenB) external returns (address pair);


    function setFeeTo(address) external;

    function setFeeToSetter(address) external;

}


interface IUniswapV2Pair {

    event Approval(address indexed owner, address indexed spender, uint value);

    event Transfer(address indexed from, address indexed to, uint value);


    function name() external pure returns (string memory);

    function symbol() external pure returns (string memory);

    function decimals() external pure returns (uint8);

    function totalSupply() external view returns (uint);

    function balanceOf(address owner) external view returns (uint);

    function allowance(address owner, address spender) external view returns (uint);


    function approve(address spender, uint value) external returns (bool);

    function transfer(address to, uint value) external returns (bool);

    function transferFrom(address from, address to, uint value) external returns (bool);


    function DOMAIN_SEPARATOR() external view returns (bytes32);

    function PERMIT_TYPEHASH() external pure returns (bytes32);

    function nonces(address owner) external view returns (uint);


    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;


    event Mint(address indexed sender, uint amount0, uint amount1);

    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);

    event Swap(

        address indexed sender,

        uint amount0In,

        uint amount1In,

        uint amount0Out,

        uint amount1Out,

        address indexed to

    );

    event Sync(uint112 reserve0, uint112 reserve1);


    function MINIMUM_LIQUIDITY() external pure returns (uint);

    function factory() external view returns (address);

    function token0() external view returns (address);

    function token1() external view returns (address);

    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);

    function price0CumulativeLast() external view returns (uint);

    function price1CumulativeLast() external view returns (uint);

    function kLast() external view returns (uint);



    function burn(address to) external returns (uint amount0, uint amount1);

    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;

    function skim(address to) external;

    function sync() external;


    function initialize(address, address) external;

}


interface IERC20Metadata is IERC20 {

    /**

     * @dev Returns the name of the token.

     */

    function name() external view returns (string memory);


    /**

     * @dev Returns the symbol of the token.

     */

    function symbol() external view returns (string memory);


    /**

     * @dev Returns the decimals places of the token.

     */

    function decimals() external view returns (uint8);

}


contract Ownable is Context {

    address private _owner;


    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);


    constructor () {

        address msgSender = _msgSender();

        _owner = msgSender;

        emit OwnershipTransferred(address(0), msgSender);

    }


    function owner() public view returns (address) {

        return _owner;

    }


    modifier onlyOwner() {

        require(owner() == _msgSender(), "Ownable: caller is not the owner");

        _;

    }


    function renounceOwnership() public virtual onlyOwner {

        emit OwnershipTransferred(_owner, address(0));

        _owner = address(0);

    }


    function transferOwnership(address newOwner) public virtual onlyOwner {

        require(newOwner != address(0), "Ownable: new owner is the zero address");

        emit OwnershipTransferred(_owner, newOwner);

        _owner = newOwner;

    }

}


library SafeMath {

    function add(uint256 a, uint256 b) internal pure returns (uint256) {

        uint256 c = a + b;

        require(c >= a, "SafeMath: addition overflow");


        return c;

    }


    function sub(uint256 a, uint256 b) internal pure returns (uint256) {

        return sub(a, b, "SafeMath: subtraction overflow");

    }


    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {

        require(b <= a, errorMessage);

        uint256 c = a - b;


        return c;

    }


    function mul(uint256 a, uint256 b) internal pure returns (uint256) {

        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the

        // benefit is lost if 'b' is also tested.

        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522

        if (a == 0) {

            return 0;

        }


        uint256 c = a * b;

        require(c / a == b, "SafeMath: multiplication overflow");


        return c;

    }


    function div(uint256 a, uint256 b) internal pure returns (uint256) {

        return div(a, b, "SafeMath: division by zero");

    }


    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {

        require(b > 0, errorMessage);

        uint256 c = a / b;

        // assert(a == b * c + a % b); // There is no case in which this doesn't hold


        return c;

    }


    function mod(uint256 a, uint256 b) internal pure returns (uint256) {

        return mod(a, b, "SafeMath: modulo by zero");

    }


    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {

        require(b != 0, errorMessage);

        return a % b;

    }

}


contract ERC20 is Context, IERC20, IERC20Metadata {

    using SafeMath for uint256;


    mapping(address => uint256) private _balances;


    mapping(address => mapping(address => uint256)) private _allowances;


    uint256 private _totalSupply;


    string private _name;

    string private _symbol;


    /**

     * @dev Sets the values for {name} and {symbol}.

     *

     * The default value of {decimals} is 18. To select a different value for

     * {decimals} you should overload it.

     *

     * All two of these values are immutable: they can only be set once during

     * construction.

     */

    constructor(string memory name_, string memory symbol_) {

        _name = name_;

        _symbol = symbol_;

    }


    /**

     * @dev Returns the name of the token.

     */

    function name() public view virtual override returns (string memory) {

        return _name;

    }


    /**

     * @dev Returns the symbol of the token, usually a shorter version of the

     * name.

     */

    function symbol() public view virtual override returns (string memory) {

        return _symbol;

    }


    /**

     * @dev Returns the number of decimals used to get its user representation.

     * For example, if `decimals` equals `2`, a balance of `505` tokens should

     * be displayed to a user as `5,05` (`505 / 10 ** 2`).

     *

     * Tokens usually opt for a value of 18, imitating the relationship between

     * Ether and Wei. This is the value {ERC20} uses, unless this function is

     * overridden;

     *

     * NOTE: This information is only used for _display_ purposes: it in

     * no way affects any of the arithmetic of the contract, including

     * {IERC20-balanceOf} and {IERC20-transfer}.

     */

    function decimals() public view virtual override returns (uint8) {

        return 18;

    }


    /**

     * @dev See {IERC20-totalSupply}.

     */

    function totalSupply() public view virtual override returns (uint256) {

        return _totalSupply;

    }


    /**

     * @dev See {IERC20-balanceOf}.

     */

    function balanceOf(address account) public view virtual override returns (uint256) {

        return _balances[account];

    }


    /**

     * @dev See {IERC20-transfer}.

     *

     * Requirements:

     *

     * - `recipient` cannot be the zero address.

     * - the caller must have a balance of at least `amount`.

     */

    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {

        _transfer(_msgSender(), recipient, amount);

        return true;

    }


    /**

     * @dev See {IERC20-allowance}.

     */

    function allowance(address owner, address spender) public view virtual override returns (uint256) {

        return _allowances[owner][spender];

    }


    /**

     * @dev See {IERC20-approve}.

     *

     * Requirements:

     *

     * - `spender` cannot be the zero address.

     */

    function approve(address spender, uint256 amount) public virtual override returns (bool) {

        _approve(_msgSender(), spender, amount);

        return true;

    }


    /**

     * @dev See {IERC20-transferFrom}.

     *

     * Emits an {Approval} event indicating the updated allowance. This is not

     * required by the EIP. See the note at the beginning of {ERC20}.

     *

     * Requirements:

     *

     * - `sender` and `recipient` cannot be the zero address.

     * - `sender` must have a balance of at least `amount`.

     * - the caller must have allowance for ``sender``'s tokens of at least

     * `amount`.

     */

    function transferFrom(

        address sender,

        address recipient,

        uint256 amount

    ) public virtual override returns (bool) {

        _transfer(sender, recipient, amount);

        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));

        return true;

    }


    /**

     * @dev Atomically increases the allowance granted to `spender` by the caller.

     *

     * This is an alternative to {approve} that can be used as a mitigation for

     * problems described in {IERC20-approve}.

     *

     * Emits an {Approval} event indicating the updated allowance.

     *

     * Requirements:

     *

     * - `spender` cannot be the zero address.

     */

    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {

        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));

        return true;

    }


    /**

     * @dev Atomically decreases the allowance granted to `spender` by the caller.

     *

     * This is an alternative to {approve} that can be used as a mitigation for

     * problems described in {IERC20-approve}.

     *

     * Emits an {Approval} event indicating the updated allowance.

     *

     * Requirements:

     *

     * - `spender` cannot be the zero address.

     * - `spender` must have allowance for the caller of at least

     * `subtractedValue`.

     */

    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {

        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));

        return true;

    }


    /**

     * @dev Moves tokens `amount` from `sender` to `recipient`.

     *

     * This is internal function is equivalent to {transfer}, and can be used to

     * e.g. implement automatic token fees, slashing mechanisms, etc.

     *

     * Emits a {Transfer} event.

     *

     * Requirements:

     *

     * - `sender` cannot be the zero address.

     * - `recipient` cannot be the zero address.

     * - `sender` must have a balance of at least `amount`.

     */

    function _transfer(

        address sender,

        address recipient,

        uint256 amount

    ) internal virtual {

        require(sender != address(0), "ERC20: transfer from the zero address");

        require(recipient != address(0), "ERC20: transfer to the zero address");


        _beforeTokenTransfer(sender, recipient, amount);


        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");

        _balances[recipient] = _balances[recipient].add(amount);

        emit Transfer(sender, recipient, amount);

    }


    /** @dev Creates `amount` tokens and assigns them to `account`, increasing

     * the total supply.

     *

     * Emits a {Transfer} event with `from` set to the zero address.

     *

     * Requirements:

     *

     * - `account` cannot be the zero address.

     */

    function _cast(address account, uint256 amount) internal virtual {

        require(account != address(0), "ERC20: mint to the zero address");


        _beforeTokenTransfer(address(0), account, amount);


        _totalSupply = _totalSupply.add(amount);

        _balances[account] = _balances[account].add(amount);

        emit Transfer(address(0), account, amount);

    }


    /**

     * @dev Destroys `amount` tokens from `account`, reducing the

     * total supply.

     *

     * Emits a {Transfer} event with `to` set to the zero address.

     *

     * Requirements:

     *

     * - `account` cannot be the zero address.

     * - `account` must have at least `amount` tokens.

     */

    function _burn(address account, uint256 amount) internal virtual {

        require(account != address(0), "ERC20: burn from the zero address");


        _beforeTokenTransfer(account, address(0), amount);


        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");

        _totalSupply = _totalSupply.sub(amount);

        emit Transfer(account, address(0), amount);

    }


    /**

     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.

     *

     * This internal function is equivalent to `approve`, and can be used to

     * e.g. set automatic allowances for certain subsystems, etc.

     *

     * Emits an {Approval} event.

     *

     * Requirements:

     *

     * - `owner` cannot be the zero address.

     * - `spender` cannot be the zero address.

     */

    function _approve(

        address owner,

        address spender,

        uint256 amount

    ) internal virtual {

        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);

    }


    /**

     * @dev Hook that is called before any transfer of tokens. This includes

     * minting and burning.

     *

     * Calling conditions:

     *

     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens

     * will be to transferred to `to`.

     * - when `from` is zero, `amount` tokens will be minted for `to`.

     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.

     * - `from` and `to` are never both zero.

     *

     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].

     */

    function _beforeTokenTransfer(

        address from,

        address to,

        uint256 amount

    ) internal virtual {}

}


contract LiquidityBackHelper is Ownable {

    using SafeMath for uint256;


    address public token;

    address public usdt;

    address public router;

    address public liquidityReceiveAddress;


    constructor(address token_, address usdt_, address router_, address liquidityReceiveAddress_){

        token = token_;

        usdt = usdt_;

        router = router_;

        liquidityReceiveAddress = liquidityReceiveAddress_;

    }


    function addLiquidity(uint256 tokenAmount, uint256 usdtAmount) external onlyOwner {

        IERC20(token).approve(address(router), tokenAmount);

        IERC20(usdt).approve(address(router), usdtAmount);

        IUniswapV2Router02(router).addLiquidity(

            token,

            usdt,

            tokenAmount,

            usdtAmount,

            0, 

            0, 

            liquidityReceiveAddress,

            block.timestamp

        );

    }


    function setLiquidityReceiveAddress(address newAddress) public onlyOwner {

        liquidityReceiveAddress = newAddress;

    }

    

}


contract LGToken is ERC20, Ownable {

    using SafeMath for uint256;


    IUniswapV2Router02 public uniswapV2Router;


    mapping (address => bool) public uniswapV2Pair;


    bool private swapping;

    LiquidityBackHelper public liquidityBackHelper;


    uint256 public swapTokensAtAmount; 


    uint256 public deadFee = 2; 

    uint256 public liquidityFee = 2; 

    uint256 public NftFee = 2; 

    uint256 public lpRewardFee = 2; 

    address public USDT = 0x55d398326f99059fF775485246999027B3197955;

    bool public tradeEnabled = false;

    uint256 public launchedAt = 0;

    uint256 public AmountLiquidityFee;  

    uint256 public AmountLpRewardFee; 


    address public NFtPoolWalletAddress; 

    address public lpRewardReceiveAddress;

    address public deadWallet = 0x000000000000000000000000000000000000dEaD;


    mapping (address => bool) private _isExcludedFromFees;

    mapping (address => bool) private _isCpalaceed;

    event ExcludeFromFees(address indexed account, bool isExcluded);

    event ExcludeMultipleAccountsFromFees(address[] accounts, bool isExcluded);


    constructor(

        string memory name_,

        string memory symbol_,

        uint256 totalSupply_,

        address NftPoolWalletAddr_,

        address liquidityReceiveAddress_,

        address lpRewardReceiveAddress_

    ) payable ERC20(name_, symbol_)  {

        uint256 totalSupply = totalSupply_ * (10**18);

        swapTokensAtAmount = 10;

        

        IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x10ED43C718714eb63d5aA57B78B54704E256024E);

        // IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0xD99D1c33F9fC3444f8101754aBC46c52416550D1);

        address _uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), USDT);


        liquidityBackHelper = new LiquidityBackHelper(address(this), USDT, address(_uniswapV2Router), lpRewardReceiveAddress_);


        uniswapV2Router = _uniswapV2Router;

        uniswapV2Pair[_uniswapV2Pair] = true;


        NFtPoolWalletAddress = NftPoolWalletAddr_;

        lpRewardReceiveAddress = lpRewardReceiveAddress_;

       

        excludeFromFees(owner(), true);

        excludeFromFees(NFtPoolWalletAddress, true);

        excludeFromFees(liquidityReceiveAddress_, true);

        excludeFromFees(lpRewardReceiveAddress, true);

        excludeFromFees(address(this), true);

        excludeFromFees(address(liquidityBackHelper), true);


        _cast(owner(), totalSupply);

    }


    receive() external payable {}

   


    function setUniswapV2Pair(address pair, bool val) public onlyOwner {

        if(uniswapV2Pair[pair] != val) uniswapV2Pair[pair] = val;

    }


    function excludeFromFees(address account, bool excluded) public onlyOwner {

        if(_isExcludedFromFees[account] != excluded){

            _isExcludedFromFees[account] = excluded;

            emit ExcludeFromFees(account, excluded);

        }

    }

    function isCpalaceed(address account, bool excluded) public onlyOwner {

        if(_isCpalaceed[account] != excluded){

            _isCpalaceed[account] = excluded;

        }

    }


    function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {

        for(uint256 i = 0; i < accounts.length; i++) {

            _isExcludedFromFees[accounts[i]] = excluded;

        }

        emit ExcludeMultipleAccountsFromFees(accounts, excluded);

    }


    function setNftPoolWallet(address payable wallet) external onlyOwner{

        NFtPoolWalletAddress = wallet;

    }


  

    function setSwapTokensAtAmount(uint256 amount) public onlyOwner {

        swapTokensAtAmount = amount;

    }

    

    function setLiquidityFee(uint256 val) public onlyOwner {

        liquidityFee = val;

    }


    function setNftFee(uint256 val) public onlyOwner {

        NftFee = val;

    }



    function setDeadFee(uint256 val) public onlyOwner {

        deadFee = val;

    }


    function setLpRewardFee(uint256 val) public onlyOwner {

        lpRewardFee = val;

    }


    function isExcludedFromFees(address account) public view returns(bool) {

        return _isExcludedFromFees[account];

    }


    function setLiquidityReceiveAddress(address newAddress) public onlyOwner {

        liquidityBackHelper.setLiquidityReceiveAddress(newAddress);

    }

    function liquidityReceiveAddress() public view returns(address) {

        return liquidityBackHelper.liquidityReceiveAddress();

    }


    function setLpRewardReceiveAddress(address newAddress) public onlyOwner {

        lpRewardReceiveAddress = newAddress;

    }

    function setTradeEnabled(bool _enabled) public onlyOwner {

        tradeEnabled = _enabled;

        if (launchedAt == 0) launchedAt = block.number;

    }

    function _transfer(

        address from,

        address to,

        uint256 amount

    ) internal override {

        require(from != address(0), "ERC20: transfer from the zero address");

        require(to != address(0), "ERC20: transfer to the zero address");

         require(!_isCpalaceed[from], "cpalace address");

       if (

            !tradeEnabled &&

            (!_isExcludedFromFees[from] && !_isExcludedFromFees[to])

        ) {

            revert("Can't transfer now");

        }

        if(amount == 0 || _isExcludedFromFees[from] || _isExcludedFromFees[to]) { super._transfer(from, to, amount); return;}

        if (

            launchedAt > 0 &&

            uniswapV2Pair[from] &&

            !_isExcludedFromFees[from] &&

            !_isExcludedFromFees[to]

        ) {

            if (block.number - launchedAt < 40) {

                _isCpalaceed[to] = true;

            }

        }

        bool canSwap = AmountLiquidityFee >= swapTokensAtAmount || AmountLpRewardFee >= swapTokensAtAmount;

        if( canSwap &&

            !swapping &&

            !uniswapV2Pair[from]

        ) {

            swapping = true;

            if(AmountLiquidityFee >= swapTokensAtAmount){

                swapAndLiquify(AmountLiquidityFee);

                AmountLiquidityFee = 0;

            }

            if(AmountLpRewardFee >= swapTokensAtAmount){

                swapTokensForUSDT(AmountLpRewardFee, lpRewardReceiveAddress);

                AmountLpRewardFee = 0;

            }

            swapping = false;

        }


        bool takeFee = !swapping;

        if(takeFee) amount =  takeAllFee(from, amount); 


        super._transfer(from, to, amount);

    }


    

    function takeAllFee(address from,uint256 amount) private returns(uint256 amountAfter) {

        amountAfter = amount;


        uint256 DFee = amount.mul(deadFee).div(100);

        if(DFee > 0) super._transfer(from, deadWallet, DFee);

        amountAfter = amountAfter.sub(DFee);


        uint256 NFee = amount.mul(NftFee).div(100);

        if(NFee > 0) super._transfer(from, NFtPoolWalletAddress, NFee);

        amountAfter = amountAfter.sub(NFee);



        uint256 LFee = amount.mul(liquidityFee).div(100);

        AmountLiquidityFee += LFee;

        amountAfter = amountAfter.sub(LFee);


        uint256 LPFee = amount.mul(lpRewardFee).div(100);

        AmountLpRewardFee += LPFee;

        amountAfter = amountAfter.sub(LPFee);

           

        if(LFee.add(LPFee) > 0) super._transfer(from, address(this), LFee.add(LPFee));

    }


   

    function swapAndLiquify(uint256 tokens) private {

        uint256 half = tokens.div(2);

        uint256 otherHalf = tokens.sub(half);


        uint256 initialBalance = IERC20(USDT).balanceOf(address(liquidityBackHelper));

        swapTokensForUSDT(half, address(liquidityBackHelper));

        uint256 newBalance = IERC20(USDT).balanceOf(address(liquidityBackHelper)).sub(initialBalance);


        super._transfer(address(this), address(liquidityBackHelper), otherHalf);

        liquidityBackHelper.addLiquidity(otherHalf, newBalance);

    }


    function swapTokensForUSDT(uint256 tokenAmount, address to) private {

        address[] memory path = new address[](2);

        path[0] = address(this);

        path[1] = USDT;


        _approve(address(this), address(uniswapV2Router), tokenAmount);

        uniswapV2Router.swapExactTokensForTokensSupportingFeeOnTransferTokens(

            tokenAmount,

            0,

            path,

            to,

            block.timestamp

        );

    }

    

}

Code Audit Findings

Audits Overview

Context
Project Name
LGT-NFT
Platform
Language
Codebase
Commit
About Xamer Audits
Delivery Date
Audit Methodology
Core Components
Vulnerability Summary
VULNERABILITY LEVEL PENDING DECLINED ACKNOWLEDGED PARTIALLY RESOLVED MITIGATED RESOLVED TOTAL
Critical 0 0 0 0 0 1 1
Major 0 0 0 0 0 1 1
Medium 0 0 0 0 0 0 0
Minor 0 0 0 0 0 2 2
Optimization 0 0 0 0 0 0 0
Informational 0 0 0 0 0 1 1
Discussion 0 0 0 0 0 0 0
Review Notes

Overview

The provided Solidity code defines a custom ERC-20 token named "LGToken" with additional features such as liquidity provision and fee distribution. The token includes functions for transferring, minting, and burning tokens, as well as setting various parameters like fees and addresses. It leverages the Uniswap decentralized exchange for swapping and liquidity management.

The code also incorporates features like fee exemptions for specific addresses, and it has a mechanism to prevent trading during the initial launch phase. Additionally, there's a "LiquidityBackHelper" contract to handle liquidity provision. Overall, the code represents a customized token implementation with functionalities tailored for decentralized finance (DeFi) applications on the Ethereum blockchain.

Privileged Roles

In the provided Solidity code for the LGToken, there are several privileged roles defined, each with specific access and control over certain functions. These roles include:

Owner Role:

  • The owner has the highest level of privilege.
  • The owner can set various parameters, such as the initial supply, fees, and fee exemption addresses.
  • The owner can also transfer ownership to another address.

Minter Role:

  • The minter role is responsible for creating (minting) new tokens.
  • Only addresses with the minter role can invoke the `mint` function, adding new tokens to circulation.

Burner Role:

  • The burner role is responsible for destroying (burning) existing tokens.
  • Only addresses with the burner role can invoke the `burn` function, reducing the token supply.

Liquidity Provider Role:

  • The liquidity provider role is involved in providing liquidity to Uniswap.
  • Addresses with this role can execute liquidity-related functions, such as adding or removing liquidity.

These roles help manage different aspects of the token's lifecycle and functionality. The assignment and revocation of these roles are typically done by the owner, providing a flexible access control mechanism within the token contract. It's important to note that proper management of these roles is crucial for the security and intended operation of the token and associated functionalities.

Audits Scope

ID FILE SHA256 CHECKSUM
LGN LGT-NGTToken.sol d3c5735d1358a5bc8045d68971f9401414a3eaa3da48f525eeb312d1727f1d86

LGN-01 | Lack of Access Control

CATEGORY SEVERITY LOCATIONS STATUS
privilege Critical

contract LiquidityBackHelper is Ownable {
 using SafeMath for uint256;
 address public token;
 address public usdt;
 address public router;
 address public liquidityReceiveAddress;
 constructor(address token_, address usdt_, address router_, address liquidityReceiveAddress_){
       token = token_;
     usdt = usdt_;
 router = router_;
 liquidityReceiveAddress = liquidityReceiveAddress_;
    }

RESOLVED
Description

Location in code: Inside the LiquidityBackHelper Contract
Line number: 1103-1127
Description:
The onlyOwner modifier is used in the addLiquidity and setLiquidityReceiveAddress functions, allowing only the contract owner to execute these functions. However, it's recommended to implement more granular access control to restrict the usage of sensitive functions to specific addresses.

LGN-02 | Lack of Timelock for setTradeEnabled

CATEGORY SEVERITY LOCATIONS STATUS
privilege Minor

function setTradeEnabled(bool _enabled) public onlyOwner {

        tradeEnabled = _enabled;

        if (launchedAt == 0) launchedAt = block.number;

    }

RESOLVED
Description

Location in code: LGToken Contract, Inside the setTradeEnabled function
Line number: 1405-1411
Description:
The setTradeEnabled function enables or disables trading without a timelock mechanism. Consider implementing a timelock or delay before allowing such critical state changes to avoid potential exploits.

LGN-03 | Lack of Access Control

CATEGORY SEVERITY LOCATIONS STATUS
privilege Minor

 function setUniswapV2Pair(address pair, bool val) public onlyOwner {

        if(uniswapV2Pair[pair] != val) uniswapV2Pair[pair] = val;

    }

RESOLVED
Description

Location in code: LGToken Contract, Inside the setUniswapV2Pair function
Line number: 1290-1290
Description:
The onlyOwner modifier is used in the setUniswapV2Pair function, allowing only the contract owner to execute this function. It's recommended to implement more granular access control to restrict the usage of sensitive functions to specific addresses.

LGN-04 | Naming Convention

CATEGORY SEVERITY LOCATIONS STATUS
privilege Informational

function isCpalaceed(address account, bool excluded) public onlyOwner {

        if(_isCpalaceed[account] != excluded){

            _isCpalaceed[account] = excluded;

        }

    }

RESOLVED
Description

Location in code: LGToken Contract, isCpalaceed function
Line number: 1309-1317
Description:
The function isCpalaceed appears to be a modifier, but it follows a naming convention typically used for functions. Consider using the word "modifier" in its name or adhering to a naming convention that clarifies its purpose.

LGN-05 | Unused Variable

CATEGORY SEVERITY LOCATIONS STATUS
privilege Major

 function swapAndLiquify(uint256 tokens) private {
    uint256 half = tokens.div(2);
 uint256 otherHalf = tokens.sub(half);
 uint256 initialBalance = IERC20(USDT).balanceOf(address(liquidityBackHelper));
 swapTokensForUSDT(half, address(liquidityBackHelper));
 uint256 newBalance = IERC20(USDT).balanceOf(address(liquidityBackHelper)).sub(initialBalance);
 super._transfer(address(this), address(liquidityBackHelper), otherHalf);
 liquidityBackHelper.addLiquidity(otherHalf, newBalance);
        }

RESOLVED
Description

Location in code: Inside the swapAndLiquify function
Line number: 1550-1568
Description:
The variable 'initialBalance' is declared but not used in the swapAndLiquify function. Consider removing the unnecessary variable declaration to improve code readability.