More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 405 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
Unstake | 12853775 | 974 days ago | IN | 0 ETH | 0.00621241 | ||||
Stake | 12853775 | 974 days ago | IN | 0 ETH | 0.00322387 | ||||
Stake | 12806602 | 981 days ago | IN | 0 ETH | 0.00163701 | ||||
Stake | 12793453 | 983 days ago | IN | 0 ETH | 0.00552767 | ||||
Stake | 12792984 | 983 days ago | IN | 0 ETH | 0.00267639 | ||||
Stake | 12785526 | 985 days ago | IN | 0 ETH | 0.00695416 | ||||
Stake | 12775851 | 986 days ago | IN | 0 ETH | 0.00370018 | ||||
Unstake | 12769681 | 987 days ago | IN | 0 ETH | 0.00377191 | ||||
Unstake | 12769591 | 987 days ago | IN | 0 ETH | 0.00338307 | ||||
Stake | 12769591 | 987 days ago | IN | 0 ETH | 0.00177061 | ||||
Stake | 12769029 | 987 days ago | IN | 0 ETH | 0.00113061 | ||||
Stake | 12768872 | 987 days ago | IN | 0 ETH | 0.00078744 | ||||
Unstake | 12768872 | 987 days ago | IN | 0 ETH | 0.00501485 | ||||
Stake | 12768607 | 987 days ago | IN | 0 ETH | 0.00245552 | ||||
Unstake | 12768438 | 987 days ago | IN | 0 ETH | 0.00359548 | ||||
Unstake | 12767967 | 987 days ago | IN | 0 ETH | 0.00387199 | ||||
Stake | 12767967 | 987 days ago | IN | 0 ETH | 0.00190985 | ||||
Stake | 12767601 | 987 days ago | IN | 0 ETH | 0.00148595 | ||||
Unstake | 12767374 | 987 days ago | IN | 0 ETH | 0.00635963 | ||||
Stake | 12767350 | 987 days ago | IN | 0 ETH | 0.0023851 | ||||
Stake | 12764710 | 988 days ago | IN | 0 ETH | 0.00168894 | ||||
Stake | 12762197 | 988 days ago | IN | 0 ETH | 0.00241284 | ||||
Unstake | 12762105 | 988 days ago | IN | 0 ETH | 0.00612277 | ||||
Stake | 12762100 | 988 days ago | IN | 0 ETH | 0.00187894 | ||||
Unstake | 12761382 | 988 days ago | IN | 0 ETH | 0.00300675 |
Latest 1 internal transaction
Advanced mode:
Parent Txn Hash | Block | From | To | Value | ||
---|---|---|---|---|---|---|
11498757 | 1183 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Contract Name:
RewardsType2
Compiler Version
v0.6.2+commit.bacdbe57
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity ^0.6.0; import "./Rewards.sol"; import "./ReferralRewardsType2.sol"; contract RewardsType2 is Rewards { event WithdrawRequested( address indexed user, uint256 id, uint256 amount, uint256 timelock ); struct Request { uint256 timelock; // Wnen the unstake can be executed uint256 amount; // Amount to be withdrawn Status status; // Request status } enum Status {NONE, PENDING, EXECUTED} // Unstake request status mapping(address => Request[]) public unstakeRequests; // Requests list per each user mapping(address => uint256) public requestHead; // The first pending unstake request in the user's requests list /// @dev Constructor that initializes the most important configurations. /// @param _token Token to be staked and harvested. /// @param _referralTree Contract with referral's tree. constructor(dANT _token, ReferralTree _referralTree) public Rewards(_token, 0, 57870370370) { referralRewards = new ReferralRewardsType2( _token, _referralTree, Rewards(address(this)), [uint256(5000 * 1e18), 2000 * 1e18, 100 * 1e18], [[uint256(0), 0, 0], [uint256(0), 0, 0], [uint256(0), 0, 0]], [ [uint256(6 * 1e16), 2 * 1e16, 1 * 1e16], [uint256(5 * 1e16), 15 * 1e15, 75 * 1e14], [uint256(4 * 1e16), 1 * 1e16, 5 * 1e15] ] ); referralRewards.transferOwnership(_msgSender()); } /// @dev Allows to unstake deposit amount. /// @param _amount Amount to be unstaked. function unstake(uint256 _amount) public { updateStakingReward(msg.sender); referralRewards.claimAllDividends(msg.sender); UserInfo storage user = userInfo[msg.sender]; if (_amount == 0) { _amount = user.amount; } user.amount = user.amount.sub(_amount); user.unfrozen = user.unfrozen.add(_amount); totalStake = totalStake.sub(_amount); uint256 id = unstakeRequests[msg.sender].length; unstakeRequests[msg.sender].push( Request({ timelock: now + 3 days, amount: _amount, status: Status.PENDING }) ); referralRewards.removeDepositReward(msg.sender, _amount); emit WithdrawRequested(msg.sender, id, _amount, now + 3 days); } /// @dev Accumulate new reward and remove old deposits. /// @param _user Address of the user. /// @return _reward Earned reward. function accumulateStakingReward(address _user) internal override returns (uint256) { UserInfo memory user = userInfo[_user]; return now.sub(user.lastUpdate).mul(user.amount).mul(rewardPerSec); } /// @dev Assess new reward. /// @param _user Address of the user. function updateStakingReward(address _user) internal override { super.updateStakingReward(_user); executeUnstakes(_user); } /// @dev Executes unstake requests if timelock passed. /// @param _user Address of the user. function executeUnstakes(address _user) internal { for ( uint256 requestId = requestHead[_user]; requestId < unstakeRequests[_user].length; requestId++ ) { Request storage request = unstakeRequests[_user][requestId]; if (request.timelock < now && request.status == Status.PENDING) { request.status = Status.EXECUTED; UserInfo storage user = userInfo[_user]; user.unfrozen = user.unfrozen.sub(request.amount); safeTokenTransfer(_user, request.amount); emit Withdraw(_user, requestId, request.amount, now); requestHead[_user] = requestHead[_user].add(1); } } } /// @dev Returns user's unclaimed reward. /// @param _includeDeposit Should the finnished deposits be included into calculations. /// @return _reward User's reward. function getPendingReward(address _user, bool _includeDeposit) public override view returns (uint256 _reward) { UserInfo storage user = userInfo[_user]; _reward = now .sub(user.lastUpdate) .mul(user.amount) .mul(rewardPerSec) .div(1e18); if (_includeDeposit) { for ( uint256 requestId = requestHead[_user]; requestId < unstakeRequests[_user].length; requestId++ ) { Request storage request = unstakeRequests[_user][requestId]; if ( request.timelock < now && request.status == Status.PENDING ) { _reward = _reward.add(request.amount); } } } } /// @dev Returns claimed and unclaimed user's reward. /// @param _user Address of the user. /// @return _reward User's reward. function getReward(address _user) public override view returns (uint256 _reward) { UserInfo storage user = userInfo[_user]; _reward = user.reward.add( now.sub(user.lastUpdate).mul(user.amount).mul(rewardPerSec).div( 1e18 ) ); } // /// @dev Returns user's unstake requests length. // /// @param _user Address of the user. // /// @return Number of unstake requests. function getRequestsLength(address _user) public view returns (uint256) { return unstakeRequests[_user].length; } /// @dev Returns unclaimed rewards. /// @return All unclaimed rewards. function getTotalPendingRewards() public view returns (uint256) { return now.sub(lastUpdate).mul(totalStake).mul(rewardPerSec).div(1e18); } /// @dev Returns assessed rewards. /// @return All assessed rewards. function getTotalRewards() public view returns (uint256) { return totalClaimed.add(getTotalPendingRewards()).sub(totalClaimed).div( 1e18 ); } /// @dev Procces deposit and by returning deposit. function handleDepositEnd(address, uint256) internal override {} }
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./ReferralTree.sol"; import "./dANT.sol"; contract ReferralRewards is Ownable { using SafeMath for uint256; event ReferralDepositReward( address indexed refferer, address indexed refferal, uint256 indexed level, uint256 amount ); event ReferralRewardPaid(address indexed user, uint256 amount); // Info of each deposit made by the referrer struct DepositInfo { address referrer; // Address of refferer who made this deposit uint256 depth; // The level of the refferal uint256 amount; // Amount of deposited LP tokens uint256 time; // Wnen the deposit is ended uint256 lastUpdatedTime; // Last time the referral claimed reward from the deposit } // Info of each referral struct ReferralInfo { uint256 reward; // Ammount of collected deposit rewards uint256 lastUpdate; // Last time the referral claimed rewards uint256 depositHead; // The start index in the deposit's list uint256 depositTail; // The end index in the deposit's list uint256[amtLevels] amounts; // Amounts that generate rewards on each referral level mapping(uint256 => DepositInfo) deposits; // Deposits that generate reward for the referral } uint256 public constant amtLevels = 3; // Number of levels by total staked amount that determine referral reward's rate uint256 public constant referDepth = 3; // Number of referral levels that can receive dividends dANT public token; // Harvested token contract ReferralTree public referralTree; // Contract with referral's tree Rewards rewards; // Main farming contract uint256[amtLevels] public depositBounds; // Limits of referral's stake used to determine the referral rate uint256[referDepth][amtLevels] public depositRate; // Referral rates based on referral's deplth and stake received from deposit uint256[referDepth][amtLevels] public stakingRate; // Referral rates based on referral's deplth and stake received from staking mapping(address => ReferralInfo) public referralReward; // Info per each referral /// @dev Constructor that initializes the most important configurations. /// @param _token Token to be staked and harvested. /// @param _referralTree Contract with referral's tree. /// @param _rewards Main farming contract. /// @param _depositBounds Limits of referral's stake used to determine the referral rate. /// @param _depositRate Referral rates based on referral's deplth and stake received from deposit. /// @param _stakingRate Referral rates based on referral's deplth and stake received from staking. constructor( dANT _token, ReferralTree _referralTree, Rewards _rewards, uint256[amtLevels] memory _depositBounds, uint256[referDepth][amtLevels] memory _depositRate, uint256[referDepth][amtLevels] memory _stakingRate ) public Ownable() { token = _token; referralTree = _referralTree; depositBounds = _depositBounds; depositRate = _depositRate; stakingRate = _stakingRate; rewards = _rewards; } /// @dev Allows an owner to update bounds. /// @param _depositBounds Limits of referral's stake used to determine the referral rate. function setBounds(uint256[amtLevels] memory _depositBounds) public onlyOwner { depositBounds = _depositBounds; } /// @dev Allows an owner to update deposit rates. /// @param _depositRate Referral rates based on referral's deplth and stake received from deposit. function setDepositRate(uint256[referDepth][amtLevels] memory _depositRate) public onlyOwner { depositRate = _depositRate; } /// @dev Allows an owner to update staking rates. /// @param _stakingRate Referral rates based on referral's deplth and stake received from staking. function setStakingRate(uint256[referDepth][amtLevels] memory _stakingRate) public onlyOwner { stakingRate = _stakingRate; } /// @dev Allows a farming contract to set user referral. /// @param _referrer Address of the referred user. /// @param _referral Address of the refferal. function setReferral(address _referrer, address _referral) public { require( msg.sender == address(rewards), "assessReferalDepositReward: bad role" ); referralTree.setReferral(_referrer, _referral); } /// @dev Allows the main farming contract to assess referral deposit rewards. /// @param _referrer Address of the referred user. /// @param _amount Amount of new deposit. function assessReferalDepositReward(address _referrer, uint256 _amount) external virtual { require( msg.sender == address(rewards), "assessReferalDepositReward: bad role" ); address[] memory referrals = referralTree.getReferrals( _referrer, referDepth ); uint256[] memory referralStakes = rewards.getReferralStakes(referrals); uint256[] memory percents = getDepositRate(referralStakes); for (uint256 level = 0; level < referrals.length; level++) { if (referrals[level] == address(0)) { continue; } ReferralInfo storage referralInfo = referralReward[referrals[level]]; referralInfo.deposits[referralInfo.depositTail] = DepositInfo({ referrer: _referrer, depth: level, amount: _amount, lastUpdatedTime: now, time: now + rewards.duration() }); referralInfo.amounts[level] = referralInfo.amounts[level].add( _amount ); referralInfo.depositTail = referralInfo.depositTail.add(1); if (percents[level] == 0) { continue; } uint256 depositReward = _amount.mul(percents[level]); if (depositReward > 0) { referralInfo.reward = referralInfo.reward.add(depositReward); emit ReferralDepositReward( _referrer, referrals[level], level, depositReward ); } } } /// @dev Allows a user to claim his dividends. function claimDividends() public { claimUserDividends(msg.sender); } /// @dev Allows a referral tree to claim all the dividends. /// @param _referral Address of user that claims his dividends. function claimAllDividends(address _referral) public { require( msg.sender == address(referralTree) || msg.sender == address(rewards), "claimAllDividends: bad role" ); claimUserDividends(_referral); } /// @dev Allows to decrement staked amount that generates reward to the referrals. /// @param _referrer Address of the referrer. /// @param _amount Ammount of tokens to be withdrawn by referrer. function removeDepositReward(address _referrer, uint256 _amount) external virtual {} /// @dev Update the staking referral reward for _user. /// @param _user Address of the referral. function accumulateReward(address _user) internal virtual { ReferralInfo storage referralInfo = referralReward[_user]; if (referralInfo.lastUpdate >= now) { return; } uint256 rewardPerSec = rewards.rewardPerSec(); uint256 referralStake = rewards.getReferralStake(_user); uint256[referDepth] memory rates = getStakingRateRange(referralStake); for ( uint256 i = referralInfo.depositHead; i < referralInfo.depositTail; i++ ) { DepositInfo memory deposit = referralInfo.deposits[i]; uint256 reward = Math .min(now, deposit.time) .sub(deposit.lastUpdatedTime) .mul(deposit.amount) .mul(rewardPerSec) .mul(rates[deposit.depth]) .div(1e18); if (reward > 0) { referralInfo.reward = referralInfo.reward.add(reward); } referralInfo.deposits[i].lastUpdatedTime = now; if (deposit.time < now) { if (i != referralInfo.depositHead) { referralInfo.deposits[i] = referralInfo .deposits[referralInfo.depositHead]; } delete referralInfo.deposits[referralInfo.depositHead]; referralInfo.depositHead = referralInfo.depositHead.add(1); } } referralInfo.lastUpdate = now; } /// @dev Asses and distribute claimed dividends. /// @param _user Address of user that claims dividends. function claimUserDividends(address _user) internal { accumulateReward(_user); ReferralInfo storage referralInfo = referralReward[_user]; uint256 amount = referralInfo.reward.div(1e18); if (amount > 0) { uint256 scaledReward = amount.mul(1e18); referralInfo.reward = referralInfo.reward.sub(scaledReward); token.mint(_user, amount); emit ReferralRewardPaid(_user, amount); } } /// @dev Returns referral reward. /// @param _user Address of referral. /// @return Referral reward. function getReferralReward(address _user) external virtual view returns (uint256) { ReferralInfo storage referralInfo = referralReward[_user]; uint256 rewardPerSec = rewards.rewardPerSec(); uint256 referralStake = rewards.getReferralStake(_user); uint256[referDepth] memory rates = getStakingRateRange(referralStake); uint256 _reward = referralInfo.reward; for ( uint256 i = referralInfo.depositHead; i < referralInfo.depositTail; i++ ) { DepositInfo memory deposit = referralInfo.deposits[i]; _reward = _reward.add( Math .min(now, deposit.time) .sub(deposit.lastUpdatedTime) .mul(deposit.amount) .mul(rewardPerSec) .mul(rates[deposit.depth]) .div(1e18) ); } return _reward.div(1e18); } /// @dev Returns direct user referral. /// @param _user Address of referrer. /// @return Direct user referral. function getReferral(address _user) public view returns (address) { return referralTree.referrals(_user); } /// @dev Returns stakong rate for the spesific referral stake. /// @param _referralStake Amount staked by referral. /// @return _rates Array of stakong rates by referral level. function getStakingRateRange(uint256 _referralStake) public view returns (uint256[referDepth] memory _rates) { for (uint256 i = 0; i < depositBounds.length; i++) { if (_referralStake >= depositBounds[i]) { return stakingRate[i]; } } } /// @dev Returns deposit rate based on the spesific referral stake and referral level. /// @param _referralStakes Amounts staked by referrals. /// @return _rates Array of deposit rates by referral level. function getDepositRate(uint256[] memory _referralStakes) public view returns (uint256[] memory _rates) { _rates = new uint256[](_referralStakes.length); for (uint256 level = 0; level < _referralStakes.length; level++) { for (uint256 j = 0; j < depositBounds.length; j++) { if (_referralStakes[level] >= depositBounds[j]) { _rates[level] = depositRate[j][level]; break; } } } } /// @dev Returns limits of referral's stake used to determine the referral rate. /// @return Array of deposit bounds. function getDepositBounds() public view returns (uint256[referDepth] memory) { return depositBounds; } /// @dev Returns referral rates based on referral's deplth and stake received from staking. /// @return Array of staking rates. function getStakingRates() public view returns (uint256[referDepth][amtLevels] memory) { return stakingRate; } /// @dev Returns referral rates based on referral's deplth and stake received from deposit. /// @return Array of deposit rates. function getDepositRates() public view returns (uint256[referDepth][amtLevels] memory) { return depositRate; } /// @dev Returns amounts that generate reward for referral bu levels. /// @param _user Address of referral. /// @return Returns amounts that generate reward for referral bu levels. function getReferralAmounts(address _user) public view returns (uint256[amtLevels] memory) { ReferralInfo memory referralInfo = referralReward[_user]; return referralInfo.amounts; } }
pragma solidity ^0.6.0; pragma experimental ABIEncoderV2; import "./ReferralRewards.sol"; contract ReferralRewardsType2 is ReferralRewards { /// @dev Constructor that initializes the most important configurations. /// @param _token Token to be staked and harvested. /// @param _referralTree Contract with referral's tree. /// @param _rewards Main farming contract. /// @param _depositBounds Limits of referral's stake used to determine the referral rate. /// @param _depositRate Referral rates based on referral's deplth and stake received from deposit. /// @param _stakingRate Referral rates based on referral's deplth and stake received from staking. constructor( dANT _token, ReferralTree _referralTree, Rewards _rewards, uint256[amtLevels] memory _depositBounds, uint256[referDepth][amtLevels] memory _depositRate, uint256[referDepth][amtLevels] memory _stakingRate ) public ReferralRewards( _token, _referralTree, _rewards, _depositBounds, _depositRate, _stakingRate ) {} /// @dev Allows the main farming contract to assess referral deposit rewards. /// @param _referrer Address of the referred user. /// @param _amount Amount of new deposit. function assessReferalDepositReward(address _referrer, uint256 _amount) external override { require( msg.sender == address(rewards), "assessReferalDepositReward: bad role" ); address[] memory referrals = referralTree.getReferrals( _referrer, referDepth ); for (uint256 i = 0; i < referrals.length; i++) { if (referrals[i] == address(0)) { continue; } accumulateReward(referrals[i]); ReferralInfo storage referralInfo = referralReward[referrals[i]]; referralInfo.deposits[referralInfo.depositTail] = DepositInfo({ referrer: _referrer, depth: i, amount: _amount, lastUpdatedTime: now, time: 0 }); referralInfo.amounts[i] = referralInfo.amounts[i].add(_amount); referralInfo.depositTail = referralInfo.depositTail.add(1); } } /// @dev Update the staking referral reward for _user. /// @param _user Address of the referral. function accumulateReward(address _user) internal override { ReferralInfo storage referralInfo = referralReward[_user]; if (referralInfo.lastUpdate >= now) { return; } uint256 rewardPerSec = rewards.rewardPerSec(); uint256 referralStake = rewards.getReferralStake(_user); uint256[referDepth] memory rates = getStakingRateRange(referralStake); if (referralInfo.lastUpdate > 0) { for (uint256 i = 0; i < referralInfo.amounts.length; i++) { uint256 reward = now .sub(referralInfo.lastUpdate) .mul(referralInfo.amounts[i]) .mul(rewardPerSec) .mul(rates[i]) .div(1e18); if (reward > 0) { referralInfo.reward = referralInfo.reward.add(reward); } } } referralInfo.lastUpdate = now; } /// @dev Allows the main farming contract to decrement staked amount that generates reward to the referrals. /// @param _referrer Address of the referrer. /// @param _amount Ammount of tokens to be withdrawn by referrer. function removeDepositReward(address _referrer, uint256 _amount) external override { require( msg.sender == address(rewards), "removeDepositReward: bad role" ); address[] memory referrals = referralTree.getReferrals( _referrer, referDepth ); for (uint256 i = 0; i < referrals.length; i++) { if (referrals[i] == address(0)) { continue; } accumulateReward(referrals[i]); ReferralInfo storage referralInfo = referralReward[referrals[i]]; referralInfo.amounts[i] = referralInfo.amounts[i].sub(_amount); } } /// @dev Returns referral reward. /// @param _user Address of referral. /// @return Referral reward. function getReferralReward(address _user) external override view returns (uint256) { ReferralInfo storage referralInfo = referralReward[_user]; uint256 rewardPerSec = rewards.rewardPerSec(); uint256 referralStake = rewards.getReferralStake(_user); uint256[referDepth] memory rates = getStakingRateRange(referralStake); uint256 _reward = referralInfo.reward; if (referralInfo.lastUpdate > 0) { for (uint256 i = 0; i < referralInfo.amounts.length; i++) { _reward = _reward.add( now .sub(referralInfo.lastUpdate) .mul(referralInfo.amounts[i]) .mul(rewardPerSec) .mul(rates[i]) .div(1e18) ); } } return _reward.div(1e18); } }
pragma solidity ^0.6.0; import "@openzeppelin/contracts/access/AccessControl.sol"; import "./ReferralRewards.sol"; import "./Rewards.sol"; contract ReferralTree is AccessControl { using SafeMath for uint256; event ReferralAdded(address indexed referrer, address indexed referral); bytes32 public constant REWARDS_ROLE = keccak256("REWARDS_ROLE"); // Role for those who allowed to mint new tokens mapping(address => address) public referrals; // Referral addresses for each referrer mapping(address => bool) public registered; // Map to ensure if the referrer is in the tree mapping(address => address[]) public referrers; // List of referrer addresses for each referral ReferralRewards[] public referralRewards; // Referral reward contracts that are allowed to modify the tree address public treeRoot; // The root of the referral tree /// @dev Constructor that initializes the most important configurations. /// @param _treeRoot The root of the referral tree. constructor(address _treeRoot) public AccessControl() { treeRoot = _treeRoot; registered[_treeRoot] = true; _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); } /// @dev Allows an admin to reanonce the DEFAULT_ADMIN_ROLE. /// @param _newAdmin Address of the new admin. function changeAdmin(address _newAdmin) public { require( hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "changeAdmin: bad role" ); _setupRole(DEFAULT_ADMIN_ROLE, _newAdmin); renounceRole(DEFAULT_ADMIN_ROLE, _msgSender()); } /// @dev Allows a farming contract to set the users referral. /// @param _referrer Address of the referred user. /// @param _referral Address of the refferal. function setReferral(address _referrer, address _referral) public { require(hasRole(REWARDS_ROLE, _msgSender()), "setReferral: bad role"); require(_referrer != address(0), "setReferral: bad referrer"); if (!registered[_referrer]) { require( registered[_referral], "setReferral: not registered referral" ); referrals[_referrer] = _referral; registered[_referrer] = true; referrers[_referral].push(_referrer); emit ReferralAdded(_referrer, _referral); } } /// @dev Allows an admin to remove the referral rewards contract from trusted list. /// @param _referralRewards Contract that manages referral rewards. function removeReferralReward(ReferralRewards _referralRewards) public { require( hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "setReferral: bad role" ); for (uint256 i = 0; i < referralRewards.length; i++) { if (_referralRewards == referralRewards[i]) { uint256 lastIndex = referralRewards.length - 1; if (i != lastIndex) { referralRewards[i] = referralRewards[lastIndex]; } referralRewards.pop(); revokeRole(REWARDS_ROLE, address(_referralRewards)); break; } } } /// @dev Allows an admin to add the referral rewards contract from trusted list. /// @param _referralRewards Contract that manages referral rewards. function addReferralReward(ReferralRewards _referralRewards) public { require( hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "setReferral: bad role" ); _setupRole(REWARDS_ROLE, address(_referralRewards)); referralRewards.push(_referralRewards); } /// @dev Allows a user to claim all the dividends in all trusted products. function claimAllDividends() public { for (uint256 i = 0; i < referralRewards.length; i++) { ReferralRewards referralReward = referralRewards[i]; if (referralReward.getReferralReward(_msgSender()) > 0) { referralReward.claimAllDividends(_msgSender()); } } } /// @dev Returns user referrals up to the required depth. /// @param _referrer Address of referrer. /// @param _referDepth Number of referrals to be returned. /// @return List of user referrals. function getReferrals(address _referrer, uint256 _referDepth) public view returns (address[] memory) { address[] memory referralsTree = new address[](_referDepth); address referrer = _referrer; for (uint256 i = 0; i < _referDepth; i++) { referralsTree[i] = referrals[referrer]; referrer = referralsTree[i]; } return referralsTree; } /// @dev Returns user referrals up to the required depth. /// @param _referral Address of referral. /// @return List of user referrers. function getReferrers(address _referral) public view returns (address[] memory) { return referrers[_referral]; } /// @dev Returns total user's referral reward. /// @param _user Address of the user. /// @return Total user's referral reward. function getUserReferralReward(address _user) public view returns (uint256) { uint256 amount = 0; for (uint256 i = 0; i < referralRewards.length; i++) { ReferralRewards referralReward = referralRewards[i]; amount = amount.add(referralReward.getReferralReward(_user)); } return amount; } /// @dev Returns trusted referral reward contracts. /// @return List of trusted referral reward contracts. function getReferralRewards() public view returns (ReferralRewards[] memory) { return referralRewards; } }
pragma solidity ^0.6.0; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./ReferralTree.sol"; import "./dANT.sol"; import "./ReferralRewards.sol"; abstract contract Rewards is Ownable { using SafeMath for uint256; event Deposit( address indexed user, uint256 indexed id, uint256 amount, uint256 start, uint256 end ); event Withdraw( address indexed user, uint256 indexed id, uint256 amount, uint256 time ); event RewardPaid(address indexed user, uint256 amount); // Info of each deposit made by the user struct DepositInfo { uint256 amount; // Amount of deposited LP tokens uint256 time; // Wnen the deposit is ended } // Info of each user struct UserInfo { uint256 amount; // Total deposited amount uint256 unfrozen; // Amount of token to be unstaked uint256 reward; // Ammount of claimed rewards uint256 lastUpdate; // Last time the user claimed rewards uint256 depositHead; // The start index in the deposit's list uint256 depositTail; // The end index in the deposit's list mapping(uint256 => DepositInfo) deposits; // User's dposits } dANT public token; // Harvested token contract ReferralRewards public referralRewards; // Contract that manages referral rewards uint256 public duration; // How long the deposit works uint256 public rewardPerSec; // Reward rate generated each second uint256 public totalStake; // Amount of all staked LP tokens uint256 public totalClaimed; // Amount of all distributed rewards uint256 public lastUpdate; // Last time someone received rewards bool public isActive = true; // If the deposits are allowed mapping(address => UserInfo) public userInfo; // Info per each user /// @dev Constructor that initializes the most important configurations. /// @param _token Token to be staked and harvested. /// @param _duration How long the deposit works. /// @param _rewardPerSec Reward rate generated each second. constructor( dANT _token, uint256 _duration, uint256 _rewardPerSec ) public Ownable() { token = _token; duration = _duration; rewardPerSec = _rewardPerSec; } /// @dev Allows an owner to stop or countinue deposits. /// @param _isActive Whether the deposits are allowed. function setActive(bool _isActive) public onlyOwner { isActive = _isActive; } /// @dev Allows an owner to update referral rewards module. /// @param _referralRewards Contract that manages referral rewards. function setReferralRewards(ReferralRewards _referralRewards) public onlyOwner { referralRewards = _referralRewards; } /// @dev Allows an owner to update duration of the deposits. /// @param _duration How long the deposit works. function setDuration(uint256 _duration) public onlyOwner { duration = _duration; } /// @dev Allows an owner to update reward rate per sec. /// @param _rewardPerSec Reward rate generated each second. function setRewardPerSec(uint256 _rewardPerSec) public onlyOwner { rewardPerSec = _rewardPerSec; } /// @dev Allows to stake for the specific user. /// @param _user Deposit receiver. /// @param _amount Amount of deposit. function stakeFor(address _user, uint256 _amount) public { require( referralRewards.getReferral(_user) != address(0), "stakeFor: referral isn't set" ); proccessStake(_user, _amount, address(0)); } /// @dev Allows to stake for themselves. /// @param _amount Amount of deposit. /// @param _refferal Referral address that will be set in case of the first stake. function stake(uint256 _amount, address _refferal) public { proccessStake(msg.sender, _amount, _refferal); } /// @dev Proccess the stake. /// @param _receiver Deposit receiver. /// @param _amount Amount of deposit. /// @param _refferal Referral address that will be set in case of the first stake. function proccessStake( address _receiver, uint256 _amount, address _refferal ) internal { require(isActive, "stake: is paused"); referralRewards.setReferral(_receiver, _refferal); referralRewards.claimAllDividends(_receiver); updateStakingReward(_receiver); if (_amount > 0) { token.transferFrom(msg.sender, address(this), _amount); UserInfo storage user = userInfo[_receiver]; user.amount = user.amount.add(_amount); totalStake = totalStake.add(_amount); user.deposits[user.depositTail] = DepositInfo({ amount: _amount, time: now + duration }); emit Deposit( _receiver, user.depositTail, _amount, now, now + duration ); user.depositTail = user.depositTail.add(1); referralRewards.assessReferalDepositReward(_receiver, _amount); } } /// @dev Accumulate new reward and remove old deposits. /// @param _user Address of the user. /// @return _reward Earned reward. function accumulateStakingReward(address _user) internal virtual returns (uint256 _reward) { UserInfo storage user = userInfo[_user]; for (uint256 i = user.depositHead; i < user.depositTail; i++) { DepositInfo memory deposit = user.deposits[i]; _reward = _reward.add( Math .min(now, deposit.time) .sub(user.lastUpdate) .mul(deposit.amount) .mul(rewardPerSec) ); if (deposit.time < now) { referralRewards.claimAllDividends(_user); user.amount = user.amount.sub(deposit.amount); handleDepositEnd(_user, deposit.amount); delete user.deposits[i]; user.depositHead = user.depositHead.add(1); } } } /// @dev Assess new reward. /// @param _user Address of the user. function updateStakingReward(address _user) internal virtual { UserInfo storage user = userInfo[_user]; if (user.lastUpdate >= now) { return; } uint256 scaledReward = accumulateStakingReward(_user); uint256 reward = scaledReward.div(1e18); lastUpdate = now; user.reward = user.reward.add(reward); user.lastUpdate = now; if (reward > 0) { totalClaimed = totalClaimed.add(reward); token.mint(_user, reward); emit RewardPaid(_user, reward); } } /// @dev Procces deposit and by returning deposit. /// @param _user Address of the user. /// @param _amount Amount of the deposit. function handleDepositEnd(address _user, uint256 _amount) internal virtual { totalStake = totalStake.sub(_amount); safeTokenTransfer(_user, _amount); emit Withdraw(_user, 0, _amount, now); } /// @dev Safe token transfer. /// @param _to Address of the receiver. /// @param _amount Amount of the tokens to be sent. function safeTokenTransfer(address _to, uint256 _amount) internal { uint256 tokenBal = token.balanceOf(address(this)); if (_amount > tokenBal) { token.transfer(_to, tokenBal); } else { token.transfer(_to, _amount); } } /// @dev Returns user's unclaimed reward. /// @param _user Address of the user. /// @param _includeDeposit Should the finnished deposits be included into calculations. /// @return _reward User's reward. function getPendingReward(address _user, bool _includeDeposit) public virtual view returns (uint256 _reward) { UserInfo storage user = userInfo[_user]; for (uint256 i = user.depositHead; i < user.depositTail; i++) { DepositInfo memory deposit = user.deposits[i]; _reward = _reward.add( Math .min(now, deposit.time) .sub(user.lastUpdate) .mul(deposit.amount) .mul(rewardPerSec) .div(1e18) ); if (_includeDeposit && deposit.time < now) { _reward = _reward.add(deposit.amount); } } } /// @dev Returns claimed and unclaimed user's reward. /// @param _user Address of the user. /// @return _reward User's reward. function getReward(address _user) public virtual view returns (uint256 _reward) { UserInfo storage user = userInfo[_user]; _reward = user.reward; for (uint256 i = user.depositHead; i < user.depositTail; i++) { DepositInfo memory deposit = user.deposits[i]; _reward = _reward.add( Math .min(now, deposit.time) .sub(user.lastUpdate) .mul(deposit.amount) .mul(rewardPerSec) .div(1e18) ); } } /// @dev Returns referral stakes. /// @param _referrals List of referrals[]. /// @return _stakes List of referral stakes. function getReferralStakes(address[] memory _referrals) public view returns (uint256[] memory _stakes) { _stakes = new uint256[](_referrals.length); for (uint256 i = 0; i < _referrals.length; i++) { _stakes[i] = userInfo[_referrals[i]].amount; } } /// @dev Returns referral stake. /// @param _referral Address of referral. /// @return Deposited amount. function getReferralStake(address _referral) public view returns (uint256) { return userInfo[_referral].amount; } /// @dev Returns approximate reward assessed in the future. /// @param _delta Time to estimate. /// @return Predicted rewards. function getEstimated(uint256 _delta) public view returns (uint256) { return (now + _delta) .sub(lastUpdate) .mul(totalStake) .mul(rewardPerSec) .div(1e18); } /// @dev Returns user's deposit by id. /// @param _user Address of user. /// @param _id Deposit id. /// @return Deposited amount and deposit end time. function getDeposit(address _user, uint256 _id) public view returns (uint256, uint256) { DepositInfo memory deposit = userInfo[_user].deposits[_id]; return (deposit.amount, deposit.time); } }
pragma solidity ^0.6.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol"; import "@openzeppelin/contracts/access/AccessControl.sol"; contract dANT is ERC20Burnable, AccessControl { bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); /** * @dev Grants `DEFAULT_ADMIN_ROLE` to the * account that deploys the contract. * * See {ERC20-constructor}. */ constructor(uint256 initialSupply) public ERC20("Digital Antares Dollar", "dANT") AccessControl() { _setupRole(DEFAULT_ADMIN_ROLE, _msgSender()); _mint(0xE7de66EC6Fca05392Ade53E1A6c06779f029977a, initialSupply * 10**18); } /** * @dev Set the DEFAULT_ADMIN_ROLE to `_newAdmin`. * * Requirements: * * - the caller must have the `DEFAULT_ADMIN_ROLE`. */ function changeAdmin(address _newAdmin) public { require( hasRole(DEFAULT_ADMIN_ROLE, _msgSender()), "changeAdmin: bad role" ); _setupRole(DEFAULT_ADMIN_ROLE, _newAdmin); renounceRole(DEFAULT_ADMIN_ROLE, _msgSender()); } /** * @dev Creates `_amount` new tokens for `_to`. * * See {ERC20-_mint}. * * Requirements: * * - the caller must have the `MINTER_ROLE`. */ function mint(address _to, uint256 _amount) public { require(hasRole(MINTER_ROLE, _msgSender()), "mint: bad role"); _mint(_to, _amount); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/EnumerableSet.sol"; import "../utils/Address.sol"; import "../GSN/Context.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context { using EnumerableSet for EnumerableSet.AddressSet; using Address for address; struct RoleData { EnumerableSet.AddressSet members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view returns (bool) { return _roles[role].members.contains(account); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view returns (uint256) { return _roles[role].members.length(); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view returns (address) { return _roles[role].members.at(index); } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant"); _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual { require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke"); _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { emit RoleAdminChanged(role, _roles[role].adminRole, adminRole); _roles[role].adminRole = adminRole; } function _grantRole(bytes32 role, address account) private { if (_roles[role].members.add(account)) { emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (_roles[role].members.remove(account)) { emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../GSN/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow, so we distribute return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../../GSN/Context.sol"; import "./IERC20.sol"; import "../../math/SafeMath.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ constructor (string memory name_, string memory symbol_) public { _name = name_; _symbol = symbol_; _decimals = 18; } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is * called. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */ function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../../GSN/Context.sol"; import "./ERC20.sol"; /** * @dev Extension of {ERC20} that allows token holders to destroy both their own * tokens and those that they have an allowance for, in a way that can be * recognized off-chain (via event analysis). */ abstract contract ERC20Burnable is Context, ERC20 { using SafeMath for uint256; /** * @dev Destroys `amount` tokens from the caller. * * See {ERC20-_burn}. */ function burn(uint256 amount) public virtual { _burn(_msgSender(), amount); } /** * @dev Destroys `amount` tokens from `account`, deducting from the caller's * allowance. * * See {ERC20-_burn} and {ERC20-allowance}. * * Requirements: * * - the caller must have allowance for ``accounts``'s tokens of at least * `amount`. */ function burnFrom(address account, uint256 amount) public virtual { uint256 decreasedAllowance = allowance(account, _msgSender()).sub(amount, "ERC20: burn amount exceeds allowance"); _approve(account, _msgSender(), decreasedAllowance); _burn(account, amount); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <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.6.2 <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); } 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); } } } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } }
{ "remappings": [], "optimizer": { "enabled": false, "runs": 200 }, "evmVersion": "istanbul", "libraries": { "": {} }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract dANT","name":"_token","type":"address"},{"internalType":"contract ReferralTree","name":"_referralTree","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"start","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"end","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"time","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timelock","type":"uint256"}],"name":"WithdrawRequested","type":"event"},{"inputs":[],"name":"duration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_delta","type":"uint256"}],"name":"getEstimated","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"bool","name":"_includeDeposit","type":"bool"}],"name":"getPendingReward","outputs":[{"internalType":"uint256","name":"_reward","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_referral","type":"address"}],"name":"getReferralStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_referrals","type":"address[]"}],"name":"getReferralStakes","outputs":[{"internalType":"uint256[]","name":"_stakes","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getRequestsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getReward","outputs":[{"internalType":"uint256","name":"_reward","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalPendingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"referralRewards","outputs":[{"internalType":"contract ReferralRewards","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"requestHead","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerSec","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_isActive","type":"bool"}],"name":"setActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_duration","type":"uint256"}],"name":"setDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ReferralRewards","name":"_referralRewards","type":"address"}],"name":"setReferralRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardPerSec","type":"uint256"}],"name":"setRewardPerSec","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_refferal","type":"address"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stakeFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract dANT","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalStake","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"unstakeRequests","outputs":[{"internalType":"uint256","name":"timelock","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"enum RewardsType2.Status","name":"status","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"unfrozen","type":"uint256"},{"internalType":"uint256","name":"reward","type":"uint256"},{"internalType":"uint256","name":"lastUpdate","type":"uint256"},{"internalType":"uint256","name":"depositHead","type":"uint256"},{"internalType":"uint256","name":"depositTail","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040526001600860006101000a81548160ff0219169083151502179055503480156200002c57600080fd5b5060405162006d2b38038062006d2b833981810160405260408110156200005257600080fd5b810190808051906020019092919080519060200190929190505050816000640d7957c6426000620000886200058360201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35082600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508160038190555080600481905550505050818130604051806060016040528069010f0cf064dd592000008152602001686c6b935b8bbd400000815260200168056bc75e2d631000008152506040518060600160405280604051806060016040528060008152602001600081526020016000815250815260200160405180606001604052806000815260200160008152602001600081525081526020016040518060600160405280600081526020016000815260200160008152508152506040518060600160405280604051806060016040528066d529ae9e860000815260200166470de4df8200008152602001662386f26fc100008152508152602001604051806060016040528066b1a2bc2ec50000815260200166354a6ba7a180008152602001661aa535d3d0c00081525081526020016040518060600160405280668e1bc9bf0400008152602001662386f26fc1000081526020016611c37937e08000815250815250604051620002da906200058b565b808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184600360200280838360005b838110156200039a5780820151818401526020810190506200037d565b505050509050018360036000925b81841015620003f25782846020020151600360200280838360005b83811015620003e0578082015181840152602081019050620003c3565b505050509050019260010192620003a8565b925050508260036000925b81841015620004475782846020020151600360200280838360005b838110156200043557808201518184015260208101905062000418565b505050509050019260010192620003fd565b925050509650505050505050604051809103906000f08015801562000470573d6000803e3d6000fd5b50600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f2fde38b620004ff6200058360201b60201c565b6040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b1580156200056257600080fd5b505af115801562000577573d6000803e3d6000fd5b50505050505062000599565b600033905090565b613829806200350283390190565b612f5980620005a96000396000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c80638b0e9f3f11610104578063c00007b0116100a2578063eeb58da511610071578063eeb58da51461090e578063f2fde38b14610952578063f6be71d114610996578063fc0c546a146109c4576101da565b8063c00007b01461085c578063c0463711146108b4578063d54ad2a1146108d2578063e627f2db146108f0576101da565b8063abdc8054116100de578063abdc8054146106af578063acec338a146106f1578063adcfa77314610721578063be6b5c911461074f576101da565b80638b0e9f3f146105fd5780638da5cb5b1461061b578063995deaba14610665576101da565b80632e17de781161017c5780634f41e95d1161014b5780634f41e95d1461050957806366442a0614610527578063715018a6146105a55780637acb7757146105af576101da565b80632e17de78146103d15780632ee40908146103ff5780634d597e761461044d5780634da63f8f146104a5576101da565b80631b1ace25116101b85780631b1ace25146102d05780631e9b3a921461032857806322f3e2d4146103465780632726b50614610368576101da565b80630fb5a6b4146101df57806316ad0f6d146101fd5780631959a00214610255575b600080fd5b6101e7610a0e565b6040518082815260200191505060405180910390f35b61023f6004803603602081101561021357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a14565b6040518082815260200191505060405180910390f35b6102976004803603602081101561026b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a60565b60405180878152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390f35b610312600480360360208110156102e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a9c565b6040518082815260200191505060405180910390f35b610330610ae8565b6040518082815260200191505060405180910390f35b61034e610b46565b604051808215151515815260200191505060405180910390f35b6103b46004803603604081101561037e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b59565b604051808381526020018281526020019250505060405180910390f35b6103fd600480360360208110156103e757600080fd5b8101908080359060200190929190505050610bee565b005b61044b6004803603604081101561041557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fa0565b005b61048f6004803603602081101561046357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061112c565b6040518082815260200191505060405180910390f35b6104f3600480360360408110156104bb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611144565b6040518082815260200191505060405180910390f35b610511611346565b6040518082815260200191505060405180910390f35b6105736004803603604081101561053d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061134c565b6040518084815260200183815260200182600281111561058f57fe5b60ff168152602001935050505060405180910390f35b6105ad61139d565b005b6105fb600480360360408110156105c557600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611525565b005b610605611534565b6040518082815260200191505060405180910390f35b61062361153a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61066d611563565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106db600480360360208110156106c557600080fd5b8101908080359060200190929190505050611589565b6040518082815260200191505060405180910390f35b61071f6004803603602081101561070757600080fd5b810190808035151590602001909291905050506115eb565b005b61074d6004803603602081101561073757600080fd5b81019080803590602001909291905050506116d1565b005b6108056004803603602081101561076557600080fd5b810190808035906020019064010000000081111561078257600080fd5b82018360208201111561079457600080fd5b803590602001918460208302840111640100000000831117156107b657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506117a4565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561084857808201518184015260208101905061082d565b505050509050019250505060405180910390f35b61089e6004803603602081101561087257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611869565b6040518082815260200191505060405180910390f35b6108bc611926565b6040518082815260200191505060405180910390f35b6108da61192c565b6040518082815260200191505060405180910390f35b6108f8611932565b6040518082815260200191505060405180910390f35b6109506004803603602081101561092457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611983565b005b6109946004803603602081101561096857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a90565b005b6109c2600480360360208110156109ac57600080fd5b8101908080359060200190929190505050611c9d565b005b6109cc611d70565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60035481565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b60096020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040154908060050154905086565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050919050565b6000610b41670de0b6b3a7640000610b33600454610b25600554610b1760075442611d9690919063ffffffff16565b611de090919063ffffffff16565b611de090919063ffffffff16565b611e6690919063ffffffff16565b905090565b600860009054906101000a900460ff1681565b600080610b64612e8c565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060060160008581526020019081526020016000206040518060400160405290816000820154815260200160018201548152505090508060000151816020015192509250509250929050565b610bf733611eb0565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166319aaff86336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b158015610c9857600080fd5b505af1158015610cac573d6000803e3d6000fd5b505050506000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000821415610d0457806000015491505b610d1b828260000154611d9690919063ffffffff16565b8160000181905550610d3a828260010154611ec590919063ffffffff16565b8160010181905550610d5782600554611d9690919063ffffffff16565b6005819055506000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060405180606001604052806203f4804201815260200185815260200160016002811115610e0c57fe5b8152509080600181540180825580915050600190039060005260206000209060030201600090919091909150600082015181600001556020820151816001015560408201518160020160006101000a81548160ff02191690836002811115610e7057fe5b02179055505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630d43422633856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167f7a64d79878509820925daa6339976afdd4e1c50dc32bfae6820dd5792bd306a782856203f480420160405180848152602001838152602001828152602001935050505060405180910390a2505050565b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633b0f0f2f846040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561105757600080fd5b505afa15801561106b573d6000803e3d6000fd5b505050506040513d602081101561108157600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16141561111c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f7374616b65466f723a20726566657272616c2069736e2774207365740000000081525060200191505060405180910390fd5b61112882826000611f4d565b5050565b600b6020528060005260406000206000915090505481565b600080600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506111e3670de0b6b3a76400006111d56004546111c785600001546111b9876003015442611d9690919063ffffffff16565b611de090919063ffffffff16565b611de090919063ffffffff16565b611e6690919063ffffffff16565b9150821561133f576000600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905081101561133d576000600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481106112c657fe5b906000526020600020906003020190504281600001541080156113105750600160028111156112f157fe5b8160020160009054906101000a900460ff16600281111561130e57fe5b145b1561132f5761132c816001015485611ec590919063ffffffff16565b93505b508080600101915050611230565b505b5092915050565b60045481565b600a602052816000526040600020818154811061136557fe5b9060005260206000209060030201600091509150508060000154908060010154908060020160009054906101000a900460ff16905083565b6113a56124b5565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611466576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b611530338383611f4d565b5050565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006115e4670de0b6b3a76400006115d66004546115c86005546115ba600754894201611d9690919063ffffffff16565b611de090919063ffffffff16565b611de090919063ffffffff16565b611e6690919063ffffffff16565b9050919050565b6115f36124b5565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600860006101000a81548160ff02191690831515021790555050565b6116d96124b5565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461179a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8060048190555050565b606081516040519080825280602002602001820160405280156117d65781602001602082028038833980820191505090505b50905060008090505b825181101561186357600960008483815181106117f857fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015482828151811061184a57fe5b60200260200101818152505080806001019150506117df565b50919050565b600080600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905061191e61190b670de0b6b3a76400006118fd6004546118ef86600001546118e1886003015442611d9690919063ffffffff16565b611de090919063ffffffff16565b611de090919063ffffffff16565b611e6690919063ffffffff16565b8260020154611ec590919063ffffffff16565b915050919050565b60075481565b60065481565b600061197e670de0b6b3a7640000611970600654611962611951610ae8565b600654611ec590919063ffffffff16565b611d9690919063ffffffff16565b611e6690919063ffffffff16565b905090565b61198b6124b5565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611a4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611a986124b5565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b59576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611bdf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612edd6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611ca56124b5565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611d66576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8060038190555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000611dd883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506124bd565b905092915050565b600080831415611df35760009050611e60565b6000828402905082848281611e0457fe5b0414611e5b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612f036021913960400191505060405180910390fd5b809150505b92915050565b6000611ea883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061257d565b905092915050565b611eb981612643565b611ec28161282d565b50565b600080828401905083811015611f43576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600860009054906101000a900460ff16611fcf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f7374616b653a206973207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637543e3f084836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b1580156120a457600080fd5b505af11580156120b8573d6000803e3d6000fd5b50505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166319aaff86846040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15801561215d57600080fd5b505af1158015612171573d6000803e3d6000fd5b5050505061217e83611eb0565b60008211156124b057600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561226457600080fd5b505af1158015612278573d6000803e3d6000fd5b505050506040513d602081101561228e57600080fd5b8101908080519060200190929190505050506000600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506122fa838260000154611ec590919063ffffffff16565b816000018190555061231783600554611ec590919063ffffffff16565b6005819055506040518060400160405280848152602001600354420181525081600601600083600501548152602001908152602001600020600082015181600001556020820151816001015590505080600501548473ffffffffffffffffffffffffffffffffffffffff167f7162984403f6c73c8639375d45a9187dfd04602231bd8e587c415718b5f7e5f98542600354420160405180848152602001838152602001828152602001935050505060405180910390a36123e560018260050154611ec590919063ffffffff16565b8160050181905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ab4f7a7a85856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561249657600080fd5b505af11580156124aa573d6000803e3d6000fd5b50505050505b505050565b600033905090565b600083831115829061256a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561252f578082015181840152602081019050612514565b50505050905090810190601f16801561255c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290612629576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156125ee5780820151818401526020810190506125d3565b50505050905090810190601f16801561261b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161263557fe5b049050809150509392505050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905042816003015410612697575061282a565b60006126a283612af6565b905060006126c1670de0b6b3a764000083611e6690919063ffffffff16565b9050426007819055506126e1818460020154611ec590919063ffffffff16565b836002018190555042836003018190555060008111156128265761271081600654611ec590919063ffffffff16565b600681905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1985836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156127bf57600080fd5b505af11580156127d3573d6000803e3d6000fd5b505050508373ffffffffffffffffffffffffffffffffffffffff167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486826040518082815260200191505060405180910390a25b5050505b50565b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015612af2576000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811061290857fe5b9060005260206000209060030201905042816000015410801561295257506001600281111561293357fe5b8160020160009054906101000a900460ff16600281111561295057fe5b145b15612ae45760028160020160006101000a81548160ff0219169083600281111561297857fe5b02179055506000600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506129db82600101548260010154611d9690919063ffffffff16565b81600101819055506129f1848360010154612bd1565b828473ffffffffffffffffffffffffffffffffffffffff167f02f25270a4d87bea75db541cdfe559334a275b4a233520ed6c0a2429667cca94846001015442604051808381526020018281526020019250505060405180910390a3612a9f6001600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec590919063ffffffff16565b600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b508080600101915050612872565b5050565b6000612b00612ea6565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060c001604052908160008201548152602001600182015481526020016002820154815260200160038201548152602001600482015481526020016005820154815250509050612bc9600454612bbb8360000151612bad856060015142611d9690919063ffffffff16565b611de090919063ffffffff16565b611de090919063ffffffff16565b915050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015612c7257600080fd5b505afa158015612c86573d6000803e3d6000fd5b505050506040513d6020811015612c9c57600080fd5b8101908080519060200190929190505050905080821115612da157600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015612d6057600080fd5b505af1158015612d74573d6000803e3d6000fd5b505050506040513d6020811015612d8a57600080fd5b810190808051906020019092919050505050612e87565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015612e4a57600080fd5b505af1158015612e5e573d6000803e3d6000fd5b505050506040513d6020811015612e7457600080fd5b8101908080519060200190929190505050505b505050565b604051806040016040528060008152602001600081525090565b6040518060c00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122039085f5dbe6be17a19dd9def29ff7cddaccc890a0530d84e005074335844e17864736f6c6343000602003360806040523480156200001157600080fd5b50604051620038293803806200382983398181016040526200003791908101906200052b565b85858585858560006200004f620001fe60201b60201c565b9050806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35085600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555084600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260049060036200018292919062000206565b50816007906003620001969291906200024b565b50806010906003620001aa9291906200024b565b5083600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050505050505050505050506200073c565b600033905090565b826003810192821562000238579160200282015b82811115620002375782518255916020019190600101906200021a565b5b509050620002479190620002a2565b5090565b826003800281019282156200028f579160200282015b828111156200028e578251829060036200027d929190620002ca565b509160200191906003019062000261565b5b5090506200029e91906200030f565b5090565b620002c791905b80821115620002c3576000816000905550600101620002a9565b5090565b90565b8260038101928215620002fc579160200282015b82811115620002fb578251825591602001919060010190620002de565b5b5090506200030b9190620002a2565b5090565b6200033d91905b808211156200033957600081816200032f919062000340565b5060030162000316565b5090565b90565b50600081556001016000815560010160009055565b600082601f8301126200036757600080fd5b60036200037e6200037882620005f1565b620005c3565b915081838560608402820111156200039557600080fd5b60005b83811015620003c95781620003ae8882620003d3565b84526020840193506060830192505060018101905062000398565b5050505092915050565b600082601f830112620003e557600080fd5b6003620003fc620003f68262000614565b620005c3565b915081838560208402820111156200041357600080fd5b60005b838110156200044757816200042c888262000514565b84526020840193506020830192505060018101905062000416565b5050505092915050565b600082601f8301126200046357600080fd5b60036200047a620004748262000637565b620005c3565b915081838560208402820111156200049157600080fd5b60005b83811015620004c55781620004aa888262000514565b84526020840193506020830192505060018101905062000494565b5050505092915050565b600081519050620004e081620006d4565b92915050565b600081519050620004f781620006ee565b92915050565b6000815190506200050e8162000708565b92915050565b600081519050620005258162000722565b92915050565b60008060008060008061030087890312156200054657600080fd5b60006200055689828a01620004fd565b96505060206200056989828a01620004cf565b95505060406200057c89828a01620004e6565b94505060606200058f89828a0162000451565b93505060c0620005a289828a0162000355565b9250506101e0620005b689828a0162000355565b9150509295509295509295565b6000604051905081810181811067ffffffffffffffff82111715620005e757600080fd5b8060405250919050565b600067ffffffffffffffff8211156200060957600080fd5b602082029050919050565b600067ffffffffffffffff8211156200062c57600080fd5b602082029050919050565b600067ffffffffffffffff8211156200064f57600080fd5b602082029050919050565b60006200066782620006aa565b9050919050565b60006200067b826200065a565b9050919050565b60006200068f826200065a565b9050919050565b6000620006a3826200065a565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b620006df816200066e565b8114620006eb57600080fd5b50565b620006f98162000682565b81146200070557600080fd5b50565b620007138162000696565b81146200071f57600080fd5b50565b6200072d81620006ca565b81146200073957600080fd5b50565b6130dd806200074c6000396000f3fe608060405234801561001057600080fd5b50600436106101a95760003560e01c8063715018a6116100f9578063ab4f7a7a11610097578063e7e2fe1911610071578063e7e2fe19146104bd578063f2fde38b146104db578063f3c13a12146104f7578063fc0c546a14610527576101a9565b8063ab4f7a7a14610455578063ad35710114610471578063c72b50fd146104a1576101a9565b80638da5cb5b116100d35780638da5cb5b146103a757806393af7adc146103c5578063a6a9fcfa146103f5578063a7749d1c14610425576101a9565b8063715018a6146103515780637543e3f01461035b578063767bd4ba14610377576101a9565b80633a294ba31161016657806353d4e7f51161014057806353d4e7f5146102d8578063668038e0146102f65780636dcc2b3a146103005780636e18b6db1461031e576101a9565b80633a294ba31461025c5780633b0f0f2f14610278578063414eff13146102a8576101a9565b80630b3cb9d2146101ae5780630d434226146101cc578063168b85cf146101e857806319aaff8614610204578063396fe62714610220578063397f66901461023e575b600080fd5b6101b6610545565b6040516101c39190612d92565b60405180910390f35b6101e660048036036101e191908101906125ac565b61054a565b005b61020260048036036101fd9190810190612653565b6107ab565b005b61021e6004803603610219919081019061251e565b610856565b005b61022861094a565b6040516102359190612c01565b60405180910390f35b6102466109cd565b6040516102539190612c5a565b60405180910390f35b61027660048036036102719190810190612629565b6109f3565b005b610292600480360361028d919081019061251e565b610a9e565b60405161029f9190612b94565b60405180910390f35b6102c260048036036102bd919081019061251e565b610b52565b6040516102cf9190612d92565b60405180910390f35b6102e0610df2565b6040516102ed9190612c01565b60405180910390f35b6102fe610e75565b005b610308610e80565b6040516103159190612d92565b60405180910390f35b6103386004803603610333919081019061251e565b610e85565b6040516103489493929190612dad565b60405180910390f35b610359610eb5565b005b61037560048036036103709190810190612570565b61100a565b005b610391600480360361038c91908101906126bd565b61112d565b60405161039e9190612d92565b60405180910390f35b6103af611145565b6040516103bc9190612b94565b60405180910390f35b6103df60048036036103da91908101906126bd565b61116e565b6040516103ec9190612c1d565b60405180910390f35b61040f600480360361040a919081019061251e565b611203565b60405161041c9190612c1d565b60405180910390f35b61043f600480360361043a919081019061267c565b6112d9565b60405161044c9190612c38565b60405180910390f35b61046f600480360361046a91908101906125ac565b6113b0565b005b61048b6004803603610486919081019061270f565b6116fa565b6040516104989190612d92565b60405180910390f35b6104bb60048036036104b69190810190612629565b611722565b005b6104c56117cd565b6040516104d29190612c1d565b60405180910390f35b6104f560048036036104f0919081019061251e565b611818565b005b610511600480360361050c919081019061270f565b6119dc565b60405161051e9190612d92565b60405180910390f35b61052f611a04565b60405161053c9190612c75565b60405180910390f35b600381565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146105da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d190612cf2565b60405180910390fd5b6060600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166332a00d8e8460036040518363ffffffff1660e01b815260040161063a929190612bd8565b60006040518083038186803b15801561065257600080fd5b505afa158015610666573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525061068f91908101906125e8565b905060008090505b81518110156107a557600073ffffffffffffffffffffffffffffffffffffffff168282815181106106c457fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614156106ed57610798565b6107098282815181106106fc57fe5b6020026020010151611a2a565b60006019600084848151811061071b57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506107828482600401846003811061077257fe5b0154611cd590919063ffffffff16565b81600401836003811061079157fe5b0181905550505b8080600101915050610697565b50505050565b6107b3611d1f565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610841576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083890612d32565b60405180910390fd5b80600490600361085292919061208c565b5050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108ff5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61093e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093590612d52565b60405180910390fd5b61094781611d27565b50565b6109526120cc565b6010600380602002604051908101604052809291906000905b828210156109c4578382600302016003806020026040519081016040528092919082600380156109b0576020028201915b81548152602001906001019080831161099c575b50505050508152602001906001019061096b565b50505050905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109fb611d1f565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8090612d32565b60405180910390fd5b806010906003610a9a9291906120f9565b5050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639ca423b3836040518263ffffffff1660e01b8152600401610afb9190612b94565b60206040518083038186803b158015610b1357600080fd5b505afa158015610b27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b4b9190810190612547565b9050919050565b600080601960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f41e95d6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c0057600080fd5b505afa158015610c14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610c3891908101906126e6565b90506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631b1ace25866040518263ffffffff1660e01b8152600401610c979190612b94565b60206040518083038186803b158015610caf57600080fd5b505afa158015610cc3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610ce791908101906126e6565b9050610cf1612149565b610cfa8261116e565b9050600084600001549050600085600101541115610dcb5760008090505b6003811015610dc957610dba610dab670de0b6b3a7640000610d9d868560038110610d3f57fe5b6020020151610d8f8a610d818d6004018960038110610d5a57fe5b0154610d738f6001015442611cd590919063ffffffff16565b611ec190919063ffffffff16565b611ec190919063ffffffff16565b611ec190919063ffffffff16565b611f3190919063ffffffff16565b83611f7b90919063ffffffff16565b91508080600101915050610d18565b505b610de6670de0b6b3a764000082611f3190919063ffffffff16565b95505050505050919050565b610dfa6120cc565b6007600380602002604051908101604052809291906000905b82821015610e6c57838260030201600380602002604051908101604052809291908260038015610e58576020028201915b815481526020019060010190808311610e44575b505050505081526020019060010190610e13565b50505050905090565b610e7e33611d27565b565b600381565b60196020528060005260406000206000915090508060000154908060010154908060020154908060030154905084565b610ebd611d1f565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f4290612d32565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461109a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109190612d72565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637543e3f083836040518363ffffffff1660e01b81526004016110f7929190612baf565b600060405180830381600087803b15801561111157600080fd5b505af1158015611125573d6000803e3d6000fd5b505050505050565b6004816003811061113a57fe5b016000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b611176612149565b60008090505b60038110156111fc576004816003811061119257fe5b015483106111ef57601081600381106111a757fe5b600302016003806020026040519081016040528092919082600380156111e2576020028201915b8154815260200190600101908083116111ce575b50505050509150506111fe565b808060010191505061117c565b505b919050565b61120b612149565b61121361216b565b601960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060a001604052908160008201548152602001600182015481526020016002820154815260200160038201548152602001600482016003806020026040519081016040528092919082600380156112c1576020028201915b8154815260200190600101908083116112ad575b50505050508152505090508060800151915050919050565b6060815160405190808252806020026020018201604052801561130b5781602001602082028038833980820191505090505b50905060008090505b82518110156113aa5760008090505b600381101561139c576004816003811061133957fe5b015484838151811061134757fe5b60200260200101511061138f576007816003811061136157fe5b60030201826003811061137057fe5b015483838151811061137e57fe5b60200260200101818152505061139c565b8080600101915050611323565b508080600101915050611314565b50919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611440576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143790612d72565b60405180910390fd5b6060600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166332a00d8e8460036040518363ffffffff1660e01b81526004016114a0929190612bd8565b60006040518083038186803b1580156114b857600080fd5b505afa1580156114cc573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506114f591908101906125e8565b905060008090505b81518110156116f457600073ffffffffffffffffffffffffffffffffffffffff1682828151811061152a57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff161415611553576116e7565b61156f82828151811061156257fe5b6020026020010151611a2a565b60006019600084848151811061158157fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506040518060a001604052808673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200185815260200160008152602001428152508160070160008360030154815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002015560608201518160030155608082015181600401559050506116b1848260040184600381106116a157fe5b0154611f7b90919063ffffffff16565b8160040183600381106116c057fe5b01819055506116dd60018260030154611f7b90919063ffffffff16565b8160030181905550505b80806001019150506114fd565b50505050565b6010826003811061170757fe5b60030201816003811061171657fe5b01600091509150505481565b61172a611d1f565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117af90612d32565b60405180910390fd5b8060079060036117c99291906120f9565b5050565b6117d5612149565b600460038060200260405190810160405280929190826003801561180e576020028201915b8154815260200190600101908083116117fa575b5050505050905090565b611820611d1f565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146118ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118a590612d32565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561191e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191590612cb2565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600782600381106119e957fe5b6003020181600381106119f857fe5b01600091509150505481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000601960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905042816001015410611a7e5750611cd2565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f41e95d6040518163ffffffff1660e01b815260040160206040518083038186803b158015611ae857600080fd5b505afa158015611afc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611b2091908101906126e6565b90506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631b1ace25856040518263ffffffff1660e01b8152600401611b7f9190612b94565b60206040518083038186803b158015611b9757600080fd5b505afa158015611bab573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611bcf91908101906126e6565b9050611bd9612149565b611be28261116e565b9050600084600101541115611cc45760008090505b6003811015611cc2576000611c89670de0b6b3a7640000611c7b858560038110611c1d57fe5b6020020151611c6d89611c5f8c6004018960038110611c3857fe5b0154611c518e6001015442611cd590919063ffffffff16565b611ec190919063ffffffff16565b611ec190919063ffffffff16565b611ec190919063ffffffff16565b611f3190919063ffffffff16565b90506000811115611cb457611cab818760000154611f7b90919063ffffffff16565b86600001819055505b508080600101915050611bf7565b505b428460010181905550505050505b50565b6000611d1783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611fd0565b905092915050565b600033905090565b611d3081611a2a565b6000601960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000611d94670de0b6b3a76400008360000154611f3190919063ffffffff16565b90506000811115611ebc576000611dbc670de0b6b3a764000083611ec190919063ffffffff16565b9050611dd5818460000154611cd590919063ffffffff16565b8360000181905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1985846040518363ffffffff1660e01b8152600401611e3a929190612bd8565b600060405180830381600087803b158015611e5457600080fd5b505af1158015611e68573d6000803e3d6000fd5b505050508373ffffffffffffffffffffffffffffffffffffffff167f04b20935b234f45fda390d2df59d92b7bb8bed322d3bc8764e826cfff50007d583604051611eb29190612d92565b60405180910390a2505b505050565b600080831415611ed45760009050611f2b565b6000828402905082848281611ee557fe5b0414611f26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f1d90612d12565b60405180910390fd5b809150505b92915050565b6000611f7383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061202b565b905092915050565b600080828401905083811015611fc6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fbd90612cd2565b60405180910390fd5b8091505092915050565b6000838311158290612018576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161200f9190612c90565b60405180910390fd5b5060008385039050809150509392505050565b60008083118290612072576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120699190612c90565b60405180910390fd5b50600083858161207e57fe5b049050809150509392505050565b82600381019282156120bb579160200282015b828111156120ba57825182559160200191906001019061209f565b5b5090506120c891906121a0565b5090565b60405180606001604052806003905b6120e36121c5565b8152602001906001900390816120db5790505090565b82600380028101928215612138579160200282015b82811115612137578251829060036121279291906121e7565b509160200191906003019061210e565b5b5090506121459190612227565b5090565b6040518060600160405280600390602082028038833980820191505090505090565b6040518060a001604052806000815260200160008152602001600081526020016000815260200161219a6121c5565b81525090565b6121c291905b808211156121be5760008160009055506001016121a6565b5090565b90565b6040518060600160405280600390602082028038833980820191505090505090565b8260038101928215612216579160200282015b828111156122155782518255916020019190600101906121fa565b5b50905061222391906121a0565b5090565b61225091905b8082111561224c57600081816122439190612253565b5060030161222d565b5090565b90565b50600081556001016000815560010160009055565b60008135905061227781613079565b92915050565b60008151905061228c81613079565b92915050565b600082601f8301126122a357600080fd5b81516122b66122b182612e1f565b612df2565b915081818352602084019350602081019050838560208402820111156122db57600080fd5b60005b8381101561230b57816122f1888261227d565b8452602084019350602083019250506001810190506122de565b5050505092915050565b600082601f83011261232657600080fd5b600361233961233482612e47565b612df2565b9150818385606084028201111561234f57600080fd5b60005b8381101561237f57816123658882612389565b845260208401935060608301925050600181019050612352565b5050505092915050565b600082601f83011261239a57600080fd5b60036123ad6123a882612e69565b612df2565b915081838560208402820111156123c357600080fd5b60005b838110156123f357816123d988826124f4565b8452602084019350602083019250506001810190506123c6565b5050505092915050565b600082601f83011261240e57600080fd5b600361242161241c82612e8b565b612df2565b9150818385602084028201111561243757600080fd5b60005b83811015612467578161244d88826124f4565b84526020840193506020830192505060018101905061243a565b5050505092915050565b600082601f83011261248257600080fd5b813561249561249082612ead565b612df2565b915081818352602084019350602081019050838560208402820111156124ba57600080fd5b60005b838110156124ea57816124d088826124f4565b8452602084019350602083019250506001810190506124bd565b5050505092915050565b60008135905061250381613090565b92915050565b60008151905061251881613090565b92915050565b60006020828403121561253057600080fd5b600061253e84828501612268565b91505092915050565b60006020828403121561255957600080fd5b60006125678482850161227d565b91505092915050565b6000806040838503121561258357600080fd5b600061259185828601612268565b92505060206125a285828601612268565b9150509250929050565b600080604083850312156125bf57600080fd5b60006125cd85828601612268565b92505060206125de858286016124f4565b9150509250929050565b6000602082840312156125fa57600080fd5b600082015167ffffffffffffffff81111561261457600080fd5b61262084828501612292565b91505092915050565b6000610120828403121561263c57600080fd5b600061264a84828501612315565b91505092915050565b60006060828403121561266557600080fd5b6000612673848285016123fd565b91505092915050565b60006020828403121561268e57600080fd5b600082013567ffffffffffffffff8111156126a857600080fd5b6126b484828501612471565b91505092915050565b6000602082840312156126cf57600080fd5b60006126dd848285016124f4565b91505092915050565b6000602082840312156126f857600080fd5b600061270684828501612509565b91505092915050565b6000806040838503121561272257600080fd5b6000612730858286016124f4565b9250506020612741858286016124f4565b9150509250929050565b60006127578383612838565b60608301905092915050565b600061276f8383612b76565b60208301905092915050565b61278481612fb1565b82525050565b61279381612f03565b61279d8184612f6e565b92506127a882612ed5565b8060005b838110156127d95781516127c0878261274b565b96506127cb83612f3a565b9250506001810190506127ac565b505050505050565b6127ea81612f19565b6127f48184612f84565b92506127ff82612ee9565b8060005b838110156128305781516128178782612763565b965061282283612f54565b925050600181019050612803565b505050505050565b61284181612f0e565b61284b8184612f79565b925061285682612edf565b8060005b8381101561288757815161286e8782612763565b965061287983612f47565b92505060018101905061285a565b505050505050565b600061289a82612f24565b6128a48185612f8f565b93506128af83612ef3565b8060005b838110156128e05781516128c78882612763565b97506128d283612f61565b9250506001810190506128b3565b5085935050505092915050565b6128f681612fed565b82525050565b61290581613011565b82525050565b600061291682612f2f565b6129208185612fa0565b9350612930818560208601613035565b61293981613068565b840191505092915050565b6000612951602683612fa0565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006129b7601b83612fa0565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b60006129f7601d83612fa0565b91507f72656d6f76654465706f7369745265776172643a2062616420726f6c650000006000830152602082019050919050565b6000612a37602183612fa0565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612a9d602083612fa0565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000612add601b83612fa0565b91507f636c61696d416c6c4469766964656e64733a2062616420726f6c6500000000006000830152602082019050919050565b6000612b1d602483612fa0565b91507f6173736573735265666572616c4465706f7369745265776172643a206261642060008301527f726f6c65000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b612b7f81612fe3565b82525050565b612b8e81612fe3565b82525050565b6000602082019050612ba9600083018461277b565b92915050565b6000604082019050612bc4600083018561277b565b612bd1602083018461277b565b9392505050565b6000604082019050612bed600083018561277b565b612bfa6020830184612b85565b9392505050565b600061012082019050612c17600083018461278a565b92915050565b6000606082019050612c3260008301846127e1565b92915050565b60006020820190508181036000830152612c52818461288f565b905092915050565b6000602082019050612c6f60008301846128ed565b92915050565b6000602082019050612c8a60008301846128fc565b92915050565b60006020820190508181036000830152612caa818461290b565b905092915050565b60006020820190508181036000830152612ccb81612944565b9050919050565b60006020820190508181036000830152612ceb816129aa565b9050919050565b60006020820190508181036000830152612d0b816129ea565b9050919050565b60006020820190508181036000830152612d2b81612a2a565b9050919050565b60006020820190508181036000830152612d4b81612a90565b9050919050565b60006020820190508181036000830152612d6b81612ad0565b9050919050565b60006020820190508181036000830152612d8b81612b10565b9050919050565b6000602082019050612da76000830184612b85565b92915050565b6000608082019050612dc26000830187612b85565b612dcf6020830186612b85565b612ddc6040830185612b85565b612de96060830184612b85565b95945050505050565b6000604051905081810181811067ffffffffffffffff82111715612e1557600080fd5b8060405250919050565b600067ffffffffffffffff821115612e3657600080fd5b602082029050602081019050919050565b600067ffffffffffffffff821115612e5e57600080fd5b602082029050919050565b600067ffffffffffffffff821115612e8057600080fd5b602082029050919050565b600067ffffffffffffffff821115612ea257600080fd5b602082029050919050565b600067ffffffffffffffff821115612ec457600080fd5b602082029050602081019050919050565b6000819050919050565b6000819050919050565b6000819050919050565b6000819050602082019050919050565b600060039050919050565b600060039050919050565b600060039050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600081905092915050565b600081905092915050565b600081905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612fbc82612fc3565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6000612ff882612fff565b9050919050565b600061300a82612fc3565b9050919050565b600061301c82613023565b9050919050565b600061302e82612fc3565b9050919050565b60005b83811015613053578082015181840152602081019050613038565b83811115613062576000848401525b50505050565b6000601f19601f8301169050919050565b61308281612fb1565b811461308d57600080fd5b50565b61309981612fe3565b81146130a457600080fd5b5056fea2646970667358221220afd5d572a68e87f62246d4b6444c10013b6354347155267bec1c11452a79a9b264736f6c63430006020033000000000000000000000000be3c393fb670f0a29c3f3e660ffb113200e36676000000000000000000000000e5c23851bbde700414beb3ab2d2ae7063c8d9c72
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101da5760003560e01c80638b0e9f3f11610104578063c00007b0116100a2578063eeb58da511610071578063eeb58da51461090e578063f2fde38b14610952578063f6be71d114610996578063fc0c546a146109c4576101da565b8063c00007b01461085c578063c0463711146108b4578063d54ad2a1146108d2578063e627f2db146108f0576101da565b8063abdc8054116100de578063abdc8054146106af578063acec338a146106f1578063adcfa77314610721578063be6b5c911461074f576101da565b80638b0e9f3f146105fd5780638da5cb5b1461061b578063995deaba14610665576101da565b80632e17de781161017c5780634f41e95d1161014b5780634f41e95d1461050957806366442a0614610527578063715018a6146105a55780637acb7757146105af576101da565b80632e17de78146103d15780632ee40908146103ff5780634d597e761461044d5780634da63f8f146104a5576101da565b80631b1ace25116101b85780631b1ace25146102d05780631e9b3a921461032857806322f3e2d4146103465780632726b50614610368576101da565b80630fb5a6b4146101df57806316ad0f6d146101fd5780631959a00214610255575b600080fd5b6101e7610a0e565b6040518082815260200191505060405180910390f35b61023f6004803603602081101561021357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a14565b6040518082815260200191505060405180910390f35b6102976004803603602081101561026b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a60565b60405180878152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390f35b610312600480360360208110156102e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a9c565b6040518082815260200191505060405180910390f35b610330610ae8565b6040518082815260200191505060405180910390f35b61034e610b46565b604051808215151515815260200191505060405180910390f35b6103b46004803603604081101561037e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b59565b604051808381526020018281526020019250505060405180910390f35b6103fd600480360360208110156103e757600080fd5b8101908080359060200190929190505050610bee565b005b61044b6004803603604081101561041557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fa0565b005b61048f6004803603602081101561046357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061112c565b6040518082815260200191505060405180910390f35b6104f3600480360360408110156104bb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611144565b6040518082815260200191505060405180910390f35b610511611346565b6040518082815260200191505060405180910390f35b6105736004803603604081101561053d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061134c565b6040518084815260200183815260200182600281111561058f57fe5b60ff168152602001935050505060405180910390f35b6105ad61139d565b005b6105fb600480360360408110156105c557600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611525565b005b610605611534565b6040518082815260200191505060405180910390f35b61062361153a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61066d611563565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106db600480360360208110156106c557600080fd5b8101908080359060200190929190505050611589565b6040518082815260200191505060405180910390f35b61071f6004803603602081101561070757600080fd5b810190808035151590602001909291905050506115eb565b005b61074d6004803603602081101561073757600080fd5b81019080803590602001909291905050506116d1565b005b6108056004803603602081101561076557600080fd5b810190808035906020019064010000000081111561078257600080fd5b82018360208201111561079457600080fd5b803590602001918460208302840111640100000000831117156107b657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506117a4565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561084857808201518184015260208101905061082d565b505050509050019250505060405180910390f35b61089e6004803603602081101561087257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611869565b6040518082815260200191505060405180910390f35b6108bc611926565b6040518082815260200191505060405180910390f35b6108da61192c565b6040518082815260200191505060405180910390f35b6108f8611932565b6040518082815260200191505060405180910390f35b6109506004803603602081101561092457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611983565b005b6109946004803603602081101561096857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a90565b005b6109c2600480360360208110156109ac57600080fd5b8101908080359060200190929190505050611c9d565b005b6109cc611d70565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60035481565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b60096020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040154908060050154905086565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050919050565b6000610b41670de0b6b3a7640000610b33600454610b25600554610b1760075442611d9690919063ffffffff16565b611de090919063ffffffff16565b611de090919063ffffffff16565b611e6690919063ffffffff16565b905090565b600860009054906101000a900460ff1681565b600080610b64612e8c565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060060160008581526020019081526020016000206040518060400160405290816000820154815260200160018201548152505090508060000151816020015192509250509250929050565b610bf733611eb0565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166319aaff86336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b158015610c9857600080fd5b505af1158015610cac573d6000803e3d6000fd5b505050506000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000821415610d0457806000015491505b610d1b828260000154611d9690919063ffffffff16565b8160000181905550610d3a828260010154611ec590919063ffffffff16565b8160010181905550610d5782600554611d9690919063ffffffff16565b6005819055506000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060405180606001604052806203f4804201815260200185815260200160016002811115610e0c57fe5b8152509080600181540180825580915050600190039060005260206000209060030201600090919091909150600082015181600001556020820151816001015560408201518160020160006101000a81548160ff02191690836002811115610e7057fe5b02179055505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630d43422633856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff167f7a64d79878509820925daa6339976afdd4e1c50dc32bfae6820dd5792bd306a782856203f480420160405180848152602001838152602001828152602001935050505060405180910390a2505050565b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633b0f0f2f846040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561105757600080fd5b505afa15801561106b573d6000803e3d6000fd5b505050506040513d602081101561108157600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff16141561111c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f7374616b65466f723a20726566657272616c2069736e2774207365740000000081525060200191505060405180910390fd5b61112882826000611f4d565b5050565b600b6020528060005260406000206000915090505481565b600080600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506111e3670de0b6b3a76400006111d56004546111c785600001546111b9876003015442611d9690919063ffffffff16565b611de090919063ffffffff16565b611de090919063ffffffff16565b611e6690919063ffffffff16565b9150821561133f576000600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905081101561133d576000600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481106112c657fe5b906000526020600020906003020190504281600001541080156113105750600160028111156112f157fe5b8160020160009054906101000a900460ff16600281111561130e57fe5b145b1561132f5761132c816001015485611ec590919063ffffffff16565b93505b508080600101915050611230565b505b5092915050565b60045481565b600a602052816000526040600020818154811061136557fe5b9060005260206000209060030201600091509150508060000154908060010154908060020160009054906101000a900460ff16905083565b6113a56124b5565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611466576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b611530338383611f4d565b5050565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006115e4670de0b6b3a76400006115d66004546115c86005546115ba600754894201611d9690919063ffffffff16565b611de090919063ffffffff16565b611de090919063ffffffff16565b611e6690919063ffffffff16565b9050919050565b6115f36124b5565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600860006101000a81548160ff02191690831515021790555050565b6116d96124b5565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461179a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8060048190555050565b606081516040519080825280602002602001820160405280156117d65781602001602082028038833980820191505090505b50905060008090505b825181101561186357600960008483815181106117f857fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015482828151811061184a57fe5b60200260200101818152505080806001019150506117df565b50919050565b600080600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905061191e61190b670de0b6b3a76400006118fd6004546118ef86600001546118e1886003015442611d9690919063ffffffff16565b611de090919063ffffffff16565b611de090919063ffffffff16565b611e6690919063ffffffff16565b8260020154611ec590919063ffffffff16565b915050919050565b60075481565b60065481565b600061197e670de0b6b3a7640000611970600654611962611951610ae8565b600654611ec590919063ffffffff16565b611d9690919063ffffffff16565b611e6690919063ffffffff16565b905090565b61198b6124b5565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611a4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611a986124b5565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611b59576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611bdf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612edd6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611ca56124b5565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611d66576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8060038190555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000611dd883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506124bd565b905092915050565b600080831415611df35760009050611e60565b6000828402905082848281611e0457fe5b0414611e5b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612f036021913960400191505060405180910390fd5b809150505b92915050565b6000611ea883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061257d565b905092915050565b611eb981612643565b611ec28161282d565b50565b600080828401905083811015611f43576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600860009054906101000a900460ff16611fcf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f7374616b653a206973207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637543e3f084836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b1580156120a457600080fd5b505af11580156120b8573d6000803e3d6000fd5b50505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166319aaff86846040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15801561215d57600080fd5b505af1158015612171573d6000803e3d6000fd5b5050505061217e83611eb0565b60008211156124b057600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561226457600080fd5b505af1158015612278573d6000803e3d6000fd5b505050506040513d602081101561228e57600080fd5b8101908080519060200190929190505050506000600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506122fa838260000154611ec590919063ffffffff16565b816000018190555061231783600554611ec590919063ffffffff16565b6005819055506040518060400160405280848152602001600354420181525081600601600083600501548152602001908152602001600020600082015181600001556020820151816001015590505080600501548473ffffffffffffffffffffffffffffffffffffffff167f7162984403f6c73c8639375d45a9187dfd04602231bd8e587c415718b5f7e5f98542600354420160405180848152602001838152602001828152602001935050505060405180910390a36123e560018260050154611ec590919063ffffffff16565b8160050181905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ab4f7a7a85856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561249657600080fd5b505af11580156124aa573d6000803e3d6000fd5b50505050505b505050565b600033905090565b600083831115829061256a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561252f578082015181840152602081019050612514565b50505050905090810190601f16801561255c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290612629576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156125ee5780820151818401526020810190506125d3565b50505050905090810190601f16801561261b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161263557fe5b049050809150509392505050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905042816003015410612697575061282a565b60006126a283612af6565b905060006126c1670de0b6b3a764000083611e6690919063ffffffff16565b9050426007819055506126e1818460020154611ec590919063ffffffff16565b836002018190555042836003018190555060008111156128265761271081600654611ec590919063ffffffff16565b600681905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1985836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b1580156127bf57600080fd5b505af11580156127d3573d6000803e3d6000fd5b505050508373ffffffffffffffffffffffffffffffffffffffff167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486826040518082815260200191505060405180910390a25b5050505b50565b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015612af2576000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811061290857fe5b9060005260206000209060030201905042816000015410801561295257506001600281111561293357fe5b8160020160009054906101000a900460ff16600281111561295057fe5b145b15612ae45760028160020160006101000a81548160ff0219169083600281111561297857fe5b02179055506000600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506129db82600101548260010154611d9690919063ffffffff16565b81600101819055506129f1848360010154612bd1565b828473ffffffffffffffffffffffffffffffffffffffff167f02f25270a4d87bea75db541cdfe559334a275b4a233520ed6c0a2429667cca94846001015442604051808381526020018281526020019250505060405180910390a3612a9f6001600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ec590919063ffffffff16565b600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b508080600101915050612872565b5050565b6000612b00612ea6565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060c001604052908160008201548152602001600182015481526020016002820154815260200160038201548152602001600482015481526020016005820154815250509050612bc9600454612bbb8360000151612bad856060015142611d9690919063ffffffff16565b611de090919063ffffffff16565b611de090919063ffffffff16565b915050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015612c7257600080fd5b505afa158015612c86573d6000803e3d6000fd5b505050506040513d6020811015612c9c57600080fd5b8101908080519060200190929190505050905080821115612da157600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015612d6057600080fd5b505af1158015612d74573d6000803e3d6000fd5b505050506040513d6020811015612d8a57600080fd5b810190808051906020019092919050505050612e87565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015612e4a57600080fd5b505af1158015612e5e573d6000803e3d6000fd5b505050506040513d6020811015612e7457600080fd5b8101908080519060200190929190505050505b505050565b604051806040016040528060008152602001600081525090565b6040518060c00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122039085f5dbe6be17a19dd9def29ff7cddaccc890a0530d84e005074335844e17864736f6c63430006020033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000be3c393fb670f0a29c3f3e660ffb113200e36676000000000000000000000000e5c23851bbde700414beb3ab2d2ae7063c8d9c72
-----Decoded View---------------
Arg [0] : _token (address): 0xbE3c393Fb670f0A29C3F3E660FFB113200e36676
Arg [1] : _referralTree (address): 0xe5C23851Bbde700414BeB3Ab2D2aE7063c8D9C72
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000be3c393fb670f0a29c3f3e660ffb113200e36676
Arg [1] : 000000000000000000000000e5c23851bbde700414beb3ab2d2ae7063c8d9c72
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 23 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
[ 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.