Overview

Gallant
Rank #N/A

Skynet Trust Score

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

Gallant Info

Audits

Onboarded Date

13/Dec/2022

Contracts

0x580...f9f78

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

Gallant -Audit

View Findings
5

All Findings

0

Acknowledge

0

Partially

5

Resolved

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

Method

Audited Files/SHA256

Contracts

0x580655e2c6...f9f78

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

Gallant (gallant.sol) 1

Gallant Smart Contract Code

                        
                        

/**

 *Submitted for verification at BscScan.com on 2021-07-30

*/


// SPDX-License-Identifier: Unlicensed


/*



Gallant Token


Telegram: https://t.me/GallantTokenOfficial

Website: https://www.gallanttoken.com/

Twitter: https://twitter.com/GallantToken



Welcome to Gallant Token, where Transparency meets Community.

We are a fully Doxxed team and here to build an Awesome Project

that could Revolutionize and Benefit the whole Crypto Community.


*/



pragma solidity ^0.8.3;



interface IERC20 {

    

    function totalSupply() external view returns (uint256);

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

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

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

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

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

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

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

}


library SafeMath {

    


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

        return a + b;

    }


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

        return a - b;

    }


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

        return a * b;

    }

    

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

        return a / b;

    }


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

        unchecked {

            require(b <= a, errorMessage);

            return a - b;

        }

    }

    

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

        unchecked {

            require(b > 0, errorMessage);

            return a / b;

        }

    }

    

}




abstract contract Context {

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

        return msg.sender;

    }


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

        this; 

        return msg.data;

    }

}



library Address {

    

    function isContract(address account) internal view returns (bool) {

        uint256 size;

        assembly { size := extcodesize(account) }

        return size > 0;

    }


    function sendValue(address payable recipient, uint256 amount) internal {

        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{ value: amount }("");

        require(success, "Address: unable to send value, recipient may have reverted");

    }

    

    function functionCall(address target, bytes memory data) internal returns (bytes memory) {

      return functionCall(target, data, "Address: low-level call failed");

    }

    

    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {

        return functionCallWithValue(target, data, 0, errorMessage);

    }

    

    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {

        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");

    }

    

    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {

        require(address(this).balance >= value, "Address: insufficient balance for call");

        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{ value: value }(data);

        return _verifyCallResult(success, returndata, errorMessage);

    }

    

    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {

        return functionStaticCall(target, data, "Address: low-level static call failed");

    }

    

    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {

        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);

        return _verifyCallResult(success, returndata, errorMessage);

    }



    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {

        return functionDelegateCall(target, data, "Address: low-level delegate call failed");

    }

    

    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {

        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);

        return _verifyCallResult(success, returndata, errorMessage);

    }


    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {

        if (success) {

            return returndata;

        } else {

            if (returndata.length > 0) {

                 assembly {

                    let returndata_size := mload(returndata)

                    revert(add(32, returndata), returndata_size)

                }

            } else {

                revert(errorMessage);

            }

        }

    }

}




abstract contract Ownable is Context {

    address private _owner;


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

    constructor () {

        _owner = 0x7de877baE30C0855d1Fc0ff8911197bcb937a829; 

        emit OwnershipTransferred(address(0), _owner);

    }

    function owner() public view virtual 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;

    }

}


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 mint(address to) external returns (uint liquidity);

    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 IUniswapV2Router01 {

    function factory() external pure returns (address);

    function WETH() 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 addLiquidityETH(

        address token,

        uint amountTokenDesired,

        uint amountTokenMin,

        uint amountETHMin,

        address to,

        uint deadline

    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);

    function removeLiquidity(

        address tokenA,

        address tokenB,

        uint liquidity,

        uint amountAMin,

        uint amountBMin,

        address to,

        uint deadline

    ) external returns (uint amountA, uint amountB);

    function removeLiquidityETH(

        address token,

        uint liquidity,

        uint amountTokenMin,

        uint amountETHMin,

        address to,

        uint deadline

    ) external returns (uint amountToken, uint amountETH);

    function removeLiquidityWithPermit(

        address tokenA,

        address tokenB,

        uint liquidity,

        uint amountAMin,

        uint amountBMin,

        address to,

        uint deadline,

        bool approveMax, uint8 v, bytes32 r, bytes32 s

    ) external returns (uint amountA, uint amountB);

    function removeLiquidityETHWithPermit(

        address token,

        uint liquidity,

        uint amountTokenMin,

        uint amountETHMin,

        address to,

        uint deadline,

        bool approveMax, uint8 v, bytes32 r, bytes32 s

    ) external returns (uint amountToken, uint amountETH);

    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 swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)

        external

        payable

        returns (uint[] memory amounts);

    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)

        external

        returns (uint[] memory amounts);

    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)

        external

        returns (uint[] memory amounts);

    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)

        external

        payable

        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 removeLiquidityETHSupportingFeeOnTransferTokens(

        address token,

        uint liquidity,

        uint amountTokenMin,

        uint amountETHMin,

        address to,

        uint deadline

    ) external returns (uint amountETH);

    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(

        address token,

        uint liquidity,

        uint amountTokenMin,

        uint amountETHMin,

        address to,

        uint deadline,

        bool approveMax, uint8 v, bytes32 r, bytes32 s

    ) external returns (uint amountETH);


    function swapExactTokensForTokensSupportingFeeOnTransferTokens(

        uint amountIn,

        uint amountOutMin,

        address[] calldata path,

        address to,

        uint deadline

    ) external;

    function swapExactETHForTokensSupportingFeeOnTransferTokens(

        uint amountOutMin,

        address[] calldata path,

        address to,

        uint deadline

    ) external payable;

    function swapExactTokensForETHSupportingFeeOnTransferTokens(

        uint amountIn,

        uint amountOutMin,

        address[] calldata path,

        address to,

        uint deadline

    ) external;

}


contract Gallant is Context, IERC20, Ownable {

    using SafeMath for uint256;

    using Address for address;


    mapping (address => uint256) private _rOwned;

    mapping (address => uint256) private _tOwned;

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

    mapping (address => bool) private _isExcludedFromFee;

    mapping (address => bool) private _isExcluded;

    

    

    //_isBlacklisted = Can not buy or sell or transfer tokens at all <-----for bots! 

    mapping (address => bool) public _isBlacklisted;

    

   

   


    address[] private _excluded;

    address payable private Wallet_Burn = payable(0x000000000000000000000000000000000000dEaD);

    address payable private Wallet_Dev = payable(0xee0FA8Ec7DbE981502898289a9458dd2DF4AFfe5); 






    uint256 private constant MAX = ~uint256(0);

    uint256 private _tTotal = 100000000 * 10**6 * 10**9;  

    uint256 private _rTotal = (MAX - (MAX % _tTotal));

    uint256 private _tFeeTotal;

    string private _name = "Gallant";

    string private _symbol = "GAL";

    uint8 private _decimals = 9;





    //Thoust levy thou did imply upon ones transaction - Fees!

    uint256 public _FeeReflection = 5;

    uint256 public _FeeLiquidity = 5;

    uint256 public _FeeBurn = 0;

    uint256 public _FeeDev = 5; 


    //Thoust levy yond once wast - Fee Setting!

    uint256 private _previousFeeReflection = _FeeReflection;

    uint256 private _previousFeeLiquidity = _FeeLiquidity;

    uint256 private _previousFeeBurn = _FeeBurn;

    uint256 private _previousFeeDev = _FeeDev; 


    //Thy accumulated fees upon the transaction of the squire - Total Fees!

    uint256 public _FeesTotal = _FeeLiquidity+_FeeBurn+_FeeDev+_FeeReflection;

    uint256 private _previousFeesTotal = _FeesTotal;

      


    //Weneth one need maketh slippery thy swap indeed fine fellow - Fees for processin BNB!

    uint256 private _liquidityAndPromoFee = _FeeLiquidity+_FeeDev;

    uint256 private _previousLiquidityAndPromoFee = _liquidityAndPromoFee;

    

    //The gleam nuggets holder of maximum repute is donned upon you - Max Wallet Holding Limit! - 1% at launch

    uint256 public _maxWalletToken = 1000000 * 10**6 * 10**9; 

                                     

    IUniswapV2Router02 public immutable uniswapV2Router;

    address public immutable uniswapV2Pair;

    bool inSwapAndLiquify;

    bool public swapAndLiquifyEnabled = true;

    

    //No further may you passeth into the realm of splendor - Max Transaction Amount!

    uint256 public _maxTxAmount = 1000000 * 10**6 * 10**9; 


    //Thy tokens for exchangeth to nuggets of delight - Number of tokens required to trigger LP 

    uint256 public _numTokensSellToAddToLiquidity = 100000 * 10**6 * 10**9; 

    event MinTokensBeforeSwapUpdated(uint256 minTokensBeforeSwap);

    event SwapAndLiquifyEnabledUpdated(bool enabled);

    event SwapAndLiquify(

        uint256 tokensSwapped,

        uint256 ethReceived,

        uint256 tokensIntoLiqudity

        

    );

    

    modifier lockTheSwap {

        inSwapAndLiquify = true;

        _;

        inSwapAndLiquify = false;

    }

    

    constructor () {

        _rOwned[owner()] = _rTotal;

        

        IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x10ED43C718714eb63d5aA57B78B54704E256024E);

        


        uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())

            .createPair(address(this), _uniswapV2Router.WETH());

        uniswapV2Router = _uniswapV2Router;

        _isExcludedFromFee[owner()] = true;

        _isExcludedFromFee[address(this)] = true;

        _isExcludedFromFee[Wallet_Burn] = true; 

        _isExcludedFromFee[Wallet_Dev] = true; 

        

      

        

        emit Transfer(address(0), owner(), _tTotal);

    }


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

        return _name;

    }


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

        return _symbol;

    }


    function decimals() public view returns (uint8) {

        return _decimals;

    }


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

        return _tTotal;

    }


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

        if (_isExcluded[account]) return _tOwned[account];

        return tokenFromReflection(_rOwned[account]);

    }


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

        _transfer(_msgSender(), recipient, amount);

        return true;

    }


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

        return _allowances[owner][spender];

    }


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

        _approve(_msgSender(), spender, amount);

        return true;

    }


    function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {

        _transfer(sender, recipient, amount);

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

        return true;

    }


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

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

        return true;

    }


    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;

    }


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

        return _isExcluded[account];

    }


    function totalFees() public view returns (uint256) {

        return _tFeeTotal;

    }


    //Distributeth the chance equal by halt thy demons timepiece - Make it fair and add a delay between buys (preventing bots)

    bool public slowFairBuys = true;

    uint8 public buy_buy_delay = 10;

    uint8 public buy_sell_delay = 5;

    mapping (address => uint) private buy_buy;

    mapping (address => uint) private buy_sell;


    

    //Thee buyeth twice valorous sir, but such speedeth is demonic indeedeth - Time delay between buys to prevent bots

    function sefeLaunch_buy_buy_delay(bool setBool, uint8 numSeconds) public onlyOwner {

        slowFairBuys = setBool;

        buy_buy_delay = numSeconds;

    }


    //But thee buyeth so apace thee wilt not selleth so abrupt! - Time delay between buys and sell 

    function sefeLaunch_buy_sell_delay(bool setBool, uint8 numSeconds) public onlyOwner {

        slowFairBuys = setBool;

        buy_sell_delay = numSeconds;

    }



    function deliver(uint256 tAmount) public {

        address sender = _msgSender();

        require(!_isExcluded[sender], "Excluded addresses cannot call this function");

        (uint256 rAmount,,,,,,) = _getValues(tAmount);

        _rOwned[sender] = _rOwned[sender].sub(rAmount);

        _rTotal = _rTotal.sub(rAmount);

        _tFeeTotal = _tFeeTotal.add(tAmount);

    }


    function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) {

        require(tAmount <= _tTotal, "Amount must be less than supply");

        if (!deductTransferFee) {

            (uint256 rAmount,,,,,,) = _getValues(tAmount);

            return rAmount;

        } else {

            (,uint256 rTransferAmount,,,,,) = _getValues(tAmount);

            return rTransferAmount;

        }

    }





    function tokenFromReflection(uint256 rAmount) public view returns(uint256) {

        require(rAmount <= _rTotal, "Amount must be less than total reflections");

        uint256 currentRate =  _getRate();

        return rAmount.div(currentRate);

    }


    function excludeFromReward(address account) public onlyOwner() {

        require(!_isExcluded[account], "Account is already excluded");

        if(_rOwned[account] > 0) {

            _tOwned[account] = tokenFromReflection(_rOwned[account]);

        }

        _isExcluded[account] = true;

        _excluded.push(account);

    }


    function includeInReward(address account) external onlyOwner() {

        require(_isExcluded[account], "Account is already included");

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

            if (_excluded[i] == account) {

                _excluded[i] = _excluded[_excluded.length - 1];

                _tOwned[account] = 0;

                _isExcluded[account] = false;

                _excluded.pop();

                break;

            }

        }

    }

        function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {

        (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity, uint256 tDev) = _getValues(tAmount);

        _tOwned[sender] = _tOwned[sender].sub(tAmount);

        _rOwned[sender] = _rOwned[sender].sub(rAmount);

        _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);

        _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);        

        _takeLiquidity(tLiquidity);

        _takeDev(tDev);

        _reflectFee(rFee, tFee);

        emit Transfer(sender, recipient, tTransferAmount);

    }

    

    

    //F'r thee this transaction did cost nay wage - Remove fee from wallet address

    function excludeFromFee(address account) public onlyOwner {

        _isExcludedFromFee[account] = true;

    }

    

    //Nobel sir, thy wage implied is levied wi' greed - Include wallet address in fee

    function includeInFee(address account) public onlyOwner {

        _isExcludedFromFee[account] = false;

    }

    

    //Setteth the numb'r of gallants to addeth to thy liquid exchangeth - Set number of tokens to trigger auto LP 

    function process_setNumTokensSellToAddToLiquidity(uint256 numTokensSellToAddToLiquidity) external onlyOwner() {

        _numTokensSellToAddToLiquidity = numTokensSellToAddToLiquidity;

    }



    //Gleaming reflection of thy goldeth make hast f'rthwith to c'rn'rs of the realm - Set Reflection fee

    function fees_setFeeReflectionPercent(uint256 FeeReflection) external onlyOwner() {

        if (FeeReflection < 11) {_FeeReflection = FeeReflection;}

        

    }


    //Sendeth thy tokens to the fires depths of hades with haste - Set burn fee

    function fees_setFeeBurnPercent(uint256 FeeBurn) external onlyOwner() {

        if (FeeBurn < 11) {_FeeBurn = FeeBurn;}

    }

    

    //Maketh thy liquid liketh quick silv'r from the sw'rd = Set Auto LP fee

    function fees_setFeeLiquidityPercent(uint256 FeeLiquidity) external onlyOwner() {

        if (FeeLiquidity < 11) {_FeeLiquidity = FeeLiquidity;}

    }

    

    //Bringeth much gilt'd pleasure upon King Steven of Gallant - Set the dev wallet fee

    function fees_setFeeDev(uint256 FeeDev) external onlyOwner() {

        if (FeeDev < 11) {_FeeDev = FeeDev;}

    }

    



    //Passeth me thy purse and teketh upon thyself f'r a new one - Changing dev wallet address

    function Wallet_Update_Dev(address payable wallet) public onlyOwner() {

        Wallet_Dev = wallet;

        _isExcludedFromFee[Wallet_Dev] = true;

    }

       

   

    //Setteth p'rmit'd Gallants by trade of knights 100 strong - Set max transaction (in percent)

    function safeLaunch_setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {

        _maxTxAmount = _tTotal.mul(maxTxPercent).div(

            10**2

        );

    }

    

    //Setteth p'rmit'd Gallants for oneth fine trade - Set max transaction in tokens

     function safeLaunch_setMaxTxTokens(uint256 maxTxTokens) external onlyOwner() {

        _maxTxAmount = maxTxTokens;

    }

    

    

    

    //Setteth thy p'rmit'd Gallant holder p'rcent of thine realms splend'r - Set max wallet as a percent of total

     function safeLaunch_setMaxWalletPercent(uint256 maxWallPercent) external onlyOwner() {

        _maxWalletToken = _tTotal.mul(maxWallPercent).div(

            10**2

        );

    }

    

    //Setteth p'rmit'd Gallants of thine chinks holder - Set max wallet in tokens 

     function safeLaunch_setMaxWalletTokens(uint256 maxWallTokens) external onlyOwner() {

        _maxWalletToken = maxWallTokens;

    }

    

    

    

    //Switheth wi' glee thine contraption o'liquid - Set swap and liquify on or off

    function process_setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner {

        swapAndLiquifyEnabled = _enabled;

        emit SwapAndLiquifyEnabledUpdated(_enabled);

    }

    

    //Mine arms art taketh with glee thine golden splend'rus - allow bnb into contract from PCS

    receive() external payable {}


    function _reflectFee(uint256 rFee, uint256 tFee) private {

        _rTotal = _rTotal.sub(rFee);

        _tFeeTotal = _tFeeTotal.add(tFee);

    }

    

    

    //Unhand thy from the clasps of the listeth of the dark l'rds of the und'rw'rld - Remove from blacklist

    function safeLaunch_removeFromBlackList(address account) external onlyOwner {

        _isBlacklisted[account] = false;

    }

    

    

    //Did cast the scamm'rs down into the depths of the und'rw'rld - Add to black list

    function safeLaunch_addToBlackList(address[] calldata addresses) external onlyOwner {

      for (uint256 i; i < addresses.length; ++i) {

        _isBlacklisted[addresses[i]] = true;

      }

    }

    

   

    function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256) {

        (uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity, uint256 tDev) = _getTValues(tAmount);

        (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tLiquidity, tDev, _getRate());

        return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tLiquidity, tDev);

    }


    function _getTValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {

        uint256 tFee = calculateFeeReflection(tAmount);

        uint256 tLiquidity = calculateLiquidityAndPromoFee(tAmount);

        uint256 tDev = calculateFeeBurn(tAmount);

        uint256 tTransferAmount = tAmount.sub(tFee).sub(tLiquidity).sub(tDev);

        return (tTransferAmount, tFee, tLiquidity, tDev);

    }


    function _getRValues(uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 tDev, uint256 currentRate) private pure returns (uint256, uint256, uint256) {

        uint256 rAmount = tAmount.mul(currentRate);

        uint256 rFee = tFee.mul(currentRate);

        uint256 rLiquidity = tLiquidity.mul(currentRate);

        uint256 rDev = tDev.mul(currentRate);

        uint256 rTransferAmount = rAmount.sub(rFee).sub(rLiquidity).sub(rDev);

        return (rAmount, rTransferAmount, rFee);

    }


    function _getRate() private view returns(uint256) {

        (uint256 rSupply, uint256 tSupply) = _getCurrentSupply();

        return rSupply.div(tSupply);

    }


    function _getCurrentSupply() private view returns(uint256, uint256) {

        uint256 rSupply = _rTotal;

        uint256 tSupply = _tTotal;      

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

            if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);

            rSupply = rSupply.sub(_rOwned[_excluded[i]]);

            tSupply = tSupply.sub(_tOwned[_excluded[i]]);

        }

        if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);

        return (rSupply, tSupply);

    }

    

    function _takeLiquidity(uint256 tLiquidity) private {

        uint256 currentRate =  _getRate();

        uint256 rLiquidity = tLiquidity.mul(currentRate);

        _rOwned[address(this)] = _rOwned[address(this)].add(rLiquidity);

        if(_isExcluded[address(this)])

            _tOwned[address(this)] = _tOwned[address(this)].add(tLiquidity);

    }

    

    function _takeDev(uint256 tDev) private {

        uint256 currentRate =  _getRate();

        uint256 rDev = tDev.mul(currentRate);

        _rOwned[Wallet_Burn] = _rOwned[Wallet_Burn].add(rDev);

        if(_isExcluded[Wallet_Burn])

            _tOwned[Wallet_Burn] = _tOwned[Wallet_Burn].add(tDev);

    }

    

    function calculateFeeReflection(uint256 _amount) private view returns (uint256) {

        return _amount.mul(_FeeReflection).div(

            10**2

        );

    }


    function calculateFeeBurn(uint256 _amount) private view returns (uint256) {

        return _amount.mul(_FeeBurn).div(

            10**2

        );

    }


    function calculateLiquidityAndPromoFee(uint256 _amount) private view returns (uint256) {

        return _amount.mul(_liquidityAndPromoFee).div(

            10**2

        );

    }

    

    function removeAllFee() private {

        

        _previousFeeReflection = _FeeReflection;

        _previousFeeBurn = _FeeBurn;

        _previousLiquidityAndPromoFee = _liquidityAndPromoFee;

        _previousFeeLiquidity = _FeeLiquidity;

        _previousFeeDev = _FeeDev;

        

        _FeeReflection = 0;

        _FeeBurn = 0;

        _liquidityAndPromoFee = 0;

        _FeeLiquidity = 0;

        _FeeDev = 0;



    }

    

    function restoreAllFee() private {



         _FeeReflection = _previousFeeReflection;

         _FeeBurn = _previousFeeBurn;

         _liquidityAndPromoFee = _previousLiquidityAndPromoFee;

         _FeeLiquidity = _previousFeeLiquidity;

         _FeeDev = _previousFeeDev;

    }

    

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

        return _isExcludedFromFee[account];

    }


    function _approve(address owner, address spender, uint256 amount) private {

        require(owner != address(0), "Err owner 0 address");

        require(spender != address(0), "Err spender 0 address");


        _allowances[owner][spender] = amount;

        emit Approval(owner, spender, amount);

    }


    function _transfer(

        address from,

        address to,

        uint256 amount

    ) private {


        

        

        //checketh thy chinks holder supplyeth p'rmit'd - Check not over max balance

        if (from != owner() && to != owner() && to != address(this)  && to != address(0x000000000000000000000000000000000000dEaD) && to != uniswapV2Pair){

            uint256 heldTokens = balanceOf(to);

            require((heldTokens + amount) <= _maxWalletToken,"You are trying to buy over the max wallet limit.");}

        

        //Demons art not welcometh h're!!!! - No blacklisted peple or bots can buy or sell 

        require(!_isBlacklisted[from] && !_isBlacklisted[to], "To or from address is blacklisted");

        require(from != address(0), "from 0 address");

        require(to != address(0), "to 0 address");

        require(amount > 0, "must be more than 0 tokens");



       //Doth we needeth to sloweth things down f'r fairness? - Time delay to stop bots and to make buys fair for all 

        if (from == uniswapV2Pair &&

            slowFairBuys &&

            !_isExcludedFromFee[to] &&

            to != address(this)  && 

            to != address(0x000000000000000000000000000000000000dEaD)) {

            require(buy_buy[to] < block.timestamp,"Need to wait a few seconds before you can buy again.");

            buy_buy[to] = block.timestamp + buy_buy_delay;

            buy_sell[to] = block.timestamp + buy_sell_delay;


        }




        if (from != uniswapV2Pair &&

            slowFairBuys &&

            !_isExcludedFromFee[to] &&

            to != address(this)  && 

            to != address(0x000000000000000000000000000000000000dEaD)) {

            require(buy_sell[from] < block.timestamp,"Need to wait a few seconds before selling.");

        }





        

        //Limits the tokens thee can buyeth - Transaction limits

        if(from != owner() && to != owner())

            require(amount <= _maxTxAmount, "You are trying to buy/sell move tokens that the max transaction permits");


        uint256 contractTokenBalance = balanceOf(address(this));

        

        if(contractTokenBalance >= _maxTxAmount)

        {

            contractTokenBalance = _maxTxAmount;

        }

        

        bool overMinTokenBalance = contractTokenBalance >= _numTokensSellToAddToLiquidity;

        if (

            overMinTokenBalance &&

            !inSwapAndLiquify &&

            from != uniswapV2Pair &&

            swapAndLiquifyEnabled

        ) {

            contractTokenBalance = _numTokensSellToAddToLiquidity;

            swapAndLiquify(contractTokenBalance);

        }

        

        bool takeFee = true;

        

       

         require(to != address(0), "Transfer to the zero address");

         

        if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){

            takeFee = false;

        }

        

        _tokenTransfer(from,to,amount,takeFee);

    }

    

     function sendToWallet(address payable wallet, uint256 amount) private {

            wallet.transfer(amount);

        }



    function precDiv(uint a, uint b, uint precision) internal pure returns ( uint) {

     return a*(10**precision)/b;

         

    } 


     function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {

        

       uint256 __splitPromo = 0;

       uint256 __tokensToPromo = 0;

       


        if (_FeeDev != 0){



             __splitPromo = precDiv(_FeeDev,_liquidityAndPromoFee,2);

             __tokensToPromo = contractTokenBalance*__splitPromo/100;



                   

        //Sendeth wage to King Steven of Gallant foreth promotion of Splend'r! - Send BNB to dev wallet for marketing and development 

        uint256 balanceBeforePromoWallet = address(this).balance;

        swapTokensForEth(__tokensToPromo);

        uint256 balanceToSendPromo = address(this).balance - balanceBeforePromoWallet;

        sendToWallet(Wallet_Dev, balanceToSendPromo);

}


             

        if (_FeeLiquidity != 0){

        uint256 __tokenstoLP = contractTokenBalance-__tokensToPromo;

        uint256 firstHalf = __tokenstoLP.div(2);

        uint256 secondHalf = __tokenstoLP.sub(firstHalf);

        uint256 balanceBeforeLP = address(this).balance;

        swapTokensForEth(firstHalf); 

        uint256 swappedLP = address(this).balance.sub(balanceBeforeLP);

        addLiquidity(secondHalf, swappedLP);

        emit SwapAndLiquify(firstHalf, swappedLP, secondHalf);

        }

    

}


    function swapTokensForEth(uint256 tokenAmount) private {

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

        path[0] = address(this);

        path[1] = uniswapV2Router.WETH();

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

        uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(

            tokenAmount,

            0, 

            path,

            address(this),

            block.timestamp

        );

    }


    function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {

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

        uniswapV2Router.addLiquidityETH{value: ethAmount}(

            address(this),

            tokenAmount,

            0, 

            0, 

            owner(),

            block.timestamp

        );

    }    

    

    //Purge thy gallant frometh thy abode - Process tokens on contract into BNB and send to wallet

    function process_TokensFromContract(address payable wallet, uint256 tokenAmount) public onlyOwner {

        uint256 tokensOnWallet = balanceOf(address(this));

        if (tokenAmount > tokensOnWallet) {tokenAmount = tokensOnWallet;}

        uint256 balanceBefore = address(this).balance;

        swapTokensForEth(tokenAmount);

        uint256 balanceToSend = address(this).balance - balanceBefore;

        sendToWallet(wallet, balanceToSend);

    }


    //M're gleaming rocks of splend'r to distributeth from thy realm - Send BNB from contract to wallet

    function process_BNBFromContract(address payable wallet, uint256 bnbAmount) public onlyOwner {

        uint256 contractBNB = address(this).balance;

        if (contractBNB > 0) {

        if (bnbAmount > contractBNB) {bnbAmount = contractBNB;}

        sendToWallet(wallet, bnbAmount);

    }

    }




    //Transfereth of thy Gallant - Transfer functions

    function _tokenTransfer(address sender, address recipient, uint256 amount,bool takeFee) private {

        

         

        

        if(!takeFee)

            removeAllFee();

        

        if (_isExcluded[sender] && !_isExcluded[recipient]) {

            _transferFromExcluded(sender, recipient, amount);

        } else if (!_isExcluded[sender] && _isExcluded[recipient]) {

            _transferToExcluded(sender, recipient, amount);

        } else if (!_isExcluded[sender] && !_isExcluded[recipient]) {

            _transferStandard(sender, recipient, amount);

        } else if (_isExcluded[sender] && _isExcluded[recipient]) {

            _transferBothExcluded(sender, recipient, amount);

        } else {

            _transferStandard(sender, recipient, amount);

        }

        

        if(!takeFee)

            restoreAllFee();


    }


    function _transferStandard(address sender, address recipient, uint256 tAmount) private {

        (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity, uint256 tDev) = _getValues(tAmount);

                

        _rOwned[sender] = _rOwned[sender].sub(rAmount);

        _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);

        _takeLiquidity(tLiquidity);

        _takeDev(tDev);

        _reflectFee(rFee, tFee);

        emit Transfer(sender, recipient, tTransferAmount);

    }


    function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {

        (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity, uint256 tDev) = _getValues(tAmount);

        

        

        _rOwned[sender] = _rOwned[sender].sub(rAmount);

        _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);

        _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);           

        _takeLiquidity(tLiquidity);

        _takeDev(tDev);

        _reflectFee(rFee, tFee);

        emit Transfer(sender, recipient, tTransferAmount);

    }


    function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {

        (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity, uint256 tDev) = _getValues(tAmount);

       

       

        _tOwned[sender] = _tOwned[sender].sub(tAmount);

        _rOwned[sender] = _rOwned[sender].sub(rAmount);

        _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);   

        _takeLiquidity(tLiquidity);

        _takeDev(tDev);

        _reflectFee(rFee, tFee);

        emit Transfer(sender, recipient, tTransferAmount);

    }


    


}





























//muchas gracias RG - Contract by GEN - GenTokens.com

Code Audit Findings

Audits Overview

Context
Project Name
Gallant
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 0 0
Major 0 0 0 0 0 0 0
Medium 0 0 0 0 0 2 2
Minor 0 0 0 0 0 3 3
Optimization 0 0 0 0 0 0 0
Informational 0 0 0 0 0 0 0
Discussion 0 0 0 0 0 0 0
Review Notes

Overview

The provided Solidity smart contract is designed for a decentralized finance (DeFi) token on the Ethereum blockchain. It features a token reflection mechanism, allowing for simplified fee calculations. The contract includes functionality for excluding and including addresses from various fees, a flexible fee system with reflection, burn, liquidity, and developer wallet fees, and the ability to set transaction limits.

Liquidity management is implemented through automatic provision in the Uniswap pool. The contract has measures for wallet and blacklist management, max wallet limits, and control over the swap and liquify mechanism. A time delay mechanism is in place to deter rapid buying or selling, and a fallback function allows BNB transfers. Security features include safeguards against reentrancy attacks. It's essential to conduct a thorough audit before deploying such a contract for real-world use.

Privileged Roles

The provided Solidity smart contract defines several privileged roles with specific capabilities:

Owner Role:

  • The contract owner has exclusive privileges to execute certain functions, such as adjusting fees, setting transaction limits, and managing the developer wallet.
  • The owner can update the developer wallet address.
  • The owner can set and modify various fee percentages, including reflection, burn, liquidity, and developer fees.
  • The owner can add or remove addresses from the blacklist.

Excluded Role:

  • Addresses can be marked as excluded from fees, allowing them to interact with the contract without incurring certain charges.
  • Excluded addresses can be added or removed by the owner.

Blacklist Management:

  • The owner has the authority to add or remove addresses from a blacklist.
  • Blacklisted addresses are restricted from buying or selling tokens.

These roles are crucial for controlling and maintaining the functionality of the decentralized token. The owner, in particular, has the highest level of authority, enabling them to manage fees, adjust wallet addresses, and control the overall behavior of the contract. It's important to note that the privileges associated with these roles should be handled responsibly to ensure the security and integrity of the decentralized application.

Audits Scope

ID FILE SHA256 CHECKSUM
GLT gallant.sol d7912f3e5a9d80d7f7de84862d00625c31b09a8a6172c34a1bc2a064f7b0bba7

GLT-01 | Missing Access Control

CATEGORY SEVERITY LOCATIONS STATUS
privilege Medium

  function excludeFromFee(address account) public onlyOwner {

        _isExcludedFromFee[account] = true;

    }

RESOLVED
Description

Location in code: Inside the function excludeFromFee
Line number: 1175-1179
Description:
The excludeFromFee function lacks proper access control, allowing unauthorized users to modify fee exclusion settings.

GLT-02 | Unrestricted Swap and Liquify

CATEGORY SEVERITY LOCATIONS STATUS
privilege Medium

 function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
     uint256 __splitPromo = 0;
     uint256 __tokensToPromo = 0;
       if (_FeeDev != 0){
 __splitPromo = precDiv(_FeeDev,_liquidityAndPromoFee,2);
 __tokensToPromo = contractTokenBalance*__splitPromo/100;
 //Sendeth wage to King Steven of Gallant foreth promotion of Splend'r! - Send BNB to dev wallet for marketing and development
 uint256 balanceBeforePromoWallet = address(this).balance;
   swapTokensForEth(__tokensToPromo);
 uint256 balanceToSendPromo = address(this).balance - balanceBeforePromoWallet;
   sendToWallet(Wallet_Dev, balanceToSendPromo);
          }
if (_FeeLiquidity != 0){
 uint256 __tokenstoLP = contractTokenBalance-__tokensToPromo;
     uint256 firstHalf = __tokenstoLP.div(2);
   uint256 secondHalf = __tokenstoLP.sub(firstHalf);
  uint256 balanceBeforeLP = address(this).balance;
   swapTokensForEth(firstHalf);
 uint256 swappedLP = address(this).balance.sub(balanceBeforeLP);
  addLiquidity(secondHalf, swappedLP);
   emit SwapAndLiquify(firstHalf, swappedLP, secondHalf);
           }
 }

RESOLVED
Description

Location in code: Inside the function swapAndLiquify
Line number: 1751-1811
Description:
The swapAndLiquify function does not enforce any restrictions on who can call it. Consider adding access control checks to limit the execution of this function to specific addresses or roles.

GLT-03 | Lack of Access Control

CATEGORY SEVERITY LOCATIONS STATUS
privilege Minor

   function process_TokensFromContract(address payable wallet, uint256 tokenAmount) public onlyOwner {
      uint256 tokensOnWallet = balanceOf(address(this));
   if (tokenAmount > tokensOnWallet) {tokenAmount = tokensOnWallet;}
   uint256 balanceBefore = address(this).balance;
     swapTokensForEth(tokenAmount);
  uint256 balanceToSend = address(this).balance - balanceBefore;
     sendToWallet(wallet, balanceToSend);
         }

RESOLVED
Description

Location in code: Inside the function process_TokensFromContract
Line number: 1867-1881
Description:
The process_TokensFromContract function does not have sufficient access control. Consider adding a modifier or a check to ensure that only authorized addresses can call this function.

GLT-04 | Possible Integer Overflow

CATEGORY SEVERITY LOCATIONS STATUS
privilege Minor

function precDiv(uint a, uint b, uint precision) internal pure returns ( uint) {

     return a*(10**precision)/b;

    }

RESOLVED
Description

Location in code: Inside the precDiv function
Line number: 1742-1748
Description:
The precDiv function might be susceptible to integer overflow issues. Ensure that the calculated values do not exceed the maximum range for uint256.

GLT-05 | Lack of Boundary Checks

CATEGORY SEVERITY LOCATIONS STATUS
privilege Minor

 function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256) {

        (uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity, uint256 tDev) = _getTValues(tAmount);

        (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tLiquidity, tDev, _getRate());

        return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tLiquidity, tDev);

    }

RESOLVED
Description

Location in code: Inside the _getValues function
Line number: 1373-1381
Description:
The _getValues function may not check for boundary conditions, leading to unexpected results if inputs are near the maximum limit. Implement proper boundary checks to ensure safe execution.