Overview
POL Balance
0 POL
POL Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 14 internal transactions
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
43898883 | 542 days ago | Contract Creation | 0 POL | |||
41059148 | 615 days ago | Contract Creation | 0 POL | |||
35619194 | 753 days ago | Contract Creation | 0 POL | |||
35595019 | 754 days ago | Contract Creation | 0 POL | |||
35304984 | 761 days ago | Contract Creation | 0 POL | |||
34197351 | 788 days ago | Contract Creation | 0 POL | |||
33243292 | 811 days ago | Contract Creation | 0 POL | |||
31192883 | 864 days ago | Contract Creation | 0 POL | |||
30596373 | 880 days ago | Contract Creation | 0 POL | |||
30042104 | 894 days ago | Contract Creation | 0 POL | |||
29959273 | 896 days ago | Contract Creation | 0 POL | |||
29921142 | 897 days ago | Contract Creation | 0 POL | |||
29577089 | 906 days ago | Contract Creation | 0 POL | |||
29390675 | 911 days ago | Contract Creation | 0 POL |
Loading...
Loading
Contract Name:
ERC20CompetitiveRewardModuleFactory
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)
/* ERC20CompetitiveRewardModuleFactory https://github.com/gysr-io/core SPDX-License-Identifier: MIT */ pragma solidity 0.8.4; import "./interfaces/IModuleFactory.sol"; import "./ERC20CompetitiveRewardModule.sol"; /** * @title ERC20 competitive reward module factory * * @notice this factory contract handles deployment for the * ERC20CompetitiveRewardModule contract * * @dev it is called by the parent PoolFactory and is responsible * for parsing constructor arguments before creating a new contract */ contract ERC20CompetitiveRewardModuleFactory is IModuleFactory { /** * @inheritdoc IModuleFactory */ function createModule(bytes calldata data) external override returns (address) { // validate require(data.length == 128, "crmf1"); // parse constructor arguments address token; uint256 bonusMin; uint256 bonusMax; uint256 bonusPeriod; assembly { token := calldataload(68) bonusMin := calldataload(100) bonusMax := calldataload(132) bonusPeriod := calldataload(164) } // create module ERC20CompetitiveRewardModule module = new ERC20CompetitiveRewardModule( token, bonusMin, bonusMax, bonusPeriod, 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); } }
/* ERC20CompetitiveRewardModule https://github.com/gysr-io/core SPDX-License-Identifier: MIT */ pragma solidity 0.8.4; import "./interfaces/IRewardModule.sol"; import "./ERC20BaseRewardModule.sol"; import "./GysrUtils.sol"; /** * @title ERC20 competitive reward module * * @notice this reward module distributes a single ERC20 token as the staking reward. * It is designed to offer competitive and engaging reward mechanics. * * @dev share seconds are the primary unit of accounting in this module. They * are accrued over time and burned during reward distribution. Users can * earn a time multiplier as an incentive for longer term staking. They can * also receive a GYSR multiplier by spending GYSR at the time of unstaking. * * h/t https://github.com/ampleforth/token-geyser */ contract ERC20CompetitiveRewardModule is ERC20BaseRewardModule { using SafeERC20 for IERC20; using GysrUtils for uint256; // single stake by user struct Stake { uint256 shares; uint256 timestamp; } mapping(address => Stake[]) public stakes; // configuration fields uint256 public immutable bonusMin; uint256 public immutable bonusMax; uint256 public immutable bonusPeriod; IERC20 private immutable _token; address private immutable _factory; // global state fields uint256 public totalStakingShares; uint256 public totalStakingShareSeconds; uint256 public lastUpdated; uint256 private _usage; /** * @param token_ the token that will be rewarded * @param bonusMin_ initial time bonus * @param bonusMax_ maximum time bonus * @param bonusPeriod_ period (in seconds) over which time bonus grows to max * @param factory_ address of module factory */ constructor( address token_, uint256 bonusMin_, uint256 bonusMax_, uint256 bonusPeriod_, address factory_ ) { require(bonusMin_ <= bonusMax_, "crm1"); _token = IERC20(token_); _factory = factory_; bonusMin = bonusMin_; bonusMax = bonusMax_; bonusPeriod = bonusPeriod_; lastUpdated = block.timestamp; } // -- IRewardModule ------------------------------------------------------- /** * @inheritdoc IRewardModule */ function tokens() external view override returns (address[] memory tokens_) { tokens_ = new address[](1); tokens_[0] = address(_token); } /** * @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 factory() external view override returns (address) { return _factory; } /** * @inheritdoc IRewardModule */ function stake( address account, address, uint256 shares, bytes calldata ) external override onlyOwner returns (uint256, uint256) { _update(); _stake(account, shares); return (0, 0); } /** * @inheritdoc IRewardModule */ function unstake( address account, address user, uint256 shares, bytes calldata data ) external override onlyOwner returns (uint256, uint256) { _update(); return _unstake(account, user, shares, data); } /** * @inheritdoc IRewardModule */ function claim( address account, address user, uint256 shares, bytes calldata data ) external override onlyOwner returns (uint256 spent, uint256 vested) { _update(); (spent, vested) = _unstake(account, user, shares, data); _stake(account, shares); } /** * @inheritdoc IRewardModule */ function update(address) external override { requireOwner(); _update(); } /** * @inheritdoc IRewardModule */ function clean() external override { requireOwner(); _update(); _clean(address(_token)); } // -- ERC20CompetitiveRewardModule ---------------------------------------- /** * @notice fund module 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 module 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); } /** * @notice compute time bonus earned as a function of staking time * @param time length of time for which the tokens have been staked * @return bonus multiplier for time */ function timeBonus(uint256 time) public view returns (uint256) { if (time >= bonusPeriod) { return 10**DECIMALS + bonusMax; } // linearly interpolate between bonus min and bonus max uint256 bonus = bonusMin + ((bonusMax - bonusMin) * time) / bonusPeriod; return 10**DECIMALS + bonus; } /** * @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)); } /** * @param addr address of interest * @return number of active stakes for user */ function stakeCount(address addr) public view returns (uint256) { return stakes[addr].length; } // -- ERC20CompetitiveRewardModule internal ------------------------------- /** * @dev internal implementation of stake method * @param account address of staking account * @param shares number of shares burned */ function _stake(address account, uint256 shares) private { // update user staking info stakes[account].push(Stake(shares, block.timestamp)); // add newly minted shares to global total totalStakingShares += shares; } /** * @dev internal implementation of unstake method * @param account address of staking account * @param user address of user * @param shares number of shares burned * @param data additional data * @return spent amount of gysr spent * @return vested amount of gysr vested */ function _unstake( address account, address user, uint256 shares, bytes calldata data ) private returns (uint256 spent, uint256 vested) { // validate // note: we assume shares has been validated upstream require(data.length == 0 || data.length == 32, "crm2"); // parse GYSR amount from data if (data.length == 32) { assembly { spent := calldataload(164) } } uint256 bonus = spent.gysrBonus(shares, totalStakingShares, _usage); // do unstaking, first-in last-out, respecting time bonus uint256 shareSeconds; uint256 timeWeightedShareSeconds; (shareSeconds, timeWeightedShareSeconds) = _unstakeFirstInLastOut( account, shares ); // compute and apply GYSR token bonus uint256 gysrWeightedShareSeconds = (bonus * timeWeightedShareSeconds) / 10**DECIMALS; // get reward in shares uint256 unlockedShares = totalShares(address(_token)) - lockedShares(address(_token)); uint256 rewardShares = (unlockedShares * gysrWeightedShareSeconds) / (totalStakingShareSeconds + gysrWeightedShareSeconds); if (rewardShares == 0) { return (0, 0); } // reward _distribute(user, address(_token), rewardShares); // update usage uint256 ratio; if (spent > 0) { vested = spent; emit GysrSpent(user, spent); emit GysrVested(user, vested); ratio = ((bonus - 10**DECIMALS) * 10**DECIMALS) / bonus; } uint256 weight = (shareSeconds * 10**DECIMALS) / (totalStakingShareSeconds + shareSeconds); _usage = _usage - (weight * _usage) / 10**DECIMALS + (weight * ratio) / 10**DECIMALS; } /** * @dev internal implementation of update method to * unlock tokens and do global accounting */ function _update() private { _unlockTokens(address(_token)); // global accounting totalStakingShareSeconds += (block.timestamp - lastUpdated) * totalStakingShares; lastUpdated = block.timestamp; } /** * @dev helper function to actually execute unstaking, first-in last-out, while computing and applying time bonus. This function also updates user and global totals for shares and share-seconds. * @param user address of user * @param shares number of staking shares to burn * @return rawShareSeconds raw share seconds burned * @return bonusShareSeconds time bonus weighted share seconds */ function _unstakeFirstInLastOut(address user, uint256 shares) private returns (uint256 rawShareSeconds, uint256 bonusShareSeconds) { // redeem first-in-last-out uint256 sharesLeftToBurn = shares; Stake[] storage userStakes = stakes[user]; while (sharesLeftToBurn > 0) { Stake storage lastStake = userStakes[userStakes.length - 1]; uint256 stakeTime = block.timestamp - lastStake.timestamp; require(stakeTime > 0, "crm3"); uint256 bonus = timeBonus(stakeTime); if (lastStake.shares <= sharesLeftToBurn) { // fully redeem a past stake bonusShareSeconds += (lastStake.shares * stakeTime * bonus) / 10**DECIMALS; rawShareSeconds += lastStake.shares * stakeTime; sharesLeftToBurn -= lastStake.shares; userStakes.pop(); } else { // partially redeem a past stake bonusShareSeconds += (sharesLeftToBurn * stakeTime * bonus) / 10**DECIMALS; rawShareSeconds += sharesLeftToBurn * stakeTime; lastStake.shares -= sharesLeftToBurn; sharesLeftToBurn = 0; } } // update global totals totalStakingShareSeconds -= rawShareSeconds; totalStakingShares -= shares; } }
/* 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", "devdoc", "userdoc", "metadata", "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
608060405234801561001057600080fd5b50612f8c806100206000396000f3fe608060405234801561001057600080fd5b506004361061002a5760003560e01c8062ee8fe51461002f575b600080fd5b61004261003d366004610240565b61006b565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6000608082146100db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f63726d6631000000000000000000000000000000000000000000000000000000604482015260640160405180910390fd5b60405160443590606435906084359060a435906000908590859085908590309061010490610233565b73ffffffffffffffffffffffffffffffffffffffff9586168152602081019490945260408401929092526060830152909116608082015260a001604051809103906000f08015801561015a573d6000803e3d6000fd5b506040517ff2fde38b00000000000000000000000000000000000000000000000000000000815233600482015290915073ffffffffffffffffffffffffffffffffffffffff82169063f2fde38b90602401600060405180830381600087803b1580156101c557600080fd5b505af11580156101d9573d6000803e3d6000fd5b505060405173ffffffffffffffffffffffffffffffffffffffff841681523392507ff708942ec477396a151a5285651961dcab8e8a82ea4f5b31a5236f92f6c92710915060200160405180910390a2979650505050505050565b612ca9806102ae83390190565b60008060208385031215610252578182fd5b823567ffffffffffffffff80821115610269578384fd5b818501915085601f83011261027c578384fd5b81358181111561028a578485fd5b86602082850101111561029b578485fd5b6020929092019691955090935050505056fe6101206040523480156200001257600080fd5b5060405162002ca938038062002ca983398101604081905262000035916200014d565b60008054336001600160a01b0319918216811783556001805490921681179091556040519091907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3600080546040516001600160a01b0390911691907fa06677f7b64342b4bcbde423684dbdb5356acfe41ad0285b6ecbe6dc4bf427f2908290a382841115620000fe5760405162461bcd60e51b8152600401620000f59060208082526004908201526363726d3160e01b604082015260600190565b60405180910390fd5b6001600160601b0319606095861b811660e052941b9093166101005260809190915260a05260c05242600855620001a1565b80516001600160a01b03811681146200014857600080fd5b919050565b600080600080600060a0868803121562000165578081fd5b620001708662000130565b9450602086015193506040860151925060608601519150620001956080870162000130565b90509295509295909350565b60805160a05160c05160e05160601c6101005160601c612a316200027860003960006104bb015260008181610567015281816107050152818161074801528181610781015281816107de01528181610a9601528181610c3201528181610c5f01528181610cc501528181610d2401528181610fa701528181610fd2015281816115d401528181611618015261169601526000818161032701528181610afd0152610b5d0152600081816103d501528181610b240152610ba301526000818161028101528181610b820152610be10152612a316000f3fe608060405234801561001057600080fd5b50600436106102265760003560e01c80637bb98a681161012a578063c148cf85116100bd578063dc16ceb91161008c578063f2fde38b11610071578063f2fde38b1461052e578063f77c479114610541578063fc4333cd1461055257600080fd5b8063dc16ceb9146104fb578063e336ac441461050557600080fd5b8063c148cf85146104a6578063c45a0155146104b9578063c7537f36146104df578063d0b06f5d146104f257600080fd5b8063a5be655c116100f9578063a5be655c14610459578063a65e2cfd14610462578063a779d08014610475578063bf6b874e1461047d57600080fd5b80637bb98a68146103f75780638da5cb5b1461040c5780639d63848a146104315780639e57e4911461044657600080fd5b80634af4a127116101bd5780635f5319931161018c5780636d811e71116101715780636d811e71146103bf57806370c6a17e146103c75780637aba86d2146103d057600080fd5b80635f5319931461036c5780636d16fa41146103ac57600080fd5b80634af4a127146103225780634b8456b8146103495780635689141214610351578063584b62a11461035957600080fd5b80632e0f2625116101f95780632e0f2625146102b657806333060d90146102be5780633f265ddb146102e75780634854b143146102fa57600080fd5b806304003d5b1461022b578063111d7d50146102675780631b87d58a1461027c5780631c1b8772146102a3575b600080fd5b6102546102393660046125de565b6001600160a01b031660009081526002602052604090205490565b6040519081526020015b60405180910390f35b61027a610275366004612728565b61055a565b005b6102547f000000000000000000000000000000000000000000000000000000000000000081565b61027a6102b13660046125de565b610593565b610254601281565b6102546102cc3660046125de565b6001600160a01b031660009081526005602052604090205490565b6102546102f536600461268e565b6105a6565b61030d6103083660046125f8565b610676565b6040805192835260208301919091520161025e565b6102547f000000000000000000000000000000000000000000000000000000000000000081565b610254601081565b6102546106fb565b61030d61036736600461268e565b610879565b61037f61037a36600461268e565b6108b5565b604080519687526020870195909552938501929092526060840152608083015260a082015260c00161025e565b61027a6103ba3660046125de565b610946565b600954610254565b61025460065481565b6102547f000000000000000000000000000000000000000000000000000000000000000081565b6103ff610a18565b60405161025e91906127bc565b6000546001600160a01b03165b6040516001600160a01b03909116815260200161025e565b610439610a72565b60405161025e919061276f565b6102546104543660046126d7565b610af9565b61025460075481565b61027a610470366004612707565b610c25565b610254610c5d565b61025461048b3660046125de565b6001600160a01b031660009081526003602052604090205490565b61030d6104b43660046125f8565b610dc0565b7f0000000000000000000000000000000000000000000000000000000000000000610419565b61030d6104ed3660046125f8565b610e40565b61025460085481565b610254620f424081565b6102546105133660046125de565b6001600160a01b031660009081526004602052604090205490565b61027a61053c3660046125de565b610ec1565b6001546001600160a01b0316610419565b61027a610f92565b610562610fcd565b61058e7f000000000000000000000000000000000000000000000000000000000000000084848461102d565b505050565b61059b61144f565b6105a3610fcd565b50565b6001600160a01b03821660009081526002602052604081208054829190849081106105e157634e487b7160e01b600052603260045260246000fd5b906000526020600020906006020190508060040154421015610607576000915050610670565b600281015461061a576000915050610670565b8060050154816004015461062e9190612845565b421061063f57600201549050610670565b6005810154600182015460038301546106589042612987565b6106629190612968565b61066c919061285d565b9150505b92915050565b6000805481906001600160a01b031633146106d85760405162461bcd60e51b815260206004820152600360248201527f6f6331000000000000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6106e0610fcd565b6106ea87866114a9565b5060009050805b9550959350505050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660009081526004602052604081205461073e5750600090565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166000908152600360205260409020546001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166000908152600460205260409020546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b15801561082857600080fd5b505afa15801561083c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086091906126ef565b61086a9190612968565b610874919061285d565b905090565b6005602052816000526040600020818154811061089557600080fd5b600091825260209091206002909102018054600190910154909250905082565b6000806000806000806000600260008a6001600160a01b03166001600160a01b03168152602001908152602001600020888154811061090457634e487b7160e01b600052603260045260246000fd5b6000918252602090912060069091020180546001820154600283015460038401546004850154600590950154939e929d50909b50995091975095509350505050565b61094e61144f565b6001600160a01b0381166109a45760405162461bcd60e51b815260206004820152600360248201527f6f6334000000000000000000000000000000000000000000000000000000000060448201526064016106cf565b6001546040516001600160a01b038084169216907fa06677f7b64342b4bcbde423684dbdb5356acfe41ad0285b6ecbe6dc4bf427f290600090a3600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60408051600180825281830190925260609160208083019080368337019050509050610a426106fb565b81600081518110610a6357634e487b7160e01b600052603260045260246000fd5b60200260200101818152505090565b604080516001808252818301909252606091602080830190803683370190505090507f000000000000000000000000000000000000000000000000000000000000000081600081518110610ad657634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b03168152505090565b60007f00000000000000000000000000000000000000000000000000000000000000008210610b59577f0000000000000000000000000000000000000000000000000000000000000000610b4f6012600a6128c0565b6106709190612845565b60007f000000000000000000000000000000000000000000000000000000000000000083610bc77f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612987565b610bd19190612968565b610bdb919061285d565b610c05907f0000000000000000000000000000000000000000000000000000000000000000612845565b905080610c146012600a6128c0565b610c1e9190612845565b9392505050565b610c2d610fcd565b610c597f000000000000000000000000000000000000000000000000000000000000000083834261102d565b5050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031660009081526004602090815260408083205460039092528220548291610cac91612987565b905080610cbb57600091505090565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166000908152600360205260409020546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015282907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015610d6e57600080fd5b505afa158015610d82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da691906126ef565b610db09190612968565b610dba919061285d565b91505090565b6000805481906001600160a01b03163314610e1d5760405162461bcd60e51b815260206004820152600360248201527f6f6331000000000000000000000000000000000000000000000000000000000060448201526064016106cf565b610e25610fcd565b610e328787878787611512565b915091509550959350505050565b6000805481906001600160a01b03163314610e9d5760405162461bcd60e51b815260206004820152600360248201527f6f6331000000000000000000000000000000000000000000000000000000000060448201526064016106cf565b610ea5610fcd565b610eb28787878787611512565b90925090506106f187866114a9565b610ec961144f565b6001600160a01b038116610f1f5760405162461bcd60e51b815260206004820152600360248201527f6f6333000000000000000000000000000000000000000000000000000000000060448201526064016106cf565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b610f9a61144f565b610fa2610fcd565b610fcb7f0000000000000000000000000000000000000000000000000000000000000000611828565b565b610ff67f0000000000000000000000000000000000000000000000000000000000000000611aa2565b506006546008546110079042612987565b6110119190612968565b600760008282546110229190612845565b909155505042600855565b611035611be1565b600083116110855760405162461bcd60e51b815260206004820152600360248201527f726d31000000000000000000000000000000000000000000000000000000000060448201526064016106cf565b428110156110d55760405162461bcd60e51b815260206004820152600360248201527f726d32000000000000000000000000000000000000000000000000000000000060448201526064016106cf565b6001600160a01b03841660009081526002602052604090205460101161113d5760405162461bcd60e51b815260206004820152600360248201527f726d33000000000000000000000000000000000000000000000000000000000060448201526064016106cf565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015284906000906001600160a01b038316906370a082319060240160206040518083038186803b15801561119a57600080fd5b505afa1580156111ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d291906126ef565b90506111e96001600160a01b038316333088611c3b565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009082906001600160a01b038516906370a082319060240160206040518083038186803b15801561124657600080fd5b505afa15801561125a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061127e91906126ef565b6112889190612987565b905060008083116112a5576112a0620f424083612968565b6112d5565b6001600160a01b03881660009081526003602052604090205483906112cb908490612968565b6112d5919061285d565b6001600160a01b038916600090815260046020526040812080549293508392909190611302908490612845565b90915550506001600160a01b0388166000908152600360205260408120805483929061132f908490612845565b9250508190555060026000896001600160a01b03166001600160a01b031681526020019081526020016000206040518060c00160405280898152602001838152602001838152602001878152602001878152602001888152509080600181540180825580915050600190039060005260206000209060060201600090919091909150600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a082015181600501555050876001600160a01b03167f0d2eac201c6bd25b979f0d9ebcf8ff27a476edde7006f42e843dc70727dbf90b88838860405161143d939291909283526020830191909152604082015260600190565b60405180910390a25050505050505050565b6000546001600160a01b03163314610fcb5760405162461bcd60e51b815260206004820152600360248201527f6f6331000000000000000000000000000000000000000000000000000000000060448201526064016106cf565b6001600160a01b038216600090815260056020908152604080832081518083019092528482524282840190815281546001818101845592865293852092516002909402909201928355905191015560068054839290611509908490612845565b90915550505050565b6000808215806115225750602083145b6115705760405162461bcd60e51b81526004016106cf9060208082526004908201527f63726d3200000000000000000000000000000000000000000000000000000000604082015260600190565b602083141561157f5760a43591505b6006546009546000916115959185918991611d0a565b90506000806115a48a89611e4c565b909250905060006115b76012600a6128c0565b6115c18386612968565b6115cb919061285d565b9050600061160e7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031660009081526004602052604090205490565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166000908152600360205260409020546116519190612987565b90506000826007546116639190612845565b61166d8484612968565b611677919061285d565b90508061169057600080975097505050505050506106f1565b6116bb8c7f000000000000000000000000000000000000000000000000000000000000000083612081565b5060008815611787578897508c6001600160a01b03167fc16aaa1ae5a136c89a5275f4f29944ca4f17d3815f9122eae9455ae495b4c76f8a60405161170291815260200190565b60405180910390a28c6001600160a01b03167f18fe0f7ac77be33dd859236b08864eee2e81199a12f1ac17e688517ddc47ea808960405161174591815260200190565b60405180910390a28661175a6012600a6128c0565b6117666012600a6128c0565b611770908a612987565b61177a9190612968565b611784919061285d565b90505b6000866007546117979190612845565b6117a36012600a6128c0565b6117ad9089612968565b6117b7919061285d565b90506117c56012600a6128c0565b6117cf8383612968565b6117d9919061285d565b6117e56012600a6128c0565b6009546117f29084612968565b6117fc919061285d565b6009546118099190612987565b6118139190612845565b60095550505050505050509550959350505050565b6001600160a01b038116600090815260026020526040812054815b81811015611a9c576001600160a01b038416600090815260026020526040812061186d8584612987565b8154811061188b57634e487b7160e01b600052603260045260246000fd5b60009182526020822060069091020191506118a68584612987565b90506118b286826105a6565b1580156118d25750816005015482600401546118ce9190612845565b4210155b15611a8757815460018301546004840154604080519384526020840192909252908201526001600160a01b038716907fda2a262bf91f4f5d64d1083fcf0438477235659afee73ec3ead834792dd2fc3e9060600160405180910390a26001600160a01b0386166000908152600260205260409020805461195490600190612987565b8154811061197257634e487b7160e01b600052603260045260246000fd5b906000526020600020906006020160026000886001600160a01b03166001600160a01b0316815260200190815260200160002082815481106119c457634e487b7160e01b600052603260045260246000fd5b6000918252602080832084546006909302019182556001808501549083015560028085015481840155600380860154908401556004808601549084015560059485015494909201939093556001600160a01b038916825290915260409020805480611a3f57634e487b7160e01b600052603160045260246000fd5b6000828152602081206006600019909301928302018181556001810182905560028101829055600381018290556004810182905560050155905584611a83816129ca565b9550505b50508080611a94906129ca565b915050611843565b50505050565b6000805b6001600160a01b038316600090815260026020526040902054811015611b69576000611ad284836105a6565b6001600160a01b03851660009081526002602052604081208054929350909184908110611b0f57634e487b7160e01b600052603260045260246000fd5b906000526020600020906006020190506000821115611b545781816002016000828254611b3c9190612987565b9091555050426003820155611b518285612845565b93505b50508080611b61906129ca565b915050611aa6565b508015611bdc576001600160a01b03821660009081526004602052604081208054839290611b98908490612987565b90915550506040518181526001600160a01b038316907ff544cfde8481f9e7bc714e7e32a2b1a6b73688d87f1b32827ce45051e8e3b8e69060200160405180910390a25b919050565b6001546001600160a01b03163314610fcb5760405162461bcd60e51b815260206004820152600360248201527f6f6332000000000000000000000000000000000000000000000000000000000060448201526064016106cf565b6040516001600160a01b0380851660248301528316604482015260648101829052611a9c9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526121df565b600083611d1957506000611e44565b82611d2657506000611e44565b84611d3e57611d376012600a6128c0565b9050611e44565b6000611d4c6012600a6128c0565b84611d5960026012612987565b611d6490600a6128c0565b611d6e9190612968565b611d78919061285d565b905080851115611d9a5784611d8d8288612968565b611d97919061285d565b95505b600083611da960026012612987565b611db490600a6128c0565b611dbe9190612845565b611dd18868010000000000000000612968565b611ddb919061285d565b611dee9068010000000000000000612845565b905068010000000000000000611e066012600a6128c0565b611e1283600f0b6122c4565b600f0b611e1f9190612968565b611e29919061285d565b611e356012600a6128c0565b611e3f9190612845565b925050505b949350505050565b6001600160a01b0382166000908152600560205260408120819083905b81156120465780546000908290611e8290600190612987565b81548110611ea057634e487b7160e01b600052603260045260246000fd5b906000526020600020906002020190506000816001015442611ec29190612987565b905060008111611f165760405162461bcd60e51b81526004016106cf9060208082526004908201527f63726d3300000000000000000000000000000000000000000000000000000000604082015260600190565b6000611f2182610af9565b905084836000015411611fd357611f3a6012600a6128c0565b83548290611f49908590612968565b611f539190612968565b611f5d919061285d565b611f679087612845565b8354909650611f77908390612968565b611f819088612845565b8354909750611f909086612987565b945083805480611fb057634e487b7160e01b600052603160045260246000fd5b60008281526020812060026000199093019283020181815560010155905561203e565b611fdf6012600a6128c0565b81611fea8488612968565b611ff49190612968565b611ffe919061285d565b6120089087612845565b95506120148286612968565b61201e9088612845565b9650848360000160008282546120349190612987565b9091555060009550505b505050611e69565b83600760008282546120589190612987565b9250508190555084600660008282546120719190612987565b9250508190555050509250929050565b6001600160a01b0382166000818152600360205260408082205490517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152919285928591906370a082319060240160206040518083038186803b1580156120ee57600080fd5b505afa158015612102573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212691906126ef565b6121309190612968565b61213a919061285d565b6001600160a01b038516600090815260036020526040812080549294508592909190612167908490612987565b9091555061218190506001600160a01b0382168684612305565b836001600160a01b0316856001600160a01b03167f1a4dfb075362880d700ede1cc31d284b1c3b2811e9f0b2ddde7bdb270042c13f84866040516121cf929190918252602082015260400190565b60405180910390a3509392505050565b6000612234826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661234e9092919063ffffffff16565b80519091501561058e578080602001905181019061225291906126b7565b61058e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016106cf565b60008082600f0b136122d557600080fd5b60806122e08361235d565b6122fd90600f0b6f4d104d427de7fce20a6e420e02236748612968565b901c92915050565b6040516001600160a01b03831660248201526044810182905261058e9084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401611c88565b6060611e44848460008561245f565b60008082600f0b1361236e57600080fd5b6000600f83900b68010000000000000000811261238d576040918201911d5b64010000000081126123a1576020918201911d5b6201000081126123b3576010918201911d5b61010081126123c4576008918201911d5b601081126123d4576004918201911d5b600481126123e4576002918201911d5b600281126123f3576001820191505b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0820160401b600f85900b607f8490031b6780000000000000005b60008113156124545790800260ff81901c8281029390930192607f011c9060011d61242e565b509095945050505050565b6060824710156124d75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016106cf565b843b6125255760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106cf565b600080866001600160a01b031685876040516125419190612753565b60006040518083038185875af1925050503d806000811461257e576040519150601f19603f3d011682016040523d82523d6000602084013e612583565b606091505b5091509150611e3f8282866060831561259d575081610c1e565b8251156125ad5782518084602001fd5b8160405162461bcd60e51b81526004016106cf91906127f4565b80356001600160a01b0381168114611bdc57600080fd5b6000602082840312156125ef578081fd5b610c1e826125c7565b60008060008060006080868803121561260f578081fd5b612618866125c7565b9450612626602087016125c7565b935060408601359250606086013567ffffffffffffffff80821115612649578283fd5b818801915088601f83011261265c578283fd5b81358181111561266a578384fd5b89602082850101111561267b578384fd5b9699959850939650602001949392505050565b600080604083850312156126a0578182fd5b6126a9836125c7565b946020939093013593505050565b6000602082840312156126c8578081fd5b81518015158114610c1e578182fd5b6000602082840312156126e8578081fd5b5035919050565b600060208284031215612700578081fd5b5051919050565b60008060408385031215612719578182fd5b50508035926020909101359150565b60008060006060848603121561273c578283fd5b505081359360208301359350604090920135919050565b6000825161276581846020870161299e565b9190910192915050565b6020808252825182820181905260009190848201906040850190845b818110156127b05783516001600160a01b03168352928401929184019160010161278b565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156127b0578351835292840192918401916001016127d8565b602081526000825180602084015261281381604085016020870161299e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60008219821115612858576128586129e5565b500190565b60008261287857634e487b7160e01b81526012600452602481fd5b500490565b600181815b808511156128b857816000190482111561289e5761289e6129e5565b808516156128ab57918102915b93841c9390800290612882565b509250929050565b6000610c1e83836000826128d657506001610670565b816128e357506000610670565b81600181146128f957600281146129035761291f565b6001915050610670565b60ff841115612914576129146129e5565b50506001821b610670565b5060208310610133831016604e8410600b8410161715612942575081810a610670565b61294c838361287d565b8060001904821115612960576129606129e5565b029392505050565b6000816000190483118215151615612982576129826129e5565b500290565b600082821015612999576129996129e5565b500390565b60005b838110156129b95781810151838201526020016129a1565b83811115611a9c5750506000910152565b60006000198214156129de576129de6129e5565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220e183a13bba243df9d1e0019df9e608dc0b9ee5839b465d258c6a45af12a85e1964736f6c63430008040033a26469706673582212208791ef6af6bc487352f840735df530effcc2e26ebcac25f1ec532b6de52e7b8664736f6c63430008040033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061002a5760003560e01c8062ee8fe51461002f575b600080fd5b61004261003d366004610240565b61006b565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6000608082146100db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600560248201527f63726d6631000000000000000000000000000000000000000000000000000000604482015260640160405180910390fd5b60405160443590606435906084359060a435906000908590859085908590309061010490610233565b73ffffffffffffffffffffffffffffffffffffffff9586168152602081019490945260408401929092526060830152909116608082015260a001604051809103906000f08015801561015a573d6000803e3d6000fd5b506040517ff2fde38b00000000000000000000000000000000000000000000000000000000815233600482015290915073ffffffffffffffffffffffffffffffffffffffff82169063f2fde38b90602401600060405180830381600087803b1580156101c557600080fd5b505af11580156101d9573d6000803e3d6000fd5b505060405173ffffffffffffffffffffffffffffffffffffffff841681523392507ff708942ec477396a151a5285651961dcab8e8a82ea4f5b31a5236f92f6c92710915060200160405180910390a2979650505050505050565b612ca9806102ae83390190565b60008060208385031215610252578182fd5b823567ffffffffffffffff80821115610269578384fd5b818501915085601f83011261027c578384fd5b81358181111561028a578485fd5b86602082850101111561029b578485fd5b6020929092019691955090935050505056fe6101206040523480156200001257600080fd5b5060405162002ca938038062002ca983398101604081905262000035916200014d565b60008054336001600160a01b0319918216811783556001805490921681179091556040519091907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3600080546040516001600160a01b0390911691907fa06677f7b64342b4bcbde423684dbdb5356acfe41ad0285b6ecbe6dc4bf427f2908290a382841115620000fe5760405162461bcd60e51b8152600401620000f59060208082526004908201526363726d3160e01b604082015260600190565b60405180910390fd5b6001600160601b0319606095861b811660e052941b9093166101005260809190915260a05260c05242600855620001a1565b80516001600160a01b03811681146200014857600080fd5b919050565b600080600080600060a0868803121562000165578081fd5b620001708662000130565b9450602086015193506040860151925060608601519150620001956080870162000130565b90509295509295909350565b60805160a05160c05160e05160601c6101005160601c612a316200027860003960006104bb015260008181610567015281816107050152818161074801528181610781015281816107de01528181610a9601528181610c3201528181610c5f01528181610cc501528181610d2401528181610fa701528181610fd2015281816115d401528181611618015261169601526000818161032701528181610afd0152610b5d0152600081816103d501528181610b240152610ba301526000818161028101528181610b820152610be10152612a316000f3fe608060405234801561001057600080fd5b50600436106102265760003560e01c80637bb98a681161012a578063c148cf85116100bd578063dc16ceb91161008c578063f2fde38b11610071578063f2fde38b1461052e578063f77c479114610541578063fc4333cd1461055257600080fd5b8063dc16ceb9146104fb578063e336ac441461050557600080fd5b8063c148cf85146104a6578063c45a0155146104b9578063c7537f36146104df578063d0b06f5d146104f257600080fd5b8063a5be655c116100f9578063a5be655c14610459578063a65e2cfd14610462578063a779d08014610475578063bf6b874e1461047d57600080fd5b80637bb98a68146103f75780638da5cb5b1461040c5780639d63848a146104315780639e57e4911461044657600080fd5b80634af4a127116101bd5780635f5319931161018c5780636d811e71116101715780636d811e71146103bf57806370c6a17e146103c75780637aba86d2146103d057600080fd5b80635f5319931461036c5780636d16fa41146103ac57600080fd5b80634af4a127146103225780634b8456b8146103495780635689141214610351578063584b62a11461035957600080fd5b80632e0f2625116101f95780632e0f2625146102b657806333060d90146102be5780633f265ddb146102e75780634854b143146102fa57600080fd5b806304003d5b1461022b578063111d7d50146102675780631b87d58a1461027c5780631c1b8772146102a3575b600080fd5b6102546102393660046125de565b6001600160a01b031660009081526002602052604090205490565b6040519081526020015b60405180910390f35b61027a610275366004612728565b61055a565b005b6102547f000000000000000000000000000000000000000000000000000000000000000081565b61027a6102b13660046125de565b610593565b610254601281565b6102546102cc3660046125de565b6001600160a01b031660009081526005602052604090205490565b6102546102f536600461268e565b6105a6565b61030d6103083660046125f8565b610676565b6040805192835260208301919091520161025e565b6102547f000000000000000000000000000000000000000000000000000000000000000081565b610254601081565b6102546106fb565b61030d61036736600461268e565b610879565b61037f61037a36600461268e565b6108b5565b604080519687526020870195909552938501929092526060840152608083015260a082015260c00161025e565b61027a6103ba3660046125de565b610946565b600954610254565b61025460065481565b6102547f000000000000000000000000000000000000000000000000000000000000000081565b6103ff610a18565b60405161025e91906127bc565b6000546001600160a01b03165b6040516001600160a01b03909116815260200161025e565b610439610a72565b60405161025e919061276f565b6102546104543660046126d7565b610af9565b61025460075481565b61027a610470366004612707565b610c25565b610254610c5d565b61025461048b3660046125de565b6001600160a01b031660009081526003602052604090205490565b61030d6104b43660046125f8565b610dc0565b7f0000000000000000000000000000000000000000000000000000000000000000610419565b61030d6104ed3660046125f8565b610e40565b61025460085481565b610254620f424081565b6102546105133660046125de565b6001600160a01b031660009081526004602052604090205490565b61027a61053c3660046125de565b610ec1565b6001546001600160a01b0316610419565b61027a610f92565b610562610fcd565b61058e7f000000000000000000000000000000000000000000000000000000000000000084848461102d565b505050565b61059b61144f565b6105a3610fcd565b50565b6001600160a01b03821660009081526002602052604081208054829190849081106105e157634e487b7160e01b600052603260045260246000fd5b906000526020600020906006020190508060040154421015610607576000915050610670565b600281015461061a576000915050610670565b8060050154816004015461062e9190612845565b421061063f57600201549050610670565b6005810154600182015460038301546106589042612987565b6106629190612968565b61066c919061285d565b9150505b92915050565b6000805481906001600160a01b031633146106d85760405162461bcd60e51b815260206004820152600360248201527f6f6331000000000000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6106e0610fcd565b6106ea87866114a9565b5060009050805b9550959350505050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660009081526004602052604081205461073e5750600090565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166000908152600360205260409020546001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166000908152600460205260409020546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b15801561082857600080fd5b505afa15801561083c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086091906126ef565b61086a9190612968565b610874919061285d565b905090565b6005602052816000526040600020818154811061089557600080fd5b600091825260209091206002909102018054600190910154909250905082565b6000806000806000806000600260008a6001600160a01b03166001600160a01b03168152602001908152602001600020888154811061090457634e487b7160e01b600052603260045260246000fd5b6000918252602090912060069091020180546001820154600283015460038401546004850154600590950154939e929d50909b50995091975095509350505050565b61094e61144f565b6001600160a01b0381166109a45760405162461bcd60e51b815260206004820152600360248201527f6f6334000000000000000000000000000000000000000000000000000000000060448201526064016106cf565b6001546040516001600160a01b038084169216907fa06677f7b64342b4bcbde423684dbdb5356acfe41ad0285b6ecbe6dc4bf427f290600090a3600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b60408051600180825281830190925260609160208083019080368337019050509050610a426106fb565b81600081518110610a6357634e487b7160e01b600052603260045260246000fd5b60200260200101818152505090565b604080516001808252818301909252606091602080830190803683370190505090507f000000000000000000000000000000000000000000000000000000000000000081600081518110610ad657634e487b7160e01b600052603260045260246000fd5b60200260200101906001600160a01b031690816001600160a01b03168152505090565b60007f00000000000000000000000000000000000000000000000000000000000000008210610b59577f0000000000000000000000000000000000000000000000000000000000000000610b4f6012600a6128c0565b6106709190612845565b60007f000000000000000000000000000000000000000000000000000000000000000083610bc77f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612987565b610bd19190612968565b610bdb919061285d565b610c05907f0000000000000000000000000000000000000000000000000000000000000000612845565b905080610c146012600a6128c0565b610c1e9190612845565b9392505050565b610c2d610fcd565b610c597f000000000000000000000000000000000000000000000000000000000000000083834261102d565b5050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031660009081526004602090815260408083205460039092528220548291610cac91612987565b905080610cbb57600091505090565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166000908152600360205260409020546040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015282907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a082319060240160206040518083038186803b158015610d6e57600080fd5b505afa158015610d82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da691906126ef565b610db09190612968565b610dba919061285d565b91505090565b6000805481906001600160a01b03163314610e1d5760405162461bcd60e51b815260206004820152600360248201527f6f6331000000000000000000000000000000000000000000000000000000000060448201526064016106cf565b610e25610fcd565b610e328787878787611512565b915091509550959350505050565b6000805481906001600160a01b03163314610e9d5760405162461bcd60e51b815260206004820152600360248201527f6f6331000000000000000000000000000000000000000000000000000000000060448201526064016106cf565b610ea5610fcd565b610eb28787878787611512565b90925090506106f187866114a9565b610ec961144f565b6001600160a01b038116610f1f5760405162461bcd60e51b815260206004820152600360248201527f6f6333000000000000000000000000000000000000000000000000000000000060448201526064016106cf565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b610f9a61144f565b610fa2610fcd565b610fcb7f0000000000000000000000000000000000000000000000000000000000000000611828565b565b610ff67f0000000000000000000000000000000000000000000000000000000000000000611aa2565b506006546008546110079042612987565b6110119190612968565b600760008282546110229190612845565b909155505042600855565b611035611be1565b600083116110855760405162461bcd60e51b815260206004820152600360248201527f726d31000000000000000000000000000000000000000000000000000000000060448201526064016106cf565b428110156110d55760405162461bcd60e51b815260206004820152600360248201527f726d32000000000000000000000000000000000000000000000000000000000060448201526064016106cf565b6001600160a01b03841660009081526002602052604090205460101161113d5760405162461bcd60e51b815260206004820152600360248201527f726d33000000000000000000000000000000000000000000000000000000000060448201526064016106cf565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015284906000906001600160a01b038316906370a082319060240160206040518083038186803b15801561119a57600080fd5b505afa1580156111ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111d291906126ef565b90506111e96001600160a01b038316333088611c3b565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009082906001600160a01b038516906370a082319060240160206040518083038186803b15801561124657600080fd5b505afa15801561125a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061127e91906126ef565b6112889190612987565b905060008083116112a5576112a0620f424083612968565b6112d5565b6001600160a01b03881660009081526003602052604090205483906112cb908490612968565b6112d5919061285d565b6001600160a01b038916600090815260046020526040812080549293508392909190611302908490612845565b90915550506001600160a01b0388166000908152600360205260408120805483929061132f908490612845565b9250508190555060026000896001600160a01b03166001600160a01b031681526020019081526020016000206040518060c00160405280898152602001838152602001838152602001878152602001878152602001888152509080600181540180825580915050600190039060005260206000209060060201600090919091909150600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a082015181600501555050876001600160a01b03167f0d2eac201c6bd25b979f0d9ebcf8ff27a476edde7006f42e843dc70727dbf90b88838860405161143d939291909283526020830191909152604082015260600190565b60405180910390a25050505050505050565b6000546001600160a01b03163314610fcb5760405162461bcd60e51b815260206004820152600360248201527f6f6331000000000000000000000000000000000000000000000000000000000060448201526064016106cf565b6001600160a01b038216600090815260056020908152604080832081518083019092528482524282840190815281546001818101845592865293852092516002909402909201928355905191015560068054839290611509908490612845565b90915550505050565b6000808215806115225750602083145b6115705760405162461bcd60e51b81526004016106cf9060208082526004908201527f63726d3200000000000000000000000000000000000000000000000000000000604082015260600190565b602083141561157f5760a43591505b6006546009546000916115959185918991611d0a565b90506000806115a48a89611e4c565b909250905060006115b76012600a6128c0565b6115c18386612968565b6115cb919061285d565b9050600061160e7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031660009081526004602052604090205490565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166000908152600360205260409020546116519190612987565b90506000826007546116639190612845565b61166d8484612968565b611677919061285d565b90508061169057600080975097505050505050506106f1565b6116bb8c7f000000000000000000000000000000000000000000000000000000000000000083612081565b5060008815611787578897508c6001600160a01b03167fc16aaa1ae5a136c89a5275f4f29944ca4f17d3815f9122eae9455ae495b4c76f8a60405161170291815260200190565b60405180910390a28c6001600160a01b03167f18fe0f7ac77be33dd859236b08864eee2e81199a12f1ac17e688517ddc47ea808960405161174591815260200190565b60405180910390a28661175a6012600a6128c0565b6117666012600a6128c0565b611770908a612987565b61177a9190612968565b611784919061285d565b90505b6000866007546117979190612845565b6117a36012600a6128c0565b6117ad9089612968565b6117b7919061285d565b90506117c56012600a6128c0565b6117cf8383612968565b6117d9919061285d565b6117e56012600a6128c0565b6009546117f29084612968565b6117fc919061285d565b6009546118099190612987565b6118139190612845565b60095550505050505050509550959350505050565b6001600160a01b038116600090815260026020526040812054815b81811015611a9c576001600160a01b038416600090815260026020526040812061186d8584612987565b8154811061188b57634e487b7160e01b600052603260045260246000fd5b60009182526020822060069091020191506118a68584612987565b90506118b286826105a6565b1580156118d25750816005015482600401546118ce9190612845565b4210155b15611a8757815460018301546004840154604080519384526020840192909252908201526001600160a01b038716907fda2a262bf91f4f5d64d1083fcf0438477235659afee73ec3ead834792dd2fc3e9060600160405180910390a26001600160a01b0386166000908152600260205260409020805461195490600190612987565b8154811061197257634e487b7160e01b600052603260045260246000fd5b906000526020600020906006020160026000886001600160a01b03166001600160a01b0316815260200190815260200160002082815481106119c457634e487b7160e01b600052603260045260246000fd5b6000918252602080832084546006909302019182556001808501549083015560028085015481840155600380860154908401556004808601549084015560059485015494909201939093556001600160a01b038916825290915260409020805480611a3f57634e487b7160e01b600052603160045260246000fd5b6000828152602081206006600019909301928302018181556001810182905560028101829055600381018290556004810182905560050155905584611a83816129ca565b9550505b50508080611a94906129ca565b915050611843565b50505050565b6000805b6001600160a01b038316600090815260026020526040902054811015611b69576000611ad284836105a6565b6001600160a01b03851660009081526002602052604081208054929350909184908110611b0f57634e487b7160e01b600052603260045260246000fd5b906000526020600020906006020190506000821115611b545781816002016000828254611b3c9190612987565b9091555050426003820155611b518285612845565b93505b50508080611b61906129ca565b915050611aa6565b508015611bdc576001600160a01b03821660009081526004602052604081208054839290611b98908490612987565b90915550506040518181526001600160a01b038316907ff544cfde8481f9e7bc714e7e32a2b1a6b73688d87f1b32827ce45051e8e3b8e69060200160405180910390a25b919050565b6001546001600160a01b03163314610fcb5760405162461bcd60e51b815260206004820152600360248201527f6f6332000000000000000000000000000000000000000000000000000000000060448201526064016106cf565b6040516001600160a01b0380851660248301528316604482015260648101829052611a9c9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526121df565b600083611d1957506000611e44565b82611d2657506000611e44565b84611d3e57611d376012600a6128c0565b9050611e44565b6000611d4c6012600a6128c0565b84611d5960026012612987565b611d6490600a6128c0565b611d6e9190612968565b611d78919061285d565b905080851115611d9a5784611d8d8288612968565b611d97919061285d565b95505b600083611da960026012612987565b611db490600a6128c0565b611dbe9190612845565b611dd18868010000000000000000612968565b611ddb919061285d565b611dee9068010000000000000000612845565b905068010000000000000000611e066012600a6128c0565b611e1283600f0b6122c4565b600f0b611e1f9190612968565b611e29919061285d565b611e356012600a6128c0565b611e3f9190612845565b925050505b949350505050565b6001600160a01b0382166000908152600560205260408120819083905b81156120465780546000908290611e8290600190612987565b81548110611ea057634e487b7160e01b600052603260045260246000fd5b906000526020600020906002020190506000816001015442611ec29190612987565b905060008111611f165760405162461bcd60e51b81526004016106cf9060208082526004908201527f63726d3300000000000000000000000000000000000000000000000000000000604082015260600190565b6000611f2182610af9565b905084836000015411611fd357611f3a6012600a6128c0565b83548290611f49908590612968565b611f539190612968565b611f5d919061285d565b611f679087612845565b8354909650611f77908390612968565b611f819088612845565b8354909750611f909086612987565b945083805480611fb057634e487b7160e01b600052603160045260246000fd5b60008281526020812060026000199093019283020181815560010155905561203e565b611fdf6012600a6128c0565b81611fea8488612968565b611ff49190612968565b611ffe919061285d565b6120089087612845565b95506120148286612968565b61201e9088612845565b9650848360000160008282546120349190612987565b9091555060009550505b505050611e69565b83600760008282546120589190612987565b9250508190555084600660008282546120719190612987565b9250508190555050509250929050565b6001600160a01b0382166000818152600360205260408082205490517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152919285928591906370a082319060240160206040518083038186803b1580156120ee57600080fd5b505afa158015612102573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212691906126ef565b6121309190612968565b61213a919061285d565b6001600160a01b038516600090815260036020526040812080549294508592909190612167908490612987565b9091555061218190506001600160a01b0382168684612305565b836001600160a01b0316856001600160a01b03167f1a4dfb075362880d700ede1cc31d284b1c3b2811e9f0b2ddde7bdb270042c13f84866040516121cf929190918252602082015260400190565b60405180910390a3509392505050565b6000612234826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661234e9092919063ffffffff16565b80519091501561058e578080602001905181019061225291906126b7565b61058e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016106cf565b60008082600f0b136122d557600080fd5b60806122e08361235d565b6122fd90600f0b6f4d104d427de7fce20a6e420e02236748612968565b901c92915050565b6040516001600160a01b03831660248201526044810182905261058e9084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401611c88565b6060611e44848460008561245f565b60008082600f0b1361236e57600080fd5b6000600f83900b68010000000000000000811261238d576040918201911d5b64010000000081126123a1576020918201911d5b6201000081126123b3576010918201911d5b61010081126123c4576008918201911d5b601081126123d4576004918201911d5b600481126123e4576002918201911d5b600281126123f3576001820191505b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0820160401b600f85900b607f8490031b6780000000000000005b60008113156124545790800260ff81901c8281029390930192607f011c9060011d61242e565b509095945050505050565b6060824710156124d75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016106cf565b843b6125255760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016106cf565b600080866001600160a01b031685876040516125419190612753565b60006040518083038185875af1925050503d806000811461257e576040519150601f19603f3d011682016040523d82523d6000602084013e612583565b606091505b5091509150611e3f8282866060831561259d575081610c1e565b8251156125ad5782518084602001fd5b8160405162461bcd60e51b81526004016106cf91906127f4565b80356001600160a01b0381168114611bdc57600080fd5b6000602082840312156125ef578081fd5b610c1e826125c7565b60008060008060006080868803121561260f578081fd5b612618866125c7565b9450612626602087016125c7565b935060408601359250606086013567ffffffffffffffff80821115612649578283fd5b818801915088601f83011261265c578283fd5b81358181111561266a578384fd5b89602082850101111561267b578384fd5b9699959850939650602001949392505050565b600080604083850312156126a0578182fd5b6126a9836125c7565b946020939093013593505050565b6000602082840312156126c8578081fd5b81518015158114610c1e578182fd5b6000602082840312156126e8578081fd5b5035919050565b600060208284031215612700578081fd5b5051919050565b60008060408385031215612719578182fd5b50508035926020909101359150565b60008060006060848603121561273c578283fd5b505081359360208301359350604090920135919050565b6000825161276581846020870161299e565b9190910192915050565b6020808252825182820181905260009190848201906040850190845b818110156127b05783516001600160a01b03168352928401929184019160010161278b565b50909695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156127b0578351835292840192918401916001016127d8565b602081526000825180602084015261281381604085016020870161299e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60008219821115612858576128586129e5565b500190565b60008261287857634e487b7160e01b81526012600452602481fd5b500490565b600181815b808511156128b857816000190482111561289e5761289e6129e5565b808516156128ab57918102915b93841c9390800290612882565b509250929050565b6000610c1e83836000826128d657506001610670565b816128e357506000610670565b81600181146128f957600281146129035761291f565b6001915050610670565b60ff841115612914576129146129e5565b50506001821b610670565b5060208310610133831016604e8410600b8410161715612942575081810a610670565b61294c838361287d565b8060001904821115612960576129606129e5565b029392505050565b6000816000190483118215151615612982576129826129e5565b500290565b600082821015612999576129996129e5565b500390565b60005b838110156129b95781810151838201526020016129a1565b83811115611a9c5750506000910152565b60006000198214156129de576129de6129e5565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220e183a13bba243df9d1e0019df9e608dc0b9ee5839b465d258c6a45af12a85e1964736f6c63430008040033a26469706673582212208791ef6af6bc487352f840735df530effcc2e26ebcac25f1ec532b6de52e7b8664736f6c63430008040033
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.