File 1 of 1: Martinicoin.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor(address initialOwner) {
_transferOwnership(initialOwner);
}
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 {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, 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 from,
address to,
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 Address {
function isContract(address account) internal view returns (bool) {
return account.code.length > 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
) internal 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 Pausable is Context, Ownable {
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor() {
_paused = false;
}
function paused() public view virtual returns (bool) {
return _paused;
}
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
function pause() public onlyOwner whenNotPaused{
_paused = true;
emit Paused(_msgSender());
}
function unpause() public onlyOwner whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
abstract contract ERC20Blacklist is Ownable {
event Blacklisted(address account);
event Whitelisted(address account);
mapping(address => bool) internal _blacklist;
modifier onlyWhitelisted() {
require(!_blacklist[_msgSender()], "Wallet is blacklisted");
_;
}
function isBlacklisted(address account) public view returns (bool) {
return _blacklist[account];
}
function addToBlacklist(address account) external onlyOwner {
require(account != address(0), "Zero address not allowed");
require(!_blacklist[account], "Address is already blacklisted");
_blacklist[account] = true;
emit Blacklisted(account);
}
function removeFromBlacklist(address account) external onlyOwner {
require(account != address(0), "Zero address not allowed");
require(_blacklist[account], "Address is not blacklisted");
_blacklist[account] = false;
emit Whitelisted(account);
}
}
contract ERC20 is IERC20, Ownable {
using Address for address;
mapping(address => uint256) internal _rOwned;
mapping(address => uint256) internal _tOwned;
mapping(address => mapping(address => uint256)) internal _allowances;
mapping(address => bool) internal _isExcludedFromFee;
mapping(address => bool) internal _isExcluded;
address[] internal _excluded;
uint256 internal _tFeeTotal;
uint8 internal _decimals;
uint256 internal constant MAX = ~uint256(0);
uint256 internal _tTotal;
uint256 internal _rTotal;
string internal _name;
string internal _symbol;
constructor(address initialOwner_,
string memory name_,
string memory symbol_,
uint8 decimals_,
uint256 totalSupply_
) Ownable(initialOwner_) {
_decimals = decimals_;
_tTotal = totalSupply_ * 10 ** uint256(decimals_);
_rTotal = (MAX - (MAX % _tTotal));
_name = name_;
_symbol = symbol_;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_rOwned[initialOwner_] = _rTotal;
emit Transfer(address(0), initialOwner_, _tTotal);
}
function name() public view override returns (string memory) {
return _name;
}
function symbol() public view override returns (string memory) {
return _symbol;
}
function decimals() public view override returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view virtual 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()] - amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] - subtractedValue);
return true;
}
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
function tokenFromReflection(uint256 rAmount) public view returns (uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount / currentRate;
}
function _getRate() internal view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply / 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 - _rOwned[_excluded[i]];
tSupply = tSupply - _tOwned[_excluded[i]];
}
if (rSupply < _rTotal / _tTotal) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _transfer(
address from,
address to,
uint256 amount
) internal {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_beforeTokenTransfer(from, to, amount);
_tokenTransfer(from, to, amount);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount) private {
uint tTransferAmount;
if (_isExcludedFromFee[sender] || _isExcludedFromFee[recipient]) {
tTransferAmount = takeFee(sender, recipient, tAmount);
} else {
tTransferAmount = tAmount;
}
uint256 currentRate = _getRate();
uint256 rAmount = tAmount * currentRate;
uint256 rTransferAmount = tTransferAmount * currentRate;
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
} else {
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
}
emit Transfer(sender, recipient, tTransferAmount);
}
function takeFee(address, address, uint256 amount) internal virtual returns(uint256) {
return amount;
}
function totalFees() public view returns (uint256) {
return _tFeeTotal;
}
function isExcludedFromReward(address account) public view returns (bool) {
return _isExcluded[account];
}
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 excluded");
for (uint256 i = 0; i < _excluded.length; i++) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
uint256 currentRate = _getRate();
_rOwned[account] = _tOwned[account] *currentRate;
_tOwned[account] = 0;
_isExcluded[account] = false;
_excluded.pop();
break;
}
}
}
function isExcludedFromFee(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
function excludeFromFee(address account) public onlyOwner {
_isExcludedFromFee[account] = true;
}
function includeInFee(address account) public onlyOwner {
_isExcludedFromFee[account] = false;
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
abstract contract ERC20Burnable is Context, ERC20 {
uint256 public _burnFee = 800;
function _burn(address account, uint256 tAmount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), tAmount);
uint256 accountBalance = balanceOf(account);
require(accountBalance >= tAmount, "ERC20: burn amount exceeds balance");
uint256 currentRate = _getRate();
uint256 rAmount = tAmount * currentRate;
_rOwned[account] -= rAmount;
_rTotal -= rAmount;
_tTotal -= tAmount;
if (_isExcluded[account]) {
_tOwned[account] -= tAmount;
}
emit Transfer(account, address(0), tAmount);
}
function setBurnFee(uint256 _fee) external onlyOwner {
_burnFee = _fee;
}
function burn(uint256 amount) public virtual {
_burn(_msgSender(), amount);
}
function burnFrom(address account, uint256 amount) public virtual {
_spendAllowance(account, _msgSender(), amount);
_burn(account, amount);
}
function takeFee(address sender, address recipient, uint256 amount) internal virtual override returns(uint256) {
uint tFee = amount * _burnFee / 10000;
uint256 currentRate = _getRate();
uint256 rFee = tFee * currentRate;
_rTotal -= rFee;
_tTotal -= tFee;
emit Transfer(sender, address(0), amount);
return super.takeFee(sender, recipient, amount) - tFee;
}
}
abstract contract ERC20Mintable is ERC20 {
uint256 private immutable _cap;
constructor(uint256 cap_) {
require(cap_ > 0, "ERC20Capped: cap is 0");
_cap = cap_;
}
function _mint(address account, uint256 tAmount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, tAmount);
uint256 currentRate = _getRate();
uint256 rAmount = tAmount * currentRate;
_rOwned[account] += rAmount;
if (_isExcluded[account]) {
_tOwned[account] += tAmount;
}
_tTotal += tAmount;
_rTotal = (MAX - (MAX % _tTotal));
emit Transfer(address(0), account, tAmount);
}
function mint(address to, uint256 amount) public onlyOwner {
require(totalSupply() + amount <= _cap, "Total supply cannot exceed cap");
_mint(to, amount);
}
}
abstract contract ERC20Taxable is ERC20 {
uint256 public _taxFee = 1;
function setTaxFee(uint256 _fee) external onlyOwner {
_taxFee = _fee;
}
function takeFee(address sender, address recipient, uint256 amount) internal virtual override returns(uint256) {
uint tFee = amount * _taxFee / 10000;
uint256 currentRate = _getRate();
uint256 rFee = tFee * currentRate;
_rTotal = _rTotal - rFee;
_tFeeTotal = _tFeeTotal + tFee;
return super.takeFee(sender, recipient, amount) - tFee;
}
}
abstract contract ERC20Team is ERC20 {
uint256 public _teamFee;
address public _teamWallet;
function setTeamFee(uint256 _fee) external onlyOwner {
_teamFee = _fee;
}
function setTeamWallet(address account) external onlyOwner {
require(account != address(0), "Zera address not allowed");
_teamWallet = account;
}
function takeFee(address sender, address recipient, uint256 amount) internal virtual override returns(uint256) {
if (_teamWallet != address(0)) {
uint tFee = amount * _teamFee / 10000;
uint256 currentRate = _getRate();
uint256 rFee = tFee * currentRate;
_rOwned[_teamWallet] += rFee;
if (_isExcluded[_teamWallet]) {
_tOwned[_teamWallet] += tFee;
}
emit Transfer(sender, _teamWallet, tFee);
return super.takeFee(sender, recipient, amount) - tFee;
} else {
return super.takeFee(sender, recipient, amount);
}
}
}
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 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;
}
abstract contract ERC20Liquidity is ERC20 {
mapping (address => bool) internal _isExcludedFromAutoLiquidity;
uint256 public _liquidityFee;
uint256 internal minimumTokensBeforeSwap;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool inSwapAndLiquify;
bool public swapAndLiquifyEnabled = false;
event SwapAndLiquify(
uint256 tokensSwapped,
uint256 ethReceived,
uint256 tokensIntoLiqudity
);
modifier lockTheSwap {
inSwapAndLiquify = true;
_;
inSwapAndLiquify = false;
}
constructor(address _router) {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(_router);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router = _uniswapV2Router;
_isExcludedFromAutoLiquidity[uniswapV2Pair] = true;
_isExcludedFromAutoLiquidity[address(uniswapV2Router)] = true;
}
function setExcludedFromAutoLiquidity(address a, bool b) external onlyOwner {
_isExcludedFromAutoLiquidity[a] = b;
}
function takeFee(address sender, address recipient, uint256 amount) internal virtual override returns(uint256) {
uint tFee = amount * _liquidityFee / 10000;
uint256 currentRate = _getRate();
uint256 rFee = tFee * currentRate;
_rOwned[address(this)] = _rOwned[address(this)] + rFee;
emit Transfer(sender, address(this), tFee);
if (_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)] + tFee;
uint256 contractTokenBalance = balanceOf(address(this));
bool isOverMinTokenBalance = contractTokenBalance >= minimumTokensBeforeSwap;
if (
isOverMinTokenBalance &&
!inSwapAndLiquify &&
!_isExcludedFromAutoLiquidity[sender] &&
swapAndLiquifyEnabled
) {
contractTokenBalance = minimumTokensBeforeSwap;
swapAndLiquify(contractTokenBalance);
}
return super.takeFee(sender, recipient, amount) - tFee;
}
function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
uint256 half = contractTokenBalance / 2;
uint256 otherHalf = contractTokenBalance - half;
uint256 initialBalance = address(this).balance;
swapTokensForBnb(half);
uint256 newBalance = address(this).balance -initialBalance;
addLiquidity(otherHalf, newBalance);
emit SwapAndLiquify(half, newBalance, otherHalf);
}
function swapTokensForBnb(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 bnbAmount) private {
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.addLiquidityETH{value: bnbAmount}(
address(this),
tokenAmount,
0,
0,
owner(),
block.timestamp
);
}
function setNumTokensSellToAddToLiquidity(uint256 _minimumTokensBeforeSwap) external onlyOwner() {
minimumTokensBeforeSwap = _minimumTokensBeforeSwap;
}
function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner {
swapAndLiquifyEnabled = _enabled;
}
function setLiquidityFee(uint256 _fee) external onlyOwner {
_liquidityFee = _fee;
}
function retriveBNB(address payable to, uint256 amount) external onlyOwner {
require(to != address(0), "Zero address prohibited");
uint256 contractBalance = address(this).balance;
require(amount <= contractBalance, "Insufficient contract BNB balance");
to.transfer(amount);
}
receive() external payable {}
}
contract Martinicoin is ERC20
,ERC20Burnable
,ERC20Taxable
{
constructor(address initialOwner_,
string memory name_,
string memory symbol_,
uint8 decimals_,
uint256 totalSupply_
)
ERC20(initialOwner_, name_, symbol_, decimals_, totalSupply_)
{
}
function takeFee(address sender, address recipient, uint256 amount) internal
override(ERC20 ,ERC20Burnable ,ERC20Taxable ) returns(uint256) {
return super.takeFee(sender, recipient, amount);
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual override {}
}