Source Code
Latest 24 from a total of 24 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Increase Lock Am... | 36517082 | 211 days ago | IN | 0 S | 0.01144992 | ||||
| Create Lock | 36517050 | 211 days ago | IN | 0 S | 0.01100252 | ||||
| Withdraw | 36516969 | 211 days ago | IN | 0 S | 0.00695151 | ||||
| Increase Lock Am... | 31612650 | 237 days ago | IN | 0 S | 0.01324013 | ||||
| Increase Lock Am... | 31612474 | 237 days ago | IN | 0 S | 0.01324013 | ||||
| Create Lock | 31611307 | 237 days ago | IN | 0 S | 0.01371015 | ||||
| Create Lock | 31611262 | 237 days ago | IN | 0 S | 0.00300404 | ||||
| Create Lock | 31611047 | 237 days ago | IN | 0 S | 0.00322165 | ||||
| Create Lock | 31401710 | 238 days ago | IN | 0 S | 0.0023393 | ||||
| Create Lock | 31401124 | 238 days ago | IN | 0 S | 0.0023393 | ||||
| Create Lock | 31401073 | 238 days ago | IN | 0 S | 0.0025473 | ||||
| Withdraw | 31215754 | 239 days ago | IN | 0 S | 0.00695151 | ||||
| Increase Lock Am... | 24460261 | 266 days ago | IN | 0 S | 0.01431187 | ||||
| Create Lock | 23114570 | 272 days ago | IN | 0 S | 0.01384992 | ||||
| Increase Lock Am... | 22965522 | 273 days ago | IN | 0 S | 0.01144992 | ||||
| Increase Lock Am... | 22965002 | 273 days ago | IN | 0 S | 0.01144992 | ||||
| Increase Lock Am... | 22964959 | 273 days ago | IN | 0 S | 0.01144992 | ||||
| Increase Lock Am... | 22545938 | 275 days ago | IN | 0 S | 0.01144932 | ||||
| Increase Lock Am... | 22473227 | 275 days ago | IN | 0 S | 0.01130932 | ||||
| Increase Lock Am... | 22470902 | 275 days ago | IN | 0 S | 0.01144932 | ||||
| Increase Lock Am... | 22470674 | 275 days ago | IN | 0 S | 0.01130932 | ||||
| Increase Lock Am... | 22465355 | 275 days ago | IN | 0 S | 0.01130932 | ||||
| Create Lock | 21911696 | 278 days ago | IN | 0 S | 0.01442252 | ||||
| Set Lp Token | 21908712 | 278 days ago | IN | 0 S | 0.00161415 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
ve69LP
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
/**
* ==============================
* ve69LP
* ==============================
* Voting-Escrow Token Standard
* ==============================
*
* // "Lee, this is America. We don't care about your 'rich cultural heritage'!" - Carter
* // https://x.com/sonicreddragon
* // https://t.me/sonicreddragon
*/
pragma solidity ^0.8.9;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
/**
* @title ve69LP
* @dev Vote-Escrowed 69/31 LP token implementation
* Users lock 69/31 LP tokens for a period of time to receive voting power
* The voting power depends on the amount of tokens locked and the lock time
* Follows the veCRV model from Curve Finance
*/
contract ve69LP is Ownable, ReentrancyGuard {
// Structs
struct LockedBalance {
uint256 amount; // Amount of 69/31 LP tokens locked
uint256 unlockTime; // Unix timestamp when tokens unlock
}
struct Point {
uint256 bias; // Voting power at the time of recording
uint256 slope; // How fast the voting power is decreasing over time
uint256 timestamp; // Time point was recorded
}
// Constants
uint256 private constant WEEK = 7 * 86400; // 1 week in seconds
uint256 private constant MAX_LOCK_TIME = 4 * 365 * 86400; // 4 years in seconds
uint256 private constant MIN_LOCK_TIME = 7 * 86400; // 1 week in seconds
// State variables
IERC20 public lpToken; // 69/31 LP token
uint256 public totalSupply; // Total ve69LP supply
mapping(address => LockedBalance) public locked;
mapping(address => uint256) public userPointEpoch;
mapping(address => mapping(uint256 => Point)) public userPointHistory;
mapping(uint256 => Point) public pointHistory;
uint256 public epoch;
// Events
event Deposit(address indexed provider, uint256 value, uint256 locktime, uint256 timestamp);
event Withdraw(address indexed provider, uint256 value, uint256 timestamp);
event Supply(uint256 prevSupply, uint256 supply);
event LpTokenUpdated(address indexed newLpToken);
/**
* @dev Constructor
* @param _lpToken Address of the 69/31 LP token
*/
constructor(address _lpToken) {
require(_lpToken != address(0), "LP token address cannot be zero");
lpToken = IERC20(_lpToken);
pointHistory[0] = Point({
bias: 0,
slope: 0,
timestamp: block.timestamp
});
epoch = 0;
}
/**
* @dev Get the voting power of a user
* @param _user Address of the user
* @return User's current voting power
*/
function balanceOf(address _user) external view returns (uint256) {
LockedBalance memory userLock = locked[_user];
return calculateVotingPower(userLock.amount, userLock.unlockTime);
}
/**
* @dev Get the total voting power
* @return Total current voting power
*/
function totalVotingPower() external view returns (uint256) {
return totalSupply;
}
/**
* @dev Create a new lock or add to an existing lock
* @param _value Amount of 69/31 LP to lock
* @param _unlockTime Future time when tokens unlock
*/
function createLock(uint256 _value, uint256 _unlockTime) external nonReentrant {
require(_value > 0, "Must lock non-zero amount");
require(_unlockTime > block.timestamp, "Lock time must be in the future");
require(_unlockTime >= block.timestamp + MIN_LOCK_TIME, "Lock time must be at least 1 week");
require(_unlockTime <= block.timestamp + MAX_LOCK_TIME, "Lock time too long");
LockedBalance storage userLock = locked[msg.sender];
require(userLock.amount == 0, "Lock already exists");
// Transfer tokens to contract
require(lpToken.transferFrom(msg.sender, address(this), _value), "Transfer failed");
// Update locked balance
userLock.amount = _value;
userLock.unlockTime = _unlockTime;
// Calculate voting power
uint256 votingPower = calculateVotingPower(_value, _unlockTime);
// Update total supply
uint256 prevSupply = totalSupply;
totalSupply = prevSupply + votingPower;
// Update user point history
userPointEpoch[msg.sender] += 1;
uint256 userEpoch = userPointEpoch[msg.sender];
userPointHistory[msg.sender][userEpoch] = Point({
bias: votingPower,
slope: votingPower / (_unlockTime - block.timestamp),
timestamp: block.timestamp
});
// Update global point history
epoch += 1;
pointHistory[epoch] = Point({
bias: totalSupply,
slope: pointHistory[epoch - 1].slope + (votingPower / (_unlockTime - block.timestamp)),
timestamp: block.timestamp
});
emit Deposit(msg.sender, _value, _unlockTime, block.timestamp);
emit Supply(prevSupply, totalSupply);
}
/**
* @dev Increase lock amount without changing the unlock time
* @param _value Additional amount of 69/31 LP to lock
*/
function increaseLockAmount(uint256 _value) external nonReentrant {
LockedBalance storage userLocked = locked[msg.sender];
require(_value > 0, "Must increase by non-zero amount");
require(userLocked.amount > 0, "No existing lock found");
require(userLocked.unlockTime > block.timestamp, "Lock expired");
// Checkpoint with new amount but same unlock time
_checkpoint(msg.sender, userLocked, LockedBalance({
amount: userLocked.amount + _value,
unlockTime: userLocked.unlockTime
}));
// Update user's lock
userLocked.amount += _value;
// Transfer LP tokens from user to contract
require(lpToken.transferFrom(msg.sender, address(this), _value), "Transfer failed");
emit Deposit(msg.sender, _value, userLocked.unlockTime, block.timestamp);
}
/**
* @dev Extend lock time without changing the amount
* @param _unlockTime New unlock time
*/
function extendLockTime(uint256 _unlockTime) external nonReentrant {
LockedBalance storage userLock = locked[msg.sender];
require(userLock.amount > 0, "No existing lock found");
require(_unlockTime > userLock.unlockTime, "Cannot decrease lock time");
require(_unlockTime <= block.timestamp + MAX_LOCK_TIME, "Lock time too long");
require(_unlockTime >= block.timestamp + MIN_LOCK_TIME, "Lock time must be in the future");
// Calculate old voting power
uint256 oldVotingPower = calculateVotingPower(userLock.amount, userLock.unlockTime);
// Update unlock time
userLock.unlockTime = _unlockTime;
// Calculate new voting power
uint256 newVotingPower = calculateVotingPower(userLock.amount, _unlockTime);
// Update user point history
userPointEpoch[msg.sender] += 1;
uint256 userEpoch = userPointEpoch[msg.sender];
userPointHistory[msg.sender][userEpoch] = Point({
bias: newVotingPower,
slope: 0,
timestamp: block.timestamp
});
// Update total supply
totalSupply = totalSupply - oldVotingPower + newVotingPower;
// Update global point history
epoch += 1;
pointHistory[epoch] = Point({
bias: totalSupply,
slope: 0,
timestamp: block.timestamp
});
emit Deposit(msg.sender, userLock.amount, _unlockTime, block.timestamp);
}
/**
* @dev Withdraw tokens once the lock has expired
*/
function withdraw() external nonReentrant {
LockedBalance storage userLock = locked[msg.sender];
require(userLock.amount > 0, "No lock found");
require(block.timestamp >= userLock.unlockTime, "Lock not expired");
// Save the amount to withdraw
uint256 amount = userLock.amount;
// Clear the lock before any external calls
userLock.amount = 0;
userLock.unlockTime = 0;
// Update total supply (voting power should already be 0 since lock expired)
uint256 oldVotingPower = calculateVotingPower(amount, userLock.unlockTime);
if (oldVotingPower > 0) {
totalSupply = totalSupply > oldVotingPower ? totalSupply - oldVotingPower : 0;
}
// Update user point history
userPointEpoch[msg.sender] += 1;
uint256 userEpoch = userPointEpoch[msg.sender];
userPointHistory[msg.sender][userEpoch] = Point({
bias: 0,
slope: 0,
timestamp: block.timestamp
});
// Update global point history
epoch += 1;
pointHistory[epoch] = Point({
bias: totalSupply,
slope: 0,
timestamp: block.timestamp
});
// Transfer tokens back to user
require(lpToken.transfer(msg.sender, amount), "Transfer failed");
emit Withdraw(msg.sender, amount, block.timestamp);
emit Supply(totalSupply + oldVotingPower, totalSupply);
}
/**
* @dev Get lock information for a user
* @param _user Address of the user
* @return amount Amount of locked LP tokens
* @return unlockTime Timestamp when tokens unlock
*/
function getLock(address _user) external view returns (uint256 amount, uint256 unlockTime) {
LockedBalance memory userLocked = locked[_user];
return (userLocked.amount, userLocked.unlockTime);
}
/**
* @dev Calculate voting power based on amount and lock time
* @param _amount Amount of LP tokens locked
* @param _unlockTime Time when tokens unlock
* @return Voting power
*/
function calculateVotingPower(uint256 _amount, uint256 _unlockTime) public view returns (uint256) {
if (_amount == 0 || _unlockTime <= block.timestamp) {
return 0;
}
uint256 timeDiff = _unlockTime - block.timestamp;
if (timeDiff > MAX_LOCK_TIME) {
timeDiff = MAX_LOCK_TIME;
}
// Calculate voting power with improved precision
// Use 1e18 precision throughout the calculation
uint256 timeRatio = (timeDiff * 1e18) / MAX_LOCK_TIME;
uint256 votingPower = (_amount * timeRatio) / 1e18;
return votingPower;
}
/**
* @dev Internal function to update user points and total supply
* @param _user User address
* @param _oldLocked Old locked balance
* @param _newLocked New locked balance
*/
function _checkpoint(address _user, LockedBalance memory _oldLocked, LockedBalance memory _newLocked) internal {
Point memory userOldPoint;
Point memory userNewPoint;
// Calculate old and new voting power
uint256 oldPower = calculateVotingPower(_oldLocked.amount, _oldLocked.unlockTime);
uint256 newPower = calculateVotingPower(_newLocked.amount, _newLocked.unlockTime);
// Update user point epoch and save history
userPointEpoch[_user] += 1;
uint256 userEpoch = userPointEpoch[_user];
// Calculate slope and bias with improved precision
uint256 oldSlope = 0;
uint256 newSlope = 0;
if (_oldLocked.unlockTime > block.timestamp) {
uint256 timeDiff = _oldLocked.unlockTime - block.timestamp;
if (timeDiff > MAX_LOCK_TIME) {
timeDiff = MAX_LOCK_TIME;
}
// Calculate slope with 1e18 precision
oldSlope = (_oldLocked.amount * 1e18) / timeDiff;
}
if (_newLocked.unlockTime > block.timestamp) {
uint256 timeDiff = _newLocked.unlockTime - block.timestamp;
if (timeDiff > MAX_LOCK_TIME) {
timeDiff = MAX_LOCK_TIME;
}
// Calculate slope with 1e18 precision
newSlope = (_newLocked.amount * 1e18) / timeDiff;
}
// Update user point history with current timestamp
userOldPoint.bias = oldPower;
userOldPoint.slope = oldSlope;
userOldPoint.timestamp = block.timestamp;
userNewPoint.bias = newPower;
userNewPoint.slope = newSlope;
userNewPoint.timestamp = block.timestamp;
// Save user point history
userPointHistory[_user][userEpoch] = userNewPoint;
// Update global point history
epoch += 1;
// Update global supply with proper overflow checks
uint256 prevSupply = totalSupply;
totalSupply = prevSupply + newPower - oldPower;
// Update global point history with proper overflow checks
Point memory lastPoint = pointHistory[epoch - 1];
pointHistory[epoch] = Point({
bias: lastPoint.bias + newPower - oldPower,
slope: lastPoint.slope + newSlope - oldSlope,
timestamp: block.timestamp
});
emit Supply(prevSupply, totalSupply);
}
/**
* @dev Allows the owner to set the LP token address after deployment
* This is useful for manual LP setup through Beets UI
* @param _newLpToken Address of the new LP token
*/
function setLpToken(address _newLpToken) external onlyOwner {
require(_newLpToken != address(0), "LP token address cannot be zero");
require(totalSupply == 0, "Cannot change LP token after locks have been created");
// Update token address
lpToken = IERC20(_newLpToken);
// Emit event to log the change
emit LpTokenUpdated(_newLpToken);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
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 {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the 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 `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, 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 `from` to `to` 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 from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1);
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator,
Rounding rounding
) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10**64) {
value /= 10**64;
result += 64;
}
if (value >= 10**32) {
value /= 10**32;
result += 32;
}
if (value >= 10**16) {
value /= 10**16;
result += 16;
}
if (value >= 10**8) {
value /= 10**8;
result += 8;
}
if (value >= 10**4) {
value /= 10**4;
result += 4;
}
if (value >= 10**2) {
value /= 10**2;
result += 2;
}
if (value >= 10**1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
}
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"evmVersion": "paris",
"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":"_lpToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"provider","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"locktime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newLpToken","type":"address"}],"name":"LpTokenUpdated","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":false,"internalType":"uint256","name":"prevSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"supply","type":"uint256"}],"name":"Supply","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"provider","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_unlockTime","type":"uint256"}],"name":"calculateVotingPower","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"uint256","name":"_unlockTime","type":"uint256"}],"name":"createLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"epoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_unlockTime","type":"uint256"}],"name":"extendLockTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getLock","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"unlockTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"increaseLockAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"locked","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"unlockTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lpToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"pointHistory","outputs":[{"internalType":"uint256","name":"bias","type":"uint256"},{"internalType":"uint256","name":"slope","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newLpToken","type":"address"}],"name":"setLpToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalVotingPower","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":"address","name":"","type":"address"}],"name":"userPointEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userPointHistory","outputs":[{"internalType":"uint256","name":"bias","type":"uint256"},{"internalType":"uint256","name":"slope","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b506040516200196138038062001961833981016040819052610031916101a2565b61003a33610152565b600180556001600160a01b0381166100985760405162461bcd60e51b815260206004820152601f60248201527f4c5020746f6b656e20616464726573732063616e6e6f74206265207a65726f00604482015260640160405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055604080516060810182526000808252602080830182815242948401948552828052600790915291517f6d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6df5590517f6d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6e05590517f6d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6e1556008556101d2565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156101b457600080fd5b81516001600160a01b03811681146101cb57600080fd5b9392505050565b61177f80620001e26000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c806381fc83bb116100ad5780639ee933b5116100715780639ee933b5146102d9578063b52c05fe146102ec578063cbf9fe5f146102ff578063ef9889ee14610326578063f2fde38b1461033957600080fd5b806381fc83bb1461025d578063828047a51461027d5780638ad4c447146102905780638da5cb5b146102bf578063900cf0cf146102d057600080fd5b80635fcbd285116100f45780635fcbd285146101b4578063671b3793146101df5780636b9db4e6146101e757806370a0823114610242578063715018a61461025557600080fd5b806318160ddd1461012657806334d901a4146101425780633ccfd60b14610197578063403f4447146101a1575b600080fd5b61012f60035481565b6040519081526020015b60405180910390f35b61017c610150366004611609565b600660209081526000928352604080842090915290825290208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610139565b61019f61034c565b005b61019f6101af366004611633565b610623565b6002546101c7906001600160a01b031681565b6040516001600160a01b039091168152602001610139565b60035461012f565b61022d6101f536600461164c565b6001600160a01b0316600090815260046020908152604091829020825180840190935280548084526001909101549290910182905291565b60408051928352602083019190915201610139565b61012f61025036600461164c565b61085b565b61019f6108a2565b61012f61026b36600461164c565b60056020526000908152604090205481565b61019f61028b366004611633565b6108b4565b61017c61029e366004611633565b60076020526000908152604090208054600182015460029092015490919083565b6000546001600160a01b03166101c7565b61012f60085481565b61019f6102e736600461164c565b610b85565b61019f6102fa366004611667565b610c9a565b61022d61030d36600461164c565b6004602052600090815260409020805460019091015482565b61012f610334366004611667565b6110d8565b61019f61034736600461164c565b611165565b6103546111db565b33600090815260046020526040902080546103a65760405162461bcd60e51b815260206004820152600d60248201526c139bc81b1bd8dac8199bdd5b99609a1b60448201526064015b60405180910390fd5b80600101544210156103ed5760405162461bcd60e51b815260206004820152601060248201526f131bd8dac81b9bdd08195e1c1a5c995960821b604482015260640161039d565b805460008083556001830181905561040582826110d8565b9050801561042f57806003541161041d57600061042b565b8060035461042b919061169f565b6003555b33600090815260056020526040812080546001929061044f9084906116b2565b9091555050336000818152600560209081526040808320548151606081018352848152808401858152428285019081529686526006855283862083875290945291842091518255915160018083019190915593516002909101556008805491939290916104bd9084906116b2565b90915550506040805160608101825260035481526000602080830182815242848601908152600854845260079092529184902092518355905160018301555160029182015554905163a9059cbb60e01b8152336004820152602481018590526001600160a01b039091169063a9059cbb906044016020604051808303816000875af1158015610550573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061057491906116c5565b6105905760405162461bcd60e51b815260040161039d906116e7565b6040805184815242602082015233917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568910160405180910390a27f5e2aa66efd74cce82b21852e317e5490d9ecc9e6bb953ae24d90851258cc2f5c826003546105f991906116b2565b6003546040805192835260208301919091520160405180910390a15050505061062160018055565b565b61062b6111db565b336000908152600460205260409020816106875760405162461bcd60e51b815260206004820181905260248201527f4d75737420696e637265617365206279206e6f6e2d7a65726f20616d6f756e74604482015260640161039d565b80546106ce5760405162461bcd60e51b8152602060048201526016602482015275139bc8195e1a5cdd1a5b99c81b1bd8dac8199bdd5b9960521b604482015260640161039d565b428160010154116107105760405162461bcd60e51b815260206004820152600c60248201526b131bd8dac8195e1c1a5c995960a21b604482015260640161039d565b60408051808201825282548082526001840154602083015282518084019093526107569233929181906107449088906116b2565b81526020018560010154815250611234565b8181600001600082825461076a91906116b2565b90915550506002546040516323b872dd60e01b8152336004820152306024820152604481018490526001600160a01b03909116906323b872dd906064016020604051808303816000875af11580156107c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ea91906116c5565b6108065760405162461bcd60e51b815260040161039d906116e7565b6001810154604080518481526020810192909252429082015233907f36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e9060600160405180910390a25061085860018055565b50565b6001600160a01b038116600090815260046020908152604080832081518083019092528054808352600190910154928201839052909161089b91906110d8565b9392505050565b6108aa611543565b610621600061159d565b6108bc6111db565b33600090815260046020526040902080546109125760405162461bcd60e51b8152602060048201526016602482015275139bc8195e1a5cdd1a5b99c81b1bd8dac8199bdd5b9960521b604482015260640161039d565b806001015482116109655760405162461bcd60e51b815260206004820152601960248201527f43616e6e6f74206465637265617365206c6f636b2074696d6500000000000000604482015260640161039d565b610973630784ce00426116b2565b8211156109b75760405162461bcd60e51b81526020600482015260126024820152714c6f636b2074696d6520746f6f206c6f6e6760701b604482015260640161039d565b6109c462093a80426116b2565b821015610a135760405162461bcd60e51b815260206004820152601f60248201527f4c6f636b2074696d65206d75737420626520696e207468652066757475726500604482015260640161039d565b6000610a27826000015483600101546110d8565b600183018490558254909150600090610a4090856110d8565b3360009081526005602052604081208054929350600192909190610a659084906116b2565b9091555050336000818152600560209081526040808320548151606081018352868152808401858152428285019081529686526006855283862083875290945291909320905181559051600182015591516002909201919091556003548290610acf90859061169f565b610ad991906116b2565b600381905550600160086000828254610af291906116b2565b909155505060408051606080820183526003548252600060208084018281524285870181815260085485526007845293879020955186559051600186015591516002909401939093558754845190815292830189905282840152915133927f36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e928290030190a25050505061085860018055565b610b8d611543565b6001600160a01b038116610be35760405162461bcd60e51b815260206004820152601f60248201527f4c5020746f6b656e20616464726573732063616e6e6f74206265207a65726f00604482015260640161039d565b60035415610c505760405162461bcd60e51b815260206004820152603460248201527f43616e6e6f74206368616e6765204c5020746f6b656e206166746572206c6f636044820152731adcc81a185d99481899595b8818dc99585d195960621b606482015260840161039d565b600280546001600160a01b0319166001600160a01b0383169081179091556040517f97e55bb318d98381459adc6798c88be81db93422fa9002274b3d280e421a152990600090a250565b610ca26111db565b60008211610cf25760405162461bcd60e51b815260206004820152601960248201527f4d757374206c6f636b206e6f6e2d7a65726f20616d6f756e7400000000000000604482015260640161039d565b428111610d415760405162461bcd60e51b815260206004820152601f60248201527f4c6f636b2074696d65206d75737420626520696e207468652066757475726500604482015260640161039d565b610d4e62093a80426116b2565b811015610da75760405162461bcd60e51b815260206004820152602160248201527f4c6f636b2074696d65206d757374206265206174206c656173742031207765656044820152606b60f81b606482015260840161039d565b610db5630784ce00426116b2565b811115610df95760405162461bcd60e51b81526020600482015260126024820152714c6f636b2074696d6520746f6f206c6f6e6760701b604482015260640161039d565b336000908152600460205260409020805415610e4d5760405162461bcd60e51b81526020600482015260136024820152724c6f636b20616c72656164792065786973747360681b604482015260640161039d565b6002546040516323b872dd60e01b8152336004820152306024820152604481018590526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015610ea4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec891906116c5565b610ee45760405162461bcd60e51b815260040161039d906116e7565b828155600181018290556000610efa84846110d8565b600354909150610f0a82826116b2565b600355336000908152600560205260408120805460019290610f2d9084906116b2565b9091555050336000908152600560209081526040918290205482516060810190935284835291908101610f60428861169f565b610f6a9086611710565b8152426020918201523360009081526006825260408082208583528352808220845181559284015160018085019190915593015160029092019190915560088054909190610fb99084906116b2565b90915550506040805160608101909152600354815260208101610fdc428861169f565b610fe69086611710565b600760006001600854610ff9919061169f565b81526020019081526020016000206001015461101591906116b2565b81524260209182018190526008546000908152600783526040908190208451815584840151600182015593810151600290940193909355825189815291820188905281830152905133917f36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e919081900360600190a26003546040805184815260208101929092527f5e2aa66efd74cce82b21852e317e5490d9ecc9e6bb953ae24d90851258cc2f5c910160405180910390a1505050506110d460018055565b5050565b60008215806110e75750428211155b156110f45750600061115f565b6000611100428461169f565b9050630784ce008111156111155750630784ce005b6000630784ce0061112e83670de0b6b3a7640000611732565b6111389190611710565b90506000670de0b6b3a764000061114f8388611732565b6111599190611710565b93505050505b92915050565b61116d611543565b6001600160a01b0381166111d25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161039d565b6108588161159d565b60026001540361122d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161039d565b6002600155565b61125860405180606001604052806000815260200160008152602001600081525090565b61127c60405180606001604052806000815260200160008152602001600081525090565b6000611290856000015186602001516110d8565b905060006112a6856000015186602001516110d8565b6001600160a01b038816600090815260056020526040812080549293506001929091906112d49084906116b2565b90915550506001600160a01b038716600090815260056020908152604082205490880151909190819042101561134f576000428a60200151611316919061169f565b9050630784ce0081111561132b5750630784ce005b8951819061134190670de0b6b3a7640000611732565b61134b9190611710565b9250505b42886020015111156113a657600042896020015161136d919061169f565b9050630784ce008111156113825750630784ce005b8851819061139890670de0b6b3a7640000611732565b6113a29190611710565b9150505b8487526020808801839052426040808a018290528689528883018481528982019283526001600160a01b038e16600090815260068552828120888252909452908320895181559051600180830191909155915160029091015560088054919290916114129084906116b2565b90915550506003548561142586836116b2565b61142f919061169f565b600381905550600060076000600160085461144a919061169f565b81526020019081526020016000206040518060600160405290816000820154815260200160018201548152602001600282015481525050905060405180606001604052808888846000015161149f91906116b2565b6114a9919061169f565b8152602001858584602001516114bf91906116b2565b6114c9919061169f565b81524260209182015260085460009081526007825260409081902083518155838301516001820155928101516002909301929092556003548251858152918201527f5e2aa66efd74cce82b21852e317e5490d9ecc9e6bb953ae24d90851258cc2f5c910160405180910390a1505050505050505050505050565b6000546001600160a01b031633146106215760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161039d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b038116811461160457600080fd5b919050565b6000806040838503121561161c57600080fd5b611625836115ed565b946020939093013593505050565b60006020828403121561164557600080fd5b5035919050565b60006020828403121561165e57600080fd5b61089b826115ed565b6000806040838503121561167a57600080fd5b50508035926020909101359150565b634e487b7160e01b600052601160045260246000fd5b8181038181111561115f5761115f611689565b8082018082111561115f5761115f611689565b6000602082840312156116d757600080fd5b8151801515811461089b57600080fd5b6020808252600f908201526e151c985b9cd9995c8819985a5b1959608a1b604082015260600190565b60008261172d57634e487b7160e01b600052601260045260246000fd5b500490565b808202811582820484141761115f5761115f61168956fea2646970667358221220d7fd47ad4ead31cd5e0448005ffd6ad4325f0228bed3ecfce574bca97598134e64736f6c63430008140033000000000000000000000000fbd43f75e09bfbcdef8b95cefabf980311e6d62f
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806381fc83bb116100ad5780639ee933b5116100715780639ee933b5146102d9578063b52c05fe146102ec578063cbf9fe5f146102ff578063ef9889ee14610326578063f2fde38b1461033957600080fd5b806381fc83bb1461025d578063828047a51461027d5780638ad4c447146102905780638da5cb5b146102bf578063900cf0cf146102d057600080fd5b80635fcbd285116100f45780635fcbd285146101b4578063671b3793146101df5780636b9db4e6146101e757806370a0823114610242578063715018a61461025557600080fd5b806318160ddd1461012657806334d901a4146101425780633ccfd60b14610197578063403f4447146101a1575b600080fd5b61012f60035481565b6040519081526020015b60405180910390f35b61017c610150366004611609565b600660209081526000928352604080842090915290825290208054600182015460029092015490919083565b60408051938452602084019290925290820152606001610139565b61019f61034c565b005b61019f6101af366004611633565b610623565b6002546101c7906001600160a01b031681565b6040516001600160a01b039091168152602001610139565b60035461012f565b61022d6101f536600461164c565b6001600160a01b0316600090815260046020908152604091829020825180840190935280548084526001909101549290910182905291565b60408051928352602083019190915201610139565b61012f61025036600461164c565b61085b565b61019f6108a2565b61012f61026b36600461164c565b60056020526000908152604090205481565b61019f61028b366004611633565b6108b4565b61017c61029e366004611633565b60076020526000908152604090208054600182015460029092015490919083565b6000546001600160a01b03166101c7565b61012f60085481565b61019f6102e736600461164c565b610b85565b61019f6102fa366004611667565b610c9a565b61022d61030d36600461164c565b6004602052600090815260409020805460019091015482565b61012f610334366004611667565b6110d8565b61019f61034736600461164c565b611165565b6103546111db565b33600090815260046020526040902080546103a65760405162461bcd60e51b815260206004820152600d60248201526c139bc81b1bd8dac8199bdd5b99609a1b60448201526064015b60405180910390fd5b80600101544210156103ed5760405162461bcd60e51b815260206004820152601060248201526f131bd8dac81b9bdd08195e1c1a5c995960821b604482015260640161039d565b805460008083556001830181905561040582826110d8565b9050801561042f57806003541161041d57600061042b565b8060035461042b919061169f565b6003555b33600090815260056020526040812080546001929061044f9084906116b2565b9091555050336000818152600560209081526040808320548151606081018352848152808401858152428285019081529686526006855283862083875290945291842091518255915160018083019190915593516002909101556008805491939290916104bd9084906116b2565b90915550506040805160608101825260035481526000602080830182815242848601908152600854845260079092529184902092518355905160018301555160029182015554905163a9059cbb60e01b8152336004820152602481018590526001600160a01b039091169063a9059cbb906044016020604051808303816000875af1158015610550573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061057491906116c5565b6105905760405162461bcd60e51b815260040161039d906116e7565b6040805184815242602082015233917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b568910160405180910390a27f5e2aa66efd74cce82b21852e317e5490d9ecc9e6bb953ae24d90851258cc2f5c826003546105f991906116b2565b6003546040805192835260208301919091520160405180910390a15050505061062160018055565b565b61062b6111db565b336000908152600460205260409020816106875760405162461bcd60e51b815260206004820181905260248201527f4d75737420696e637265617365206279206e6f6e2d7a65726f20616d6f756e74604482015260640161039d565b80546106ce5760405162461bcd60e51b8152602060048201526016602482015275139bc8195e1a5cdd1a5b99c81b1bd8dac8199bdd5b9960521b604482015260640161039d565b428160010154116107105760405162461bcd60e51b815260206004820152600c60248201526b131bd8dac8195e1c1a5c995960a21b604482015260640161039d565b60408051808201825282548082526001840154602083015282518084019093526107569233929181906107449088906116b2565b81526020018560010154815250611234565b8181600001600082825461076a91906116b2565b90915550506002546040516323b872dd60e01b8152336004820152306024820152604481018490526001600160a01b03909116906323b872dd906064016020604051808303816000875af11580156107c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ea91906116c5565b6108065760405162461bcd60e51b815260040161039d906116e7565b6001810154604080518481526020810192909252429082015233907f36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e9060600160405180910390a25061085860018055565b50565b6001600160a01b038116600090815260046020908152604080832081518083019092528054808352600190910154928201839052909161089b91906110d8565b9392505050565b6108aa611543565b610621600061159d565b6108bc6111db565b33600090815260046020526040902080546109125760405162461bcd60e51b8152602060048201526016602482015275139bc8195e1a5cdd1a5b99c81b1bd8dac8199bdd5b9960521b604482015260640161039d565b806001015482116109655760405162461bcd60e51b815260206004820152601960248201527f43616e6e6f74206465637265617365206c6f636b2074696d6500000000000000604482015260640161039d565b610973630784ce00426116b2565b8211156109b75760405162461bcd60e51b81526020600482015260126024820152714c6f636b2074696d6520746f6f206c6f6e6760701b604482015260640161039d565b6109c462093a80426116b2565b821015610a135760405162461bcd60e51b815260206004820152601f60248201527f4c6f636b2074696d65206d75737420626520696e207468652066757475726500604482015260640161039d565b6000610a27826000015483600101546110d8565b600183018490558254909150600090610a4090856110d8565b3360009081526005602052604081208054929350600192909190610a659084906116b2565b9091555050336000818152600560209081526040808320548151606081018352868152808401858152428285019081529686526006855283862083875290945291909320905181559051600182015591516002909201919091556003548290610acf90859061169f565b610ad991906116b2565b600381905550600160086000828254610af291906116b2565b909155505060408051606080820183526003548252600060208084018281524285870181815260085485526007845293879020955186559051600186015591516002909401939093558754845190815292830189905282840152915133927f36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e928290030190a25050505061085860018055565b610b8d611543565b6001600160a01b038116610be35760405162461bcd60e51b815260206004820152601f60248201527f4c5020746f6b656e20616464726573732063616e6e6f74206265207a65726f00604482015260640161039d565b60035415610c505760405162461bcd60e51b815260206004820152603460248201527f43616e6e6f74206368616e6765204c5020746f6b656e206166746572206c6f636044820152731adcc81a185d99481899595b8818dc99585d195960621b606482015260840161039d565b600280546001600160a01b0319166001600160a01b0383169081179091556040517f97e55bb318d98381459adc6798c88be81db93422fa9002274b3d280e421a152990600090a250565b610ca26111db565b60008211610cf25760405162461bcd60e51b815260206004820152601960248201527f4d757374206c6f636b206e6f6e2d7a65726f20616d6f756e7400000000000000604482015260640161039d565b428111610d415760405162461bcd60e51b815260206004820152601f60248201527f4c6f636b2074696d65206d75737420626520696e207468652066757475726500604482015260640161039d565b610d4e62093a80426116b2565b811015610da75760405162461bcd60e51b815260206004820152602160248201527f4c6f636b2074696d65206d757374206265206174206c656173742031207765656044820152606b60f81b606482015260840161039d565b610db5630784ce00426116b2565b811115610df95760405162461bcd60e51b81526020600482015260126024820152714c6f636b2074696d6520746f6f206c6f6e6760701b604482015260640161039d565b336000908152600460205260409020805415610e4d5760405162461bcd60e51b81526020600482015260136024820152724c6f636b20616c72656164792065786973747360681b604482015260640161039d565b6002546040516323b872dd60e01b8152336004820152306024820152604481018590526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015610ea4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ec891906116c5565b610ee45760405162461bcd60e51b815260040161039d906116e7565b828155600181018290556000610efa84846110d8565b600354909150610f0a82826116b2565b600355336000908152600560205260408120805460019290610f2d9084906116b2565b9091555050336000908152600560209081526040918290205482516060810190935284835291908101610f60428861169f565b610f6a9086611710565b8152426020918201523360009081526006825260408082208583528352808220845181559284015160018085019190915593015160029092019190915560088054909190610fb99084906116b2565b90915550506040805160608101909152600354815260208101610fdc428861169f565b610fe69086611710565b600760006001600854610ff9919061169f565b81526020019081526020016000206001015461101591906116b2565b81524260209182018190526008546000908152600783526040908190208451815584840151600182015593810151600290940193909355825189815291820188905281830152905133917f36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e919081900360600190a26003546040805184815260208101929092527f5e2aa66efd74cce82b21852e317e5490d9ecc9e6bb953ae24d90851258cc2f5c910160405180910390a1505050506110d460018055565b5050565b60008215806110e75750428211155b156110f45750600061115f565b6000611100428461169f565b9050630784ce008111156111155750630784ce005b6000630784ce0061112e83670de0b6b3a7640000611732565b6111389190611710565b90506000670de0b6b3a764000061114f8388611732565b6111599190611710565b93505050505b92915050565b61116d611543565b6001600160a01b0381166111d25760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161039d565b6108588161159d565b60026001540361122d5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161039d565b6002600155565b61125860405180606001604052806000815260200160008152602001600081525090565b61127c60405180606001604052806000815260200160008152602001600081525090565b6000611290856000015186602001516110d8565b905060006112a6856000015186602001516110d8565b6001600160a01b038816600090815260056020526040812080549293506001929091906112d49084906116b2565b90915550506001600160a01b038716600090815260056020908152604082205490880151909190819042101561134f576000428a60200151611316919061169f565b9050630784ce0081111561132b5750630784ce005b8951819061134190670de0b6b3a7640000611732565b61134b9190611710565b9250505b42886020015111156113a657600042896020015161136d919061169f565b9050630784ce008111156113825750630784ce005b8851819061139890670de0b6b3a7640000611732565b6113a29190611710565b9150505b8487526020808801839052426040808a018290528689528883018481528982019283526001600160a01b038e16600090815260068552828120888252909452908320895181559051600180830191909155915160029091015560088054919290916114129084906116b2565b90915550506003548561142586836116b2565b61142f919061169f565b600381905550600060076000600160085461144a919061169f565b81526020019081526020016000206040518060600160405290816000820154815260200160018201548152602001600282015481525050905060405180606001604052808888846000015161149f91906116b2565b6114a9919061169f565b8152602001858584602001516114bf91906116b2565b6114c9919061169f565b81524260209182015260085460009081526007825260409081902083518155838301516001820155928101516002909301929092556003548251858152918201527f5e2aa66efd74cce82b21852e317e5490d9ecc9e6bb953ae24d90851258cc2f5c910160405180910390a1505050505050505050505050565b6000546001600160a01b031633146106215760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161039d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b038116811461160457600080fd5b919050565b6000806040838503121561161c57600080fd5b611625836115ed565b946020939093013593505050565b60006020828403121561164557600080fd5b5035919050565b60006020828403121561165e57600080fd5b61089b826115ed565b6000806040838503121561167a57600080fd5b50508035926020909101359150565b634e487b7160e01b600052601160045260246000fd5b8181038181111561115f5761115f611689565b8082018082111561115f5761115f611689565b6000602082840312156116d757600080fd5b8151801515811461089b57600080fd5b6020808252600f908201526e151c985b9cd9995c8819985a5b1959608a1b604082015260600190565b60008261172d57634e487b7160e01b600052601260045260246000fd5b500490565b808202811582820484141761115f5761115f61168956fea2646970667358221220d7fd47ad4ead31cd5e0448005ffd6ad4325f0228bed3ecfce574bca97598134e64736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000fbd43f75e09bfbcdef8b95cefabf980311e6d62f
-----Decoded View---------------
Arg [0] : _lpToken (address): 0xfbd43F75e09bfBcDeF8B95CEfAbf980311E6d62F
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000fbd43f75e09bfbcdef8b95cefabf980311e6d62f
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in S
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
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.