More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 569 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Withdraw | 16545097 | 642 days ago | IN | 0 ETH | 0.00326519 | ||||
Withdraw | 16508612 | 647 days ago | IN | 0 ETH | 0.00172923 | ||||
Withdraw | 16508606 | 647 days ago | IN | 0 ETH | 0.00176275 | ||||
Withdraw | 16493776 | 649 days ago | IN | 0 ETH | 0.00059328 | ||||
Withdraw | 16493766 | 649 days ago | IN | 0 ETH | 0.00279827 | ||||
Withdraw | 16493079 | 649 days ago | IN | 0 ETH | 0.00219164 | ||||
Withdraw | 16375121 | 666 days ago | IN | 0 ETH | 0.00191258 | ||||
Withdraw | 16375119 | 666 days ago | IN | 0 ETH | 0.00163794 | ||||
Withdraw | 16375116 | 666 days ago | IN | 0 ETH | 0.00198161 | ||||
Withdraw | 16375101 | 666 days ago | IN | 0 ETH | 0.00232215 | ||||
Withdraw | 16375071 | 666 days ago | IN | 0 ETH | 0.00138644 | ||||
Withdraw | 16375068 | 666 days ago | IN | 0 ETH | 0.00131678 | ||||
Withdraw | 16375065 | 666 days ago | IN | 0 ETH | 0.00129606 | ||||
Deposit | 16315787 | 674 days ago | IN | 0 ETH | 0.00198515 | ||||
Deposit | 16308997 | 675 days ago | IN | 0 ETH | 0.00214798 | ||||
Withdraw | 16308975 | 675 days ago | IN | 0 ETH | 0.00192084 | ||||
Deposit | 16308937 | 675 days ago | IN | 0 ETH | 0.00186028 | ||||
Deposit | 16308934 | 675 days ago | IN | 0 ETH | 0.00184453 | ||||
Withdraw | 16308931 | 675 days ago | IN | 0 ETH | 0.00193045 | ||||
Withdraw | 16308929 | 675 days ago | IN | 0 ETH | 0.00184707 | ||||
Deposit | 16308926 | 675 days ago | IN | 0 ETH | 0.00179735 | ||||
Withdraw | 16308921 | 675 days ago | IN | 0 ETH | 0.00132615 | ||||
Withdraw | 16308919 | 675 days ago | IN | 0 ETH | 0.00140326 | ||||
Withdraw | 16308918 | 675 days ago | IN | 0 ETH | 0.00208304 | ||||
Withdraw | 16308916 | 675 days ago | IN | 0 ETH | 0.00231508 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
Farms
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// 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); } // File @openzeppelin/contracts/utils/[email protected] 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; // 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} 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"); // 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). * * 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"); // solhint-disable-next-line avoid-low-level-calls (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"); // 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.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"); // 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); } } } } // File @openzeppelin/contracts/token/ERC20/utils/[email protected] pragma solidity ^0.8.0; /** * @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' // 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) + 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 // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } // File @openzeppelin/contracts/utils/math/[email protected] 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. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * 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; } } } // File @openzeppelin/contracts/utils/[email protected] 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) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } // File @openzeppelin/contracts/access/[email protected] pragma solidity ^0.8.0; /** * @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() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), 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 { emit OwnershipTransferred(_owner, address(0)); _owner = 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"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } // File contracts/interfaces/IRewardRepository.sol pragma solidity 0.8.4; interface IRewardRepository { function balance(address _token) external view returns (uint256); function transferTo( address _token, address _receiver, uint256 _amount ) external; function ownerTransferTo( address _token, address _receiver, uint256 _amount ) external; } // File contracts/Farms.sol pragma solidity >0.6.12; // Farms distribute reward tokens based on staking contract Farms is Ownable { using SafeMath for uint256; 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 ERC20s tokens // entitled to a user but is pending to be distributed is: // // pending reward = (user.amount * pool.accRewardPerShare) - user.rewardDebt // // Whenever a user deposits or withdraws LP tokens to a pool. Here's what happens: // 1. The pool's `accRewardPerShare` (and `lastRewardTimestamp`) 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. Share tokens to distribute per second. uint256 lastRewardTimestamp; // Last timestamp that Share token distribution occurred. uint256 accRewardPerShare; // Accumulated Share tokens per share, times 1e12. See below. uint16 depositFeeBP; // Deposit fee in basis points uint16 withdrawalFeeBP; // Withdrawal fee in basis points } // The reward TOKEN IERC20 public rewardToken; // reward tokens created per block. uint256 public rewardPerSecond; uint256 public BONUS_MULTIPLIER = 1; address public rewardRepository; // 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 timestamp when reward mining starts. uint256 public startTimestamp; // Deposit & withdrawal fee address address public feeAddress; 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); constructor( IERC20 _rewardToken, address _rewardRepository, uint256 _rewardPerSecond, uint256 _startTimestamp, address _feeAddress ) { rewardToken = _rewardToken; rewardRepository = _rewardRepository; rewardPerSecond = _rewardPerSecond; startTimestamp = _startTimestamp; feeAddress = _feeAddress; } function rewardRepositoryBalance() external view returns (uint256) { return IRewardRepository(rewardRepository).balance(address(rewardToken)); } function poolLength() external view returns (uint256) { return poolInfo.length; } // Add a new lp to the pool. Can only be called by the owner. // DO NOT add the same LP token more than once. Rewards will be messed up if you do. function add( uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate, uint16 _depositFeeBP, uint16 _withdrawalFeeBP ) public onlyOwner { require(_depositFeeBP <= 10000, "add: invalid deposit fee basis points"); require(_withdrawalFeeBP <= 10000, "add: invalid withdrawal fee basis points"); uint256 lpSupply = _lpToken.balanceOf(address(this)); if (_withUpdate) { massUpdatePools(); } uint256 lastRewardTimestamp = block.timestamp > startTimestamp ? block.timestamp : startTimestamp; totalAllocPoint = totalAllocPoint.add(_allocPoint); poolInfo.push(PoolInfo({lpToken: _lpToken, allocPoint: _allocPoint, lastRewardTimestamp: lastRewardTimestamp, accRewardPerShare: 0, depositFeeBP : _depositFeeBP, withdrawalFeeBP : _withdrawalFeeBP})); } // Update the given pool's reward allocation point. Can only be called by the owner. function set( uint256 _pid, uint256 _allocPoint, bool _withUpdate ) public onlyOwner { if (_withUpdate) { massUpdatePools(); } totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(_allocPoint); poolInfo[_pid].allocPoint = _allocPoint; } function setFeeAddress(address _feeAddress) external onlyOwner { require(_feeAddress != address(0), "Invalid zero address"); feeAddress = _feeAddress; } function setRewardRepository(address _rewardRepository) external onlyOwner { require(_rewardRepository != address(0), "Invalid zero address"); rewardRepository = _rewardRepository; } function setRewardPerSecond(uint256 _rewardPerSecond) external onlyOwner { massUpdatePools(); rewardPerSecond = _rewardPerSecond; } // View function to see pending reward tokens on frontend. function pendingReward(uint256 _pid, address _user) external view returns (uint256) { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; uint256 accRewardPerShare = pool.accRewardPerShare; uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (block.timestamp > pool.lastRewardTimestamp && lpSupply != 0) { uint256 multiplier = getMultiplier(pool.lastRewardTimestamp, block.timestamp); uint256 addedReward = multiplier.mul(rewardPerSecond).mul(pool.allocPoint).div(totalAllocPoint); accRewardPerShare = accRewardPerShare.add(addedReward.mul(1e12).div(lpSupply)); } return user.amount.mul(accRewardPerShare).div(1e12).sub(user.rewardDebt); } function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) { return _to.sub(_from).mul(BONUS_MULTIPLIER); } // 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); } } function updatePoolDepositFee(uint256 _pid, uint16 _depositFeeBP) public onlyOwner() { require(_depositFeeBP <= 400, "updatePoolDepositFee: fee must be under 4%"); PoolInfo storage pool = poolInfo[_pid]; pool.depositFeeBP = _depositFeeBP; } function updatePoolWithdrawalFee(uint256 _pid, uint16 _withdrawalFeeBP) public onlyOwner() { require(_withdrawalFeeBP <= 400, "updatePoolWithdrawalFee: fee must be under 4%"); PoolInfo storage pool = poolInfo[_pid]; pool.withdrawalFeeBP = _withdrawalFeeBP; } // Update reward variables of the given pool to be up-to-date. function updatePool(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; if (block.timestamp <= pool.lastRewardTimestamp) { return; } uint256 lpSupply = pool.lpToken.balanceOf(address(this)); if (lpSupply == 0) { pool.lastRewardTimestamp = block.timestamp; return; } uint256 multiplier = getMultiplier(pool.lastRewardTimestamp, block.timestamp); uint256 reward = multiplier.mul(rewardPerSecond).mul(pool.allocPoint).div(totalAllocPoint); pool.accRewardPerShare = pool.accRewardPerShare.add(reward.mul(1e12).div(lpSupply)); pool.lastRewardTimestamp = block.timestamp; } // Deposit LP tokens to Farms contract for reward token allocation. function deposit(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; updatePool(_pid); if (user.amount > 0) { uint256 pending = user.amount.mul(pool.accRewardPerShare).div(1e12).sub(user.rewardDebt); safeRewardTransfer(msg.sender, pending); } if (_amount > 0) { pool.lpToken.safeTransferFrom(address(msg.sender), address(this), _amount); if (pool.depositFeeBP > 0) { uint256 depositFee = _amount.mul(pool.depositFeeBP).div(10000); pool.lpToken.safeTransfer(feeAddress, depositFee); user.amount = user.amount.add(_amount).sub(depositFee); } else { user.amount = user.amount.add(_amount); } } user.rewardDebt = user.amount.mul(pool.accRewardPerShare).div(1e12); emit Deposit(msg.sender, _pid, _amount); } // Withdraw LP tokens from Farms contract. function withdraw(uint256 _pid, uint256 _amount) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; require(user.amount >= _amount, "withdraw: can't withdraw more than deposit"); updatePool(_pid); uint256 pending = user.amount.mul(pool.accRewardPerShare).div(1e12).sub(user.rewardDebt); safeRewardTransfer(msg.sender, pending); if (_amount > 0) { if (pool.withdrawalFeeBP > 0) { uint256 withdrawalFee = _amount.mul(pool.withdrawalFeeBP).div(10000); uint256 withdrawalAmount = _amount.sub(withdrawalFee); user.amount = user.amount.sub(_amount); pool.lpToken.safeTransfer(feeAddress, withdrawalFee); pool.lpToken.safeTransfer(address(msg.sender), withdrawalAmount); } else { user.amount = user.amount.sub(_amount); pool.lpToken.safeTransfer(address(msg.sender), _amount); } } user.rewardDebt = user.amount.mul(pool.accRewardPerShare).div(1e12); emit Withdraw(msg.sender, _pid, _amount); } // Withdraw without caring about rewards. EMERGENCY ONLY. function emergencyWithdraw(uint256 _pid) public { PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][msg.sender]; if (user.amount > 0) { if (pool.withdrawalFeeBP > 0) { uint256 withdrawalFee = user.amount.mul(pool.withdrawalFeeBP).div(10000); uint256 withdrawalAmount = user.amount.sub(withdrawalFee); pool.lpToken.safeTransfer(feeAddress, withdrawalFee); pool.lpToken.safeTransfer(address(msg.sender), withdrawalAmount); } else { pool.lpToken.safeTransfer(address(msg.sender), user.amount); } } emit EmergencyWithdraw(msg.sender, _pid, user.amount); user.amount = 0; user.rewardDebt = 0; } // Safe reward token transfer function, just in case if rounding error causes pool to not have enough reward tokens. function safeRewardTransfer(address _to, uint256 _amount) internal { IRewardRepository(rewardRepository).transferTo(address(rewardToken), _to, _amount); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IERC20","name":"_rewardToken","type":"address"},{"internalType":"address","name":"_rewardRepository","type":"address"},{"internalType":"uint256","name":"_rewardPerSecond","type":"uint256"},{"internalType":"uint256","name":"_startTimestamp","type":"uint256"},{"internalType":"address","name":"_feeAddress","type":"address"}],"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":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"BONUS_MULTIPLIER","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":"bool","name":"_withUpdate","type":"bool"},{"internalType":"uint16","name":"_depositFeeBP","type":"uint16"},{"internalType":"uint16","name":"_withdrawalFeeBP","type":"uint16"}],"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":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","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":"pendingReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"lastRewardTimestamp","type":"uint256"},{"internalType":"uint256","name":"accRewardPerShare","type":"uint256"},{"internalType":"uint16","name":"depositFeeBP","type":"uint16"},{"internalType":"uint16","name":"withdrawalFeeBP","type":"uint16"}],"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":[],"name":"rewardPerSecond","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardRepository","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardRepositoryBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeAddress","type":"address"}],"name":"setFeeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardPerSecond","type":"uint256"}],"name":"setRewardPerSecond","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_rewardRepository","type":"address"}],"name":"setRewardRepository","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTimestamp","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":"_pid","type":"uint256"},{"internalType":"uint16","name":"_depositFeeBP","type":"uint16"}],"name":"updatePoolDepositFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint16","name":"_withdrawalFeeBP","type":"uint16"}],"name":"updatePoolWithdrawalFee","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
6080604052600160035560006007553480156200001b57600080fd5b5060405162001d6138038062001d618339810160408190526200003e91620000cb565b600080546001600160a01b031916339081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600180546001600160a01b039687166001600160a01b0319918216179091556004805495871695821695909517909455600292909255600855600980549190931691161790556200014c565b600080600080600060a08688031215620000e3578081fd5b8551620000f08162000133565b6020870151909550620001038162000133565b8094505060408601519250606086015191506080860151620001258162000133565b809150509295509295909350565b6001600160a01b03811681146200014957600080fd5b50565b611c05806200015c6000396000f3fe608060405234801561001057600080fd5b50600436106101c45760003560e01c80638705fcd4116100f9578063a9ddbcf711610097578063e6fd48bc11610071578063e6fd48bc146103e0578063f2fde38b146103e9578063f579ecb9146103fc578063f7c618c11461040f57600080fd5b8063a9ddbcf7146103a7578063cc534dbb146103ba578063e2bbb158146103cd57600080fd5b80638dbb1e3a116100d35780638dbb1e3a146103315780638f10369a1461034457806393f1a40b1461034d57806398969e821461039457600080fd5b80638705fcd4146103045780638aa28550146103175780638da5cb5b1461032057600080fd5b806351eb05a611610166578063630b5ba111610140578063630b5ba1146102ce57806364482f79146102d657806366da5815146102e9578063715018a6146102fc57600080fd5b806351eb05a6146102955780635312ea8e146102a85780635cf14d04146102bb57600080fd5b80631d153cd8116101a25780631d153cd81461023a57806324b616d214610265578063412753581461026d578063441a3e701461028057600080fd5b8063081e3eda146101c95780631526fe27146101e057806317caf6f114610231575b600080fd5b6005545b6040519081526020015b60405180910390f35b6101f36101ee366004611916565b610422565b604080516001600160a01b039097168752602087019590955293850192909252606084015261ffff90811660808401521660a082015260c0016101d7565b6101cd60075481565b60045461024d906001600160a01b031681565b6040516001600160a01b0390911681526020016101d7565b6101cd61047b565b60095461024d906001600160a01b031681565b61029361028e366004611a01565b610505565b005b6102936102a3366004611916565b610721565b6102936102b6366004611916565b610865565b6102936102c93660046119d6565b6109a2565b610293610a8f565b6102936102e4366004611a22565b610aba565b6102936102f7366004611916565b610b85565b610293610bbc565b6102936103123660046118de565b610c30565b6101cd60035481565b6000546001600160a01b031661024d565b6101cd61033f366004611a01565b610cc9565b6101cd60025481565b61037f61035b366004611946565b60066020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152016101d7565b6101cd6103a2366004611946565b610ce4565b6102936103b53660046118de565b610e5d565b6102936103c8366004611975565b610ef6565b6102936103db366004611a01565b6111ef565b6101cd60085481565b6102936103f73660046118de565b611375565b61029361040a3660046119d6565b61145f565b60015461024d906001600160a01b031681565b6005818154811061043257600080fd5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b0390931694509092909161ffff808216916201000090041686565b6004805460015460405163e3d670d760e01b81526001600160a01b039182169381019390935260009291169063e3d670d79060240160206040518083038186803b1580156104c857600080fd5b505afa1580156104dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610500919061192e565b905090565b60006005838154811061052857634e487b7160e01b600052603260045260246000fd5b6000918252602080832086845260068252604080852033865290925292208054600590920290920192508311156105b95760405162461bcd60e51b815260206004820152602a60248201527f77697468647261773a2063616e2774207769746864726177206d6f7265207468604482015269185b8819195c1bdcda5d60b21b60648201526084015b60405180910390fd5b6105c284610721565b60006105fc82600101546105f664e8d4a510006105f08760030154876000015461154190919063ffffffff16565b9061154d565b90611559565b90506106083382611565565b83156106c357600483015462010000900461ffff161561069f57600483015460009061064790612710906105f090889062010000900461ffff16611541565b905060006106558683611559565b84549091506106649087611559565b84556009548554610682916001600160a01b039182169116846115db565b8454610698906001600160a01b031633836115db565b50506106c3565b81546106ab9085611559565b825582546106c3906001600160a01b031633866115db565b600383015482546106de9164e8d4a51000916105f091611541565b6001830155604051848152859033907ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689060200160405180910390a35050505050565b60006005828154811061074457634e487b7160e01b600052603260045260246000fd5b9060005260206000209060050201905080600201544211610763575050565b80546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b1580156107a657600080fd5b505afa1580156107ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107de919061192e565b9050806107f057504260029091015550565b6000610800836002015442610cc9565b9050600061082d6007546105f086600101546108276002548761154190919063ffffffff16565b90611541565b9050610850610845846105f08464e8d4a51000611541565b600386015490611643565b60038501555050426002909201919091555050565b60006005828154811061088857634e487b7160e01b600052603260045260246000fd5b6000918252602080832085845260068252604080852033865290925292208054600590920290920192501561095a57600482015462010000900461ffff161561093f57600482015481546000916108f191612710916105f0919062010000900461ffff16611541565b82549091506000906109039083611559565b6009548554919250610922916001600160a01b039081169116846115db565b8354610938906001600160a01b031633836115db565b505061095a565b8054825461095a916001600160a01b039091169033906115db565b8054604051908152839033907fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959060200160405180910390a360008082556001909101555050565b6000546001600160a01b031633146109cc5760405162461bcd60e51b81526004016105b090611aa9565b6101908161ffff161115610a385760405162461bcd60e51b815260206004820152602d60248201527f757064617465506f6f6c5769746864726177616c4665653a20666565206d757360448201526c7420626520756e64657220342560981b60648201526084016105b0565b600060058381548110610a5b57634e487b7160e01b600052603260045260246000fd5b60009182526020909120600460059092020101805461ffff909316620100000263ffff000019909316929092179091555050565b60055460005b81811015610ab657610aa681610721565b610aaf81611b78565b9050610a95565b5050565b6000546001600160a01b03163314610ae45760405162461bcd60e51b81526004016105b090611aa9565b8015610af257610af2610a8f565b610b4382610b3d60058681548110610b1a57634e487b7160e01b600052603260045260246000fd5b90600052602060002090600502016001015460075461155990919063ffffffff16565b90611643565b6007819055508160058481548110610b6b57634e487b7160e01b600052603260045260246000fd5b906000526020600020906005020160010181905550505050565b6000546001600160a01b03163314610baf5760405162461bcd60e51b81526004016105b090611aa9565b610bb7610a8f565b600255565b6000546001600160a01b03163314610be65760405162461bcd60e51b81526004016105b090611aa9565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610c5a5760405162461bcd60e51b81526004016105b090611aa9565b6001600160a01b038116610ca75760405162461bcd60e51b8152602060048201526014602482015273496e76616c6964207a65726f206164647265737360601b60448201526064016105b0565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600354600090610cdd906108278486611559565b9392505050565b60008060058481548110610d0857634e487b7160e01b600052603260045260246000fd5b600091825260208083208784526006825260408085206001600160a01b03898116875293528085206005949094029091016003810154815492516370a0823160e01b815230600482015291965093949291909116906370a082319060240160206040518083038186803b158015610d7e57600080fd5b505afa158015610d92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db6919061192e565b9050836002015442118015610dca57508015155b15610e2a576000610ddf856002015442610cc9565b90506000610e066007546105f088600101546108276002548761154190919063ffffffff16565b9050610e25610e1e846105f08464e8d4a51000611541565b8590611643565b935050505b610e5283600101546105f664e8d4a510006105f086886000015461154190919063ffffffff16565b979650505050505050565b6000546001600160a01b03163314610e875760405162461bcd60e51b81526004016105b090611aa9565b6001600160a01b038116610ed45760405162461bcd60e51b8152602060048201526014602482015273496e76616c6964207a65726f206164647265737360601b60448201526064016105b0565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610f205760405162461bcd60e51b81526004016105b090611aa9565b6127108261ffff161115610f845760405162461bcd60e51b815260206004820152602560248201527f6164643a20696e76616c6964206465706f7369742066656520626173697320706044820152646f696e747360d81b60648201526084016105b0565b6127108161ffff161115610feb5760405162461bcd60e51b815260206004820152602860248201527f6164643a20696e76616c6964207769746864726177616c2066656520626173696044820152677320706f696e747360c01b60648201526084016105b0565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a082319060240160206040518083038186803b15801561102d57600080fd5b505afa158015611041573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611065919061192e565b9050831561107557611075610a8f565b600060085442116110885760085461108a565b425b60075490915061109a9088611643565b6007556040805160c0810182526001600160a01b0397881681526020810198895290810191825260006060820181815261ffff9687166080840190815295871660a0840190815260058054600181018255938190529351929093027f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db08101805493909a166001600160a01b03199093169290921790985597517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db189015590517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db288015594517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db387015550517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db4909401805493518216620100000263ffffffff1990941694909116939093179190911790915550565b60006005838154811061121257634e487b7160e01b600052603260045260246000fd5b6000918252602080832086845260068252604080852033865290925292206005909102909101915061124384610721565b80541561128657600061127882600101546105f664e8d4a510006105f08760030154876000015461154190919063ffffffff16565b90506112843382611565565b505b82156113185781546112a3906001600160a01b031633308661164f565b600482015461ffff16156113095760048201546000906112d090612710906105f090879061ffff16611541565b60095484549192506112ef916001600160a01b039081169116836115db565b81546113019082906105f69087611643565b825550611318565b80546113159084611643565b81555b600382015481546113339164e8d4a51000916105f091611541565b6001820155604051838152849033907f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159060200160405180910390a350505050565b6000546001600160a01b0316331461139f5760405162461bcd60e51b81526004016105b090611aa9565b6001600160a01b0381166114045760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105b0565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146114895760405162461bcd60e51b81526004016105b090611aa9565b6101908161ffff1611156114f25760405162461bcd60e51b815260206004820152602a60248201527f757064617465506f6f6c4465706f7369744665653a20666565206d75737420626044820152696520756e64657220342560b01b60648201526084016105b0565b60006005838154811061151557634e487b7160e01b600052603260045260246000fd5b60009182526020909120600590910201600401805461ffff191661ffff93909316929092179091555050565b6000610cdd8284611b16565b6000610cdd8284611af6565b6000610cdd8284611b35565b600480546001546040516352f950a960e11b81526001600160a01b0391821693810193909352848116602484015260448301849052169063a5f2a15290606401600060405180830381600087803b1580156115bf57600080fd5b505af11580156115d3573d6000803e3d6000fd5b505050505050565b6040516001600160a01b03831660248201526044810182905261163e90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261168d565b505050565b6000610cdd8284611ade565b6040516001600160a01b03808516602483015283166044820152606481018290526116879085906323b872dd60e01b90608401611607565b50505050565b60006116e2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661175f9092919063ffffffff16565b80519091501561163e578080602001905181019061170091906118fa565b61163e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105b0565b606061176e8484600085611776565b949350505050565b6060824710156117d75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016105b0565b843b6118255760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105b0565b600080866001600160a01b031685876040516118419190611a5a565b60006040518083038185875af1925050503d806000811461187e576040519150601f19603f3d011682016040523d82523d6000602084013e611883565b606091505b5091509150610e528282866060831561189d575081610cdd565b8251156118ad5782518084602001fd5b8160405162461bcd60e51b81526004016105b09190611a76565b803561ffff811681146118d957600080fd5b919050565b6000602082840312156118ef578081fd5b8135610cdd81611ba9565b60006020828403121561190b578081fd5b8151610cdd81611bc1565b600060208284031215611927578081fd5b5035919050565b60006020828403121561193f578081fd5b5051919050565b60008060408385031215611958578081fd5b82359150602083013561196a81611ba9565b809150509250929050565b600080600080600060a0868803121561198c578081fd5b85359450602086013561199e81611ba9565b935060408601356119ae81611bc1565b92506119bc606087016118c7565b91506119ca608087016118c7565b90509295509295909350565b600080604083850312156119e8578182fd5b823591506119f8602084016118c7565b90509250929050565b60008060408385031215611a13578182fd5b50508035926020909101359150565b600080600060608486031215611a36578283fd5b83359250602084013591506040840135611a4f81611bc1565b809150509250925092565b60008251611a6c818460208701611b4c565b9190910192915050565b6020815260008251806020840152611a95816040850160208701611b4c565b601f01601f19169190910160400192915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115611af157611af1611b93565b500190565b600082611b1157634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b3057611b30611b93565b500290565b600082821015611b4757611b47611b93565b500390565b60005b83811015611b67578181015183820152602001611b4f565b838111156116875750506000910152565b6000600019821415611b8c57611b8c611b93565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114611bbe57600080fd5b50565b8015158114611bbe57600080fdfea264697066735822122056b36f81b9bde72f913e173f3a2fb8d26f7be2fa77952479e0a47c30b927810d64736f6c6343000804003300000000000000000000000045fdb1b92a649fb6a64ef1511d3ba5bf600448380000000000000000000000000404084e0e63eb98766a4540a0ac6b0fbf17d155000000000000000000000000000000000000000000000000000000e8d4a51000000000000000000000000000000000000000000000000000000000006296783b0000000000000000000000001e7b390149abb3b891e0a7027e111188032d4540
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101c45760003560e01c80638705fcd4116100f9578063a9ddbcf711610097578063e6fd48bc11610071578063e6fd48bc146103e0578063f2fde38b146103e9578063f579ecb9146103fc578063f7c618c11461040f57600080fd5b8063a9ddbcf7146103a7578063cc534dbb146103ba578063e2bbb158146103cd57600080fd5b80638dbb1e3a116100d35780638dbb1e3a146103315780638f10369a1461034457806393f1a40b1461034d57806398969e821461039457600080fd5b80638705fcd4146103045780638aa28550146103175780638da5cb5b1461032057600080fd5b806351eb05a611610166578063630b5ba111610140578063630b5ba1146102ce57806364482f79146102d657806366da5815146102e9578063715018a6146102fc57600080fd5b806351eb05a6146102955780635312ea8e146102a85780635cf14d04146102bb57600080fd5b80631d153cd8116101a25780631d153cd81461023a57806324b616d214610265578063412753581461026d578063441a3e701461028057600080fd5b8063081e3eda146101c95780631526fe27146101e057806317caf6f114610231575b600080fd5b6005545b6040519081526020015b60405180910390f35b6101f36101ee366004611916565b610422565b604080516001600160a01b039097168752602087019590955293850192909252606084015261ffff90811660808401521660a082015260c0016101d7565b6101cd60075481565b60045461024d906001600160a01b031681565b6040516001600160a01b0390911681526020016101d7565b6101cd61047b565b60095461024d906001600160a01b031681565b61029361028e366004611a01565b610505565b005b6102936102a3366004611916565b610721565b6102936102b6366004611916565b610865565b6102936102c93660046119d6565b6109a2565b610293610a8f565b6102936102e4366004611a22565b610aba565b6102936102f7366004611916565b610b85565b610293610bbc565b6102936103123660046118de565b610c30565b6101cd60035481565b6000546001600160a01b031661024d565b6101cd61033f366004611a01565b610cc9565b6101cd60025481565b61037f61035b366004611946565b60066020908152600092835260408084209091529082529020805460019091015482565b604080519283526020830191909152016101d7565b6101cd6103a2366004611946565b610ce4565b6102936103b53660046118de565b610e5d565b6102936103c8366004611975565b610ef6565b6102936103db366004611a01565b6111ef565b6101cd60085481565b6102936103f73660046118de565b611375565b61029361040a3660046119d6565b61145f565b60015461024d906001600160a01b031681565b6005818154811061043257600080fd5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b0390931694509092909161ffff808216916201000090041686565b6004805460015460405163e3d670d760e01b81526001600160a01b039182169381019390935260009291169063e3d670d79060240160206040518083038186803b1580156104c857600080fd5b505afa1580156104dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610500919061192e565b905090565b60006005838154811061052857634e487b7160e01b600052603260045260246000fd5b6000918252602080832086845260068252604080852033865290925292208054600590920290920192508311156105b95760405162461bcd60e51b815260206004820152602a60248201527f77697468647261773a2063616e2774207769746864726177206d6f7265207468604482015269185b8819195c1bdcda5d60b21b60648201526084015b60405180910390fd5b6105c284610721565b60006105fc82600101546105f664e8d4a510006105f08760030154876000015461154190919063ffffffff16565b9061154d565b90611559565b90506106083382611565565b83156106c357600483015462010000900461ffff161561069f57600483015460009061064790612710906105f090889062010000900461ffff16611541565b905060006106558683611559565b84549091506106649087611559565b84556009548554610682916001600160a01b039182169116846115db565b8454610698906001600160a01b031633836115db565b50506106c3565b81546106ab9085611559565b825582546106c3906001600160a01b031633866115db565b600383015482546106de9164e8d4a51000916105f091611541565b6001830155604051848152859033907ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689060200160405180910390a35050505050565b60006005828154811061074457634e487b7160e01b600052603260045260246000fd5b9060005260206000209060050201905080600201544211610763575050565b80546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b1580156107a657600080fd5b505afa1580156107ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107de919061192e565b9050806107f057504260029091015550565b6000610800836002015442610cc9565b9050600061082d6007546105f086600101546108276002548761154190919063ffffffff16565b90611541565b9050610850610845846105f08464e8d4a51000611541565b600386015490611643565b60038501555050426002909201919091555050565b60006005828154811061088857634e487b7160e01b600052603260045260246000fd5b6000918252602080832085845260068252604080852033865290925292208054600590920290920192501561095a57600482015462010000900461ffff161561093f57600482015481546000916108f191612710916105f0919062010000900461ffff16611541565b82549091506000906109039083611559565b6009548554919250610922916001600160a01b039081169116846115db565b8354610938906001600160a01b031633836115db565b505061095a565b8054825461095a916001600160a01b039091169033906115db565b8054604051908152839033907fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959060200160405180910390a360008082556001909101555050565b6000546001600160a01b031633146109cc5760405162461bcd60e51b81526004016105b090611aa9565b6101908161ffff161115610a385760405162461bcd60e51b815260206004820152602d60248201527f757064617465506f6f6c5769746864726177616c4665653a20666565206d757360448201526c7420626520756e64657220342560981b60648201526084016105b0565b600060058381548110610a5b57634e487b7160e01b600052603260045260246000fd5b60009182526020909120600460059092020101805461ffff909316620100000263ffff000019909316929092179091555050565b60055460005b81811015610ab657610aa681610721565b610aaf81611b78565b9050610a95565b5050565b6000546001600160a01b03163314610ae45760405162461bcd60e51b81526004016105b090611aa9565b8015610af257610af2610a8f565b610b4382610b3d60058681548110610b1a57634e487b7160e01b600052603260045260246000fd5b90600052602060002090600502016001015460075461155990919063ffffffff16565b90611643565b6007819055508160058481548110610b6b57634e487b7160e01b600052603260045260246000fd5b906000526020600020906005020160010181905550505050565b6000546001600160a01b03163314610baf5760405162461bcd60e51b81526004016105b090611aa9565b610bb7610a8f565b600255565b6000546001600160a01b03163314610be65760405162461bcd60e51b81526004016105b090611aa9565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610c5a5760405162461bcd60e51b81526004016105b090611aa9565b6001600160a01b038116610ca75760405162461bcd60e51b8152602060048201526014602482015273496e76616c6964207a65726f206164647265737360601b60448201526064016105b0565b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600354600090610cdd906108278486611559565b9392505050565b60008060058481548110610d0857634e487b7160e01b600052603260045260246000fd5b600091825260208083208784526006825260408085206001600160a01b03898116875293528085206005949094029091016003810154815492516370a0823160e01b815230600482015291965093949291909116906370a082319060240160206040518083038186803b158015610d7e57600080fd5b505afa158015610d92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db6919061192e565b9050836002015442118015610dca57508015155b15610e2a576000610ddf856002015442610cc9565b90506000610e066007546105f088600101546108276002548761154190919063ffffffff16565b9050610e25610e1e846105f08464e8d4a51000611541565b8590611643565b935050505b610e5283600101546105f664e8d4a510006105f086886000015461154190919063ffffffff16565b979650505050505050565b6000546001600160a01b03163314610e875760405162461bcd60e51b81526004016105b090611aa9565b6001600160a01b038116610ed45760405162461bcd60e51b8152602060048201526014602482015273496e76616c6964207a65726f206164647265737360601b60448201526064016105b0565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610f205760405162461bcd60e51b81526004016105b090611aa9565b6127108261ffff161115610f845760405162461bcd60e51b815260206004820152602560248201527f6164643a20696e76616c6964206465706f7369742066656520626173697320706044820152646f696e747360d81b60648201526084016105b0565b6127108161ffff161115610feb5760405162461bcd60e51b815260206004820152602860248201527f6164643a20696e76616c6964207769746864726177616c2066656520626173696044820152677320706f696e747360c01b60648201526084016105b0565b6040516370a0823160e01b81523060048201526000906001600160a01b038616906370a082319060240160206040518083038186803b15801561102d57600080fd5b505afa158015611041573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611065919061192e565b9050831561107557611075610a8f565b600060085442116110885760085461108a565b425b60075490915061109a9088611643565b6007556040805160c0810182526001600160a01b0397881681526020810198895290810191825260006060820181815261ffff9687166080840190815295871660a0840190815260058054600181018255938190529351929093027f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db08101805493909a166001600160a01b03199093169290921790985597517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db189015590517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db288015594517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db387015550517f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db4909401805493518216620100000263ffffffff1990941694909116939093179190911790915550565b60006005838154811061121257634e487b7160e01b600052603260045260246000fd5b6000918252602080832086845260068252604080852033865290925292206005909102909101915061124384610721565b80541561128657600061127882600101546105f664e8d4a510006105f08760030154876000015461154190919063ffffffff16565b90506112843382611565565b505b82156113185781546112a3906001600160a01b031633308661164f565b600482015461ffff16156113095760048201546000906112d090612710906105f090879061ffff16611541565b60095484549192506112ef916001600160a01b039081169116836115db565b81546113019082906105f69087611643565b825550611318565b80546113159084611643565b81555b600382015481546113339164e8d4a51000916105f091611541565b6001820155604051838152849033907f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159060200160405180910390a350505050565b6000546001600160a01b0316331461139f5760405162461bcd60e51b81526004016105b090611aa9565b6001600160a01b0381166114045760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105b0565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146114895760405162461bcd60e51b81526004016105b090611aa9565b6101908161ffff1611156114f25760405162461bcd60e51b815260206004820152602a60248201527f757064617465506f6f6c4465706f7369744665653a20666565206d75737420626044820152696520756e64657220342560b01b60648201526084016105b0565b60006005838154811061151557634e487b7160e01b600052603260045260246000fd5b60009182526020909120600590910201600401805461ffff191661ffff93909316929092179091555050565b6000610cdd8284611b16565b6000610cdd8284611af6565b6000610cdd8284611b35565b600480546001546040516352f950a960e11b81526001600160a01b0391821693810193909352848116602484015260448301849052169063a5f2a15290606401600060405180830381600087803b1580156115bf57600080fd5b505af11580156115d3573d6000803e3d6000fd5b505050505050565b6040516001600160a01b03831660248201526044810182905261163e90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261168d565b505050565b6000610cdd8284611ade565b6040516001600160a01b03808516602483015283166044820152606481018290526116879085906323b872dd60e01b90608401611607565b50505050565b60006116e2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661175f9092919063ffffffff16565b80519091501561163e578080602001905181019061170091906118fa565b61163e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016105b0565b606061176e8484600085611776565b949350505050565b6060824710156117d75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016105b0565b843b6118255760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016105b0565b600080866001600160a01b031685876040516118419190611a5a565b60006040518083038185875af1925050503d806000811461187e576040519150601f19603f3d011682016040523d82523d6000602084013e611883565b606091505b5091509150610e528282866060831561189d575081610cdd565b8251156118ad5782518084602001fd5b8160405162461bcd60e51b81526004016105b09190611a76565b803561ffff811681146118d957600080fd5b919050565b6000602082840312156118ef578081fd5b8135610cdd81611ba9565b60006020828403121561190b578081fd5b8151610cdd81611bc1565b600060208284031215611927578081fd5b5035919050565b60006020828403121561193f578081fd5b5051919050565b60008060408385031215611958578081fd5b82359150602083013561196a81611ba9565b809150509250929050565b600080600080600060a0868803121561198c578081fd5b85359450602086013561199e81611ba9565b935060408601356119ae81611bc1565b92506119bc606087016118c7565b91506119ca608087016118c7565b90509295509295909350565b600080604083850312156119e8578182fd5b823591506119f8602084016118c7565b90509250929050565b60008060408385031215611a13578182fd5b50508035926020909101359150565b600080600060608486031215611a36578283fd5b83359250602084013591506040840135611a4f81611bc1565b809150509250925092565b60008251611a6c818460208701611b4c565b9190910192915050565b6020815260008251806020840152611a95816040850160208701611b4c565b601f01601f19169190910160400192915050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60008219821115611af157611af1611b93565b500190565b600082611b1157634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b3057611b30611b93565b500290565b600082821015611b4757611b47611b93565b500390565b60005b83811015611b67578181015183820152602001611b4f565b838111156116875750506000910152565b6000600019821415611b8c57611b8c611b93565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b0381168114611bbe57600080fd5b50565b8015158114611bbe57600080fdfea264697066735822122056b36f81b9bde72f913e173f3a2fb8d26f7be2fa77952479e0a47c30b927810d64736f6c63430008040033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000045fdb1b92a649fb6a64ef1511d3ba5bf600448380000000000000000000000000404084e0e63eb98766a4540a0ac6b0fbf17d155000000000000000000000000000000000000000000000000000000e8d4a51000000000000000000000000000000000000000000000000000000000006296783b0000000000000000000000001e7b390149abb3b891e0a7027e111188032d4540
-----Decoded View---------------
Arg [0] : _rewardToken (address): 0x45fDb1b92a649fb6A64Ef1511D3Ba5Bf60044838
Arg [1] : _rewardRepository (address): 0x0404084e0e63Eb98766A4540A0AC6B0Fbf17d155
Arg [2] : _rewardPerSecond (uint256): 1000000000000
Arg [3] : _startTimestamp (uint256): 1654028347
Arg [4] : _feeAddress (address): 0x1e7b390149Abb3B891e0a7027E111188032D4540
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 00000000000000000000000045fdb1b92a649fb6a64ef1511d3ba5bf60044838
Arg [1] : 0000000000000000000000000404084e0e63eb98766a4540a0ac6b0fbf17d155
Arg [2] : 000000000000000000000000000000000000000000000000000000e8d4a51000
Arg [3] : 000000000000000000000000000000000000000000000000000000006296783b
Arg [4] : 0000000000000000000000001e7b390149abb3b891e0a7027e111188032d4540
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.072884 | 15,061.7344 | $1,097.76 |
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.