Feature Tip: Add private address tag to any address under My Name Tag !
ERC-20
unagii.com
Overview
Max Total Supply
2,668,940.109529958821579845 uKNC
Holders
165 (0.00%)
Total Transfers
-
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
PoolMaster
Compiler Version
v0.7.6+commit.7338295f
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.7.6; import '@openzeppelin/contracts/math/SafeMath.sol'; import {IERC20Ext} from '@kyber.network/utils-sc/contracts/IERC20Ext.sol'; import {ERC20, ERC20Burnable} from '@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol'; import {SafeERC20} from '@openzeppelin/contracts/token/ERC20/SafeERC20.sol'; import {ReentrancyGuard} from '@openzeppelin/contracts/utils/ReentrancyGuard.sol'; import { PermissionAdmin, PermissionOperators } from '@kyber.network/utils-sc/contracts/PermissionOperators.sol'; import {IKyberStaking} from '../interfaces/staking/IKyberStaking.sol'; import {IRewardsDistributor} from '../interfaces/rewardDistribution/IRewardsDistributor.sol'; import {IKyberGovernance} from '../interfaces/governance/IKyberGovernance.sol'; interface INewKNC { function mintWithOldKnc(uint256 amount) external; function oldKNC() external view returns (address); } interface IKyberNetworkProxy { function swapEtherToToken(IERC20Ext token, uint256 minConversionRate) external payable returns (uint256 destAmount); function swapTokenToToken( IERC20Ext src, uint256 srcAmount, IERC20Ext dest, uint256 minConversionRate ) external returns (uint256 destAmount); } contract PoolMaster is PermissionAdmin, PermissionOperators, ReentrancyGuard, ERC20Burnable { using SafeMath for uint256; using SafeERC20 for IERC20Ext; struct Fees { uint256 mintFeeBps; uint256 claimFeeBps; uint256 burnFeeBps; } event FeesSet(uint256 mintFeeBps, uint256 burnFeeBps, uint256 claimFeeBps); enum FeeTypes {MINT, CLAIM, BURN} IERC20Ext internal constant ETH_ADDRESS = IERC20Ext(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE); uint256 internal constant PRECISION = (10**18); uint256 internal constant BPS = 10000; uint256 internal constant MAX_FEE_BPS = 1000; // 10% uint256 internal constant INITIAL_SUPPLY_MULTIPLIER = 10; Fees public adminFees; uint256 public withdrawableAdminFees; IKyberNetworkProxy public kyberProxy; IKyberStaking public immutable kyberStaking; IRewardsDistributor public rewardsDistributor; IKyberGovernance public kyberGovernance; IERC20Ext public immutable newKnc; IERC20Ext private immutable oldKnc; receive() external payable {} constructor( string memory _name, string memory _symbol, IKyberNetworkProxy _kyberProxy, IKyberStaking _kyberStaking, IKyberGovernance _kyberGovernance, IRewardsDistributor _rewardsDistributor, uint256 _mintFeeBps, uint256 _claimFeeBps, uint256 _burnFeeBps ) ERC20(_name, _symbol) PermissionAdmin(msg.sender) { kyberProxy = _kyberProxy; kyberStaking = _kyberStaking; kyberGovernance = _kyberGovernance; rewardsDistributor = _rewardsDistributor; address _newKnc = address(_kyberStaking.kncToken()); newKnc = IERC20Ext(_newKnc); IERC20Ext _oldKnc = IERC20Ext(INewKNC(_newKnc).oldKNC()); oldKnc = _oldKnc; _oldKnc.safeApprove(_newKnc, type(uint256).max); IERC20Ext(_newKnc).safeApprove(address(_kyberStaking), type(uint256).max); _changeFees(_mintFeeBps, _claimFeeBps, _burnFeeBps); } function changeKyberProxy(IKyberNetworkProxy _kyberProxy) external onlyAdmin { kyberProxy = _kyberProxy; } function changeRewardsDistributor(IRewardsDistributor _rewardsDistributor) external onlyAdmin { rewardsDistributor = _rewardsDistributor; } function changeGovernance(IKyberGovernance _kyberGovernance) external onlyAdmin { kyberGovernance = _kyberGovernance; } function changeFees( uint256 _mintFeeBps, uint256 _claimFeeBps, uint256 _burnFeeBps ) external onlyAdmin { _changeFees(_mintFeeBps, _claimFeeBps, _burnFeeBps); } function depositWithOldKnc(uint256 tokenWei) external { oldKnc.safeTransferFrom(msg.sender, address(this), tokenWei); INewKNC(address(newKnc)).mintWithOldKnc(tokenWei); _deposit(tokenWei, msg.sender); } function depositWithNewKnc(uint256 tokenWei) external { newKnc.safeTransferFrom(msg.sender, address(this), tokenWei); _deposit(tokenWei, msg.sender); } /* * @notice Called by users burning their token * @dev Calculates pro rata KNC and redeems from staking contract * @param tokensToRedeem */ function withdraw(uint256 tokensToRedeemTwei) external nonReentrant { require(balanceOf(msg.sender) >= tokensToRedeemTwei, 'insufficient balance'); uint256 proRataKnc = getLatestStake().mul(tokensToRedeemTwei).div(totalSupply()); _unstake(proRataKnc); proRataKnc = _administerAdminFee(FeeTypes.BURN, proRataKnc); super._burn(msg.sender, tokensToRedeemTwei); newKnc.safeTransfer(msg.sender, proRataKnc); } /* * @notice Vote on KyberDAO campaigns * @dev Admin calls with relevant params for each campaign in an epoch * @param proposalIds: DAO proposalIds * @param optionBitMasks: corresponding voting options */ function vote(uint256[] calldata proposalIds, uint256[] calldata optionBitMasks) external onlyOperator { require(proposalIds.length == optionBitMasks.length, 'invalid length'); for (uint256 i = 0; i < proposalIds.length; i++) { kyberGovernance.submitVote(proposalIds[i], optionBitMasks[i]); } } /* * @notice Claim accumulated reward thus far * @notice Will apply admin fee to KNC token. * Admin fee for other tokens applied after liquidation to KNC * @dev Admin or operator calls with relevant params * @param cycle - sourced from Kyber API * @param index - sourced from Kyber API * @param tokens - ERC20 fee tokens * @param merkleProof - sourced from Kyber API */ function claimReward( uint256 cycle, uint256 index, IERC20Ext[] calldata tokens, uint256[] calldata cumulativeAmounts, bytes32[] calldata merkleProof ) external onlyOperator { rewardsDistributor.claim(cycle, index, address(this), tokens, cumulativeAmounts, merkleProof); uint256 availableKnc = _administerAdminFee(FeeTypes.CLAIM, getAvailableNewKncBalanceTwei()); _stake(availableKnc); } /* * @notice Will liquidate ETH or ERC20 tokens to KNC * @notice Will apply admin fee after liquidations * @notice Token allowance should have been given to proxy for liquidation * @dev Admin or operator calls with relevant params * @param tokens - ETH / ERC20 tokens to be liquidated to KNC * @param minRates - kyberProxy.getExpectedRate(eth/token => knc) */ function liquidateTokensToKnc(IERC20Ext[] calldata tokens, uint256[] calldata minRates) external onlyOperator { require(tokens.length == minRates.length, 'unequal lengths'); for (uint256 i = 0; i < tokens.length; i++) { if (tokens[i] == ETH_ADDRESS) { // leave 1 wei for gas optimizations kyberProxy.swapEtherToToken{value: address(this).balance.sub(1)}(newKnc, minRates[i]); } else if (tokens[i] != newKnc) { // token allowance should have been given // leave 1 twei for gas optimizations kyberProxy.swapTokenToToken( tokens[i], tokens[i].balanceOf(address(this)).sub(1), newKnc, minRates[i] ); } } uint256 availableKnc = _administerAdminFee(FeeTypes.CLAIM, getAvailableNewKncBalanceTwei()); _stake(availableKnc); } /* * @notice Called by admin on deployment for KNC * @dev Approves Kyber Proxy contract to trade KNC * @param Token to approve on proxy contract * @param Pass _giveAllowance as true to give max allowance, otherwise resets to zero */ function approveKyberProxyContract(IERC20Ext token, bool giveAllowance) external onlyOperator { require(token != newKnc, 'knc not allowed'); uint256 amount = giveAllowance ? type(uint256).max : 0; token.safeApprove(address(kyberProxy), amount); } function withdrawAdminFee() external onlyOperator { uint256 fee = withdrawableAdminFees.sub(1); withdrawableAdminFees = 1; newKnc.safeTransfer(admin, fee); } function stakeAdminFee() external onlyOperator { uint256 fee = withdrawableAdminFees.sub(1); withdrawableAdminFees = 1; _deposit(fee, admin); } /* * @notice Returns KNC balance staked to the DAO */ function getLatestStake() public view returns (uint256 latestStake) { (latestStake, , ) = kyberStaking.getLatestStakerData(address(this)); } /* * @notice Returns KNC balance available to stake */ function getAvailableNewKncBalanceTwei() public view returns (uint256) { return newKnc.balanceOf(address(this)).sub(withdrawableAdminFees); } /* * @notice Returns fee (in basis points) depending on fee type */ function getFeeRate(FeeTypes _type) public view returns (uint256) { if (_type == FeeTypes.MINT) return adminFees.mintFeeBps; else if (_type == FeeTypes.CLAIM) return adminFees.claimFeeBps; return adminFees.burnFeeBps; } /* * @notice For APY calculation, returns rate of 1 pool master token to KNC */ function getProRataKnc() public view returns (uint256) { if (totalSupply() == 0) return 0; return getLatestStake().mul(PRECISION).div(totalSupply()); } function _changeFees( uint256 _mintFeeBps, uint256 _claimFeeBps, uint256 _burnFeeBps ) internal { require(_mintFeeBps <= MAX_FEE_BPS, 'bad mint bps'); require(_claimFeeBps <= MAX_FEE_BPS, 'bad claim bps'); require(_burnFeeBps >= 10 && _burnFeeBps <= MAX_FEE_BPS, 'bad burn bps'); adminFees = Fees({ mintFeeBps: _mintFeeBps, claimFeeBps: _claimFeeBps, burnFeeBps: _burnFeeBps }); emit FeesSet(_mintFeeBps, _claimFeeBps, _burnFeeBps); } /* * @notice returns the amount after fee deduction */ function _administerAdminFee(FeeTypes _feeType, uint256 rewardAmount) internal returns (uint256) { uint256 adminFeeToDeduct = rewardAmount.mul(getFeeRate(_feeType)).div(BPS); withdrawableAdminFees = withdrawableAdminFees.add(adminFeeToDeduct); return rewardAmount.sub(adminFeeToDeduct); } /* * @notice Calculate and stake new KNC to staking contract * then mints appropriate amount to user */ function _deposit(uint256 tokenWei, address user) internal { uint256 balanceBefore = getLatestStake(); if (user != admin) _administerAdminFee(FeeTypes.MINT, tokenWei); uint256 depositAmount = getAvailableNewKncBalanceTwei(); _stake(depositAmount); uint256 mintAmount = _calculateMintAmount(balanceBefore, depositAmount); return super._mint(user, mintAmount); } /* * @notice KyberDAO deposit */ function _stake(uint256 amount) private { if (amount > 0) kyberStaking.deposit(amount); } /* * @notice KyberDAO withdraw */ function _unstake(uint256 amount) private { kyberStaking.withdraw(amount); } /* * @notice Calculates proportional issuance according to KNC contribution * @notice Fund starts at ratio of INITIAL_SUPPLY_MULTIPLIER/1 == token supply/ KNC balance * and approaches 1/1 as rewards accrue in KNC * @param kncBalanceBefore used to determine ratio of incremental to current KNC */ function _calculateMintAmount(uint256 kncBalanceBefore, uint256 depositAmount) private view returns (uint256 mintAmount) { uint256 totalSupply = totalSupply(); if (totalSupply == 0) return (kncBalanceBefore.add(depositAmount)).mul(INITIAL_SUPPLY_MULTIPLIER); mintAmount = depositAmount.mul(totalSupply).div(kncBalanceBefore); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.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, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { 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) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { 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, reverting 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) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * 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); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /** * @dev Interface extending ERC20 standard to include decimals() as * it is optional in the OpenZeppelin IERC20 interface. */ interface IERC20Ext is IERC20 { /** * @dev This function is required as Kyber requires to interact * with token.decimals() with many of its operations. */ function decimals() external view returns (uint8 digits); }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "../../utils/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.7.0; import "./IERC20.sol"; import "../../math/SafeMath.sol"; import "../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor () { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; import "./PermissionAdmin.sol"; abstract contract PermissionOperators is PermissionAdmin { uint256 private constant MAX_GROUP_SIZE = 50; mapping(address => bool) internal operators; address[] internal operatorsGroup; event OperatorAdded(address newOperator, bool isAdd); modifier onlyOperator() { require(operators[msg.sender], "only operator"); _; } function getOperators() external view returns (address[] memory) { return operatorsGroup; } function addOperator(address newOperator) public onlyAdmin { require(!operators[newOperator], "operator exists"); // prevent duplicates. require(operatorsGroup.length < MAX_GROUP_SIZE, "max operators"); emit OperatorAdded(newOperator, true); operators[newOperator] = true; operatorsGroup.push(newOperator); } function removeOperator(address operator) public onlyAdmin { require(operators[operator], "not operator"); operators[operator] = false; for (uint256 i = 0; i < operatorsGroup.length; ++i) { if (operatorsGroup[i] == operator) { operatorsGroup[i] = operatorsGroup[operatorsGroup.length - 1]; operatorsGroup.pop(); emit OperatorAdded(operator, false); break; } } } }
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.7.6; pragma abicoder v2; import {IERC20} from '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import {IEpochUtils} from './IEpochUtils.sol'; interface IKyberStaking is IEpochUtils { event Delegated( address indexed staker, address indexed representative, uint256 indexed epoch, bool isDelegated ); event Deposited(uint256 curEpoch, address indexed staker, uint256 amount); event Withdraw(uint256 indexed curEpoch, address indexed staker, uint256 amount); function initAndReturnStakerDataForCurrentEpoch(address staker) external returns ( uint256 stake, uint256 delegatedStake, address representative ); function deposit(uint256 amount) external; function delegate(address dAddr) external; function withdraw(uint256 amount) external; /** * @notice return combine data (stake, delegatedStake, representative) of a staker * @dev allow to get staker data up to current epoch + 1 */ function getStakerData(address staker, uint256 epoch) external view returns ( uint256 stake, uint256 delegatedStake, address representative ); function getLatestStakerData(address staker) external view returns ( uint256 stake, uint256 delegatedStake, address representative ); /** * @notice return raw data of a staker for an epoch * WARN: should be used only for initialized data * if data has not been initialized, it will return all 0 * pool master shouldn't use this function to compute/distribute rewards of pool members */ function getStakerRawData(address staker, uint256 epoch) external view returns ( uint256 stake, uint256 delegatedStake, address representative ); function kncToken() external view returns (IERC20); }
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; import {IERC20Ext} from '@kyber.network/utils-sc/contracts/IERC20Ext.sol'; interface IRewardsDistributor { event Claimed( uint256 indexed cycle, address indexed user, IERC20Ext[] tokens, uint256[] claimAmounts ); /** * @dev Claim accumulated rewards for a set of tokens at a given cycle number * @param cycle cycle number * @param index user reward info index in the array of reward info * during merkle tree generation * @param user wallet address of reward beneficiary * @param tokens array of tokens claimable by reward beneficiary * @param cumulativeAmounts cumulative token amounts claimable by reward beneficiary * @param merkleProof merkle proof of claim * @return claimAmounts actual claimed token amounts sent to the reward beneficiary **/ function claim( uint256 cycle, uint256 index, address user, IERC20Ext[] calldata tokens, uint256[] calldata cumulativeAmounts, bytes32[] calldata merkleProof ) external returns (uint256[] memory claimAmounts); /** * @dev Checks whether a claim is valid or not * @param cycle cycle number * @param index user reward info index in the array of reward info * during merkle tree generation * @param user wallet address of reward beneficiary * @param tokens array of tokens claimable by reward beneficiary * @param cumulativeAmounts cumulative token amounts claimable by reward beneficiary * @param merkleProof merkle proof of claim * @return true if valid claim, false otherwise **/ function isValidClaim( uint256 cycle, uint256 index, address user, IERC20Ext[] calldata tokens, uint256[] calldata cumulativeAmounts, bytes32[] calldata merkleProof ) external view returns (bool); /** * @dev Fetch accumulated claimed rewards for a set of tokens since the first cycle * @param user wallet address of reward beneficiary * @param tokens array of tokens claimed by reward beneficiary * @return userClaimedAmounts claimed token amounts by reward beneficiary since the first cycle **/ function getClaimedAmounts(address user, IERC20Ext[] calldata tokens) external view returns (uint256[] memory userClaimedAmounts); }
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.7.6; pragma abicoder v2; import {IExecutorWithTimelock} from './IExecutorWithTimelock.sol'; import {IVotingPowerStrategy} from './IVotingPowerStrategy.sol'; interface IKyberGovernance { enum ProposalState { Pending, Canceled, Active, Failed, Succeeded, Queued, Expired, Executed, Finalized } enum ProposalType {Generic, Binary} /// For Binary proposal, optionBitMask is 0/1/2 /// For Generic proposal, optionBitMask is bitmask of voted options struct Vote { uint32 optionBitMask; uint224 votingPower; } struct ProposalWithoutVote { uint256 id; ProposalType proposalType; address creator; IExecutorWithTimelock executor; IVotingPowerStrategy strategy; address[] targets; uint256[] weiValues; string[] signatures; bytes[] calldatas; bool[] withDelegatecalls; string[] options; uint256[] voteCounts; uint256 totalVotes; uint256 maxVotingPower; uint256 startTime; uint256 endTime; uint256 executionTime; string link; bool executed; bool canceled; } struct Proposal { ProposalWithoutVote proposalData; mapping(address => Vote) votes; } struct BinaryProposalParams { address[] targets; uint256[] weiValues; string[] signatures; bytes[] calldatas; bool[] withDelegatecalls; } /** * @dev emitted when a new binary proposal is created * @param proposalId id of the binary proposal * @param creator address of the creator * @param executor ExecutorWithTimelock contract that will execute the proposal * @param strategy votingPowerStrategy contract to calculate voting power * @param targets list of contracts called by proposal's associated transactions * @param weiValues list of value in wei for each propoposal's associated transaction * @param signatures list of function signatures (can be empty) to be used * when created the callData * @param calldatas list of calldatas: if associated signature empty, * calldata ready, else calldata is arguments * @param withDelegatecalls boolean, true = transaction delegatecalls the taget, * else calls the target * @param startTime timestamp when vote starts * @param endTime timestamp when vote ends * @param link URL link of the proposal * @param maxVotingPower max voting power for this proposal **/ event BinaryProposalCreated( uint256 proposalId, address indexed creator, IExecutorWithTimelock indexed executor, IVotingPowerStrategy indexed strategy, address[] targets, uint256[] weiValues, string[] signatures, bytes[] calldatas, bool[] withDelegatecalls, uint256 startTime, uint256 endTime, string link, uint256 maxVotingPower ); /** * @dev emitted when a new generic proposal is created * @param proposalId id of the generic proposal * @param creator address of the creator * @param executor ExecutorWithTimelock contract that will execute the proposal * @param strategy votingPowerStrategy contract to calculate voting power * @param options list of proposal vote options * @param startTime timestamp when vote starts * @param endTime timestamp when vote ends * @param link URL link of the proposal * @param maxVotingPower max voting power for this proposal **/ event GenericProposalCreated( uint256 proposalId, address indexed creator, IExecutorWithTimelock indexed executor, IVotingPowerStrategy indexed strategy, string[] options, uint256 startTime, uint256 endTime, string link, uint256 maxVotingPower ); /** * @dev emitted when a proposal is canceled * @param proposalId id of the proposal **/ event ProposalCanceled(uint256 proposalId); /** * @dev emitted when a proposal is queued * @param proposalId id of the proposal * @param executionTime time when proposal underlying transactions can be executed * @param initiatorQueueing address of the initiator of the queuing transaction **/ event ProposalQueued( uint256 indexed proposalId, uint256 executionTime, address indexed initiatorQueueing ); /** * @dev emitted when a proposal is executed * @param proposalId id of the proposal * @param initiatorExecution address of the initiator of the execution transaction **/ event ProposalExecuted(uint256 proposalId, address indexed initiatorExecution); /** * @dev emitted when a vote is registered * @param proposalId id of the proposal * @param voter address of the voter * @param voteOptions vote options selected by voter * @param votingPower Power of the voter/vote **/ event VoteEmitted( uint256 indexed proposalId, address indexed voter, uint32 indexed voteOptions, uint224 votingPower ); /** * @dev emitted when a vote is registered * @param proposalId id of the proposal * @param voter address of the voter * @param voteOptions vote options selected by voter * @param oldVotingPower Old power of the voter/vote * @param newVotingPower New power of the voter/vote **/ event VotingPowerChanged( uint256 indexed proposalId, address indexed voter, uint32 indexed voteOptions, uint224 oldVotingPower, uint224 newVotingPower ); event DaoOperatorTransferred(address indexed newDaoOperator); event ExecutorAuthorized(address indexed executor); event ExecutorUnauthorized(address indexed executor); event VotingPowerStrategyAuthorized(address indexed strategy); event VotingPowerStrategyUnauthorized(address indexed strategy); /** * @dev Function is triggered when users withdraw from staking and change voting power */ function handleVotingPowerChanged( address staker, uint256 newVotingPower, uint256[] calldata proposalIds ) external; /** * @dev Creates a Binary Proposal (needs to be validated by the Proposal Validator) * @param executor The ExecutorWithTimelock contract that will execute the proposal * @param strategy voting power strategy of the proposal * @param executionParams data for execution, includes * targets list of contracts called by proposal's associated transactions * weiValues list of value in wei for each proposal's associated transaction * signatures list of function signatures (can be empty) * to be used when created the callData * calldatas list of calldatas: if associated signature empty, * calldata ready, else calldata is arguments * withDelegatecalls boolean, true = transaction delegatecalls the taget, * else calls the target * @param startTime start timestamp to allow vote * @param endTime end timestamp of the proposal * @param link link to the proposal description **/ function createBinaryProposal( IExecutorWithTimelock executor, IVotingPowerStrategy strategy, BinaryProposalParams memory executionParams, uint256 startTime, uint256 endTime, string memory link ) external returns (uint256 proposalId); /** * @dev Creates a Generic Proposal * @param executor ExecutorWithTimelock contract that will execute the proposal * @param strategy votingPowerStrategy contract to calculate voting power * @param options list of proposal vote options * @param startTime timestamp when vote starts * @param endTime timestamp when vote ends * @param link URL link of the proposal **/ function createGenericProposal( IExecutorWithTimelock executor, IVotingPowerStrategy strategy, string[] memory options, uint256 startTime, uint256 endTime, string memory link ) external returns (uint256 proposalId); /** * @dev Cancels a Proposal, * either at anytime by guardian * or when proposal is Pending/Active and threshold no longer reached * @param proposalId id of the proposal **/ function cancel(uint256 proposalId) external; /** * @dev Queue the proposal (If Proposal Succeeded) * @param proposalId id of the proposal to queue **/ function queue(uint256 proposalId) external; /** * @dev Execute the proposal (If Proposal Queued) * @param proposalId id of the proposal to execute **/ function execute(uint256 proposalId) external payable; /** * @dev Function allowing msg.sender to vote for/against a proposal * @param proposalId id of the proposal * @param optionBitMask vote option(s) selected **/ function submitVote(uint256 proposalId, uint256 optionBitMask) external; /** * @dev Function to register the vote of user that has voted offchain via signature * @param proposalId id of the proposal * @param choice the bit mask of voted options * @param v v part of the voter signature * @param r r part of the voter signature * @param s s part of the voter signature **/ function submitVoteBySignature( uint256 proposalId, uint256 choice, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Add new addresses to the list of authorized executors * @param executors list of new addresses to be authorized executors **/ function authorizeExecutors(address[] calldata executors) external; /** * @dev Remove addresses to the list of authorized executors * @param executors list of addresses to be removed as authorized executors **/ function unauthorizeExecutors(address[] calldata executors) external; /** * @dev Add new addresses to the list of authorized strategies * @param strategies list of new addresses to be authorized strategies **/ function authorizeVotingPowerStrategies(address[] calldata strategies) external; /** * @dev Remove addresses to the list of authorized strategies * @param strategies list of addresses to be removed as authorized strategies **/ function unauthorizeVotingPowerStrategies(address[] calldata strategies) external; /** * @dev Returns whether an address is an authorized executor * @param executor address to evaluate as authorized executor * @return true if authorized **/ function isExecutorAuthorized(address executor) external view returns (bool); /** * @dev Returns whether an address is an authorized strategy * @param strategy address to evaluate as authorized strategy * @return true if authorized **/ function isVotingPowerStrategyAuthorized(address strategy) external view returns (bool); /** * @dev Getter the address of the guardian, that can mainly cancel proposals * @return The address of the guardian **/ function getDaoOperator() external view returns (address); /** * @dev Getter of the proposal count (the current number of proposals ever created) * @return the proposal count **/ function getProposalsCount() external view returns (uint256); /** * @dev Getter of a proposal by id * @param proposalId id of the proposal to get * @return the proposal as ProposalWithoutVote memory object **/ function getProposalById(uint256 proposalId) external view returns (ProposalWithoutVote memory); /** * @dev Getter of the vote data of a proposal by id * including totalVotes, voteCounts and options * @param proposalId id of the proposal * @return (totalVotes, voteCounts, options) **/ function getProposalVoteDataById(uint256 proposalId) external view returns ( uint256, uint256[] memory, string[] memory ); /** * @dev Getter of the Vote of a voter about a proposal * Note: Vote is a struct: ({uint32 bitOptionMask, uint224 votingPower}) * @param proposalId id of the proposal * @param voter address of the voter * @return The associated Vote memory object **/ function getVoteOnProposal(uint256 proposalId, address voter) external view returns (Vote memory); /** * @dev Get the current state of a proposal * @param proposalId id of the proposal * @return The current state if the proposal **/ function getProposalState(uint256 proposalId) external view returns (ProposalState); }
// SPDX-License-Identifier: MIT pragma solidity ^0.7.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.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.7.0; import "../../utils/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_) { _name = name_; _symbol = symbol_; _decimals = 18; } /** * @dev Returns the name of the token. */ function name() public view virtual returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual 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 virtual returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual 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 virtual { _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.7.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; abstract contract PermissionAdmin { address public admin; address public pendingAdmin; event AdminClaimed(address newAdmin, address previousAdmin); event TransferAdminPending(address pendingAdmin); constructor(address _admin) { require(_admin != address(0), "admin 0"); admin = _admin; } modifier onlyAdmin() { require(msg.sender == admin, "only admin"); _; } /** * @dev Allows the current admin to set the pendingAdmin address. * @param newAdmin The address to transfer ownership to. */ function transferAdmin(address newAdmin) public onlyAdmin { require(newAdmin != address(0), "new admin 0"); emit TransferAdminPending(newAdmin); pendingAdmin = newAdmin; } /** * @dev Allows the current admin to set the admin in one tx. Useful initial deployment. * @param newAdmin The address to transfer ownership to. */ function transferAdminQuickly(address newAdmin) public onlyAdmin { require(newAdmin != address(0), "admin 0"); emit TransferAdminPending(newAdmin); emit AdminClaimed(newAdmin, admin); admin = newAdmin; } /** * @dev Allows the pendingAdmin address to finalize the change admin process. */ function claimAdmin() public { require(pendingAdmin == msg.sender, "not pending"); emit AdminClaimed(pendingAdmin, admin); admin = pendingAdmin; pendingAdmin = address(0); } }
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; interface IEpochUtils { function epochPeriodInSeconds() external view returns (uint256); function firstEpochStartTime() external view returns (uint256); function getCurrentEpochNumber() external view returns (uint256); function getEpochNumber(uint256 timestamp) external view returns (uint256); }
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.7.6; pragma abicoder v2; import {IKyberGovernance} from './IKyberGovernance.sol'; interface IExecutorWithTimelock { /** * @dev emitted when a new pending admin is set * @param newPendingAdmin address of the new pending admin **/ event NewPendingAdmin(address newPendingAdmin); /** * @dev emitted when a new admin is set * @param newAdmin address of the new admin **/ event NewAdmin(address newAdmin); /** * @dev emitted when a new delay (between queueing and execution) is set * @param delay new delay **/ event NewDelay(uint256 delay); /** * @dev emitted when a new (trans)action is Queued. * @param actionHash hash of the action * @param target address of the targeted contract * @param value wei value of the transaction * @param signature function signature of the transaction * @param data function arguments of the transaction or callData if signature empty * @param executionTime time at which to execute the transaction * @param withDelegatecall boolean, true = transaction delegatecalls the target, else calls the target **/ event QueuedAction( bytes32 actionHash, address indexed target, uint256 value, string signature, bytes data, uint256 executionTime, bool withDelegatecall ); /** * @dev emitted when an action is Cancelled * @param actionHash hash of the action * @param target address of the targeted contract * @param value wei value of the transaction * @param signature function signature of the transaction * @param data function arguments of the transaction or callData if signature empty * @param executionTime time at which to execute the transaction * @param withDelegatecall boolean, true = transaction delegatecalls the target, else calls the target **/ event CancelledAction( bytes32 actionHash, address indexed target, uint256 value, string signature, bytes data, uint256 executionTime, bool withDelegatecall ); /** * @dev emitted when an action is Cancelled * @param actionHash hash of the action * @param target address of the targeted contract * @param value wei value of the transaction * @param signature function signature of the transaction * @param data function arguments of the transaction or callData if signature empty * @param executionTime time at which to execute the transaction * @param withDelegatecall boolean, true = transaction delegatecalls the target, else calls the target * @param resultData the actual callData used on the target **/ event ExecutedAction( bytes32 actionHash, address indexed target, uint256 value, string signature, bytes data, uint256 executionTime, bool withDelegatecall, bytes resultData ); /** * @dev Function, called by Governance, that queue a transaction, returns action hash * @param target smart contract target * @param value wei value of the transaction * @param signature function signature of the transaction * @param data function arguments of the transaction or callData if signature empty * @param executionTime time at which to execute the transaction * @param withDelegatecall boolean, true = transaction delegatecalls the target, else calls the target **/ function queueTransaction( address target, uint256 value, string memory signature, bytes memory data, uint256 executionTime, bool withDelegatecall ) external returns (bytes32); /** * @dev Function, called by Governance, that cancels a transaction, returns the callData executed * @param target smart contract target * @param value wei value of the transaction * @param signature function signature of the transaction * @param data function arguments of the transaction or callData if signature empty * @param executionTime time at which to execute the transaction * @param withDelegatecall boolean, true = transaction delegatecalls the target, else calls the target **/ function executeTransaction( address target, uint256 value, string memory signature, bytes memory data, uint256 executionTime, bool withDelegatecall ) external payable returns (bytes memory); /** * @dev Function, called by Governance, that cancels a transaction, returns action hash * @param target smart contract target * @param value wei value of the transaction * @param signature function signature of the transaction * @param data function arguments of the transaction or callData if signature empty * @param executionTime time at which to execute the transaction * @param withDelegatecall boolean, true = transaction delegatecalls the target, else calls the target **/ function cancelTransaction( address target, uint256 value, string memory signature, bytes memory data, uint256 executionTime, bool withDelegatecall ) external returns (bytes32); /** * @dev Getter of the current admin address (should be governance) * @return The address of the current admin **/ function getAdmin() external view returns (address); /** * @dev Getter of the current pending admin address * @return The address of the pending admin **/ function getPendingAdmin() external view returns (address); /** * @dev Getter of the delay between queuing and execution * @return The delay in seconds **/ function getDelay() external view returns (uint256); /** * @dev Returns whether an action (via actionHash) is queued * @param actionHash hash of the action to be checked * keccak256(abi.encode(target, value, signature, data, executionTime, withDelegatecall)) * @return true if underlying action of actionHash is queued **/ function isActionQueued(bytes32 actionHash) external view returns (bool); /** * @dev Checks whether a proposal is over its grace period * @param governance Governance contract * @param proposalId Id of the proposal against which to test * @return true of proposal is over grace period **/ function isProposalOverGracePeriod(IKyberGovernance governance, uint256 proposalId) external view returns (bool); /** * @dev Getter of grace period constant * @return grace period in seconds **/ function GRACE_PERIOD() external view returns (uint256); /** * @dev Getter of minimum delay constant * @return minimum delay in seconds **/ function MINIMUM_DELAY() external view returns (uint256); /** * @dev Getter of maximum delay constant * @return maximum delay in seconds **/ function MAXIMUM_DELAY() external view returns (uint256); }
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.7.6; pragma abicoder v2; import {IWithdrawHandler} from '../staking/IWithdrawHandler.sol'; interface IVotingPowerStrategy is IWithdrawHandler { /** * @dev call by governance when create a proposal */ function handleProposalCreation( uint256 proposalId, uint256 startTime, uint256 endTime ) external; /** * @dev call by governance when cancel a proposal */ function handleProposalCancellation(uint256 proposalId) external; /** * @dev call by governance when submitting a vote * @param choice: unused param for future usage * @return votingPower of voter */ function handleVote( address voter, uint256 proposalId, uint256 choice ) external returns (uint256 votingPower); /** * @dev get voter's voting power given timestamp * @dev for reading purposes and validating voting power for creating/canceling proposal in the furture * @dev when submitVote, should call 'handleVote' instead */ function getVotingPower(address voter, uint256 timestamp) external view returns (uint256 votingPower); /** * @dev validate that startTime and endTime are suitable for calculating voting power * @dev with current version, startTime and endTime must be in the sameEpcoh */ function validateProposalCreation(uint256 startTime, uint256 endTime) external view returns (bool); /** * @dev getMaxVotingPower at current time * @dev call by governance when creating a proposal */ function getMaxVotingPower() external view returns (uint256); }
// SPDX-License-Identifier: agpl-3.0 pragma solidity 0.7.6; pragma abicoder v2; /** * @title Interface for callbacks hooks when user withdraws from staking contract */ interface IWithdrawHandler { function handleWithdrawal(address staker, uint256 reduceAmount) external; }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"contract IKyberNetworkProxy","name":"_kyberProxy","type":"address"},{"internalType":"contract IKyberStaking","name":"_kyberStaking","type":"address"},{"internalType":"contract IKyberGovernance","name":"_kyberGovernance","type":"address"},{"internalType":"contract IRewardsDistributor","name":"_rewardsDistributor","type":"address"},{"internalType":"uint256","name":"_mintFeeBps","type":"uint256"},{"internalType":"uint256","name":"_claimFeeBps","type":"uint256"},{"internalType":"uint256","name":"_burnFeeBps","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"}],"name":"AdminClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"mintFeeBps","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"burnFeeBps","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"claimFeeBps","type":"uint256"}],"name":"FeesSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOperator","type":"address"},{"indexed":false,"internalType":"bool","name":"isAdd","type":"bool"}],"name":"OperatorAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"pendingAdmin","type":"address"}],"name":"TransferAdminPending","type":"event"},{"inputs":[{"internalType":"address","name":"newOperator","type":"address"}],"name":"addOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adminFees","outputs":[{"internalType":"uint256","name":"mintFeeBps","type":"uint256"},{"internalType":"uint256","name":"claimFeeBps","type":"uint256"},{"internalType":"uint256","name":"burnFeeBps","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20Ext","name":"token","type":"address"},{"internalType":"bool","name":"giveAllowance","type":"bool"}],"name":"approveKyberProxyContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_mintFeeBps","type":"uint256"},{"internalType":"uint256","name":"_claimFeeBps","type":"uint256"},{"internalType":"uint256","name":"_burnFeeBps","type":"uint256"}],"name":"changeFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IKyberGovernance","name":"_kyberGovernance","type":"address"}],"name":"changeGovernance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IKyberNetworkProxy","name":"_kyberProxy","type":"address"}],"name":"changeKyberProxy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IRewardsDistributor","name":"_rewardsDistributor","type":"address"}],"name":"changeRewardsDistributor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"cycle","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"contract IERC20Ext[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"cumulativeAmounts","type":"uint256[]"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"claimReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenWei","type":"uint256"}],"name":"depositWithNewKnc","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenWei","type":"uint256"}],"name":"depositWithOldKnc","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAvailableNewKncBalanceTwei","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum PoolMaster.FeeTypes","name":"_type","type":"uint8"}],"name":"getFeeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLatestStake","outputs":[{"internalType":"uint256","name":"latestStake","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOperators","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getProRataKnc","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"kyberGovernance","outputs":[{"internalType":"contract IKyberGovernance","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kyberProxy","outputs":[{"internalType":"contract IKyberNetworkProxy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kyberStaking","outputs":[{"internalType":"contract IKyberStaking","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20Ext[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"minRates","type":"uint256[]"}],"name":"liquidateTokensToKnc","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"newKnc","outputs":[{"internalType":"contract IERC20Ext","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"removeOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardsDistributor","outputs":[{"internalType":"contract IRewardsDistributor","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakeAdminFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"transferAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"transferAdminQuickly","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"proposalIds","type":"uint256[]"},{"internalType":"uint256[]","name":"optionBitMasks","type":"uint256[]"}],"name":"vote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokensToRedeemTwei","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawAdminFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawableAdminFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60e06040523480156200001157600080fd5b50604051620042e7380380620042e783398181016040526101208110156200003857600080fd5b81019080805160405193929190846401000000008211156200005957600080fd5b9083019060208201858111156200006f57600080fd5b82516401000000008111828201881017156200008a57600080fd5b82525081516020918201929091019080838360005b83811015620000b95781810151838201526020016200009f565b50505050905090810190601f168015620000e75780820380516001836020036101000a031916815260200191505b50604052602001805160405193929190846401000000008211156200010b57600080fd5b9083019060208201858111156200012157600080fd5b82516401000000008111828201881017156200013c57600080fd5b82525081516020918201929091019080838360005b838110156200016b57818101518382015260200162000151565b50505050905090810190601f168015620001995780820380516001836020036101000a031916815260200191505b5060409081526020820151908201516060830151608084015160a085015160c086015160e09096015194975092955090939092888833806200020c576040805162461bcd60e51b8152602060048201526007602482015266061646d696e20360cc1b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b039290921691909117905560016004558151620002469060089060208501906200098b565b5080516200025c9060099060208401906200098b565b5050600a805460ff1916601217905550600f80546001600160a01b03808a166001600160a01b0319928316179092556001600160601b0319606089901b16608052601180548884169083161790556010805487841692169190911790556040805163408e3ff160e11b8152905160009289169163811c7fe2916004808301926020929190829003018186803b158015620002f557600080fd5b505afa1580156200030a573d6000803e3d6000fd5b505050506040513d60208110156200032157600080fd5b50516001600160601b0319606082901b1660a0526040805163b434616960e01b815290519192506000916001600160a01b0384169163b4346169916004808301926020929190829003018186803b1580156200037c57600080fd5b505afa15801562000391573d6000803e3d6000fd5b505050506040513d6020811015620003a857600080fd5b5051606081901b6001600160601b03191660c0529050620003e26001600160a01b0382168360001962000427602090811b6200274017901c565b6200040988600019846001600160a01b03166200042760201b62002740179092919060201c565b620004168585856200054b565b505050505050505050505062000a37565b801580620004b1575060408051636eb1769f60e11b81523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b1580156200048157600080fd5b505afa15801562000496573d6000803e3d6000fd5b505050506040513d6020811015620004ad57600080fd5b5051155b620004ee5760405162461bcd60e51b8152600401808060200182810382526036815260200180620042b16036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0390811663095ea7b360e01b17909152620005469185916200069d16565b505050565b6103e883111562000592576040805162461bcd60e51b815260206004820152600c60248201526b626164206d696e742062707360a01b604482015290519081900360640190fd5b6103e8821115620005da576040805162461bcd60e51b815260206004820152600d60248201526c62616420636c61696d2062707360981b604482015290519081900360640190fd5b600a8110158015620005ee57506103e88111155b6200062f576040805162461bcd60e51b815260206004820152600c60248201526b626164206275726e2062707360a01b604482015290519081900360640190fd5b60408051606080820183528582526020808301869052918301849052600b869055600c859055600d849055825186815291820185905281830184905291517f01bae858246c904512695a3f6d48ab88abb7a0192fdd7c53b043e60317795f45929181900390910190a1505050565b6000620006f9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166200075960201b62002885179092919060201c565b80519091501562000546578080602001905160208110156200071a57600080fd5b5051620005465760405162461bcd60e51b815260040180806020018281038252602a81526020018062004287602a913960400191505060405180910390fd5b60606200076a848460008562000774565b90505b9392505050565b606082471015620007b75760405162461bcd60e51b8152600401808060200182810382526026815260200180620042616026913960400191505060405180910390fd5b620007c285620008db565b62000814576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b60208310620008545780518252601f19909201916020918201910162000833565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114620008b8576040519150601f19603f3d011682016040523d82523d6000602084013e620008bd565b606091505b509092509050620008d0828286620008e1565b979650505050505050565b3b151590565b60608315620008f25750816200076d565b825115620009035782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156200094f57818101518382015260200162000935565b50505050905090810190601f1680156200097d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b828054600181600116156101000203166002900490600052602060002090601f016020900481019282620009c3576000855562000a0e565b82601f10620009de57805160ff191683800117855562000a0e565b8280016001018555821562000a0e579182015b8281111562000a0e578251825591602001919060010190620009f1565b5062000a1c92915062000a20565b5090565b5b8082111562000a1c576000815560010162000a21565b60805160601c60a05160601c60c05160601c6137b862000aa9600039806124d4525080610d3452806111815280611218528061158a5280611d465280611df25280611ee052806124fe52806126355280612717525080610fe352806126595280612d175280612fee52506137b86000f3fe6080604052600436106102f65760003560e01c806370a082311161018f57806399572d6f116100e1578063dd62ed3e1161008a578063f0eeed8111610064578063f0eeed8114610ce8578063f851a44014610cfd578063fe49abe314610d12576102fd565b8063dd62ed3e14610c83578063ed94444714610cbe578063f0359d1b14610cd3576102fd565b8063ac8a584a116100bb578063ac8a584a14610c11578063c243d1a014610c44578063d8f3dda914610c6e576102fd565b806399572d6f14610b6c578063a457c2d714610b9f578063a9059cbb14610bd8576102fd565b80637acc867811610143578063957b7eb31161011d578063957b7eb314610a5557806395d89b4114610b245780639870d7fe14610b39576102fd565b80637acc8678146109265780637c70fb57146109595780638733ece714610986576102fd565b806377f50f971161017457806377f50f97146108a257806379cc6790146108b75780637a319590146108f0576102fd565b806370a082311461083c57806375829def1461086f576102fd565b80632e1a7d4d116102485780633f2a5540116101fc5780634bc92d6c116101d65780634bc92d6c1461079b57806351be62fa146107ce578063677dedee14610809576102fd565b80633f2a55401461062f57806342966c68146106445780634881c7b11461066e576102fd565b806337fd63c71161022d57806337fd63c7146105cc57806339509351146105e15780633cce85ea1461061a576102fd565b80632e1a7d4d14610577578063313ce567146105a1576102fd565b80631adc5573116102aa578063267822471161028457806326782247146104e857806327a099d8146104fd5780632ded90eb14610562576102fd565b80631adc55731461045f578063229ad4771461049057806323b872dd146104a5576102fd565b8063095ea7b3116102db578063095ea7b3146103b85780630e8ee4a91461040557806318160ddd14610438576102fd565b8063045c6a911461030257806306fdde031461032e576102fd565b366102fd57005b600080fd5b34801561030e57600080fd5b5061032c6004803603602081101561032557600080fd5b5035610d27565b005b34801561033a57600080fd5b50610343610d69565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561037d578181015183820152602001610365565b50505050905090810190601f1680156103aa5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103c457600080fd5b506103f1600480360360408110156103db57600080fd5b506001600160a01b038135169060200135610e00565b604080519115158252519081900360200190f35b34801561041157600080fd5b5061032c6004803603602081101561042857600080fd5b50356001600160a01b0316610e1e565b34801561044457600080fd5b5061044d610e8c565b60408051918252519081900360200190f35b34801561046b57600080fd5b50610474610e92565b604080516001600160a01b039092168252519081900360200190f35b34801561049c57600080fd5b5061044d610ea1565b3480156104b157600080fd5b506103f1600480360360608110156104c857600080fd5b506001600160a01b03813581169160208101359091169060400135610ee7565b3480156104f457600080fd5b50610474610f6f565b34801561050957600080fd5b50610512610f7e565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561054e578181015183820152602001610536565b505050509050019250505060405180910390f35b34801561056e57600080fd5b5061044d610fdf565b34801561058357600080fd5b5061032c6004803603602081101561059a57600080fd5b503561107f565b3480156105ad57600080fd5b506105b66111b1565b6040805160ff9092168252519081900360200190f35b3480156105d857600080fd5b5061044d6111ba565b3480156105ed57600080fd5b506103f16004803603604081101561060457600080fd5b506001600160a01b0381351690602001356111c0565b34801561062657600080fd5b5061044d61120e565b34801561063b57600080fd5b506104746112b5565b34801561065057600080fd5b5061032c6004803603602081101561066757600080fd5b50356112c4565b34801561067a57600080fd5b5061032c600480360360a081101561069157600080fd5b8135916020810135918101906060810160408201356401000000008111156106b857600080fd5b8201836020820111156106ca57600080fd5b803590602001918460208302840111640100000000831117156106ec57600080fd5b91939092909160208101903564010000000081111561070a57600080fd5b82018360208201111561071c57600080fd5b8035906020019184602083028401116401000000008311171561073e57600080fd5b91939092909160208101903564010000000081111561075c57600080fd5b82018360208201111561076e57600080fd5b8035906020019184602083028401116401000000008311171561079057600080fd5b5090925090506112d5565b3480156107a757600080fd5b506107b0611528565b60408051938452602084019290925282820152519081900360600190f35b3480156107da57600080fd5b5061032c600480360360408110156107f157600080fd5b506001600160a01b0381351690602001351515611534565b34801561081557600080fd5b5061032c6004803603602081101561082c57600080fd5b50356001600160a01b0316611643565b34801561084857600080fd5b5061044d6004803603602081101561085f57600080fd5b50356001600160a01b03166116b1565b34801561087b57600080fd5b5061032c6004803603602081101561089257600080fd5b50356001600160a01b03166116d0565b3480156108ae57600080fd5b5061032c6117d5565b3480156108c357600080fd5b5061032c600480360360408110156108da57600080fd5b506001600160a01b0381351690602001356118a7565b3480156108fc57600080fd5b5061032c6004803603606081101561091357600080fd5b50803590602081013590604001356118fc565b34801561093257600080fd5b5061032c6004803603602081101561094957600080fd5b50356001600160a01b0316611953565b34801561096557600080fd5b5061044d6004803603602081101561097c57600080fd5b503560ff16611aa0565b34801561099257600080fd5b5061032c600480360360408110156109a957600080fd5b8101906020810181356401000000008111156109c457600080fd5b8201836020820111156109d657600080fd5b803590602001918460208302840111640100000000831117156109f857600080fd5b919390929091602081019035640100000000811115610a1657600080fd5b820183602082011115610a2857600080fd5b80359060200191846020830284011164010000000083111715610a4a57600080fd5b509092509050611ae3565b348015610a6157600080fd5b5061032c60048036036040811015610a7857600080fd5b810190602081018135640100000000811115610a9357600080fd5b820183602082011115610aa557600080fd5b80359060200191846020830284011164010000000083111715610ac757600080fd5b919390929091602081019035640100000000811115610ae557600080fd5b820183602082011115610af757600080fd5b80359060200191846020830284011164010000000083111715610b1957600080fd5b509092509050611c35565b348015610b3057600080fd5b50610343611fbf565b348015610b4557600080fd5b5061032c60048036036020811015610b5c57600080fd5b50356001600160a01b0316612020565b348015610b7857600080fd5b5061032c60048036036020811015610b8f57600080fd5b50356001600160a01b03166121db565b348015610bab57600080fd5b506103f160048036036040811015610bc257600080fd5b506001600160a01b038135169060200135612249565b348015610be457600080fd5b506103f160048036036040811015610bfb57600080fd5b506001600160a01b0381351690602001356122b1565b348015610c1d57600080fd5b5061032c60048036036020811015610c3457600080fd5b50356001600160a01b03166122c5565b348015610c5057600080fd5b5061032c60048036036020811015610c6757600080fd5b50356124c7565b348015610c7a57600080fd5b5061032c612584565b348015610c8f57600080fd5b5061044d60048036036040811015610ca657600080fd5b506001600160a01b0381358116916020013516612608565b348015610cca57600080fd5b50610474612633565b348015610cdf57600080fd5b50610474612657565b348015610cf457600080fd5b5061047461267b565b348015610d0957600080fd5b5061047461268a565b348015610d1e57600080fd5b5061032c612699565b610d5c6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633308461289c565b610d668133612915565b50565b60088054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610df55780601f10610dca57610100808354040283529160200191610df5565b820191906000526020600020905b815481529060010190602001808311610dd857829003601f168201915b505050505090505b90565b6000610e14610e0d612971565b8484612975565b5060015b92915050565b6000546001600160a01b03163314610e6a576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b601080546001600160a01b0319166001600160a01b0392909216919091179055565b60075490565b6011546001600160a01b031681565b6000610eab610e8c565b610eb757506000610dfd565b610ee2610ec2610e8c565b610edc670de0b6b3a7640000610ed6610fdf565b90612a61565b90612aba565b905090565b6000610ef4848484612b21565b610f6484610f00612971565b610f5f85604051806060016040528060288152602001613648602891396001600160a01b038a16600090815260066020526040812090610f3e612971565b6001600160a01b031681526020810191909152604001600020549190612c7e565b612975565b5060015b9392505050565b6001546001600160a01b031681565b60606003805480602002602001604051908101604052809291908181526020018280548015610df557602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610fb8575050505050905090565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166360e4f2e0306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060606040518083038186803b15801561104e57600080fd5b505afa158015611062573d6000803e3d6000fd5b505050506040513d606081101561107857600080fd5b5051919050565b600260045414156110d7576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600455806110e6336116b1565b1015611139576040805162461bcd60e51b815260206004820152601460248201527f696e73756666696369656e742062616c616e6365000000000000000000000000604482015290519081900360640190fd5b6000611152611146610e8c565b610edc84610ed6610fdf565b905061115d81612d15565b611168600282612d8f565b90506111743383612dc8565b6111a86001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163383612ec4565b50506001600455565b600a5460ff1690565b600e5481565b6000610e146111cd612971565b84610f5f85600660006111de612971565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490612f2f565b6000610ee2600e547f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561128357600080fd5b505afa158015611297573d6000803e3d6000fd5b505050506040513d60208110156112ad57600080fd5b505190612f89565b6010546001600160a01b031681565b610d666112cf612971565b82612dc8565b3360009081526002602052604090205460ff16611329576040805162461bcd60e51b815260206004820152600d60248201526c37b7363c9037b832b930ba37b960991b604482015290519081900360640190fd5b601060009054906101000a90046001600160a01b03166001600160a01b031663c390d3318989308a8a8a8a8a8a6040518a63ffffffff1660e01b8152600401808a8152602001898152602001886001600160a01b0316815260200180602001806020018060200184810384528a8a82818152602001925060200280828437600083820152601f01601f19169091018581038452888152602090810191508990890280828437600083820152601f01601f19169091018581038352868152602090810191508790870280828437600081840152601f19601f8201169050808301925050509c50505050505050505050505050600060405180830381600087803b15801561143457600080fd5b505af1158015611448573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561147157600080fd5b810190808051604051939291908464010000000082111561149157600080fd5b9083019060208201858111156114a657600080fd5b82518660208202830111640100000000821117156114c357600080fd5b82525081516020918201928201910280838360005b838110156114f05781810151838201526020016114d8565b50505050905001604052505050506000611512600161150d61120e565b612d8f565b905061151d81612fe6565b505050505050505050565b600b54600c54600d5483565b3360009081526002602052604090205460ff16611588576040805162461bcd60e51b815260206004820152600d60248201526c37b7363c9037b832b930ba37b960991b604482015290519081900360640190fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561160f576040805162461bcd60e51b815260206004820152600f60248201527f6b6e63206e6f7420616c6c6f7765640000000000000000000000000000000000604482015290519081900360640190fd5b60008161161d576000611621565b6000195b600f5490915061163e906001600160a01b03858116911683612740565b505050565b6000546001600160a01b0316331461168f576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0381166000908152600560205260409020545b919050565b6000546001600160a01b0316331461171c576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b038116611777576040805162461bcd60e51b815260206004820152600b60248201527f6e65772061646d696e2030000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b038316815290517f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc409181900360200190a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b03163314611834576040805162461bcd60e51b815260206004820152600b60248201527f6e6f742070656e64696e67000000000000000000000000000000000000000000604482015290519081900360640190fd5b600154600054604080516001600160a01b03938416815292909116602083015280517f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60006118de82604051806060016040528060248152602001613670602491396118d7866118d2612971565b612608565b9190612c7e565b90506118f2836118ec612971565b83612975565b61163e8383612dc8565b6000546001600160a01b03163314611948576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b61163e838383613052565b6000546001600160a01b0316331461199f576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b0381166119fa576040805162461bcd60e51b815260206004820152600760248201527f61646d696e203000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b038316815290517f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc409181900360200190a1600054604080516001600160a01b038085168252909216602083015280517f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed9281900390910190a1600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080826002811115611aaf57fe5b1415611abe5750600b546116cb565b6001826002811115611acc57fe5b1415611adb5750600c546116cb565b5050600d5490565b3360009081526002602052604090205460ff16611b37576040805162461bcd60e51b815260206004820152600d60248201526c37b7363c9037b832b930ba37b960991b604482015290519081900360640190fd5b828114611b8b576040805162461bcd60e51b815260206004820152600e60248201527f696e76616c6964206c656e677468000000000000000000000000000000000000604482015290519081900360640190fd5b60005b83811015611c2e576011546001600160a01b0316636f93bfb7868684818110611bb357fe5b90506020020135858585818110611bc657fe5b905060200201356040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b158015611c0a57600080fd5b505af1158015611c1e573d6000803e3d6000fd5b505060019092019150611b8e9050565b5050505050565b3360009081526002602052604090205460ff16611c89576040805162461bcd60e51b815260206004820152600d60248201526c37b7363c9037b832b930ba37b960991b604482015290519081900360640190fd5b828114611cdd576040805162461bcd60e51b815260206004820152600f60248201527f756e657175616c206c656e677468730000000000000000000000000000000000604482015290519081900360640190fd5b60005b83811015611fa45773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee858583818110611d0957fe5b905060200201356001600160a01b03166001600160a01b03161415611df057600f546001600160a01b0316637a2a0456611d44476001612f89565b7f0000000000000000000000000000000000000000000000000000000000000000868686818110611d7157fe5b905060200201356040518463ffffffff1660e01b815260040180836001600160a01b03168152602001828152602001925050506020604051808303818588803b158015611dbd57600080fd5b505af1158015611dd1573d6000803e3d6000fd5b50505050506040513d6020811015611de857600080fd5b50611f9c9050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316858583818110611e2657fe5b905060200201356001600160a01b03166001600160a01b031614611f9c57600f546001600160a01b0316637409e2eb868684818110611e6157fe5b905060200201356001600160a01b0316611ede6001898987818110611e8257fe5b905060200201356001600160a01b03166001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561128357600080fd5b7f0000000000000000000000000000000000000000000000000000000000000000878787818110611f0b57fe5b905060200201356040518563ffffffff1660e01b815260040180856001600160a01b03168152602001848152602001836001600160a01b03168152602001828152602001945050505050602060405180830381600087803b158015611f6f57600080fd5b505af1158015611f83573d6000803e3d6000fd5b505050506040513d6020811015611f9957600080fd5b50505b600101611ce0565b506000611fb4600161150d61120e565b9050611c2e81612fe6565b60098054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610df55780601f10610dca57610100808354040283529160200191610df5565b6000546001600160a01b0316331461206c576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff16156120da576040805162461bcd60e51b815260206004820152600f60248201527f6f70657261746f72206578697374730000000000000000000000000000000000604482015290519081900360640190fd5b600354603211612131576040805162461bcd60e51b815260206004820152600d60248201527f6d6178206f70657261746f727300000000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b03831681526001602082015281517f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b929181900390910190a16001600160a01b03166000818152600260205260408120805460ff191660019081179091556003805491820181559091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b0319169091179055565b6000546001600160a01b03163314612227576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b601180546001600160a01b0319166001600160a01b0392909216919091179055565b6000610e14612256612971565b84610f5f8560405180606001604052806025815260200161375e6025913960066000612280612971565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190612c7e565b6000610e146122be612971565b8484612b21565b6000546001600160a01b03163314612311576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff1661237e576040805162461bcd60e51b815260206004820152600c60248201527f6e6f74206f70657261746f720000000000000000000000000000000000000000604482015290519081900360640190fd5b6001600160a01b0381166000908152600260205260408120805460ff191690555b6003548110156124c357816001600160a01b0316600382815481106123c057fe5b6000918252602090912001546001600160a01b031614156124bb576003805460001981019081106123ed57fe5b600091825260209091200154600380546001600160a01b03909216918390811061241357fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600380548061244c57fe5b60008281526020808220830160001990810180546001600160a01b0319169055909201909255604080516001600160a01b03861681529182019290925281517f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b929181900390910190a16124c3565b60010161239f565b5050565b6124fc6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001633308461289c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663c49fc085826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561256257600080fd5b505af1158015612576573d6000803e3d6000fd5b50505050610d668133612915565b3360009081526002602052604090205460ff166125d8576040805162461bcd60e51b815260206004820152600d60248201526c37b7363c9037b832b930ba37b960991b604482015290519081900360640190fd5b600e546000906125e9906001612f89565b6001600e55600054909150610d669082906001600160a01b0316612915565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b600f546001600160a01b031681565b6000546001600160a01b031681565b3360009081526002602052604090205460ff166126ed576040805162461bcd60e51b815260206004820152600d60248201526c37b7363c9037b832b930ba37b960991b604482015290519081900360640190fd5b600e546000906126fe906001612f89565b6001600e55600054909150610d66906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116911683612ec4565b8015806127df5750604080517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b1580156127b157600080fd5b505afa1580156127c5573d6000803e3d6000fd5b505050506040513d60208110156127db57600080fd5b5051155b61281a5760405162461bcd60e51b81526004018080602001828103825260368152602001806137286036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b03167f095ea7b30000000000000000000000000000000000000000000000000000000017905261163e9084906131d2565b60606128948484600085613283565b949350505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03167f23b872dd0000000000000000000000000000000000000000000000000000000017905261290f9085906131d2565b50505050565b600061291f610fdf565b6000549091506001600160a01b0383811691161461294457612942600084612d8f565b505b600061294e61120e565b905061295981612fe6565b600061296583836133de565b9050611c2e8482613415565b3390565b6001600160a01b0383166129ba5760405162461bcd60e51b81526004018080602001828103825260248152602001806136da6024913960400191505060405180910390fd5b6001600160a01b0382166129ff5760405162461bcd60e51b81526004018080602001828103825260228152602001806135b96022913960400191505060405180910390fd5b6001600160a01b03808416600081815260066020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600082612a7057506000610e18565b82820282848281612a7d57fe5b0414610f685760405162461bcd60e51b81526004018080602001828103825260218152602001806136276021913960400191505060405180910390fd5b6000808211612b10576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381612b1957fe5b049392505050565b6001600160a01b038316612b665760405162461bcd60e51b81526004018080602001828103825260258152602001806136b56025913960400191505060405180910390fd5b6001600160a01b038216612bab5760405162461bcd60e51b81526004018080602001828103825260238152602001806135746023913960400191505060405180910390fd5b612bb683838361163e565b612bf3816040518060600160405280602681526020016135db602691396001600160a01b0386166000908152600560205260409020549190612c7e565b6001600160a01b038085166000908152600560205260408082209390935590841681522054612c229082612f2f565b6001600160a01b0380841660008181526005602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115612d0d5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612cd2578181015183820152602001612cba565b50505050905090810190601f168015612cff5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632e1a7d4d826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015612d7b57600080fd5b505af1158015611c2e573d6000803e3d6000fd5b600080612dab612710610edc612da487611aa0565b8690612a61565b600e54909150612dbb9082612f2f565b600e556128948382612f89565b6001600160a01b038216612e0d5760405162461bcd60e51b81526004018080602001828103825260218152602001806136946021913960400191505060405180910390fd5b612e198260008361163e565b612e5681604051806060016040528060228152602001613597602291396001600160a01b0385166000908152600560205260409020549190612c7e565b6001600160a01b038316600090815260056020526040902055600754612e7c9082612f89565b6007556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b03167fa9059cbb0000000000000000000000000000000000000000000000000000000017905261163e9084906131d2565b600082820183811015610f68576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082821115612fe0576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b8015610d66577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b6b55f25826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015612d7b57600080fd5b6103e88311156130a9576040805162461bcd60e51b815260206004820152600c60248201527f626164206d696e74206270730000000000000000000000000000000000000000604482015290519081900360640190fd5b6103e8821115613100576040805162461bcd60e51b815260206004820152600d60248201527f62616420636c61696d2062707300000000000000000000000000000000000000604482015290519081900360640190fd5b600a811015801561311357506103e88111155b613164576040805162461bcd60e51b815260206004820152600c60248201527f626164206275726e206270730000000000000000000000000000000000000000604482015290519081900360640190fd5b60408051606080820183528582526020808301869052918301849052600b869055600c859055600d849055825186815291820185905281830184905291517f01bae858246c904512695a3f6d48ab88abb7a0192fdd7c53b043e60317795f45929181900390910190a1505050565b6000613227826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166128859092919063ffffffff16565b80519091501561163e5780806020019051602081101561324657600080fd5b505161163e5760405162461bcd60e51b815260040180806020018281038252602a8152602001806136fe602a913960400191505060405180910390fd5b6060824710156132c45760405162461bcd60e51b81526004018080602001828103825260268152602001806136016026913960400191505060405180910390fd5b6132cd85613507565b61331e576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b6020831061335c5780518252601f19909201916020918201910161333d565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146133be576040519150601f19603f3d011682016040523d82523d6000602084013e6133c3565b606091505b50915091506133d382828661350d565b979650505050505050565b6000806133e9610e8c565b905080613407576133ff600a610ed68686612f2f565b915050610e18565b61289484610edc8584612a61565b6001600160a01b038216613470576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b61347c6000838361163e565b6007546134899082612f2f565b6007556001600160a01b0382166000908152600560205260409020546134af9082612f2f565b6001600160a01b03831660008181526005602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b3b151590565b6060831561351c575081610f68565b82511561352c5782518084602001fd5b60405162461bcd60e51b8152602060048201818152845160248401528451859391928392604401919085019080838360008315612cd2578181015183820152602001612cba56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122076d9bebe42ad013fd0917a582b28e064df74f8a5c407501b78c6510a9c88ceae64736f6c63430007060033416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c5361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001600000000000000000000000009aab3f75489902f3a48495025729a0af77d4b11e000000000000000000000000eadb96f1623176144eba2b24e35325220972b3bd0000000000000000000000007ec8fcc26be7e9e85b57e73083e5fe0550d8a7fe0000000000000000000000005ec0dcf4f6f55f28550c70b854082993fdc0d3b200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000015556e61676969204b4e4320506f6f6c4d617374657200000000000000000000000000000000000000000000000000000000000000000000000000000000000004754b4e4300000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106102f65760003560e01c806370a082311161018f57806399572d6f116100e1578063dd62ed3e1161008a578063f0eeed8111610064578063f0eeed8114610ce8578063f851a44014610cfd578063fe49abe314610d12576102fd565b8063dd62ed3e14610c83578063ed94444714610cbe578063f0359d1b14610cd3576102fd565b8063ac8a584a116100bb578063ac8a584a14610c11578063c243d1a014610c44578063d8f3dda914610c6e576102fd565b806399572d6f14610b6c578063a457c2d714610b9f578063a9059cbb14610bd8576102fd565b80637acc867811610143578063957b7eb31161011d578063957b7eb314610a5557806395d89b4114610b245780639870d7fe14610b39576102fd565b80637acc8678146109265780637c70fb57146109595780638733ece714610986576102fd565b806377f50f971161017457806377f50f97146108a257806379cc6790146108b75780637a319590146108f0576102fd565b806370a082311461083c57806375829def1461086f576102fd565b80632e1a7d4d116102485780633f2a5540116101fc5780634bc92d6c116101d65780634bc92d6c1461079b57806351be62fa146107ce578063677dedee14610809576102fd565b80633f2a55401461062f57806342966c68146106445780634881c7b11461066e576102fd565b806337fd63c71161022d57806337fd63c7146105cc57806339509351146105e15780633cce85ea1461061a576102fd565b80632e1a7d4d14610577578063313ce567146105a1576102fd565b80631adc5573116102aa578063267822471161028457806326782247146104e857806327a099d8146104fd5780632ded90eb14610562576102fd565b80631adc55731461045f578063229ad4771461049057806323b872dd146104a5576102fd565b8063095ea7b3116102db578063095ea7b3146103b85780630e8ee4a91461040557806318160ddd14610438576102fd565b8063045c6a911461030257806306fdde031461032e576102fd565b366102fd57005b600080fd5b34801561030e57600080fd5b5061032c6004803603602081101561032557600080fd5b5035610d27565b005b34801561033a57600080fd5b50610343610d69565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561037d578181015183820152602001610365565b50505050905090810190601f1680156103aa5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103c457600080fd5b506103f1600480360360408110156103db57600080fd5b506001600160a01b038135169060200135610e00565b604080519115158252519081900360200190f35b34801561041157600080fd5b5061032c6004803603602081101561042857600080fd5b50356001600160a01b0316610e1e565b34801561044457600080fd5b5061044d610e8c565b60408051918252519081900360200190f35b34801561046b57600080fd5b50610474610e92565b604080516001600160a01b039092168252519081900360200190f35b34801561049c57600080fd5b5061044d610ea1565b3480156104b157600080fd5b506103f1600480360360608110156104c857600080fd5b506001600160a01b03813581169160208101359091169060400135610ee7565b3480156104f457600080fd5b50610474610f6f565b34801561050957600080fd5b50610512610f7e565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561054e578181015183820152602001610536565b505050509050019250505060405180910390f35b34801561056e57600080fd5b5061044d610fdf565b34801561058357600080fd5b5061032c6004803603602081101561059a57600080fd5b503561107f565b3480156105ad57600080fd5b506105b66111b1565b6040805160ff9092168252519081900360200190f35b3480156105d857600080fd5b5061044d6111ba565b3480156105ed57600080fd5b506103f16004803603604081101561060457600080fd5b506001600160a01b0381351690602001356111c0565b34801561062657600080fd5b5061044d61120e565b34801561063b57600080fd5b506104746112b5565b34801561065057600080fd5b5061032c6004803603602081101561066757600080fd5b50356112c4565b34801561067a57600080fd5b5061032c600480360360a081101561069157600080fd5b8135916020810135918101906060810160408201356401000000008111156106b857600080fd5b8201836020820111156106ca57600080fd5b803590602001918460208302840111640100000000831117156106ec57600080fd5b91939092909160208101903564010000000081111561070a57600080fd5b82018360208201111561071c57600080fd5b8035906020019184602083028401116401000000008311171561073e57600080fd5b91939092909160208101903564010000000081111561075c57600080fd5b82018360208201111561076e57600080fd5b8035906020019184602083028401116401000000008311171561079057600080fd5b5090925090506112d5565b3480156107a757600080fd5b506107b0611528565b60408051938452602084019290925282820152519081900360600190f35b3480156107da57600080fd5b5061032c600480360360408110156107f157600080fd5b506001600160a01b0381351690602001351515611534565b34801561081557600080fd5b5061032c6004803603602081101561082c57600080fd5b50356001600160a01b0316611643565b34801561084857600080fd5b5061044d6004803603602081101561085f57600080fd5b50356001600160a01b03166116b1565b34801561087b57600080fd5b5061032c6004803603602081101561089257600080fd5b50356001600160a01b03166116d0565b3480156108ae57600080fd5b5061032c6117d5565b3480156108c357600080fd5b5061032c600480360360408110156108da57600080fd5b506001600160a01b0381351690602001356118a7565b3480156108fc57600080fd5b5061032c6004803603606081101561091357600080fd5b50803590602081013590604001356118fc565b34801561093257600080fd5b5061032c6004803603602081101561094957600080fd5b50356001600160a01b0316611953565b34801561096557600080fd5b5061044d6004803603602081101561097c57600080fd5b503560ff16611aa0565b34801561099257600080fd5b5061032c600480360360408110156109a957600080fd5b8101906020810181356401000000008111156109c457600080fd5b8201836020820111156109d657600080fd5b803590602001918460208302840111640100000000831117156109f857600080fd5b919390929091602081019035640100000000811115610a1657600080fd5b820183602082011115610a2857600080fd5b80359060200191846020830284011164010000000083111715610a4a57600080fd5b509092509050611ae3565b348015610a6157600080fd5b5061032c60048036036040811015610a7857600080fd5b810190602081018135640100000000811115610a9357600080fd5b820183602082011115610aa557600080fd5b80359060200191846020830284011164010000000083111715610ac757600080fd5b919390929091602081019035640100000000811115610ae557600080fd5b820183602082011115610af757600080fd5b80359060200191846020830284011164010000000083111715610b1957600080fd5b509092509050611c35565b348015610b3057600080fd5b50610343611fbf565b348015610b4557600080fd5b5061032c60048036036020811015610b5c57600080fd5b50356001600160a01b0316612020565b348015610b7857600080fd5b5061032c60048036036020811015610b8f57600080fd5b50356001600160a01b03166121db565b348015610bab57600080fd5b506103f160048036036040811015610bc257600080fd5b506001600160a01b038135169060200135612249565b348015610be457600080fd5b506103f160048036036040811015610bfb57600080fd5b506001600160a01b0381351690602001356122b1565b348015610c1d57600080fd5b5061032c60048036036020811015610c3457600080fd5b50356001600160a01b03166122c5565b348015610c5057600080fd5b5061032c60048036036020811015610c6757600080fd5b50356124c7565b348015610c7a57600080fd5b5061032c612584565b348015610c8f57600080fd5b5061044d60048036036040811015610ca657600080fd5b506001600160a01b0381358116916020013516612608565b348015610cca57600080fd5b50610474612633565b348015610cdf57600080fd5b50610474612657565b348015610cf457600080fd5b5061047461267b565b348015610d0957600080fd5b5061047461268a565b348015610d1e57600080fd5b5061032c612699565b610d5c6001600160a01b037f000000000000000000000000defa4e8a7bcba345f687a2f1456f5edd9ce972021633308461289c565b610d668133612915565b50565b60088054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610df55780601f10610dca57610100808354040283529160200191610df5565b820191906000526020600020905b815481529060010190602001808311610dd857829003601f168201915b505050505090505b90565b6000610e14610e0d612971565b8484612975565b5060015b92915050565b6000546001600160a01b03163314610e6a576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b601080546001600160a01b0319166001600160a01b0392909216919091179055565b60075490565b6011546001600160a01b031681565b6000610eab610e8c565b610eb757506000610dfd565b610ee2610ec2610e8c565b610edc670de0b6b3a7640000610ed6610fdf565b90612a61565b90612aba565b905090565b6000610ef4848484612b21565b610f6484610f00612971565b610f5f85604051806060016040528060288152602001613648602891396001600160a01b038a16600090815260066020526040812090610f3e612971565b6001600160a01b031681526020810191909152604001600020549190612c7e565b612975565b5060015b9392505050565b6001546001600160a01b031681565b60606003805480602002602001604051908101604052809291908181526020018280548015610df557602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610fb8575050505050905090565b60007f000000000000000000000000eadb96f1623176144eba2b24e35325220972b3bd6001600160a01b03166360e4f2e0306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060606040518083038186803b15801561104e57600080fd5b505afa158015611062573d6000803e3d6000fd5b505050506040513d606081101561107857600080fd5b5051919050565b600260045414156110d7576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600455806110e6336116b1565b1015611139576040805162461bcd60e51b815260206004820152601460248201527f696e73756666696369656e742062616c616e6365000000000000000000000000604482015290519081900360640190fd5b6000611152611146610e8c565b610edc84610ed6610fdf565b905061115d81612d15565b611168600282612d8f565b90506111743383612dc8565b6111a86001600160a01b037f000000000000000000000000defa4e8a7bcba345f687a2f1456f5edd9ce97202163383612ec4565b50506001600455565b600a5460ff1690565b600e5481565b6000610e146111cd612971565b84610f5f85600660006111de612971565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490612f2f565b6000610ee2600e547f000000000000000000000000defa4e8a7bcba345f687a2f1456f5edd9ce972026001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561128357600080fd5b505afa158015611297573d6000803e3d6000fd5b505050506040513d60208110156112ad57600080fd5b505190612f89565b6010546001600160a01b031681565b610d666112cf612971565b82612dc8565b3360009081526002602052604090205460ff16611329576040805162461bcd60e51b815260206004820152600d60248201526c37b7363c9037b832b930ba37b960991b604482015290519081900360640190fd5b601060009054906101000a90046001600160a01b03166001600160a01b031663c390d3318989308a8a8a8a8a8a6040518a63ffffffff1660e01b8152600401808a8152602001898152602001886001600160a01b0316815260200180602001806020018060200184810384528a8a82818152602001925060200280828437600083820152601f01601f19169091018581038452888152602090810191508990890280828437600083820152601f01601f19169091018581038352868152602090810191508790870280828437600081840152601f19601f8201169050808301925050509c50505050505050505050505050600060405180830381600087803b15801561143457600080fd5b505af1158015611448573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561147157600080fd5b810190808051604051939291908464010000000082111561149157600080fd5b9083019060208201858111156114a657600080fd5b82518660208202830111640100000000821117156114c357600080fd5b82525081516020918201928201910280838360005b838110156114f05781810151838201526020016114d8565b50505050905001604052505050506000611512600161150d61120e565b612d8f565b905061151d81612fe6565b505050505050505050565b600b54600c54600d5483565b3360009081526002602052604090205460ff16611588576040805162461bcd60e51b815260206004820152600d60248201526c37b7363c9037b832b930ba37b960991b604482015290519081900360640190fd5b7f000000000000000000000000defa4e8a7bcba345f687a2f1456f5edd9ce972026001600160a01b0316826001600160a01b0316141561160f576040805162461bcd60e51b815260206004820152600f60248201527f6b6e63206e6f7420616c6c6f7765640000000000000000000000000000000000604482015290519081900360640190fd5b60008161161d576000611621565b6000195b600f5490915061163e906001600160a01b03858116911683612740565b505050565b6000546001600160a01b0316331461168f576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b600f80546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0381166000908152600560205260409020545b919050565b6000546001600160a01b0316331461171c576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b038116611777576040805162461bcd60e51b815260206004820152600b60248201527f6e65772061646d696e2030000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b038316815290517f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc409181900360200190a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b03163314611834576040805162461bcd60e51b815260206004820152600b60248201527f6e6f742070656e64696e67000000000000000000000000000000000000000000604482015290519081900360640190fd5b600154600054604080516001600160a01b03938416815292909116602083015280517f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60006118de82604051806060016040528060248152602001613670602491396118d7866118d2612971565b612608565b9190612c7e565b90506118f2836118ec612971565b83612975565b61163e8383612dc8565b6000546001600160a01b03163314611948576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b61163e838383613052565b6000546001600160a01b0316331461199f576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b0381166119fa576040805162461bcd60e51b815260206004820152600760248201527f61646d696e203000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b038316815290517f3b81caf78fa51ecbc8acb482fd7012a277b428d9b80f9d156e8a54107496cc409181900360200190a1600054604080516001600160a01b038085168252909216602083015280517f65da1cfc2c2e81576ad96afb24a581f8e109b7a403b35cbd3243a1c99efdb9ed9281900390910190a1600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080826002811115611aaf57fe5b1415611abe5750600b546116cb565b6001826002811115611acc57fe5b1415611adb5750600c546116cb565b5050600d5490565b3360009081526002602052604090205460ff16611b37576040805162461bcd60e51b815260206004820152600d60248201526c37b7363c9037b832b930ba37b960991b604482015290519081900360640190fd5b828114611b8b576040805162461bcd60e51b815260206004820152600e60248201527f696e76616c6964206c656e677468000000000000000000000000000000000000604482015290519081900360640190fd5b60005b83811015611c2e576011546001600160a01b0316636f93bfb7868684818110611bb357fe5b90506020020135858585818110611bc657fe5b905060200201356040518363ffffffff1660e01b81526004018083815260200182815260200192505050600060405180830381600087803b158015611c0a57600080fd5b505af1158015611c1e573d6000803e3d6000fd5b505060019092019150611b8e9050565b5050505050565b3360009081526002602052604090205460ff16611c89576040805162461bcd60e51b815260206004820152600d60248201526c37b7363c9037b832b930ba37b960991b604482015290519081900360640190fd5b828114611cdd576040805162461bcd60e51b815260206004820152600f60248201527f756e657175616c206c656e677468730000000000000000000000000000000000604482015290519081900360640190fd5b60005b83811015611fa45773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee858583818110611d0957fe5b905060200201356001600160a01b03166001600160a01b03161415611df057600f546001600160a01b0316637a2a0456611d44476001612f89565b7f000000000000000000000000defa4e8a7bcba345f687a2f1456f5edd9ce97202868686818110611d7157fe5b905060200201356040518463ffffffff1660e01b815260040180836001600160a01b03168152602001828152602001925050506020604051808303818588803b158015611dbd57600080fd5b505af1158015611dd1573d6000803e3d6000fd5b50505050506040513d6020811015611de857600080fd5b50611f9c9050565b7f000000000000000000000000defa4e8a7bcba345f687a2f1456f5edd9ce972026001600160a01b0316858583818110611e2657fe5b905060200201356001600160a01b03166001600160a01b031614611f9c57600f546001600160a01b0316637409e2eb868684818110611e6157fe5b905060200201356001600160a01b0316611ede6001898987818110611e8257fe5b905060200201356001600160a01b03166001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561128357600080fd5b7f000000000000000000000000defa4e8a7bcba345f687a2f1456f5edd9ce97202878787818110611f0b57fe5b905060200201356040518563ffffffff1660e01b815260040180856001600160a01b03168152602001848152602001836001600160a01b03168152602001828152602001945050505050602060405180830381600087803b158015611f6f57600080fd5b505af1158015611f83573d6000803e3d6000fd5b505050506040513d6020811015611f9957600080fd5b50505b600101611ce0565b506000611fb4600161150d61120e565b9050611c2e81612fe6565b60098054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610df55780601f10610dca57610100808354040283529160200191610df5565b6000546001600160a01b0316331461206c576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff16156120da576040805162461bcd60e51b815260206004820152600f60248201527f6f70657261746f72206578697374730000000000000000000000000000000000604482015290519081900360640190fd5b600354603211612131576040805162461bcd60e51b815260206004820152600d60248201527f6d6178206f70657261746f727300000000000000000000000000000000000000604482015290519081900360640190fd5b604080516001600160a01b03831681526001602082015281517f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b929181900390910190a16001600160a01b03166000818152600260205260408120805460ff191660019081179091556003805491820181559091527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b0319169091179055565b6000546001600160a01b03163314612227576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b601180546001600160a01b0319166001600160a01b0392909216919091179055565b6000610e14612256612971565b84610f5f8560405180606001604052806025815260200161375e6025913960066000612280612971565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190612c7e565b6000610e146122be612971565b8484612b21565b6000546001600160a01b03163314612311576040805162461bcd60e51b815260206004820152600a60248201526937b7363c9030b236b4b760b11b604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff1661237e576040805162461bcd60e51b815260206004820152600c60248201527f6e6f74206f70657261746f720000000000000000000000000000000000000000604482015290519081900360640190fd5b6001600160a01b0381166000908152600260205260408120805460ff191690555b6003548110156124c357816001600160a01b0316600382815481106123c057fe5b6000918252602090912001546001600160a01b031614156124bb576003805460001981019081106123ed57fe5b600091825260209091200154600380546001600160a01b03909216918390811061241357fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600380548061244c57fe5b60008281526020808220830160001990810180546001600160a01b0319169055909201909255604080516001600160a01b03861681529182019290925281517f091a7a4b85135fdd7e8dbc18b12fabe5cc191ea867aa3c2e1a24a102af61d58b929181900390910190a16124c3565b60010161239f565b5050565b6124fc6001600160a01b037f000000000000000000000000dd974d5c2e2928dea5f71b9825b8b646686bd2001633308461289c565b7f000000000000000000000000defa4e8a7bcba345f687a2f1456f5edd9ce972026001600160a01b031663c49fc085826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561256257600080fd5b505af1158015612576573d6000803e3d6000fd5b50505050610d668133612915565b3360009081526002602052604090205460ff166125d8576040805162461bcd60e51b815260206004820152600d60248201526c37b7363c9037b832b930ba37b960991b604482015290519081900360640190fd5b600e546000906125e9906001612f89565b6001600e55600054909150610d669082906001600160a01b0316612915565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b7f000000000000000000000000defa4e8a7bcba345f687a2f1456f5edd9ce9720281565b7f000000000000000000000000eadb96f1623176144eba2b24e35325220972b3bd81565b600f546001600160a01b031681565b6000546001600160a01b031681565b3360009081526002602052604090205460ff166126ed576040805162461bcd60e51b815260206004820152600d60248201526c37b7363c9037b832b930ba37b960991b604482015290519081900360640190fd5b600e546000906126fe906001612f89565b6001600e55600054909150610d66906001600160a01b037f000000000000000000000000defa4e8a7bcba345f687a2f1456f5edd9ce972028116911683612ec4565b8015806127df5750604080517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b03848116602483015291519185169163dd62ed3e91604480820192602092909190829003018186803b1580156127b157600080fd5b505afa1580156127c5573d6000803e3d6000fd5b505050506040513d60208110156127db57600080fd5b5051155b61281a5760405162461bcd60e51b81526004018080602001828103825260368152602001806137286036913960400191505060405180910390fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b03167f095ea7b30000000000000000000000000000000000000000000000000000000017905261163e9084906131d2565b60606128948484600085613283565b949350505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03167f23b872dd0000000000000000000000000000000000000000000000000000000017905261290f9085906131d2565b50505050565b600061291f610fdf565b6000549091506001600160a01b0383811691161461294457612942600084612d8f565b505b600061294e61120e565b905061295981612fe6565b600061296583836133de565b9050611c2e8482613415565b3390565b6001600160a01b0383166129ba5760405162461bcd60e51b81526004018080602001828103825260248152602001806136da6024913960400191505060405180910390fd5b6001600160a01b0382166129ff5760405162461bcd60e51b81526004018080602001828103825260228152602001806135b96022913960400191505060405180910390fd5b6001600160a01b03808416600081815260066020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600082612a7057506000610e18565b82820282848281612a7d57fe5b0414610f685760405162461bcd60e51b81526004018080602001828103825260218152602001806136276021913960400191505060405180910390fd5b6000808211612b10576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381612b1957fe5b049392505050565b6001600160a01b038316612b665760405162461bcd60e51b81526004018080602001828103825260258152602001806136b56025913960400191505060405180910390fd5b6001600160a01b038216612bab5760405162461bcd60e51b81526004018080602001828103825260238152602001806135746023913960400191505060405180910390fd5b612bb683838361163e565b612bf3816040518060600160405280602681526020016135db602691396001600160a01b0386166000908152600560205260409020549190612c7e565b6001600160a01b038085166000908152600560205260408082209390935590841681522054612c229082612f2f565b6001600160a01b0380841660008181526005602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115612d0d5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612cd2578181015183820152602001612cba565b50505050905090810190601f168015612cff5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b7f000000000000000000000000eadb96f1623176144eba2b24e35325220972b3bd6001600160a01b0316632e1a7d4d826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015612d7b57600080fd5b505af1158015611c2e573d6000803e3d6000fd5b600080612dab612710610edc612da487611aa0565b8690612a61565b600e54909150612dbb9082612f2f565b600e556128948382612f89565b6001600160a01b038216612e0d5760405162461bcd60e51b81526004018080602001828103825260218152602001806136946021913960400191505060405180910390fd5b612e198260008361163e565b612e5681604051806060016040528060228152602001613597602291396001600160a01b0385166000908152600560205260409020549190612c7e565b6001600160a01b038316600090815260056020526040902055600754612e7c9082612f89565b6007556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b03167fa9059cbb0000000000000000000000000000000000000000000000000000000017905261163e9084906131d2565b600082820183811015610f68576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082821115612fe0576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b8015610d66577f000000000000000000000000eadb96f1623176144eba2b24e35325220972b3bd6001600160a01b031663b6b55f25826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015612d7b57600080fd5b6103e88311156130a9576040805162461bcd60e51b815260206004820152600c60248201527f626164206d696e74206270730000000000000000000000000000000000000000604482015290519081900360640190fd5b6103e8821115613100576040805162461bcd60e51b815260206004820152600d60248201527f62616420636c61696d2062707300000000000000000000000000000000000000604482015290519081900360640190fd5b600a811015801561311357506103e88111155b613164576040805162461bcd60e51b815260206004820152600c60248201527f626164206275726e206270730000000000000000000000000000000000000000604482015290519081900360640190fd5b60408051606080820183528582526020808301869052918301849052600b869055600c859055600d849055825186815291820185905281830184905291517f01bae858246c904512695a3f6d48ab88abb7a0192fdd7c53b043e60317795f45929181900390910190a1505050565b6000613227826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166128859092919063ffffffff16565b80519091501561163e5780806020019051602081101561324657600080fd5b505161163e5760405162461bcd60e51b815260040180806020018281038252602a8152602001806136fe602a913960400191505060405180910390fd5b6060824710156132c45760405162461bcd60e51b81526004018080602001828103825260268152602001806136016026913960400191505060405180910390fd5b6132cd85613507565b61331e576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b6020831061335c5780518252601f19909201916020918201910161333d565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146133be576040519150601f19603f3d011682016040523d82523d6000602084013e6133c3565b606091505b50915091506133d382828661350d565b979650505050505050565b6000806133e9610e8c565b905080613407576133ff600a610ed68686612f2f565b915050610e18565b61289484610edc8584612a61565b6001600160a01b038216613470576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b61347c6000838361163e565b6007546134899082612f2f565b6007556001600160a01b0382166000908152600560205260409020546134af9082612f2f565b6001600160a01b03831660008181526005602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b3b151590565b6060831561351c575081610f68565b82511561352c5782518084602001fd5b60405162461bcd60e51b8152602060048201818152845160248401528451859391928392604401919085019080838360008315612cd2578181015183820152602001612cba56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122076d9bebe42ad013fd0917a582b28e064df74f8a5c407501b78c6510a9c88ceae64736f6c63430007060033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001600000000000000000000000009aab3f75489902f3a48495025729a0af77d4b11e000000000000000000000000eadb96f1623176144eba2b24e35325220972b3bd0000000000000000000000007ec8fcc26be7e9e85b57e73083e5fe0550d8a7fe0000000000000000000000005ec0dcf4f6f55f28550c70b854082993fdc0d3b200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000015556e61676969204b4e4320506f6f6c4d617374657200000000000000000000000000000000000000000000000000000000000000000000000000000000000004754b4e4300000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _name (string): Unagii KNC PoolMaster
Arg [1] : _symbol (string): uKNC
Arg [2] : _kyberProxy (address): 0x9AAb3f75489902f3a48495025729a0AF77d4b11e
Arg [3] : _kyberStaking (address): 0xeadb96F1623176144EBa2B24e35325220972b3bD
Arg [4] : _kyberGovernance (address): 0x7Ec8FcC26bE7e9E85B57E73083E5Fe0550d8A7fE
Arg [5] : _rewardsDistributor (address): 0x5EC0DcF4f6F55f28550c70B854082993fdc0D3B2
Arg [6] : _mintFeeBps (uint256): 0
Arg [7] : _claimFeeBps (uint256): 0
Arg [8] : _burnFeeBps (uint256): 10
-----Encoded View---------------
13 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000160
Arg [2] : 0000000000000000000000009aab3f75489902f3a48495025729a0af77d4b11e
Arg [3] : 000000000000000000000000eadb96f1623176144eba2b24e35325220972b3bd
Arg [4] : 0000000000000000000000007ec8fcc26be7e9e85b57e73083e5fe0550d8a7fe
Arg [5] : 0000000000000000000000005ec0dcf4f6f55f28550c70b854082993fdc0d3b2
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [8] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000015
Arg [10] : 556e61676969204b4e4320506f6f6c4d61737465720000000000000000000000
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [12] : 754b4e4300000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.