Contract Address Details

0x7DeD7f9D3dF541190F666FB6897483e46D54e948

Contract Name
VelhallaStaking
Creator
0xee4b5e–c14260 at 0x02186e–85b36f
Balance
0 VLX
Tokens
Fetching tokens...
Transactions
48,517 Transactions
Transfers
75,234 Transfers
Gas Used
136,162,018,954
Last Balance Update
69800077
Contract name:
VelhallaStaking




Optimization enabled
true
Compiler version
v0.6.12+commit.27d51765




Optimization runs
200
EVM Version
default




Verified at
2022-01-20T06:54:10.628380Z

Constructor Arguments

0000000000000000000000008d9fb713587174ee97e91866050c383b5cee6209000000000000000000000000f800f6977a7f98eaca9163e549be17bbda84394a

Arg [0] (address) : 0x8d9fb713587174ee97e91866050c383b5cee6209
Arg [1] (address) : 0xf800f6977a7f98eaca9163e549be17bbda84394a

              

Contract source code

// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;


// 
/**
 * @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;
    }

    function min(uint256 x, uint256 y) internal pure returns (uint256 z) {
        z = x < y ? x : y;
    }

    // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
    function sqrt(uint256 y) internal pure returns (uint256 z) {
        if (y > 3) {
            z = y;
            uint256 x = y / 2 + 1;
            while (x < z) {
                z = x;
                x = (y / x + x) / 2;
            }
        } else if (y != 0) {
            z = 1;
        }
    }
}

// 
interface IBEP20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the token decimals.
     */
    function decimals() external view returns (uint8);

    /**
     * @dev Returns the token symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the token name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the bep token owner.
     */
    function getOwner() external view returns (address);

    /**
     * @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);
}

// 
/**
 * @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);
            }
        }
    }
}

// 
/**
 * @title SafeBEP20
 * @dev Wrappers around BEP20 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 SafeBEP20 for IBEP20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeBEP20 {
    using SafeMath for uint256;
    using Address for address;

    function safeTransfer(
        IBEP20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IBEP20 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
     * {IBEP20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IBEP20 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),
            'SafeBEP20: approve from non-zero to non-zero allowance'
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IBEP20 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(
        IBEP20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(
            value,
            'SafeBEP20: 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(IBEP20 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, 'SafeBEP20: low-level call failed');
        if (returndata.length > 0) {
            // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), 'SafeBEP20: BEP20 operation did not succeed');
        }
    }
}

// 
/*
 * @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.
 */
contract Context {
    // Empty internal constructor, to prevent people from mistakenly deploying
    // an instance of this contract, which should be used via inheritance.
    constructor() internal {}

    function _msgSender() internal view returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

// 
/**
 * @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 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 onlyOwner {
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     */
    function _transferOwnership(address newOwner) internal {
        require(newOwner != address(0), 'Ownable: new owner is the zero address');
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}


/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() internal {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}


/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotHalt` and `whenHalt`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Haltable is Context {
    /**
     * @dev Emitted when the halt is triggered by `account`.
     */
    event Halt(address account);

    /**
     * @dev Emitted when the halt is lifted by `account`.
     */
    // event Unhalt(address account);

    bool private _isHalt;

    /**
     * @dev Initializes the contract with not _isHalt state.
     */
    constructor() internal {
        _isHalt = false;
    }

    /**
     * @dev Returns true if the contract is halt, and false otherwise.
     */
    function isHalt() public view virtual returns (bool) {
        return _isHalt;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not _isHalt.
     *
     * Requirements:
     *
     * - The contract must not be _isHalt.
     */
    modifier whenNotHalt() {
        require(!isHalt(), "Halt: The contract has been halt, you can just withdraw now.");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is _isHalt.
     *
     * Requirements:
     *
     * - The contract must be _isHalt.
     */
    modifier whenHalt() {
        require(isHalt(), "Halt: Not halt, this function can only be used when contract being halt.");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be _isHalt.
     */
    function _halt() internal virtual whenNotHalt {
        _isHalt = true;
        emit Halt(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be _isHalt.
     */
    // function _unhalt() internal virtual whenHalt {
    //     _isHalt = false;
    //     emit Unhalt(_msgSender());
    // }
}


// 
/**
 * @dev Implementation of the {IBEP20} 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 {BEP20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-BEP20-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 BEP20 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 {IBEP20-approve}.
 */
contract BEP20 is Context, IBEP20, Ownable {
    using SafeMath for uint256;
    using Address for address;

    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name, string memory symbol) public {
        _name = name;
        _symbol = symbol;
        _decimals = 18;
    }

    /**
     * @dev Returns the bep token owner.
     */
    function getOwner() external override view returns (address) {
        return owner();
    }

    /**
     * @dev Returns the token name.
     */
    function name() public override view returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the token decimals.
     */
    function decimals() public override view returns (uint8) {
        return _decimals;
    }

    /**
     * @dev Returns the token symbol.
     */
    function symbol() public override view returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {BEP20-totalSupply}.
     */
    function totalSupply() public override view returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {BEP20-balanceOf}.
     */
    function balanceOf(address account) public override view returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {BEP20-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 override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {BEP20-allowance}.
     */
    function allowance(address owner, address spender) public override view returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {BEP20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {BEP20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {BEP20};
     *
     * 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 override returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(
            sender,
            _msgSender(),
            _allowances[sender][_msgSender()].sub(amount, 'BEP20: 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 {BEP20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public 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 {BEP20-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 returns (bool) {
        _approve(
            _msgSender(),
            spender,
            _allowances[_msgSender()][spender].sub(subtractedValue, 'BEP20: decreased allowance below zero')
        );
        return true;
    }

    /**
     * @dev Creates `amount` tokens and assigns them to `msg.sender`, increasing
     * the total supply.
     *
     * Requirements
     *
     * - `msg.sender` must be the token owner
     */
    function mint(uint256 amount) public onlyOwner returns (bool) {
        _mint(_msgSender(), amount);
        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 {
        require(sender != address(0), 'BEP20: transfer from the zero address');
        require(recipient != address(0), 'BEP20: transfer to the zero address');

        _balances[sender] = _balances[sender].sub(amount, 'BEP20: 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 {
        require(account != address(0), 'BEP20: mint to the zero address');

        _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 {
        require(account != address(0), 'BEP20: burn from the zero address');

        _balances[account] = _balances[account].sub(amount, 'BEP20: 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 {
        require(owner != address(0), 'BEP20: approve from the zero address');
        require(spender != address(0), 'BEP20: approve to the zero address');

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`.`amount` is then deducted
     * from the caller's allowance.
     *
     * See {_burn} and {_approve}.
     */
    function _burnFrom(address account, uint256 amount) internal {
        _burn(account, amount);
        _approve(
            account,
            _msgSender(),
            _allowances[account][_msgSender()].sub(amount, 'BEP20: burn amount exceeds allowance')
        );
    }
}


// VelhallaToken with Governance.
contract VelhallaToken is BEP20('Velhalla Token', 'VHT') {
    /// @notice Creates `_amount` token to `_to`. Must only be called by the owner (VelhallaStaking).
    function mint(address _to, uint256 _amount) external onlyOwner {
        _mint(_to, _amount);
    }

    function burn(address _from ,uint256 _amount) external onlyOwner {
        _burn(_from, _amount);
    }

    // The SCAR TOKEN!
    IBEP20 public scar;


    constructor(
        IBEP20 _scar
    ) public {
        scar = _scar;
    }

    // Safe scar transfer function, just in case if rounding error causes pool to not have enough SCARs.
    function safeScarTransfer(address _to, uint256 _amount) external onlyOwner {
        uint256 scarBal = scar.balanceOf(address(this));
        if (_amount > scarBal) {
            scar.transfer(_to,scarBal);
        } else {
            scar.transfer(_to, _amount);
        }
    }

}


// VelhallaStaking is the master of SCAR. He can distribute SCAR and he is a fair guy.
//
// Note that it's ownable and the owner wields tremendous power. The ownership
// will be transferred to a governance smart contract once SCAR is sufficiently
// distributed and the community can show to govern itself.
//
// Have fun reading it. Hopefully it's bug-free. God bless.
contract VelhallaStaking is Ownable, Pausable, Haltable {
    using SafeMath for uint256;
    using SafeBEP20 for IBEP20;

    // Info of each user.
    struct UserInfo {
        uint256 amount;     // How many LP tokens the user has provided.
        uint256 rewardDebt; // Reward debt. See explanation below.
        uint256 lastDepositedTime;  // keeps track of deposited time for withdraw lock
        //
        // We do some fancy math here. Basically, any point in time, the amount of SCARs
        // entitled to a user but is pending to be distributed is:
        //
        //   pending reward = (user.amount * pool.accScarPerShare) - user.rewardDebt
        //
        // Whenever a user deposits or withdraws LP tokens to a pool. Here's what happens:
        //   1. The pool's `accScarPerShare` (and `lastRewardBlock`) gets updated.
        //   2. User receives the pending reward sent to his/her address.
        //   3. User's `amount` gets updated.
        //   4. User's `rewardDebt` gets updated.
    }

    // Info of each pool.
    struct PoolInfo {
        IBEP20 lpToken;           // Address of LP token contract.
        uint256 allocPoint;       // How many allocation points assigned to this pool. SCARs to distribute per block.
        uint256 lastRewardBlock;  // Last block number that SCARs distribution occurs.
        uint256 accScarPerShare; // Accumulated SCARs per share, times 1e12. See below.
        uint256 totalStaked;    // Record total staked SCAR from user
    }

    // The SCAR TOKEN!
    IBEP20 public scar;
    // The Velhalla TOKEN!
    VelhallaToken public vht;
    // SCAR tokens reward per block. 15000000*1e18 * 0.4 / (240*24*60*60), about 0.289 SCAR per block. total 15000000 SCAR token for 240 days, where 3 second/block
    uint256 private scarPerBlock = 289351851851852000;
    // Bonus muliplier for early scar makers.
    uint256 public BONUS_MULTIPLIER = 100;  // defalut 100%
    // SCAR tokens reward per block. 15000000*1e18 * 0.4 / (240*24*60*60), about 0.289 SCAR per block. total 15000000 SCAR token for 240 days, where 3 second/block
    uint256 public scarPerBlockAfterMultiplier;
    // Info of each pool.
    PoolInfo[] public poolInfo;
    // Info of each user that stakes LP tokens.
    mapping (uint256 => mapping (address => UserInfo)) public userInfo;
    // Total allocation poitns. Must be the sum of all allocation points in all pools.
    uint256 public totalAllocPoint = 0;
    // The block number when SCAR mining starts.
    uint256 public startBlock = 1;

    uint256 public withdrawLockPeriod = 2 weeks; //  lock for 2 weeks
    bool public leaveStakingLock = true;
    bool public emergencyWithdrawLock =true;

    event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
    event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
    event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);
    event Pause();
    event Unpause();
    event Halt();

    constructor(
        IBEP20 _scar,
        VelhallaToken _vht
    ) public {
        scar = _scar;
        vht = _vht;

        scarPerBlockAfterMultiplier = scarPerBlock;

        // staking pool
        poolInfo.push(PoolInfo({
            lpToken: _scar,
            allocPoint: 1000,
            lastRewardBlock: startBlock,
            accScarPerShare: 0,
            totalStaked: 0
        }));

        totalAllocPoint = 1000;

    }

    function updateMultiplier(uint256 multiplierNumber) external onlyOwner whenNotHalt {
        require(multiplierNumber >= 100, "Bouns must large than 100%");
        BONUS_MULTIPLIER = multiplierNumber;
        scarPerBlockAfterMultiplier = scarPerBlock.mul(BONUS_MULTIPLIER).div(100);
    }

    function poolLength() external view returns (uint256) {
        return poolInfo.length;
    }

    // Return reward multiplier over the given _from to _to block.
    function getMultiplier(uint256 _from, uint256 _to) internal view returns (uint256) {
        return _to.sub(_from).mul(BONUS_MULTIPLIER);
    }

    // View function to see pending SCARs on frontend. 
    function pendingScar(address _user) external view returns (uint256) {
        PoolInfo storage pool = poolInfo[0];
        UserInfo storage user = userInfo[0][_user];
        uint256 accScarPerShare = pool.accScarPerShare;
        if (block.number > pool.lastRewardBlock && pool.totalStaked != 0 && !isHalt()) {
            uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
            uint256 scarReward = multiplier.mul(scarPerBlock).mul(pool.allocPoint).div(totalAllocPoint).div(100);   // defalut 100%
            accScarPerShare = accScarPerShare.add(scarReward.mul(1e31).div(pool.totalStaked));
        }
        return user.amount.mul(accScarPerShare).div(1e31).sub(user.rewardDebt);
    }


    // Update reward variables of the given pool to be up-to-date.
    function updatePool() public whenNotPaused whenNotHalt {
        PoolInfo storage pool = poolInfo[0];
        if (block.number <= pool.lastRewardBlock) {
            return;
        }
        if (pool.totalStaked == 0) {
            pool.lastRewardBlock = block.number;
            return;
        }
        uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
        uint256 scarReward = multiplier.mul(scarPerBlock).mul(pool.allocPoint).div(totalAllocPoint).div(100);   // defalut 100%

        uint256 totalReward = pool.lpToken.balanceOf(address(this)).sub(pool.totalStaked);
        if (scarReward > totalReward)   // Stop giving out rewards when VelhallaStaking contract run out of funds. Keep pending without modifying pool.lastRewardBlock until extra funds injected.
        {
            return;
        }
        
        scar.transfer(address(vht), scarReward);

        pool.accScarPerShare = pool.accScarPerShare.add(scarReward.mul(1e31).div(pool.totalStaked));
        pool.lastRewardBlock = block.number;
    }


    // Stake SCAR tokens to VelhallaStaking
    function enterStaking(uint256 _amount) internal whenNotPaused whenNotHalt{
        PoolInfo storage pool = poolInfo[0];
        UserInfo storage user = userInfo[0][msg.sender];
        updatePool();
        if (user.amount > 0) {
            uint256 pending = user.amount.mul(pool.accScarPerShare).div(1e31).sub(user.rewardDebt);

            if(pending > 0) {
                safeScarTransfer(msg.sender, pending);     // Before staking, claim the reward back to user
            }
        }
        if(_amount > 0) {
            pool.lpToken.safeTransferFrom(address(msg.sender), address(this), _amount);     // VelhallaStaking rceives user's SCAR
            pool.totalStaked = pool.totalStaked.add(_amount);
            user.amount = user.amount.add(_amount);
        }
        user.rewardDebt = user.amount.mul(pool.accScarPerShare).div(1e31);
        user.lastDepositedTime = block.timestamp;

        vht.mint(msg.sender, _amount);
        emit Deposit(msg.sender, 0, _amount);
    }

    // Withdraw SCAR tokens from STAKING.
    function leaveStaking(uint256 _amount) internal whenNotPaused{
        PoolInfo storage pool = poolInfo[0];
        UserInfo storage user = userInfo[0][msg.sender];
        require(user.amount >= _amount, "withdraw: not good");

        if(!isHalt()){
            updatePool();
        }
        
        uint256 pending = user.amount.mul(pool.accScarPerShare).div(1e31).sub(user.rewardDebt);
        if(pending > 0) {
            safeScarTransfer(msg.sender, pending);
        }
        if(_amount > 0) {
            user.amount = user.amount.sub(_amount);
            pool.totalStaked = pool.totalStaked.sub(_amount);
            pool.lpToken.safeTransfer(address(msg.sender), _amount);
        }
        user.rewardDebt = user.amount.mul(pool.accScarPerShare).div(1e31);

        vht.burn(msg.sender, _amount);
        emit Withdraw(msg.sender, 0, _amount);
    }

    function deposit(uint256 _amount) external whenNotPaused whenNotHalt{
        enterStaking(_amount);
    }

    function claim() external whenNotPaused whenNotHalt{
        leaveStaking(0);
    }

    function withdraw(uint256 _amount) external whenNotPaused{
        UserInfo storage user = userInfo[0][msg.sender];
        if(leaveStakingLock == true)
            require(block.timestamp > user.lastDepositedTime.add(withdrawLockPeriod), "The withdraw lock time has not yet expired");
        leaveStaking(_amount);
    }

    /**
     * @notice Triggers stopped state
     * @dev Only possible when contract not paused.
     */
    function pause() external onlyOwner whenNotPaused whenNotHalt{
        _pause();
        emit Pause();
    }

    /**
     * @notice Returns to normal state
     * @dev Only possible when contract is paused.
     */
    function unpause() external onlyOwner whenPaused whenNotHalt{
        _unpause();
        emit Unpause();
    }

    /**
     * @notice Triggers halt
     * @dev Only possible when contract not paused.
     */
    function halt() external onlyOwner whenNotPaused whenNotHalt{
        updatePool();
        setLeaveStakingLock(false);
        _halt();
        emit Halt();
    }


    function getTotalStakeValue() public view returns (uint256) {
        return poolInfo[0].totalStaked;
    }

    function getWithdrawLockTime(address _user) external view returns (uint256) {
        UserInfo storage user = userInfo[0][_user];
        if (block.timestamp > user.lastDepositedTime.add(withdrawLockPeriod))
            return 0;
        return user.lastDepositedTime.add(withdrawLockPeriod).sub(block.timestamp);
    }
    

    function setLeaveStakingLock(bool _leaveStakingLock) public onlyOwner {
        leaveStakingLock = _leaveStakingLock;
    }
    function setEmergencyWithdrawLock(bool _emergencyWithdrawLock) external onlyOwner{
        emergencyWithdrawLock = _emergencyWithdrawLock;
    }

    function transferRemainingRewardBackToOwner() external onlyOwner whenHalt{
        uint256 totalReward = scar.balanceOf(address(this)).sub(poolInfo[0].totalStaked);
        scar.transfer(address(_msgSender()), totalReward);
    }

    // Safe scar transfer function, just in case if rounding error causes pool to not have enough SCARs.
    function safeScarTransfer(address _to, uint256 _amount) internal {
        vht.safeScarTransfer(_to, _amount);
    }

}
        

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_scar","internalType":"contract IBEP20"},{"type":"address","name":"_vht","internalType":"contract VelhallaToken"}]},{"type":"event","name":"Deposit","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"EmergencyWithdraw","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Halt","inputs":[],"anonymous":false},{"type":"event","name":"Halt","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Pause","inputs":[],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Unpause","inputs":[],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Withdraw","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"uint256","name":"pid","internalType":"uint256","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"BONUS_MULTIPLIER","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"claim","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"deposit","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"emergencyWithdrawLock","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getTotalStakeValue","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getWithdrawLockTime","inputs":[{"type":"address","name":"_user","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"halt","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isHalt","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"leaveStakingLock","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"pendingScar","inputs":[{"type":"address","name":"_user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"lpToken","internalType":"contract IBEP20"},{"type":"uint256","name":"allocPoint","internalType":"uint256"},{"type":"uint256","name":"lastRewardBlock","internalType":"uint256"},{"type":"uint256","name":"accScarPerShare","internalType":"uint256"},{"type":"uint256","name":"totalStaked","internalType":"uint256"}],"name":"poolInfo","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"poolLength","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IBEP20"}],"name":"scar","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"scarPerBlockAfterMultiplier","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setEmergencyWithdrawLock","inputs":[{"type":"bool","name":"_emergencyWithdrawLock","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setLeaveStakingLock","inputs":[{"type":"bool","name":"_leaveStakingLock","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"startBlock","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalAllocPoint","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferRemainingRewardBackToOwner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unpause","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateMultiplier","inputs":[{"type":"uint256","name":"multiplierNumber","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updatePool","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"uint256","name":"rewardDebt","internalType":"uint256"},{"type":"uint256","name":"lastDepositedTime","internalType":"uint256"}],"name":"userInfo","inputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract VelhallaToken"}],"name":"vht","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"uint256","name":"_amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"withdrawLockPeriod","inputs":[]}]
            

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106101e55760003560e01c8063715018a61161010f578063b6b55f25116100a2578063e3161ddd11610071578063e3161ddd1461041d578063f2fde38b14610425578063f61159ed1461044b578063fde90a1d14610453576101e5565b8063b6b55f25146103d1578063bbe6ce23146103ee578063c558dc92146103f6578063d119a53c146103fe576101e5565b80638c12ed32116100de5780638c12ed321461036f5780638da5cb5b1461037757806393f1a40b1461037f578063a619cfcb146103c9576101e5565b8063715018a61461034f57806378d473a0146103575780638456cb591461035f5780638aa2855014610367576101e5565b80632fda2f38116101875780635c975abb116101565780635c975abb146102fc5780635ed7ca5b146103045780635ffe61461461030c57806367f94c7c14610329576101e5565b80632fda2f38146102c05780633f4ba83a146102e457806348cd4cb1146102ec5780634e71d92d146102f4576101e5565b806317caf6f1116101c357806317caf6f1146102775780632628490f1461027f578063293d31b7146102875780632e1a7d4d146102a3576101e5565b8063081e3eda146101ea57806311d6804f146102045780631526fe2714610225575b600080fd5b6101f2610479565b60408051918252519081900360200190f35b6102236004803603602081101561021a57600080fd5b5035151561047f565b005b6102426004803603602081101561023b57600080fd5b50356104f1565b604080516001600160a01b03909616865260208601949094528484019290925260608401526080830152519081900360a00190f35b6101f2610539565b6101f261053f565b61028f610545565b604080519115158252519081900360200190f35b610223600480360360208110156102b957600080fd5b503561054e565b6102c8610622565b604080516001600160a01b039092168252519081900360200190f35b610223610631565b6101f2610750565b610223610756565b61028f6107f3565b610223610803565b6102236004803603602081101561032257600080fd5b5035610931565b6101f26004803603602081101561033f57600080fd5b50356001600160a01b0316610a48565b610223610abb565b610223610b5d565b610223610d2e565b6101f2610e4a565b61028f610e50565b6102c8610e60565b6103ab6004803603604081101561039557600080fd5b50803590602001356001600160a01b0316610e6f565b60408051938452602084019290925282820152519081900360600190f35b6101f2610e9b565b610223600480360360208110156103e757600080fd5b5035610ea1565b61028f610f3e565b6102c8610f4c565b6102236004803603602081101561041457600080fd5b50351515610f5b565b610223610fc6565b6102236004803603602081101561043b57600080fd5b50356001600160a01b0316611213565b6101f2611274565b6101f26004803603602081101561046957600080fd5b50356001600160a01b031661129b565b60065490565b6104876113c3565b6000546001600160a01b039081169116146104d7576040805162461bcd60e51b81526020600482018190526024820152600080516020612149833981519152604482015290519081900360640190fd5b600b80549115156101000261ff0019909216919091179055565b600681815481106104fe57fe5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b0390931694509092909185565b60085481565b600a5481565b600b5460ff1681565b6105566107f3565b1561059b576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b3360009081526000805160206121b183398151915260205260409020600b5460ff1615156001141561061557600a5460028201546105d8916113c7565b42116106155760405162461bcd60e51b815260040180806020018281038252602a8152602001806120fe602a913960400191505060405180910390fd5b61061e8261142a565b5050565b6002546001600160a01b031681565b6106396113c3565b6000546001600160a01b03908116911614610689576040805162461bcd60e51b81526020600482018190526024820152600080516020612149833981519152604482015290519081900360640190fd5b6106916107f3565b6106d9576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6106e1610e50565b1561071d5760405162461bcd60e51b815260040180806020018281038252603c8152602001806120c2603c913960400191505060405180910390fd5b610725611669565b6040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60095481565b61075e6107f3565b156107a3576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6107ab610e50565b156107e75760405162461bcd60e51b815260040180806020018281038252603c8152602001806120c2603c913960400191505060405180910390fd5b6107f1600061142a565b565b600054600160a01b900460ff1690565b61080b6113c3565b6000546001600160a01b0390811691161461085b576040805162461bcd60e51b81526020600482018190526024820152600080516020612149833981519152604482015290519081900360640190fd5b6108636107f3565b156108a8576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6108b0610e50565b156108ec5760405162461bcd60e51b815260040180806020018281038252603c8152602001806120c2603c913960400191505060405180910390fd5b6108f4610fc6565b6108fe6000610f5b565b61090661170c565b6040517fa8d1ea886eaf8bd3d113c770bf7af546123c70e235b0d036ff752d5e920a7b5690600090a1565b6109396113c3565b6000546001600160a01b03908116911614610989576040805162461bcd60e51b81526020600482018190526024820152600080516020612149833981519152604482015290519081900360640190fd5b610991610e50565b156109cd5760405162461bcd60e51b815260040180806020018281038252603c8152602001806120c2603c913960400191505060405180910390fd5b6064811015610a23576040805162461bcd60e51b815260206004820152601a60248201527f426f756e73206d757374206c61726765207468616e2031303025000000000000604482015290519081900360640190fd5b6004819055600354610a4290606490610a3c908461178c565b906117e5565b60055550565b6001600160a01b03811660009081526000805160206121b183398151915260205260408120600a546002820154610a7e916113c7565b421115610a8f576000915050610ab6565b610ab242610aac600a5484600201546113c790919063ffffffff16565b90611827565b9150505b919050565b610ac36113c3565b6000546001600160a01b03908116911614610b13576040805162461bcd60e51b81526020600482018190526024820152600080516020612149833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b610b656113c3565b6000546001600160a01b03908116911614610bb5576040805162461bcd60e51b81526020600482018190526024820152600080516020612149833981519152604482015290519081900360640190fd5b610bbd610e50565b610bf85760405162461bcd60e51b81526004018080602001828103825260488152602001806121696048913960600191505060405180910390fd5b6000610c9c6006600081548110610c0b57fe5b60009182526020918290206004600590920201810154600154604080516370a0823160e01b815230948101949094525191936001600160a01b03909116926370a082319260248083019392829003018186803b158015610c6a57600080fd5b505afa158015610c7e573d6000803e3d6000fd5b505050506040513d6020811015610c9457600080fd5b505190611827565b6001549091506001600160a01b031663a9059cbb610cb86113c3565b836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610cff57600080fd5b505af1158015610d13573d6000803e3d6000fd5b505050506040513d6020811015610d2957600080fd5b505050565b610d366113c3565b6000546001600160a01b03908116911614610d86576040805162461bcd60e51b81526020600482018190526024820152600080516020612149833981519152604482015290519081900360640190fd5b610d8e6107f3565b15610dd3576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b610ddb610e50565b15610e175760405162461bcd60e51b815260040180806020018281038252603c8152602001806120c2603c913960400191505060405180910390fd5b610e1f611869565b6040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b60045481565b600054600160a81b900460ff1690565b6000546001600160a01b031690565b600760209081526000928352604080842090915290825290208054600182015460029092015490919083565b60055481565b610ea96107f3565b15610eee576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b610ef6610e50565b15610f325760405162461bcd60e51b815260040180806020018281038252603c8152602001806120c2603c913960400191505060405180910390fd5b610f3b816118f2565b50565b600b54610100900460ff1681565b6001546001600160a01b031681565b610f636113c3565b6000546001600160a01b03908116911614610fb3576040805162461bcd60e51b81526020600482018190526024820152600080516020612149833981519152604482015290519081900360640190fd5b600b805460ff1916911515919091179055565b610fce6107f3565b15611013576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b61101b610e50565b156110575760405162461bcd60e51b815260040180806020018281038252603c8152602001806120c2603c913960400191505060405180910390fd5b6000600660008154811061106757fe5b906000526020600020906005020190508060020154431161108857506107f1565b600481015461109d57436002909101556107f1565b60006110ad826002015443611b30565b905060006110df6064610a3c600854610a3c87600101546110d96003548961178c90919063ffffffff16565b9061178c565b6004808501548554604080516370a0823160e01b8152309481019490945251939450600093611139936001600160a01b03909216916370a08231916024808301926020929190829003018186803b158015610c6a57600080fd5b90508082111561114c57505050506107f1565b6001546002546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018690529051919092169163a9059cbb9160448083019260209291908290030181600087803b1580156111a557600080fd5b505af11580156111b9573d6000803e3d6000fd5b505050506040513d60208110156111cf57600080fd5b505060048401546111ff906111f490610a3c8568fc6f7c40458122964d601f1b61178c565b6003860154906113c7565b600385015550504360029092019190915550565b61121b6113c3565b6000546001600160a01b0390811691161461126b576040805162461bcd60e51b81526020600482018190526024820152600080516020612149833981519152604482015290519081900360640190fd5b610f3b81611b44565b6000600660008154811061128457fe5b906000526020600020906005020160040154905090565b60008060066000815481106112ac57fe5b600091825260208083206001600160a01b03871684526000805160206121b183398151915290915260409092206003600590920290920190810154600282015491935090431180156113015750600483015415155b80156113125750611310610e50565b155b1561138b576000611327846002015443611b30565b905060006113536064610a3c600854610a3c89600101546110d96003548961178c90919063ffffffff16565b905061138661137f8660040154610a3c68fc6f7c40458122964d601f1b8561178c90919063ffffffff16565b84906113c7565b925050505b6113ba8260010154610aac68fc6f7c40458122964d601f1b610a3c85876000015461178c90919063ffffffff16565b95945050505050565b3390565b600082820183811015611421576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b6114326107f3565b15611477576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6000600660008154811061148757fe5b600091825260208083203384526000805160206121b18339815191529091526040909220805460059092029092019250831115611500576040805162461bcd60e51b81526020600482015260126024820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b604482015290519081900360640190fd5b611508610e50565b61151457611514610fc6565b60006115498260010154610aac68fc6f7c40458122964d601f1b610a3c8760030154876000015461178c90919063ffffffff16565b9050801561155b5761155b3382611be4565b831561159957815461156d9085611827565b8255600483015461157e9085611827565b60048401558254611599906001600160a01b03163386611c55565b600383015482546115bb9168fc6f7c40458122964d601f1b91610a3c9161178c565b600183015560025460408051632770a7eb60e21b81523360048201526024810187905290516001600160a01b0390921691639dc29fac9160448082019260009290919082900301818387803b15801561161357600080fd5b505af1158015611627573d6000803e3d6000fd5b5050604080518781529051600093503392507ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360200190a350505050565b6116716107f3565b6116b9576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6116ef6113c3565b604080516001600160a01b039092168252519081900360200190a1565b611714610e50565b156117505760405162461bcd60e51b815260040180806020018281038252603c8152602001806120c2603c913960400191505060405180910390fd5b6000805460ff60a81b1916600160a81b1790557f553ecabd0db41a2351346d8e53c7809e606601ae528edc6e6a10b41565a60c5a6116ef6113c3565b60008261179b57506000611424565b828202828482816117a857fe5b04146114215760405162461bcd60e51b81526004018080602001828103825260218152602001806121286021913960400191505060405180910390fd5b600061142183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611ca7565b600061142183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d49565b6118716107f3565b156118b6576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586116ef6113c3565b6118fa6107f3565b1561193f576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b611947610e50565b156119835760405162461bcd60e51b815260040180806020018281038252603c8152602001806120c2603c913960400191505060405180910390fd5b6000600660008154811061199357fe5b600091825260208083203384526000805160206121b18339815191529091526040909220600590910290910191506119c9610fc6565b805415611a19576000611a058260010154610aac68fc6f7c40458122964d601f1b610a3c8760030154876000015461178c90919063ffffffff16565b90508015611a1757611a173382611be4565b505b8215611a59578154611a36906001600160a01b0316333086611da3565b6004820154611a4590846113c7565b60048301558054611a5690846113c7565b81555b60038201548154611a7b9168fc6f7c40458122964d601f1b91610a3c9161178c565b60018201554260028083019190915554604080516340c10f1960e01b81523360048201526024810186905290516001600160a01b03909216916340c10f199160448082019260009290919082900301818387803b158015611adb57600080fd5b505af1158015611aef573d6000803e3d6000fd5b5050604080518681529051600093503392507f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a3505050565b600454600090611421906110d98486611827565b6001600160a01b038116611b895760405162461bcd60e51b815260040180806020018281038252602681526020018061209c6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600254604080516387967c9960e01b81526001600160a01b03858116600483015260248201859052915191909216916387967c9991604480830192600092919082900301818387803b158015611c3957600080fd5b505af1158015611c4d573d6000803e3d6000fd5b505050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610d29908490611e03565b60008183611d335760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611cf8578181015183820152602001611ce0565b50505050905090810190601f168015611d255780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611d3f57fe5b0495945050505050565b60008184841115611d9b5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611cf8578181015183820152602001611ce0565b505050900390565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052611dfd908590611e03565b50505050565b6060611e58826040518060400160405280602081526020017f5361666542455032303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611eb49092919063ffffffff16565b805190915015610d2957808060200190516020811015611e7757600080fd5b5051610d295760405162461bcd60e51b815260040180806020018281038252602a815260200180612072602a913960400191505060405180910390fd5b6060611ec38484600085611ecb565b949350505050565b6060611ed685612038565b611f27576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b60208310611f665780518252601f199092019160209182019101611f47565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114611fc8576040519150601f19603f3d011682016040523d82523d6000602084013e611fcd565b606091505b50915091508115611fe1579150611ec39050565b805115611ff15780518082602001fd5b60405162461bcd60e51b8152602060048201818152865160248401528651879391928392604401919085019080838360008315611cf8578181015183820152602001611ce0565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590611ec357505015159291505056fe5361666542455032303a204245503230206f7065726174696f6e20646964206e6f7420737563636565644f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737348616c743a2054686520636f6e747261637420686173206265656e2068616c742c20796f752063616e206a757374207769746864726177206e6f772e546865207769746864726177206c6f636b2074696d6520686173206e6f74207965742065787069726564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657248616c743a204e6f742068616c742c20746869732066756e6374696f6e2063616e206f6e6c792062652075736564207768656e20636f6e7472616374206265696e672068616c742e6d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6dfa2646970667358221220422ac40c4dc322044bcf2350a3cda7cc0cfe044c4b8bdbacf36caf25cd5436e964736f6c634300060c0033