Address Contract Partially Verified
Address
0x926FF6584b5905CC793cfB19bfc0AD6443671F47
Balance
0 ETH
Nonce
1
Code Size
4183 bytes
Creator
0x86Aed0a1...60C7 at tx 0x0d67e100...433666
Indexed Transactions
0
Contract Bytecode
4183 bytes
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c80638da5cb5b116100c3578063b62496f51161007c578063b62496f51461029d578063bc2d7743146102c0578063bd962399146102d3578063dd62ed3e146102e6578063e30c39781461031f578063f2fde38b1461033057600080fd5b80638da5cb5b1461024d57806392f6576e1461025e57806395d89b41146102665780639a7a23d61461026e5780639d9241ec14610281578063a9059cbb1461028a57600080fd5b80632632fde4116101155780632632fde4146101c5578063313ce567146101f0578063567ab997146101ff57806370a0823114610214578063715018a61461023d57806379ba50971461024557600080fd5b806306fdde0314610152578063095ea7b314610170578063180b0d7e1461019357806318160ddd146101aa57806323b872dd146101b2575b600080fd5b61015a610343565b6040516101679190610db3565b60405180910390f35b61018361017e366004610e1d565b6103d5565b6040519015158152602001610167565b61019c6103e881565b604051908152602001610167565b60055461019c565b6101836101c0366004610e47565b6103ef565b6101d86101d3366004610e83565b610413565b6040516001600160a01b039091168152602001610167565b60405160128152602001610167565b61021261020d366004610e83565b61043d565b005b61019c610222366004610e9c565b6001600160a01b031660009081526003602052604090205490565b6102126104a2565b6102126104b6565b6000546001600160a01b03166101d8565b61019c606481565b61015a6104fa565b61021261027c366004610ebe565b610509565b61019c600a5481565b610183610298366004610e1d565b61077c565b6101836102ab366004610e9c565b60086020526000908152604090205460ff1681565b6102126102ce366004610e9c565b61078a565b600b546101d8906001600160a01b031681565b61019c6102f4366004610efa565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6001546001600160a01b03166101d8565b61021261033e366004610e9c565b6107b4565b60606006805461035290610f2d565b80601f016020809104026020016040519081016040528092919081815260200182805461037e90610f2d565b80156103cb5780601f106103a0576101008083540402835291602001916103cb565b820191906000526020600020905b8154815290600101906020018083116103ae57829003601f168201915b5050505050905090565b6000336103e3818585610825565b60019150505b92915050565b6000336103fd858285610837565b6104088585856108b5565b506001949350505050565b6009818154811061042357600080fd5b6000918252602090912001546001600160a01b0316905081565b610445610914565b600081118015610456575060648111155b61049d5760405162461bcd60e51b815260206004820152601360248201527245524332303a204f7574206f662052616e676560681b60448201526064015b60405180910390fd5b600a55565b6104aa610914565b6104b46000610941565b565b60015433906001600160a01b031681146104ee5760405163118cdaa760e01b81526001600160a01b0382166004820152602401610494565b6104f781610941565b50565b60606007805461035290610f2d565b610511610914565b6001600160a01b03821660009081526008602052604090205481151560ff9091161515036105755760405162461bcd60e51b815260206004820152601160248201527015985b1d5948185b1c9958591e481cd95d607a1b6044820152606401610494565b6001600160a01b0382166000908152600860205260409020805460ff191682158015919091179091556105f257600980546001810182556000919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0180546001600160a01b0319166001600160a01b038416179055610740565b6009546001106106365760405162461bcd60e51b815260206004820152600f60248201526e2932b8bab4b932b21018903830b4b960891b6044820152606401610494565b60005b60095481101561073e57826001600160a01b03166009828154811061066057610660610f67565b6000918252602090912001546001600160a01b03160361072c576009805461068a90600190610f93565b8154811061069a5761069a610f67565b600091825260209091200154600980546001600160a01b0390921691839081106106c6576106c6610f67565b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600980548061070557610705610fa6565b600082815260209020810160001990810180546001600160a01b031916905501905561073e565b8061073681610fbc565b915050610639565b505b604051811515906001600160a01b038416907fffa9187bf1f18bf477bd0ea1bcbb64e93b6a98132473929edfce215cd9b16fab90600090a35050565b6000336103e38185856108b5565b610792610914565b600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6107bc610914565b600180546001600160a01b0383166001600160a01b031990911681179091556107ed6000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b610832838383600161095a565b505050565b6001600160a01b0383811660009081526004602090815260408083209386168352929052205460001981146108af57818110156108a057604051637dc7a0d960e11b81526001600160a01b03841660048201526024810182905260448101839052606401610494565b6108af8484848403600061095a565b50505050565b6001600160a01b0383166108df57604051634b637e8f60e11b815260006004820152602401610494565b6001600160a01b0382166109095760405163ec442f0560e01b815260006004820152602401610494565b610832838383610a2f565b6000546001600160a01b031633146104b45760405163118cdaa760e01b8152336004820152602401610494565b600180546001600160a01b03191690556104f781610d3b565b6001600160a01b0384166109845760405163e602df0560e01b815260006004820152602401610494565b6001600160a01b0383166109ae57604051634a1406b160e11b815260006004820152602401610494565b6001600160a01b03808516600090815260046020908152604080832093871683529290522082905580156108af57826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610a2191815260200190565b60405180910390a350505050565b610a37610d8b565b6001600160a01b038316610a62578060056000828254610a579190610fd5565b90915550610ad49050565b6001600160a01b03831660009081526003602052604090205481811015610ab55760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401610494565b6001600160a01b03841660009081526003602052604090209082900390555b6001600160a01b038216610af057600580548290039055610d31565b6001600160a01b03821660009081526008602052604081205460ff1615610b165750600a545b60006103e8610b258385610fe8565b610b2f9190610fff565b90508015610cad57600b546001600160a01b0316610bdb578060036000610b5e6000546001600160a01b031690565b6001600160a01b03166001600160a01b031681526020019081526020016000206000828254610b8d9190610fd5565b90915550506000546040518281526001600160a01b039091169030907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3610cad565b600b546001600160a01b031660009081526003602052604081208054839290610c05908490610fd5565b9091555050600b5460405163f055862d60e01b8152600481018390526001600160a01b039091169063f055862d90602401600060405180830381600087803b158015610c5057600080fd5b505af1158015610c64573d6000803e3d6000fd5b5050600b546040518481526001600160a01b0390911692503091507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35b610cb78184610f93565b6001600160a01b03851660009081526003602052604081208054909190610cdf908490610fd5565b90915550506001600160a01b038085169086167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef610d1d8487610f93565b60405190815260200160405180910390a350505b6108326001600255565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6002805403610dad57604051633ee5aeb560e01b815260040160405180910390fd5b60028055565b600060208083528351808285015260005b81811015610de057858101830151858201604001528201610dc4565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b0381168114610e1857600080fd5b919050565b60008060408385031215610e3057600080fd5b610e3983610e01565b946020939093013593505050565b600080600060608486031215610e5c57600080fd5b610e6584610e01565b9250610e7360208501610e01565b9150604084013590509250925092565b600060208284031215610e9557600080fd5b5035919050565b600060208284031215610eae57600080fd5b610eb782610e01565b9392505050565b60008060408385031215610ed157600080fd5b610eda83610e01565b915060208301358015158114610eef57600080fd5b809150509250929050565b60008060408385031215610f0d57600080fd5b610f1683610e01565b9150610f2460208401610e01565b90509250929050565b600181811c90821680610f4157607f821691505b602082108103610f6157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b818103818111156103e9576103e9610f7d565b634e487b7160e01b600052603160045260246000fd5b600060018201610fce57610fce610f7d565b5060010190565b808201808211156103e9576103e9610f7d565b80820281158282048414176103e9576103e9610f7d565b60008261101c57634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220422b774ae93b36366a82d8f020572b349333b7bacc34c175433a96bd456b4c6564736f6c63430008130033
Verified Source Code Partial Match
Compiler: v0.8.19+commit.7dd6d404
EVM: paris
Optimization: Yes (200 runs)
PABLODEFI.sol 758 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)
//Developed by: NarcosLand
pragma solidity 0.8.19;
/**
* @dev Standard ERC20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
*/
interface IERC20Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC20InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC20InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
* @param spender Address that may be allowed to operate on tokens without being their owner.
* @param allowance Amount of tokens a `spender` is allowed to operate with.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC20InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.
* @param spender Address that may be allowed to operate on tokens without being their owner.
*/
error ERC20InvalidSpender(address spender);
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*/
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);
}
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor() {
address initialOwner = msg.sender;
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
/**
* @dev Contract module which provides access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This extension of the {Ownable} contract includes a two-step mechanism to transfer
* ownership, where the new owner must call {acceptOwnership} in order to replace the
* old one. This can help prevent common mistakes, such as transfers of ownership to
* incorrect accounts, or to contracts that are unable to interact with the
* permission system.
*
* The initial owner is specified at deployment time in the constructor for `Ownable`. This
* can later be changed with {transferOwnership} and {acceptOwnership}.
*
* This module is used through inheritance. It will make available all functions
* from parent (Ownable).
*/
abstract contract Ownable2Step is Ownable {
address private _pendingOwner;
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
/**
* @dev Returns the address of the pending owner.
*/
function pendingOwner() public view virtual returns (address) {
return _pendingOwner;
}
/**
* @dev Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one.
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual override onlyOwner {
_pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`) and deletes any pending owner.
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual override {
delete _pendingOwner;
super._transferOwnership(newOwner);
}
/**
* @dev The new owner accepts the ownership transfer.
*/
function acceptOwnership() public virtual {
address sender = _msgSender();
if (pendingOwner() != sender) {
revert OwnableUnauthorizedAccount(sender);
}
_transferOwnership(sender);
}
}
interface PabloStake {
function ADDFUNDSby(uint256 tokens) external;
}
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private _status;
/**
* @dev Unauthorized reentrant call.
*/
error ReentrancyGuardReentrantCall();
constructor() {
_status = NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be NOT_ENTERED
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
// Any calls to nonReentrant after this point will fail
_status = ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
*
* TIP: For a detailed writeup see our guide
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*/
abstract contract ERC20 is Context, Ownable2Step, IERC20, IERC20Metadata, IERC20Errors, ReentrancyGuard {
mapping(address account => uint256) private _balances;
mapping(address account => mapping(address spender => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
mapping (address => bool) public automatedMarketMakerPairs;
address[] public _marketPairs;
uint256 public constant MAX_FEE_RATE = 100; //100 is for 10%
uint256 public constant feeDenominator = 1000;
uint256 public totalSellFee = 100; //55 for 5.5%
address public PABLOStaking = address(0);
event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);
/**
* @dev Sets the values for {name} and {symbol}.
*
* 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 returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual 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 default value returned by this function, unless
* it's 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 returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `value`.
*/
function transfer(address to, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_transfer(owner, to, value);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `value` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, value);
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}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `value`.
* - the caller must have allowance for ``from``'s tokens of at least
* `value`.
*/
function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, value);
_transfer(from, to, value);
return true;
}
/**
* @dev Moves a `value` amount of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _transfer(address from, address to, uint256 value) internal {
if (from == address(0)) {
revert ERC20InvalidSender(address(0));
}
if (to == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(from, to, value);
}
/**
* @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
* (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
* this function.
*
* Emits a {Transfer} event.
*/
function _update(address from, address to, uint256 value) internal virtual nonReentrant {
if (from == address(0)) {
// Overflow check required: The rest of the code assumes that totalSupply never overflows
_totalSupply += value;
} else {
uint256 fromBalance = _balances[from];
if (fromBalance < value) {
revert ERC20InsufficientBalance(from, fromBalance, value);
}
unchecked {
// Overflow not possible: value <= fromBalance <= totalSupply.
_balances[from] = fromBalance - value;
}
}
if (to == address(0)) {
unchecked {
// Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
_totalSupply -= value;
}
} else {
uint256 _realFee = 0;
if(automatedMarketMakerPairs[to]){ _realFee = totalSellFee; }
uint256 feeAmount = (value * _realFee) / (feeDenominator);
if(feeAmount > 0) {
if(PABLOStaking == address(0)) {
_balances[owner()] += (feeAmount);
emit Transfer(address(this), owner(), feeAmount);
}
else {
_balances[PABLOStaking] += (feeAmount);
PabloStake(PABLOStaking).ADDFUNDSby(feeAmount);
emit Transfer(address(this), PABLOStaking, feeAmount);
}
}
// Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
_balances[to] += (value - feeAmount);
emit Transfer(from, to, (value - feeAmount));
}
}
function setAutomatedMarketMakerPair(address _pair, bool _value) public onlyOwner {
require(automatedMarketMakerPairs[_pair] != _value, "Value already set");
automatedMarketMakerPairs[_pair] = _value;
if(_value){
_marketPairs.push(_pair);
}else{
require(_marketPairs.length > 1, "Required 1 pair");
for (uint256 i = 0; i < _marketPairs.length; i++) {
if (_marketPairs[i] == _pair) {
_marketPairs[i] = _marketPairs[_marketPairs.length - 1];
_marketPairs.pop();
break;
}
}
}
emit SetAutomatedMarketMakerPair(_pair, _value);
}
/**
* @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
* Relies on the `_update` mechanism
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _mint(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(address(0), account, value);
}
/**
* @dev Sets `value` 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.
*
* Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
*/
function _approve(address owner, address spender, uint256 value) internal {
_approve(owner, spender, value, true);
}
/**
* @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
*
* By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
* `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
* `Approval` event during `transferFrom` operations.
*
* Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
* true using the following override:
* ```
* function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
* super._approve(owner, spender, value, true);
* }
* ```
*
* Requirements are the same as {_approve}.
*/
function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
if (owner == address(0)) {
revert ERC20InvalidApprover(address(0));
}
if (spender == address(0)) {
revert ERC20InvalidSpender(address(0));
}
_allowances[owner][spender] = value;
if (emitEvent) {
emit Approval(owner, spender, value);
}
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `value`.
*
* Does not update the allowance value in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Does not emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
if (currentAllowance < value) {
revert ERC20InsufficientAllowance(spender, currentAllowance, value);
}
unchecked {
_approve(owner, spender, currentAllowance - value, false);
}
}
}
function setPABLOStaking(address _staking) external onlyOwner {
//Require do not needed because we might set it to Zero
PABLOStaking = _staking;
}
function setTotalSellFee(uint256 _value) external onlyOwner {
require(_value > 0 && _value <= MAX_FEE_RATE, "ERC20: Out of Range");
totalSellFee = _value;
}
}
contract PABLODEFI is ERC20 {
constructor(uint256 initialSupply) ERC20("PABLO DEFI", "PABLO") {
_mint(msg.sender, initialSupply);
}
}
Read Contract
MAX_FEE_RATE 0x92f6576e → uint256
PABLOStaking 0xbd962399 → address
_marketPairs 0x2632fde4 → address
allowance 0xdd62ed3e → uint256
automatedMarketMakerPairs 0xb62496f5 → bool
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
feeDenominator 0x180b0d7e → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
pendingOwner 0xe30c3978 → address
symbol 0x95d89b41 → string
totalSellFee 0x9d9241ec → uint256
totalSupply 0x18160ddd → uint256
Write Contract 9 functions
These functions modify contract state and require a wallet transaction to execute.
acceptOwnership 0x79ba5097
No parameters
approve 0x095ea7b3
address spender
uint256 value
returns: bool
renounceOwnership 0x715018a6
No parameters
setAutomatedMarketMakerPair 0x9a7a23d6
address _pair
bool _value
setPABLOStaking 0xbc2d7743
address _staking
setTotalSellFee 0x567ab997
uint256 _value
transfer 0xa9059cbb
address to
uint256 value
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool
transferOwnership 0xf2fde38b
address newOwner
Token Balances (1)
View Transfers →Recent Transactions
No transactions found for this address