- Contract name:
- ICake
- Optimization enabled
- true
- Compiler version
- v0.6.12+commit.27d51765
- Optimization runs
- 99999
- EVM Version
- default
- Verified at
- 2024-07-20T03:25:33.968180Z
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "./interfaces/ICakePool.sol";
contract ICake is Ownable {
using SafeMath for uint256;
ICaKePool public immutable cakePool;
address public admin;
// threshold of locked duration
uint256 public ceiling;
uint256 public constant MIN_CEILING_DURATION = 1 weeks;
event UpdateCeiling(uint256 newCeiling);
/**
* @notice Checks if the msg.sender is the admin address
*/
modifier onlyAdmin() {
require(msg.sender == admin, "None admin!");
_;
}
/**
* @notice Constructor
* @param _cakePool: Cake pool contract
* @param _admin: admin of the this contract
* @param _ceiling: the max locked duration which the linear decrease start
*/
constructor(
ICaKePool _cakePool,
address _admin,
uint256 _ceiling
) public {
require(_ceiling >= MIN_CEILING_DURATION, "Invalid ceiling duration");
cakePool = _cakePool;
admin = _admin;
ceiling = _ceiling;
}
/**
* @notice calculate iCake credit per user.
* @param _user: user address.
*/
function getUserCredit(address _user) external view returns (uint256) {
require(_user != address(0), "getUserCredit: Invalid address");
ICaKePool.UserInfo memory userInfo = cakePool.userInfo(_user);
if (!userInfo.locked || block.timestamp > userInfo.lockEndTime) {
return 0;
}
// lockEndTime always >= lockStartTime
uint256 lockDuration = userInfo.lockEndTime.sub(userInfo.lockStartTime);
if (lockDuration >= ceiling) {
return userInfo.lockedAmount;
} else if (lockDuration < ceiling && lockDuration >= 0) {
return (userInfo.lockedAmount.mul(lockDuration)).div(ceiling);
}
}
/**
* @notice update ceiling thereshold duration for iCake calculation.
* @param _newCeiling: new threshold duration.
*/
function updateCeiling(uint256 _newCeiling) external onlyAdmin {
require(_newCeiling >= MIN_CEILING_DURATION, "updateCeiling: Invalid ceiling");
require(ceiling != _newCeiling, "updateCeiling: Ceiling not changed");
ceiling = _newCeiling;
emit UpdateCeiling(ceiling);
}
}
@openzeppelin/contracts/GSN/Context.sol
// 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;
}
}
@openzeppelin/contracts/access/Ownable.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "../GSN/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
@openzeppelin/contracts/math/SafeMath.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
@openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
@openzeppelin/contracts/token/ERC20/SafeERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.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");
}
}
}
@openzeppelin/contracts/utils/Address.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contracts/interfaces/ICakePool.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
interface ICaKePool {
struct UserInfo {
uint256 shares;
uint256 lastDepositedTime;
uint256 cakeAtLastUserAction;
uint256 lastUserActionTime;
uint256 lockStartTime;
uint256 lockEndTime;
uint256 userBoostedShare;
bool locked;
uint256 lockedAmount;
}
function userInfo(address _user) external view returns (UserInfo memory);
}
Compiler Settings
{"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata"],"":["ast"]}},"optimizer":{"runs":99999,"enabled":true},"libraries":{}}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_cakePool","internalType":"contract ICaKePool"},{"type":"address","name":"_admin","internalType":"address"},{"type":"uint256","name":"_ceiling","internalType":"uint256"}]},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"UpdateCeiling","inputs":[{"type":"uint256","name":"newCeiling","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MIN_CEILING_DURATION","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"admin","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract ICaKePool"}],"name":"cakePool","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"ceiling","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getUserCredit","inputs":[{"type":"address","name":"_user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateCeiling","inputs":[{"type":"uint256","name":"_newCeiling","internalType":"uint256"}]}]
Contract Creation Code
0x60a060405234801561001057600080fd5b50604051610da4380380610da483398101604081905261002f916100ee565b60006100396100ea565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35062093a808110156100af5760405162461bcd60e51b81526004016100a690610130565b60405180910390fd5b60609290921b6001600160601b031916608052600180546001600160a01b0319166001600160a01b039290921691909117905560025561017f565b3390565b600080600060608486031215610102578283fd5b835161010d81610167565b602085015190935061011e81610167565b80925050604084015190509250925092565b60208082526018908201527f496e76616c6964206365696c696e67206475726174696f6e0000000000000000604082015260600190565b6001600160a01b038116811461017c57600080fd5b50565b60805160601c610c036101a1600039806103ca52806104f55250610c036000f3fe608060405234801561001057600080fd5b50600436106100a35760003560e01c8063dad6f0dc11610076578063f0be070c1161005b578063f0be070c14610113578063f2fde38b1461011b578063f851a4401461012e576100a3565b8063dad6f0dc146100f8578063ed64a9671461010b576100a3565b8063715018a6146100a8578063753ed1bd146100b25780638da5cb5b146100d0578063b1463a6a146100e5575b600080fd5b6100b0610136565b005b6100ba61020a565b6040516100c79190610b9d565b60405180910390f35b6100d8610210565b6040516100c7919061091a565b6100b06100f3366004610902565b61022c565b6100ba61010636600461084a565b610336565b6100d86104f3565b6100ba610517565b6100b061012936600461084a565b61051e565b6100d8610654565b61013e610670565b60005473ffffffffffffffffffffffffffffffffffffffff90811691161461019b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161019290610afa565b60405180910390fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60025481565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b60015473ffffffffffffffffffffffffffffffffffffffff16331461027d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161019290610b66565b62093a808110156102ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161019290610b2f565b8060025414156102f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161019290610a40565b60028190556040517ffb400ea281d5b831cc19858a6fefe7cc8865606ffb709543e3dc56632705708c9061032b908390610b9d565b60405180910390a150565b600073ffffffffffffffffffffffffffffffffffffffff8216610385576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161019290610a09565b61038d6107ec565b6040517f1959a00200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690631959a002906103ff90869060040161091a565b6101206040518083038186803b15801561041857600080fd5b505afa15801561042c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610450919061087e565b90508060e00151158061046657508060a0015142115b156104755760009150506104ee565b600061049282608001518360a0015161067490919063ffffffff16565b905060025481106104aa5750610100015190506104ee565b600254811080156104b9575060015b156104eb576104e26002546104dc838561010001516106bf90919063ffffffff16565b90610713565b925050506104ee565b50505b919050565b7f000000000000000000000000000000000000000000000000000000000000000081565b62093a8081565b610526610670565b60005473ffffffffffffffffffffffffffffffffffffffff90811691161461057a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161019290610afa565b73ffffffffffffffffffffffffffffffffffffffff81166105c7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610192906109ac565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b3390565b60006106b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610755565b90505b92915050565b6000826106ce575060006106b9565b828202828482816106db57fe5b04146106b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161019290610a9d565b60006106b683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061079b565b60008184841115610793576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610192919061093b565b505050900390565b600081836107d6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610192919061093b565b5060008385816107e257fe5b0495945050505050565b60405180610120016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600015158152602001600081525090565b805180151581146106b957600080fd5b60006020828403121561085b578081fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146106b6578182fd5b6000610120808385031215610891578182fd5b61089a81610ba6565b9050825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c08201526108e98460e0850161083a565b60e0820152610100928301519281019290925250919050565b600060208284031215610913578081fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b6000602080835283518082850152825b818110156109675785810183015185820160400152820161094b565b818111156109785783604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201527f6464726573730000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601e908201527f676574557365724372656469743a20496e76616c696420616464726573730000604082015260600190565b60208082526022908201527f7570646174654365696c696e673a204365696c696e67206e6f74206368616e6760408201527f6564000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60408201527f7700000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601e908201527f7570646174654365696c696e673a20496e76616c6964206365696c696e670000604082015260600190565b6020808252600b908201527f4e6f6e652061646d696e21000000000000000000000000000000000000000000604082015260600190565b90815260200190565b60405181810167ffffffffffffffff81118282101715610bc557600080fd5b60405291905056fea2646970667358221220a4ff3c9f726484abd06a94b5e2b1763aada38ae199f9f318f44c8796806d3fd664736f6c634300060c0033000000000000000000000000ab387712bead1e4c031977f69230245e3af79a8f0000000000000000000000005bd03def68a8e95dc138f8d3484f78bcac8cbe620000000000000000000000000000000000000000000000000000000000278d00
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106100a35760003560e01c8063dad6f0dc11610076578063f0be070c1161005b578063f0be070c14610113578063f2fde38b1461011b578063f851a4401461012e576100a3565b8063dad6f0dc146100f8578063ed64a9671461010b576100a3565b8063715018a6146100a8578063753ed1bd146100b25780638da5cb5b146100d0578063b1463a6a146100e5575b600080fd5b6100b0610136565b005b6100ba61020a565b6040516100c79190610b9d565b60405180910390f35b6100d8610210565b6040516100c7919061091a565b6100b06100f3366004610902565b61022c565b6100ba61010636600461084a565b610336565b6100d86104f3565b6100ba610517565b6100b061012936600461084a565b61051e565b6100d8610654565b61013e610670565b60005473ffffffffffffffffffffffffffffffffffffffff90811691161461019b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161019290610afa565b60405180910390fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60025481565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b60015473ffffffffffffffffffffffffffffffffffffffff16331461027d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161019290610b66565b62093a808110156102ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161019290610b2f565b8060025414156102f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161019290610a40565b60028190556040517ffb400ea281d5b831cc19858a6fefe7cc8865606ffb709543e3dc56632705708c9061032b908390610b9d565b60405180910390a150565b600073ffffffffffffffffffffffffffffffffffffffff8216610385576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161019290610a09565b61038d6107ec565b6040517f1959a00200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000ab387712bead1e4c031977f69230245e3af79a8f1690631959a002906103ff90869060040161091a565b6101206040518083038186803b15801561041857600080fd5b505afa15801561042c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610450919061087e565b90508060e00151158061046657508060a0015142115b156104755760009150506104ee565b600061049282608001518360a0015161067490919063ffffffff16565b905060025481106104aa5750610100015190506104ee565b600254811080156104b9575060015b156104eb576104e26002546104dc838561010001516106bf90919063ffffffff16565b90610713565b925050506104ee565b50505b919050565b7f000000000000000000000000ab387712bead1e4c031977f69230245e3af79a8f81565b62093a8081565b610526610670565b60005473ffffffffffffffffffffffffffffffffffffffff90811691161461057a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161019290610afa565b73ffffffffffffffffffffffffffffffffffffffff81166105c7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610192906109ac565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b3390565b60006106b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610755565b90505b92915050565b6000826106ce575060006106b9565b828202828482816106db57fe5b04146106b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161019290610a9d565b60006106b683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061079b565b60008184841115610793576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610192919061093b565b505050900390565b600081836107d6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610192919061093b565b5060008385816107e257fe5b0495945050505050565b60405180610120016040528060008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600015158152602001600081525090565b805180151581146106b957600080fd5b60006020828403121561085b578081fd5b813573ffffffffffffffffffffffffffffffffffffffff811681146106b6578182fd5b6000610120808385031215610891578182fd5b61089a81610ba6565b9050825181526020830151602082015260408301516040820152606083015160608201526080830151608082015260a083015160a082015260c083015160c08201526108e98460e0850161083a565b60e0820152610100928301519281019290925250919050565b600060208284031215610913578081fd5b5035919050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b6000602080835283518082850152825b818110156109675785810183015185820160400152820161094b565b818111156109785783604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201527f6464726573730000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601e908201527f676574557365724372656469743a20496e76616c696420616464726573730000604082015260600190565b60208082526022908201527f7570646174654365696c696e673a204365696c696e67206e6f74206368616e6760408201527f6564000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60408201527f7700000000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601e908201527f7570646174654365696c696e673a20496e76616c6964206365696c696e670000604082015260600190565b6020808252600b908201527f4e6f6e652061646d696e21000000000000000000000000000000000000000000604082015260600190565b90815260200190565b60405181810167ffffffffffffffff81118282101715610bc557600080fd5b60405291905056fea2646970667358221220a4ff3c9f726484abd06a94b5e2b1763aada38ae199f9f318f44c8796806d3fd664736f6c634300060c0033