ETH Price: $2,277.13 (+1.97%)

Contract

0x9D2390247921974b1A697a4ebC8CD88aBe93bF0A
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Create Lock With...163116552023-01-01 11:35:47615 days ago1672572947IN
0x9D239024...aBe93bF0A
0 ETH0.007656713
Create Lock With...163056532022-12-31 15:31:23616 days ago1672500683IN
0x9D239024...aBe93bF0A
0 ETH0.0101631416.4430841
Create Lock With...162923732022-12-29 19:01:59618 days ago1672340519IN
0x9D239024...aBe93bF0A
0 ETH0.0087859920.54626789
Create Lock With...162923092022-12-29 18:49:11618 days ago1672339751IN
0x9D239024...aBe93bF0A
0 ETH0.0073952717.29404106
Create Lock With...162922932022-12-29 18:45:59618 days ago1672339559IN
0x9D239024...aBe93bF0A
0 ETH0.0083930715.22480741
Create Lock With...162920312022-12-29 17:53:23618 days ago1672336403IN
0x9D239024...aBe93bF0A
0 ETH0.0096794522.63564522
Create Lock With...162849262022-12-28 18:04:23619 days ago1672250663IN
0x9D239024...aBe93bF0A
0 ETH0.012624520.26795919
Create Lock With...162831092022-12-28 11:59:59619 days ago1672228799IN
0x9D239024...aBe93bF0A
0 ETH0.0076072712.63105905
Create Lock With...162830382022-12-28 11:45:47619 days ago1672227947IN
0x9D239024...aBe93bF0A
0 ETH0.0086613613.90561637
Create Lock With...162825502022-12-28 10:07:47619 days ago1672222067IN
0x9D239024...aBe93bF0A
0 ETH0.007928713.27052733
Create Lock With...162709372022-12-26 19:12:23621 days ago1672081943IN
0x9D239024...aBe93bF0A
0 ETH0.0128698820.1098281
Create Lock With...162540572022-12-24 10:39:59623 days ago1671878399IN
0x9D239024...aBe93bF0A
0 ETH0.0081270313.04725831
Create Lock With...162508542022-12-23 23:56:35624 days ago1671839795IN
0x9D239024...aBe93bF0A
0 ETH0.0070101111.34154498
Create Lock With...162202682022-12-19 17:34:47628 days ago1671471287IN
0x9D239024...aBe93bF0A
0 ETH0.0122945419.89111974
Create Lock With...162141482022-12-18 21:04:47629 days ago1671397487IN
0x9D239024...aBe93bF0A
0 ETH0.0085906213.89889142
Create Lock With...162140492022-12-18 20:44:47629 days ago1671396287IN
0x9D239024...aBe93bF0A
0 ETH0.0076859412.43519493
Create Lock With...162139752022-12-18 20:29:59629 days ago1671395399IN
0x9D239024...aBe93bF0A
0 ETH0.0078816112.40848128
Create Lock With...162139262022-12-18 20:20:11629 days ago1671394811IN
0x9D239024...aBe93bF0A
0 ETH0.0080757513.06588094
Create Lock With...162124992022-12-18 15:33:35629 days ago1671377615IN
0x9D239024...aBe93bF0A
0 ETH0.0080062714
Create Lock With...162124702022-12-18 15:27:47629 days ago1671377267IN
0x9D239024...aBe93bF0A
0 ETH0.0075003313.11529872
Create Lock With...162124462022-12-18 15:22:59629 days ago1671376979IN
0x9D239024...aBe93bF0A
0 ETH0.0074092312.57983992
Create Lock With...162071772022-12-17 21:43:35630 days ago1671313415IN
0x9D239024...aBe93bF0A
0 ETH0.0077528112.54337792
Create Lock With...161919982022-12-15 18:51:23632 days ago1671130283IN
0x9D239024...aBe93bF0A
0 ETH0.0181410829.12452663
Create Lock With...161839872022-12-14 16:00:11633 days ago1671033611IN
0x9D239024...aBe93bF0A
0 ETH0.0069653315.66187294
Create Lock With...161701842022-12-12 17:42:47635 days ago1670866967IN
0x9D239024...aBe93bF0A
0 ETH0.0112835117.76394143
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MAHAReferralV1

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 100 runs

Other Settings:
default evmVersion
File 1 of 13 : MAHAReferralV1.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {INFTLocker} from "../interfaces/INFTLocker.sol";
import {IERC20} from "@openzeppelin/contracts/interfaces/IERC20.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";

contract MAHAReferralV1 is Ownable {
    INFTLocker public locker;
    IERC20 public maha;
    uint256 public minLockDuration;
    uint256 public referralDenominator = 10;
    address internal me;

    event ReferralPaid(
        address indexed who,
        address indexed referral,
        uint256 amt,
        uint256 mahax
    );

    constructor(
        INFTLocker _locker,
        IERC20 _maha,
        uint256 _minLockDuration
    ) {
        locker = _locker;
        maha = _maha;
        minLockDuration = _minLockDuration;

        maha.approve(
            address(locker),
            0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
        );

        me = address(this);
    }

    function createLockWithReferral(
        uint256 _value,
        uint256 _lockDuration,
        bool _stakeNFT,
        address referral
    ) external {
        maha.transferFrom(msg.sender, me, _value);

        uint256 nftId = locker.createLockFor(
            _value,
            _lockDuration,
            msg.sender,
            _stakeNFT
        );

        if (_lockDuration > minLockDuration && referral != address(0)) {
            uint256 mahax = locker.balanceOfNFT(nftId);
            uint256 reward = mahax / referralDenominator; // give 10% of the mahax value as referral

            if (maha.balanceOf(me) > reward) {
                maha.transfer(referral, reward);
                emit ReferralPaid(referral, msg.sender, reward, mahax);
            }
        }
    }

    function setParams(uint256 _minLockDuration, uint256 _referralDenominator)
        external
        onlyOwner
    {
        minLockDuration = _minLockDuration;
        referralDenominator = _referralDenominator;
    }

    function refund() external onlyOwner {
        maha.transfer(msg.sender, maha.balanceOf(address(this)));
    }
}

File 2 of 13 : INFTLocker.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import {IERC721} from "@openzeppelin/contracts/interfaces/IERC721.sol";
import {IERC721Receiver} from "@openzeppelin/contracts/interfaces/IERC721Receiver.sol";
import {IRegistry} from "./IRegistry.sol";

interface INFTLocker is IERC721 {
    function registry() external view returns (IRegistry);

    function balanceOfNFT(uint256) external view returns (uint256);

    function isStaked(uint256) external view returns (bool);

    function epoch() external view returns (uint256);

    function userPointEpoch(uint256) external view returns (uint256);

    function userPointHistory(uint256, uint256)
        external
        view
        returns (Point memory);

    function pointHistory(uint256) external view returns (Point memory);

    function totalSupplyWithoutDecay() external view returns (uint256);

    function isApprovedOrOwner(address, uint256) external view returns (bool);

    function totalSupply() external view returns (uint256);

    function totalSupplyAt(uint256 _block) external view returns (uint256);

    function merge(uint256 _from, uint256 _to) external;

    function blockNumber() external view returns (uint256);

    function checkpoint() external;

    function depositFor(uint256 _tokenId, uint256 _value) external;

    function createLockFor(
        uint256 _value,
        uint256 _lockDuration,
        address _to,
        bool _stakeNFT
    ) external returns (uint256);

    function migrateTokenFor(
        uint256 _value,
        uint256 _lockDuration,
        address _to
    ) external returns (uint256);

    function createLock(
        uint256 _value,
        uint256 _lockDuration,
        bool _stakeNFT
    ) external returns (uint256);

    enum DepositType {
        DEPOSIT_FOR_TYPE,
        CREATE_LOCK_TYPE,
        INCREASE_LOCK_AMOUNT,
        INCREASE_UNLOCK_TIME,
        MERGE_TYPE
    }

    struct Point {
        int128 bias;
        int128 slope; // # -dweight / dt
        uint256 ts;
        uint256 blk; // block
    }

    /* We cannot really do block numbers per se b/c slope is per time, not per block
     * and per block could be fairly bad b/c Ethereum changes blocktimes.
     * What we can do is to extrapolate ***At functions */

    struct LockedBalance {
        int128 amount;
        uint256 end;
        uint256 start;
    }

    event Deposit(
        address indexed provider,
        uint256 tokenId,
        uint256 value,
        uint256 indexed locktime,
        DepositType deposit_type,
        uint256 ts
    );

    event Withdraw(
        address indexed provider,
        uint256 tokenId,
        uint256 value,
        uint256 ts
    );

    event Supply(uint256 prevSupply, uint256 supply);
}

File 3 of 13 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        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 {
        _transferOwnership(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");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 4 of 13 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol)

pragma solidity ^0.8.0;

import "../token/ERC20/IERC20.sol";

File 5 of 13 : IRegistry.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import {IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol";

interface IRegistry is IAccessControl {
    event MahaChanged(address indexed whom, address _old, address _new);
    event VoterChanged(address indexed whom, address _old, address _new);
    event LockerChanged(address indexed whom, address _old, address _new);
    event GovernorChanged(address indexed whom, address _old, address _new);
    event StakerChanged(address indexed whom, address _old, address _new);
    event EmissionControllerChanged(
        address indexed whom,
        address _old,
        address _new
    );

    function maha() external view returns (address);

    function gaugeVoter() external view returns (address);

    function locker() external view returns (address);

    function staker() external view returns (address);

    function emissionController() external view returns (address);

    function governor() external view returns (address);

    function getAllAddresses()
        external
        view
        returns (
            address,
            address,
            address,
            address,
            address
        );

    function ensureNotPaused() external;

    function setMAHA(address _new) external;

    function setEmissionController(address _new) external;

    function setStaker(address _new) external;

    function setVoter(address _new) external;

    function setLocker(address _new) external;

    function setGovernor(address _new) external;
}

File 6 of 13 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol)

pragma solidity ^0.8.0;

import "../token/ERC721/IERC721.sol";

File 7 of 13 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721Receiver.sol)

pragma solidity ^0.8.0;

import "../token/ERC721/IERC721Receiver.sol";

File 8 of 13 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 9 of 13 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 10 of 13 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 11 of 13 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 12 of 13 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with 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) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 13 of 13 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 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 `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, 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 `from` to `to` 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 from,
        address to,
        uint256 amount
    ) external returns (bool);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 100
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract INFTLocker","name":"_locker","type":"address"},{"internalType":"contract IERC20","name":"_maha","type":"address"},{"internalType":"uint256","name":"_minLockDuration","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"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":"who","type":"address"},{"indexed":true,"internalType":"address","name":"referral","type":"address"},{"indexed":false,"internalType":"uint256","name":"amt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mahax","type":"uint256"}],"name":"ReferralPaid","type":"event"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"uint256","name":"_lockDuration","type":"uint256"},{"internalType":"bool","name":"_stakeNFT","type":"bool"},{"internalType":"address","name":"referral","type":"address"}],"name":"createLockWithReferral","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"locker","outputs":[{"internalType":"contract INFTLocker","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maha","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minLockDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"referralDenominator","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"refund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minLockDuration","type":"uint256"},{"internalType":"uint256","name":"_referralDenominator","type":"uint256"}],"name":"setParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052600a60045534801561001557600080fd5b50604051610a27380380610a278339810160408190526100349161017e565b61003d33610107565b600180546001600160a01b03199081166001600160a01b0386811691821790935560028054909216928516928317909155600383905560405163095ea7b360e01b81526004810191909152600019602482015263095ea7b390604401602060405180830381600087803b1580156100b357600080fd5b505af11580156100c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100eb9190610157565b5050600580546001600160a01b03191630179055506101d89050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208284031215610168578081fd5b81518015158114610177578182fd5b9392505050565b600080600060608486031215610192578182fd5b835161019d816101c0565b60208501519093506101ae816101c0565b80925050604084015190509250925092565b6001600160a01b03811681146101d557600080fd5b50565b610840806101e76000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c80638da5cb5b116100665780638da5cb5b14610104578063c0324c7714610115578063d6a298e914610128578063d7b96d4e14610131578063f2fde38b1461014457600080fd5b80630cbc9527146100a3578063205765cc146100bf5780633de00c36146100d4578063590e1ae3146100f4578063715018a6146100fc575b600080fd5b6100ac60045481565b6040519081526020015b60405180910390f35b6100d26100cd366004610781565b610157565b005b6002546100e7906001600160a01b031681565b6040516100b691906107c8565b6100d2610490565b6100d26105a3565b6000546001600160a01b03166100e7565b6100d2610123366004610760565b6105b7565b6100ac60035481565b6001546100e7906001600160a01b031681565b6100d261015236600461070b565b6105ca565b6002546005546040516323b872dd60e01b81523360048201526001600160a01b039182166024820152604481018790529116906323b872dd90606401602060405180830381600087803b1580156101ad57600080fd5b505af11580156101c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101e5919061072c565b50600154604051630a2abdb360e01b8152600481018690526024810185905233604482015283151560648201526000916001600160a01b031690630a2abdb390608401602060405180830381600087803b15801561024257600080fd5b505af1158015610256573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027a9190610748565b90506003548411801561029557506001600160a01b03821615155b15610489576001546040516339f890b560e21b8152600481018390526000916001600160a01b03169063e7e242d49060240160206040518083038186803b1580156102df57600080fd5b505afa1580156102f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103179190610748565b905060006004548261032991906107dc565b6002546005546040516370a0823160e01b815292935083926001600160a01b03928316926370a0823192610362929116906004016107c8565b60206040518083038186803b15801561037a57600080fd5b505afa15801561038e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b29190610748565b11156104865760025460405163a9059cbb60e01b81526001600160a01b038681166004830152602482018490529091169063a9059cbb90604401602060405180830381600087803b15801561040657600080fd5b505af115801561041a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043e919061072c565b50604080518281526020810184905233916001600160a01b038716917f65db98422e8b7340e0d6dfa99bbadd4ba95a51fefafd8f0e1cbbb2e819429a42910160405180910390a35b50505b5050505050565b610498610645565b6002546040516370a0823160e01b81526001600160a01b039091169063a9059cbb90339083906370a08231906104d29030906004016107c8565b60206040518083038186803b1580156104ea57600080fd5b505afa1580156104fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105229190610748565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561056857600080fd5b505af115801561057c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a0919061072c565b50565b6105ab610645565b6105b5600061069f565b565b6105bf610645565b600391909155600455565b6105d2610645565b6001600160a01b03811661063c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6105a08161069f565b6000546001600160a01b031633146105b55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610633565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b038116811461070657600080fd5b919050565b60006020828403121561071c578081fd5b610725826106ef565b9392505050565b60006020828403121561073d578081fd5b8151610725816107fc565b600060208284031215610759578081fd5b5051919050565b60008060408385031215610772578081fd5b50508035926020909101359150565b60008060008060808587031215610796578182fd5b843593506020850135925060408501356107af816107fc565b91506107bd606086016106ef565b905092959194509250565b6001600160a01b0391909116815260200190565b6000826107f757634e487b7160e01b81526012600452602481fd5b500490565b80151581146105a057600080fdfea2646970667358221220a4fd7568481f41a86f7bcd81da5f097bc4640b6519a6cec7df18d8209454724f64736f6c63430008040033000000000000000000000000bdd8f4daf71c2cb16cce7e54bb81ef3cfcf5aacb000000000000000000000000b4d930279552397bba2ee473229f89ec245bc3650000000000000000000000000000000000000000000000000000000000278d00

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80638da5cb5b116100665780638da5cb5b14610104578063c0324c7714610115578063d6a298e914610128578063d7b96d4e14610131578063f2fde38b1461014457600080fd5b80630cbc9527146100a3578063205765cc146100bf5780633de00c36146100d4578063590e1ae3146100f4578063715018a6146100fc575b600080fd5b6100ac60045481565b6040519081526020015b60405180910390f35b6100d26100cd366004610781565b610157565b005b6002546100e7906001600160a01b031681565b6040516100b691906107c8565b6100d2610490565b6100d26105a3565b6000546001600160a01b03166100e7565b6100d2610123366004610760565b6105b7565b6100ac60035481565b6001546100e7906001600160a01b031681565b6100d261015236600461070b565b6105ca565b6002546005546040516323b872dd60e01b81523360048201526001600160a01b039182166024820152604481018790529116906323b872dd90606401602060405180830381600087803b1580156101ad57600080fd5b505af11580156101c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101e5919061072c565b50600154604051630a2abdb360e01b8152600481018690526024810185905233604482015283151560648201526000916001600160a01b031690630a2abdb390608401602060405180830381600087803b15801561024257600080fd5b505af1158015610256573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027a9190610748565b90506003548411801561029557506001600160a01b03821615155b15610489576001546040516339f890b560e21b8152600481018390526000916001600160a01b03169063e7e242d49060240160206040518083038186803b1580156102df57600080fd5b505afa1580156102f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103179190610748565b905060006004548261032991906107dc565b6002546005546040516370a0823160e01b815292935083926001600160a01b03928316926370a0823192610362929116906004016107c8565b60206040518083038186803b15801561037a57600080fd5b505afa15801561038e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b29190610748565b11156104865760025460405163a9059cbb60e01b81526001600160a01b038681166004830152602482018490529091169063a9059cbb90604401602060405180830381600087803b15801561040657600080fd5b505af115801561041a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043e919061072c565b50604080518281526020810184905233916001600160a01b038716917f65db98422e8b7340e0d6dfa99bbadd4ba95a51fefafd8f0e1cbbb2e819429a42910160405180910390a35b50505b5050505050565b610498610645565b6002546040516370a0823160e01b81526001600160a01b039091169063a9059cbb90339083906370a08231906104d29030906004016107c8565b60206040518083038186803b1580156104ea57600080fd5b505afa1580156104fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105229190610748565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561056857600080fd5b505af115801561057c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a0919061072c565b50565b6105ab610645565b6105b5600061069f565b565b6105bf610645565b600391909155600455565b6105d2610645565b6001600160a01b03811661063c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6105a08161069f565b6000546001600160a01b031633146105b55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610633565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b038116811461070657600080fd5b919050565b60006020828403121561071c578081fd5b610725826106ef565b9392505050565b60006020828403121561073d578081fd5b8151610725816107fc565b600060208284031215610759578081fd5b5051919050565b60008060408385031215610772578081fd5b50508035926020909101359150565b60008060008060808587031215610796578182fd5b843593506020850135925060408501356107af816107fc565b91506107bd606086016106ef565b905092959194509250565b6001600160a01b0391909116815260200190565b6000826107f757634e487b7160e01b81526012600452602481fd5b500490565b80151581146105a057600080fdfea2646970667358221220a4fd7568481f41a86f7bcd81da5f097bc4640b6519a6cec7df18d8209454724f64736f6c63430008040033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000bdd8f4daf71c2cb16cce7e54bb81ef3cfcf5aacb000000000000000000000000b4d930279552397bba2ee473229f89ec245bc3650000000000000000000000000000000000000000000000000000000000278d00

-----Decoded View---------------
Arg [0] : _locker (address): 0xbdD8F4dAF71C2cB16ccE7e54BB81ef3cfcF5AAcb
Arg [1] : _maha (address): 0xB4d930279552397bbA2ee473229f89Ec245bc365
Arg [2] : _minLockDuration (uint256): 2592000

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000bdd8f4daf71c2cb16cce7e54bb81ef3cfcf5aacb
Arg [1] : 000000000000000000000000b4d930279552397bba2ee473229f89ec245bc365
Arg [2] : 0000000000000000000000000000000000000000000000000000000000278d00


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.