Overview
POL Balance
0 POL
POL Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 internal transactions (View All)
Loading...
Loading
Contract Name:
ERC20FriendlyRewardModuleFactory
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 10000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
/* ERC20FriendlyRewardModuleFactory https://github.com/gysr-io/core SPDX-License-Identifier: MIT */ pragma solidity 0.8.4; import "./interfaces/IModuleFactory.sol"; import "./ERC20FriendlyRewardModule.sol"; /** * @title ERC20 friendly reward module factory * * @notice this factory contract handles deployment for the * ERC20FriendlyRewardModule contract * * @dev it is called by the parent PoolFactory and is responsible * for parsing constructor arguments before creating a new contract */ contract ERC20FriendlyRewardModuleFactory is IModuleFactory { /** * @inheritdoc IModuleFactory */ function createModule(bytes calldata data) external override returns (address) { // validate require(data.length == 96, "frmf1"); // parse constructor arguments address token; uint256 penaltyStart; uint256 penaltyPeriod; assembly { token := calldataload(68) penaltyStart := calldataload(100) penaltyPeriod := calldataload(132) } // create module ERC20FriendlyRewardModule module = new ERC20FriendlyRewardModule( token, penaltyStart, penaltyPeriod, address(this) ); module.transferOwnership(msg.sender); // output emit ModuleCreated(msg.sender, address(module)); return address(module); } }
/* ERC20BaseRewardModule https://github.com/gysr-io/core SPDX-License-Identifier: MIT */ pragma solidity 0.8.4; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./interfaces/IRewardModule.sol"; /** * @title ERC20 base reward module * * @notice this abstract class implements common ERC20 funding and unlocking * logic, which is inherited by other reward modules. */ abstract contract ERC20BaseRewardModule is IRewardModule { using SafeERC20 for IERC20; // single funding/reward schedule struct Funding { uint256 amount; uint256 shares; uint256 locked; uint256 updated; uint256 start; uint256 duration; } // constants uint256 public constant INITIAL_SHARES_PER_TOKEN = 10**6; uint256 public constant MAX_ACTIVE_FUNDINGS = 16; // funding/reward state fields mapping(address => Funding[]) private _fundings; mapping(address => uint256) private _shares; mapping(address => uint256) private _locked; /** * @notice getter for total token shares */ function totalShares(address token) public view returns (uint256) { return _shares[token]; } /** * @notice getter for total locked token shares */ function lockedShares(address token) public view returns (uint256) { return _locked[token]; } /** * @notice getter for funding schedule struct */ function fundings(address token, uint256 index) public view returns ( uint256 amount, uint256 shares, uint256 locked, uint256 updated, uint256 start, uint256 duration ) { Funding storage f = _fundings[token][index]; return (f.amount, f.shares, f.locked, f.updated, f.start, f.duration); } /** * @param token contract address of reward token * @return number of active funding schedules */ function fundingCount(address token) public view returns (uint256) { return _fundings[token].length; } /** * @notice compute number of unlockable shares for a specific funding schedule * @param token contract address of reward token * @param idx index of the funding * @return the number of unlockable shares */ function unlockable(address token, uint256 idx) public view returns (uint256) { Funding storage funding = _fundings[token][idx]; // funding schedule is in future if (block.timestamp < funding.start) { return 0; } // empty if (funding.locked == 0) { return 0; } // handle zero-duration period or leftover dust from integer division if (block.timestamp >= funding.start + funding.duration) { return funding.locked; } return ((block.timestamp - funding.updated) * funding.shares) / funding.duration; } /** * @notice fund pool by locking up reward tokens for future distribution * @param token contract address of reward token * @param amount number of reward tokens to lock up as funding * @param duration period (seconds) over which funding will be unlocked * @param start time (seconds) at which funding begins to unlock */ function _fund( address token, uint256 amount, uint256 duration, uint256 start ) internal { requireController(); // validate require(amount > 0, "rm1"); require(start >= block.timestamp, "rm2"); require(_fundings[token].length < MAX_ACTIVE_FUNDINGS, "rm3"); IERC20 rewardToken = IERC20(token); // do transfer of funding uint256 total = rewardToken.balanceOf(address(this)); rewardToken.safeTransferFrom(msg.sender, address(this), amount); uint256 actual = rewardToken.balanceOf(address(this)) - total; // mint shares at current rate uint256 minted = (total > 0) ? (_shares[token] * actual) / total : actual * INITIAL_SHARES_PER_TOKEN; _locked[token] += minted; _shares[token] += minted; // create new funding _fundings[token].push( Funding({ amount: amount, shares: minted, locked: minted, updated: start, start: start, duration: duration }) ); emit RewardsFunded(token, amount, minted, start); } /** * @dev internal function to clean up stale funding schedules * @param token contract address of reward token to clean up */ function _clean(address token) internal { // check for stale funding schedules to expire uint256 removed = 0; uint256 originalSize = _fundings[token].length; for (uint256 i = 0; i < originalSize; i++) { Funding storage funding = _fundings[token][i - removed]; uint256 idx = i - removed; if ( unlockable(token, idx) == 0 && block.timestamp >= funding.start + funding.duration ) { emit RewardsExpired( token, funding.amount, funding.shares, funding.start ); // remove at idx by copying last element here, then popping off last // (we don't care about order) _fundings[token][idx] = _fundings[token][ _fundings[token].length - 1 ]; _fundings[token].pop(); removed++; } } } /** * @dev unlocks reward tokens based on funding schedules * @param token contract addres of reward token * @return shares number of shares unlocked */ function _unlockTokens(address token) internal returns (uint256 shares) { // get unlockable shares for each funding schedule for (uint256 i = 0; i < _fundings[token].length; i++) { uint256 s = unlockable(token, i); Funding storage funding = _fundings[token][i]; if (s > 0) { funding.locked -= s; funding.updated = block.timestamp; shares += s; } } // do unlocking if (shares > 0) { _locked[token] -= shares; emit RewardsUnlocked(token, shares); } } /** * @dev distribute reward tokens to user * @param user address of user receiving rweard * @param token contract address of reward token * @param shares number of shares to be distributed * @return amount number of reward tokens distributed */ function _distribute( address user, address token, uint256 shares ) internal returns (uint256 amount) { // compute reward amount in tokens IERC20 rewardToken = IERC20(token); amount = (rewardToken.balanceOf(address(this)) * shares) / _shares[token]; // update overall reward shares _shares[token] -= shares; // do reward rewardToken.safeTransfer(user, amount); emit RewardsDistributed(user, token, amount, shares); } }
/* ERC20FriendlyRewardModule https://github.com/gysr-io/core SPDX-License-Identifier: MIT */ pragma solidity 0.8.4; import "./interfaces/IRewardModule.sol"; import "./interfaces/IEvents.sol"; import "./ERC20BaseRewardModule.sol"; import "./GysrUtils.sol"; /** * @title ERC20 friendly reward module * * @notice this reward module distributes a single ERC20 token as the staking reward. * It is designed to offer simple and predictable reward mechanics. * * @dev rewards are immutable once earned, and can be claimed by the user at * any time. The module can be configured with a linear vesting schedule to * incentivize longer term staking. The user can spend GYSR at the time of * staking to receive a multiplier on their earning rate. */ contract ERC20FriendlyRewardModule is ERC20BaseRewardModule { using GysrUtils for uint256; // constants uint256 public constant FULL_VESTING = 10**DECIMALS; // single stake by user struct Stake { uint256 shares; uint256 gysr; uint256 bonus; uint256 rewardTally; uint256 timestamp; } // mapping of user to all of their stakes mapping(address => Stake[]) public stakes; // total shares without GYSR multiplier applied uint256 public totalRawStakingShares; // total shares with GYSR multiplier applied uint256 public totalStakingShares; // counter representing the current rate of rewards per share uint256 public rewardsPerStakedShare; // value to keep track of earnings to be put back into the pool uint256 public rewardDust; // timestamp of last update uint256 public lastUpdated; // minimum ratio of earned rewards measured against FULL_VESTING (i.e. 2.5 * 10^17 would be 25%) uint256 public immutable vestingStart; // length of time in seconds until the user receives a FULL_VESTING (1x) multiplier on rewards uint256 public immutable vestingPeriod; IERC20 private immutable _token; address private immutable _factory; /** * @param token_ the token that will be rewarded * @param vestingStart_ minimum ratio earned * @param vestingPeriod_ period (in seconds) over which investors vest to 100% * @param factory_ address of module factory */ constructor( address token_, uint256 vestingStart_, uint256 vestingPeriod_, address factory_ ) { require(vestingStart_ <= FULL_VESTING, "frm1"); _token = IERC20(token_); _factory = factory_; vestingStart = vestingStart_; vestingPeriod = vestingPeriod_; lastUpdated = block.timestamp; } /** * @inheritdoc IRewardModule */ function tokens() external view override returns (address[] memory tokens_) { tokens_ = new address[](1); tokens_[0] = address(_token); } /** * @inheritdoc IRewardModule */ function factory() external view override returns (address) { return _factory; } /** * @inheritdoc IRewardModule */ function balances() external view override returns (uint256[] memory balances_) { balances_ = new uint256[](1); balances_[0] = totalLocked(); } /** * @inheritdoc IRewardModule */ function usage() external view override returns (uint256) { return _usage(); } /** * @inheritdoc IRewardModule */ function stake( address account, address user, uint256 shares, bytes calldata data ) external override onlyOwner returns (uint256, uint256) { _update(); return _stake(account, user, shares, data); } /** * @notice internal implementation of stake method * @param account address of staking account * @param user address of user * @param shares number of new shares minted * @param data addtional data * @return amount of gysr spent * @return amount of gysr vested */ function _stake( address account, address user, uint256 shares, bytes calldata data ) internal returns (uint256, uint256) { require(data.length == 0 || data.length == 32, "frm2"); uint256 gysr; if (data.length == 32) { assembly { gysr := calldataload(164) } } uint256 bonus = gysr.gysrBonus(shares, totalRawStakingShares + shares, _usage()); if (gysr > 0) { emit GysrSpent(user, gysr); } // update user staking info stakes[account].push( Stake(shares, gysr, bonus, rewardsPerStakedShare, block.timestamp) ); // add new shares to global totals totalRawStakingShares += shares; totalStakingShares += (shares * bonus) / 10**DECIMALS; return (gysr, 0); } /** * @inheritdoc IRewardModule */ function unstake( address account, address user, uint256 shares, bytes calldata ) external override onlyOwner returns (uint256, uint256) { _update(); return _unstake(account, user, shares); } /** * @notice internal implementation of unstake * @param account address of staking account * @param user address of user * @param shares number of shares burned * @return amount of gysr spent * @return amount of gysr vested */ function _unstake( address account, address user, uint256 shares ) internal returns (uint256, uint256) { // redeem first-in-last-out uint256 sharesLeftToBurn = shares; Stake[] storage userStakes = stakes[account]; uint256 rewardAmount; uint256 gysrVested; uint256 preVestingRewards; uint256 timeVestingCoeff; while (sharesLeftToBurn > 0) { Stake storage lastStake = userStakes[userStakes.length - 1]; if (lastStake.shares <= sharesLeftToBurn) { // fully redeem a past stake preVestingRewards = _rewardForStakedShares( lastStake.shares, lastStake.bonus, lastStake.rewardTally ); timeVestingCoeff = timeVestingCoefficient(lastStake.timestamp); rewardAmount += (preVestingRewards * timeVestingCoeff) / 10**DECIMALS; rewardDust += (preVestingRewards * (FULL_VESTING - timeVestingCoeff)) / 10**DECIMALS; totalStakingShares -= (lastStake.shares * lastStake.bonus) / 10**DECIMALS; sharesLeftToBurn -= lastStake.shares; gysrVested += lastStake.gysr; userStakes.pop(); } else { // partially redeem a past stake preVestingRewards = _rewardForStakedShares( sharesLeftToBurn, lastStake.bonus, lastStake.rewardTally ); timeVestingCoeff = timeVestingCoefficient(lastStake.timestamp); rewardAmount += (preVestingRewards * timeVestingCoeff) / 10**DECIMALS; rewardDust += (preVestingRewards * (FULL_VESTING - timeVestingCoeff)) / 10**DECIMALS; totalStakingShares -= (sharesLeftToBurn * lastStake.bonus) / 10**DECIMALS; uint256 partialVested = (sharesLeftToBurn * lastStake.gysr) / lastStake.shares; gysrVested += partialVested; lastStake.shares -= sharesLeftToBurn; lastStake.gysr -= partialVested; sharesLeftToBurn = 0; } } // update global totals totalRawStakingShares -= shares; if (rewardAmount > 0) { _distribute(user, address(_token), rewardAmount); } if (gysrVested > 0) { emit GysrVested(user, gysrVested); } return (0, gysrVested); } /** * @inheritdoc IRewardModule */ function claim( address account, address user, uint256 shares, bytes calldata data ) external override onlyOwner returns (uint256 spent, uint256 vested) { _update(); (, vested) = _unstake(account, user, shares); (spent, ) = _stake(account, user, shares, data); } /** * @dev compute rewards owed for a specific stake * @param shares number of shares to calculate rewards for * @param bonus associated bonus for this stake * @param rewardTally associated rewardTally for this stake * @return reward for these staked shares */ function _rewardForStakedShares( uint256 shares, uint256 bonus, uint256 rewardTally ) internal view returns (uint256) { return ((((rewardsPerStakedShare - rewardTally) * shares) / 10**DECIMALS) * // counteract rewardsPerStakedShare coefficient bonus) / 10**DECIMALS; // counteract bonus coefficient } /** * @notice compute vesting multiplier as function of staking time * @param time epoch time at which the tokens were staked * @return vesting multiplier rewards */ function timeVestingCoefficient(uint256 time) public view returns (uint256) { if (vestingPeriod == 0) return FULL_VESTING; uint256 stakeTime = block.timestamp - time; if (stakeTime > vestingPeriod) return FULL_VESTING; return vestingStart + (stakeTime * (FULL_VESTING - vestingStart)) / vestingPeriod; } /** * @inheritdoc IRewardModule */ function update(address) external override { requireOwner(); _update(); } /** * @notice method called ad hoc to clean up and perform additional accounting * @dev will only be called manually, and should not contain any essential logic */ function clean() external override { requireOwner(); _update(); _clean(address(_token)); } /** * @notice fund Geyser by locking up reward tokens for distribution * @param amount number of reward tokens to lock up as funding * @param duration period (seconds) over which funding will be unlocked */ function fund(uint256 amount, uint256 duration) external { _update(); _fund(address(_token), amount, duration, block.timestamp); } /** * @notice fund Geyser by locking up reward tokens for distribution * @param amount number of reward tokens to lock up as funding * @param duration period (seconds) over which funding will be unlocked * @param start time (seconds) at which funding begins to unlock */ function fund( uint256 amount, uint256 duration, uint256 start ) external { _update(); _fund(address(_token), amount, duration, start); } /** * @dev updates the internal accounting for rewards per staked share * retrieves unlocked tokens and adds on any unvested rewards from the last unstake operation */ function _update() private { lastUpdated = block.timestamp; if (totalStakingShares == 0) { rewardsPerStakedShare = 0; return; } uint256 rewardsToUnlock = _unlockTokens(address(_token)) + rewardDust; rewardDust = 0; // global accounting rewardsPerStakedShare += (rewardsToUnlock * 10**DECIMALS) / totalStakingShares; } /** * @return total number of locked reward tokens */ function totalLocked() public view returns (uint256) { if (lockedShares(address(_token)) == 0) { return 0; } return (_token.balanceOf(address(this)) * lockedShares(address(_token))) / totalShares(address(_token)); } /** * @return total number of unlocked reward tokens */ function totalUnlocked() public view returns (uint256) { uint256 unlockedShares = totalShares(address(_token)) - lockedShares(address(_token)); if (unlockedShares == 0) { return 0; } return (_token.balanceOf(address(this)) * unlockedShares) / totalShares(address(_token)); } /** * @dev internal helper to get current usage ratio * @return GYSR usage ratio */ function _usage() private view returns (uint256) { if (totalStakingShares == 0) { return 0; } return ((totalStakingShares - totalRawStakingShares) * 10**DECIMALS) / totalStakingShares; } /** * @param addr address of interest * @return number of active stakes for user */ function stakeCount(address addr) public view returns (uint256) { return stakes[addr].length; } }
/* GYSRUtils https://github.com/gysr-io/core SPDX-License-Identifier: MIT */ pragma solidity 0.8.4; import "./MathUtils.sol"; /** * @title GYSR utilities * * @notice this library implements utility methods for the GYSR multiplier * and spending mechanics */ library GysrUtils { using MathUtils for int128; // constants uint256 public constant DECIMALS = 18; uint256 public constant GYSR_PROPORTION = 10**(DECIMALS - 2); // 1% /** * @notice compute GYSR bonus as a function of usage ratio, stake amount, * and GYSR spent * @param gysr number of GYSR token applied to bonus * @param amount number of tokens or shares to unstake * @param total number of tokens or shares in overall pool * @param ratio usage ratio from 0 to 1 * @return multiplier value */ function gysrBonus( uint256 gysr, uint256 amount, uint256 total, uint256 ratio ) internal pure returns (uint256) { if (amount == 0) { return 0; } if (total == 0) { return 0; } if (gysr == 0) { return 10**DECIMALS; } // scale GYSR amount with respect to proportion uint256 portion = (GYSR_PROPORTION * total) / 10**DECIMALS; if (amount > portion) { gysr = (gysr * portion) / amount; } // 1 + gysr / (0.01 + ratio) uint256 x = 2**64 + (2**64 * gysr) / (10**(DECIMALS - 2) + ratio); return 10**DECIMALS + (uint256(int256(int128(uint128(x)).logbase10())) * 10**DECIMALS) / 2**64; } }
/* MathUtils https://github.com/gysr-io/core SPDX-License-Identifier: BSD-4-Clause */ pragma solidity 0.8.4; /** * @title Math utilities * * @notice this library implements various logarithmic math utilies which support * other contracts and specifically the GYSR multiplier calculation * * @dev h/t https://github.com/abdk-consulting/abdk-libraries-solidity */ library MathUtils { /** * @notice calculate binary logarithm of x * * @param x signed 64.64-bit fixed point number, require x > 0 * @return signed 64.64-bit fixed point number */ function logbase2(int128 x) internal pure returns (int128) { unchecked { require(x > 0); int256 msb = 0; int256 xc = x; if (xc >= 0x10000000000000000) { xc >>= 64; msb += 64; } if (xc >= 0x100000000) { xc >>= 32; msb += 32; } if (xc >= 0x10000) { xc >>= 16; msb += 16; } if (xc >= 0x100) { xc >>= 8; msb += 8; } if (xc >= 0x10) { xc >>= 4; msb += 4; } if (xc >= 0x4) { xc >>= 2; msb += 2; } if (xc >= 0x2) msb += 1; // No need to shift xc anymore int256 result = (msb - 64) << 64; uint256 ux = uint256(int256(x)) << uint256(127 - msb); for (int256 bit = 0x8000000000000000; bit > 0; bit >>= 1) { ux *= ux; uint256 b = ux >> 255; ux >>= 127 + b; result += bit * int256(b); } return int128(result); } } /** * @notice calculate natural logarithm of x * @dev magic constant comes from ln(2) * 2^128 -> hex * @param x signed 64.64-bit fixed point number, require x > 0 * @return signed 64.64-bit fixed point number */ function ln(int128 x) internal pure returns (int128) { unchecked { require(x > 0); return int128( int256( (uint256(int256(logbase2(x))) * 0xB17217F7D1CF79ABC9E3B39803F2F6AF) >> 128 ) ); } } /** * @notice calculate logarithm base 10 of x * @dev magic constant comes from log10(2) * 2^128 -> hex * @param x signed 64.64-bit fixed point number, require x > 0 * @return signed 64.64-bit fixed point number */ function logbase10(int128 x) internal pure returns (int128) { require(x > 0); return int128( int256( (uint256(int256(logbase2(x))) * 0x4d104d427de7fce20a6e420e02236748) >> 128 ) ); } // wrapper functions to allow testing function testlogbase2(int128 x) public pure returns (int128) { return logbase2(x); } function testlogbase10(int128 x) public pure returns (int128) { return logbase10(x); } }
/* OwnerController https://github.com/gysr-io/core SPDX-License-Identifier: MIT */ pragma solidity 0.8.4; /** * @title Owner controller * * @notice this base contract implements an owner-controller access model. * * @dev the contract is an adapted version of the OpenZeppelin Ownable contract. * It allows the owner to designate an additional account as the controller to * perform restricted operations. * * Other changes include supporting role verification with a require method * in addition to the modifier option, and removing some unneeded functionality. * * Original contract here: * https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol */ contract OwnerController { address private _owner; address private _controller; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); event ControlTransferred( address indexed previousController, address indexed newController ); constructor() { _owner = msg.sender; _controller = msg.sender; emit OwnershipTransferred(address(0), _owner); emit ControlTransferred(address(0), _owner); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Returns the address of the current controller. */ function controller() public view returns (address) { return _controller; } /** * @dev Modifier that throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == msg.sender, "oc1"); _; } /** * @dev Modifier that throws if called by any account other than the controller. */ modifier onlyController() { require(_controller == msg.sender, "oc2"); _; } /** * @dev Throws if called by any account other than the owner. */ function requireOwner() internal view { require(_owner == msg.sender, "oc1"); } /** * @dev Throws if called by any account other than the controller. */ function requireController() internal view { require(_controller == msg.sender, "oc2"); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). This can * include renouncing ownership by transferring to the zero address. * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual { requireOwner(); require(newOwner != address(0), "oc3"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } /** * @dev Transfers control of the contract to a new account (`newController`). * Can only be called by the owner. */ function transferControl(address newController) public virtual { requireOwner(); require(newController != address(0), "oc4"); emit ControlTransferred(_controller, newController); _controller = newController; } }
/* IEvents https://github.com/gysr-io/core SPDX-License-Identifier: MIT */ pragma solidity 0.8.4; /** * @title GYSR event system * * @notice common interface to define GYSR event system */ interface IEvents { // staking event Staked( address indexed user, address indexed token, uint256 amount, uint256 shares ); event Unstaked( address indexed user, address indexed token, uint256 amount, uint256 shares ); event Claimed( address indexed user, address indexed token, uint256 amount, uint256 shares ); // rewards event RewardsDistributed( address indexed user, address indexed token, uint256 amount, uint256 shares ); event RewardsFunded( address indexed token, uint256 amount, uint256 shares, uint256 timestamp ); event RewardsUnlocked(address indexed token, uint256 shares); event RewardsExpired( address indexed token, uint256 amount, uint256 shares, uint256 timestamp ); // gysr event GysrSpent(address indexed user, uint256 amount); event GysrVested(address indexed user, uint256 amount); event GysrWithdrawn(uint256 amount); }
/* IModuleFactory https://github.com/gysr-io/core SPDX-License-Identifier: MIT */ pragma solidity 0.8.4; /** * @title Module factory interface * * @notice this defines the common module factory interface used by the * main factory to create the staking and reward modules for a new Pool. */ interface IModuleFactory { // events event ModuleCreated(address indexed user, address module); /** * @notice create a new Pool module * @param data binary encoded construction parameters * @return address of newly created module */ function createModule(bytes calldata data) external returns (address); }
/* IRewardModule https://github.com/gysr-io/core SPDX-License-Identifier: MIT */ pragma solidity 0.8.4; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./IEvents.sol"; import "../OwnerController.sol"; /** * @title Reward module interface * * @notice this contract defines the common interface that any reward module * must implement to be compatible with the modular Pool architecture. */ abstract contract IRewardModule is OwnerController, IEvents { // constants uint256 public constant DECIMALS = 18; /** * @return array of reward tokens */ function tokens() external view virtual returns (address[] memory); /** * @return array of reward token balances */ function balances() external view virtual returns (uint256[] memory); /** * @return GYSR usage ratio for reward module */ function usage() external view virtual returns (uint256); /** * @return address of module factory */ function factory() external view virtual returns (address); /** * @notice perform any necessary accounting for new stake * @param account address of staking account * @param user address of user * @param shares number of new shares minted * @param data addtional data * @return amount of gysr spent * @return amount of gysr vested */ function stake( address account, address user, uint256 shares, bytes calldata data ) external virtual returns (uint256, uint256); /** * @notice reward user and perform any necessary accounting for unstake * @param account address of staking account * @param user address of user * @param shares number of shares burned * @param data additional data * @return amount of gysr spent * @return amount of gysr vested */ function unstake( address account, address user, uint256 shares, bytes calldata data ) external virtual returns (uint256, uint256); /** * @notice reward user and perform and necessary accounting for existing stake * @param account address of staking account * @param user address of user * @param shares number of shares being claimed against * @param data addtional data * @return amount of gysr spent * @return amount of gysr vested */ function claim( address account, address user, uint256 shares, bytes calldata data ) external virtual returns (uint256, uint256); /** * @notice method called by anyone to update accounting * @param user address of user for update * @dev will only be called ad hoc and should not contain essential logic */ function update(address user) external virtual; /** * @notice method called by owner to clean up and perform additional accounting * @dev will only be called ad hoc and should not contain any essential logic */ function clean() external virtual; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC20.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // 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"); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // 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); } } } }
{ "remappings": [], "optimizer": { "enabled": true, "runs": 10000 }, "evmVersion": "istanbul", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"module","type":"address"}],"name":"ModuleCreated","type":"event"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"createModule","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50613152806100206000396000f3fe608060405234801561001057600080fd5b506004361061002a5760003560e01c8062ee8fe51461002f575b600080fd5b61004261003d366004610234565b61006b565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6000606082146100db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f66726d6631000000000000000000000000000000000000000000000000000000604482015260640160405180910390fd5b60405160443590606435906084359060009084908490849030906100fe90610227565b73ffffffffffffffffffffffffffffffffffffffff9485168152602081019390935260408301919091529091166060820152608001604051809103906000f08015801561014f573d6000803e3d6000fd5b506040517ff2fde38b00000000000000000000000000000000000000000000000000000000815233600482015290915073ffffffffffffffffffffffffffffffffffffffff82169063f2fde38b90602401600060405180830381600087803b1580156101ba57600080fd5b505af11580156101ce573d6000803e3d6000fd5b505060405173ffffffffffffffffffffffffffffffffffffffff841681523392507ff708942ec477396a151a5285651961dcab8e8a82ea4f5b31a5236f92f6c92710915060200160405180910390a29695505050505050565b612e7b806102a283390190565b60008060208385031215610246578182fd5b823567ffffffffffffffff8082111561025d578384fd5b818501915085601f830112610270578384fd5b81358181111561027e578485fd5b86602082850101111561028f578485fd5b6020929092019691955090935050505056fe6101006040523480156200001257600080fd5b5060405162002e7b38038062002e7b833981016040819052620000359162000153565b60008054336001600160a01b0319918216811783556001805490921681179091556040519091907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3600080546040516001600160a01b0390911691907fa06677f7b64342b4bcbde423684dbdb5356acfe41ad0285b6ecbe6dc4bf427f2908290a3620000c86012600a620001e6565b8311156200010b5760405162461bcd60e51b8152600401620001029060208082526004908201526366726d3160e01b604082015260600190565b60405180910390fd5b6001600160601b0319606094851b811660c052931b90921660e05260805260a05242600a55620002c7565b80516001600160a01b03811681146200014e57600080fd5b919050565b6000806000806080858703121562000169578384fd5b620001748562000136565b93506020850151925060408501519150620001926060860162000136565b905092959194509250565b600181815b80851115620001de578160001904821115620001c257620001c2620002b1565b80851615620001d057918102915b93841c9390800290620001a2565b509250929050565b6000620001f48383620001fb565b9392505050565b6000826200020c57506001620002ab565b816200021b57506000620002ab565b81600181146200023457600281146200023f576200025f565b6001915050620002ab565b60ff841115620002535762000253620002b1565b50506001821b620002ab565b5060208310610133831016604e8410600b841016171562000284575081810a620002ab565b6200029083836200019d565b8060001904821115620002a757620002a7620002b1565b0290505b92915050565b634e487b7160e01b600052601160045260246000fd5b60805160a05160c05160601c60e05160601c612afd6200037e60003960006104f90152600081816105c701528181610765015281816107a8015281816107e10152818161083e01528181610b1201528181610b8201528181610baf01528181610c1501528181610c7401528181611006015281816110480152611a5301526000818161042601528181610e1201528181610e510152610e8c0152600081816102e401528181610ead0152610efc0152612afd6000f3fe608060405234801561001057600080fd5b506004361061025c5760003560e01c80637313ee5a11610145578063c45a0155116100bd578063dc16ceb91161008c578063f2fde38b11610071578063f2fde38b1461057f578063f77c479114610592578063fc4333cd146105a357600080fd5b8063dc16ceb91461054c578063e336ac441461055657600080fd5b8063c45a0155146104f7578063c7537f361461051d578063cecc46c814610530578063d0b06f5d1461054357600080fd5b8063a049820a11610114578063a779d080116100f9578063a779d080146104b3578063bf6b874e146104bb578063c148cf85146104e457600080fd5b8063a049820a14610497578063a65e2cfd146104a057600080fd5b80637313ee5a146104215780637bb98a68146104485780638da5cb5b1461045d5780639d63848a1461048257600080fd5b80633f265ddb116101d8578063584b62a1116101a75780636d16fa411161018c5780636d16fa41146103fd5780636d811e711461041057806370c6a17e1461041857600080fd5b8063584b62a1146103825780635f531993146103bd57600080fd5b80633f265ddb146103375780634854b1431461034a5780634b8456b814610372578063568914121461037a57600080fd5b80631c1b87721161022f578063254800d411610214578063254800d4146102df5780632e0f26251461030657806333060d901461030e57600080fd5b80631c1b8772146102c357806322182698146102d657600080fd5b806304003d5b1461026157806308a389401461029d5780631054b670146102a5578063111d7d50146102ae575b600080fd5b61028a61026f3660046126aa565b6001600160a01b031660009081526002602052604090205490565b6040519081526020015b60405180910390f35b61028a6105ab565b61028a60095481565b6102c16102bc3660046127f4565b6105ba565b005b6102c16102d13660046126aa565b6105f3565b61028a60065481565b61028a7f000000000000000000000000000000000000000000000000000000000000000081565b61028a601281565b61028a61031c3660046126aa565b6001600160a01b031660009081526005602052604090205490565b61028a61034536600461275a565b610606565b61035d6103583660046126c4565b6106d6565b60408051928352602083019190915201610294565b61028a601081565b61028a61075b565b61039561039036600461275a565b6108d9565b604080519586526020860194909452928401919091526060830152608082015260a001610294565b6103d06103cb36600461275a565b610927565b604080519687526020870195909552938501929092526060840152608083015260a082015260c001610294565b6102c161040b3660046126aa565b6109b8565b61028a610a8a565b61028a60075481565b61028a7f000000000000000000000000000000000000000000000000000000000000000081565b610450610a94565b6040516102949190612888565b6000546001600160a01b03165b6040516001600160a01b039091168152602001610294565b61048a610aee565b604051610294919061283b565b61028a60085481565b6102c16104ae3660046127d3565b610b75565b61028a610bad565b61028a6104c93660046126aa565b6001600160a01b031660009081526003602052604090205490565b61035d6104f23660046126c4565b610d10565b7f000000000000000000000000000000000000000000000000000000000000000061046a565b61035d61052b3660046126c4565b610d80565b61028a61053e3660046127a3565b610e0e565b61028a600a5481565b61028a620f424081565b61028a6105643660046126aa565b6001600160a01b031660009081526004602052604090205490565b6102c161058d3660046126aa565b610f20565b6001546001600160a01b031661046a565b6102c1610ff1565b6105b76012600a61298c565b81565b6105c261102c565b6105ee7f00000000000000000000000000000000000000000000000000000000000000008484846110ba565b505050565b6105fb6114dc565b61060361102c565b50565b6001600160a01b038216600090815260026020526040812080548291908490811061064157634e487b7160e01b600052603260045260246000fd5b9060005260206000209060060201905080600401544210156106675760009150506106d0565b600281015461067a5760009150506106d0565b8060050154816004015461068e9190612911565b421061069f576002015490506106d0565b6005810154600182015460038301546106b89042612a53565b6106c29190612a34565b6106cc9190612929565b9150505b92915050565b6000805481906001600160a01b031633146107385760405162461bcd60e51b815260206004820152600360248201527f6f6331000000000000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b61074061102c565b61074d8787878787611536565b915091509550959350505050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660009081526004602052604081205461079e5750600090565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166000908152600360205260409020546001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166000908152600460205260409020546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b15801561088857600080fd5b505afa15801561089c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c091906127bb565b6108ca9190612a34565b6108d49190612929565b905090565b600560205281600052604060002081815481106108f557600080fd5b600091825260209091206005909102018054600182015460028301546003840154600490940154929550909350919085565b6000806000806000806000600260008a6001600160a01b03166001600160a01b03168152602001908152602001600020888154811061097657634e487b7160e01b600052603260045260246000fd5b6000918252602090912060069091020180546001820154600283015460038401546004850154600590950154939e929d50909b50995091975095509350505050565b6109c06114dc565b6001600160a01b038116610a165760405162461bcd60e51b815260206004820152600360248201527f6f63340000000000000000000000000000000000000000000000000000000000604482015260640161072f565b6001546040516001600160a01b038084169216907fa06677f7b64342b4bcbde423684dbdb5356acfe41ad0285b6ecbe6dc4bf427f290600090a3600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60006108d46116f0565b60408051600180825281830190925260609160208083019080368337019050509050610abe61075b565b81600081518110610adf57634e487b7160e01b600052603260045260246000fd5b60200260200101818152505090565b604080516001808252818301909252606091602080830190803683370190505090507f000000000000000000000000000000000000000000000000000000000000000081600081518110610b5257634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b03168152505090565b610b7d61102c565b610ba97f00000000000000000000000000000000000000000000000000000000000000008383426110ba565b5050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031660009081526004602090815260408083205460039092528220548291610bfc91612a53565b905080610c0b57600091505090565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166000908152600360205260409020546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015282907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015610cbe57600080fd5b505afa158015610cd2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf691906127bb565b610d009190612a34565b610d0a9190612929565b91505090565b6000805481906001600160a01b03163314610d6d5760405162461bcd60e51b815260206004820152600360248201527f6f63310000000000000000000000000000000000000000000000000000000000604482015260640161072f565b610d7561102c565b61074d878787611722565b6000805481906001600160a01b03163314610ddd5760405162461bcd60e51b815260206004820152600360248201527f6f63310000000000000000000000000000000000000000000000000000000000604482015260640161072f565b610de561102c565b610df0878787611722565b9150610e0190508787878787611536565b5097909650945050505050565b60007f0000000000000000000000000000000000000000000000000000000000000000610e41576106d06012600a61298c565b6000610e4d8342612a53565b90507f0000000000000000000000000000000000000000000000000000000000000000811115610e8a57610e836012600a61298c565b9392505050565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000610ed86012600a61298c565b610ee29190612a53565b610eec9083612a34565b610ef69190612929565b610e83907f0000000000000000000000000000000000000000000000000000000000000000612911565b610f286114dc565b6001600160a01b038116610f7e5760405162461bcd60e51b815260206004820152600360248201527f6f63330000000000000000000000000000000000000000000000000000000000604482015260640161072f565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b610ff96114dc565b61100161102c565b61102a7f0000000000000000000000000000000000000000000000000000000000000000611ad7565b565b42600a5560075461103e576000600855565b600060095461106c7f0000000000000000000000000000000000000000000000000000000000000000611d51565b6110769190612911565b600060095560075490915061108d6012600a61298c565b6110979083612a34565b6110a19190612929565b600860008282546110b29190612911565b909155505050565b6110c2611e90565b600083116111125760405162461bcd60e51b815260206004820152600360248201527f726d310000000000000000000000000000000000000000000000000000000000604482015260640161072f565b428110156111625760405162461bcd60e51b815260206004820152600360248201527f726d320000000000000000000000000000000000000000000000000000000000604482015260640161072f565b6001600160a01b0384166000908152600260205260409020546010116111ca5760405162461bcd60e51b815260206004820152600360248201527f726d330000000000000000000000000000000000000000000000000000000000604482015260640161072f565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015284906000906001600160a01b038316906370a082319060240160206040518083038186803b15801561122757600080fd5b505afa15801561123b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125f91906127bb565b90506112766001600160a01b038316333088611eea565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009082906001600160a01b038516906370a082319060240160206040518083038186803b1580156112d357600080fd5b505afa1580156112e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130b91906127bb565b6113159190612a53565b905060008083116113325761132d620f424083612a34565b611362565b6001600160a01b0388166000908152600360205260409020548390611358908490612a34565b6113629190612929565b6001600160a01b03891660009081526004602052604081208054929350839290919061138f908490612911565b90915550506001600160a01b038816600090815260036020526040812080548392906113bc908490612911565b9250508190555060026000896001600160a01b03166001600160a01b031681526020019081526020016000206040518060c00160405280898152602001838152602001838152602001878152602001878152602001888152509080600181540180825580915050600190039060005260206000209060060201600090919091909150600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a082015181600501555050876001600160a01b03167f0d2eac201c6bd25b979f0d9ebcf8ff27a476edde7006f42e843dc70727dbf90b8883886040516114ca939291909283526020830191909152604082015260600190565b60405180910390a25050505050505050565b6000546001600160a01b0316331461102a5760405162461bcd60e51b815260206004820152600360248201527f6f63310000000000000000000000000000000000000000000000000000000000604482015260640161072f565b6000808215806115465750602083145b6115945760405162461bcd60e51b815260040161072f9060208082526004908201527f66726d3200000000000000000000000000000000000000000000000000000000604082015260600190565b600060208414156115a4575060a4355b60006115c987886006546115b89190612911565b6115c06116f0565b85929190611fb9565b9050811561161557876001600160a01b03167fc16aaa1ae5a136c89a5275f4f29944ca4f17d3815f9122eae9455ae495b4c76f8360405161160c91815260200190565b60405180910390a25b6001600160a01b0389166000908152600560208181526040808420815160a0810183528c8152808401888152928101878152600854606083019081524260808401908152845460018181018755958a52968920935196909702909201948555925191840191909155905160028301555160038201559051600490910155600680548992906116a4908490612911565b909155506116b690506012600a61298c565b6116c08289612a34565b6116ca9190612929565b600760008282546116db9190612911565b90915550919960009950975050505050505050565b6000600754600014156117035750600090565b6007546117126012600a61298c565b6006546007546108c09190612a53565b6001600160a01b038316600090815260056020526040812081908390828080805b8515611a30578454600090869061175c90600190612a53565b8154811061177a57634e487b7160e01b600052603260045260246000fd5b90600052602060002090600502019050868160000154116118ea576117ac8160000154826002015483600301546120fb565b92506117bb8160040154610e0e565b91506117c96012600a61298c565b6117d38385612a34565b6117dd9190612929565b6117e79086612911565b94506117f56012600a61298c565b826118026012600a61298c565b61180c9190612a53565b6118169085612a34565b6118209190612929565b600960008282546118319190612911565b9091555061184390506012600a61298c565b600282015482546118549190612a34565b61185e9190612929565b6007600082825461186f9190612a53565b909155505080546118809088612a53565b96508060010154846118929190612911565b9350858054806118b257634e487b7160e01b600052603160045260246000fd5b600082815260208120600560001990930192830201818155600181018290556002810182905560038101829055600401559055611a2a565b6118fd87826002015483600301546120fb565b925061190c8160040154610e0e565b915061191a6012600a61298c565b6119248385612a34565b61192e9190612929565b6119389086612911565b94506119466012600a61298c565b826119536012600a61298c565b61195d9190612a53565b6119679085612a34565b6119719190612929565b600960008282546119829190612911565b9091555061199490506012600a61298c565b60028201546119a39089612a34565b6119ad9190612929565b600760008282546119be9190612a53565b909155505080546001820154600091906119d8908a612a34565b6119e29190612929565b90506119ee8186612911565b945087826000016000828254611a049190612a53565b9250508190555080826001016000828254611a1f9190612a53565b909155506000985050505b50611743565b8860066000828254611a429190612a53565b90915550508315611a7a57611a788a7f00000000000000000000000000000000000000000000000000000000000000008661214d565b505b8215611ac457896001600160a01b03167f18fe0f7ac77be33dd859236b08864eee2e81199a12f1ac17e688517ddc47ea8084604051611abb91815260200190565b60405180910390a25b5060009a91995090975050505050505050565b6001600160a01b038116600090815260026020526040812054815b81811015611d4b576001600160a01b0384166000908152600260205260408120611b1c8584612a53565b81548110611b3a57634e487b7160e01b600052603260045260246000fd5b6000918252602082206006909102019150611b558584612a53565b9050611b618682610606565b158015611b81575081600501548260040154611b7d9190612911565b4210155b15611d3657815460018301546004840154604080519384526020840192909252908201526001600160a01b038716907fda2a262bf91f4f5d64d1083fcf0438477235659afee73ec3ead834792dd2fc3e9060600160405180910390a26001600160a01b03861660009081526002602052604090208054611c0390600190612a53565b81548110611c2157634e487b7160e01b600052603260045260246000fd5b906000526020600020906006020160026000886001600160a01b03166001600160a01b031681526020019081526020016000208281548110611c7357634e487b7160e01b600052603260045260246000fd5b6000918252602080832084546006909302019182556001808501549083015560028085015481840155600380860154908401556004808601549084015560059485015494909201939093556001600160a01b038916825290915260409020805480611cee57634e487b7160e01b600052603160045260246000fd5b6000828152602081206006600019909301928302018181556001810182905560028101829055600381018290556004810182905560050155905584611d3281612a96565b9550505b50508080611d4390612a96565b915050611af2565b50505050565b6000805b6001600160a01b038316600090815260026020526040902054811015611e18576000611d818483610606565b6001600160a01b03851660009081526002602052604081208054929350909184908110611dbe57634e487b7160e01b600052603260045260246000fd5b906000526020600020906006020190506000821115611e035781816002016000828254611deb9190612a53565b9091555050426003820155611e008285612911565b93505b50508080611e1090612a96565b915050611d55565b508015611e8b576001600160a01b03821660009081526004602052604081208054839290611e47908490612a53565b90915550506040518181526001600160a01b038316907ff544cfde8481f9e7bc714e7e32a2b1a6b73688d87f1b32827ce45051e8e3b8e69060200160405180910390a25b919050565b6001546001600160a01b0316331461102a5760405162461bcd60e51b815260206004820152600360248201527f6f63320000000000000000000000000000000000000000000000000000000000604482015260640161072f565b6040516001600160a01b0380851660248301528316604482015260648101829052611d4b9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526122ab565b600083611fc8575060006120f3565b82611fd5575060006120f3565b84611fed57611fe66012600a61298c565b90506120f3565b6000611ffb6012600a61298c565b8461200860026012612a53565b61201390600a61298c565b61201d9190612a34565b6120279190612929565b905080851115612049578461203c8288612a34565b6120469190612929565b95505b60008361205860026012612a53565b61206390600a61298c565b61206d9190612911565b6120808868010000000000000000612a34565b61208a9190612929565b61209d9068010000000000000000612911565b9050680100000000000000006120b56012600a61298c565b6120c183600f0b612390565b600f0b6120ce9190612a34565b6120d89190612929565b6120e46012600a61298c565b6120ee9190612911565b925050505b949350505050565b60006121096012600a61298c565b836121166012600a61298c565b86856008546121259190612a53565b61212f9190612a34565b6121399190612929565b6121439190612a34565b6120f39190612929565b6001600160a01b0382166000818152600360205260408082205490517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152919285928591906370a082319060240160206040518083038186803b1580156121ba57600080fd5b505afa1580156121ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121f291906127bb565b6121fc9190612a34565b6122069190612929565b6001600160a01b038516600090815260036020526040812080549294508592909190612233908490612a53565b9091555061224d90506001600160a01b03821686846123d1565b836001600160a01b0316856001600160a01b03167f1a4dfb075362880d700ede1cc31d284b1c3b2811e9f0b2ddde7bdb270042c13f848660405161229b929190918252602082015260400190565b60405180910390a3509392505050565b6000612300826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661241a9092919063ffffffff16565b8051909150156105ee578080602001905181019061231e9190612783565b6105ee5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161072f565b60008082600f0b136123a157600080fd5b60806123ac83612429565b6123c990600f0b6f4d104d427de7fce20a6e420e02236748612a34565b901c92915050565b6040516001600160a01b0383166024820152604481018290526105ee9084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401611f37565b60606120f3848460008561252b565b60008082600f0b1361243a57600080fd5b6000600f83900b680100000000000000008112612459576040918201911d5b640100000000811261246d576020918201911d5b62010000811261247f576010918201911d5b6101008112612490576008918201911d5b601081126124a0576004918201911d5b600481126124b0576002918201911d5b600281126124bf576001820191505b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0820160401b600f85900b607f8490031b6780000000000000005b60008113156125205790800260ff81901c8281029390930192607f011c9060011d6124fa565b509095945050505050565b6060824710156125a35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161072f565b843b6125f15760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161072f565b600080866001600160a01b0316858760405161260d919061281f565b60006040518083038185875af1925050503d806000811461264a576040519150601f19603f3d011682016040523d82523d6000602084013e61264f565b606091505b50915091506120ee82828660608315612669575081610e83565b8251156126795782518084602001fd5b8160405162461bcd60e51b815260040161072f91906128c0565b80356001600160a01b0381168114611e8b57600080fd5b6000602082840312156126bb578081fd5b610e8382612693565b6000806000806000608086880312156126db578081fd5b6126e486612693565b94506126f260208701612693565b935060408601359250606086013567ffffffffffffffff80821115612715578283fd5b818801915088601f830112612728578283fd5b813581811115612736578384fd5b896020828501011115612747578384fd5b9699959850939650602001949392505050565b6000806040838503121561276c578182fd5b61277583612693565b946020939093013593505050565b600060208284031215612794578081fd5b81518015158114610e83578182fd5b6000602082840312156127b4578081fd5b5035919050565b6000602082840312156127cc578081fd5b5051919050565b600080604083850312156127e5578182fd5b50508035926020909101359150565b600080600060608486031215612808578283fd5b505081359360208301359350604090920135919050565b60008251612831818460208701612a6a565b9190910192915050565b6020808252825182820181905260009190848201906040850190845b8181101561287c5783516001600160a01b031683529284019291840191600101612857565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561287c578351835292840192918401916001016128a4565b60208152600082518060208401526128df816040850160208701612a6a565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000821982111561292457612924612ab1565b500190565b60008261294457634e487b7160e01b81526012600452602481fd5b500490565b600181815b8085111561298457816000190482111561296a5761296a612ab1565b8085161561297757918102915b93841c939080029061294e565b509250929050565b6000610e8383836000826129a2575060016106d0565b816129af575060006106d0565b81600181146129c557600281146129cf576129eb565b60019150506106d0565b60ff8411156129e0576129e0612ab1565b50506001821b6106d0565b5060208310610133831016604e8410600b8410161715612a0e575081810a6106d0565b612a188383612949565b8060001904821115612a2c57612a2c612ab1565b029392505050565b6000816000190483118215151615612a4e57612a4e612ab1565b500290565b600082821015612a6557612a65612ab1565b500390565b60005b83811015612a85578181015183820152602001612a6d565b83811115611d4b5750506000910152565b6000600019821415612aaa57612aaa612ab1565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220c558902b1569d2a041616349eee016ffdb59318bc94414283dff5bad13890a1a64736f6c63430008040033a26469706673582212201af08c50630a7baeba26437ed53c89b9a0d2cdf17daec7c48469fef99adc048564736f6c63430008040033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061002a5760003560e01c8062ee8fe51461002f575b600080fd5b61004261003d366004610234565b61006b565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6000606082146100db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f66726d6631000000000000000000000000000000000000000000000000000000604482015260640160405180910390fd5b60405160443590606435906084359060009084908490849030906100fe90610227565b73ffffffffffffffffffffffffffffffffffffffff9485168152602081019390935260408301919091529091166060820152608001604051809103906000f08015801561014f573d6000803e3d6000fd5b506040517ff2fde38b00000000000000000000000000000000000000000000000000000000815233600482015290915073ffffffffffffffffffffffffffffffffffffffff82169063f2fde38b90602401600060405180830381600087803b1580156101ba57600080fd5b505af11580156101ce573d6000803e3d6000fd5b505060405173ffffffffffffffffffffffffffffffffffffffff841681523392507ff708942ec477396a151a5285651961dcab8e8a82ea4f5b31a5236f92f6c92710915060200160405180910390a29695505050505050565b612e7b806102a283390190565b60008060208385031215610246578182fd5b823567ffffffffffffffff8082111561025d578384fd5b818501915085601f830112610270578384fd5b81358181111561027e578485fd5b86602082850101111561028f578485fd5b6020929092019691955090935050505056fe6101006040523480156200001257600080fd5b5060405162002e7b38038062002e7b833981016040819052620000359162000153565b60008054336001600160a01b0319918216811783556001805490921681179091556040519091907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3600080546040516001600160a01b0390911691907fa06677f7b64342b4bcbde423684dbdb5356acfe41ad0285b6ecbe6dc4bf427f2908290a3620000c86012600a620001e6565b8311156200010b5760405162461bcd60e51b8152600401620001029060208082526004908201526366726d3160e01b604082015260600190565b60405180910390fd5b6001600160601b0319606094851b811660c052931b90921660e05260805260a05242600a55620002c7565b80516001600160a01b03811681146200014e57600080fd5b919050565b6000806000806080858703121562000169578384fd5b620001748562000136565b93506020850151925060408501519150620001926060860162000136565b905092959194509250565b600181815b80851115620001de578160001904821115620001c257620001c2620002b1565b80851615620001d057918102915b93841c9390800290620001a2565b509250929050565b6000620001f48383620001fb565b9392505050565b6000826200020c57506001620002ab565b816200021b57506000620002ab565b81600181146200023457600281146200023f576200025f565b6001915050620002ab565b60ff841115620002535762000253620002b1565b50506001821b620002ab565b5060208310610133831016604e8410600b841016171562000284575081810a620002ab565b6200029083836200019d565b8060001904821115620002a757620002a7620002b1565b0290505b92915050565b634e487b7160e01b600052601160045260246000fd5b60805160a05160c05160601c60e05160601c612afd6200037e60003960006104f90152600081816105c701528181610765015281816107a8015281816107e10152818161083e01528181610b1201528181610b8201528181610baf01528181610c1501528181610c7401528181611006015281816110480152611a5301526000818161042601528181610e1201528181610e510152610e8c0152600081816102e401528181610ead0152610efc0152612afd6000f3fe608060405234801561001057600080fd5b506004361061025c5760003560e01c80637313ee5a11610145578063c45a0155116100bd578063dc16ceb91161008c578063f2fde38b11610071578063f2fde38b1461057f578063f77c479114610592578063fc4333cd146105a357600080fd5b8063dc16ceb91461054c578063e336ac441461055657600080fd5b8063c45a0155146104f7578063c7537f361461051d578063cecc46c814610530578063d0b06f5d1461054357600080fd5b8063a049820a11610114578063a779d080116100f9578063a779d080146104b3578063bf6b874e146104bb578063c148cf85146104e457600080fd5b8063a049820a14610497578063a65e2cfd146104a057600080fd5b80637313ee5a146104215780637bb98a68146104485780638da5cb5b1461045d5780639d63848a1461048257600080fd5b80633f265ddb116101d8578063584b62a1116101a75780636d16fa411161018c5780636d16fa41146103fd5780636d811e711461041057806370c6a17e1461041857600080fd5b8063584b62a1146103825780635f531993146103bd57600080fd5b80633f265ddb146103375780634854b1431461034a5780634b8456b814610372578063568914121461037a57600080fd5b80631c1b87721161022f578063254800d411610214578063254800d4146102df5780632e0f26251461030657806333060d901461030e57600080fd5b80631c1b8772146102c357806322182698146102d657600080fd5b806304003d5b1461026157806308a389401461029d5780631054b670146102a5578063111d7d50146102ae575b600080fd5b61028a61026f3660046126aa565b6001600160a01b031660009081526002602052604090205490565b6040519081526020015b60405180910390f35b61028a6105ab565b61028a60095481565b6102c16102bc3660046127f4565b6105ba565b005b6102c16102d13660046126aa565b6105f3565b61028a60065481565b61028a7f000000000000000000000000000000000000000000000000000000000000000081565b61028a601281565b61028a61031c3660046126aa565b6001600160a01b031660009081526005602052604090205490565b61028a61034536600461275a565b610606565b61035d6103583660046126c4565b6106d6565b60408051928352602083019190915201610294565b61028a601081565b61028a61075b565b61039561039036600461275a565b6108d9565b604080519586526020860194909452928401919091526060830152608082015260a001610294565b6103d06103cb36600461275a565b610927565b604080519687526020870195909552938501929092526060840152608083015260a082015260c001610294565b6102c161040b3660046126aa565b6109b8565b61028a610a8a565b61028a60075481565b61028a7f000000000000000000000000000000000000000000000000000000000000000081565b610450610a94565b6040516102949190612888565b6000546001600160a01b03165b6040516001600160a01b039091168152602001610294565b61048a610aee565b604051610294919061283b565b61028a60085481565b6102c16104ae3660046127d3565b610b75565b61028a610bad565b61028a6104c93660046126aa565b6001600160a01b031660009081526003602052604090205490565b61035d6104f23660046126c4565b610d10565b7f000000000000000000000000000000000000000000000000000000000000000061046a565b61035d61052b3660046126c4565b610d80565b61028a61053e3660046127a3565b610e0e565b61028a600a5481565b61028a620f424081565b61028a6105643660046126aa565b6001600160a01b031660009081526004602052604090205490565b6102c161058d3660046126aa565b610f20565b6001546001600160a01b031661046a565b6102c1610ff1565b6105b76012600a61298c565b81565b6105c261102c565b6105ee7f00000000000000000000000000000000000000000000000000000000000000008484846110ba565b505050565b6105fb6114dc565b61060361102c565b50565b6001600160a01b038216600090815260026020526040812080548291908490811061064157634e487b7160e01b600052603260045260246000fd5b9060005260206000209060060201905080600401544210156106675760009150506106d0565b600281015461067a5760009150506106d0565b8060050154816004015461068e9190612911565b421061069f576002015490506106d0565b6005810154600182015460038301546106b89042612a53565b6106c29190612a34565b6106cc9190612929565b9150505b92915050565b6000805481906001600160a01b031633146107385760405162461bcd60e51b815260206004820152600360248201527f6f6331000000000000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b61074061102c565b61074d8787878787611536565b915091509550959350505050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660009081526004602052604081205461079e5750600090565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166000908152600360205260409020546001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166000908152600460205260409020546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b15801561088857600080fd5b505afa15801561089c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c091906127bb565b6108ca9190612a34565b6108d49190612929565b905090565b600560205281600052604060002081815481106108f557600080fd5b600091825260209091206005909102018054600182015460028301546003840154600490940154929550909350919085565b6000806000806000806000600260008a6001600160a01b03166001600160a01b03168152602001908152602001600020888154811061097657634e487b7160e01b600052603260045260246000fd5b6000918252602090912060069091020180546001820154600283015460038401546004850154600590950154939e929d50909b50995091975095509350505050565b6109c06114dc565b6001600160a01b038116610a165760405162461bcd60e51b815260206004820152600360248201527f6f63340000000000000000000000000000000000000000000000000000000000604482015260640161072f565b6001546040516001600160a01b038084169216907fa06677f7b64342b4bcbde423684dbdb5356acfe41ad0285b6ecbe6dc4bf427f290600090a3600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60006108d46116f0565b60408051600180825281830190925260609160208083019080368337019050509050610abe61075b565b81600081518110610adf57634e487b7160e01b600052603260045260246000fd5b60200260200101818152505090565b604080516001808252818301909252606091602080830190803683370190505090507f000000000000000000000000000000000000000000000000000000000000000081600081518110610b5257634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b03168152505090565b610b7d61102c565b610ba97f00000000000000000000000000000000000000000000000000000000000000008383426110ba565b5050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031660009081526004602090815260408083205460039092528220548291610bfc91612a53565b905080610c0b57600091505090565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166000908152600360205260409020546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015282907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015610cbe57600080fd5b505afa158015610cd2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf691906127bb565b610d009190612a34565b610d0a9190612929565b91505090565b6000805481906001600160a01b03163314610d6d5760405162461bcd60e51b815260206004820152600360248201527f6f63310000000000000000000000000000000000000000000000000000000000604482015260640161072f565b610d7561102c565b61074d878787611722565b6000805481906001600160a01b03163314610ddd5760405162461bcd60e51b815260206004820152600360248201527f6f63310000000000000000000000000000000000000000000000000000000000604482015260640161072f565b610de561102c565b610df0878787611722565b9150610e0190508787878787611536565b5097909650945050505050565b60007f0000000000000000000000000000000000000000000000000000000000000000610e41576106d06012600a61298c565b6000610e4d8342612a53565b90507f0000000000000000000000000000000000000000000000000000000000000000811115610e8a57610e836012600a61298c565b9392505050565b7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000610ed86012600a61298c565b610ee29190612a53565b610eec9083612a34565b610ef69190612929565b610e83907f0000000000000000000000000000000000000000000000000000000000000000612911565b610f286114dc565b6001600160a01b038116610f7e5760405162461bcd60e51b815260206004820152600360248201527f6f63330000000000000000000000000000000000000000000000000000000000604482015260640161072f565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b610ff96114dc565b61100161102c565b61102a7f0000000000000000000000000000000000000000000000000000000000000000611ad7565b565b42600a5560075461103e576000600855565b600060095461106c7f0000000000000000000000000000000000000000000000000000000000000000611d51565b6110769190612911565b600060095560075490915061108d6012600a61298c565b6110979083612a34565b6110a19190612929565b600860008282546110b29190612911565b909155505050565b6110c2611e90565b600083116111125760405162461bcd60e51b815260206004820152600360248201527f726d310000000000000000000000000000000000000000000000000000000000604482015260640161072f565b428110156111625760405162461bcd60e51b815260206004820152600360248201527f726d320000000000000000000000000000000000000000000000000000000000604482015260640161072f565b6001600160a01b0384166000908152600260205260409020546010116111ca5760405162461bcd60e51b815260206004820152600360248201527f726d330000000000000000000000000000000000000000000000000000000000604482015260640161072f565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015284906000906001600160a01b038316906370a082319060240160206040518083038186803b15801561122757600080fd5b505afa15801561123b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125f91906127bb565b90506112766001600160a01b038316333088611eea565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009082906001600160a01b038516906370a082319060240160206040518083038186803b1580156112d357600080fd5b505afa1580156112e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130b91906127bb565b6113159190612a53565b905060008083116113325761132d620f424083612a34565b611362565b6001600160a01b0388166000908152600360205260409020548390611358908490612a34565b6113629190612929565b6001600160a01b03891660009081526004602052604081208054929350839290919061138f908490612911565b90915550506001600160a01b038816600090815260036020526040812080548392906113bc908490612911565b9250508190555060026000896001600160a01b03166001600160a01b031681526020019081526020016000206040518060c00160405280898152602001838152602001838152602001878152602001878152602001888152509080600181540180825580915050600190039060005260206000209060060201600090919091909150600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a082015181600501555050876001600160a01b03167f0d2eac201c6bd25b979f0d9ebcf8ff27a476edde7006f42e843dc70727dbf90b8883886040516114ca939291909283526020830191909152604082015260600190565b60405180910390a25050505050505050565b6000546001600160a01b0316331461102a5760405162461bcd60e51b815260206004820152600360248201527f6f63310000000000000000000000000000000000000000000000000000000000604482015260640161072f565b6000808215806115465750602083145b6115945760405162461bcd60e51b815260040161072f9060208082526004908201527f66726d3200000000000000000000000000000000000000000000000000000000604082015260600190565b600060208414156115a4575060a4355b60006115c987886006546115b89190612911565b6115c06116f0565b85929190611fb9565b9050811561161557876001600160a01b03167fc16aaa1ae5a136c89a5275f4f29944ca4f17d3815f9122eae9455ae495b4c76f8360405161160c91815260200190565b60405180910390a25b6001600160a01b0389166000908152600560208181526040808420815160a0810183528c8152808401888152928101878152600854606083019081524260808401908152845460018181018755958a52968920935196909702909201948555925191840191909155905160028301555160038201559051600490910155600680548992906116a4908490612911565b909155506116b690506012600a61298c565b6116c08289612a34565b6116ca9190612929565b600760008282546116db9190612911565b90915550919960009950975050505050505050565b6000600754600014156117035750600090565b6007546117126012600a61298c565b6006546007546108c09190612a53565b6001600160a01b038316600090815260056020526040812081908390828080805b8515611a30578454600090869061175c90600190612a53565b8154811061177a57634e487b7160e01b600052603260045260246000fd5b90600052602060002090600502019050868160000154116118ea576117ac8160000154826002015483600301546120fb565b92506117bb8160040154610e0e565b91506117c96012600a61298c565b6117d38385612a34565b6117dd9190612929565b6117e79086612911565b94506117f56012600a61298c565b826118026012600a61298c565b61180c9190612a53565b6118169085612a34565b6118209190612929565b600960008282546118319190612911565b9091555061184390506012600a61298c565b600282015482546118549190612a34565b61185e9190612929565b6007600082825461186f9190612a53565b909155505080546118809088612a53565b96508060010154846118929190612911565b9350858054806118b257634e487b7160e01b600052603160045260246000fd5b600082815260208120600560001990930192830201818155600181018290556002810182905560038101829055600401559055611a2a565b6118fd87826002015483600301546120fb565b925061190c8160040154610e0e565b915061191a6012600a61298c565b6119248385612a34565b61192e9190612929565b6119389086612911565b94506119466012600a61298c565b826119536012600a61298c565b61195d9190612a53565b6119679085612a34565b6119719190612929565b600960008282546119829190612911565b9091555061199490506012600a61298c565b60028201546119a39089612a34565b6119ad9190612929565b600760008282546119be9190612a53565b909155505080546001820154600091906119d8908a612a34565b6119e29190612929565b90506119ee8186612911565b945087826000016000828254611a049190612a53565b9250508190555080826001016000828254611a1f9190612a53565b909155506000985050505b50611743565b8860066000828254611a429190612a53565b90915550508315611a7a57611a788a7f00000000000000000000000000000000000000000000000000000000000000008661214d565b505b8215611ac457896001600160a01b03167f18fe0f7ac77be33dd859236b08864eee2e81199a12f1ac17e688517ddc47ea8084604051611abb91815260200190565b60405180910390a25b5060009a91995090975050505050505050565b6001600160a01b038116600090815260026020526040812054815b81811015611d4b576001600160a01b0384166000908152600260205260408120611b1c8584612a53565b81548110611b3a57634e487b7160e01b600052603260045260246000fd5b6000918252602082206006909102019150611b558584612a53565b9050611b618682610606565b158015611b81575081600501548260040154611b7d9190612911565b4210155b15611d3657815460018301546004840154604080519384526020840192909252908201526001600160a01b038716907fda2a262bf91f4f5d64d1083fcf0438477235659afee73ec3ead834792dd2fc3e9060600160405180910390a26001600160a01b03861660009081526002602052604090208054611c0390600190612a53565b81548110611c2157634e487b7160e01b600052603260045260246000fd5b906000526020600020906006020160026000886001600160a01b03166001600160a01b031681526020019081526020016000208281548110611c7357634e487b7160e01b600052603260045260246000fd5b6000918252602080832084546006909302019182556001808501549083015560028085015481840155600380860154908401556004808601549084015560059485015494909201939093556001600160a01b038916825290915260409020805480611cee57634e487b7160e01b600052603160045260246000fd5b6000828152602081206006600019909301928302018181556001810182905560028101829055600381018290556004810182905560050155905584611d3281612a96565b9550505b50508080611d4390612a96565b915050611af2565b50505050565b6000805b6001600160a01b038316600090815260026020526040902054811015611e18576000611d818483610606565b6001600160a01b03851660009081526002602052604081208054929350909184908110611dbe57634e487b7160e01b600052603260045260246000fd5b906000526020600020906006020190506000821115611e035781816002016000828254611deb9190612a53565b9091555050426003820155611e008285612911565b93505b50508080611e1090612a96565b915050611d55565b508015611e8b576001600160a01b03821660009081526004602052604081208054839290611e47908490612a53565b90915550506040518181526001600160a01b038316907ff544cfde8481f9e7bc714e7e32a2b1a6b73688d87f1b32827ce45051e8e3b8e69060200160405180910390a25b919050565b6001546001600160a01b0316331461102a5760405162461bcd60e51b815260206004820152600360248201527f6f63320000000000000000000000000000000000000000000000000000000000604482015260640161072f565b6040516001600160a01b0380851660248301528316604482015260648101829052611d4b9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526122ab565b600083611fc8575060006120f3565b82611fd5575060006120f3565b84611fed57611fe66012600a61298c565b90506120f3565b6000611ffb6012600a61298c565b8461200860026012612a53565b61201390600a61298c565b61201d9190612a34565b6120279190612929565b905080851115612049578461203c8288612a34565b6120469190612929565b95505b60008361205860026012612a53565b61206390600a61298c565b61206d9190612911565b6120808868010000000000000000612a34565b61208a9190612929565b61209d9068010000000000000000612911565b9050680100000000000000006120b56012600a61298c565b6120c183600f0b612390565b600f0b6120ce9190612a34565b6120d89190612929565b6120e46012600a61298c565b6120ee9190612911565b925050505b949350505050565b60006121096012600a61298c565b836121166012600a61298c565b86856008546121259190612a53565b61212f9190612a34565b6121399190612929565b6121439190612a34565b6120f39190612929565b6001600160a01b0382166000818152600360205260408082205490517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152919285928591906370a082319060240160206040518083038186803b1580156121ba57600080fd5b505afa1580156121ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121f291906127bb565b6121fc9190612a34565b6122069190612929565b6001600160a01b038516600090815260036020526040812080549294508592909190612233908490612a53565b9091555061224d90506001600160a01b03821686846123d1565b836001600160a01b0316856001600160a01b03167f1a4dfb075362880d700ede1cc31d284b1c3b2811e9f0b2ddde7bdb270042c13f848660405161229b929190918252602082015260400190565b60405180910390a3509392505050565b6000612300826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661241a9092919063ffffffff16565b8051909150156105ee578080602001905181019061231e9190612783565b6105ee5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161072f565b60008082600f0b136123a157600080fd5b60806123ac83612429565b6123c990600f0b6f4d104d427de7fce20a6e420e02236748612a34565b901c92915050565b6040516001600160a01b0383166024820152604481018290526105ee9084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401611f37565b60606120f3848460008561252b565b60008082600f0b1361243a57600080fd5b6000600f83900b680100000000000000008112612459576040918201911d5b640100000000811261246d576020918201911d5b62010000811261247f576010918201911d5b6101008112612490576008918201911d5b601081126124a0576004918201911d5b600481126124b0576002918201911d5b600281126124bf576001820191505b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0820160401b600f85900b607f8490031b6780000000000000005b60008113156125205790800260ff81901c8281029390930192607f011c9060011d6124fa565b509095945050505050565b6060824710156125a35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161072f565b843b6125f15760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161072f565b600080866001600160a01b0316858760405161260d919061281f565b60006040518083038185875af1925050503d806000811461264a576040519150601f19603f3d011682016040523d82523d6000602084013e61264f565b606091505b50915091506120ee82828660608315612669575081610e83565b8251156126795782518084602001fd5b8160405162461bcd60e51b815260040161072f91906128c0565b80356001600160a01b0381168114611e8b57600080fd5b6000602082840312156126bb578081fd5b610e8382612693565b6000806000806000608086880312156126db578081fd5b6126e486612693565b94506126f260208701612693565b935060408601359250606086013567ffffffffffffffff80821115612715578283fd5b818801915088601f830112612728578283fd5b813581811115612736578384fd5b896020828501011115612747578384fd5b9699959850939650602001949392505050565b6000806040838503121561276c578182fd5b61277583612693565b946020939093013593505050565b600060208284031215612794578081fd5b81518015158114610e83578182fd5b6000602082840312156127b4578081fd5b5035919050565b6000602082840312156127cc578081fd5b5051919050565b600080604083850312156127e5578182fd5b50508035926020909101359150565b600080600060608486031215612808578283fd5b505081359360208301359350604090920135919050565b60008251612831818460208701612a6a565b9190910192915050565b6020808252825182820181905260009190848201906040850190845b8181101561287c5783516001600160a01b031683529284019291840191600101612857565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b8181101561287c578351835292840192918401916001016128a4565b60208152600082518060208401526128df816040850160208701612a6a565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b6000821982111561292457612924612ab1565b500190565b60008261294457634e487b7160e01b81526012600452602481fd5b500490565b600181815b8085111561298457816000190482111561296a5761296a612ab1565b8085161561297757918102915b93841c939080029061294e565b509250929050565b6000610e8383836000826129a2575060016106d0565b816129af575060006106d0565b81600181146129c557600281146129cf576129eb565b60019150506106d0565b60ff8411156129e0576129e0612ab1565b50506001821b6106d0565b5060208310610133831016604e8410600b8410161715612a0e575081810a6106d0565b612a188383612949565b8060001904821115612a2c57612a2c612ab1565b029392505050565b6000816000190483118215151615612a4e57612a4e612ab1565b500290565b600082821015612a6557612a65612ab1565b500390565b60005b83811015612a85578181015183820152602001612a6d565b83811115611d4b5750506000910152565b6000600019821415612aaa57612aaa612ab1565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220c558902b1569d2a041616349eee016ffdb59318bc94414283dff5bad13890a1a64736f6c63430008040033a26469706673582212201af08c50630a7baeba26437ed53c89b9a0d2cdf17daec7c48469fef99adc048564736f6c63430008040033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.