More Info
Private Name Tags
ContractCreator
Multichain Info
No addresses found
Latest 25 from a total of 396 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Withdraw | 17044583 | 30 hrs ago | IN | 0 S | 0.00617741 | ||||
Claim Rewards | 17042139 | 30 hrs ago | IN | 0 S | 0.0029623 | ||||
Claim Rewards | 17035475 | 31 hrs ago | IN | 0 S | 0.00343447 | ||||
Claim Rewards | 16963929 | 39 hrs ago | IN | 0 S | 0.00343447 | ||||
Withdraw | 16952039 | 40 hrs ago | IN | 0 S | 0.00716378 | ||||
Claim Rewards | 16951829 | 40 hrs ago | IN | 0 S | 0.00343509 | ||||
Withdraw | 16944270 | 41 hrs ago | IN | 0 S | 0.00716307 | ||||
Withdraw | 16929515 | 43 hrs ago | IN | 0 S | 0.00617741 | ||||
Withdraw | 16926288 | 43 hrs ago | IN | 0 S | 0.00617801 | ||||
Withdraw | 16900360 | 46 hrs ago | IN | 0 S | 0.00635879 | ||||
Withdraw | 16900170 | 46 hrs ago | IN | 0 S | 0.00742646 | ||||
Withdraw | 16893909 | 46 hrs ago | IN | 0 S | 0.00686834 | ||||
Withdraw | 16889821 | 47 hrs ago | IN | 0 S | 0.00635991 | ||||
Withdraw | 16889527 | 47 hrs ago | IN | 0 S | 0.00643875 | ||||
Withdraw | 16887758 | 47 hrs ago | IN | 0 S | 0.00716177 | ||||
Withdraw | 16877712 | 2 days ago | IN | 0 S | 0.00617801 | ||||
Withdraw | 16877499 | 2 days ago | IN | 0 S | 0.00700476 | ||||
Claim Rewards | 16877470 | 2 days ago | IN | 0 S | 0.00343572 | ||||
Claim Rewards | 16877407 | 2 days ago | IN | 0 S | 0.0029623 | ||||
Withdraw | 16873920 | 2 days ago | IN | 0 S | 0.00617358 | ||||
Withdraw | 16867584 | 2 days ago | IN | 0 S | 0.00643941 | ||||
Withdraw | 16866583 | 2 days ago | IN | 0 S | 0.00716177 | ||||
Withdraw | 16866157 | 2 days ago | IN | 0 S | 0.00624455 | ||||
Claim Rewards | 16860452 | 2 days ago | IN | 0 S | 0.00343509 | ||||
Set Tax Rate | 16860224 | 2 days ago | IN | 0 S | 0.00163383 |
Loading...
Loading
Contract Name:
LuxFarm
Compiler Version
v0.7.5+commit.eb77ed08
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; import "./lib/SafeMath.sol"; import "./lib/Address.sol"; import "./lib/SafeERC20.sol"; import "./lib/OwnableManagement.sol"; import "./lib/IERC20.sol"; import "./lib/IERC20Mintable.sol"; import "./lib/ReentrancyGuard.sol"; /** * @title LuxFarm * @notice Contract for staking any ERC20 token to earn LUX rewards * @dev Users can deposit tokens to earn LUX rewards based on their contribution */ contract LuxFarm is OwnableManagement, ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; // Tokens address public immutable farmToken; address public immutable lux; // Tax configuration address public taxReceiver; uint public taxOnWithdraw = 300; // 3% default, can be changed up to 15% // Farm state uint public totalStaked; // Total tokens staked in farm bool public rewardsEnabled = true; // Flag to enable/disable rewards uint public rewardsDisabledAt; // Timestamp when rewards were disabled // User data mapping(address => uint) public userDeposits; // User's token deposits mapping(address => uint) public lastClaimTime; // Last time user claimed farm rewards // Reward rate uint public dailyRewardRate; // Daily LUX reward rate // Constants uint public constant BASIS_POINTS = 10000; // Added constant for basis points uint public constant ONE_DAY = 1 days; // One day in seconds // Events event Deposit(address indexed user, uint amount); event Withdraw(address indexed user, uint amount, uint tax, uint claimedRewards); event ClaimRewards(address indexed user, uint amount); event TaxRateChanged(uint newTaxRate); event TaxReceiverChanged(address newTaxReceiver); event RewardRateChanged(uint newRewardRate); event RewardsDisabled(uint timestamp); event RewardsEnabled(uint timestamp); /** * @notice Constructor * @param _farmToken Deposit token address * @param _lux LUX token address * @param _taxReceiver Address to receive withdrawal taxes * @param _dailyRewardRate Daily reward rate in LUX tokens */ constructor( address _farmToken, address _lux, address _taxReceiver, uint _dailyRewardRate ) { require(_farmToken != address(0), "Invalid deposit token address"); require(_lux != address(0), "Invalid LUX address"); require(_taxReceiver != address(0), "Invalid tax receiver address"); require(_dailyRewardRate > 0, "Invalid reward rate"); farmToken = _farmToken; lux = _lux; taxReceiver = _taxReceiver; dailyRewardRate = _dailyRewardRate; } /** * @notice Set the tax rate for farm withdrawals * @param _taxRate New tax rate (in basis points, e.g. 300 = 3%) */ function setTaxRate(uint _taxRate) external onlyManager { require(_taxRate <= 1500, "Tax cannot exceed 15%"); taxOnWithdraw = _taxRate; emit TaxRateChanged(_taxRate); } /** * @notice Set the tax receiver address * @param _taxReceiver New tax receiver address */ function setTaxReceiver(address _taxReceiver) external onlyManager { require(_taxReceiver != address(0), "Invalid tax receiver address"); taxReceiver = _taxReceiver; emit TaxReceiverChanged(_taxReceiver); } /** * @notice Set the daily reward rate * @param _dailyRewardRate New daily reward rate in LUX tokens */ function setDailyRewardRate(uint _dailyRewardRate) external onlyManager { require(_dailyRewardRate > 0, "Invalid reward rate"); dailyRewardRate = _dailyRewardRate; emit RewardRateChanged(_dailyRewardRate); } /** * @notice Disable rewards for all users * @dev Users can still claim existing rewards accrued up to this point */ function disableRewards() external onlyManager { require(rewardsEnabled, "Rewards already disabled"); rewardsEnabled = false; rewardsDisabledAt = block.timestamp; emit RewardsDisabled(block.timestamp); } /** * @notice Enable rewards for all users * @dev Allows rewards to start accruing again from this point forward */ function enableRewards() external onlyManager { require(!rewardsEnabled, "Rewards already enabled"); rewardsEnabled = true; rewardsDisabledAt = 0; emit RewardsEnabled(block.timestamp); } /** * @notice Internal function to claim rewards for a user * @dev Updates last claim time and mints LUX rewards if any * @param _user Address of the user claiming rewards * @return uint Amount of LUX claimed */ function _claimRewards(address _user) internal returns (uint) { uint claimedRewards = 0; if (lastClaimTime[_user] > 0 && userDeposits[_user] > 0) { claimedRewards = calculateRewards(_user); if (claimedRewards > 0) { // Mint LUX directly to user IERC20Mintable(lux).mint(_user, claimedRewards); emit ClaimRewards(_user, claimedRewards); } } // Always update the last claim time lastClaimTime[_user] = block.timestamp; return claimedRewards; } /** * @notice Deposit tokens to the farm to earn LUX rewards * @param _amount Amount of tokens to deposit * @return bool Success indicator */ function deposit(uint _amount) external nonReentrant returns (bool) { require(_amount > 0, "Cannot deposit 0"); // Auto-claim rewards before deposit _claimRewards(msg.sender); // Update deposit amount userDeposits[msg.sender] = userDeposits[msg.sender].add(_amount); // Update total staked amount totalStaked = totalStaked.add(_amount); // Transfer tokens from user to contract IERC20(farmToken).safeTransferFrom(msg.sender, address(this), _amount); emit Deposit(msg.sender, _amount); return true; } /** * @notice Withdraw tokens from the farm with tax applied and auto-claim rewards * @param _amount Amount of tokens to withdraw * @return bool Success indicator */ function withdraw(uint _amount) external nonReentrant returns (bool) { require(_amount > 0, "Cannot withdraw 0"); require(userDeposits[msg.sender] >= _amount, "Insufficient deposit"); // Auto-claim rewards before withdrawal uint claimedRewards = _claimRewards(msg.sender); // Apply tax on withdrawal uint tax = _amount.mul(taxOnWithdraw).div(BASIS_POINTS); uint amountAfterTax = _amount.sub(tax); // Update deposit record userDeposits[msg.sender] = userDeposits[msg.sender].sub(_amount); // Update total staked amount totalStaked = totalStaked.sub(_amount); // Transfer tokens back to user after tax IERC20(farmToken).safeTransfer(msg.sender, amountAfterTax); // Transfer tax to tax receiver if (tax > 0) { IERC20(farmToken).safeTransfer(taxReceiver, tax); } emit Withdraw(msg.sender, _amount, tax, claimedRewards); return true; } /** * @notice Calculate rewards from deposits for a user based on time since last claim * @param _user Address of the user * @return uint Rewards */ function calculateRewards(address _user) public view returns (uint) { uint claimTime = lastClaimTime[_user]; if (claimTime == 0) { return 0; } if (totalStaked == 0 || userDeposits[_user] == 0) return 0; uint timeEnd; if (!rewardsEnabled && rewardsDisabledAt > 0) { // If rewards are disabled, only calculate rewards up to the disabled timestamp timeEnd = rewardsDisabledAt < claimTime ? claimTime : rewardsDisabledAt; } else { timeEnd = block.timestamp; } uint timeElapsed = timeEnd.sub(claimTime); uint timeRatio = timeElapsed.mul(BASIS_POINTS).div(ONE_DAY); return userDeposits[_user].mul(dailyRewardRate).mul(timeRatio) .div(totalStaked).div(BASIS_POINTS); } /** * @notice Claim and withdraw LUX rewards from deposits * @dev Calculates rewards based on time since last claim, transfers them to user * @return uint Amount of LUX claimed */ function claimRewards() external nonReentrant returns (uint) { require(userDeposits[msg.sender] > 0, "Must have deposits"); uint reward = _claimRewards(msg.sender); require(reward > 0, "No rewards to claim"); return reward; } /** * @notice Get the last time a user claimed rewards * @param _user Address of the user * @return uint Timestamp of last claim */ function getLastClaimTime(address _user) external view returns (uint) { return lastClaimTime[_user]; } /** * @notice Emergency function to recover tokens accidentally sent to the contract * @param _token Address of the token to recover * @param _amount Amount of tokens to recover */ function recoverERC20(address _token, uint256 _amount) external onlyManager { require(_token != farmToken, "Cannot withdraw staked tokens"); IERC20(_token).safeTransfer(manager(), _amount); } }
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; 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 in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly 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} */ function sendValue(address payable recipient, uint256 amount) internal { require( address(this).balance >= amount, "Address: insufficient balance" ); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (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). * * 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"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{value: value}( data ); return _verifyCallResult(success, returndata, errorMessage); } function _functionCallWithValue( address target, bytes memory data, uint256 weiValue, string memory errorMessage ) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{value: weiValue}( data ); 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 // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(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"); // solhint-disable-next-line avoid-low-level-calls (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.3._ */ 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.3._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (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 // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } function addressToString( address _address ) internal pure returns (string memory) { bytes32 _bytes = bytes32(uint256(_address)); bytes memory HEX = "0123456789abcdef"; bytes memory _addr = new bytes(42); _addr[0] = "0"; _addr[1] = "x"; for (uint256 i = 0; i < 20; i++) { _addr[2 + i * 2] = HEX[uint8(_bytes[i + 12] >> 4)]; _addr[3 + i * 2] = HEX[uint8(_bytes[i + 12] & 0x0f)]; } return string(_addr); } }
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; interface IERC20 { function decimals() external view returns (uint8); /** * @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: AGPL-3.0-or-later pragma solidity 0.7.5; interface IERC20Mintable { function mint(address account, uint256 amount) external; }
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; interface IOwnableManagement { function manager() external view returns (address); function renounceManagement() external; function pushManagement(address newOwner_) external; function pullManagement() external; }
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; import "./IOwnableManagement.sol"; contract OwnableManagement is IOwnableManagement { address internal _owner; address internal _newOwner; event OwnershipPushed(address indexed previousOwner, address indexed newOwner); event OwnershipPulled(address indexed previousOwner, address indexed newOwner); constructor () { _owner = msg.sender; emit OwnershipPushed( address(0), _owner ); } function manager() public view override returns (address) { return _owner; } modifier onlyManager() { require( _owner == msg.sender, "Ownable: caller is not the owner" ); _; } function renounceManagement() public virtual override onlyManager() { emit OwnershipPushed( _owner, address(0) ); _owner = address(0); } function pushManagement( address newOwner_ ) public virtual override onlyManager() { require( newOwner_ != address(0), "Ownable: new owner is the zero address"); emit OwnershipPushed( _owner, newOwner_ ); _newOwner = newOwner_; } function pullManagement() public virtual override { require( msg.sender == _newOwner, "Ownable: must be new owner to pull"); emit OwnershipPulled( _owner, _newOwner ); _owner = _newOwner; } }
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; /** * @title ReentrancyGuard * @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. */ 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 making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _status will be _NOT_ENTERED 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; } }
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; import "./SafeMath.sol"; import "./Address.sol"; import "./IERC20.sol"; library SafeERC20 { using SafeMath for uint256; 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)); } 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' // solhint-disable-next-line max-line-length 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).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); 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. // A Solidity high level call has three parts: // 1. The target address is checked to verify it contains contract code // 2. The call itself is made, and success asserted // 3. The return value is decoded, which in turn checks the size of the returned data. // solhint-disable-next-line max-line-length require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function add32(uint32 a, uint32 b) internal pure returns (uint32) { uint32 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function sub32(uint32 a, uint32 b) internal pure returns (uint32) { return sub32(a, b, "SafeMath: subtraction overflow"); } function sub32( uint32 a, uint32 b, string memory errorMessage ) internal pure returns (uint32) { require(b <= a, errorMessage); uint32 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function mul32(uint32 a, uint32 b) internal pure returns (uint32) { if (a == 0) { return 0; } uint32 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } function sqrrt(uint256 a) internal pure returns (uint c) { if (a > 3) { c = a; uint b = add(div(a, 2), 1); while (b < c) { c = b; b = div(add(div(a, b), b), 2); } } else if (a != 0) { c = 1; } } function percentageAmount( uint256 total_, uint8 percentage_ ) internal pure returns (uint256 percentAmount_) { return div(mul(total_, percentage_), 1000); } function substractPercentage( uint256 total_, uint8 percentageToSub_ ) internal pure returns (uint256 result_) { return sub(total_, div(mul(total_, percentageToSub_), 1000)); } function percentageOfTotal( uint256 part_, uint256 total_ ) internal pure returns (uint256 percent_) { return div(mul(part_, 100), total_); } function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow, so we distribute return (a / 2) + (b / 2) + (((a % 2) + (b % 2)) / 2); } function quadraticPricing( uint256 payment_, uint256 multiplier_ ) internal pure returns (uint256) { return sqrrt(mul(multiplier_, payment_)); } function bondingCurve( uint256 supply_, uint256 multiplier_ ) internal pure returns (uint256) { return mul(multiplier_, supply_); } }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_farmToken","type":"address"},{"internalType":"address","name":"_lux","type":"address"},{"internalType":"address","name":"_taxReceiver","type":"address"},{"internalType":"uint256","name":"_dailyRewardRate","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ClaimRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipPulled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipPushed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newRewardRate","type":"uint256"}],"name":"RewardRateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"RewardsDisabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"RewardsEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newTaxRate","type":"uint256"}],"name":"TaxRateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newTaxReceiver","type":"address"}],"name":"TaxReceiverChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tax","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"claimedRewards","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"BASIS_POINTS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ONE_DAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"calculateRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dailyRewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"disableRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"farmToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getLastClaimTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastClaimTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lux","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"manager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pullManagement","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner_","type":"address"}],"name":"pushManagement","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceManagement","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardsDisabledAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardsEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_dailyRewardRate","type":"uint256"}],"name":"setDailyRewardRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_taxRate","type":"uint256"}],"name":"setTaxRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_taxReceiver","type":"address"}],"name":"setTaxReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"taxOnWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"taxReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userDeposits","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60c060405261012c6004556006805460ff1916600117905534801561002357600080fd5b50604051611ced380380611ced8339818101604052608081101561004657600080fd5b5080516020820151604080840151606090940151600080546001600160a01b031916331780825592519495939491926001600160a01b0316917fea8258f2d9ddb679928cf34b78cf645b7feda9acc828e4dd82d014eaae270eba908290a360016002556001600160a01b038416610104576040805162461bcd60e51b815260206004820152601d60248201527f496e76616c6964206465706f73697420746f6b656e2061646472657373000000604482015290519081900360640190fd5b6001600160a01b03831661015f576040805162461bcd60e51b815260206004820152601360248201527f496e76616c6964204c5558206164647265737300000000000000000000000000604482015290519081900360640190fd5b6001600160a01b0382166101ba576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c696420746178207265636569766572206164647265737300000000604482015290519081900360640190fd5b6000811161020f576040805162461bcd60e51b815260206004820152601360248201527f496e76616c696420726577617264207261746500000000000000000000000000604482015290519081900360640190fd5b606084811b6001600160601b03199081166080529084901b1660a052600380546001600160a01b0319166001600160a01b03938416179055600a559182169116611a686102856000398061040852806113a452508061069652806106d45280610bd25280610e8752806110055250611a686000f3fe608060405234801561001057600080fd5b50600436106101b95760003560e01c80638df25170116100f9578063c2442f9311610097578063e1f1c4a711610071578063e1f1c4a7146103e6578063e6ef73d6146103ee578063ec562987146103f6578063f4426766146103fe576101b9565b8063c2442f931461039b578063c6d69a30146103a3578063cd8de42c146103c0576101b9565b8063b6b55f25116100d3578063b6b55f2514610348578063b77cf9c614610365578063bc1786281461038b578063c1e3d2dd14610393576101b9565b80638df25170146102fd578063a680e0bc1461031a578063b2d9bbfe14610340576101b9565b806346f68ee91161016657806364ab86751161014057806364ab86751461029b578063817b1cd2146102c1578063863e76db146102c95780638980f11f146102d1576101b9565b806346f68ee914610265578063481c6a751461028b5780635a96ac0a14610293576101b9565b80631dafe16b116101975780631dafe16b146102245780632e1a7d4d14610240578063372500ab1461025d576101b9565b80630741ed67146101be578063089208d8146101e25780630ba36dcd146101ec575b600080fd5b6101c6610406565b604080516001600160a01b039092168252519081900360200190f35b6101ea61042a565b005b6102126004803603602081101561020257600080fd5b50356001600160a01b03166104e0565b60408051918252519081900360200190f35b61022c6104f2565b604080519115158252519081900360200190f35b61022c6004803603602081101561025657600080fd5b50356104fb565b610212610751565b6101ea6004803603602081101561027b57600080fd5b50356001600160a01b031661087b565b6101c6610987565b6101ea610996565b610212600480360360208110156102b157600080fd5b50356001600160a01b0316610a4d565b610212610b64565b610212610b6a565b6101ea600480360360408110156102e757600080fd5b506001600160a01b038135169060200135610b71565b6101ea6004803603602081101561031357600080fd5b5035610c77565b6102126004803603602081101561033057600080fd5b50356001600160a01b0316610d66565b610212610d81565b61022c6004803603602081101561035e57600080fd5b5035610d87565b6102126004803603602081101561037b57600080fd5b50356001600160a01b0316610ef1565b6101ea610f03565b610212610ffd565b6101c6611003565b6101ea600480360360208110156103b957600080fd5b5035611027565b6101ea600480360360208110156103d657600080fd5b50356001600160a01b0316611118565b610212611233565b6101c6611239565b610212611248565b6101ea61124e565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000546001600160a01b03163314610489576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907fea8258f2d9ddb679928cf34b78cf645b7feda9acc828e4dd82d014eaae270eba908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60086020526000908152604090205481565b60065460ff1681565b6000600280541415610554576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60028055816105aa576040805162461bcd60e51b815260206004820152601160248201527f43616e6e6f742077697468647261772030000000000000000000000000000000604482015290519081900360640190fd5b3360009081526008602052604090205482111561060e576040805162461bcd60e51b815260206004820152601460248201527f496e73756666696369656e74206465706f736974000000000000000000000000604482015290519081900360640190fd5b60006106193361134c565b9050600061063e6127106106386004548761149290919063ffffffff16565b906114f4565b9050600061064c8583611536565b336000908152600860205260409020549091506106699086611536565b336000908152600860205260409020556005546106869086611536565b6005556106bd6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163383611578565b81156106fd576003546106fd906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911684611578565b6040805186815260208101849052808201859052905133917f02f25270a4d87bea75db541cdfe559334a275b4a233520ed6c0a2429667cca94919081900360600190a2600193505050506001600255919050565b60006002805414156107aa576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600280553360009081526008602052604090205461080f576040805162461bcd60e51b815260206004820152601260248201527f4d7573742068617665206465706f736974730000000000000000000000000000604482015290519081900360640190fd5b600061081a3361134c565b905060008111610871576040805162461bcd60e51b815260206004820152601360248201527f4e6f207265776172647320746f20636c61696d00000000000000000000000000604482015290519081900360640190fd5b9050600160025590565b6000546001600160a01b031633146108da576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811661091f5760405162461bcd60e51b81526004018080602001828103825260268152602001806119a06026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917fea8258f2d9ddb679928cf34b78cf645b7feda9acc828e4dd82d014eaae270eba91a36001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6000546001600160a01b031690565b6001546001600160a01b031633146109df5760405162461bcd60e51b81526004018080602001828103825260228152602001806119c66022913960400191505060405180910390fd5b600154600080546040516001600160a01b0393841693909116917faa151555690c956fc3ea32f106bb9f119b5237a061eaa8557cff3e51e3792c8d91a36001546000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909216919091179055565b6001600160a01b03811660009081526009602052604081205480610a75576000915050610b5f565b6005541580610a9a57506001600160a01b038316600090815260086020526040902054155b15610aa9576000915050610b5f565b60065460009060ff16158015610ac157506000600754115b15610ae0578160075410610ad757600754610ad9565b815b9050610ae3565b50425b6000610aef8284611536565b90506000610b066201518061063884612710611492565b9050610b5861271061063860055461063885610b52600a54600860008f6001600160a01b03166001600160a01b031681526020019081526020016000205461149290919063ffffffff16565b90611492565b9450505050505b919050565b60055481565b6201518081565b6000546001600160a01b03163314610bd0576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415610c57576040805162461bcd60e51b815260206004820152601d60248201527f43616e6e6f74207769746864726177207374616b656420746f6b656e73000000604482015290519081900360640190fd5b610c73610c62610987565b6001600160a01b0384169083611578565b5050565b6000546001600160a01b03163314610cd6576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60008111610d2b576040805162461bcd60e51b815260206004820152601360248201527f496e76616c696420726577617264207261746500000000000000000000000000604482015290519081900360640190fd5b600a8190556040805182815290517f1e3be2efa25bca5bff2215c7b30b31086e703d6aa7d9b9a1f8ba62c5291219ad9181900360200190a150565b6001600160a01b031660009081526009602052604090205490565b60045481565b6000600280541415610de0576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002805581610e36576040805162461bcd60e51b815260206004820152601060248201527f43616e6e6f74206465706f736974203000000000000000000000000000000000604482015290519081900360640190fd5b610e3f3361134c565b5033600090815260086020526040902054610e5a90836115fd565b33600090815260086020526040902055600554610e7790836115fd565b600555610eaf6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333085611657565b60408051838152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a250600180600255919050565b60096020526000908152604090205481565b6000546001600160a01b03163314610f62576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60065460ff16610fb9576040805162461bcd60e51b815260206004820152601860248201527f5265776172647320616c72656164792064697361626c65640000000000000000604482015290519081900360640190fd5b6006805460ff1916905542600781905560408051918252517f386896cd0d8097415f68e3bbb255e95042dc54bdad93308a4fa52045d341f9079181900360200190a1565b600a5481565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000546001600160a01b03163314611086576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6105dc8111156110dd576040805162461bcd60e51b815260206004820152601560248201527f5461782063616e6e6f7420657863656564203135250000000000000000000000604482015290519081900360640190fd5b60048190556040805182815290517fbe89dc2f9769e9896808a0f0983380fed3225e0784b99b98d3eec9ccb50185289181900360200190a150565b6000546001600160a01b03163314611177576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166111d2576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c696420746178207265636569766572206164647265737300000000604482015290519081900360640190fd5b600380546001600160a01b03831673ffffffffffffffffffffffffffffffffffffffff19909116811790915560408051918252517f6224532ae86e8a3e8c09a66cda6903a58238d0425f916e382008c4d3211da0249181900360200190a150565b61271081565b6003546001600160a01b031681565b60075481565b6000546001600160a01b031633146112ad576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60065460ff1615611305576040805162461bcd60e51b815260206004820152601760248201527f5265776172647320616c726561647920656e61626c6564000000000000000000604482015290519081900360640190fd5b6006805460ff1916600117905560006007556040805142815290517fd4f3d8ab0661c5947b6210340137d899c37ec0da59baaa1d9e8a643e5d4f1cfd9181900360200190a1565b6001600160a01b03811660009081526009602052604081205481901580159061138c57506001600160a01b03831660009081526008602052604090205415155b156114715761139a83610a4d565b90508015611471577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166340c10f1984836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561141957600080fd5b505af115801561142d573d6000803e3d6000fd5b50506040805184815290516001600160a01b03871693507f1f89f96333d3133000ee447473151fa9606543368f02271c9d95ae14f13bcc6792509081900360200190a25b6001600160a01b039290921660009081526009602052604090204290555090565b6000826114a1575060006114ee565b828202828482816114ae57fe5b04146114eb5760405162461bcd60e51b81526004018080602001828103825260218152602001806119e86021913960400191505060405180910390fd5b90505b92915050565b60006114eb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116e5565b60006114eb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611787565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526115f89084906117e1565b505050565b6000828201838110156114eb576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790526116df9085906117e1565b50505050565b600081836117715760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561173657818101518382015260200161171e565b50505050905090810190601f1680156117635780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161177d57fe5b0495945050505050565b600081848411156117d95760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561173657818101518382015260200161171e565b505050900390565b6117f3826001600160a01b0316611999565b611844576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106118825780518252601f199092019160209182019101611863565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146118e4576040519150601f19603f3d011682016040523d82523d6000602084013e6118e9565b606091505b509150915081611940576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156116df5780806020019051602081101561195c57600080fd5b50516116df5760405162461bcd60e51b815260040180806020018281038252602a815260200180611a09602a913960400191505060405180910390fd5b3b15159056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a206d757374206265206e6577206f776e657220746f2070756c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220ddfcadbd1aa0264ad8fe3b0f368164a042bd630ee8cd6c626277406f7664113f64736f6c6343000705003300000000000000000000000029219dd400f2bf60e5a23d13be72b486d4038894000000000000000000000000162630279ecb4a372d5744cb2a04e9acfa95e0f4000000000000000000000000f551a76ec6ba817bd0a4d796be80a77d9d98e94f00000000000000000000000000000000000000000000000000005af3107a4000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101b95760003560e01c80638df25170116100f9578063c2442f9311610097578063e1f1c4a711610071578063e1f1c4a7146103e6578063e6ef73d6146103ee578063ec562987146103f6578063f4426766146103fe576101b9565b8063c2442f931461039b578063c6d69a30146103a3578063cd8de42c146103c0576101b9565b8063b6b55f25116100d3578063b6b55f2514610348578063b77cf9c614610365578063bc1786281461038b578063c1e3d2dd14610393576101b9565b80638df25170146102fd578063a680e0bc1461031a578063b2d9bbfe14610340576101b9565b806346f68ee91161016657806364ab86751161014057806364ab86751461029b578063817b1cd2146102c1578063863e76db146102c95780638980f11f146102d1576101b9565b806346f68ee914610265578063481c6a751461028b5780635a96ac0a14610293576101b9565b80631dafe16b116101975780631dafe16b146102245780632e1a7d4d14610240578063372500ab1461025d576101b9565b80630741ed67146101be578063089208d8146101e25780630ba36dcd146101ec575b600080fd5b6101c6610406565b604080516001600160a01b039092168252519081900360200190f35b6101ea61042a565b005b6102126004803603602081101561020257600080fd5b50356001600160a01b03166104e0565b60408051918252519081900360200190f35b61022c6104f2565b604080519115158252519081900360200190f35b61022c6004803603602081101561025657600080fd5b50356104fb565b610212610751565b6101ea6004803603602081101561027b57600080fd5b50356001600160a01b031661087b565b6101c6610987565b6101ea610996565b610212600480360360208110156102b157600080fd5b50356001600160a01b0316610a4d565b610212610b64565b610212610b6a565b6101ea600480360360408110156102e757600080fd5b506001600160a01b038135169060200135610b71565b6101ea6004803603602081101561031357600080fd5b5035610c77565b6102126004803603602081101561033057600080fd5b50356001600160a01b0316610d66565b610212610d81565b61022c6004803603602081101561035e57600080fd5b5035610d87565b6102126004803603602081101561037b57600080fd5b50356001600160a01b0316610ef1565b6101ea610f03565b610212610ffd565b6101c6611003565b6101ea600480360360208110156103b957600080fd5b5035611027565b6101ea600480360360208110156103d657600080fd5b50356001600160a01b0316611118565b610212611233565b6101c6611239565b610212611248565b6101ea61124e565b7f000000000000000000000000162630279ecb4a372d5744cb2a04e9acfa95e0f481565b6000546001600160a01b03163314610489576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907fea8258f2d9ddb679928cf34b78cf645b7feda9acc828e4dd82d014eaae270eba908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60086020526000908152604090205481565b60065460ff1681565b6000600280541415610554576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60028055816105aa576040805162461bcd60e51b815260206004820152601160248201527f43616e6e6f742077697468647261772030000000000000000000000000000000604482015290519081900360640190fd5b3360009081526008602052604090205482111561060e576040805162461bcd60e51b815260206004820152601460248201527f496e73756666696369656e74206465706f736974000000000000000000000000604482015290519081900360640190fd5b60006106193361134c565b9050600061063e6127106106386004548761149290919063ffffffff16565b906114f4565b9050600061064c8583611536565b336000908152600860205260409020549091506106699086611536565b336000908152600860205260409020556005546106869086611536565b6005556106bd6001600160a01b037f00000000000000000000000029219dd400f2bf60e5a23d13be72b486d4038894163383611578565b81156106fd576003546106fd906001600160a01b037f00000000000000000000000029219dd400f2bf60e5a23d13be72b486d40388948116911684611578565b6040805186815260208101849052808201859052905133917f02f25270a4d87bea75db541cdfe559334a275b4a233520ed6c0a2429667cca94919081900360600190a2600193505050506001600255919050565b60006002805414156107aa576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b600280553360009081526008602052604090205461080f576040805162461bcd60e51b815260206004820152601260248201527f4d7573742068617665206465706f736974730000000000000000000000000000604482015290519081900360640190fd5b600061081a3361134c565b905060008111610871576040805162461bcd60e51b815260206004820152601360248201527f4e6f207265776172647320746f20636c61696d00000000000000000000000000604482015290519081900360640190fd5b9050600160025590565b6000546001600160a01b031633146108da576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811661091f5760405162461bcd60e51b81526004018080602001828103825260268152602001806119a06026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917fea8258f2d9ddb679928cf34b78cf645b7feda9acc828e4dd82d014eaae270eba91a36001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6000546001600160a01b031690565b6001546001600160a01b031633146109df5760405162461bcd60e51b81526004018080602001828103825260228152602001806119c66022913960400191505060405180910390fd5b600154600080546040516001600160a01b0393841693909116917faa151555690c956fc3ea32f106bb9f119b5237a061eaa8557cff3e51e3792c8d91a36001546000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909216919091179055565b6001600160a01b03811660009081526009602052604081205480610a75576000915050610b5f565b6005541580610a9a57506001600160a01b038316600090815260086020526040902054155b15610aa9576000915050610b5f565b60065460009060ff16158015610ac157506000600754115b15610ae0578160075410610ad757600754610ad9565b815b9050610ae3565b50425b6000610aef8284611536565b90506000610b066201518061063884612710611492565b9050610b5861271061063860055461063885610b52600a54600860008f6001600160a01b03166001600160a01b031681526020019081526020016000205461149290919063ffffffff16565b90611492565b9450505050505b919050565b60055481565b6201518081565b6000546001600160a01b03163314610bd0576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b7f00000000000000000000000029219dd400f2bf60e5a23d13be72b486d40388946001600160a01b0316826001600160a01b03161415610c57576040805162461bcd60e51b815260206004820152601d60248201527f43616e6e6f74207769746864726177207374616b656420746f6b656e73000000604482015290519081900360640190fd5b610c73610c62610987565b6001600160a01b0384169083611578565b5050565b6000546001600160a01b03163314610cd6576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60008111610d2b576040805162461bcd60e51b815260206004820152601360248201527f496e76616c696420726577617264207261746500000000000000000000000000604482015290519081900360640190fd5b600a8190556040805182815290517f1e3be2efa25bca5bff2215c7b30b31086e703d6aa7d9b9a1f8ba62c5291219ad9181900360200190a150565b6001600160a01b031660009081526009602052604090205490565b60045481565b6000600280541415610de0576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002805581610e36576040805162461bcd60e51b815260206004820152601060248201527f43616e6e6f74206465706f736974203000000000000000000000000000000000604482015290519081900360640190fd5b610e3f3361134c565b5033600090815260086020526040902054610e5a90836115fd565b33600090815260086020526040902055600554610e7790836115fd565b600555610eaf6001600160a01b037f00000000000000000000000029219dd400f2bf60e5a23d13be72b486d403889416333085611657565b60408051838152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a250600180600255919050565b60096020526000908152604090205481565b6000546001600160a01b03163314610f62576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60065460ff16610fb9576040805162461bcd60e51b815260206004820152601860248201527f5265776172647320616c72656164792064697361626c65640000000000000000604482015290519081900360640190fd5b6006805460ff1916905542600781905560408051918252517f386896cd0d8097415f68e3bbb255e95042dc54bdad93308a4fa52045d341f9079181900360200190a1565b600a5481565b7f00000000000000000000000029219dd400f2bf60e5a23d13be72b486d403889481565b6000546001600160a01b03163314611086576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6105dc8111156110dd576040805162461bcd60e51b815260206004820152601560248201527f5461782063616e6e6f7420657863656564203135250000000000000000000000604482015290519081900360640190fd5b60048190556040805182815290517fbe89dc2f9769e9896808a0f0983380fed3225e0784b99b98d3eec9ccb50185289181900360200190a150565b6000546001600160a01b03163314611177576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166111d2576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c696420746178207265636569766572206164647265737300000000604482015290519081900360640190fd5b600380546001600160a01b03831673ffffffffffffffffffffffffffffffffffffffff19909116811790915560408051918252517f6224532ae86e8a3e8c09a66cda6903a58238d0425f916e382008c4d3211da0249181900360200190a150565b61271081565b6003546001600160a01b031681565b60075481565b6000546001600160a01b031633146112ad576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60065460ff1615611305576040805162461bcd60e51b815260206004820152601760248201527f5265776172647320616c726561647920656e61626c6564000000000000000000604482015290519081900360640190fd5b6006805460ff1916600117905560006007556040805142815290517fd4f3d8ab0661c5947b6210340137d899c37ec0da59baaa1d9e8a643e5d4f1cfd9181900360200190a1565b6001600160a01b03811660009081526009602052604081205481901580159061138c57506001600160a01b03831660009081526008602052604090205415155b156114715761139a83610a4d565b90508015611471577f000000000000000000000000162630279ecb4a372d5744cb2a04e9acfa95e0f46001600160a01b03166340c10f1984836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561141957600080fd5b505af115801561142d573d6000803e3d6000fd5b50506040805184815290516001600160a01b03871693507f1f89f96333d3133000ee447473151fa9606543368f02271c9d95ae14f13bcc6792509081900360200190a25b6001600160a01b039290921660009081526009602052604090204290555090565b6000826114a1575060006114ee565b828202828482816114ae57fe5b04146114eb5760405162461bcd60e51b81526004018080602001828103825260218152602001806119e86021913960400191505060405180910390fd5b90505b92915050565b60006114eb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116e5565b60006114eb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611787565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526115f89084906117e1565b505050565b6000828201838110156114eb576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790526116df9085906117e1565b50505050565b600081836117715760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561173657818101518382015260200161171e565b50505050905090810190601f1680156117635780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161177d57fe5b0495945050505050565b600081848411156117d95760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561173657818101518382015260200161171e565b505050900390565b6117f3826001600160a01b0316611999565b611844576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106118825780518252601f199092019160209182019101611863565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146118e4576040519150601f19603f3d011682016040523d82523d6000602084013e6118e9565b606091505b509150915081611940576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156116df5780806020019051602081101561195c57600080fd5b50516116df5760405162461bcd60e51b815260040180806020018281038252602a815260200180611a09602a913960400191505060405180910390fd5b3b15159056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a206d757374206265206e6577206f776e657220746f2070756c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220ddfcadbd1aa0264ad8fe3b0f368164a042bd630ee8cd6c626277406f7664113f64736f6c63430007050033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000029219dd400f2bf60e5a23d13be72b486d4038894000000000000000000000000162630279ecb4a372d5744cb2a04e9acfa95e0f4000000000000000000000000f551a76ec6ba817bd0a4d796be80a77d9d98e94f00000000000000000000000000000000000000000000000000005af3107a4000
-----Decoded View---------------
Arg [0] : _farmToken (address): 0x29219dd400f2Bf60E5a23d13Be72B486D4038894
Arg [1] : _lux (address): 0x162630279Ecb4A372d5744CB2a04E9AcFa95e0F4
Arg [2] : _taxReceiver (address): 0xF551a76eC6Ba817BD0a4d796Be80a77d9d98E94f
Arg [3] : _dailyRewardRate (uint256): 100000000000000
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 00000000000000000000000029219dd400f2bf60e5a23d13be72b486d4038894
Arg [1] : 000000000000000000000000162630279ecb4a372d5744cb2a04e9acfa95e0f4
Arg [2] : 000000000000000000000000f551a76ec6ba817bd0a4d796be80a77d9d98e94f
Arg [3] : 00000000000000000000000000000000000000000000000000005af3107a4000
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.