Overview
Max Total Supply
10,000,000 SURF
Holders
917 ( -0.109%)
Market
Price
$0.04 @ 0.000012 ETH
Onchain Market Cap
$381,853.03
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:
SURF
Compiler Version
v0.6.12+commit.27d51765
Contract Source Code (Solidity Multiple files format)
/* _____ __ ______ ______ ___________ _____ _ ______________ / ___// / / / __ \/ ____/ / ____/ _/ | / / | / | / / ____/ ____/ \__ \/ / / / /_/ / /_ / /_ / // |/ / /| | / |/ / / / __/ ___/ / /_/ / _, _/ __/ _ / __/ _/ // /| / ___ |/ /| / /___/ /___ /____/\____/_/ |_/_/ (_) /_/ /___/_/ |_/_/ |_/_/ |_/\____/_____/ Website: https://surf.finance Created by Proof and sol_dev, with help from Zoma and Mr Fahrenheit Audited by Aegis DAO and Sherlock Security */ pragma solidity ^0.6.12; import './ERC20.sol'; import './IERC20.sol'; import './Ownable.sol'; import './Whirlpool.sol'; interface Callable { function tokenCallback(address _from, uint256 _tokens, bytes calldata _data) external returns (bool); function receiveApproval(address _from, uint256 _tokens, address _token, bytes calldata _data) external; } // SURF Token with Governance. The governance contract will own the SURF, Tito, and Whirlpool contracts, // allowing SURF token holders to make and vote on proposals that can modify many parts of the protocol. contract SURF is ERC20("SURF.Finance", "SURF"), Ownable { // There will be a max supply of 10,000,000 SURF tokens uint256 public constant MAX_SUPPLY = 10000000 * 10**18; bool public maxSupplyHit = false; // The SURF transfer fee that gets rewarded to Whirlpool stakers (1 = 0.1%). Defaults to 1% uint256 public transferFee = 10; // Mapping of whitelisted sender and recipient addresses that don't pay the transfer fee. Allows SURF token holders to whitelist future contracts mapping(address => bool) public senderWhitelist; mapping(address => bool) public recipientWhitelist; // The Tito contract address public titoAddress; // The Whirlpool contract address payable public whirlpoolAddress; // The Uniswap SURF-ETH LP token address address public surfPoolAddress; // Creates `_amount` token to `_to`. Can only be called by the Tito contract. function mint(address _to, uint256 _amount) public { require(maxSupplyHit != true, "max supply hit"); require(msg.sender == titoAddress, "not Tito"); uint256 supply = totalSupply(); if (supply.add(_amount) >= MAX_SUPPLY) { _amount = MAX_SUPPLY.sub(supply); maxSupplyHit = true; } if (_amount > 0) { _mint(_to, _amount); _moveDelegates(address(0), _delegates[_to], _amount); } } // Sets the addresses of the Tito farming contract, the Whirlpool staking contract, and the Uniswap SURF-ETH LP token function setContractAddresses(address _titoAddress, address payable _whirlpoolAddress, address _surfPoolAddress) public onlyOwner { if (_titoAddress != address(0)) titoAddress = _titoAddress; if (_whirlpoolAddress != address(0)) whirlpoolAddress = _whirlpoolAddress; if (_surfPoolAddress != address(0)) surfPoolAddress = _surfPoolAddress; } // Sets the SURF transfer fee that gets rewarded to Whirlpool stakers. Can't be higher than 10%. function setTransferFee(uint256 _transferFee) public onlyOwner { require(_transferFee <= 100, "over 10%"); transferFee = _transferFee; } // Add an address to the sender or recipient transfer whitelist function addToTransferWhitelist(bool _addToSenderWhitelist, address _address) public onlyOwner { if (_addToSenderWhitelist == true) senderWhitelist[_address] = true; else recipientWhitelist[_address] = true; } // Remove an address from the sender or recipient transfer whitelist function removeFromTransferWhitelist(bool _removeFromSenderWhitelist, address _address) public onlyOwner { if (_removeFromSenderWhitelist == true) senderWhitelist[_address] = false; else recipientWhitelist[_address] = false; } // Both the Tito and Whirlpool contracts will lock the SURF-ETH LP tokens they receive from their staking/unstaking fees here (ensuring liquidity forever). // This function allows SURF token holders to decide what to do with the locked LP tokens in the future function migrateLockedLPTokens(address _to, uint256 _amount) public onlyOwner { IERC20 surfPool = IERC20(surfPoolAddress); require(_amount > 0 && _amount <= surfPool.balanceOf(address(this)), "bad amount"); surfPool.transfer(_to, _amount); } function approveAndCall(address _spender, uint256 _tokens, bytes calldata _data) external returns (bool) { approve(_spender, _tokens); Callable(_spender).receiveApproval(msg.sender, _tokens, address(this), _data); return true; } function transferAndCall(address _to, uint256 _tokens, bytes calldata _data) external returns (bool) { uint256 _balanceBefore = balanceOf(_to); transfer(_to, _tokens); uint256 _tokensReceived = balanceOf(_to) - _balanceBefore; uint32 _size; assembly { _size := extcodesize(_to) } if (_size > 0) { require(Callable(_to).tokenCallback(msg.sender, _tokensReceived, _data)); } return true; } // There's a fee on every SURF transfer that gets sent to the Whirlpool staking contract which will start getting rewarded to stakers after the max supply is hit. // The transfer fee will reduce the front-running of Uniswap trades and will provide a major incentive to hold and stake SURF long-term. // Transfers to/from the Tito or Whirlpool contracts will not pay a fee. function _transfer(address sender, address recipient, uint256 amount) internal override { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); uint256 transferFeeAmount; uint256 tokensToTransfer; if (amount > 0) { // Send a fee to the Whirlpool staking contract if this isn't a whitelisted transfer if (_isWhitelistedTransfer(sender, recipient) != true) { transferFeeAmount = amount.mul(transferFee).div(1000); _balances[whirlpoolAddress] = _balances[whirlpoolAddress].add(transferFeeAmount); _moveDelegates(_delegates[sender], _delegates[whirlpoolAddress], transferFeeAmount); Whirlpool(whirlpoolAddress).addSurfReward(sender, transferFeeAmount); emit Transfer(sender, whirlpoolAddress, transferFeeAmount); } tokensToTransfer = amount.sub(transferFeeAmount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); if (tokensToTransfer > 0) { _balances[recipient] = _balances[recipient].add(tokensToTransfer); _moveDelegates(_delegates[sender], _delegates[recipient], tokensToTransfer); // If the Whirlpool staking contract is the transfer recipient, addSurfReward gets called to keep things in sync if (recipient == whirlpoolAddress) Whirlpool(whirlpoolAddress).addSurfReward(sender, tokensToTransfer); } } emit Transfer(sender, recipient, tokensToTransfer); } // Internal function to determine if a SURF transfer is being sent or received by a whitelisted address function _isWhitelistedTransfer(address _sender, address _recipient) internal view returns (bool) { // The Whirlpool and Tito contracts are always whitelisted return _sender == whirlpoolAddress || _recipient == whirlpoolAddress || _sender == titoAddress || _recipient == titoAddress || senderWhitelist[_sender] == true || recipientWhitelist[_recipient] == true; } // Copied and modified from YAM code: // https://github.com/yam-finance/yam-protocol/blob/master/contracts/token/YAMGovernanceStorage.sol // https://github.com/yam-finance/yam-protocol/blob/master/contracts/token/YAMGovernance.sol // Which is copied and modified from COMPOUND: // https://github.com/compound-finance/compound-protocol/blob/master/contracts/Governance/Comp.sol /// @dev A record of each accounts delegate mapping (address => address) internal _delegates; /// @dev A checkpoint for marking number of votes from a given block struct Checkpoint { uint32 fromBlock; uint256 votes; } /// @dev A record of votes checkpoints for each account, by index mapping (address => mapping (uint32 => Checkpoint)) public checkpoints; /// @dev The number of checkpoints for each account mapping (address => uint32) public numCheckpoints; /// @dev The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @dev The EIP-712 typehash for the delegation struct used by the contract bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); /// @dev A record of states for signing / validating signatures mapping (address => uint) public nonces; /// @dev An event thats emitted when an account changes its delegate event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); /// @dev An event thats emitted when a delegate account's vote balance changes event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance); /** * @dev Delegate votes from `msg.sender` to `delegatee` * @param delegator The address to get delegatee for */ function delegates(address delegator) external view returns (address) { return _delegates[delegator]; } /** * @dev Delegate votes from `msg.sender` to `delegatee` * @param delegatee The address to delegate votes to */ function delegate(address delegatee) external { return _delegate(msg.sender, delegatee); } /** * @dev Delegates votes from signatory to `delegatee` * @param delegatee The address to delegate votes to * @param nonce The contract state required to match the signature * @param expiry The time at which to expire the signature * @param v The recovery byte of the signature * @param r Half of the ECDSA signature pair * @param s Half of the ECDSA signature pair */ function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) external { bytes32 domainSeparator = keccak256( abi.encode( DOMAIN_TYPEHASH, keccak256(bytes(name())), getChainId(), address(this) ) ); bytes32 structHash = keccak256( abi.encode( DELEGATION_TYPEHASH, delegatee, nonce, expiry ) ); bytes32 digest = keccak256( abi.encodePacked( "\x19\x01", domainSeparator, structHash ) ); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "SURF::delegateBySig: invalid signature"); require(nonce == nonces[signatory]++, "SURF::delegateBySig: invalid nonce"); require(now <= expiry, "SURF::delegateBySig: signature expired"); return _delegate(signatory, delegatee); } /** * @dev Gets the current votes balance for `account` * @param account The address to get votes balance * @return The number of current votes for `account` */ function getCurrentVotes(address account) external view returns (uint256) { uint32 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0; } /** * @dev Determine the prior number of votes for an account as of a block number * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. * @param account The address of the account to check * @param blockNumber The block number to get the vote balance at * @return The number of votes the account had as of the given block */ function getPriorVotes(address account, uint blockNumber) external view returns (uint256) { require(blockNumber < block.number, "SURF::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return 0; } // First check most recent balance if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) { return checkpoints[account][nCheckpoints - 1].votes; } // Next check implicit zero balance if (checkpoints[account][0].fromBlock > blockNumber) { return 0; } uint32 lower = 0; uint32 upper = nCheckpoints - 1; while (upper > lower) { uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow Checkpoint memory cp = checkpoints[account][center]; if (cp.fromBlock == blockNumber) { return cp.votes; } else if (cp.fromBlock < blockNumber) { lower = center; } else { upper = center - 1; } } return checkpoints[account][lower].votes; } function _delegate(address delegator, address delegatee) internal { address currentDelegate = _delegates[delegator]; uint256 delegatorBalance = balanceOf(delegator); // balance of underlying SURFs (not scaled); _delegates[delegator] = delegatee; emit DelegateChanged(delegator, currentDelegate, delegatee); _moveDelegates(currentDelegate, delegatee, delegatorBalance); } function _moveDelegates(address srcRep, address dstRep, uint256 amount) internal { if (srcRep != dstRep && amount > 0) { if (srcRep != address(0)) { // decrease old representative uint32 srcRepNum = numCheckpoints[srcRep]; uint256 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0; uint256 srcRepNew = srcRepOld.sub(amount); _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew); } if (dstRep != address(0)) { // increase new representative uint32 dstRepNum = numCheckpoints[dstRep]; uint256 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0; uint256 dstRepNew = dstRepOld.add(amount); _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew); } } } function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint256 oldVotes, uint256 newVotes) internal { uint32 blockNumber = safe32(block.number, "SURF::_writeCheckpoint: block number exceeds 32 bits"); if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) { checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; } else { checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes); numCheckpoints[delegatee] = nCheckpoints + 1; } emit DelegateVotesChanged(delegatee, oldVotes, newVotes); } function safe32(uint n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } function getChainId() internal pure returns (uint) { uint256 chainId; assembly { chainId := chainid() } return chainId; } }
pragma solidity ^0.6.12; // File: @openzeppelin/contracts/utils/Address.sol /** * @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) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @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"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); 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); } } } }
pragma solidity ^0.6.12; // File: @openzeppelin/contracts/GSN/Context.sol /* * @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; } }
pragma solidity ^0.6.12; import './Context.sol'; import './IERC20.sol'; import './SafeMath.sol'; // File: @openzeppelin/contracts/token/ERC20/ERC20.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) internal _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ constructor (string memory name, string memory symbol) public { _name = name; _symbol = symbol; _decimals = 18; } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is * called. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view override returns (uint8) { return _decimals; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does. */ function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
pragma solidity ^0.6.12; // File: @openzeppelin/contracts/token/ERC20/IERC20.sol /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the number of decimal places. */ function decimals() external view returns (uint8); /** * @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); }
pragma solidity ^0.6.12; interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; }
pragma solidity ^0.6.12; // File: @uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; }
pragma solidity ^0.6.12; import './Context.sol'; // File: @openzeppelin/contracts/access/Ownable.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. */ 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; } }
pragma solidity ^0.6.12; import './SafeMath.sol'; import './Address.sol'; import './IERC20.sol'; // File: @openzeppelin/contracts/token/ERC20/SafeERC20.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"); } } }
pragma solidity ^0.6.12; // File: @openzeppelin/contracts/math/SafeMath.sol /** * @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; } }
/* _____ __ ______ ______ ___________ _____ _ ______________ / ___// / / / __ \/ ____/ / ____/ _/ | / / | / | / / ____/ ____/ \__ \/ / / / /_/ / /_ / /_ / // |/ / /| | / |/ / / / __/ ___/ / /_/ / _, _/ __/ _ / __/ _/ // /| / ___ |/ /| / /___/ /___ /____/\____/_/ |_/_/ (_) /_/ /___/_/ |_/_/ |_/_/ |_/\____/_____/ Website: https://surf.finance Created by Proof and sol_dev, with help from Zoma and Mr Fahrenheit Audited by Aegis DAO and Sherlock Security */ pragma solidity ^0.6.12; import './Ownable.sol'; import './SafeMath.sol'; import './SafeERC20.sol'; import './IERC20.sol'; import './IUniswapV2Router02.sol'; import './UniStakingInterfaces.sol'; import './SURF.sol'; import './Whirlpool.sol'; // Tito is the master of SURF. He can make SURF, is a fair guy, and a great instructor. contract Tito is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 staked; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. uint256 uniRewardDebt; // UNI staking reward debt. See explanation below. uint256 claimed; // Tracks the amount of SURF claimed by the user. uint256 uniClaimed; // Tracks the amount of UNI claimed by the user. } // Info of each pool. struct PoolInfo { IERC20 token; // Address of token contract. IERC20 lpToken; // Address of LP token contract. uint256 apr; // Fixed APR for the pool. Determines how many SURFs to distribute per block. uint256 lastSurfRewardBlock; // Last block number that SURF rewards were distributed. uint256 accSurfPerShare; // Accumulated SURFs per share, times 1e12. See below. uint256 accUniPerShare; // Accumulated UNIs per share, times 1e12. See below. address uniStakeContract; // Address of UNI staking contract (if applicable). } // We do some fancy math here. Basically, any point in time, the amount of SURFs // entitled to a user but is pending to be distributed is: // // pending reward = (user.staked * pool.accSurfPerShare) - user.rewardDebt // // Whenever a user deposits or withdraws LP tokens to a pool. Here's what happens: // 1. The pool's `accSurfPerShare` (and `lastSurfRewardBlock`) gets updated. // 2. User receives the pending reward sent to his/her address. // 3. User's `staked` amount gets updated. // 4. User's `rewardDebt` gets updated. // The SURF TOKEN! SURF public surf; // The address of the SURF-ETH Uniswap pool address public surfPoolAddress; // The Whirlpool staking contract Whirlpool public whirlpool; // The Uniswap v2 Router IUniswapV2Router02 internal uniswapRouter = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); // The UNI Staking Rewards Factory StakingRewardsFactory internal uniStakingFactory = StakingRewardsFactory(0x3032Ab3Fa8C01d786D29dAdE018d7f2017918e12); // The UNI Token IERC20 internal uniToken = IERC20(0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984); // The WETH Token IERC20 internal weth; // Dev address address payable public devAddress; // Info of each pool. PoolInfo[] public poolInfo; mapping(address => bool) public existingPools; // Info of each user that stakes LP tokens. mapping (uint256 => mapping (address => UserInfo)) public userInfo; // Mapping of whitelisted contracts so that certain contracts like the Aegis pool can interact with the Tito contract mapping(address => bool) public contractWhitelist; // The block number when SURF mining starts. uint256 public startBlock; // Becomes true once the SURF-ETH Uniswap is created (no sooner than 500 blocks after launch) bool public surfPoolActive = false; // The staking fees collected during the first 500 blocks will seed the SURF-ETH Uniswap pool uint256 public initialSurfPoolETH = 0; // 5% of every deposit into any secondary pool (not SURF-ETH) will be converted to SURF (on Uniswap) and sent to the Whirlpool staking contract which becomes active and starts distributing the accumulated SURF to stakers once the max supply is hit uint256 public surfSentToWhirlpool = 0; // The amount of ETH donated to the SURF community by partner projects uint256 public donatedETH = 0; // Certain partner projects need to donate 25 ETH to the SURF community to get a beach uint256 public minimumDonationAmount = 25 * 10**18; // Mapping of addresses that donated ETH on behalf of a partner project mapping(address => address) public donaters; // Mapping of the size of donations from partner projects mapping(address => uint256) public donations; // Approximate number of blocks per year - assumes 13 second blocks uint256 internal constant APPROX_BLOCKS_PER_YEAR = uint256(uint256(365 days) / uint256(13 seconds)); // The default APR for each pool will be 1,000% uint256 internal constant DEFAULT_APR = 1000; // There will be a 1000 block Soft Launch in which SURF is minted to each pool at a static rate to make the start as fair as possible uint256 internal constant SOFT_LAUNCH_DURATION = 1000; // During the Soft Launch, all pools except for the SURF-ETH pool will mint 40 SURF per block. Once it's activated, the SURF-ETH pool will mint the same amount of SURF per block as all of the other pools combined until the end of the Soft Launch uint256 internal constant SOFT_LAUNCH_SURF_PER_BLOCK = 40 * 10**18; event Deposit(address indexed user, uint256 indexed pid, uint256 amount); event Claim(address indexed user, uint256 indexed pid, uint256 surfAmount, uint256 uniAmount); event ClaimAll(address indexed user, uint256 surfAmount, uint256 uniAmount); event Withdraw(address indexed user, uint256 indexed pid, uint256 amount); event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount); event SurfBuyback(address indexed user, uint256 ethSpentOnSurf, uint256 surfBought); event SurfPoolActive(address indexed user, uint256 surfLiquidity, uint256 ethLiquidity); constructor( SURF _surf, address payable _devAddress, uint256 _startBlock ) public { surf = _surf; devAddress = _devAddress; startBlock = _startBlock; weth = IERC20(uniswapRouter.WETH()); // Calculate the address the SURF-ETH Uniswap pool will exist at address uniswapfactoryAddress = uniswapRouter.factory(); address surfAddress = address(surf); address wethAddress = address(weth); // token0 must be strictly less than token1 by sort order to determine the correct address (address token0, address token1) = surfAddress < wethAddress ? (surfAddress, wethAddress) : (wethAddress, surfAddress); surfPoolAddress = address(uint(keccak256(abi.encodePacked( hex'ff', uniswapfactoryAddress, keccak256(abi.encodePacked(token0, token1)), hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' )))); _addInitialPools(); } receive() external payable {} // Internal function to add a new LP Token pool function _addPool(address _token, address _lpToken) internal { uint256 apr = DEFAULT_APR; if (_token == address(surf)) apr = apr * 5; uint256 lastSurfRewardBlock = block.number > startBlock ? block.number : startBlock; poolInfo.push( PoolInfo({ token: IERC20(_token), lpToken: IERC20(_lpToken), apr: apr, lastSurfRewardBlock: lastSurfRewardBlock, accSurfPerShare: 0, accUniPerShare: 0, uniStakeContract: address(0) }) ); existingPools[_lpToken] = true; } // Internal function that adds all of the pools that will be available at launch. Called by the constructor function _addInitialPools() internal { _addPool(address(surf), surfPoolAddress); // SURF-ETH _addPool(0xdAC17F958D2ee523a2206206994597C13D831ec7, 0x0d4a11d5EEaaC28EC3F61d100daF4d40471f1852); // ETH-USDT _addPool(0x6B175474E89094C44Da98b954EedeAC495271d0F, 0xA478c2975Ab1Ea89e8196811F51A7B7Ade33eB11); // DAI-ETH _addPool(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48, 0xB4e16d0168e52d35CaCD2c6185b44281Ec28C9Dc); // USDC-ETH _addPool(0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599, 0xBb2b8038a1640196FbE3e38816F3e67Cba72D940); // WBTC-ETH _addPool(0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984, 0xd3d2E2692501A5c9Ca623199D38826e513033a17); // UNI-ETH _addPool(0x514910771AF9Ca656af840dff83E8264EcF986CA, 0xa2107FA5B38d9bbd2C461D6EDf11B11A50F6b974); // LINK-ETH _addPool(0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9, 0xDFC14d2Af169B0D36C4EFF567Ada9b2E0CAE044f); // AAVE-ETH _addPool(0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F, 0x43AE24960e5534731Fc831386c07755A2dc33D47); // SNX-ETH _addPool(0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2, 0xC2aDdA861F89bBB333c90c492cB837741916A225); // MKR-ETH _addPool(0xc00e94Cb662C3520282E6f5717214004A7f26888, 0xCFfDdeD873554F362Ac02f8Fb1f02E5ada10516f); // COMP-ETH _addPool(0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e, 0x2fDbAdf3C4D5A8666Bc06645B8358ab803996E28); // YFI-ETH _addPool(0xba100000625a3754423978a60c9317c58a424e3D, 0xA70d458A4d9Bc0e6571565faee18a48dA5c0D593); // BAL-ETH _addPool(0x1494CA1F11D487c2bBe4543E90080AeBa4BA3C2b, 0x4d5ef58aAc27d99935E5b6B4A6778ff292059991); // DPI-ETH _addPool(0xD46bA6D942050d489DBd938a2C909A5d5039A161, 0xc5be99A02C6857f9Eac67BbCE58DF5572498F40c); // AMPL-ETH _addPool(0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39, 0x55D5c232D921B9eAA6b37b5845E439aCD04b4DBa); // HEX-ETH _addPool(0x93ED3FBe21207Ec2E8f2d3c3de6e058Cb73Bc04d, 0x343FD171caf4F0287aE6b87D75A8964Dc44516Ab); // PNK-ETH _addPool(0x429881672B9AE42b8EbA0E26cD9C73711b891Ca5, 0xdc98556Ce24f007A5eF6dC1CE96322d65832A819); // PICKLE-ETH _addPool(0x84294FC9710e1252d407d3D80A84bC39001bd4A8, 0x0C5136B5d184379fa15bcA330784f2d5c226Fe96); // NUTS-ETH _addPool(0x821144518dfE9e7b44fCF4d0824e15e8390d4637, 0x490B5B2489eeFC4106C69743F657e3c4A2870aC5); // ATIS-ETH _addPool(0xB9464ef80880c5aeA54C7324c0b8Dd6ca6d05A90, 0xa8D0f6769AB020877f262D8Cd747c188D9097d7E); // LOCK-ETH _addPool(0x926dbD499d701C61eABe2d576e770ECCF9c7F4F3, 0xC7c0EDf0b5f89eff96aF0E31643Bd588ad63Ea23); // aDAO-ETH _addPool(0x3A9FfF453d50D4Ac52A6890647b823379ba36B9E, 0x260E069deAd76baAC587B5141bB606Ef8b9Bab6c); // SHUF-ETH _addPool(0x9720Bcf5a92542D4e286792fc978B63a09731CF0, 0x08538213596fB2c392e9c5d4935ad37645600a57); // OTBC-ETH _addPool(0xEEF9f339514298C6A857EfCfC1A762aF84438dEE, 0x23d15EDceb5B5B3A23347Fa425846DE80a2E8e5C); // HEZ-ETH // These beaches will be manually added after their teams make the 25 ETH donation // _addPool(0x6F87D756DAf0503d08Eb8993686c7Fc01Dc44fB1, 0xd2E0C4928789e5DB620e53af29F5fC7bcA262635); // TRADE-ETH } // Get the pending SURFs for a user from 1 pool function _pendingSurf(uint256 _pid, address _user) internal view returns (uint256) { if (_pid == 0 && surfPoolActive != true) return 0; PoolInfo memory pool = poolInfo[_pid]; UserInfo memory user = userInfo[_pid][_user]; uint256 accSurfPerShare = pool.accSurfPerShare; uint256 lpSupply = _getPoolSupply(_pid); if (block.number > pool.lastSurfRewardBlock && lpSupply != 0) { uint256 surfReward = _calculateSurfReward(_pid, lpSupply); // Make sure that surfReward won't push the total supply of SURF past surf.MAX_SUPPLY() uint256 surfTotalSupply = surf.totalSupply(); if (surfTotalSupply.add(surfReward) >= surf.MAX_SUPPLY()) { surfReward = surf.MAX_SUPPLY().sub(surfTotalSupply); } accSurfPerShare = accSurfPerShare.add(surfReward.mul(1e12).div(lpSupply)); } return user.staked.mul(accSurfPerShare).div(1e12).sub(user.rewardDebt); } // Get the pending UNIs for a user from 1 pool function _pendingUni(uint256 _pid, address _user) internal view returns (uint256) { PoolInfo memory pool = poolInfo[_pid]; UserInfo memory user = userInfo[_pid][_user]; uint256 accUniPerShare = pool.accUniPerShare; uint256 lpSupply = _getPoolSupply(_pid); if (pool.uniStakeContract != address(0) && lpSupply != 0) { uint256 uniReward = IStakingRewards(pool.uniStakeContract).earned(address(this)); accUniPerShare = accUniPerShare.add(uniReward.mul(1e12).div(lpSupply)); } return user.staked.mul(accUniPerShare).div(1e12).sub(user.uniRewardDebt); } // Calculate the current surfReward for a specific pool function _calculateSurfReward(uint256 _pid, uint256 _lpSupply) internal view returns (uint256 surfReward) { if (surf.maxSupplyHit() != true) { PoolInfo memory pool = poolInfo[_pid]; uint256 multiplier = block.number - pool.lastSurfRewardBlock; // There will be a 1000 block Soft Launch where SURF is minted at a static rate to make things as fair as possible if (block.number < startBlock + SOFT_LAUNCH_DURATION) { // The SURF-ETH pool isn't active until the Uniswap pool is created, which can't happen until at least 500 blocks have passed. Once active, it mints 1000 SURF per block (the same amount of SURF per block as all of the other pools combined) until the Soft Launch ends if (_pid != 0) { // For the first 1000 blocks, give 40 SURF per block to all other pools that have staked LP tokens surfReward = multiplier * SOFT_LAUNCH_SURF_PER_BLOCK; } else if (surfPoolActive == true) { surfReward = multiplier * 25 * SOFT_LAUNCH_SURF_PER_BLOCK; } } else if (_pid != 0 && surfPoolActive != true) { // Keep minting 40 tokens per block since the Soft Launch is over but the SURF-ETH pool still isn't active (would only be due to no one calling the activateSurfPool function) surfReward = multiplier * SOFT_LAUNCH_SURF_PER_BLOCK; } else if (surfPoolActive == true) { // Afterwards, give surfReward based on the pool's fixed APR. // Fast low gas cost way of calculating prices since this can be called every block. uint256 surfPrice = _getSurfPrice(); uint256 lpTokenPrice = 10**18 * 2 * weth.balanceOf(address(pool.lpToken)) / pool.lpToken.totalSupply(); uint256 scaledTotalLiquidityValue = _lpSupply * lpTokenPrice; surfReward = multiplier * ((pool.apr * scaledTotalLiquidityValue / surfPrice) / APPROX_BLOCKS_PER_YEAR) / 100; } } } function poolLength() external view returns (uint256) { return poolInfo.length; } // Internal view function to get all of the stored data for a single pool function _getPoolData(uint256 _pid) internal view returns (address, address, bool, uint256, uint256, uint256, uint256) { PoolInfo memory pool = poolInfo[_pid]; return (address(pool.token), address(pool.lpToken), pool.uniStakeContract != address(0), pool.apr, pool.lastSurfRewardBlock, pool.accSurfPerShare, pool.accUniPerShare); } // View function to see all of the stored data for every pool on the frontend function _getAllPoolData() internal view returns (address[] memory, address[] memory, bool[] memory, uint[] memory, uint[] memory, uint[2][] memory) { uint256 length = poolInfo.length; address[] memory tokenData = new address[](length); address[] memory lpTokenData = new address[](length); bool[] memory isUniData = new bool[](length); uint[] memory aprData = new uint[](length); uint[] memory lastSurfRewardBlockData = new uint[](length); uint[2][] memory accTokensPerShareData = new uint[2][](length); for (uint256 pid = 0; pid < length; ++pid) { (tokenData[pid], lpTokenData[pid], isUniData[pid], aprData[pid], lastSurfRewardBlockData[pid], accTokensPerShareData[pid][0], accTokensPerShareData[pid][1]) = _getPoolData(pid); } return (tokenData, lpTokenData, isUniData, aprData, lastSurfRewardBlockData, accTokensPerShareData); } // Internal view function to get all of the extra data for a single pool function _getPoolMetadataFor(uint256 _pid, address _user, uint256 _surfPrice) internal view returns (uint[17] memory poolMetadata) { PoolInfo memory pool = poolInfo[_pid]; uint256 totalSupply; uint256 totalLPSupply; uint256 stakedLPSupply; uint256 tokenPrice; uint256 lpTokenPrice; uint256 totalLiquidityValue; uint256 surfPerBlock; if (_pid != 0 || surfPoolActive == true) { totalSupply = pool.token.totalSupply(); totalLPSupply = pool.lpToken.totalSupply(); stakedLPSupply = _getPoolSupply(_pid); tokenPrice = 10**uint256(pool.token.decimals()) * weth.balanceOf(address(pool.lpToken)) / pool.token.balanceOf(address(pool.lpToken)); lpTokenPrice = 10**18 * 2 * weth.balanceOf(address(pool.lpToken)) / totalLPSupply; totalLiquidityValue = stakedLPSupply * lpTokenPrice / 1e18; } // Only calculate with fixed apr after the Soft Launch if (block.number >= startBlock + SOFT_LAUNCH_DURATION) { surfPerBlock = ((pool.apr * 1e18 * totalLiquidityValue / _surfPrice) / APPROX_BLOCKS_PER_YEAR) / 100; } else { if (_pid != 0) { surfPerBlock = SOFT_LAUNCH_SURF_PER_BLOCK; } else if (surfPoolActive == true) { surfPerBlock = 25 * SOFT_LAUNCH_SURF_PER_BLOCK; } } // Global pool information poolMetadata[0] = totalSupply; poolMetadata[1] = totalLPSupply; poolMetadata[2] = stakedLPSupply; poolMetadata[3] = tokenPrice; poolMetadata[4] = lpTokenPrice; poolMetadata[5] = totalLiquidityValue; poolMetadata[6] = surfPerBlock; poolMetadata[7] = pool.token.decimals(); // User pool information if (_pid != 0 || surfPoolActive == true) { UserInfo memory _userInfo = userInfo[_pid][_user]; poolMetadata[8] = pool.token.balanceOf(_user); poolMetadata[9] = pool.token.allowance(_user, address(this)); poolMetadata[10] = pool.lpToken.balanceOf(_user); poolMetadata[11] = pool.lpToken.allowance(_user, address(this)); poolMetadata[12] = _userInfo.staked; poolMetadata[13] = _pendingSurf(_pid, _user); poolMetadata[14] = _pendingUni(_pid, _user); poolMetadata[15] = _userInfo.claimed; poolMetadata[16] = _userInfo.uniClaimed; } } // View function to see all of the extra pool data (token prices, total staked supply, total liquidity value, etc) on the frontend function _getAllPoolMetadataFor(address _user) internal view returns (uint[17][] memory allMetadata) { uint256 length = poolInfo.length; // Extra data for the frontend allMetadata = new uint[17][](length); // We'll need the current SURF price to make our calculations uint256 surfPrice = _getSurfPrice(); for (uint256 pid = 0; pid < length; ++pid) { allMetadata[pid] = _getPoolMetadataFor(pid, _user, surfPrice); } } // View function to see all of the data for all pools on the frontend function getAllPoolInfoFor(address _user) external view returns (address[] memory tokens, address[] memory lpTokens, bool[] memory isUnis, uint[] memory aprs, uint[] memory lastSurfRewardBlocks, uint[2][] memory accTokensPerShares, uint[17][] memory metadatas) { (tokens, lpTokens, isUnis, aprs, lastSurfRewardBlocks, accTokensPerShares) = _getAllPoolData(); metadatas = _getAllPoolMetadataFor(_user); } // Internal view function to get the current price of SURF on Uniswap function _getSurfPrice() internal view returns (uint256 surfPrice) { uint256 surfBalance = surf.balanceOf(surfPoolAddress); if (surfBalance > 0) { surfPrice = 10**18 * weth.balanceOf(surfPoolAddress) / surfBalance; } } // View function to show all relevant platform info on the frontend function getAllInfoFor(address _user) external view returns (bool poolActive, uint256[8] memory info) { poolActive = surfPoolActive; info[0] = blocksUntilLaunch(); info[1] = blocksUntilSurfPoolCanBeActivated(); info[2] = blocksUntilSoftLaunchEnds(); info[3] = surf.totalSupply(); info[4] = _getSurfPrice(); if (surfPoolActive) { info[5] = IERC20(surfPoolAddress).balanceOf(address(surf)); } info[6] = surfSentToWhirlpool; info[7] = surf.balanceOf(_user); } // View function to see the number of blocks remaining until launch on the frontend function blocksUntilLaunch() public view returns (uint256) { if (block.number >= startBlock) return 0; else return startBlock.sub(block.number); } // View function to see the number of blocks remaining until the SURF pool can be activated on the frontend function blocksUntilSurfPoolCanBeActivated() public view returns (uint256) { uint256 surfPoolActivationBlock = startBlock + SOFT_LAUNCH_DURATION.div(2); if (block.number >= surfPoolActivationBlock) return 0; else return surfPoolActivationBlock.sub(block.number); } // View function to see the number of blocks remaining until the Soft Launch ends on the frontend function blocksUntilSoftLaunchEnds() public view returns (uint256) { uint256 softLaunchEndBlock = startBlock + SOFT_LAUNCH_DURATION; if (block.number >= softLaunchEndBlock) return 0; else return softLaunchEndBlock.sub(block.number); } // Update reward variables for all pools. Be careful of gas spending! function massUpdatePools() public { uint256 length = poolInfo.length; for (uint256 pid = (surfPoolActive == true ? 0 : 1); pid < length; ++pid) { updatePool(pid); } } // Update reward variables of the given pool to be up-to-date. function updatePool(uint256 _pid) public { require(msg.sender == tx.origin || msg.sender == owner() || contractWhitelist[msg.sender] == true, "no contracts"); // Prevent flash loan attacks that manipulate prices. PoolInfo storage pool = poolInfo[_pid]; uint256 lpSupply = _getPoolSupply(_pid); // Handle the UNI staking rewards contract for the LP token if one exists. // The SURF-ETH pool would break by using the UNI staking rewards contract if one is made for it so it will be ignored if (_pid != 0) { // Check to see if the LP token has a UNI staking rewards contract to forward deposits to so that users can earn both SURF and UNI if (pool.uniStakeContract == address(0)) { (address uniStakeContract,) = uniStakingFactory.stakingRewardsInfoByStakingToken(address(pool.lpToken)); // If a UNI staking rewards contract exists then transfer all of the LP tokens to it to start earning UNI if (uniStakeContract != address(0)) { pool.uniStakeContract = uniStakeContract; if (lpSupply > 0) { pool.lpToken.safeApprove(uniStakeContract, 0); pool.lpToken.approve(uniStakeContract, lpSupply); IStakingRewards(pool.uniStakeContract).stake(lpSupply); } } } // A UNI staking rewards contract for this LP token is being used so get any pending UNI rewards if (pool.uniStakeContract != address(0)) { uint256 pendingUniTokens = IStakingRewards(pool.uniStakeContract).earned(address(this)); if (pendingUniTokens > 0) { uint256 uniBalanceBefore = uniToken.balanceOf(address(this)); IStakingRewards(pool.uniStakeContract).getReward(); uint256 uniBalanceAfter = uniToken.balanceOf(address(this)); pendingUniTokens = uniBalanceAfter.sub(uniBalanceBefore); pool.accUniPerShare = pool.accUniPerShare.add(pendingUniTokens.mul(1e12).div(lpSupply)); } } } // Only update the pool if the max SURF supply hasn't been hit if (surf.maxSupplyHit() != true) { if ((block.number <= pool.lastSurfRewardBlock) || (_pid == 0 && surfPoolActive != true)) { return; } if (lpSupply == 0) { pool.lastSurfRewardBlock = block.number; return; } uint256 surfReward = _calculateSurfReward(_pid, lpSupply); // Make sure that surfReward won't push the total supply of SURF past surf.MAX_SUPPLY() uint256 surfTotalSupply = surf.totalSupply(); if (surfTotalSupply.add(surfReward) >= surf.MAX_SUPPLY()) { surfReward = surf.MAX_SUPPLY().sub(surfTotalSupply); } // surf.mint(devAddress, surfReward.div(10)); Not minting 10% to the devs like Sushi, Sashimi, and Takeout do if (surfReward > 0) { surf.mint(address(this), surfReward); pool.accSurfPerShare = pool.accSurfPerShare.add(surfReward.mul(1e12).div(lpSupply)); pool.lastSurfRewardBlock = block.number; } if (surf.maxSupplyHit() == true) { whirlpool.activate(); } } } // Internal view function to get the amount of LP tokens staked in the specified pool function _getPoolSupply(uint256 _pid) internal view returns (uint256 lpSupply) { PoolInfo memory pool = poolInfo[_pid]; if (pool.uniStakeContract != address(0)) { lpSupply = IStakingRewards(pool.uniStakeContract).balanceOf(address(this)); } else { lpSupply = pool.lpToken.balanceOf(address(this)); } } // Deposits LP tokens in the specified pool to start earning the user SURF function deposit(uint256 _pid, uint256 _amount) external { depositFor(_pid, msg.sender, _amount); } // Deposits LP tokens in the specified pool on behalf of another user function depositFor(uint256 _pid, address _user, uint256 _amount) public { require(msg.sender == tx.origin || contractWhitelist[msg.sender] == true, "no contracts"); require(surf.maxSupplyHit() != true, "pools closed"); require(_pid != 0 || surfPoolActive == true, "surf pool not active"); require(_amount > 0, "deposit something"); updatePool(_pid); PoolInfo storage pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; // The sender needs to give approval to the Tito contract for the specified amount of the LP token first pool.lpToken.safeTransferFrom(address(msg.sender), address(this), _amount); // Claim any pending SURF and UNI _claimRewardsFromPool(_pid, _user); // Each pool has a 10% staking fee. If staking in the SURF-ETH pool, 100% of the fee gets permanently locked in the SURF contract (gives SURF liquidity forever). // If staking in any other pool, 50% of the fee is used to buyback SURF which is sent to the Whirlpool staking contract where it will start getting distributed to stakers after the max supply is hit, and 50% goes to the team. // The team is never minted or rewarded SURF for any reason to keep things as fair as possible. uint256 stakingFeeAmount = _amount.div(10); uint256 remainingUserAmount = _amount.sub(stakingFeeAmount); // If a UNI staking rewards contract is available, use it if (pool.uniStakeContract != address(0)) { pool.lpToken.safeApprove(pool.uniStakeContract, 0); pool.lpToken.approve(pool.uniStakeContract, remainingUserAmount); IStakingRewards(pool.uniStakeContract).stake(remainingUserAmount); } // The user is depositing to the SURF-ETH pool so permanently lock all of the LP tokens from the staking fee in the SURF contract if (_pid == 0) { pool.lpToken.transfer(address(surf), stakingFeeAmount); } else { // Remove the liquidity from the pool uint256 deadline = block.timestamp + 5 minutes; pool.lpToken.approve(address(uniswapRouter), stakingFeeAmount); uniswapRouter.removeLiquidityETHSupportingFeeOnTransferTokens(address(pool.token), stakingFeeAmount, 0, 0, address(this), deadline); // Swap the ERC-20 token for ETH uint256 ethBalanceBeforeSwap = address(this).balance; uint256 tokensToSwap = pool.token.balanceOf(address(this)); require(tokensToSwap > 0, "bad token swap"); address[] memory poolPath = new address[](2); poolPath[0] = address(pool.token); poolPath[1] = address(weth); pool.token.approve(address(uniswapRouter), tokensToSwap); uniswapRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(tokensToSwap, 0, poolPath, address(this), deadline); uint256 ethBalanceAfterSwap = address(this).balance; uint256 ethReceivedFromStakingFee; uint256 teamFeeAmount; // If surfPoolActive == true then perform a buyback of SURF using all of the ETH in the contract and then send it to the Whirlpool staking contract. Otherwise, the ETH will be used to seed the initial liquidity in the SURF-ETH Uniswap pool when activateSurfPool is called if (surfPoolActive == true) { require(ethBalanceAfterSwap > 0, "bad eth swap"); teamFeeAmount = ethBalanceAfterSwap.div(2); ethReceivedFromStakingFee = ethBalanceAfterSwap.sub(teamFeeAmount); // The SURF-ETH pool is active, so let's use the ETH to buyback SURF and send it to the Whirlpool staking contract uint256 surfBought = _buySurf(ethReceivedFromStakingFee); // Send the SURF rewards to the Whirlpool staking contract surfSentToWhirlpool += surfBought; _safeSurfTransfer(address(whirlpool), surfBought); } else { ethReceivedFromStakingFee = ethBalanceAfterSwap.sub(ethBalanceBeforeSwap); require(ethReceivedFromStakingFee > 0, "bad eth swap"); teamFeeAmount = ethReceivedFromStakingFee.div(2); } if (teamFeeAmount > 0) devAddress.transfer(teamFeeAmount); } // Add the remaining amount to the user's staked balance uint256 _currentRewardDebt = 0; uint256 _currentUniRewardDebt = 0; if (surfPoolActive != true) { _currentRewardDebt = user.staked.mul(pool.accSurfPerShare).div(1e12).sub(user.rewardDebt); _currentUniRewardDebt = user.staked.mul(pool.accUniPerShare).div(1e12).sub(user.uniRewardDebt); } user.staked = user.staked.add(remainingUserAmount); user.rewardDebt = user.staked.mul(pool.accSurfPerShare).div(1e12).sub(_currentRewardDebt); user.uniRewardDebt = user.staked.mul(pool.accUniPerShare).div(1e12).sub(_currentUniRewardDebt); emit Deposit(_user, _pid, _amount); } // Internal function that buys back SURF with the amount of ETH specified function _buySurf(uint256 _amount) internal returns (uint256 surfBought) { uint256 ethBalance = address(this).balance; if (_amount > ethBalance) _amount = ethBalance; if (_amount > 0) { uint256 deadline = block.timestamp + 5 minutes; address[] memory surfPath = new address[](2); surfPath[0] = address(weth); surfPath[1] = address(surf); uint256[] memory amounts = uniswapRouter.swapExactETHForTokens{value: _amount}(0, surfPath, address(this), deadline); surfBought = amounts[1]; } if (surfBought > 0) emit SurfBuyback(msg.sender, _amount, surfBought); } // Internal function to claim earned SURF and UNI from Tito. Claiming won't work until surfPoolActive == true function _claimRewardsFromPool(uint256 _pid, address _user) internal { PoolInfo memory pool = poolInfo[_pid]; UserInfo storage user = userInfo[_pid][_user]; if (surfPoolActive != true || user.staked == 0) return; uint256 userUniPending = user.staked.mul(pool.accUniPerShare).div(1e12).sub(user.uniRewardDebt); uint256 uniBalance = uniToken.balanceOf(address(this)); if (userUniPending > uniBalance) userUniPending = uniBalance; if (userUniPending > 0) { user.uniClaimed += userUniPending; uniToken.transfer(_user, userUniPending); } uint256 userSurfPending = user.staked.mul(pool.accSurfPerShare).div(1e12).sub(user.rewardDebt); if (userSurfPending > 0) { user.claimed += userSurfPending; _safeSurfTransfer(_user, userSurfPending); } if (userSurfPending > 0 || userUniPending > 0) { emit Claim(_user, _pid, userSurfPending, userUniPending); } } // Claim all earned SURF and UNI from a single pool. Claiming won't work until surfPoolActive == true function claim(uint256 _pid) public { require(surfPoolActive == true, "surf pool not active"); updatePool(_pid); _claimRewardsFromPool(_pid, msg.sender); UserInfo storage user = userInfo[_pid][msg.sender]; PoolInfo memory pool = poolInfo[_pid]; user.rewardDebt = user.staked.mul(pool.accSurfPerShare).div(1e12); user.uniRewardDebt = user.staked.mul(pool.accUniPerShare).div(1e12); } // Claim all earned SURF and UNI from all pools. Claiming won't work until surfPoolActive == true function claimAll() public { require(surfPoolActive == true, "surf pool not active"); uint256 totalPendingSurfAmount = 0; uint256 totalPendingUniAmount = 0; uint256 length = poolInfo.length; for (uint256 pid = 0; pid < length; ++pid) { UserInfo storage user = userInfo[pid][msg.sender]; if (user.staked > 0) { updatePool(pid); PoolInfo storage pool = poolInfo[pid]; uint256 accSurfPerShare = pool.accSurfPerShare; uint256 accUniPerShare = pool.accUniPerShare; uint256 pendingPoolSurfRewards = user.staked.mul(accSurfPerShare).div(1e12).sub(user.rewardDebt); user.claimed += pendingPoolSurfRewards; totalPendingSurfAmount = totalPendingSurfAmount.add(pendingPoolSurfRewards); user.rewardDebt = user.staked.mul(accSurfPerShare).div(1e12); uint256 pendingPoolUniRewards = user.staked.mul(accUniPerShare).div(1e12).sub(user.uniRewardDebt); user.uniClaimed += pendingPoolUniRewards; totalPendingUniAmount = totalPendingUniAmount.add(pendingPoolUniRewards); user.uniRewardDebt = user.staked.mul(accUniPerShare).div(1e12); } } require(totalPendingSurfAmount > 0 || totalPendingUniAmount > 0, "nothing to claim"); uint256 uniBalance = uniToken.balanceOf(address(this)); if (totalPendingUniAmount > uniBalance) totalPendingUniAmount = uniBalance; if (totalPendingUniAmount > 0) uniToken.transfer(msg.sender, totalPendingUniAmount); if (totalPendingSurfAmount > 0) _safeSurfTransfer(msg.sender, totalPendingSurfAmount); emit ClaimAll(msg.sender, totalPendingSurfAmount, totalPendingUniAmount); } // Withdraw LP tokens and earned SURF from Tito. Withdrawing won't work until surfPoolActive == true function withdraw(uint256 _pid, uint256 _amount) public { require(surfPoolActive == true, "surf pool not active"); UserInfo storage user = userInfo[_pid][msg.sender]; require(_amount > 0 && user.staked >= _amount, "withdraw: not good"); updatePool(_pid); // Claim any pending SURF and UNI _claimRewardsFromPool(_pid, msg.sender); PoolInfo memory pool = poolInfo[_pid]; // If a UNI staking rewards contract is in use, withdraw from it if (pool.uniStakeContract != address(0)) { IStakingRewards(pool.uniStakeContract).withdraw(_amount); } user.staked = user.staked.sub(_amount); user.rewardDebt = user.staked.mul(pool.accSurfPerShare).div(1e12); user.uniRewardDebt = user.staked.mul(pool.accUniPerShare).div(1e12); pool.lpToken.safeTransfer(address(msg.sender), _amount); emit Withdraw(msg.sender, _pid, _amount); } // Convenience function to allow users to migrate all of their staked SURF-ETH LP tokens from Tito to the Whirlpool staking contract after the max supply is hit. Migrating won't work until whirlpool.active() == true function migrateSURFLPtoWhirlpool() public { require(whirlpool.active() == true, "whirlpool not active"); UserInfo storage user = userInfo[0][msg.sender]; uint256 amountToMigrate = user.staked; require(amountToMigrate > 0, "migrate: not good"); updatePool(0); // Claim any pending SURF _claimRewardsFromPool(0, msg.sender); user.staked = 0; user.rewardDebt = 0; poolInfo[0].lpToken.approve(address(whirlpool), amountToMigrate); whirlpool.stakeFor(msg.sender, amountToMigrate); emit Withdraw(msg.sender, 0, amountToMigrate); } // Withdraw without caring about rewards. EMERGENCY ONLY. function emergencyWithdraw(uint256 _pid) public { UserInfo storage user = userInfo[_pid][msg.sender]; uint256 staked = user.staked; require(staked > 0, "no tokens"); PoolInfo memory pool = poolInfo[_pid]; // If a UNI staking rewards contract is in use, withdraw from it if (pool.uniStakeContract != address(0)) { IStakingRewards(pool.uniStakeContract).withdraw(staked); } user.staked = 0; user.rewardDebt = 0; user.uniRewardDebt = 0; pool.lpToken.safeTransfer(address(msg.sender), staked); emit EmergencyWithdraw(msg.sender, _pid, staked); } // Internal function to safely transfer SURF in case there is a rounding error function _safeSurfTransfer(address _to, uint256 _amount) internal { uint256 surfBalance = surf.balanceOf(address(this)); if (_amount > surfBalance) _amount = surfBalance; surf.transfer(_to, _amount); } // Creates the SURF-ETH Uniswap pool and adds the initial liqudity that will be permanently locked. Can be called by anyone, but no sooner than 500 blocks after launch. function activateSurfPool() public { require(surfPoolActive == false, "already active"); require(block.number > startBlock + SOFT_LAUNCH_DURATION.div(2), "too soon"); uint256 initialEthLiquidity = address(this).balance; require(initialEthLiquidity > 0, "need ETH"); massUpdatePools(); // The ETH raised from the staking fees collected before surfPoolActive == true is used to seed the ETH side of the SURF-ETH Uniswap pool. // This means that the higher the staking volume during the first 500 blocks, the higher the initial price of SURF if (donatedETH > 0 && donatedETH < initialEthLiquidity) initialEthLiquidity = initialEthLiquidity.sub(donatedETH); // Mint 1,000,000 new SURF to seed the SURF liquidity in the SURF-ETH Uniswap pool uint256 initialSurfLiquidity = 1000000 * 10**18; surf.mint(address(this), initialSurfLiquidity); // Add the liquidity to the SURF-ETH Uniswap pool surf.approve(address(uniswapRouter), initialSurfLiquidity); ( , , uint256 lpTokensReceived) = uniswapRouter.addLiquidityETH{value: initialEthLiquidity}(address(surf), initialSurfLiquidity, 0, 0, address(this), block.timestamp + 5 minutes); // Activate the SURF-ETH pool initialSurfPoolETH = initialEthLiquidity; surfPoolActive = true; // Permanently lock the LP tokens in the SURF contract IERC20(surfPoolAddress).transfer(address(surf), lpTokensReceived); // Buy SURF with all of the donatedETH from partner projects. This SURF will be sent to the Whirlpool staking contract and will start getting distributed to all stakers when the max supply is hit uint256 donatedAmount = donatedETH; uint256 ethBalance = address(this).balance; if (donatedAmount > ethBalance) donatedAmount = ethBalance; if (donatedAmount > 0) { uint256 surfBought = _buySurf(donatedAmount); // Send the SURF rewards to the Whirlpool staking contract surfSentToWhirlpool += surfBought; _safeSurfTransfer(address(whirlpool), surfBought); donatedETH = 0; } emit SurfPoolActive(msg.sender, initialSurfLiquidity, initialEthLiquidity); } // For use by partner teams that are donating to the SURF community. The funds will be used to purchase SURF tokens which will be distributed to stakers once the max supply is hit function donate(address _lpToken) public payable { require(msg.value >= minimumDonationAmount); require(donaters[_lpToken] == address(0)); donatedETH = donatedETH.add(msg.value); donaters[_lpToken] = msg.sender; donations[_lpToken] = msg.value; } // For use by partner teams that donated to the SURF community. The funds can be removed if a beach wasn't created for the specified lp token (meaning the SURF team didn't hold up their end of the agreement) function removeDonation(address _lpToken) public { require(block.number < startBlock); // Donations can only be removed if the beach hasn't been added by the startBlock address returnAddress = donaters[_lpToken]; require(msg.sender == returnAddress); uint256 donationAmount = donations[_lpToken]; require(donationAmount > 0); uint256 ethBalance = address(this).balance; require(donationAmount <= ethBalance); // Only refund the donation if the beach wasn't created require(existingPools[_lpToken] != true); donatedETH = donatedETH.sub(donationAmount); donaters[_lpToken] = address(0); donations[_lpToken] = 0; msg.sender.transfer(donationAmount); } ////////////////////////// // Governance Functions // ////////////////////////// // The following functions can only be called by the owner (the SURF token holder governance contract) // Sets the address of the Whirlpool staking contract that bought SURF gets sent to for distribution to stakers once the max supply is hit function setWhirlpoolContract(Whirlpool _whirlpool) public onlyOwner { whirlpool = _whirlpool; } // Add a new LP Token pool function addPool(address _token, address _lpToken, uint256 _apr, bool _requireDonation) public onlyOwner { require(surf.maxSupplyHit() != true); require(existingPools[_lpToken] != true, "pool exists"); require(_requireDonation != true || donations[_lpToken] >= minimumDonationAmount, "must donate"); _addPool(_token, _lpToken); if (_apr != DEFAULT_APR) poolInfo[poolInfo.length-1].apr = _apr; } // Update the given pool's APR function setApr(uint256 _pid, uint256 _apr) public onlyOwner { require(surf.maxSupplyHit() != true); updatePool(_pid); poolInfo[_pid].apr = _apr; } // Add a contract to the whitelist so that it can interact with Tito. This is needed for the Aegis pool contract to be able to stake on behalf of everyone in the pool. // We want limited interaction from contracts due to the growing "flash loan" trend that can be used to dramatically manipulate a token's price in a single block. function addToWhitelist(address _contractAddress) public onlyOwner { contractWhitelist[_contractAddress] = true; } // Remove a contract from the whitelist function removeFromWhitelist(address _contractAddress) public onlyOwner { contractWhitelist[_contractAddress] = false; } }
pragma solidity ^0.6.12; interface StakingRewardsFactory { function stakingRewardsInfoByStakingToken(address) external view returns (address, uint256); } interface IStakingRewards { // Views function lastTimeRewardApplicable() external view returns (uint256); function rewardPerToken() external view returns (uint256); function earned(address account) external view returns (uint256); function getRewardForDuration() external view returns (uint256); function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); // Mutative function stake(uint256 amount) external; function withdraw(uint256 amount) external; function getReward() external; function exit() external; }
/* _____ __ ______ ______ ___________ _____ _ ______________ / ___// / / / __ \/ ____/ / ____/ _/ | / / | / | / / ____/ ____/ \__ \/ / / / /_/ / /_ / /_ / // |/ / /| | / |/ / / / __/ ___/ / /_/ / _, _/ __/ _ / __/ _/ // /| / ___ |/ /| / /___/ /___ /____/\____/_/ |_/_/ (_) /_/ /___/_/ |_/_/ |_/_/ |_/\____/_____/ Website: https://surf.finance Created by Proof and sol_dev, with help from Zoma and Mr Fahrenheit Audited by Aegis DAO and Sherlock Security */ pragma solidity ^0.6.12; import './Ownable.sol'; import './SafeMath.sol'; import './SafeERC20.sol'; import './IERC20.sol'; import './IUniswapV2Router02.sol'; import './SURF.sol'; import './Tito.sol'; // The Whirlpool staking contract becomes active after the max supply it hit, and is where SURF-ETH LP token stakers will continue to receive dividends from other projects in the SURF ecosystem contract Whirlpool is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user struct UserInfo { uint256 staked; // How many SURF-ETH LP tokens the user has staked uint256 rewardDebt; // Reward debt. Works the same as in the Tito contract uint256 claimed; // Tracks the amount of SURF claimed by the user } // The SURF TOKEN! SURF public surf; // The Tito contract Tito public tito; // The SURF-ETH Uniswap LP token IERC20 public surfPool; // The Uniswap v2 Router IUniswapV2Router02 public uniswapRouter = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); // WETH IERC20 public weth; // Info of each user that stakes SURF-ETH LP tokens mapping (address => UserInfo) public userInfo; // The amount of SURF sent to this contract before it became active uint256 public initialSurfReward = 0; // 1% of the initialSurfReward will be rewarded to stakers per day for 100 days uint256 public initialSurfRewardPerDay; // How often the initial 1% payouts can be processed uint256 public constant INITIAL_PAYOUT_INTERVAL = 24 hours; // The unstaking fee that is used to increase locked liquidity and reward Whirlpool stakers (1 = 0.1%). Defaults to 10% uint256 public unstakingFee = 100; // The amount of SURF-ETH LP tokens kept by the unstaking fee that will be converted to SURF and distributed to stakers (1 = 0.1%). Defaults to 50% uint256 public unstakingFeeConvertToSurfAmount = 500; // When the first 1% payout can be processed (timestamp). It will be 24 hours after the Whirlpool contract is activated uint256 public startTime; // When the last 1% payout was processed (timestamp) uint256 public lastPayout; // The total amount of pending SURF available for stakers to claim uint256 public totalPendingSurf; // Accumulated SURFs per share, times 1e12. uint256 public accSurfPerShare; // The total amount of SURF-ETH LP tokens staked in the contract uint256 public totalStaked; // Becomes true once the 'activate' function called by the Tito contract when the max SURF supply is hit bool public active = false; event Stake(address indexed user, uint256 amount); event Claim(address indexed user, uint256 surfAmount); event Withdraw(address indexed user, uint256 amount); event SurfRewardAdded(address indexed user, uint256 surfReward); event EthRewardAdded(address indexed user, uint256 ethReward); constructor(SURF _surf, Tito _tito) public { tito = _tito; surf = _surf; surfPool = IERC20(tito.surfPoolAddress()); weth = IERC20(uniswapRouter.WETH()); } receive() external payable { emit EthRewardAdded(msg.sender, msg.value); } function activate() public { require(active != true, "already active"); require(surf.maxSupplyHit() == true, "too soon"); active = true; // Now that the Whirlpool staking contract is active, reward 1% of the initialSurfReward per day for 100 days startTime = block.timestamp + INITIAL_PAYOUT_INTERVAL; // The first payout can be processed 24 hours after activation lastPayout = startTime; initialSurfRewardPerDay = initialSurfReward.div(100); } // The _transfer function in the SURF contract calls this to let the Whirlpool contract know that it received the specified amount of SURF to be distributed to stakers function addSurfReward(address _from, uint256 _amount) public { require(msg.sender == address(surf), "not surf contract"); require(tito.surfPoolActive() == true, "no surf pool"); require(_amount > 0, "no surf"); if (active != true || totalStaked == 0) { initialSurfReward = initialSurfReward.add(_amount); } else { totalPendingSurf = totalPendingSurf.add(_amount); accSurfPerShare = accSurfPerShare.add(_amount.mul(1e12).div(totalStaked)); } emit SurfRewardAdded(_from, _amount); } // Allows external sources to add ETH to the contract which is used to buy and then distribute SURF to stakers function addEthReward() public payable { require(tito.surfPoolActive() == true, "no surf pool"); // We will purchase SURF with all of the ETH in the contract in case some was sent directly to the contract instead of using addEthReward uint256 ethBalance = address(this).balance; require(ethBalance > 0, "no eth"); // Use the ETH to buyback SURF which will be distributed to stakers _buySurf(ethBalance); // The _transfer function in the SURF contract calls the Whirlpool contract's updateSurfReward function so we don't need to update the balances after buying the SURF emit EthRewardAdded(msg.sender, msg.value); } // Internal function to buy back SURF with the amount of ETH specified function _buySurf(uint256 _amount) internal { uint256 deadline = block.timestamp + 5 minutes; address[] memory surfPath = new address[](2); surfPath[0] = address(weth); surfPath[1] = address(surf); uniswapRouter.swapExactETHForTokens{value: _amount}(0, surfPath, address(this), deadline); } // Handles paying out the initialSurfReward over 100 days function _processInitialPayouts() internal { if (active != true || block.timestamp < startTime || initialSurfReward == 0 || totalStaked == 0) return; // How many days since last payout? uint256 daysSinceLastPayout = (block.timestamp - lastPayout) / INITIAL_PAYOUT_INTERVAL; // If less than 1, don't do anything if (daysSinceLastPayout == 0) return; // Work out how many payouts have been missed uint256 nextPayoutNumber = (block.timestamp - startTime) / INITIAL_PAYOUT_INTERVAL; uint256 previousPayoutNumber = nextPayoutNumber - daysSinceLastPayout; // Calculate how much additional reward we have to hand out uint256 surfReward = rewardAtPayout(nextPayoutNumber) - rewardAtPayout(previousPayoutNumber); if (surfReward > initialSurfReward) surfReward = initialSurfReward; initialSurfReward = initialSurfReward.sub(surfReward); // Payout the surfReward to the stakers totalPendingSurf = totalPendingSurf.add(surfReward); accSurfPerShare = accSurfPerShare.add(surfReward.mul(1e12).div(totalStaked)); // Update lastPayout time lastPayout += (daysSinceLastPayout * INITIAL_PAYOUT_INTERVAL); } // Handles claiming the user's pending SURF rewards function _claimReward(address _user) internal { UserInfo storage user = userInfo[_user]; if (user.staked > 0) { uint256 pendingSurfReward = user.staked.mul(accSurfPerShare).div(1e12).sub(user.rewardDebt); if (pendingSurfReward > 0) { totalPendingSurf = totalPendingSurf.sub(pendingSurfReward); user.claimed += pendingSurfReward; _safeSurfTransfer(_user, pendingSurfReward); emit Claim(_user, pendingSurfReward); } } } // Stake SURF-ETH LP tokens to get rewarded with more SURF function stake(uint256 _amount) public { stakeFor(msg.sender, _amount); } // Stake SURF-ETH LP tokens on behalf of another address function stakeFor(address _user, uint256 _amount) public { require(active == true, "not active"); require(_amount > 0, "stake something"); _processInitialPayouts(); // Claim any pending SURF _claimReward(_user); surfPool.safeTransferFrom(address(msg.sender), address(this), _amount); UserInfo storage user = userInfo[_user]; totalStaked = totalStaked.add(_amount); user.staked = user.staked.add(_amount); user.rewardDebt = user.staked.mul(accSurfPerShare).div(1e12); emit Stake(_user, _amount); } // Claim earned SURF. Claiming won't work until active == true function claim() public { require(active == true, "not active"); UserInfo storage user = userInfo[msg.sender]; require(user.staked > 0, "no stake"); _processInitialPayouts(); // Claim any pending SURF _claimReward(msg.sender); user.rewardDebt = user.staked.mul(accSurfPerShare).div(1e12); } // Unstake and withdraw SURF-ETH LP tokens and any pending SURF rewards. There is a 10% unstaking fee, meaning the user will only receive 90% of their LP tokens back. // For the LP tokens kept by the unstaking fee, 50% will get locked forever in the SURF contract, and 50% will get converted to SURF and distributed to stakers. function withdraw(uint256 _amount) public { require(active == true, "not active"); UserInfo storage user = userInfo[msg.sender]; require(_amount > 0 && user.staked >= _amount, "withdraw: not good"); _processInitialPayouts(); uint256 unstakingFeeAmount = _amount.mul(unstakingFee).div(1000); uint256 remainingUserAmount = _amount.sub(unstakingFeeAmount); // Half of the LP tokens kept by the unstaking fee will be locked forever in the SURF contract, the other half will be converted to SURF and distributed to stakers uint256 lpTokensToConvertToSurf = unstakingFeeAmount.mul(unstakingFeeConvertToSurfAmount).div(1000); uint256 lpTokensToLock = unstakingFeeAmount.sub(lpTokensToConvertToSurf); // Remove the liquidity from the Uniswap SURF-ETH pool and buy SURF with the ETH received // The _transfer function in the SURF.sol contract automatically calls whirlpool.addSurfReward() so we don't have to in this function if (lpTokensToConvertToSurf > 0) { surfPool.approve(address(uniswapRouter), lpTokensToConvertToSurf); uniswapRouter.removeLiquidityETHSupportingFeeOnTransferTokens(address(surf), lpTokensToConvertToSurf, 0, 0, address(this), block.timestamp + 5 minutes); addEthReward(); } // Permanently lock the LP tokens in the SURF contract if (lpTokensToLock > 0) surfPool.transfer(address(surf), lpTokensToLock); // Claim any pending SURF _claimReward(msg.sender); totalStaked = totalStaked.sub(_amount); user.staked = user.staked.sub(_amount); surfPool.safeTransfer(address(msg.sender), remainingUserAmount); user.rewardDebt = user.staked.mul(accSurfPerShare).div(1e12); emit Withdraw(msg.sender, remainingUserAmount); } // Internal function to safely transfer SURF in case there is a rounding error function _safeSurfTransfer(address _to, uint256 _amount) internal { uint256 surfBal = surf.balanceOf(address(this)); if (_amount > surfBal) { surf.transfer(_to, surfBal); } else { surf.transfer(_to, _amount); } } // Sets the unstaking fee. Can't be higher than 50%. _convertToSurfAmount is the % of the LP tokens from the unstaking fee that will be converted to SURF and distributed to stakers. // unstakingFee - unstakingFeeConvertToSurfAmount = The % of the LP tokens from the unstaking fee that will be permanently locked in the SURF contract function setUnstakingFee(uint256 _unstakingFee, uint256 _convertToSurfAmount) public onlyOwner { require(_unstakingFee <= 500, "over 50%"); require(_convertToSurfAmount <= 1000, "bad amount"); unstakingFee = _unstakingFee; unstakingFeeConvertToSurfAmount = _convertToSurfAmount; } // Function to recover ERC20 tokens accidentally sent to the contract. // SURF and SURF-ETH LP tokens (the only 2 ERC2O's that should be in this contract) can't be withdrawn this way. function recoverERC20(address _tokenAddress) public onlyOwner { require(_tokenAddress != address(surf) && _tokenAddress != address(surfPool)); IERC20 token = IERC20(_tokenAddress); uint256 tokenBalance = token.balanceOf(address(this)); token.transfer(msg.sender, tokenBalance); } function payoutNumber() public view returns (uint256) { if (block.timestamp < startTime) return 0; uint256 payout = (block.timestamp - startTime).div(INITIAL_PAYOUT_INTERVAL); if (payout > 100) return 100; else return payout; } function timeUntilNextPayout() public view returns (uint256) { if (initialSurfReward == 0) return 0; else { uint256 payout = payoutNumber(); uint256 nextPayout = startTime.add((payout + 1).mul(INITIAL_PAYOUT_INTERVAL)); return nextPayout - block.timestamp; } } function rewardAtPayout(uint256 _payoutNumber) public view returns (uint256) { if (_payoutNumber == 0) return 0; return initialSurfRewardPerDay * _payoutNumber; } function getAllInfoFor(address _user) external view returns (bool isActive, uint256[12] memory info) { isActive = active; info[0] = surf.balanceOf(address(this)); info[1] = initialSurfReward; info[2] = totalPendingSurf; info[3] = startTime; info[4] = lastPayout; info[5] = totalStaked; info[6] = surf.balanceOf(_user); if (tito.surfPoolActive()) { info[7] = surfPool.balanceOf(_user); info[8] = surfPool.allowance(_user, address(this)); } info[9] = userInfo[_user].staked; info[10] = userInfo[_user].staked.mul(accSurfPerShare).div(1e12).sub(userInfo[_user].rewardDebt); info[11] = userInfo[_user].claimed; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"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":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"fromDelegate","type":"address"},{"indexed":true,"internalType":"address","name":"toDelegate","type":"address"}],"name":"DelegateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBalance","type":"uint256"}],"name":"DelegateVotesChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DELEGATION_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_addToSenderWhitelist","type":"bool"},{"internalType":"address","name":"_address","type":"address"}],"name":"addToTransferWhitelist","outputs":[],"stateMutability":"nonpayable","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":"address","name":"_spender","type":"address"},{"internalType":"uint256","name":"_tokens","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"approveAndCall","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"address","name":"","type":"address"},{"internalType":"uint32","name":"","type":"uint32"}],"name":"checkpoints","outputs":[{"internalType":"uint32","name":"fromBlock","type":"uint32"},{"internalType":"uint256","name":"votes","type":"uint256"}],"stateMutability":"view","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":"address","name":"delegatee","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"delegateBySig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegator","type":"address"}],"name":"delegates","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getCurrentVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getPriorVotes","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":"maxSupplyHit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"migrateLockedLPTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"numCheckpoints","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"recipientWhitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"_removeFromSenderWhitelist","type":"bool"},{"internalType":"address","name":"_address","type":"address"}],"name":"removeFromTransferWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"senderWhitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_titoAddress","type":"address"},{"internalType":"address payable","name":"_whirlpoolAddress","type":"address"},{"internalType":"address","name":"_surfPoolAddress","type":"address"}],"name":"setContractAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_transferFee","type":"uint256"}],"name":"setTransferFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"surfPoolAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"titoAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"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":"_to","type":"address"},{"internalType":"uint256","name":"_tokens","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"transferAndCall","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"transferFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"whirlpoolAddress","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040526005805460ff60a81b19169055600a6006553480156200002357600080fd5b50604080518082018252600c81526b535552462e46696e616e636560a01b60208083019182528351808501909452600484526329aaa92360e11b908401528151919291620000749160039162000106565b5080516200008a90600490602084019062000106565b50506005805460ff19166012179055506000620000a662000102565b60058054610100600160a81b0319166101006001600160a01b03841690810291909117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350620001a2565b3390565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200014957805160ff191683800117855562000179565b8280016001018555821562000179579182015b82811115620001795782518255916020019190600101906200015c565b50620001879291506200018b565b5090565b5b808211156200018757600081556001016200018c565b61299480620001b26000396000f3fe608060405234801561001057600080fd5b50600436106102485760003560e01c80637ecebe001161013b578063acb2ad6f116100b8578063cae9ca511161007c578063cae9ca51146107b4578063dd62ed3e14610839578063e7a324dc14610867578063f1127ed81461086f578063f2fde38b146108c157610248565b8063acb2ad6f1461072f578063b089fe7214610737578063b41328701461073f578063b4b5ea5714610747578063c3cda5201461076d57610248565b80638f02bb5b116100ff5780638f02bb5b1461068c57806395d89b41146106a9578063a457c2d7146106b1578063a8186558146106dd578063a9059cbb1461070357610248565b80637ecebe00146105d45780638222f07d146105fa57806385a876ae146106205780638ab633801461064c5780638da5cb5b1461068457610248565b806340c10f19116101c95780636fcfff451161018d5780636fcfff451461050d57806370a082311461054c578063715018a614610572578063782d6fe11461057a5780637b2bad2b146105a657610248565b806340c10f19146104695780635208ee0c14610495578063587cde1e146104b95780635c19a95c146104df57806368993aa91461050557610248565b80632666ed0a116102105780632666ed0a14610362578063313ce5671461039257806332cb6b0c146103b057806339509351146103b85780634000aea0146103e457610248565b806306fdde031461024d578063095ea7b3146102ca57806318160ddd1461030a57806320606b701461032457806323b872dd1461032c575b600080fd5b6102556108e7565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561028f578181015183820152602001610277565b50505050905090810190601f1680156102bc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102f6600480360360408110156102e057600080fd5b506001600160a01b03813516906020013561097d565b604080519115158252519081900360200190f35b61031261099b565b60408051918252519081900360200190f35b6103126109a1565b6102f66004803603606081101561034257600080fd5b506001600160a01b038135811691602081013590911690604001356109c5565b6103906004803603604081101561037857600080fd5b508035151590602001356001600160a01b0316610a4c565b005b61039a610afe565b6040805160ff9092168252519081900360200190f35b610312610b07565b6102f6600480360360408110156103ce57600080fd5b506001600160a01b038135169060200135610b16565b6102f6600480360360608110156103fa57600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561042a57600080fd5b82018360208201111561043c57600080fd5b8035906020019184600183028401116401000000008311171561045e57600080fd5b509092509050610b64565b6103906004803603604081101561047f57600080fd5b506001600160a01b038135169060200135610c68565b61049d610d93565b604080516001600160a01b039092168252519081900360200190f35b61049d600480360360208110156104cf57600080fd5b50356001600160a01b0316610da2565b610390600480360360208110156104f557600080fd5b50356001600160a01b0316610dc0565b61049d610dcd565b6105336004803603602081101561052357600080fd5b50356001600160a01b0316610ddc565b6040805163ffffffff9092168252519081900360200190f35b6103126004803603602081101561056257600080fd5b50356001600160a01b0316610df4565b610390610e0f565b6103126004803603604081101561059057600080fd5b506001600160a01b038135169060200135610ebc565b610390600480360360408110156105bc57600080fd5b508035151590602001356001600160a01b03166110c4565b610312600480360360208110156105ea57600080fd5b50356001600160a01b031661117b565b6102f66004803603602081101561061057600080fd5b50356001600160a01b031661118d565b6103906004803603604081101561063657600080fd5b506001600160a01b0381351690602001356111a2565b6103906004803603606081101561066257600080fd5b506001600160a01b038135811691602081013582169160409091013516611351565b61049d611435565b610390600480360360208110156106a257600080fd5b5035611449565b6102556114ec565b6102f6600480360360408110156106c757600080fd5b506001600160a01b03813516906020013561154d565b6102f6600480360360208110156106f357600080fd5b50356001600160a01b03166115b5565b6102f66004803603604081101561071957600080fd5b506001600160a01b0381351690602001356115ca565b6103126115de565b61049d6115e4565b6102f66115f3565b6103126004803603602081101561075d57600080fd5b50356001600160a01b0316611603565b610390600480360360c081101561078357600080fd5b506001600160a01b038135169060208101359060408101359060ff6060820135169060808101359060a00135611667565b6102f6600480360360608110156107ca57600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156107fa57600080fd5b82018360208201111561080c57600080fd5b8035906020019184600183028401116401000000008311171561082e57600080fd5b5090925090506118da565b6103126004803603604081101561084f57600080fd5b506001600160a01b03813581169160200135166119a6565b6103126119d1565b6108a16004803603604081101561088557600080fd5b5080356001600160a01b0316906020013563ffffffff166119f5565b6040805163ffffffff909316835260208301919091528051918290030190f35b610390600480360360208110156108d757600080fd5b50356001600160a01b0316611a22565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109735780601f1061094857610100808354040283529160200191610973565b820191906000526020600020905b81548152906001019060200180831161095657829003601f168201915b5050505050905090565b600061099161098a611b2b565b8484611b2f565b5060015b92915050565b60025490565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b60006109d2848484611c1b565b610a42846109de611b2b565b610a3d85604051806060016040528060288152602001612814602891396001600160a01b038a16600090815260016020526040812090610a1c611b2b565b6001600160a01b031681526020810191909152604001600020549190611faa565b611b2f565b5060019392505050565b610a54611b2b565b60055461010090046001600160a01b03908116911614610aa9576040805162461bcd60e51b8152602060048201819052602482015260008051602061283c833981519152604482015290519081900360640190fd5b60018215151415610ad9576001600160a01b0381166000908152600760205260409020805460ff19169055610afa565b6001600160a01b0381166000908152600860205260409020805460ff191690555b5050565b60055460ff1690565b6a084595161401484a00000081565b6000610991610b23611b2b565b84610a3d8560016000610b34611b2b565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490612041565b600080610b7086610df4565b9050610b7c86866115ca565b50600081610b8988610df4565b039050863b63ffffffff811615610c5a57876001600160a01b0316636be32e73338489896040518563ffffffff1660e01b815260040180856001600160a01b03168152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050602060405180830381600087803b158015610c2557600080fd5b505af1158015610c39573d6000803e3d6000fd5b505050506040513d6020811015610c4f57600080fd5b5051610c5a57600080fd5b506001979650505050505050565b600554600160a81b900460ff16151560011415610cbd576040805162461bcd60e51b815260206004820152600e60248201526d1b585e081cdd5c1c1b1e481a1a5d60921b604482015290519081900360640190fd5b6009546001600160a01b03163314610d07576040805162461bcd60e51b81526020600482015260086024820152676e6f74205469746f60c01b604482015290519081900360640190fd5b6000610d1161099b565b90506a084595161401484a000000610d298284612041565b10610d5957610d436a084595161401484a0000008261209b565b6005805460ff60a81b1916600160a81b17905591505b8115610d8e57610d6983836120dd565b6001600160a01b038084166000908152600c6020526040812054610d8e9216846121cd565b505050565b6009546001600160a01b031681565b6001600160a01b039081166000908152600c60205260409020541690565b610dca338261230a565b50565b600b546001600160a01b031681565b600e6020526000908152604090205463ffffffff1681565b6001600160a01b031660009081526020819052604090205490565b610e17611b2b565b60055461010090046001600160a01b03908116911614610e6c576040805162461bcd60e51b8152602060048201819052602482015260008051602061283c833981519152604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b6000438210610efc5760405162461bcd60e51b81526004018080602001828103825260278152602001806128ed6027913960400191505060405180910390fd5b6001600160a01b0383166000908152600e602052604090205463ffffffff1680610f2a576000915050610995565b6001600160a01b0384166000908152600d6020908152604080832063ffffffff600019860181168552925290912054168310610f99576001600160a01b0384166000908152600d602090815260408083206000199490940163ffffffff16835292905220600101549050610995565b6001600160a01b0384166000908152600d6020908152604080832083805290915290205463ffffffff16831015610fd4576000915050610995565b600060001982015b8163ffffffff168163ffffffff16111561108d57600282820363ffffffff16048103611006612716565b506001600160a01b0387166000908152600d6020908152604080832063ffffffff808616855290835292819020815180830190925280549093168082526001909301549181019190915290871415611068576020015194506109959350505050565b805163ffffffff1687111561107f57819350611086565b6001820392505b5050610fdc565b506001600160a01b0385166000908152600d6020908152604080832063ffffffff9094168352929052206001015491505092915050565b6110cc611b2b565b60055461010090046001600160a01b03908116911614611121576040805162461bcd60e51b8152602060048201819052602482015260008051602061283c833981519152604482015290519081900360640190fd5b60018215151415611154576001600160a01b0381166000908152600760205260409020805460ff19166001179055610afa565b6001600160a01b0381166000908152600860205260409020805460ff191660011790555050565b600f6020526000908152604090205481565b60076020526000908152604090205460ff1681565b6111aa611b2b565b60055461010090046001600160a01b039081169116146111ff576040805162461bcd60e51b8152602060048201819052602482015260008051602061283c833981519152604482015290519081900360640190fd5b600b546001600160a01b0316811580159061128b5750604080516370a0823160e01b815230600482015290516001600160a01b038316916370a08231916024808301926020929190829003018186803b15801561125b57600080fd5b505afa15801561126f573d6000803e3d6000fd5b505050506040513d602081101561128557600080fd5b50518211155b6112c9576040805162461bcd60e51b815260206004820152600a60248201526918985908185b5bdd5b9d60b21b604482015290519081900360640190fd5b806001600160a01b031663a9059cbb84846040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561132057600080fd5b505af1158015611334573d6000803e3d6000fd5b505050506040513d602081101561134a57600080fd5b5050505050565b611359611b2b565b60055461010090046001600160a01b039081169116146113ae576040805162461bcd60e51b8152602060048201819052602482015260008051602061283c833981519152604482015290519081900360640190fd5b6001600160a01b038316156113d957600980546001600160a01b0319166001600160a01b0385161790555b6001600160a01b0382161561140457600a80546001600160a01b0319166001600160a01b0384161790555b6001600160a01b03811615610d8e57600b80546001600160a01b0383166001600160a01b0319909116179055505050565b60055461010090046001600160a01b031690565b611451611b2b565b60055461010090046001600160a01b039081169116146114a6576040805162461bcd60e51b8152602060048201819052602482015260008051602061283c833981519152604482015290519081900360640190fd5b60648111156114e7576040805162461bcd60e51b81526020600482015260086024820152676f7665722031302560c01b604482015290519081900360640190fd5b600655565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109735780601f1061094857610100808354040283529160200191610973565b600061099161155a611b2b565b84610a3d8560405180606001604052806025815260200161293a6025913960016000611584611b2b565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190611faa565b60086020526000908152604090205460ff1681565b60006109916115d7611b2b565b8484611c1b565b60065481565b600a546001600160a01b031681565b600554600160a81b900460ff1681565b6001600160a01b0381166000908152600e602052604081205463ffffffff168061162e576000611660565b6001600160a01b0383166000908152600d6020908152604080832063ffffffff60001986011684529091529020600101545b9392505050565b60007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8666116926108e7565b805190602001206116a161239f565b60408051602080820195909552808201939093526060830191909152306080808401919091528151808403909101815260a0830182528051908401207fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60c08401526001600160a01b038b1660e084015261010083018a90526101208084018a9052825180850390910181526101408401835280519085012061190160f01b6101608501526101628401829052610182808501829052835180860390910181526101a285018085528151918701919091206000918290526101c2860180865281905260ff8b166101e287015261020286018a90526102228601899052935192965090949293909260019261024280840193601f198301929081900390910190855afa1580156117d4573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166118265760405162461bcd60e51b815260040180806020018281038252602681526020018061287e6026913960400191505060405180910390fd5b6001600160a01b0381166000908152600f6020526040902080546001810190915589146118845760405162461bcd60e51b815260040180806020018281038252602281526020018061285c6022913960400191505060405180910390fd5b874211156118c35760405162461bcd60e51b81526004018080602001828103825260268152602001806129146026913960400191505060405180910390fd5b6118cd818b61230a565b505050505b505050505050565b60006118e6858561097d565b50846001600160a01b0316638f4ffcb133863087876040518663ffffffff1660e01b815260040180866001600160a01b03168152602001858152602001846001600160a01b03168152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b15801561198357600080fd5b505af1158015611997573d6000803e3d6000fd5b50600198975050505050505050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b600d6020908152600092835260408084209091529082529020805460019091015463ffffffff9091169082565b611a2a611b2b565b60055461010090046001600160a01b03908116911614611a7f576040805162461bcd60e51b8152602060048201819052602482015260008051602061283c833981519152604482015290519081900360640190fd5b6001600160a01b038116611ac45760405162461bcd60e51b81526004018080602001828103825260268152602001806127516026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b3390565b6001600160a01b038316611b745760405162461bcd60e51b81526004018080602001828103825260248152602001806128c96024913960400191505060405180910390fd5b6001600160a01b038216611bb95760405162461bcd60e51b81526004018080602001828103825260228152602001806127776022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316611c605760405162461bcd60e51b81526004018080602001828103825260258152602001806128a46025913960400191505060405180910390fd5b6001600160a01b038216611ca55760405162461bcd60e51b815260040180806020018281038252602381526020018061272e6023913960400191505060405180910390fd5b6000808215611f5857611cb885856123a3565b1515600114611e0857611ce26103e8611cdc6006548661245390919063ffffffff16565b906124ac565b600a546001600160a01b0316600090815260208190526040902054909250611d0a9083612041565b600a80546001600160a01b03908116600090815260208181526040808320959095558983168252600c9052838120549254821681529290922054611d53929182169116846121cd565b600a5460408051639c8124b160e01b81526001600160a01b0388811660048301526024820186905291519190921691639c8124b191604480830192600092919082900301818387803b158015611da857600080fd5b505af1158015611dbc573d6000803e3d6000fd5b5050600a546040805186815290516001600160a01b03928316945091891692507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35b611e12838361209b565b9050611e51836040518060600160405280602681526020016127cd602691396001600160a01b0388166000908152602081905260409020549190611faa565b6001600160a01b0386166000908152602081905260409020558015611f58576001600160a01b038416600090815260208190526040902054611e939082612041565b6001600160a01b03808616600081815260208181526040808320959095558984168252600c9052838120549181529290922054611ed49282169116836121cd565b600a546001600160a01b0385811691161415611f5857600a5460408051639c8124b160e01b81526001600160a01b0388811660048301526024820185905291519190921691639c8124b191604480830192600092919082900301818387803b158015611f3f57600080fd5b505af1158015611f53573d6000803e3d6000fd5b505050505b836001600160a01b0316856001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050505050565b600081848411156120395760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611ffe578181015183820152602001611fe6565b50505050905090810190601f16801561202b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015611660576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061166083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611faa565b6001600160a01b038216612138576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b61214460008383610d8e565b6002546121519082612041565b6002556001600160a01b0382166000908152602081905260409020546121779082612041565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b816001600160a01b0316836001600160a01b0316141580156121ef5750600081115b15610d8e576001600160a01b03831615612281576001600160a01b0383166000908152600e602052604081205463ffffffff16908161222f576000612261565b6001600160a01b0385166000908152600d6020908152604080832063ffffffff60001987011684529091529020600101545b9050600061226f828561209b565b905061227d868484846124ee565b5050505b6001600160a01b03821615610d8e576001600160a01b0382166000908152600e602052604081205463ffffffff1690816122bc5760006122ee565b6001600160a01b0384166000908152600d6020908152604080832063ffffffff60001987011684529091529020600101545b905060006122fc8285612041565b90506118d2858484846124ee565b6001600160a01b038083166000908152600c60205260408120549091169061233184610df4565b6001600160a01b038581166000818152600c602052604080822080546001600160a01b031916898616908117909155905194955093928616927f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a46123998284836121cd565b50505050565b4690565b600a546000906001600160a01b03848116911614806123cf5750600a546001600160a01b038381169116145b806123e757506009546001600160a01b038481169116145b806123ff57506009546001600160a01b038381169116145b8061242757506001600160a01b03831660009081526007602052604090205460ff1615156001145b806116605750506001600160a01b031660009081526008602052604090205460ff161515600114919050565b60008261246257506000610995565b8282028284828161246f57fe5b04146116605760405162461bcd60e51b81526004018080602001828103825260218152602001806127f36021913960400191505060405180910390fd5b600061166083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612653565b600061251243604051806060016040528060348152602001612799603491396126b8565b905060008463ffffffff1611801561255b57506001600160a01b0385166000908152600d6020908152604080832063ffffffff6000198901811685529252909120548282169116145b15612598576001600160a01b0385166000908152600d6020908152604080832063ffffffff60001989011684529091529020600101829055612609565b60408051808201825263ffffffff808416825260208083018681526001600160a01b038a166000818152600d84528681208b8616825284528681209551865490861663ffffffff199182161787559251600196870155908152600e9092529390208054928801909116919092161790555b604080518481526020810184905281516001600160a01b038816927fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724928290030190a25050505050565b600081836126a25760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611ffe578181015183820152602001611fe6565b5060008385816126ae57fe5b0495945050505050565b600081640100000000841061270e5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611ffe578181015183820152602001611fe6565b509192915050565b60408051808201909152600080825260208201529056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373535552463a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d6265722065786365656473203332206269747345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572535552463a3a64656c656761746542795369673a20696e76616c6964206e6f6e6365535552463a3a64656c656761746542795369673a20696e76616c6964207369676e617475726545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373535552463a3a6765745072696f72566f7465733a206e6f74207965742064657465726d696e6564535552463a3a64656c656761746542795369673a207369676e6174757265206578706972656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220b92b2443241b4136f4d07811e224f2d738b6ae472de9c4e7c2eef7abc67ca03664736f6c634300060c0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102485760003560e01c80637ecebe001161013b578063acb2ad6f116100b8578063cae9ca511161007c578063cae9ca51146107b4578063dd62ed3e14610839578063e7a324dc14610867578063f1127ed81461086f578063f2fde38b146108c157610248565b8063acb2ad6f1461072f578063b089fe7214610737578063b41328701461073f578063b4b5ea5714610747578063c3cda5201461076d57610248565b80638f02bb5b116100ff5780638f02bb5b1461068c57806395d89b41146106a9578063a457c2d7146106b1578063a8186558146106dd578063a9059cbb1461070357610248565b80637ecebe00146105d45780638222f07d146105fa57806385a876ae146106205780638ab633801461064c5780638da5cb5b1461068457610248565b806340c10f19116101c95780636fcfff451161018d5780636fcfff451461050d57806370a082311461054c578063715018a614610572578063782d6fe11461057a5780637b2bad2b146105a657610248565b806340c10f19146104695780635208ee0c14610495578063587cde1e146104b95780635c19a95c146104df57806368993aa91461050557610248565b80632666ed0a116102105780632666ed0a14610362578063313ce5671461039257806332cb6b0c146103b057806339509351146103b85780634000aea0146103e457610248565b806306fdde031461024d578063095ea7b3146102ca57806318160ddd1461030a57806320606b701461032457806323b872dd1461032c575b600080fd5b6102556108e7565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561028f578181015183820152602001610277565b50505050905090810190601f1680156102bc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102f6600480360360408110156102e057600080fd5b506001600160a01b03813516906020013561097d565b604080519115158252519081900360200190f35b61031261099b565b60408051918252519081900360200190f35b6103126109a1565b6102f66004803603606081101561034257600080fd5b506001600160a01b038135811691602081013590911690604001356109c5565b6103906004803603604081101561037857600080fd5b508035151590602001356001600160a01b0316610a4c565b005b61039a610afe565b6040805160ff9092168252519081900360200190f35b610312610b07565b6102f6600480360360408110156103ce57600080fd5b506001600160a01b038135169060200135610b16565b6102f6600480360360608110156103fa57600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561042a57600080fd5b82018360208201111561043c57600080fd5b8035906020019184600183028401116401000000008311171561045e57600080fd5b509092509050610b64565b6103906004803603604081101561047f57600080fd5b506001600160a01b038135169060200135610c68565b61049d610d93565b604080516001600160a01b039092168252519081900360200190f35b61049d600480360360208110156104cf57600080fd5b50356001600160a01b0316610da2565b610390600480360360208110156104f557600080fd5b50356001600160a01b0316610dc0565b61049d610dcd565b6105336004803603602081101561052357600080fd5b50356001600160a01b0316610ddc565b6040805163ffffffff9092168252519081900360200190f35b6103126004803603602081101561056257600080fd5b50356001600160a01b0316610df4565b610390610e0f565b6103126004803603604081101561059057600080fd5b506001600160a01b038135169060200135610ebc565b610390600480360360408110156105bc57600080fd5b508035151590602001356001600160a01b03166110c4565b610312600480360360208110156105ea57600080fd5b50356001600160a01b031661117b565b6102f66004803603602081101561061057600080fd5b50356001600160a01b031661118d565b6103906004803603604081101561063657600080fd5b506001600160a01b0381351690602001356111a2565b6103906004803603606081101561066257600080fd5b506001600160a01b038135811691602081013582169160409091013516611351565b61049d611435565b610390600480360360208110156106a257600080fd5b5035611449565b6102556114ec565b6102f6600480360360408110156106c757600080fd5b506001600160a01b03813516906020013561154d565b6102f6600480360360208110156106f357600080fd5b50356001600160a01b03166115b5565b6102f66004803603604081101561071957600080fd5b506001600160a01b0381351690602001356115ca565b6103126115de565b61049d6115e4565b6102f66115f3565b6103126004803603602081101561075d57600080fd5b50356001600160a01b0316611603565b610390600480360360c081101561078357600080fd5b506001600160a01b038135169060208101359060408101359060ff6060820135169060808101359060a00135611667565b6102f6600480360360608110156107ca57600080fd5b6001600160a01b03823516916020810135918101906060810160408201356401000000008111156107fa57600080fd5b82018360208201111561080c57600080fd5b8035906020019184600183028401116401000000008311171561082e57600080fd5b5090925090506118da565b6103126004803603604081101561084f57600080fd5b506001600160a01b03813581169160200135166119a6565b6103126119d1565b6108a16004803603604081101561088557600080fd5b5080356001600160a01b0316906020013563ffffffff166119f5565b6040805163ffffffff909316835260208301919091528051918290030190f35b610390600480360360208110156108d757600080fd5b50356001600160a01b0316611a22565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109735780601f1061094857610100808354040283529160200191610973565b820191906000526020600020905b81548152906001019060200180831161095657829003601f168201915b5050505050905090565b600061099161098a611b2b565b8484611b2f565b5060015b92915050565b60025490565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b60006109d2848484611c1b565b610a42846109de611b2b565b610a3d85604051806060016040528060288152602001612814602891396001600160a01b038a16600090815260016020526040812090610a1c611b2b565b6001600160a01b031681526020810191909152604001600020549190611faa565b611b2f565b5060019392505050565b610a54611b2b565b60055461010090046001600160a01b03908116911614610aa9576040805162461bcd60e51b8152602060048201819052602482015260008051602061283c833981519152604482015290519081900360640190fd5b60018215151415610ad9576001600160a01b0381166000908152600760205260409020805460ff19169055610afa565b6001600160a01b0381166000908152600860205260409020805460ff191690555b5050565b60055460ff1690565b6a084595161401484a00000081565b6000610991610b23611b2b565b84610a3d8560016000610b34611b2b565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490612041565b600080610b7086610df4565b9050610b7c86866115ca565b50600081610b8988610df4565b039050863b63ffffffff811615610c5a57876001600160a01b0316636be32e73338489896040518563ffffffff1660e01b815260040180856001600160a01b03168152602001848152602001806020018281038252848482818152602001925080828437600081840152601f19601f82011690508083019250505095505050505050602060405180830381600087803b158015610c2557600080fd5b505af1158015610c39573d6000803e3d6000fd5b505050506040513d6020811015610c4f57600080fd5b5051610c5a57600080fd5b506001979650505050505050565b600554600160a81b900460ff16151560011415610cbd576040805162461bcd60e51b815260206004820152600e60248201526d1b585e081cdd5c1c1b1e481a1a5d60921b604482015290519081900360640190fd5b6009546001600160a01b03163314610d07576040805162461bcd60e51b81526020600482015260086024820152676e6f74205469746f60c01b604482015290519081900360640190fd5b6000610d1161099b565b90506a084595161401484a000000610d298284612041565b10610d5957610d436a084595161401484a0000008261209b565b6005805460ff60a81b1916600160a81b17905591505b8115610d8e57610d6983836120dd565b6001600160a01b038084166000908152600c6020526040812054610d8e9216846121cd565b505050565b6009546001600160a01b031681565b6001600160a01b039081166000908152600c60205260409020541690565b610dca338261230a565b50565b600b546001600160a01b031681565b600e6020526000908152604090205463ffffffff1681565b6001600160a01b031660009081526020819052604090205490565b610e17611b2b565b60055461010090046001600160a01b03908116911614610e6c576040805162461bcd60e51b8152602060048201819052602482015260008051602061283c833981519152604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b6000438210610efc5760405162461bcd60e51b81526004018080602001828103825260278152602001806128ed6027913960400191505060405180910390fd5b6001600160a01b0383166000908152600e602052604090205463ffffffff1680610f2a576000915050610995565b6001600160a01b0384166000908152600d6020908152604080832063ffffffff600019860181168552925290912054168310610f99576001600160a01b0384166000908152600d602090815260408083206000199490940163ffffffff16835292905220600101549050610995565b6001600160a01b0384166000908152600d6020908152604080832083805290915290205463ffffffff16831015610fd4576000915050610995565b600060001982015b8163ffffffff168163ffffffff16111561108d57600282820363ffffffff16048103611006612716565b506001600160a01b0387166000908152600d6020908152604080832063ffffffff808616855290835292819020815180830190925280549093168082526001909301549181019190915290871415611068576020015194506109959350505050565b805163ffffffff1687111561107f57819350611086565b6001820392505b5050610fdc565b506001600160a01b0385166000908152600d6020908152604080832063ffffffff9094168352929052206001015491505092915050565b6110cc611b2b565b60055461010090046001600160a01b03908116911614611121576040805162461bcd60e51b8152602060048201819052602482015260008051602061283c833981519152604482015290519081900360640190fd5b60018215151415611154576001600160a01b0381166000908152600760205260409020805460ff19166001179055610afa565b6001600160a01b0381166000908152600860205260409020805460ff191660011790555050565b600f6020526000908152604090205481565b60076020526000908152604090205460ff1681565b6111aa611b2b565b60055461010090046001600160a01b039081169116146111ff576040805162461bcd60e51b8152602060048201819052602482015260008051602061283c833981519152604482015290519081900360640190fd5b600b546001600160a01b0316811580159061128b5750604080516370a0823160e01b815230600482015290516001600160a01b038316916370a08231916024808301926020929190829003018186803b15801561125b57600080fd5b505afa15801561126f573d6000803e3d6000fd5b505050506040513d602081101561128557600080fd5b50518211155b6112c9576040805162461bcd60e51b815260206004820152600a60248201526918985908185b5bdd5b9d60b21b604482015290519081900360640190fd5b806001600160a01b031663a9059cbb84846040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561132057600080fd5b505af1158015611334573d6000803e3d6000fd5b505050506040513d602081101561134a57600080fd5b5050505050565b611359611b2b565b60055461010090046001600160a01b039081169116146113ae576040805162461bcd60e51b8152602060048201819052602482015260008051602061283c833981519152604482015290519081900360640190fd5b6001600160a01b038316156113d957600980546001600160a01b0319166001600160a01b0385161790555b6001600160a01b0382161561140457600a80546001600160a01b0319166001600160a01b0384161790555b6001600160a01b03811615610d8e57600b80546001600160a01b0383166001600160a01b0319909116179055505050565b60055461010090046001600160a01b031690565b611451611b2b565b60055461010090046001600160a01b039081169116146114a6576040805162461bcd60e51b8152602060048201819052602482015260008051602061283c833981519152604482015290519081900360640190fd5b60648111156114e7576040805162461bcd60e51b81526020600482015260086024820152676f7665722031302560c01b604482015290519081900360640190fd5b600655565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156109735780601f1061094857610100808354040283529160200191610973565b600061099161155a611b2b565b84610a3d8560405180606001604052806025815260200161293a6025913960016000611584611b2b565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190611faa565b60086020526000908152604090205460ff1681565b60006109916115d7611b2b565b8484611c1b565b60065481565b600a546001600160a01b031681565b600554600160a81b900460ff1681565b6001600160a01b0381166000908152600e602052604081205463ffffffff168061162e576000611660565b6001600160a01b0383166000908152600d6020908152604080832063ffffffff60001986011684529091529020600101545b9392505050565b60007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8666116926108e7565b805190602001206116a161239f565b60408051602080820195909552808201939093526060830191909152306080808401919091528151808403909101815260a0830182528051908401207fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60c08401526001600160a01b038b1660e084015261010083018a90526101208084018a9052825180850390910181526101408401835280519085012061190160f01b6101608501526101628401829052610182808501829052835180860390910181526101a285018085528151918701919091206000918290526101c2860180865281905260ff8b166101e287015261020286018a90526102228601899052935192965090949293909260019261024280840193601f198301929081900390910190855afa1580156117d4573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166118265760405162461bcd60e51b815260040180806020018281038252602681526020018061287e6026913960400191505060405180910390fd5b6001600160a01b0381166000908152600f6020526040902080546001810190915589146118845760405162461bcd60e51b815260040180806020018281038252602281526020018061285c6022913960400191505060405180910390fd5b874211156118c35760405162461bcd60e51b81526004018080602001828103825260268152602001806129146026913960400191505060405180910390fd5b6118cd818b61230a565b505050505b505050505050565b60006118e6858561097d565b50846001600160a01b0316638f4ffcb133863087876040518663ffffffff1660e01b815260040180866001600160a01b03168152602001858152602001846001600160a01b03168152602001806020018281038252848482818152602001925080828437600081840152601f19601f8201169050808301925050509650505050505050600060405180830381600087803b15801561198357600080fd5b505af1158015611997573d6000803e3d6000fd5b50600198975050505050505050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b600d6020908152600092835260408084209091529082529020805460019091015463ffffffff9091169082565b611a2a611b2b565b60055461010090046001600160a01b03908116911614611a7f576040805162461bcd60e51b8152602060048201819052602482015260008051602061283c833981519152604482015290519081900360640190fd5b6001600160a01b038116611ac45760405162461bcd60e51b81526004018080602001828103825260268152602001806127516026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b3390565b6001600160a01b038316611b745760405162461bcd60e51b81526004018080602001828103825260248152602001806128c96024913960400191505060405180910390fd5b6001600160a01b038216611bb95760405162461bcd60e51b81526004018080602001828103825260228152602001806127776022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316611c605760405162461bcd60e51b81526004018080602001828103825260258152602001806128a46025913960400191505060405180910390fd5b6001600160a01b038216611ca55760405162461bcd60e51b815260040180806020018281038252602381526020018061272e6023913960400191505060405180910390fd5b6000808215611f5857611cb885856123a3565b1515600114611e0857611ce26103e8611cdc6006548661245390919063ffffffff16565b906124ac565b600a546001600160a01b0316600090815260208190526040902054909250611d0a9083612041565b600a80546001600160a01b03908116600090815260208181526040808320959095558983168252600c9052838120549254821681529290922054611d53929182169116846121cd565b600a5460408051639c8124b160e01b81526001600160a01b0388811660048301526024820186905291519190921691639c8124b191604480830192600092919082900301818387803b158015611da857600080fd5b505af1158015611dbc573d6000803e3d6000fd5b5050600a546040805186815290516001600160a01b03928316945091891692507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35b611e12838361209b565b9050611e51836040518060600160405280602681526020016127cd602691396001600160a01b0388166000908152602081905260409020549190611faa565b6001600160a01b0386166000908152602081905260409020558015611f58576001600160a01b038416600090815260208190526040902054611e939082612041565b6001600160a01b03808616600081815260208181526040808320959095558984168252600c9052838120549181529290922054611ed49282169116836121cd565b600a546001600160a01b0385811691161415611f5857600a5460408051639c8124b160e01b81526001600160a01b0388811660048301526024820185905291519190921691639c8124b191604480830192600092919082900301818387803b158015611f3f57600080fd5b505af1158015611f53573d6000803e3d6000fd5b505050505b836001600160a01b0316856001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050505050565b600081848411156120395760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611ffe578181015183820152602001611fe6565b50505050905090810190601f16801561202b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015611660576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061166083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611faa565b6001600160a01b038216612138576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b61214460008383610d8e565b6002546121519082612041565b6002556001600160a01b0382166000908152602081905260409020546121779082612041565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b816001600160a01b0316836001600160a01b0316141580156121ef5750600081115b15610d8e576001600160a01b03831615612281576001600160a01b0383166000908152600e602052604081205463ffffffff16908161222f576000612261565b6001600160a01b0385166000908152600d6020908152604080832063ffffffff60001987011684529091529020600101545b9050600061226f828561209b565b905061227d868484846124ee565b5050505b6001600160a01b03821615610d8e576001600160a01b0382166000908152600e602052604081205463ffffffff1690816122bc5760006122ee565b6001600160a01b0384166000908152600d6020908152604080832063ffffffff60001987011684529091529020600101545b905060006122fc8285612041565b90506118d2858484846124ee565b6001600160a01b038083166000908152600c60205260408120549091169061233184610df4565b6001600160a01b038581166000818152600c602052604080822080546001600160a01b031916898616908117909155905194955093928616927f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a46123998284836121cd565b50505050565b4690565b600a546000906001600160a01b03848116911614806123cf5750600a546001600160a01b038381169116145b806123e757506009546001600160a01b038481169116145b806123ff57506009546001600160a01b038381169116145b8061242757506001600160a01b03831660009081526007602052604090205460ff1615156001145b806116605750506001600160a01b031660009081526008602052604090205460ff161515600114919050565b60008261246257506000610995565b8282028284828161246f57fe5b04146116605760405162461bcd60e51b81526004018080602001828103825260218152602001806127f36021913960400191505060405180910390fd5b600061166083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612653565b600061251243604051806060016040528060348152602001612799603491396126b8565b905060008463ffffffff1611801561255b57506001600160a01b0385166000908152600d6020908152604080832063ffffffff6000198901811685529252909120548282169116145b15612598576001600160a01b0385166000908152600d6020908152604080832063ffffffff60001989011684529091529020600101829055612609565b60408051808201825263ffffffff808416825260208083018681526001600160a01b038a166000818152600d84528681208b8616825284528681209551865490861663ffffffff199182161787559251600196870155908152600e9092529390208054928801909116919092161790555b604080518481526020810184905281516001600160a01b038816927fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724928290030190a25050505050565b600081836126a25760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611ffe578181015183820152602001611fe6565b5060008385816126ae57fe5b0495945050505050565b600081640100000000841061270e5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611ffe578181015183820152602001611fe6565b509192915050565b60408051808201909152600080825260208201529056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373535552463a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d6265722065786365656473203332206269747345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572535552463a3a64656c656761746542795369673a20696e76616c6964206e6f6e6365535552463a3a64656c656761746542795369673a20696e76616c6964207369676e617475726545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373535552463a3a6765745072696f72566f7465733a206e6f74207965742064657465726d696e6564535552463a3a64656c656761746542795369673a207369676e6174757265206578706972656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220b92b2443241b4136f4d07811e224f2d738b6ae472de9c4e7c2eef7abc67ca03664736f6c634300060c0033
Deployed Bytecode Sourcemap
1091:14808:7:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2162:81:2;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4207:166;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;4207:166:2;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;3214:98;;;:::i;:::-;;;;;;;;;;;;;;;;8767:122:7;;;:::i;4833:317:2:-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;4833:317:2;;;;;;;;;;;;;;;;;:::i;3632:246:7:-;;;;;;;;;;;;;;;;-1:-1:-1;3632:246:7;;;;;;;;-1:-1:-1;;;;;3632:246:7;;:::i;:::-;;3064:90:2;;;:::i;:::-;;;;;;;;;;;;;;;;;;;1214:54:7;;;:::i;5545:215:2:-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;5545:215:2;;;;;;;;:::i;4689:487:7:-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;4689:487:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;4689:487:7;;-1:-1:-1;4689:487:7;-1:-1:-1;4689:487:7;:::i;2005:486::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;2005:486:7;;;;;;;;:::i;1732:26::-;;;:::i;:::-;;;;-1:-1:-1;;;;;1732:26:7;;;;;;;;;;;;;;9717:115;;;;;;;;;;;;;;;;-1:-1:-1;9717:115:7;-1:-1:-1;;;;;9717:115:7;;:::i;9967:102::-;;;;;;;;;;;;;;;;-1:-1:-1;9967:102:7;-1:-1:-1;;;;;9967:102:7;;:::i;1886:30::-;;;:::i;8651:49::-;;;;;;;;;;;;;;;;-1:-1:-1;8651:49:7;-1:-1:-1;;;;;8651:49:7;;:::i;:::-;;;;;;;;;;;;;;;;;;;3370:117:2;;;;;;;;;;;;;;;;-1:-1:-1;3370:117:2;-1:-1:-1;;;;;3370:117:2;;:::i;1706:145:6:-;;;:::i;12390:1189:7:-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;12390:1189:7;;;;;;;;:::i;3324:229::-;;;;;;;;;;;;;;;;-1:-1:-1;3324:229:7;;;;;;;;-1:-1:-1;;;;;3324:229:7;;:::i;9169:39::-;;;;;;;;;;;;;;;;-1:-1:-1;9169:39:7;-1:-1:-1;;;;;9169:39:7;;:::i;1597:47::-;;;;;;;;;;;;;;;;-1:-1:-1;1597:47:7;-1:-1:-1;;;;;1597:47:7;;:::i;4152:269::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;4152:269:7;;;;;;;;:::i;2619:368::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;2619:368:7;;;;;;;;;;;;;;;;;;;:::i;1083:77:6:-;;;:::i;3094:156:7:-;;;;;;;;;;;;;;;;-1:-1:-1;3094:156:7;;:::i;2356:85:2:-;;;:::i;6247:266::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;6247:266:2;;;;;;;;:::i;1650:50:7:-;;;;;;;;;;;;;;;;-1:-1:-1;1650:50:7;-1:-1:-1;;;;;1650:50:7;;:::i;3690:172:2:-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;3690:172:2;;;;;;;;:::i;1409:31:7:-;;;:::i;1795:39::-;;;:::i;1274:32::-;;;:::i;11751:220::-;;;;;;;;;;;;;;;;-1:-1:-1;11751:220:7;-1:-1:-1;;;;;11751:220:7;;:::i;10489:1071::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;10489:1071:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;4427:256::-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;4427:256:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;4427:256:7;;-1:-1:-1;4427:256:7;-1:-1:-1;4427:256:7;:::i;3920:149:2:-;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;3920:149:2;;;;;;;;;;:::i;8977:117:7:-;;;:::i;8518:70::-;;;;;;;;;;;;;;;;-1:-1:-1;8518:70:7;;-1:-1:-1;;;;;8518:70:7;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;2000:240:6;;;;;;;;;;;;;;;;-1:-1:-1;2000:240:6;-1:-1:-1;;;;;2000:240:6;;:::i;2162:81:2:-;2231:5;2224:12;;;;;;;;-1:-1:-1;;2224:12:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2199:13;;2224:12;;2231:5;;2224:12;;2231:5;2224:12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2162:81;:::o;4207:166::-;4290:4;4306:39;4315:12;:10;:12::i;:::-;4329:7;4338:6;4306:8;:39::i;:::-;-1:-1:-1;4362:4:2;4207:166;;;;;:::o;3214:98::-;3293:12;;3214:98;:::o;8767:122:7:-;8809:80;8767:122;:::o;4833:317:2:-;4939:4;4955:36;4965:6;4973:9;4984:6;4955:9;:36::i;:::-;5001:121;5010:6;5018:12;:10;:12::i;:::-;5032:89;5070:6;5032:89;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;5032:19:2;;;;;;:11;:19;;;;;;5052:12;:10;:12::i;:::-;-1:-1:-1;;;;;5032:33:2;;;;;;;;;;;;-1:-1:-1;5032:33:2;;;:89;:37;:89::i;:::-;5001:8;:121::i;:::-;-1:-1:-1;5139:4:2;4833:317;;;;;:::o;3632:246:7:-;1297:12:6;:10;:12::i;:::-;1287:6;;;;;-1:-1:-1;;;;;1287:6:6;;;:22;;;1279:67;;;;;-1:-1:-1;;;1279:67:6;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1279:67:6;;;;;;;;;;;;;;;3781:4:7::1;3751:34:::0;::::1;;;3747:124;;;-1:-1:-1::0;;;;;3787:25:7;::::1;3815:5;3787:25:::0;;;:15:::1;:25;::::0;;;;:33;;-1:-1:-1;;3787:33:7::1;::::0;;3747:124:::1;;;-1:-1:-1::0;;;;;3835:28:7;::::1;3866:5;3835:28:::0;;;:18:::1;:28;::::0;;;;:36;;-1:-1:-1;;3835:36:7::1;::::0;;3747:124:::1;3632:246:::0;;:::o;3064:90:2:-;3138:9;;;;3064:90;:::o;1214:54:7:-;1251:17;1214:54;:::o;5545:215:2:-;5633:4;5649:83;5658:12;:10;:12::i;:::-;5672:7;5681:50;5720:10;5681:11;:25;5693:12;:10;:12::i;:::-;-1:-1:-1;;;;;5681:25:2;;;;;;;;;;;;;;;;;-1:-1:-1;5681:25:2;;;:34;;;;;;;;;;;:38;:50::i;4689:487:7:-;4784:4;4800:22;4825:14;4835:3;4825:9;:14::i;:::-;4800:39;;4849:22;4858:3;4863:7;4849:8;:22::i;:::-;;4881:23;4924:14;4907;4917:3;4907:9;:14::i;:::-;:31;;-1:-1:-1;5002:16:7;;5041:9;;;;5037:112;;5083:3;-1:-1:-1;;;;;5074:27:7;;5102:10;5114:15;5131:5;;5074:63;;;;;;;;;;;;;-1:-1:-1;;;;;5074:63:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;5074:63:7;5066:72;;;;;;-1:-1:-1;5165:4:7;;4689:487;-1:-1:-1;;;;;;;4689:487:7:o;2005:486::-;2074:12;;-1:-1:-1;;;2074:12:7;;;;:20;;2090:4;2074:20;;2066:47;;;;;-1:-1:-1;;;2066:47:7;;;;;;;;;;;;-1:-1:-1;;;2066:47:7;;;;;;;;;;;;;;;2145:11;;-1:-1:-1;;;;;2145:11:7;2131:10;:25;2123:46;;;;;-1:-1:-1;;;2123:46:7;;;;;;;;;;;;-1:-1:-1;;;2123:46:7;;;;;;;;;;;;;;;2179:14;2196:13;:11;:13::i;:::-;2179:30;-1:-1:-1;1251:17:7;2223:19;2179:30;2234:7;2223:10;:19::i;:::-;:33;2219:129;;2282:22;1251:17;2297:6;2282:14;:22::i;:::-;2318:12;:19;;-1:-1:-1;;;;2318:19:7;-1:-1:-1;;;2318:19:7;;;2272:32;-1:-1:-1;2219:129:7;2362:11;;2358:127;;2389:19;2395:3;2400:7;2389:5;:19::i;:::-;-1:-1:-1;;;;;2449:15:7;;;2445:1;2449:15;;;:10;:15;;;;;;2422:52;;2449:15;2466:7;2422:14;:52::i;:::-;2005:486;;;:::o;1732:26::-;;;-1:-1:-1;;;;;1732:26:7;;:::o;9717:115::-;-1:-1:-1;;;;;9804:21:7;;;9778:7;9804:21;;;:10;:21;;;;;;;;9717:115::o;9967:102::-;10030:32;10040:10;10052:9;10030;:32::i;:::-;9967:102;:::o;1886:30::-;;;-1:-1:-1;;;;;1886:30:7;;:::o;8651:49::-;;;;;;;;;;;;;;;:::o;3370:117:2:-;-1:-1:-1;;;;;3462:18:2;3436:7;3462:18;;;;;;;;;;;;3370:117::o;1706:145:6:-;1297:12;:10;:12::i;:::-;1287:6;;;;;-1:-1:-1;;;;;1287:6:6;;;:22;;;1279:67;;;;;-1:-1:-1;;;1279:67:6;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1279:67:6;;;;;;;;;;;;;;;1796:6:::1;::::0;1775:40:::1;::::0;1812:1:::1;::::0;1796:6:::1;::::0;::::1;-1:-1:-1::0;;;;;1796:6:6::1;::::0;1775:40:::1;::::0;1812:1;;1775:40:::1;1825:6;:19:::0;;-1:-1:-1;;;;;;1825:19:6::1;::::0;;1706:145::o;12390:1189:7:-;12471:7;12512:12;12498:11;:26;12490:78;;;;-1:-1:-1;;;12490:78:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;12601:23:7;;12579:19;12601:23;;;:14;:23;;;;;;;;12638:17;12634:56;;12678:1;12671:8;;;;;12634:56;-1:-1:-1;;;;;12747:20:7;;;;;;:11;:20;;;;;;;;:38;-1:-1:-1;;12768:16:7;;12747:38;;;;;;;;;:48;;:63;-1:-1:-1;12743:145:7;;-1:-1:-1;;;;;12833:20:7;;;;;;:11;:20;;;;;;;;-1:-1:-1;;12854:16:7;;;;12833:38;;;;;;;;12869:1;12833:44;;;-1:-1:-1;12826:51:7;;12743:145;-1:-1:-1;;;;;12946:20:7;;;;;;:11;:20;;;;;;;;:23;;;;;;;;:33;:23;:33;:47;-1:-1:-1;12942:86:7;;;13016:1;13009:8;;;;;12942:86;13038:12;-1:-1:-1;;13079:16:7;;13105:418;13120:5;13112:13;;:5;:13;;;13105:418;;;13183:1;13166:13;;;13165:19;;;13157:27;;13225:20;;:::i;:::-;-1:-1:-1;;;;;;13248:20:7;;;;;;:11;:20;;;;;;;;:28;;;;;;;;;;;;;13225:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13294:27;;13290:223;;;13348:8;;;;-1:-1:-1;13341:15:7;;-1:-1:-1;;;;13341:15:7;13290:223;13381:12;;:26;;;-1:-1:-1;13377:136:7;;;13435:6;13427:14;;13377:136;;;13497:1;13488:6;:10;13480:18;;13377:136;13105:418;;;;;-1:-1:-1;;;;;;13539:20:7;;;;;;:11;:20;;;;;;;;:27;;;;;;;;;;:33;;;;-1:-1:-1;;12390:1189:7;;;;:::o;3324:229::-;1297:12:6;:10;:12::i;:::-;1287:6;;;;;-1:-1:-1;;;;;1287:6:6;;;:22;;;1279:67;;;;;-1:-1:-1;;;1279:67:6;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1279:67:6;;;;;;;;;;;;;;;3458:4:7::1;3433:29:::0;::::1;;;3429:117;;;-1:-1:-1::0;;;;;3464:25:7;::::1;;::::0;;;:15:::1;:25;::::0;;;;:32;;-1:-1:-1;;3464:32:7::1;3492:4;3464:32;::::0;;3429:117:::1;;;-1:-1:-1::0;;;;;3511:28:7;::::1;;::::0;;;:18:::1;:28;::::0;;;;:35;;-1:-1:-1;;3511:35:7::1;3542:4;3511:35;::::0;;3324:229;;:::o;9169:39::-;;;;;;;;;;;;;:::o;1597:47::-;;;;;;;;;;;;;;;:::o;4152:269::-;1297:12:6;:10;:12::i;:::-;1287:6;;;;;-1:-1:-1;;;;;1287:6:6;;;:22;;;1279:67;;;;;-1:-1:-1;;;1279:67:6;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1279:67:6;;;;;;;;;;;;;;;4265:15:7::1;::::0;-1:-1:-1;;;;;4265:15:7::1;4299:11:::0;;;;;:59:::1;;-1:-1:-1::0;4325:33:7::1;::::0;;-1:-1:-1;;;4325:33:7;;4352:4:::1;4325:33;::::0;::::1;::::0;;;-1:-1:-1;;;;;4325:18:7;::::1;::::0;::::1;::::0;:33;;;;;::::1;::::0;;;;;;;;:18;:33;::::1;;::::0;::::1;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;4325:33:7;4314:44;::::1;;4299:59;4291:82;;;::::0;;-1:-1:-1;;;4291:82:7;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;4291:82:7;;;;;;;;;;;;;::::1;;4383:8;-1:-1:-1::0;;;;;4383:17:7::1;;4401:3;4406:7;4383:31;;;;;;;;;;;;;-1:-1:-1::0;;;;;4383:31:7::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;::::0;::::1;;-1:-1:-1::0;;;;;4152:269:7:o;2619:368::-;1297:12:6;:10;:12::i;:::-;1287:6;;;;;-1:-1:-1;;;;;1287:6:6;;;:22;;;1279:67;;;;;-1:-1:-1;;;1279:67:6;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1279:67:6;;;;;;;;;;;;;;;-1:-1:-1;;;;;2763:26:7;::::1;::::0;2759:58:::1;;2791:11;:26:::0;;-1:-1:-1;;;;;;2791:26:7::1;-1:-1:-1::0;;;;;2791:26:7;::::1;;::::0;;2759:58:::1;-1:-1:-1::0;;;;;2831:31:7;::::1;::::0;2827:73:::1;;2864:16;:36:::0;;-1:-1:-1;;;;;;2864:36:7::1;-1:-1:-1::0;;;;;2864:36:7;::::1;;::::0;;2827:73:::1;-1:-1:-1::0;;;;;2914:30:7;::::1;::::0;2910:70:::1;;2946:15;:34:::0;;-1:-1:-1;;;;;2946:34:7;::::1;-1:-1:-1::0;;;;;;2946:34:7;;::::1;;::::0;;2619:368;;;:::o;1083:77:6:-;1147:6;;;;;-1:-1:-1;;;;;1147:6:6;;1083:77::o;3094:156:7:-;1297:12:6;:10;:12::i;:::-;1287:6;;;;;-1:-1:-1;;;;;1287:6:6;;;:22;;;1279:67;;;;;-1:-1:-1;;;1279:67:6;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1279:67:6;;;;;;;;;;;;;;;3191:3:7::1;3175:12;:19;;3167:40;;;::::0;;-1:-1:-1;;;3167:40:7;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;-1:-1:-1;;;3167:40:7;;;;;;;;;;;;;::::1;;3217:11;:26:::0;3094:156::o;2356:85:2:-;2427:7;2420:14;;;;;;;;-1:-1:-1;;2420:14:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2395:13;;2420:14;;2427:7;;2420:14;;2427:7;2420:14;;;;;;;;;;;;;;;;;;;;;;;;6247:266;6340:4;6356:129;6365:12;:10;:12::i;:::-;6379:7;6388:96;6427:15;6388:96;;;;;;;;;;;;;;;;;:11;:25;6400:12;:10;:12::i;:::-;-1:-1:-1;;;;;6388:25:2;;;;;;;;;;;;;;;;;-1:-1:-1;6388:25:2;;;:34;;;;;;;;;;;:96;:38;:96::i;1650:50:7:-;;;;;;;;;;;;;;;:::o;3690:172:2:-;3776:4;3792:42;3802:12;:10;:12::i;:::-;3816:9;3827:6;3792:9;:42::i;1409:31:7:-;;;;:::o;1795:39::-;;;-1:-1:-1;;;;;1795:39:7;;:::o;1274:32::-;;;-1:-1:-1;;;1274:32:7;;;;;:::o;11751:220::-;-1:-1:-1;;;;;11857:23:7;;11816:7;11857:23;;;:14;:23;;;;;;;;11897:16;:67;;11963:1;11897:67;;;-1:-1:-1;;;;;11916:20:7;;;;;;:11;:20;;;;;;;;:38;-1:-1:-1;;11937:16:7;;11916:38;;;;;;;;11952:1;11916:44;;11897:67;11890:74;11751:220;-1:-1:-1;;;11751:220:7:o;10489:1071::-;10606:23;8809:80;10732:6;:4;:6::i;:::-;10716:24;;;;;;10758:12;:10;:12::i;:::-;10655:160;;;;;;;;;;;;;;;;;;;;;;;;;10796:4;10655:160;;;;;;;;;;;;;;;;;;;;;;;10632:193;;;;;;9023:71;10880:135;;;;-1:-1:-1;;;;;10880:135:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10857:168;;;;;;-1:-1:-1;;;11076:119:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11053:152;;;;;;;;;-1:-1:-1;11236:26:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10632:193;;-1:-1:-1;10857:168:7;;11053:152;;-1:-1:-1;;11236:26:7;;;;;;;-1:-1:-1;;11236:26:7;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;11236:26:7;;-1:-1:-1;;11236:26:7;;;-1:-1:-1;;;;;;;11280:23:7;;11272:74;;;;-1:-1:-1;;;11272:74:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;11373:17:7;;;;;;:6;:17;;;;;:19;;;;;;;;11364:28;;11356:75;;;;-1:-1:-1;;;11356:75:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11456:6;11449:3;:13;;11441:64;;;;-1:-1:-1;;;11441:64:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;11522:31;11532:9;11543;11522;:31::i;:::-;11515:38;;;;10489:1071;;;;;;;:::o;4427:256::-;4526:4;4542:26;4550:8;4560:7;4542;:26::i;:::-;;4587:8;-1:-1:-1;;;;;4578:34:7;;4613:10;4625:7;4642:4;4649:5;;4578:77;;;;;;;;;;;;;-1:-1:-1;;;;;4578:77:7;;;;;;;;;;;-1:-1:-1;;;;;4578:77:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;4672:4:7;;4427:256;-1:-1:-1;;;;;;;;4427:256:7:o;3920:149:2:-;-1:-1:-1;;;;;4035:18:2;;;4009:7;4035:18;;;:11;:18;;;;;;;;:27;;;;;;;;;;;;;3920:149::o;8977:117:7:-;9023:71;8977:117;:::o;8518:70::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;2000:240:6:-;1297:12;:10;:12::i;:::-;1287:6;;;;;-1:-1:-1;;;;;1287:6:6;;;:22;;;1279:67;;;;;-1:-1:-1;;;1279:67:6;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1279:67:6;;;;;;;;;;;;;;;-1:-1:-1;;;;;2088:22:6;::::1;2080:73;;;;-1:-1:-1::0;;;2080:73:6::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2189:6;::::0;2168:38:::1;::::0;-1:-1:-1;;;;;2168:38:6;;::::1;::::0;2189:6:::1;::::0;::::1;;::::0;2168:38:::1;::::0;;;::::1;2216:6;:17:::0;;-1:-1:-1;;;;;2216:17:6;;::::1;;;-1:-1:-1::0;;;;;;2216:17:6;;::::1;::::0;;;::::1;::::0;;2000:240::o;608:104:1:-;695:10;608:104;:::o;9311:340:2:-;-1:-1:-1;;;;;9412:19:2;;9404:68;;;;-1:-1:-1;;;9404:68:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;9490:21:2;;9482:68;;;;-1:-1:-1;;;9482:68:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;9561:18:2;;;;;;;:11;:18;;;;;;;;:27;;;;;;;;;;;;;:36;;;9612:32;;;;;;;;;;;;;;;;;9311:340;;;:::o;5567:1688:7:-;-1:-1:-1;;;;;5673:20:7;;5665:70;;;;-1:-1:-1;;;5665:70:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;5753:23:7;;5745:71;;;;-1:-1:-1;;;5745:71:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5827:25;;5901:10;;5897:1291;;6029:41;6052:6;6060:9;6029:22;:41::i;:::-;:49;;6074:4;6029:49;6025:502;;6118:33;6146:4;6118:23;6129:11;;6118:6;:10;;:23;;;;:::i;:::-;:27;;:33::i;:::-;6209:16;;-1:-1:-1;;;;;6209:16:7;6199:9;:27;;;;;;;;;;;6098:53;;-1:-1:-1;6199:50:7;;6098:53;6199:31;:50::i;:::-;6179:16;;;-1:-1:-1;;;;;6179:16:7;;;6169:9;:27;;;;;;;;;;;:80;;;;6282:18;;;;;:10;:18;;;;;;6313:16;;;;6302:28;;;;;;;6267:83;;6282:18;;;;6302:28;6332:17;6267:14;:83::i;:::-;6378:16;;6368:68;;;-1:-1:-1;;;6368:68:7;;-1:-1:-1;;;;;6368:68:7;;;;;;;;;;;;;;;6378:16;;;;;6368:41;;:68;;;;;6378:16;;6368:68;;;;;;;6378:16;;6368:68;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;6476:16:7;;6459:53;;;;;;;;-1:-1:-1;;;;;6476:16:7;;;;-1:-1:-1;6459:53:7;;;;-1:-1:-1;6459:53:7;;;;;;;;;;6025:502;6560:29;:6;6571:17;6560:10;:29::i;:::-;6541:48;;6624:71;6646:6;6624:71;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;6624:17:7;;:9;:17;;;;;;;;;;;;:71;:21;:71::i;:::-;-1:-1:-1;;;;;6604:17:7;;:9;:17;;;;;;;;;;:91;6714:20;;6710:467;;-1:-1:-1;;;;;6777:20:7;;:9;:20;;;;;;;;;;;:42;;6802:16;6777:24;:42::i;:::-;-1:-1:-1;;;;;6754:20:7;;;:9;:20;;;;;;;;;;;:65;;;;6852:18;;;;;:10;:18;;;;;;6872:21;;;;;;;;6837:75;;6852:18;;;6872:21;6895:16;6837:14;:75::i;:::-;7077:16;;-1:-1:-1;;;;;7064:29:7;;;7077:16;;7064:29;7060:102;;;7105:16;;7095:67;;;-1:-1:-1;;;7095:67:7;;-1:-1:-1;;;;;7095:67:7;;;;;;;;;;;;;;;7105:16;;;;;7095:41;;:67;;;;;7105:16;;7095:67;;;;;;;7105:16;;7095:67;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7060:102;7220:9;-1:-1:-1;;;;;7203:45:7;7212:6;-1:-1:-1;;;;;7203:45:7;;7231:16;7203:45;;;;;;;;;;;;;;;;;;5567:1688;;;;;:::o;1766:187:9:-;1852:7;1887:12;1879:6;;;;1871:29;;;;-1:-1:-1;;;1871:29:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;1922:5:9;;;1766:187::o;894:176::-;952:7;983:5;;;1006:6;;;;998:46;;;;;-1:-1:-1;;;998:46:9;;;;;;;;;;;;;;;;;;;;;;;;;;;1341:134;1399:7;1425:43;1429:1;1432;1425:43;;;;;;;;;;;;;;;;;:3;:43::i;7787:370:2:-;-1:-1:-1;;;;;7870:21:2;;7862:65;;;;;-1:-1:-1;;;7862:65:2;;;;;;;;;;;;;;;;;;;;;;;;;;;;7938:49;7967:1;7971:7;7980:6;7938:20;:49::i;:::-;8013:12;;:24;;8030:6;8013:16;:24::i;:::-;7998:12;:39;-1:-1:-1;;;;;8068:18:2;;:9;:18;;;;;;;;;;;:30;;8091:6;8068:22;:30::i;:::-;-1:-1:-1;;;;;8047:18:2;;:9;:18;;;;;;;;;;;:51;;;;8113:37;;;;;;;8047:18;;:9;;8113:37;;;;;;;;;;7787:370;;:::o;14007:929:7:-;14112:6;-1:-1:-1;;;;;14102:16:7;:6;-1:-1:-1;;;;;14102:16:7;;;:30;;;;;14131:1;14122:6;:10;14102:30;14098:832;;;-1:-1:-1;;;;;14152:20:7;;;14148:379;;-1:-1:-1;;;;;14258:22:7;;14239:16;14258:22;;;:14;:22;;;;;;;;;14318:13;:60;;14377:1;14318:60;;;-1:-1:-1;;;;;14334:19:7;;;;;;:11;:19;;;;;;;;:34;-1:-1:-1;;14354:13:7;;14334:34;;;;;;;;14366:1;14334:40;;14318:60;14298:80;-1:-1:-1;14396:17:7;14416:21;14298:80;14430:6;14416:13;:21::i;:::-;14396:41;;14455:57;14472:6;14480:9;14491;14502;14455:16;:57::i;:::-;14148:379;;;;-1:-1:-1;;;;;14545:20:7;;;14541:379;;-1:-1:-1;;;;;14651:22:7;;14632:16;14651:22;;;:14;:22;;;;;;;;;14711:13;:60;;14770:1;14711:60;;;-1:-1:-1;;;;;14727:19:7;;;;;;:11;:19;;;;;;;;:34;-1:-1:-1;;14747:13:7;;14727:34;;;;;;;;14759:1;14727:40;;14711:60;14691:80;-1:-1:-1;14789:17:7;14809:21;14691:80;14823:6;14809:13;:21::i;:::-;14789:41;;14848:57;14865:6;14873:9;14884;14895;14848:16;:57::i;13585:416::-;-1:-1:-1;;;;;13687:21:7;;;13661:23;13687:21;;;:10;:21;;;;;;;;;;13745:20;13698:9;13745;:20::i;:::-;-1:-1:-1;;;;;13820:21:7;;;;;;;:10;:21;;;;;;:33;;-1:-1:-1;;;;;;13820:33:7;;;;;;;;;;13869:54;;13718:47;;-1:-1:-1;13820:33:7;13869:54;;;;;;13820:21;13869:54;13934:60;13949:15;13966:9;13977:16;13934:14;:60::i;:::-;13585:416;;;;:::o;15748:149::-;15856:9;15748:149;:::o;7369:419::-;7574:16;;7461:4;;-1:-1:-1;;;;;7563:27:7;;;7574:16;;7563:27;;:61;;-1:-1:-1;7608:16:7;;-1:-1:-1;;;;;7594:30:7;;;7608:16;;7594:30;7563:61;:99;;;-1:-1:-1;7651:11:7;;-1:-1:-1;;;;;7640:22:7;;;7651:11;;7640:22;7563:99;:128;;;-1:-1:-1;7680:11:7;;-1:-1:-1;;;;;7666:25:7;;;7680:11;;7666:25;7563:128;:176;;;-1:-1:-1;;;;;;7707:24:7;;;;;;:15;:24;;;;;;;;:32;;:24;:32;7563:176;:218;;;-1:-1:-1;;;;;;;7743:30:7;;;;;:18;:30;;;;;;;;:38;;:30;:38;;;-1:-1:-1;7369:419:7:o;2200:459:9:-;2258:7;2499:6;2495:45;;-1:-1:-1;2528:1:9;2521:8;;2495:45;2562:5;;;2566:1;2562;:5;:1;2585:5;;;;;:10;2577:56;;;;-1:-1:-1;;;2577:56:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3121:130;3179:7;3205:39;3209:1;3212;3205:39;;;;;;;;;;;;;;;;;:3;:39::i;14942:636:7:-;15063:18;15084:76;15091:12;15084:76;;;;;;;;;;;;;;;;;:6;:76::i;:::-;15063:97;;15190:1;15175:12;:16;;;:85;;;;-1:-1:-1;;;;;;15195:22:7;;;;;;:11;:22;;;;;;;;:65;-1:-1:-1;;15218:16:7;;15195:40;;;;;;;;;:50;:65;;;:50;;:65;15175:85;15171:334;;;-1:-1:-1;;;;;15276:22:7;;;;;;:11;:22;;;;;;;;:40;-1:-1:-1;;15299:16:7;;15276:40;;;;;;;;15314:1;15276:46;:57;;;15171:334;;;15403:33;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;15364:22:7;;-1:-1:-1;15364:22:7;;;:11;:22;;;;;:36;;;;;;;;;;:72;;;;;;;-1:-1:-1;;15364:72:7;;;;;;;;;;;;;15450:25;;;:14;:25;;;;;;:44;;15478:16;;;15450:44;;;;;;;;;;15171:334;15520:51;;;;;;;;;;;;;;-1:-1:-1;;;;;15520:51:7;;;;;;;;;;;14942:636;;;;;:::o;3733:272:9:-;3819:7;3853:12;3846:5;3838:28;;;;-1:-1:-1;;;3838:28:9;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3876:9;3892:1;3888;:5;;;;;;;3733:272;-1:-1:-1;;;;;3733:272:9:o;15584:158:7:-;15659:6;15696:12;15689:5;15685:9;;15677:32;;;;-1:-1:-1;;;15677:32:7;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;15733:1:7;;15584:158;-1:-1:-1;;15584:158:7:o;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;:::o
Swarm Source
ipfs://b92b2443241b4136f4d07811e224f2d738b6ae472de9c4e7c2eef7abc67ca036
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.