Contract Overview
My Name Tag:
Not Available, login to update
[ Download CSV Export ]
Contract Name:
MasterChefV3
Compiler Version
v0.8.6+commit.11564f7e
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
/* .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. ( D .'( E .'( S .'( I .'( R .'( E .' `.( `.( `.( `.( `.( `.( by sandman.finance */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./DesireTokenV3.sol"; // MasterChef is the master of Desire. He can make Desire and he is a fair guy. // // Note that it's ownable and the owner wields tremendous power. The ownership // will be transferred to a governance smart contract once DESIRE is sufficiently // distributed and the community can show to govern itself. // // Have fun reading it. Hopefully it's bug-free. God bless. contract MasterChefV3 is Ownable, ReentrancyGuard { using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // We do some fancy math here. Basically, any point in time, the amount of DESIREs // entitled to a user but is pending to be distributed is: // // pending reward = (user.amount * pool.accDesirePerShare) - user.rewardDebt // // Whenever a user deposits or withdraws LP tokens to a pool. Here's what happens: // 1. The pool's `accDesirePerShare` (and `lastRewardBlock`) gets updated. // 2. User receives the pending reward sent to his/her address. // 3. User's `amount` gets updated. // 4. User's `rewardDebt` gets updated. } // Info of each pool. struct PoolInfo { IERC20 lpToken; // Address of LP token contract. uint256 allocPoint; // How many allocation points assigned to this pool. DESIREs to distribute per block. uint256 lastRewardBlock; // Last block number that DESIREs distribution occurs. uint256 accDesirePerShare; // Accumulated DESIREs per share, times 1e18. See below. uint16 depositFeeBP; // Deposit fee in basis points uint256 lpSupply; } uint256 public constant desireMaximumSupply = 500 * (10 ** 3) * (10 ** 18); // 500,000 desire uint256 public constant MAX_EMISSION_RATE = 10 * (10 ** 18); // 10 // The DESIRE TOKEN! DesireTokenV3 public immutable desire; // DESIRE tokens created per block. uint256 public desirePerBlock; // Deposit Fee address address public feeAddress; // Info of each pool. PoolInfo[] public poolInfo; // Info of each user that stakes LP tokens. mapping(uint256 => mapping(address => UserInfo)) public userInfo; // Total allocation points. Must be the sum of all allocation points in all pools. uint256 public totalAllocPoint = 0; // The block number when DESIRE mining starts. uint256 public startBlock; // The block number when DESIRE mining ends. uint256 public emmissionEndBlock = type(uint256).max; event addPool(uint256 indexed pid, address lpToken, uint256 allocPoint, uint256 depositFeeBP); event setPool(uint256 indexed pid, address lpToken, uint256 allocPoint, uint256 depositFeeBP); event Deposit(address indexed user, uint256 indexed pid, uint256 amount); event Withdraw(address indexed user, uint256 indexed pid, uint256 amount); event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount); event SetEmissionRate(address indexed caller, uint256 previousAmount, uint256 newAmount); event SetFeeAddress(address indexed user, address indexed newAddress); event SetStartBlock(uint256 newStartBlock); constructor( DesireTokenV3 _desire, address _feeAddress, uint256 _desirePerBlock, uint256 _startBlock ) { require(_feeAddress != address(0), "!nonzero"); desire = _desire; feeAddress = _feeAddress; desirePerBlock = _desirePerBlock; startBlock = _startBlock; } function poolLength() external view returns (uint256) { return poolInfo.length; } mapping(IERC20 => bool) public poolExistence; modifier nonDuplicated(IERC20 _lpToken) { require(!poolExistence[_lpToken], "nonDuplicated: duplicated"); _; } // Add a new lp to the pool. Can only be called by the owner. function add(uint256 _allocPoint, IERC20 _lpToken, uint16 _depositFeeBP, bool _withUpdate) external onlyOwner nonDuplicated(_lpToken) { // Make sure the provided token is ERC20 _lpToken.balanceOf(address(this)); require(_depositFeeBP <= 401, "add: invalid deposit fee basis points"); if (_withUpdate) { massUpdatePools(); } uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock; totalAllocPoint = totalAllocPoint + _allocPoint; poolExistence[_lpToken] = true; poolInfo.push(PoolInfo({ lpToken : _lpToken, allocPoint : _allocPoint, lastRewardBlock : lastRewardBlock, accDesirePerShare : 0, depositFeeBP : _depositFeeBP, lpSupply: 0 })); emit addPool(poolInfo.length - 1, address(_lpToken), _allocPoint, _depositFeeBP); } // Update the given pool's DESIRE allocation point and deposit fee. Can only be called by the owner. function set(uint256 _pid, uint256 _allocPoint, uint16 _depositFeeBP, bool _withUpdate) external onlyOwner { require(_depositFeeBP <= 401, "set: invalid deposit fee basis points"); if (_withUpdate) { massUpdatePools(); } totalAllocPoint = totalAllocPoint - poolInfo[_pid].allocPoint + _allocPoint; poolInfo[_pid].allocPoint = _allocPoint; poolInfo[_pid].depositFeeBP = _depositFeeBP; emit setPool(_pid, address(poolInfo[_pid].lpToken), _allocPoint, _depositFeeBP); } // Return reward multiplier over the given _from to _to block. function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) { // As we set the multiplier to 0 here after emmissionEndBlock // deposits aren't blocked after farming ends. if (_from > emmissionEndBlock) return 0; if (_to > emmissionEndBlock) return emmissionEndBlock - _from; else return _to - _from; } // View function to see pending DESIREs on frontend. function pendingDesire(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accDesirePerShare = pool.accDesirePerShare; if (block.number > pool.lastRewardBlock && pool.lpSupply != 0 && totalAllocPoint > 0) { uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number); uint256 desireReward = (multiplier * desirePerBlock * pool.allocPoint) / totalAllocPoint; accDesirePerShare = accDesirePerShare + ((desireReward * 1e18) / pool.lpSupply); } return ((user.amount * accDesirePerShare) / 1e18) - user.rewardDebt; } // Update reward variables for all pools. Be careful of gas spending! function massUpdatePools() public { uint256 length = poolInfo.length; for (uint256 pid = 0; pid < length; ++pid) { updatePool(pid); } } // Update reward variables of the given pool to be up-to-date. function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if (block.number <= pool.lastRewardBlock) { return; } if (pool.lpSupply == 0 || pool.allocPoint == 0) { pool.lastRewardBlock = block.number; return; } uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number); uint256 desireReward = (multiplier * desirePerBlock * pool.allocPoint) / totalAllocPoint; // This shouldn't happen, but just in case we stop rewards. if (desire.totalSupply() > desireMaximumSupply) desireReward = 0; else if ((desire.totalSupply() + desireReward) > desireMaximumSupply) desireReward = desireMaximumSupply - desire.totalSupply(); if (desireReward > 0) desire.mint(address(this), desireReward); // The first time we reach Desire max supply we solidify the end of farming. if (desire.totalSupply() >= desireMaximumSupply && emmissionEndBlock == type(uint256).max) emmissionEndBlock = block.number; pool.accDesirePerShare = pool.accDesirePerShare + ((desireReward * 1e18) / pool.lpSupply); pool.lastRewardBlock = block.number; } // Deposit LP tokens to MasterChef for DESIRE allocation. function deposit(uint256 _pid, uint256 _amount) external nonReentrant { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = ((user.amount * pool.accDesirePerShare) / 1e18) - user.rewardDebt; if (pending > 0) { safeDesireTransfer(msg.sender, pending); } } if (_amount > 0) { uint256 balanceBefore = pool.lpToken.balanceOf(address(this)); pool.lpToken.safeTransferFrom(address(msg.sender), address(this), _amount); _amount = pool.lpToken.balanceOf(address(this)) - balanceBefore; require(_amount > 0, "we dont accept deposits of 0 size"); if (pool.depositFeeBP > 0) { uint256 depositFee = (_amount * pool.depositFeeBP) / 10000; pool.lpToken.safeTransfer(feeAddress, depositFee); user.amount = user.amount + _amount - depositFee; pool.lpSupply = pool.lpSupply + _amount - depositFee; } else { user.amount = user.amount + _amount; pool.lpSupply = pool.lpSupply + _amount; } } user.rewardDebt = (user.amount * pool.accDesirePerShare) / 1e18; emit Deposit(msg.sender, _pid, _amount); } // Withdraw LP tokens from MasterChef. function withdraw(uint256 _pid, uint256 _amount) external nonReentrant { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; require(user.amount >= _amount, "withdraw: not good"); updatePool(_pid); uint256 pending = ((user.amount * pool.accDesirePerShare) / 1e18) - user.rewardDebt; if (pending > 0) { safeDesireTransfer(msg.sender, pending); } if (_amount > 0) { user.amount = user.amount - _amount; pool.lpToken.safeTransfer(address(msg.sender), _amount); pool.lpSupply = pool.lpSupply - _amount; } user.rewardDebt = (user.amount * pool.accDesirePerShare) / 1e18; emit Withdraw(msg.sender, _pid, _amount); } // Withdraw without caring about rewards. EMERGENCY ONLY. function emergencyWithdraw(uint256 _pid) external nonReentrant { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; uint256 amount = user.amount; user.amount = 0; user.rewardDebt = 0; pool.lpToken.safeTransfer(address(msg.sender), amount); // In the case of an accounting error, we choose to let the user emergency withdraw anyway if (pool.lpSupply >= amount) pool.lpSupply = pool.lpSupply - amount; else pool.lpSupply = 0; emit EmergencyWithdraw(msg.sender, _pid, amount); } // Safe desire transfer function, just in case if rounding error causes pool to not have enough DESIREs. function safeDesireTransfer(address _to, uint256 _amount) internal { uint256 desireBal = desire.balanceOf(address(this)); bool transferSuccess = false; if (_amount > desireBal) { transferSuccess = desire.transfer(_to, desireBal); } else { transferSuccess = desire.transfer(_to, _amount); } require(transferSuccess, "safeDesireTransfer: transfer failed"); } function setFeeAddress(address _feeAddress) external onlyOwner { require(_feeAddress != address(0), "!nonzero"); feeAddress = _feeAddress; emit SetFeeAddress(msg.sender, _feeAddress); } // Update lastRewardBlock variables for all pools. function _massUpdateLastRewardBlockPools() internal { uint256 length = poolInfo.length; for (uint256 _pid = 0; _pid < length; ++_pid) { poolInfo[_pid].lastRewardBlock = startBlock; } } function setStartBlock(uint256 _newStartBlock) external onlyOwner { require(block.number < startBlock, "cannot change start block if sale has already commenced"); require(block.number < _newStartBlock, "cannot set start block in the past"); startBlock = _newStartBlock; _massUpdateLastRewardBlockPools(); emit SetStartBlock(startBlock); } function setEmissionRate(uint256 _desirePerBlock) external onlyOwner { require(_desirePerBlock > 0); require(_desirePerBlock < MAX_EMISSION_RATE); massUpdatePools(); desirePerBlock = _desirePerBlock; emit SetEmissionRate(msg.sender, desirePerBlock, _desirePerBlock); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC20.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @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; 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 make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
/* .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. ( D .'( E .'( S .'( I .'( R .'( E .' `.( `.( `.( `.( `.( `.( by sandman.finance */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.6; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; /* TABLE ERROR REFERENCE: ERR1: The sender is on the blacklist. Please contact to support. ERR2: The recipient is on the blacklist. Please contact to support. ERR3: User cannot send more than allowed. ERR4: User is not operator. ERR5: User is excluded from antibot system. ERR6: Bot address is already on the blacklist. ERR7: The expiration time has to be greater than 0. ERR8: Bot address is not found on the blacklist. ERR9: Address cant be 0. */ // DesireToken contract DesireTokenV3 is ERC20, Ownable { event OperatorTransferred(address indexed previousOperator, address indexed newOperator); event TransferTaxRateUpdated(address indexed operator, uint256 previousRate, uint256 newRate); event HoldingAmountRateUpdated(address indexed operator, uint256 previousRate, uint256 newRate); event AntiBotWorkingStatus(address indexed operator, bool previousStatus, bool newStatus); event AddBotAddress(address indexed botAddress); event RemoveBotAddress(address indexed botAddress); event ExcludedOperatorsUpdated(address indexed operatorAddress, bool previousStatus, bool newStatus); event ExcludedHoldersUpdated(address indexed holderAddress, bool previousStatus, bool newStatus); using SafeMath for uint256; ///@dev Max transfer amount rate. (default is 3% of total supply) uint16 public maxUserTransferAmountRate = 300; ///@dev Max holding rate. (default is 9% of total supply) uint16 public maxUserHoldAmountRate = 900; ///@dev Length of blacklist addressess uint256 public blacklistLength; ///@dev Enable|Disable antiBot bool public antiBotWorking; ///@dev Exclude operators from antiBot system mapping(address => bool) private _excludedOperatorsFromAntiBot; ///@dev Exclude holders from antiBot system mapping(address => bool) private _excludedHoldersFromAntiBot; ///@dev mapping store blacklist. address=>ExpirationTime mapping(address => uint256) private _blacklist; address public constant BURN_ADDRESS = 0x000000000000000000000000000000000000dEaD; // operator role address internal _operator; // MODIFIERS modifier antiBot(address _sender, address _recipient, uint256 _amount) { //check blacklist require(!_blacklistCheck(_sender), "ERR1"); require(!_blacklistCheck(_recipient), "ERR2"); // This code will be disabled after launch and before farming if (antiBotWorking){ // check if sender|recipient has a tx amount is within the allowed limits if (_isNotOperatorExcludedFromAntiBot(_sender)){ if(_isNotOperatorExcludedFromAntiBot(_recipient)) require(_amount <= _maxUserTransferAmount(), "ERR3"); } } _; } modifier onlyOperator() { require(_operator == _msgSender(), "ERR4"); _; } constructor() ERC20('DESIRE', 'DESIRE') { // Exclude operator addresses, lps, etc from antibot system _excludedOperatorsFromAntiBot[msg.sender] = true; _excludedOperatorsFromAntiBot[address(0)] = true; _excludedOperatorsFromAntiBot[address(this)] = true; _excludedOperatorsFromAntiBot[BURN_ADDRESS] = true; _operator = _msgSender(); } function mint(address _to, uint256 _amount) public onlyOwner { _mint(_to, _amount); } //INTERNALS /// @dev overrides transfer function to use antibot system function _transfer(address _sender, address _recipient, uint256 _amount) internal virtual override antiBot(_sender, _recipient, _amount) { // Autodetect is sender is a BOT // This code will be disabled after launch and before farming if (antiBotWorking){ // check if sender|recipient has a tx amount is within the allowed limits if (_isNotHolderExcludedFromAntiBot(_sender)){ if(_isNotOperatorExcludedFromAntiBot(_sender)){ if (balanceOf(_sender) > _maxUserHoldAmount()) { _addBotAddressToBlackList(_sender, type(uint256).max); return; } } } } super._transfer(_sender, _recipient, _amount); } /// @dev internal function to add address to blacklist. function _addBotAddressToBlackList(address _botAddress, uint256 _expirationTime) internal { require(_isNotHolderExcludedFromAntiBot(_botAddress), "ERR5"); require(_isNotOperatorExcludedFromAntiBot(_botAddress), "ERR5"); require(_blacklist[_botAddress] == 0, "ERR6"); require(_expirationTime > 0, "ERR7"); _blacklist[_botAddress] = _expirationTime; blacklistLength = blacklistLength.add(1); emit AddBotAddress(_botAddress); } ///@dev internal function to remove address from blacklist. function _removeBotAddressToBlackList(address _botAddress) internal { require(_blacklist[_botAddress] > 0, "ERR8"); delete _blacklist[_botAddress]; blacklistLength = blacklistLength.sub(1); emit RemoveBotAddress(_botAddress); } ///@dev Check if the address is excluded from antibot system. function _isNotHolderExcludedFromAntiBot(address _userAddress) internal view returns(bool) { return(!_excludedHoldersFromAntiBot[_userAddress]); } ///@dev Check if the address is excluded from antibot system. function _isNotOperatorExcludedFromAntiBot(address _userAddress) internal view returns(bool) { return(!_excludedOperatorsFromAntiBot[_userAddress]); } ///@dev Max user transfer allowed function _maxUserTransferAmount() internal view returns (uint256) { return totalSupply().mul(maxUserTransferAmountRate).div(10000); } ///@dev Max user Holding allowed function _maxUserHoldAmount() internal view returns (uint256) { return totalSupply().mul(maxUserHoldAmountRate).div(10000); } ///@dev check if the address is in the blacklist or expired function _blacklistCheck(address _botAddress) internal view returns(bool) { if(_blacklist[_botAddress] > 0) return _blacklist[_botAddress] > block.timestamp; else return false; } // PUBLICS ///@dev Max user transfer allowed function maxUserTransferAmount() external view returns (uint256) { return _maxUserTransferAmount(); } ///@dev Max user Holding allowed function maxUserHoldAmount() external view returns (uint256) { return _maxUserHoldAmount(); } ///@dev check if the address is in the blacklist or expired function blacklistCheck(address _botAddress) external view returns(bool) { return _blacklistCheck(_botAddress); } ///@dev check if the address is in the blacklist or not function blacklistCheckExpirationTime(address _botAddress) external view returns(uint256){ return _blacklist[_botAddress]; } // EXTERNALS ///@dev Update operator address status function updateOperatorsFromAntiBot(address _operatorAddress, bool _status) external onlyOwner { require(_operatorAddress != address(0), "ERR9"); emit ExcludedOperatorsUpdated(_operatorAddress, _excludedOperatorsFromAntiBot[_operatorAddress], _status); _excludedOperatorsFromAntiBot[_operatorAddress] = _status; } ///@dev Update operator address status function updateHoldersFromAntiBot(address _holderAddress, bool _status) external onlyOwner { require(_holderAddress != address(0), "ERR9"); emit ExcludedHoldersUpdated(_holderAddress, _excludedHoldersFromAntiBot[_holderAddress], _status); _excludedHoldersFromAntiBot[_holderAddress] = _status; } ///@dev Update operator address function transferOperator(address newOperator) external onlyOperator { require(newOperator != address(0), "ERR9"); emit OperatorTransferred(_operator, newOperator); _operator = newOperator; } function operator() external view returns (address) { return _operator; } ///@dev Updates the max holding amount. function updateMaxUserHoldAmountRate(uint16 _maxUserHoldAmountRate) external onlyOwner { require(_maxUserHoldAmountRate >= 500); require(_maxUserHoldAmountRate <= 10000); emit TransferTaxRateUpdated(_msgSender(), maxUserHoldAmountRate, _maxUserHoldAmountRate); maxUserHoldAmountRate = _maxUserHoldAmountRate; } ///@dev Updates the max user transfer amount. function updateMaxUserTransferAmountRate(uint16 _maxUserTransferAmountRate) external onlyOwner { require(_maxUserTransferAmountRate >= 50); require(_maxUserTransferAmountRate <= 10000); emit HoldingAmountRateUpdated(_msgSender(), maxUserHoldAmountRate, _maxUserTransferAmountRate); maxUserTransferAmountRate = _maxUserTransferAmountRate; } ///@dev Update the antiBotWorking status: ENABLE|DISABLE. function updateStatusAntiBotWorking(bool _status) external onlyOwner { emit AntiBotWorkingStatus(_msgSender(), antiBotWorking, _status); antiBotWorking = _status; } ///@dev Add an address to the blacklist. Only the owner can add. Owner is the address of the Governance contract. function addBotAddress(address _botAddress, uint256 _expirationTime) external onlyOwner { _addBotAddressToBlackList(_botAddress, _expirationTime); } ///@dev Remove an address from the blacklist. Only the owner can remove. Owner is the address of the Governance contract. function removeBotAddress(address botAddress) external onlyOperator { _removeBotAddressToBlackList(botAddress); } ///@dev Add multi address to the blacklist. Only the owner can add. Owner is the address of the Governance contract. function addBotAddressBatch(address[] memory _addresses, uint256 _expirationTime) external onlyOwner { require(_addresses.length > 0); for(uint i=0;i<_addresses.length;i++){ _addBotAddressToBlackList(_addresses[i], _expirationTime); } } ///@dev Remove multi address from the blacklist. Only the owner can remove. Owner is the address of the Governance contract. function removeBotAddressBatch(address[] memory _addresses) external onlyOperator { require(_addresses.length > 0); for(uint i=0;i<_addresses.length;i++){ _removeBotAddressToBlackList(_addresses[i]); } } ///@dev Check if the address is excluded from antibot system. function isExcludedOperatorFromAntiBot(address _userAddress) external view returns(bool) { return(_excludedOperatorsFromAntiBot[_userAddress]); } ///@dev Check if the address is excluded from antibot system. function isExcludedHolderFromAntiBot(address _userAddress) external view returns(bool) { return(_excludedHoldersFromAntiBot[_userAddress]); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ 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"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ 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"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ 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); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ 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); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ 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 { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @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. * * By default, the owner account will be the one that deploys the contract. 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; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(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 { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @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}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of 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. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * 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. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* * @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; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ 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); }
{ "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract DesireTokenV3","name":"_desire","type":"address"},{"internalType":"address","name":"_feeAddress","type":"address"},{"internalType":"uint256","name":"_desirePerBlock","type":"uint256"},{"internalType":"uint256","name":"_startBlock","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newAmount","type":"uint256"}],"name":"SetEmissionRate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"SetFeeAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newStartBlock","type":"uint256"}],"name":"SetStartBlock","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"address","name":"lpToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"allocPoint","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"depositFeeBP","type":"uint256"}],"name":"addPool","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"address","name":"lpToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"allocPoint","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"depositFeeBP","type":"uint256"}],"name":"setPool","type":"event"},{"inputs":[],"name":"MAX_EMISSION_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"contract IERC20","name":"_lpToken","type":"address"},{"internalType":"uint16","name":"_depositFeeBP","type":"uint16"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"desire","outputs":[{"internalType":"contract DesireTokenV3","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"desireMaximumSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"desirePerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emmissionEndBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_from","type":"uint256"},{"internalType":"uint256","name":"_to","type":"uint256"}],"name":"getMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingDesire","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"name":"poolExistence","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IERC20","name":"lpToken","type":"address"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accDesirePerShare","type":"uint256"},{"internalType":"uint16","name":"depositFeeBP","type":"uint16"},{"internalType":"uint256","name":"lpSupply","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"uint16","name":"_depositFeeBP","type":"uint16"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_desirePerBlock","type":"uint256"}],"name":"setEmissionRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeAddress","type":"address"}],"name":"setFeeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newStartBlock","type":"uint256"}],"name":"setStartBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60a060405260006006557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6008553480156200003a57600080fd5b5060405162003db438038062003db483398181016040528101906200006091906200029b565b62000080620000746200018a60201b60201c565b6200019260201b60201c565b60018081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415620000fa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000f19062000334565b60405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b8152505082600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600281905550806007819055505050505062000435565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000815190506200026781620003e7565b92915050565b6000815190506200027e8162000401565b92915050565b60008151905062000295816200041b565b92915050565b60008060008060808587031215620002b857620002b7620003b9565b5b6000620002c8878288016200026d565b9450506020620002db8782880162000256565b9350506040620002ee8782880162000284565b9250506060620003018782880162000284565b91505092959194509250565b60006200031c60088362000356565b91506200032982620003be565b602082019050919050565b600060208201905081810360008301526200034f816200030d565b9050919050565b600082825260208201905092915050565b600062000374826200038f565b9050919050565b6000620003888262000367565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600080fd5b7f216e6f6e7a65726f000000000000000000000000000000000000000000000000600082015250565b620003f28162000367565b8114620003fe57600080fd5b50565b6200040c816200037b565b81146200041857600080fd5b50565b6200042681620003af565b81146200043257600080fd5b50565b60805160601c6139286200048c600039600081816108ff015281816109b801528181610a6601528181610b2601528181610bbf01528181611661015281816121570152818161220c01526122c001526139286000f3fe608060405234801561001057600080fd5b50600436106101a95760003560e01c80637e7a1a35116100f9578063b5b5604411610097578063d963842211610071578063d96384221461048c578063e2bbb158146104a8578063f2fde38b146104c4578063f35e4a6e146104e0576101a9565b8063b5b560441461040e578063bc5fcd8c1461042c578063cbd258b51461045c576101a9565b80638da5cb5b116100d35780638da5cb5b146103735780638dbb1e3a1461039157806393f1a40b146103c1578063a1bdb15e146103f2576101a9565b80637e7a1a351461031d57806384e82a331461033b5780638705fcd414610357576101a9565b8063436cc3d61161016657806351eb05a61161014057806351eb05a6146102d15780635312ea8e146102ed578063630b5ba114610309578063715018a614610313576101a9565b8063436cc3d614610279578063441a3e701461029757806348cd4cb1146102b3576101a9565b8063081e3eda146101ae5780631526fe27146101cc57806317caf6f1146102015780631af7e8271461021f57806338a2c5811461023d578063412753581461025b575b600080fd5b6101b66104fc565b6040516101c39190613156565b60405180910390f35b6101e660048036038101906101e1919061296c565b610509565b6040516101f896959493929190612ef3565b60405180910390f35b610209610583565b6040516102169190613156565b60405180910390f35b610227610589565b6040516102349190613156565b60405180910390f35b610245610597565b6040516102529190613156565b60405180910390f35b61026361059d565b6040516102709190612e0b565b60405180910390f35b6102816105c3565b60405161028e9190613156565b60405180910390f35b6102b160048036038101906102ac9190612a6d565b6105cf565b005b6102bb61084a565b6040516102c89190613156565b60405180910390f35b6102eb60048036038101906102e6919061296c565b610850565b005b6103076004803603810190610302919061296c565b610ce1565b005b610311610ea4565b005b61031b610ed7565b005b610325610f5f565b6040516103329190613156565b60405180910390f35b61035560048036038101906103509190612a06565b610f65565b005b610371600480360381019061036c91906128e5565b611331565b005b61037b6114bb565b6040516103889190612e0b565b60405180910390f35b6103ab60048036038101906103a69190612a6d565b6114e4565b6040516103b89190613156565b60405180910390f35b6103db60048036038101906103d691906129c6565b61152d565b6040516103e9929190613171565b60405180910390f35b61040c6004803603810190610407919061296c565b61155e565b005b61041661165f565b6040516104239190612ed8565b60405180910390f35b610446600480360381019061044191906129c6565b611683565b6040516104539190613156565b60405180910390f35b6104766004803603810190610471919061293f565b6117e2565b6040516104839190612ebd565b60405180910390f35b6104a660048036038101906104a19190612aad565b611802565b005b6104c260048036038101906104bd9190612a6d565b611a0b565b005b6104de60048036038101906104d991906128e5565b611f0e565b005b6104fa60048036038101906104f5919061296c565b612006565b005b6000600480549050905090565b6004818154811061051957600080fd5b90600052602060002090600602016000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154908060030154908060040160009054906101000a900461ffff16908060050154905086565b60065481565b6969e10de76676d080000081565b60085481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b678ac7230489e8000081565b60026001541415610615576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060c90613136565b60405180910390fd5b60026001819055506000600483815481106106335761063261347d565b5b9060005260206000209060060201905060006005600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905082816000015410156106de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d5906130d6565b60405180910390fd5b6106e784610850565b60008160010154670de0b6b3a76400008460030154846000015461070b9190613253565b6107159190613222565b61071f91906132ad565b90506000811115610735576107343382612153565b5b60008411156107be5783826000015461074e91906132ad565b82600001819055506107a533858560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166123b49092919063ffffffff16565b8383600501546107b591906132ad565b83600501819055505b670de0b6b3a7640000836003015483600001546107db9190613253565b6107e59190613222565b8260010181905550843373ffffffffffffffffffffffffffffffffffffffff167ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568866040516108349190613156565b60405180910390a3505050600180819055505050565b60075481565b6000600482815481106108665761086561347d565b5b90600052602060002090600602019050806002015443116108875750610cde565b60008160050154148061089e575060008160010154145b156108b25743816002018190555050610cde565b60006108c28260020154436114e4565b905060006006548360010154600254846108dc9190613253565b6108e69190613253565b6108f09190613222565b90506969e10de76676d08000007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561096357600080fd5b505afa158015610977573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099b9190612999565b11156109aa5760009050610b1b565b6969e10de76676d0800000817f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610a1c57600080fd5b505afa158015610a30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a549190612999565b610a5e91906131cc565b1115610b1a577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610aca57600080fd5b505afa158015610ade573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b029190612999565b6969e10de76676d0800000610b1791906132ad565b90505b5b6000811115610bb2577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166340c10f1930836040518363ffffffff1660e01b8152600401610b7f929190612e5d565b600060405180830381600087803b158015610b9957600080fd5b505af1158015610bad573d6000803e3d6000fd5b505050505b6969e10de76676d08000007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c2357600080fd5b505afa158015610c37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5b9190612999565b10158015610c8a57507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600854145b15610c9757436008819055505b8260050154670de0b6b3a764000082610cb09190613253565b610cba9190613222565b8360030154610cc991906131cc565b83600301819055504383600201819055505050505b50565b60026001541415610d27576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1e90613136565b60405180910390fd5b6002600181905550600060048281548110610d4557610d4461347d565b5b9060005260206000209060060201905060006005600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000816000015490506000826000018190555060008260010181905550610e1533828560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166123b49092919063ffffffff16565b80836005015410610e3d57808360050154610e3091906132ad565b8360050181905550610e48565b600083600501819055505b833373ffffffffffffffffffffffffffffffffffffffff167fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae059583604051610e8f9190613156565b60405180910390a35050506001808190555050565b6000600480549050905060005b81811015610ed357610ec281610850565b80610ecc906133d6565b9050610eb1565b5050565b610edf61243a565b73ffffffffffffffffffffffffffffffffffffffff16610efd6114bb565b73ffffffffffffffffffffffffffffffffffffffff1614610f53576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f4a90613096565b60405180910390fd5b610f5d6000612442565b565b60025481565b610f6d61243a565b73ffffffffffffffffffffffffffffffffffffffff16610f8b6114bb565b73ffffffffffffffffffffffffffffffffffffffff1614610fe1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd890613096565b60405180910390fd5b82600960008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561106f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611066906130f6565b60405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016110a89190612e0b565b60206040518083038186803b1580156110c057600080fd5b505afa1580156110d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110f89190612999565b506101918361ffff161115611142576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113990612f96565b60405180910390fd5b811561115157611150610ea4565b5b6000600754431161116457600754611166565b435b90508560065461117691906131cc565b6006819055506001600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060046040518060c001604052808773ffffffffffffffffffffffffffffffffffffffff168152602001888152602001838152602001600081526020018661ffff1681526020016000815250908060018154018082558091505060019003906000526020600020906006020160009091909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548161ffff021916908361ffff16021790555060a08201518160050155505060016004805490506112ee91906132ad565b7faa6642278d4bbef86d8990c37355d5d4dfe365c194106bdf7a65162268606f0786888760405161132193929190612e86565b60405180910390a2505050505050565b61133961243a565b73ffffffffffffffffffffffffffffffffffffffff166113576114bb565b73ffffffffffffffffffffffffffffffffffffffff16146113ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a490613096565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561141d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141490613056565b60405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fd44190acf9d04bdb5d3a1aafff7e6dee8b40b93dfb8c5d3f0eea4b9f4539c3f760405160405180910390a350565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60006008548311156114f95760009050611527565b600854821115611518578260085461151191906132ad565b9050611527565b828261152491906132ad565b90505b92915050565b6005602052816000526040600020602052806000526040600020600091509150508060000154908060010154905082565b61156661243a565b73ffffffffffffffffffffffffffffffffffffffff166115846114bb565b73ffffffffffffffffffffffffffffffffffffffff16146115da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115d190613096565b60405180910390fd5b600081116115e757600080fd5b678ac7230489e8000081106115fb57600080fd5b611603610ea4565b806002819055503373ffffffffffffffffffffffffffffffffffffffff167f1d6d701a35096c20378cd75889e191ea7805a050284fffba3bc572d9d354644f60025483604051611654929190613171565b60405180910390a250565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000806004848154811061169a5761169961347d565b5b9060005260206000209060060201905060006005600086815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008260030154905082600201544311801561171f57506000836005015414155b801561172d57506000600654115b156117a55760006117428460020154436114e4565b9050600060065485600101546002548461175c9190613253565b6117669190613253565b6117709190613222565b90508460050154670de0b6b3a76400008261178b9190613253565b6117959190613222565b836117a091906131cc565b925050505b8160010154670de0b6b3a76400008284600001546117c39190613253565b6117cd9190613222565b6117d791906132ad565b935050505092915050565b60096020528060005260406000206000915054906101000a900460ff1681565b61180a61243a565b73ffffffffffffffffffffffffffffffffffffffff166118286114bb565b73ffffffffffffffffffffffffffffffffffffffff161461187e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187590613096565b60405180910390fd5b6101918261ffff1611156118c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118be90613076565b60405180910390fd5b80156118d6576118d5610ea4565b5b82600485815481106118eb576118ea61347d565b5b90600052602060002090600602016001015460065461190a91906132ad565b61191491906131cc565b600681905550826004858154811061192f5761192e61347d565b5b90600052602060002090600602016001018190555081600485815481106119595761195861347d565b5b906000526020600020906006020160040160006101000a81548161ffff021916908361ffff160217905550837f39f0c3d078af018954b4fa56832a05a2b511afaa999b133ea3f1c487c21ed287600486815481106119ba576119b961347d565b5b906000526020600020906006020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685856040516119fd93929190612e86565b60405180910390a250505050565b60026001541415611a51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4890613136565b60405180910390fd5b6002600181905550600060048381548110611a6f57611a6e61347d565b5b9060005260206000209060060201905060006005600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050611adc84610850565b600081600001541115611b395760008160010154670de0b6b3a764000084600301548460000154611b0d9190613253565b611b179190613222565b611b2191906132ad565b90506000811115611b3757611b363382612153565b5b505b6000831115611e835760008260000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401611ba19190612e0b565b60206040518083038186803b158015611bb957600080fd5b505afa158015611bcd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bf19190612999565b9050611c443330868660000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16612506909392919063ffffffff16565b808360000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401611ca29190612e0b565b60206040518083038186803b158015611cba57600080fd5b505afa158015611cce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cf29190612999565b611cfc91906132ad565b935060008411611d41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3890612ff6565b60405180910390fd5b60008360040160009054906101000a900461ffff1661ffff161115611e505760006127108460040160009054906101000a900461ffff1661ffff1686611d879190613253565b611d919190613222565b9050611e04600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828660000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166123b49092919063ffffffff16565b80858460000154611e1591906131cc565b611e1f91906132ad565b836000018190555080858560050154611e3891906131cc565b611e4291906132ad565b846005018190555050611e81565b838260000154611e6091906131cc565b8260000181905550838360050154611e7891906131cc565b83600501819055505b505b670de0b6b3a764000082600301548260000154611ea09190613253565b611eaa9190613222565b8160010181905550833373ffffffffffffffffffffffffffffffffffffffff167f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a1585604051611ef99190613156565b60405180910390a35050600180819055505050565b611f1661243a565b73ffffffffffffffffffffffffffffffffffffffff16611f346114bb565b73ffffffffffffffffffffffffffffffffffffffff1614611f8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f8190613096565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611ffa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ff190612fb6565b60405180910390fd5b61200381612442565b50565b61200e61243a565b73ffffffffffffffffffffffffffffffffffffffff1661202c6114bb565b73ffffffffffffffffffffffffffffffffffffffff1614612082576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161207990613096565b60405180910390fd5b60075443106120c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120bd90613036565b60405180910390fd5b804310612108576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120ff90612f76565b60405180910390fd5b8060078190555061211761258f565b7f63b90b79f11a0f132bcb2c4a4ddd44abda45c1308a83b2919318df7f5f8b7be46007546040516121489190613156565b60405180910390a150565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016121ae9190612e0b565b60206040518083038186803b1580156121c657600080fd5b505afa1580156121da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121fe9190612999565b90506000818311156122be577f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85846040518363ffffffff1660e01b8152600401612265929190612e5d565b602060405180830381600087803b15801561227f57600080fd5b505af1158015612293573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122b79190612912565b905061236e565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040518363ffffffff1660e01b8152600401612319929190612e5d565b602060405180830381600087803b15801561233357600080fd5b505af1158015612347573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236b9190612912565b90505b806123ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123a590613016565b60405180910390fd5b50505050565b6124358363a9059cbb60e01b84846040516024016123d3929190612e5d565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506125e5565b505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b612589846323b872dd60e01b85858560405160240161252793929190612e26565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506125e5565b50505050565b6000600480549050905060005b818110156125e157600754600482815481106125bb576125ba61347d565b5b906000526020600020906006020160020181905550806125da906133d6565b905061259c565b5050565b6000612647826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166126ac9092919063ffffffff16565b90506000815111156126a757808060200190518101906126679190612912565b6126a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161269d90613116565b60405180910390fd5b5b505050565b60606126bb84846000856126c4565b90509392505050565b606082471015612709576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270090612fd6565b60405180910390fd5b612712856127d8565b612751576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612748906130b6565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161277a9190612df4565b60006040518083038185875af1925050503d80600081146127b7576040519150601f19603f3d011682016040523d82523d6000602084013e6127bc565b606091505b50915091506127cc8282866127eb565b92505050949350505050565b600080823b905060008111915050919050565b606083156127fb5782905061284b565b60008351111561280e5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128429190612f54565b60405180910390fd5b9392505050565b6000813590506128618161387f565b92915050565b60008135905061287681613896565b92915050565b60008151905061288b81613896565b92915050565b6000813590506128a0816138ad565b92915050565b6000813590506128b5816138c4565b92915050565b6000813590506128ca816138db565b92915050565b6000815190506128df816138db565b92915050565b6000602082840312156128fb576128fa6134ac565b5b600061290984828501612852565b91505092915050565b600060208284031215612928576129276134ac565b5b60006129368482850161287c565b91505092915050565b600060208284031215612955576129546134ac565b5b600061296384828501612891565b91505092915050565b600060208284031215612982576129816134ac565b5b6000612990848285016128bb565b91505092915050565b6000602082840312156129af576129ae6134ac565b5b60006129bd848285016128d0565b91505092915050565b600080604083850312156129dd576129dc6134ac565b5b60006129eb858286016128bb565b92505060206129fc85828601612852565b9150509250929050565b60008060008060808587031215612a2057612a1f6134ac565b5b6000612a2e878288016128bb565b9450506020612a3f87828801612891565b9350506040612a50878288016128a6565b9250506060612a6187828801612867565b91505092959194509250565b60008060408385031215612a8457612a836134ac565b5b6000612a92858286016128bb565b9250506020612aa3858286016128bb565b9150509250929050565b60008060008060808587031215612ac757612ac66134ac565b5b6000612ad5878288016128bb565b9450506020612ae6878288016128bb565b9350506040612af7878288016128a6565b9250506060612b0887828801612867565b91505092959194509250565b612b1d816132e1565b82525050565b612b2c816132f3565b82525050565b6000612b3d8261319a565b612b4781856131b0565b9350612b578185602086016133a3565b80840191505092915050565b612b6c81613349565b82525050565b612b7b8161336d565b82525050565b6000612b8c826131a5565b612b9681856131bb565b9350612ba68185602086016133a3565b612baf816134b1565b840191505092915050565b6000612bc76022836131bb565b9150612bd2826134c2565b604082019050919050565b6000612bea6025836131bb565b9150612bf582613511565b604082019050919050565b6000612c0d6026836131bb565b9150612c1882613560565b604082019050919050565b6000612c306026836131bb565b9150612c3b826135af565b604082019050919050565b6000612c536021836131bb565b9150612c5e826135fe565b604082019050919050565b6000612c766023836131bb565b9150612c818261364d565b604082019050919050565b6000612c996037836131bb565b9150612ca48261369c565b604082019050919050565b6000612cbc6008836131bb565b9150612cc7826136eb565b602082019050919050565b6000612cdf6025836131bb565b9150612cea82613714565b604082019050919050565b6000612d026020836131bb565b9150612d0d82613763565b602082019050919050565b6000612d25601d836131bb565b9150612d308261378c565b602082019050919050565b6000612d486012836131bb565b9150612d53826137b5565b602082019050919050565b6000612d6b6019836131bb565b9150612d76826137de565b602082019050919050565b6000612d8e602a836131bb565b9150612d9982613807565b604082019050919050565b6000612db1601f836131bb565b9150612dbc82613856565b602082019050919050565b612dd081613311565b82525050565b612ddf81613391565b82525050565b612dee8161333f565b82525050565b6000612e008284612b32565b915081905092915050565b6000602082019050612e206000830184612b14565b92915050565b6000606082019050612e3b6000830186612b14565b612e486020830185612b14565b612e556040830184612de5565b949350505050565b6000604082019050612e726000830185612b14565b612e7f6020830184612de5565b9392505050565b6000606082019050612e9b6000830186612b14565b612ea86020830185612de5565b612eb56040830184612dd6565b949350505050565b6000602082019050612ed26000830184612b23565b92915050565b6000602082019050612eed6000830184612b63565b92915050565b600060c082019050612f086000830189612b72565b612f156020830188612de5565b612f226040830187612de5565b612f2f6060830186612de5565b612f3c6080830185612dc7565b612f4960a0830184612de5565b979650505050505050565b60006020820190508181036000830152612f6e8184612b81565b905092915050565b60006020820190508181036000830152612f8f81612bba565b9050919050565b60006020820190508181036000830152612faf81612bdd565b9050919050565b60006020820190508181036000830152612fcf81612c00565b9050919050565b60006020820190508181036000830152612fef81612c23565b9050919050565b6000602082019050818103600083015261300f81612c46565b9050919050565b6000602082019050818103600083015261302f81612c69565b9050919050565b6000602082019050818103600083015261304f81612c8c565b9050919050565b6000602082019050818103600083015261306f81612caf565b9050919050565b6000602082019050818103600083015261308f81612cd2565b9050919050565b600060208201905081810360008301526130af81612cf5565b9050919050565b600060208201905081810360008301526130cf81612d18565b9050919050565b600060208201905081810360008301526130ef81612d3b565b9050919050565b6000602082019050818103600083015261310f81612d5e565b9050919050565b6000602082019050818103600083015261312f81612d81565b9050919050565b6000602082019050818103600083015261314f81612da4565b9050919050565b600060208201905061316b6000830184612de5565b92915050565b60006040820190506131866000830185612de5565b6131936020830184612de5565b9392505050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006131d78261333f565b91506131e28361333f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132175761321661341f565b5b828201905092915050565b600061322d8261333f565b91506132388361333f565b9250826132485761324761344e565b5b828204905092915050565b600061325e8261333f565b91506132698361333f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132a2576132a161341f565b5b828202905092915050565b60006132b88261333f565b91506132c38361333f565b9250828210156132d6576132d561341f565b5b828203905092915050565b60006132ec8261331f565b9050919050565b60008115159050919050565b600061330a826132e1565b9050919050565b600061ffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006133548261335b565b9050919050565b60006133668261331f565b9050919050565b60006133788261337f565b9050919050565b600061338a8261331f565b9050919050565b600061339c82613311565b9050919050565b60005b838110156133c15780820151818401526020810190506133a6565b838111156133d0576000848401525b50505050565b60006133e18261333f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156134145761341361341f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f63616e6e6f742073657420737461727420626c6f636b20696e2074686520706160008201527f7374000000000000000000000000000000000000000000000000000000000000602082015250565b7f6164643a20696e76616c6964206465706f73697420666565206261736973207060008201527f6f696e7473000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f776520646f6e7420616363657074206465706f73697473206f6620302073697a60008201527f6500000000000000000000000000000000000000000000000000000000000000602082015250565b7f736166654465736972655472616e736665723a207472616e736665722066616960008201527f6c65640000000000000000000000000000000000000000000000000000000000602082015250565b7f63616e6e6f74206368616e676520737461727420626c6f636b2069662073616c60008201527f652068617320616c726561647920636f6d6d656e636564000000000000000000602082015250565b7f216e6f6e7a65726f000000000000000000000000000000000000000000000000600082015250565b7f7365743a20696e76616c6964206465706f73697420666565206261736973207060008201527f6f696e7473000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f77697468647261773a206e6f7420676f6f640000000000000000000000000000600082015250565b7f6e6f6e4475706c6963617465643a206475706c69636174656400000000000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b613888816132e1565b811461389357600080fd5b50565b61389f816132f3565b81146138aa57600080fd5b50565b6138b6816132ff565b81146138c157600080fd5b50565b6138cd81613311565b81146138d857600080fd5b50565b6138e48161333f565b81146138ef57600080fd5b5056fea2646970667358221220a86d7779b13febb13b9f4b4ce5a21e0a63ac422b43fc78c49ac2c32a4461d5c964736f6c63430008060033000000000000000000000000fbbea521578059d8c2d53899e44c5a68b8ee88d80000000000000000000000006ce07b7ee17c3231987a5bf377487ff801608f630000000000000000000000000000000000000000000000000c901f4c072f8500000000000000000000000000000000000000000000000000000000000153b0da
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000fbbea521578059d8c2d53899e44c5a68b8ee88d80000000000000000000000006ce07b7ee17c3231987a5bf377487ff801608f630000000000000000000000000000000000000000000000000c901f4c072f8500000000000000000000000000000000000000000000000000000000000153b0da
-----Decoded View---------------
Arg [0] : _desire (address): 0xfbbea521578059d8c2d53899e44c5a68b8ee88d8
Arg [1] : _feeAddress (address): 0x6ce07b7ee17c3231987a5bf377487ff801608f63
Arg [2] : _desirePerBlock (uint256): 905257936500000000
Arg [3] : _startBlock (uint256): 22261978
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000fbbea521578059d8c2d53899e44c5a68b8ee88d8
Arg [1] : 0000000000000000000000006ce07b7ee17c3231987a5bf377487ff801608f63
Arg [2] : 0000000000000000000000000000000000000000000000000c901f4c072f8500
Arg [3] : 000000000000000000000000000000000000000000000000000000000153b0da
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.