ETH Price: $2,935.61 (-0.28%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Batch Unstake Ma...177612912023-07-24 6:50:59878 days ago1690181459IN
0xAb8C3f70...1d57e73dE
0 ETH0.0018033617.81474243
Batch Unstake177612662023-07-24 6:45:47878 days ago1690181147IN
0xAb8C3f70...1d57e73dE
0 ETH0.0032285915.40934533
Stake170503202023-04-15 5:21:11978 days ago1681536071IN
0xAb8C3f70...1d57e73dE
0 ETH0.0022205822.32619907
Stake169731332023-04-04 4:16:35989 days ago1680581795IN
0xAb8C3f70...1d57e73dE
0 ETH0.0019873719.98147086
Stake169730732023-04-04 4:03:59989 days ago1680581039IN
0xAb8C3f70...1d57e73dE
0 ETH0.0023458123.58524164
Batch Stake Mart...169437142023-03-31 0:47:23993 days ago1680223643IN
0xAb8C3f70...1d57e73dE
0 ETH0.0049748822.54343905
Batch Stake169436982023-03-31 0:44:11993 days ago1680223451IN
0xAb8C3f70...1d57e73dE
0 ETH0.0090015122.08235397
Batch Stake169436642023-03-31 0:37:11993 days ago1680223031IN
0xAb8C3f70...1d57e73dE
0 ETH0.0094073722.81007252
Stake169157332023-03-27 2:23:47997 days ago1679883827IN
0xAb8C3f70...1d57e73dE
0 ETH0.0018454618.55461206
Batch Stake168860542023-03-22 22:18:471001 days ago1679523527IN
0xAb8C3f70...1d57e73dE
0 ETH0.0131613217.19207014
Transfer168849662023-03-22 18:39:351001 days ago1679510375IN
0xAb8C3f70...1d57e73dE
0 ETH0.0023138644.86400333
Batch Stake168795042023-03-22 0:15:591002 days ago1679444159IN
0xAb8C3f70...1d57e73dE
0 ETH0.0097364312.6030486
Exchange Token168714522023-03-20 21:06:351003 days ago1679346395IN
0xAb8C3f70...1d57e73dE
0 ETH0.0018220724.60565562
Batch Stake168714472023-03-20 21:05:351003 days ago1679346335IN
0xAb8C3f70...1d57e73dE
0 ETH0.0222927424.59332968
Stake168704632023-03-20 17:46:591003 days ago1679334419IN
0xAb8C3f70...1d57e73dE
0 ETH0.0029588831.25774786
Batch Stake Mart...168660852023-03-20 3:03:351004 days ago1679281415IN
0xAb8C3f70...1d57e73dE
0 ETH0.0025254915.95675139
Batch Stake168660142023-03-20 2:49:111004 days ago1679280551IN
0xAb8C3f70...1d57e73dE
0 ETH0.0079240114.75284366
Batch Stake Mart...168599472023-03-19 6:20:471005 days ago1679206847IN
0xAb8C3f70...1d57e73dE
0 ETH0.0030877113.69541904
Stake168557062023-03-18 16:03:351005 days ago1679155415IN
0xAb8C3f70...1d57e73dE
0 ETH0.0020426421.5784806
Exchange Token168538502023-03-18 9:48:231006 days ago1679132903IN
0xAb8C3f70...1d57e73dE
0 ETH0.0007547513.25278998
Batch Stake168538442023-03-18 9:47:111006 days ago1679132831IN
0xAb8C3f70...1d57e73dE
0 ETH0.0072839213.2569474
Batch Stake Mart...168537892023-03-18 9:36:111006 days ago1679132171IN
0xAb8C3f70...1d57e73dE
0 ETH0.0031316614.19095925
Exchange Token168537812023-03-18 9:34:351006 days ago1679132075IN
0xAb8C3f70...1d57e73dE
0 ETH0.0010108813.65124329
Exchange Token168479712023-03-17 13:57:231006 days ago1679061443IN
0xAb8C3f70...1d57e73dE
0 ETH0.0028526631.29605219
Stake Martian168479642023-03-17 13:55:591006 days ago1679061359IN
0xAb8C3f70...1d57e73dE
0 ETH0.0033828130.28049617
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading
Cross-Chain Transactions

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
COSMIC

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

interface INFT {
    function walletOfOwner(address _owner) external view returns (uint256[] memory);
}

contract COSMIC is ERC20, ERC721Holder, Ownable {


    address public nft;
    address public martianNft;

    ERC20 private oldToken;

    mapping(uint256 => address) public tokenOwnerOf; // owner of token id
    mapping(uint256 => uint256) public tokenStakedAt; // staked at what timestamp

    mapping(uint256 => address) public tokenOwnerOfMartian; // owner of token id
    mapping(uint256 => uint256) public tokenStakedAtMartian; // staked at what timestamp

    uint256 public EMISSION_RATE = (1 * 10 ** decimals()) / 1 days;
    uint256 public MARTIAN_EMISSION_RATE = (1 * 10 ** decimals()) / 1 days;

    // Constructor
    constructor(address _oldToken, address _nft, address _martianNft) ERC20("COSMIC v2", "COSMIC"){
        oldToken = ERC20(_oldToken);
        nft = _nft;
        martianNft = _martianNft;
        _mint(msg.sender, 100000 * 10 ** decimals());
    }

    // Fuction to Set NFT Contract
    function updateNftContract(address _nft, address _martianNft) public onlyOwner {
        nft = _nft;
        martianNft = _martianNft;
    }

    // Additional token minting by owner
    function additionalMinting(uint256 _amount) public onlyOwner {
        _mint(msg.sender, _amount);
    }

    // Change emission rate for martian nft
    function changeRewardsMartian(uint256 _rate) external onlyOwner {
        MARTIAN_EMISSION_RATE = (_rate * 10 ** decimals()) / 1 days;
    }

    // Change emission rate for GEX NFT
    function changeRewards(uint256 _rate) external onlyOwner {
        EMISSION_RATE = (_rate * 10 ** decimals()) / 1 days;
    }

    // Stake Function
    function stake(uint256 tokenId) external {
        IERC721(nft).safeTransferFrom(msg.sender, address(this), tokenId);
        tokenOwnerOf[tokenId] = msg.sender;
        tokenStakedAt[tokenId] = block.timestamp;
    }

    // Calculate Staked Tokens for a Specific NFT
    function calculateTokens(uint256 tokenId) public view returns (uint256) {
        require(tokenStakedAt[tokenId] > 0, "Token Not Staked");
        uint256 timeElapsed = block.timestamp - tokenStakedAt[tokenId];
        return timeElapsed * EMISSION_RATE;
    }

    // Unstake Function
    function unstake(uint256 tokenId) external {
        require(tokenOwnerOf[tokenId] == msg.sender, "You can't unstake");
        _mint(msg.sender, calculateTokens(tokenId)); // Minting the tokens for staking
        IERC721(nft).transferFrom(address(this), msg.sender, tokenId);
        delete tokenOwnerOf[tokenId];
        delete tokenStakedAt[tokenId];
    }

    // Batch Staking of NFTs Function
    function batchStake(uint256[] memory tokenId) external returns (bool status){
        uint256 len = tokenId.length;
        for(uint256 i=0 ; i<len; i++){
            IERC721(nft).safeTransferFrom(msg.sender, address(this), tokenId[i]);
            tokenOwnerOf[tokenId[i]] = msg.sender;
            tokenStakedAt[tokenId[i]] = block.timestamp;
        }
        return true;
    }

    // Batch Unstaking of NFTs Function
    function batchUnstake(uint256[] memory tokenId) external checkStake(tokenId) returns (bool status){
        _mint(msg.sender, batchCalculateTokens(tokenId)); // Minting the tokens for staking
        for(uint256 i=0 ; i<tokenId.length; i++){
            IERC721(nft).transferFrom(address(this), msg.sender, tokenId[i]);
            delete tokenOwnerOf[tokenId[i]];
            delete tokenStakedAt[tokenId[i]];
        }
        return true;
    }

    // Calculate total tokens of all NFTs to unstake function
    function batchCalculateTokens(uint256[] memory tokenId) public view returns (uint256) {
        uint256 totalToken;
        for(uint256 i=0 ; i<tokenId.length; i++){
            if(tokenStakedAt[tokenId[i]] > 0){
                uint256 timeElapsed = block.timestamp - tokenStakedAt[tokenId[i]];
                totalToken += timeElapsed * EMISSION_RATE;
            }  
        }        
        return totalToken;
    }

    // Exchange old token with new token function
    function exchangeToken() external {
        uint256 amount = oldToken.balanceOf(msg.sender);
        require(amount > 0, "Insufficient balance to withdraw");
        _mint(msg.sender, amount);
        oldToken.transferFrom(msg.sender,0x000000000000000000000000000000000000dEaD, amount);
    }

    //show yield of a user function
    function showYield(address user) public view returns(uint256) {
        uint[] memory tokenIds = getTokensOwnedByUser(user);
        if (tokenIds.length > 0){
            return batchCalculateTokens(tokenIds);
        }
        return 0;        
    }

    // withdraw yield without unstaking nft function
    function withdrawYield(address user) external returns(uint256) {
        require(user == msg.sender, "You can't withdraw tokens");
        uint[] memory tokenIds = getTokensOwnedByUser(user);
        uint256 totalToken;
        for(uint256 i=0; i<tokenIds.length ; i++){
            if(tokenStakedAt[tokenIds[i]] > 0){
                uint256 timeElapsed = block.timestamp - tokenStakedAt[tokenIds[i]];
                totalToken += timeElapsed * EMISSION_RATE;
                tokenStakedAt[tokenIds[i]] = block.timestamp;
            }
        }
        _mint(msg.sender, totalToken);
        return totalToken;
    }

    // Show Staked NFTs
    function getTokensOwnedByUser(address user) public view returns(uint[] memory){
        uint256[] memory tokenStaked = INFT(nft).walletOfOwner(address(this));
        uint256[] memory tokenOwnedByUser = new uint256[](tokenStaked.length);
        uint256 currentIndex = 0;

        for (uint i; i < tokenStaked.length;){
            if(user == tokenOwnerOf[tokenStaked[i]]){
                tokenOwnedByUser[currentIndex] = tokenStaked[i];
                currentIndex++;
            }
            unchecked {++i;}
        }

        return tokenOwnedByUser;
    }

    modifier checkStake(uint256[] memory tokenId){
        for(uint256 i=0 ; i<tokenId.length; i++){
            require(tokenOwnerOf[tokenId[i]] == msg.sender, "You can't unstake");
        }
        _;
    }


    //Martian contract------------------------------------------------------------------------------------ 


    function stakeMartian(uint256 tokenId) external {
        IERC721(martianNft).safeTransferFrom(msg.sender, address(this), tokenId);
        tokenOwnerOfMartian[tokenId] = msg.sender;
        tokenStakedAtMartian[tokenId] = block.timestamp;
    }

    // Calculate Staked Tokens for a Specific martianNft
    function calculateTokensMartian(uint256 tokenId) public view returns (uint256) {
        require(tokenStakedAtMartian[tokenId] > 0, "Token Not Staked");
        uint256 timeElapsed = block.timestamp - tokenStakedAtMartian[tokenId];
        return timeElapsed * MARTIAN_EMISSION_RATE;
    }

    // Unstake Function
    function unstakeMartian(uint256 tokenId) external {
        require(tokenOwnerOfMartian[tokenId] == msg.sender, "You can't unstake");
        _mint(msg.sender, calculateTokensMartian(tokenId)); // Minting the tokens for staking
        IERC721(martianNft).transferFrom(address(this), msg.sender, tokenId);
        delete tokenOwnerOfMartian[tokenId];
        delete tokenStakedAtMartian[tokenId];
    }

    // Batch Staking of martianNfts Function
    function batchStakeMartian(uint256[] memory tokenId) external returns (bool status){
        uint256 len = tokenId.length;
        for(uint256 i=0 ; i<len; i++){
            IERC721(martianNft).safeTransferFrom(msg.sender, address(this), tokenId[i]);
            tokenOwnerOfMartian[tokenId[i]] = msg.sender;
            tokenStakedAtMartian[tokenId[i]] = block.timestamp;
        }
        return true;
    }

    // Batch Unstaking of martianNfts Function
    function batchUnstakeMartian(uint256[] memory tokenId) external checkStakeMartian(tokenId) returns (bool status){
        _mint(msg.sender, batchCalculateTokensMartian(tokenId)); // Minting the tokens for staking
        for(uint256 i=0 ; i<tokenId.length; i++){
            IERC721(martianNft).transferFrom(address(this), msg.sender, tokenId[i]);
            delete tokenOwnerOfMartian[tokenId[i]];
            delete tokenStakedAtMartian[tokenId[i]];
        }
        return true;
    }

    // Calculate total tokens of all martianNfts to unstake function
    function batchCalculateTokensMartian(uint256[] memory tokenId) public view returns (uint256) {
        uint256 totalToken;
        for(uint256 i=0 ; i<tokenId.length; i++){
            if(tokenStakedAtMartian[tokenId[i]] > 0){
                uint256 timeElapsed = block.timestamp - tokenStakedAtMartian[tokenId[i]];
                totalToken += timeElapsed * MARTIAN_EMISSION_RATE;
            }  
        }        
        return totalToken;
    }

        //show yield of a user function
    function showYieldMartian(address user) public view returns(uint256) {
        uint[] memory tokenIds = getTokensOwnedByUserMartian(user);
        if (tokenIds.length > 0){
            return batchCalculateTokensMartian(tokenIds);
        }
        return 0;        
    }

    // withdraw yield without unstaking martianNft function
    function withdrawYieldMartian(address user) external returns(uint256) {
        require(user == msg.sender, "You can't withdraw tokens");
        uint[] memory tokenIds = getTokensOwnedByUserMartian(user);
        uint256 totalToken;
        for(uint256 i=0; i<tokenIds.length ; i++){
            if(tokenStakedAtMartian[tokenIds[i]] > 0){
                uint256 timeElapsed = block.timestamp - tokenStakedAtMartian[tokenIds[i]];
                totalToken += timeElapsed * MARTIAN_EMISSION_RATE;
                tokenStakedAtMartian[tokenIds[i]] = block.timestamp;
            }
        }
        _mint(msg.sender, totalToken);
        return totalToken;
    }

    // Show Staked martianNfts
    function getTokensOwnedByUserMartian(address user) public view returns(uint[] memory){
        uint256[] memory tokenOwnedByUser = new uint256[](1112);
        uint256 currentIndex = 0;

        for(uint256 i=0; i < 1112; i++){
            if(user == tokenOwnerOfMartian[i]){
                tokenOwnedByUser[currentIndex] = i;
                currentIndex++;
            }
        }
        uint256[] memory tokenOwnedByUserFinal = new uint256[](currentIndex);

        for(uint256 i=0; i<currentIndex; i++){
            tokenOwnedByUserFinal[i] = tokenOwnedByUser[i];
        }
        return tokenOwnedByUserFinal;
    }

    modifier checkStakeMartian(uint256[] memory tokenId){
        for(uint256 i=0 ; i<tokenId.length; i++){
            require(tokenOwnerOfMartian[tokenId[i]] == msg.sender, "You can't unstake");
        }
        _;
    }


}

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol)

pragma solidity ^0.8.0;

import "../IERC721Receiver.sol";

/**
 * @dev Implementation of the {IERC721Receiver} interface.
 *
 * Accepts all token transfers.
 * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.
 */
contract ERC721Holder is IERC721Receiver {
    /**
     * @dev See {IERC721Receiver-onERC721Received}.
     *
     * Always returns `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address,
        address,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC721Received.selector;
    }
}

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

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

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

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

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

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * This 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:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
        }
        _balances[to] += amount;

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, 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:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

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

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `amount`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 6 of 10 : 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);
}

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

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

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

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

// 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": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_oldToken","type":"address"},{"internalType":"address","name":"_nft","type":"address"},{"internalType":"address","name":"_martianNft","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"EMISSION_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MARTIAN_EMISSION_RATE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"additionalMinting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenId","type":"uint256[]"}],"name":"batchCalculateTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenId","type":"uint256[]"}],"name":"batchCalculateTokensMartian","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenId","type":"uint256[]"}],"name":"batchStake","outputs":[{"internalType":"bool","name":"status","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenId","type":"uint256[]"}],"name":"batchStakeMartian","outputs":[{"internalType":"bool","name":"status","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenId","type":"uint256[]"}],"name":"batchUnstake","outputs":[{"internalType":"bool","name":"status","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenId","type":"uint256[]"}],"name":"batchUnstakeMartian","outputs":[{"internalType":"bool","name":"status","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"calculateTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"calculateTokensMartian","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rate","type":"uint256"}],"name":"changeRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rate","type":"uint256"}],"name":"changeRewardsMartian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"exchangeToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getTokensOwnedByUser","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getTokensOwnedByUserMartian","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"martianNft","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nft","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"showYield","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"showYieldMartian","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"stakeMartian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenOwnerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenOwnerOfMartian","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenStakedAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenStakedAtMartian","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"unstakeMartian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nft","type":"address"},{"internalType":"address","name":"_martianNft","type":"address"}],"name":"updateNftContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"withdrawYield","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"withdrawYieldMartian","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

608060405262015180620000166012600a62000481565b6200002390600162000499565b6200002f9190620004bb565b600d5562015180620000446012600a62000481565b6200005190600162000499565b6200005d9190620004bb565b600e553480156200006d57600080fd5b5060405162002c3c38038062002c3c8339810160408190526200009091620004fb565b604080518082018252600981526821a7a9a6a4a1903b1960b91b602080830191825283518085019094526006845265434f534d494360d01b908401528151919291620000df91600391620002c6565b508051620000f5906004906020840190620002c6565b505050620001126200010c6200018860201b60201c565b6200018c565b600880546001600160a01b038086166001600160a01b0319928316179092556006805485841690831617905560078054928416929091169190911790556200017f336200015d601290565b6200016a90600a62000481565b6200017990620186a062000499565b620001de565b5050506200059d565b3390565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216620002395760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640160405180910390fd5b80600260008282546200024d919062000545565b90915550506001600160a01b038216600090815260208190526040812080548392906200027c90849062000545565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b828054620002d49062000560565b90600052602060002090601f016020900481019282620002f8576000855562000343565b82601f106200031357805160ff191683800117855562000343565b8280016001018555821562000343579182015b828111156200034357825182559160200191906001019062000326565b506200035192915062000355565b5090565b5b8082111562000351576000815560010162000356565b634e487b7160e01b600052601160045260246000fd5b600181815b80851115620003c3578160001904821115620003a757620003a76200036c565b80851615620003b557918102915b93841c939080029062000387565b509250929050565b600082620003dc575060016200047b565b81620003eb575060006200047b565b81600181146200040457600281146200040f576200042f565b60019150506200047b565b60ff8411156200042357620004236200036c565b50506001821b6200047b565b5060208310610133831016604e8410600b841016171562000454575081810a6200047b565b62000460838362000382565b80600019048211156200047757620004776200036c565b0290505b92915050565b60006200049260ff841683620003cb565b9392505050565b6000816000190483118215151615620004b657620004b66200036c565b500290565b600082620004d957634e487b7160e01b600052601260045260246000fd5b500490565b80516001600160a01b0381168114620004f657600080fd5b919050565b6000806000606084860312156200051157600080fd5b6200051c84620004de565b92506200052c60208501620004de565b91506200053c60408501620004de565b90509250925092565b600082198211156200055b576200055b6200036c565b500190565b600181811c908216806200057557607f821691505b602082108114156200059757634e487b7160e01b600052602260045260246000fd5b50919050565b61268f80620005ad6000396000f3fe608060405234801561001057600080fd5b506004361061028a5760003560e01c80637d3177141161015c578063a9059cbb116100ce578063d2acd13d11610087578063d2acd13d1461060d578063dd3b83df14610620578063dd62ed3e14610633578063f2fde38b14610646578063f6256b8f14610659578063fb8132271461066c57600080fd5b8063a9059cbb146105a5578063aa9ef39c146105b8578063b568e7e6146105cb578063ba913782146105d4578063c2127793146105e7578063d129fb89146105fa57600080fd5b80639481890211610120578063948189021461053c57806395d89b411461054f578063a25eb5d914610557578063a29c73e11461055f578063a457c2d71461057f578063a694fc3a1461059257600080fd5b80637d317714146104c957806389885a59146104dc5780638a802fee146105055780638bb3f4e8146105185780638da5cb5b1461052b57600080fd5b8063320c4be31161020057806367dfd021116101b957806367dfd0211461044c57806370a082311461045f578063715018a614610488578063719b42c01461049057806371aa60fd146104a357806378219d51146104b657600080fd5b8063320c4be3146103cd578063350b860e146103e057806339509351146103f357806343897fd71461040657806347ccca02146104195780635902772e1461042c57600080fd5b8063150b7a0211610252578063150b7a021461033957806318160ddd1461037057806323b872dd1461037857806324bf238c1461038b5780632e17de78146103ab578063313ce567146103be57600080fd5b806301b8199a1461028f57806305a533ec146102ab57806306fdde03146102c0578063095ea7b3146102d557806314ede548146102f8575b600080fd5b610298600d5481565b6040519081526020015b60405180910390f35b6102be6102b9366004612027565b61067f565b005b6102c8610694565b6040516102a29190612040565b6102e86102e33660046120b1565b610726565b60405190151581526020016102a2565b610321610306366004612027565b600b602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016102a2565b610357610347366004612122565b630a85bd0160e11b949350505050565b6040516001600160e01b031990911681526020016102a2565b600254610298565b6102e86103863660046121e2565b610740565b610298610399366004612027565b600a6020526000908152604090205481565b6102be6103b9366004612027565b610764565b604051601281526020016102a2565b6102be6103db36600461221e565b610844565b6102986103ee366004612275565b61087a565b6102e86104013660046120b1565b61092f565b6102e8610414366004612275565b610951565b600654610321906001600160a01b031681565b61043f61043a36600461230b565b610a84565b6040516102a29190612326565b61029861045a36600461230b565b610bfa565b61029861046d36600461230b565b6001600160a01b031660009081526020819052604090205490565b6102be610c29565b6102e861049e366004612275565b610c3d565b6102986104b1366004612027565b610de9565b6102986104c4366004612027565b610e60565b6102be6104d7366004612027565b610ed7565b6103216104ea366004612027565b6009602052600090815260409020546001600160a01b031681565b61029861051336600461230b565b610fa9565b61029861052636600461230b565b6110f4565b6005546001600160a01b0316610321565b61029861054a366004612275565b61110f565b6102c86111bd565b6102be6111cc565b61029861056d366004612027565b600c6020526000908152604090205481565b6102e861058d3660046120b1565b611330565b6102be6105a0366004612027565b6113ab565b6102e86105b33660046120b1565b61143e565b6102be6105c6366004612027565b61144c565b610298600e5481565b6102be6105e2366004612027565b6114df565b6102e86105f5366004612275565b611511565b600754610321906001600160a01b031681565b6102e861061b366004612275565b61163a565b61029861062e36600461230b565b6117e0565b61029861064136600461221e565b611920565b6102be61065436600461230b565b61194b565b6102be610667366004612027565b6119c1565b61043f61067a36600461230b565b6119f3565b610687611b30565b6106913382611b8a565b50565b6060600380546106a39061236a565b80601f01602080910402602001604051908101604052809291908181526020018280546106cf9061236a565b801561071c5780601f106106f15761010080835404028352916020019161071c565b820191906000526020600020905b8154815290600101906020018083116106ff57829003601f168201915b5050505050905090565b600033610734818585611c69565b60019150505b92915050565b60003361074e858285611d8d565b610759858585611e07565b506001949350505050565b6000818152600960205260409020546001600160a01b031633146107a35760405162461bcd60e51b815260040161079a9061239f565b60405180910390fd5b6107b5336107b083610de9565b611b8a565b6006546040516323b872dd60e01b81526001600160a01b03909116906323b872dd906107e9903090339086906004016123ca565b600060405180830381600087803b15801561080357600080fd5b505af1158015610817573d6000803e3d6000fd5b50505060009182525060096020908152604080832080546001600160a01b0319169055600a909152812055565b61084c611b30565b600680546001600160a01b039384166001600160a01b03199182161790915560078054929093169116179055565b60008060005b8351811015610928576000600c60008684815181106108a1576108a16123ee565b60200260200101518152602001908152602001600020541115610916576000600c60008684815181106108d6576108d66123ee565b6020026020010151815260200190815260200160002054426108f8919061241a565b9050600e54816109089190612431565b6109129084612450565b9250505b8061092081612468565b915050610880565b5092915050565b6000336107348185856109428383611920565b61094c9190612450565b611c69565b8051600090815b81811015610a7a5760075484516001600160a01b03909116906342842e0e903390309088908690811061098d5761098d6123ee565b60200260200101516040518463ffffffff1660e01b81526004016109b3939291906123ca565b600060405180830381600087803b1580156109cd57600080fd5b505af11580156109e1573d6000803e3d6000fd5b5050505033600b60008684815181106109fc576109fc6123ee565b6020026020010151815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555042600c6000868481518110610a4d57610a4d6123ee565b60200260200101518152602001908152602001600020819055508080610a7290612468565b915050610958565b5060019392505050565b60065460405162438b6360e81b81523060048201526060916000916001600160a01b039091169063438b63009060240160006040518083038186803b158015610acc57600080fd5b505afa158015610ae0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b089190810190612483565b90506000815167ffffffffffffffff811115610b2657610b266120db565b604051908082528060200260200182016040528015610b4f578160200160208202803683370190505b5090506000805b8351811015610bf05760096000858381518110610b7557610b756123ee565b6020908102919091018101518252810191909152604001600020546001600160a01b0387811691161415610be857838181518110610bb557610bb56123ee565b6020026020010151838381518110610bcf57610bcf6123ee565b602090810291909101015281610be481612468565b9250505b600101610b56565b5090949350505050565b600080610c06836119f3565b805190915015610c2057610c198161087a565b9392505050565b50600092915050565b610c31611b30565b610c3b6000611fd5565b565b60008160005b8151811015610cbf57336001600160a01b0316600b6000848481518110610c6c57610c6c6123ee565b6020908102919091018101518252810191909152604001600020546001600160a01b031614610cad5760405162461bcd60e51b815260040161079a9061239f565b80610cb781612468565b915050610c43565b50610ccd336107b08561087a565b60005b8351811015610a7a5760075484516001600160a01b03909116906323b872dd9030903390889086908110610d0657610d066123ee565b60200260200101516040518463ffffffff1660e01b8152600401610d2c939291906123ca565b600060405180830381600087803b158015610d4657600080fd5b505af1158015610d5a573d6000803e3d6000fd5b50505050600b6000858381518110610d7457610d746123ee565b6020026020010151815260200190815260200160002060006101000a8154906001600160a01b030219169055600c6000858381518110610db657610db66123ee565b60200260200101518152602001908152602001600020600090558080610ddb90612468565b915050610cd0565b50919050565b6000818152600a6020526040812054610e375760405162461bcd60e51b815260206004820152601060248201526f151bdad95b88139bdd0814dd185ad95960821b604482015260640161079a565b6000828152600a6020526040812054610e50904261241a565b9050600d5481610c199190612431565b6000818152600c6020526040812054610eae5760405162461bcd60e51b815260206004820152601060248201526f151bdad95b88139bdd0814dd185ad95960821b604482015260640161079a565b6000828152600c6020526040812054610ec7904261241a565b9050600e5481610c199190612431565b6000818152600b60205260409020546001600160a01b03163314610f0d5760405162461bcd60e51b815260040161079a9061239f565b610f1a336107b083610e60565b6007546040516323b872dd60e01b81526001600160a01b03909116906323b872dd90610f4e903090339086906004016123ca565b600060405180830381600087803b158015610f6857600080fd5b505af1158015610f7c573d6000803e3d6000fd5b505050600091825250600b6020908152604080832080546001600160a01b0319169055600c909152812055565b60006001600160a01b0382163314610fff5760405162461bcd60e51b8152602060048201526019602482015278596f752063616e277420776974686472617720746f6b656e7360381b604482015260640161079a565b600061100a836119f3565b90506000805b82518110156110e9576000600c6000858481518110611031576110316123ee565b602002602001015181526020019081526020016000205411156110d7576000600c6000858481518110611066576110666123ee565b602002602001015181526020019081526020016000205442611088919061241a565b9050600e54816110989190612431565b6110a29084612450565b925042600c60008685815181106110bb576110bb6123ee565b6020026020010151815260200190815260200160002081905550505b806110e181612468565b915050611010565b50610c193382611b8a565b60008061110083610a84565b805190915015610c2057610c19815b60008060005b8351811015610928576000600a6000868481518110611136576111366123ee565b602002602001015181526020019081526020016000205411156111ab576000600a600086848151811061116b5761116b6123ee565b60200260200101518152602001908152602001600020544261118d919061241a565b9050600d548161119d9190612431565b6111a79084612450565b9250505b806111b581612468565b915050611115565b6060600480546106a39061236a565b6008546040516370a0823160e01b81523360048201526000916001600160a01b0316906370a082319060240160206040518083038186803b15801561121057600080fd5b505afa158015611224573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112489190612509565b90506000811161129a5760405162461bcd60e51b815260206004820181905260248201527f496e73756666696369656e742062616c616e636520746f207769746864726177604482015260640161079a565b6112a43382611b8a565b6008546040516323b872dd60e01b81526001600160a01b03909116906323b872dd906112da90339061dead9086906004016123ca565b602060405180830381600087803b1580156112f457600080fd5b505af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c9190612522565b5050565b6000338161133e8286611920565b90508381101561139e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161079a565b6107598286868403611c69565b600654604051632142170760e11b81526001600160a01b03909116906342842e0e906113df903390309086906004016123ca565b600060405180830381600087803b1580156113f957600080fd5b505af115801561140d573d6000803e3d6000fd5b50505060009182525060096020908152604080832080546001600160a01b03191633179055600a9091529020429055565b600033610734818585611e07565b600754604051632142170760e11b81526001600160a01b03909116906342842e0e90611480903390309086906004016123ca565b600060405180830381600087803b15801561149a57600080fd5b505af11580156114ae573d6000803e3d6000fd5b505050600091825250600b6020908152604080832080546001600160a01b03191633179055600c9091529020429055565b6114e7611b30565b620151806114f76012600a612628565b6115019083612431565b61150b9190612637565b600d5550565b8051600090815b81811015610a7a5760065484516001600160a01b03909116906342842e0e903390309088908690811061154d5761154d6123ee565b60200260200101516040518463ffffffff1660e01b8152600401611573939291906123ca565b600060405180830381600087803b15801561158d57600080fd5b505af11580156115a1573d6000803e3d6000fd5b5050505033600960008684815181106115bc576115bc6123ee565b6020026020010151815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555042600a600086848151811061160d5761160d6123ee565b6020026020010151815260200190815260200160002081905550808061163290612468565b915050611518565b60008160005b81518110156116bc57336001600160a01b031660096000848481518110611669576116696123ee565b6020908102919091018101518252810191909152604001600020546001600160a01b0316146116aa5760405162461bcd60e51b815260040161079a9061239f565b806116b481612468565b915050611640565b506116ca336107b08561110f565b60005b8351811015610a7a5760065484516001600160a01b03909116906323b872dd9030903390889086908110611703576117036123ee565b60200260200101516040518463ffffffff1660e01b8152600401611729939291906123ca565b600060405180830381600087803b15801561174357600080fd5b505af1158015611757573d6000803e3d6000fd5b5050505060096000858381518110611771576117716123ee565b6020026020010151815260200190815260200160002060006101000a8154906001600160a01b030219169055600a60008583815181106117b3576117b36123ee565b602002602001015181526020019081526020016000206000905580806117d890612468565b9150506116cd565b60006001600160a01b03821633146118365760405162461bcd60e51b8152602060048201526019602482015278596f752063616e277420776974686472617720746f6b656e7360381b604482015260640161079a565b600061184183610a84565b90506000805b82518110156110e9576000600a6000858481518110611868576118686123ee565b6020026020010151815260200190815260200160002054111561190e576000600a600085848151811061189d5761189d6123ee565b6020026020010151815260200190815260200160002054426118bf919061241a565b9050600d54816118cf9190612431565b6118d99084612450565b925042600a60008685815181106118f2576118f26123ee565b6020026020010151815260200190815260200160002081905550505b8061191881612468565b915050611847565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b611953611b30565b6001600160a01b0381166119b85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161079a565b61069181611fd5565b6119c9611b30565b620151806119d96012600a612628565b6119e39083612431565b6119ed9190612637565b600e5550565b60408051610458808252618b2082019092526060916000919060208201618b00803683370190505090506000805b610458811015611a8b576000818152600b60205260409020546001600160a01b0386811691161415611a795780838381518110611a6057611a606123ee565b602090810291909101015281611a7581612468565b9250505b80611a8381612468565b915050611a21565b5060008167ffffffffffffffff811115611aa757611aa76120db565b604051908082528060200260200182016040528015611ad0578160200160208202803683370190505b50905060005b82811015611b2757838181518110611af057611af06123ee565b6020026020010151828281518110611b0a57611b0a6123ee565b602090810291909101015280611b1f81612468565b915050611ad6565b50949350505050565b6005546001600160a01b03163314610c3b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161079a565b6001600160a01b038216611be05760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161079a565b8060026000828254611bf29190612450565b90915550506001600160a01b03821660009081526020819052604081208054839290611c1f908490612450565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038316611ccb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161079a565b6001600160a01b038216611d2c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161079a565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000611d998484611920565b90506000198114611e015781811015611df45760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161079a565b611e018484848403611c69565b50505050565b6001600160a01b038316611e6b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161079a565b6001600160a01b038216611ecd5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161079a565b6001600160a01b03831660009081526020819052604090205481811015611f455760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161079a565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290611f7c908490612450565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611fc891815260200190565b60405180910390a3611e01565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006020828403121561203957600080fd5b5035919050565b600060208083528351808285015260005b8181101561206d57858101830151858201604001528201612051565b8181111561207f576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b03811681146120ac57600080fd5b919050565b600080604083850312156120c457600080fd5b6120cd83612095565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561211a5761211a6120db565b604052919050565b6000806000806080858703121561213857600080fd5b61214185612095565b93506020612150818701612095565b935060408601359250606086013567ffffffffffffffff8082111561217457600080fd5b818801915088601f83011261218857600080fd5b81358181111561219a5761219a6120db565b6121ac601f8201601f191685016120f1565b915080825289848285010111156121c257600080fd5b808484018584013760008482840101525080935050505092959194509250565b6000806000606084860312156121f757600080fd5b61220084612095565b925061220e60208501612095565b9150604084013590509250925092565b6000806040838503121561223157600080fd5b61223a83612095565b915061224860208401612095565b90509250929050565b600067ffffffffffffffff82111561226b5761226b6120db565b5060051b60200190565b6000602080838503121561228857600080fd5b823567ffffffffffffffff81111561229f57600080fd5b8301601f810185136122b057600080fd5b80356122c36122be82612251565b6120f1565b81815260059190911b820183019083810190878311156122e257600080fd5b928401925b82841015612300578335825292840192908401906122e7565b979650505050505050565b60006020828403121561231d57600080fd5b610c1982612095565b6020808252825182820181905260009190848201906040850190845b8181101561235e57835183529284019291840191600101612342565b50909695505050505050565b600181811c9082168061237e57607f821691505b60208210811415610de357634e487b7160e01b600052602260045260246000fd5b602080825260119082015270596f752063616e277420756e7374616b6560781b604082015260600190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008282101561242c5761242c612404565b500390565b600081600019048311821515161561244b5761244b612404565b500290565b6000821982111561246357612463612404565b500190565b600060001982141561247c5761247c612404565b5060010190565b6000602080838503121561249657600080fd5b825167ffffffffffffffff8111156124ad57600080fd5b8301601f810185136124be57600080fd5b80516124cc6122be82612251565b81815260059190911b820183019083810190878311156124eb57600080fd5b928401925b82841015612300578351825292840192908401906124f0565b60006020828403121561251b57600080fd5b5051919050565b60006020828403121561253457600080fd5b81518015158114610c1957600080fd5b600181815b8085111561257f57816000190482111561256557612565612404565b8085161561257257918102915b93841c9390800290612549565b509250929050565b6000826125965750600161073a565b816125a35750600061073a565b81600181146125b957600281146125c3576125df565b600191505061073a565b60ff8411156125d4576125d4612404565b50506001821b61073a565b5060208310610133831016604e8410600b8410161715612602575081810a61073a565b61260c8383612544565b806000190482111561262057612620612404565b029392505050565b6000610c1960ff841683612587565b60008261265457634e487b7160e01b600052601260045260246000fd5b50049056fea26469706673582212204a81ca0293bf44043c0ab128f4fced00d9668ff59d2473831a4fff6b5735b40964736f6c634300080900330000000000000000000000000388fd621505eccc4ed6009ded6bcc107195f11e0000000000000000000000003f7e4b1ebe37788a941dc095ed56c8ab2bb2d4020000000000000000000000004af5658577a117c73eb16559f4ca39fe5d7aaeb6

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061028a5760003560e01c80637d3177141161015c578063a9059cbb116100ce578063d2acd13d11610087578063d2acd13d1461060d578063dd3b83df14610620578063dd62ed3e14610633578063f2fde38b14610646578063f6256b8f14610659578063fb8132271461066c57600080fd5b8063a9059cbb146105a5578063aa9ef39c146105b8578063b568e7e6146105cb578063ba913782146105d4578063c2127793146105e7578063d129fb89146105fa57600080fd5b80639481890211610120578063948189021461053c57806395d89b411461054f578063a25eb5d914610557578063a29c73e11461055f578063a457c2d71461057f578063a694fc3a1461059257600080fd5b80637d317714146104c957806389885a59146104dc5780638a802fee146105055780638bb3f4e8146105185780638da5cb5b1461052b57600080fd5b8063320c4be31161020057806367dfd021116101b957806367dfd0211461044c57806370a082311461045f578063715018a614610488578063719b42c01461049057806371aa60fd146104a357806378219d51146104b657600080fd5b8063320c4be3146103cd578063350b860e146103e057806339509351146103f357806343897fd71461040657806347ccca02146104195780635902772e1461042c57600080fd5b8063150b7a0211610252578063150b7a021461033957806318160ddd1461037057806323b872dd1461037857806324bf238c1461038b5780632e17de78146103ab578063313ce567146103be57600080fd5b806301b8199a1461028f57806305a533ec146102ab57806306fdde03146102c0578063095ea7b3146102d557806314ede548146102f8575b600080fd5b610298600d5481565b6040519081526020015b60405180910390f35b6102be6102b9366004612027565b61067f565b005b6102c8610694565b6040516102a29190612040565b6102e86102e33660046120b1565b610726565b60405190151581526020016102a2565b610321610306366004612027565b600b602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020016102a2565b610357610347366004612122565b630a85bd0160e11b949350505050565b6040516001600160e01b031990911681526020016102a2565b600254610298565b6102e86103863660046121e2565b610740565b610298610399366004612027565b600a6020526000908152604090205481565b6102be6103b9366004612027565b610764565b604051601281526020016102a2565b6102be6103db36600461221e565b610844565b6102986103ee366004612275565b61087a565b6102e86104013660046120b1565b61092f565b6102e8610414366004612275565b610951565b600654610321906001600160a01b031681565b61043f61043a36600461230b565b610a84565b6040516102a29190612326565b61029861045a36600461230b565b610bfa565b61029861046d36600461230b565b6001600160a01b031660009081526020819052604090205490565b6102be610c29565b6102e861049e366004612275565b610c3d565b6102986104b1366004612027565b610de9565b6102986104c4366004612027565b610e60565b6102be6104d7366004612027565b610ed7565b6103216104ea366004612027565b6009602052600090815260409020546001600160a01b031681565b61029861051336600461230b565b610fa9565b61029861052636600461230b565b6110f4565b6005546001600160a01b0316610321565b61029861054a366004612275565b61110f565b6102c86111bd565b6102be6111cc565b61029861056d366004612027565b600c6020526000908152604090205481565b6102e861058d3660046120b1565b611330565b6102be6105a0366004612027565b6113ab565b6102e86105b33660046120b1565b61143e565b6102be6105c6366004612027565b61144c565b610298600e5481565b6102be6105e2366004612027565b6114df565b6102e86105f5366004612275565b611511565b600754610321906001600160a01b031681565b6102e861061b366004612275565b61163a565b61029861062e36600461230b565b6117e0565b61029861064136600461221e565b611920565b6102be61065436600461230b565b61194b565b6102be610667366004612027565b6119c1565b61043f61067a36600461230b565b6119f3565b610687611b30565b6106913382611b8a565b50565b6060600380546106a39061236a565b80601f01602080910402602001604051908101604052809291908181526020018280546106cf9061236a565b801561071c5780601f106106f15761010080835404028352916020019161071c565b820191906000526020600020905b8154815290600101906020018083116106ff57829003601f168201915b5050505050905090565b600033610734818585611c69565b60019150505b92915050565b60003361074e858285611d8d565b610759858585611e07565b506001949350505050565b6000818152600960205260409020546001600160a01b031633146107a35760405162461bcd60e51b815260040161079a9061239f565b60405180910390fd5b6107b5336107b083610de9565b611b8a565b6006546040516323b872dd60e01b81526001600160a01b03909116906323b872dd906107e9903090339086906004016123ca565b600060405180830381600087803b15801561080357600080fd5b505af1158015610817573d6000803e3d6000fd5b50505060009182525060096020908152604080832080546001600160a01b0319169055600a909152812055565b61084c611b30565b600680546001600160a01b039384166001600160a01b03199182161790915560078054929093169116179055565b60008060005b8351811015610928576000600c60008684815181106108a1576108a16123ee565b60200260200101518152602001908152602001600020541115610916576000600c60008684815181106108d6576108d66123ee565b6020026020010151815260200190815260200160002054426108f8919061241a565b9050600e54816109089190612431565b6109129084612450565b9250505b8061092081612468565b915050610880565b5092915050565b6000336107348185856109428383611920565b61094c9190612450565b611c69565b8051600090815b81811015610a7a5760075484516001600160a01b03909116906342842e0e903390309088908690811061098d5761098d6123ee565b60200260200101516040518463ffffffff1660e01b81526004016109b3939291906123ca565b600060405180830381600087803b1580156109cd57600080fd5b505af11580156109e1573d6000803e3d6000fd5b5050505033600b60008684815181106109fc576109fc6123ee565b6020026020010151815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555042600c6000868481518110610a4d57610a4d6123ee565b60200260200101518152602001908152602001600020819055508080610a7290612468565b915050610958565b5060019392505050565b60065460405162438b6360e81b81523060048201526060916000916001600160a01b039091169063438b63009060240160006040518083038186803b158015610acc57600080fd5b505afa158015610ae0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b089190810190612483565b90506000815167ffffffffffffffff811115610b2657610b266120db565b604051908082528060200260200182016040528015610b4f578160200160208202803683370190505b5090506000805b8351811015610bf05760096000858381518110610b7557610b756123ee565b6020908102919091018101518252810191909152604001600020546001600160a01b0387811691161415610be857838181518110610bb557610bb56123ee565b6020026020010151838381518110610bcf57610bcf6123ee565b602090810291909101015281610be481612468565b9250505b600101610b56565b5090949350505050565b600080610c06836119f3565b805190915015610c2057610c198161087a565b9392505050565b50600092915050565b610c31611b30565b610c3b6000611fd5565b565b60008160005b8151811015610cbf57336001600160a01b0316600b6000848481518110610c6c57610c6c6123ee565b6020908102919091018101518252810191909152604001600020546001600160a01b031614610cad5760405162461bcd60e51b815260040161079a9061239f565b80610cb781612468565b915050610c43565b50610ccd336107b08561087a565b60005b8351811015610a7a5760075484516001600160a01b03909116906323b872dd9030903390889086908110610d0657610d066123ee565b60200260200101516040518463ffffffff1660e01b8152600401610d2c939291906123ca565b600060405180830381600087803b158015610d4657600080fd5b505af1158015610d5a573d6000803e3d6000fd5b50505050600b6000858381518110610d7457610d746123ee565b6020026020010151815260200190815260200160002060006101000a8154906001600160a01b030219169055600c6000858381518110610db657610db66123ee565b60200260200101518152602001908152602001600020600090558080610ddb90612468565b915050610cd0565b50919050565b6000818152600a6020526040812054610e375760405162461bcd60e51b815260206004820152601060248201526f151bdad95b88139bdd0814dd185ad95960821b604482015260640161079a565b6000828152600a6020526040812054610e50904261241a565b9050600d5481610c199190612431565b6000818152600c6020526040812054610eae5760405162461bcd60e51b815260206004820152601060248201526f151bdad95b88139bdd0814dd185ad95960821b604482015260640161079a565b6000828152600c6020526040812054610ec7904261241a565b9050600e5481610c199190612431565b6000818152600b60205260409020546001600160a01b03163314610f0d5760405162461bcd60e51b815260040161079a9061239f565b610f1a336107b083610e60565b6007546040516323b872dd60e01b81526001600160a01b03909116906323b872dd90610f4e903090339086906004016123ca565b600060405180830381600087803b158015610f6857600080fd5b505af1158015610f7c573d6000803e3d6000fd5b505050600091825250600b6020908152604080832080546001600160a01b0319169055600c909152812055565b60006001600160a01b0382163314610fff5760405162461bcd60e51b8152602060048201526019602482015278596f752063616e277420776974686472617720746f6b656e7360381b604482015260640161079a565b600061100a836119f3565b90506000805b82518110156110e9576000600c6000858481518110611031576110316123ee565b602002602001015181526020019081526020016000205411156110d7576000600c6000858481518110611066576110666123ee565b602002602001015181526020019081526020016000205442611088919061241a565b9050600e54816110989190612431565b6110a29084612450565b925042600c60008685815181106110bb576110bb6123ee565b6020026020010151815260200190815260200160002081905550505b806110e181612468565b915050611010565b50610c193382611b8a565b60008061110083610a84565b805190915015610c2057610c19815b60008060005b8351811015610928576000600a6000868481518110611136576111366123ee565b602002602001015181526020019081526020016000205411156111ab576000600a600086848151811061116b5761116b6123ee565b60200260200101518152602001908152602001600020544261118d919061241a565b9050600d548161119d9190612431565b6111a79084612450565b9250505b806111b581612468565b915050611115565b6060600480546106a39061236a565b6008546040516370a0823160e01b81523360048201526000916001600160a01b0316906370a082319060240160206040518083038186803b15801561121057600080fd5b505afa158015611224573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112489190612509565b90506000811161129a5760405162461bcd60e51b815260206004820181905260248201527f496e73756666696369656e742062616c616e636520746f207769746864726177604482015260640161079a565b6112a43382611b8a565b6008546040516323b872dd60e01b81526001600160a01b03909116906323b872dd906112da90339061dead9086906004016123ca565b602060405180830381600087803b1580156112f457600080fd5b505af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c9190612522565b5050565b6000338161133e8286611920565b90508381101561139e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161079a565b6107598286868403611c69565b600654604051632142170760e11b81526001600160a01b03909116906342842e0e906113df903390309086906004016123ca565b600060405180830381600087803b1580156113f957600080fd5b505af115801561140d573d6000803e3d6000fd5b50505060009182525060096020908152604080832080546001600160a01b03191633179055600a9091529020429055565b600033610734818585611e07565b600754604051632142170760e11b81526001600160a01b03909116906342842e0e90611480903390309086906004016123ca565b600060405180830381600087803b15801561149a57600080fd5b505af11580156114ae573d6000803e3d6000fd5b505050600091825250600b6020908152604080832080546001600160a01b03191633179055600c9091529020429055565b6114e7611b30565b620151806114f76012600a612628565b6115019083612431565b61150b9190612637565b600d5550565b8051600090815b81811015610a7a5760065484516001600160a01b03909116906342842e0e903390309088908690811061154d5761154d6123ee565b60200260200101516040518463ffffffff1660e01b8152600401611573939291906123ca565b600060405180830381600087803b15801561158d57600080fd5b505af11580156115a1573d6000803e3d6000fd5b5050505033600960008684815181106115bc576115bc6123ee565b6020026020010151815260200190815260200160002060006101000a8154816001600160a01b0302191690836001600160a01b0316021790555042600a600086848151811061160d5761160d6123ee565b6020026020010151815260200190815260200160002081905550808061163290612468565b915050611518565b60008160005b81518110156116bc57336001600160a01b031660096000848481518110611669576116696123ee565b6020908102919091018101518252810191909152604001600020546001600160a01b0316146116aa5760405162461bcd60e51b815260040161079a9061239f565b806116b481612468565b915050611640565b506116ca336107b08561110f565b60005b8351811015610a7a5760065484516001600160a01b03909116906323b872dd9030903390889086908110611703576117036123ee565b60200260200101516040518463ffffffff1660e01b8152600401611729939291906123ca565b600060405180830381600087803b15801561174357600080fd5b505af1158015611757573d6000803e3d6000fd5b5050505060096000858381518110611771576117716123ee565b6020026020010151815260200190815260200160002060006101000a8154906001600160a01b030219169055600a60008583815181106117b3576117b36123ee565b602002602001015181526020019081526020016000206000905580806117d890612468565b9150506116cd565b60006001600160a01b03821633146118365760405162461bcd60e51b8152602060048201526019602482015278596f752063616e277420776974686472617720746f6b656e7360381b604482015260640161079a565b600061184183610a84565b90506000805b82518110156110e9576000600a6000858481518110611868576118686123ee565b6020026020010151815260200190815260200160002054111561190e576000600a600085848151811061189d5761189d6123ee565b6020026020010151815260200190815260200160002054426118bf919061241a565b9050600d54816118cf9190612431565b6118d99084612450565b925042600a60008685815181106118f2576118f26123ee565b6020026020010151815260200190815260200160002081905550505b8061191881612468565b915050611847565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b611953611b30565b6001600160a01b0381166119b85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161079a565b61069181611fd5565b6119c9611b30565b620151806119d96012600a612628565b6119e39083612431565b6119ed9190612637565b600e5550565b60408051610458808252618b2082019092526060916000919060208201618b00803683370190505090506000805b610458811015611a8b576000818152600b60205260409020546001600160a01b0386811691161415611a795780838381518110611a6057611a606123ee565b602090810291909101015281611a7581612468565b9250505b80611a8381612468565b915050611a21565b5060008167ffffffffffffffff811115611aa757611aa76120db565b604051908082528060200260200182016040528015611ad0578160200160208202803683370190505b50905060005b82811015611b2757838181518110611af057611af06123ee565b6020026020010151828281518110611b0a57611b0a6123ee565b602090810291909101015280611b1f81612468565b915050611ad6565b50949350505050565b6005546001600160a01b03163314610c3b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161079a565b6001600160a01b038216611be05760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161079a565b8060026000828254611bf29190612450565b90915550506001600160a01b03821660009081526020819052604081208054839290611c1f908490612450565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038316611ccb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161079a565b6001600160a01b038216611d2c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161079a565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000611d998484611920565b90506000198114611e015781811015611df45760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161079a565b611e018484848403611c69565b50505050565b6001600160a01b038316611e6b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161079a565b6001600160a01b038216611ecd5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161079a565b6001600160a01b03831660009081526020819052604090205481811015611f455760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161079a565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290611f7c908490612450565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611fc891815260200190565b60405180910390a3611e01565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006020828403121561203957600080fd5b5035919050565b600060208083528351808285015260005b8181101561206d57858101830151858201604001528201612051565b8181111561207f576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b03811681146120ac57600080fd5b919050565b600080604083850312156120c457600080fd5b6120cd83612095565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561211a5761211a6120db565b604052919050565b6000806000806080858703121561213857600080fd5b61214185612095565b93506020612150818701612095565b935060408601359250606086013567ffffffffffffffff8082111561217457600080fd5b818801915088601f83011261218857600080fd5b81358181111561219a5761219a6120db565b6121ac601f8201601f191685016120f1565b915080825289848285010111156121c257600080fd5b808484018584013760008482840101525080935050505092959194509250565b6000806000606084860312156121f757600080fd5b61220084612095565b925061220e60208501612095565b9150604084013590509250925092565b6000806040838503121561223157600080fd5b61223a83612095565b915061224860208401612095565b90509250929050565b600067ffffffffffffffff82111561226b5761226b6120db565b5060051b60200190565b6000602080838503121561228857600080fd5b823567ffffffffffffffff81111561229f57600080fd5b8301601f810185136122b057600080fd5b80356122c36122be82612251565b6120f1565b81815260059190911b820183019083810190878311156122e257600080fd5b928401925b82841015612300578335825292840192908401906122e7565b979650505050505050565b60006020828403121561231d57600080fd5b610c1982612095565b6020808252825182820181905260009190848201906040850190845b8181101561235e57835183529284019291840191600101612342565b50909695505050505050565b600181811c9082168061237e57607f821691505b60208210811415610de357634e487b7160e01b600052602260045260246000fd5b602080825260119082015270596f752063616e277420756e7374616b6560781b604082015260600190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008282101561242c5761242c612404565b500390565b600081600019048311821515161561244b5761244b612404565b500290565b6000821982111561246357612463612404565b500190565b600060001982141561247c5761247c612404565b5060010190565b6000602080838503121561249657600080fd5b825167ffffffffffffffff8111156124ad57600080fd5b8301601f810185136124be57600080fd5b80516124cc6122be82612251565b81815260059190911b820183019083810190878311156124eb57600080fd5b928401925b82841015612300578351825292840192908401906124f0565b60006020828403121561251b57600080fd5b5051919050565b60006020828403121561253457600080fd5b81518015158114610c1957600080fd5b600181815b8085111561257f57816000190482111561256557612565612404565b8085161561257257918102915b93841c9390800290612549565b509250929050565b6000826125965750600161073a565b816125a35750600061073a565b81600181146125b957600281146125c3576125df565b600191505061073a565b60ff8411156125d4576125d4612404565b50506001821b61073a565b5060208310610133831016604e8410600b8410161715612602575081810a61073a565b61260c8383612544565b806000190482111561262057612620612404565b029392505050565b6000610c1960ff841683612587565b60008261265457634e487b7160e01b600052601260045260246000fd5b50049056fea26469706673582212204a81ca0293bf44043c0ab128f4fced00d9668ff59d2473831a4fff6b5735b40964736f6c63430008090033

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

0000000000000000000000000388fd621505eccc4ed6009ded6bcc107195f11e0000000000000000000000003f7e4b1ebe37788a941dc095ed56c8ab2bb2d4020000000000000000000000004af5658577a117c73eb16559f4ca39fe5d7aaeb6

-----Decoded View---------------
Arg [0] : _oldToken (address): 0x0388Fd621505ECCC4Ed6009dED6bcC107195f11E
Arg [1] : _nft (address): 0x3F7E4B1EbE37788A941dC095ed56C8ab2bb2d402
Arg [2] : _martianNft (address): 0x4Af5658577A117C73eB16559F4cA39fe5D7AaeB6

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000000388fd621505eccc4ed6009ded6bcc107195f11e
Arg [1] : 0000000000000000000000003f7e4b1ebe37788a941dc095ed56c8ab2bb2d402
Arg [2] : 0000000000000000000000004af5658577a117c73eb16559f4ca39fe5d7aaeb6


Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
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.