ETH Price: $2,554.27 (-3.99%)
Gas: 1 Gwei

Contract

0x3A706182f5725863ad660846aa8EA63C20e4b72d
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Unstake Spooky B...202550142024-07-07 13:44:5935 days ago1720359899IN
0x3A706182...C20e4b72d
0 ETH0.000112464.70018946
Unstake Spooky B...202550072024-07-07 13:43:3535 days ago1720359815IN
0x3A706182...C20e4b72d
0 ETH0.001943434.75211212
Unstake Spooky B...201227062024-06-19 2:06:4754 days ago1718762807IN
0x3A706182...C20e4b72d
0 ETH0.000790029.200481
Stake Spooky Boy201226922024-06-19 2:03:5954 days ago1718762639IN
0x3A706182...C20e4b72d
0 ETH0.001329738.75374303
Unstake Mansion ...200868692024-06-14 1:49:3559 days ago1718329775IN
0x3A706182...C20e4b72d
0 ETH0.001155319.26957385
Unstake Mansion ...200868672024-06-14 1:49:1159 days ago1718329751IN
0x3A706182...C20e4b72d
0 ETH0.000860359.17572335
Unstake Spooky B...199478072024-05-25 15:32:3578 days ago1716651155IN
0x3A706182...C20e4b72d
0 ETH0.000923528.02485858
Unstake Spooky B...199431842024-05-25 0:01:3579 days ago1716595295IN
0x3A706182...C20e4b72d
0 ETH0.004772366.3916404
Unstake Spooky B...198831612024-05-16 14:33:5987 days ago1715870039IN
0x3A706182...C20e4b72d
0 ETH0.0088762818.40234805
Unstake Spooky B...198168632024-05-07 8:01:4796 days ago1715068907IN
0x3A706182...C20e4b72d
0 ETH0.000791479.21737587
Unstake Spooky B...198050842024-05-05 16:28:3598 days ago1714926515IN
0x3A706182...C20e4b72d
0 ETH0.0008306410.50253155
Unstake Spooky B...195624692024-04-01 17:28:59132 days ago1711992539IN
0x3A706182...C20e4b72d
0 ETH0.0111589727.28603511
Unstake Spooky B...195624612024-04-01 17:27:23132 days ago1711992443IN
0x3A706182...C20e4b72d
0 ETH0.0028935429.53109444
Unstake Spooky B...194591522024-03-18 3:57:11147 days ago1710734231IN
0x3A706182...C20e4b72d
0 ETH0.0174872222.30162983
Unstake Spooky B...191539032024-02-04 8:57:35189 days ago1707037055IN
0x3A706182...C20e4b72d
0 ETH0.0040801616.42565272
Unstake Mansion ...191539022024-02-04 8:57:23189 days ago1707037043IN
0x3A706182...C20e4b72d
0 ETH0.0021369317.14552905
Unstake Spooky B...191539012024-02-04 8:57:11189 days ago1707037031IN
0x3A706182...C20e4b72d
0 ETH0.001255518.38272899
Unstake Mansion ...191539002024-02-04 8:56:59189 days ago1707037019IN
0x3A706182...C20e4b72d
0 ETH0.000927318.12410572
Unstake Spooky B...191538992024-02-04 8:56:47189 days ago1707037007IN
0x3A706182...C20e4b72d
0 ETH0.0014005117.70792465
Unstake Mansion ...191538982024-02-04 8:56:35189 days ago1707036995IN
0x3A706182...C20e4b72d
0 ETH0.001675517.86936422
Unstake Mansion ...191114142024-01-29 9:53:23195 days ago1706522003IN
0x3A706182...C20e4b72d
0 ETH0.0015946714.51817628
Unstake Spooky B...191114082024-01-29 9:52:11195 days ago1706521931IN
0x3A706182...C20e4b72d
0 ETH0.0012124414.11992497
Unstake Mansion ...190982632024-01-27 13:38:35197 days ago1706362715IN
0x3A706182...C20e4b72d
0 ETH0.002065616.57322443
Unstake Mansion ...190982602024-01-27 13:37:59197 days ago1706362679IN
0x3A706182...C20e4b72d
0 ETH0.0009594816.10852398
Unstake Spooky B...190982572024-01-27 13:37:23197 days ago1706362643IN
0x3A706182...C20e4b72d
0 ETH0.009919116.29866823
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MansionGame

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 11 : MansionGame.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;

import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./SBCC.sol";
import "./SBMP.sol";
import "./SK.sol";
import "./SOUL.sol";

contract MansionGame is Ownable, IERC721Receiver {

    SBCC private immutable sbcc;
    SBMP private immutable sbmp;
    SK private immutable sk;
    SOUL private immutable soul;
    
    struct SpookyStake {
        address owner;
        uint80 blockStakedTimestamp;
        uint16 mansionId;
    }

    struct MansionStake {
        address owner;
        uint256 owedAtTimeOfStake;
        uint80 blockStakedTimestamp;
    }

    struct Mansion {
        uint256 payoutPerDay;
        uint256 riskFactor; 
    }

    uint16[13000] rarity;


    mapping(uint256 => MansionStake) public mansionBoyStaked; 
    mapping(uint256 => SpookyStake) public spookyBoyStaked; 
    mapping(uint256 => Mansion) public mansions;
    mapping(address => uint256[]) public spookyOwnerIds;
    mapping(address => uint256[]) public mansionOwnerIds;

    uint256 public totalSpookyStaked = 0;
    uint256 public totalMansionStaked = 0;
    uint256 public owedPerMansionBoy = 0;


    constructor(address _soul) { 
        sbcc = SBCC(0xfd1076d80FfF9dC702ae9fDfEa0073467B9B3fb7);
        sbmp = SBMP(0xDa4128A4Fc209dF510E9e4483acd059D84620419);
        sk = SK(0x39AeFB036DabF9d29D33f357Dcc3dcE06dC2b899);
        soul = SOUL(_soul); 

        uint256 MAX_INT = 2**256 - 1;

        addMansion(1, 1, MAX_INT/5); // Bronze
        addMansion(69, 3, MAX_INT/5*2); // Silver
        addMansion(420, 5, MAX_INT/5*3); // Gold
        addMansion(1000, 15, 0); // Platinum
    }

    function addRarity(uint16[] calldata _values, uint16 _startingIndex) external onlyOwner {
        for( uint16 i = 0; i < _values.length; ++i ){
            rarity[_startingIndex+i] = _values[i];
        }
    }

    function getRarity(uint16 _id) external view returns(uint16){
        return rarity[_id];
    }

    function addMansion(uint256 _id, uint256 _payoutPerDay, uint256 _riskFactor) public onlyOwner {
        mansions[_id] = Mansion({
            riskFactor: _riskFactor, 
            payoutPerDay: _payoutPerDay * 1 ether
        });
    }

    function stakeSpookyBoy(uint16[] calldata _tokenIds, uint16 _mansionId) external {
        require(mansions[_mansionId].payoutPerDay != 0);
        if(_mansionId == 1000){
            require(_tokenIds.length > 5, "To stake in platinum mansion you must add atleast 6 at a time.");
        }
        for (uint i = 0; i < _tokenIds.length; i++) {
            require(sbcc.ownerOf(_tokenIds[i]) == _msgSender(), "You cannot stake this! Nice try.");
            sbcc.transferFrom(_msgSender(), address(this), _tokenIds[i]);

            spookyBoyStaked[_tokenIds[i]] = SpookyStake({
                owner: _msgSender(),
                blockStakedTimestamp: uint80(block.timestamp),
                mansionId: _mansionId
            });
            spookyOwnerIds[_msgSender()].push(_tokenIds[i]);

            totalSpookyStaked += 1;
        }
    }

    function unstakeSpookyBoy(bool unstake) external returns(uint256){
        uint256 owedToYou = 0;
        uint256 stolen = 0;

        for (uint i = 0; i < spookyOwnerIds[_msgSender()].length; i++) {
            uint256 tokenId = spookyOwnerIds[_msgSender()][i];
            SpookyStake memory stake = spookyBoyStaked[tokenId];
            require(stake.owner == _msgSender(), "You don't own this. Nice try.");
            uint256 earnedBySpooky = (block.timestamp - stake.blockStakedTimestamp) * mansions[stake.mansionId].payoutPerDay / 1 days;

            // Platinum Mansion
            if(stake.mansionId == 1000){
                owedToYou += earnedBySpooky;
            }
            // Font Door
            else if(sk.balanceOf(stake.owner, stake.mansionId) > 0){
                owedToYou += earnedBySpooky; 
            }
            // Back Door
            else{
                // Stolen!
                if(_random(tokenId) <= mansions[stake.mansionId].riskFactor){
                    stolen += earnedBySpooky;
                }
                // Got out safely
                else{
                    owedToYou += earnedBySpooky * ((rarity[tokenId] / 13000) + 1);
                }
            }

            if(unstake){
                sbcc.safeTransferFrom(address(this), stake.owner, tokenId, "");
                delete spookyBoyStaked[tokenId];
                totalSpookyStaked -= 1;
            }else{
                spookyBoyStaked[tokenId] = SpookyStake({
                    owner: _msgSender(),
                    blockStakedTimestamp: uint80(block.timestamp),
                    mansionId: stake.mansionId
                });
            }

        }
        if(unstake){
            delete spookyOwnerIds[_msgSender()];
        }
        
        if(owedToYou != 0){
            soul.mint(_msgSender(), owedToYou);
        }

        if(stolen != 0 && totalMansionStaked != 0){
            owedPerMansionBoy += stolen / totalMansionStaked;
        }

        return owedToYou + stolen; // amount you will get if nothing is stolen
    }

    function stakeMansionBoy(uint16[] calldata _tokenIds) external {
        for (uint i = 0; i < _tokenIds.length; i++) {
            require(sbmp.ownerOf(_tokenIds[i]) == _msgSender(), "You cannot stake this! Nice try.");
            sbmp.transferFrom(_msgSender(), address(this), _tokenIds[i]);

            mansionBoyStaked[_tokenIds[i]] = MansionStake({
                owner: _msgSender(),
                owedAtTimeOfStake: owedPerMansionBoy,
                blockStakedTimestamp: uint80(block.timestamp)
            });
            mansionOwnerIds[_msgSender()].push(_tokenIds[i]);

            totalMansionStaked += 1;
        }
    }

    function unstakeMansionBoy(bool unstake) external returns(uint256){
        uint256 owedToYou = 0;
        for (uint i = 0; i < mansionOwnerIds[_msgSender()].length; i++) {
            uint256 tokenId = mansionOwnerIds[_msgSender()][i];
            MansionStake memory stake = mansionBoyStaked[tokenId];
            require(stake.owner == _msgSender(), "You don't own this. Nice try.");
            
            owedToYou += owedPerMansionBoy - stake.owedAtTimeOfStake;

            if(unstake){
                sbmp.safeTransferFrom(address(this), stake.owner, tokenId, "");
                delete mansionBoyStaked[tokenId];
                totalMansionStaked -= 1;
            }else{
                mansionBoyStaked[tokenId] = MansionStake({
                    owner: _msgSender(),
                    owedAtTimeOfStake: owedPerMansionBoy,
                    blockStakedTimestamp: uint80(block.timestamp)
                });
            }
        }
        if(unstake){
            delete mansionOwnerIds[_msgSender()];
        }
        soul.mint(_msgSender(), owedToYou);

        return owedToYou;
    }
    

    function _random(uint256 seed) internal view returns (uint256) {
        return uint256(keccak256(abi.encodePacked(
            tx.origin,
            blockhash(block.number - 1),
            block.difficulty,
            block.timestamp,
            seed
        )));
    }

    
    function onERC721Received(
        address,
        address from,
        uint256,
        bytes calldata
    ) external pure override returns (bytes4) {
      require(from == address(0x0), "Cannot send tokens to Barn directly");
      return IERC721Receiver.onERC721Received.selector;
    }

}

File 2 of 11 : SOUL.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";


contract SOUL is ERC20, Ownable {

  mapping(address => bool) controllers;
  
  constructor() ERC20("SOUL", "SOUL") { }

  function mint(address to, uint256 amount) external {
    require(controllers[msg.sender], "Only controllers can mint");
    _mint(to, amount);
  }

  function burn(address from, uint256 amount) external {
    require(controllers[msg.sender], "Only controllers can burn");
    _burn(from, amount);
  }

  function selfBurn(uint256 amount) external {
    _burn(msg.sender, amount);
  }

  function addController(address controller) external onlyOwner {
    controllers[controller] = true;
  }

  function removeController(address controller) external onlyOwner {
    controllers[controller] = false;
  }
}

File 3 of 11 : SK.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;

// Created By: Lorenzo
abstract contract SK {

    function burnKey(address userAddress, uint256 keyId, uint256 amount)
        external
        virtual;

    function balanceOf(address account, uint256 id)
        public
        view
        virtual
        returns (uint256);
}

File 4 of 11 : SBMP.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;

// Created By: Lorenzo
abstract contract SBMP {
    function ownerOf(uint256 tokenId) public view virtual returns (address);

    function transferFrom(address _from, address _to, uint256 _tokenId) external virtual payable;

    function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes calldata data) external virtual payable;
}

File 5 of 11 : SBCC.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;

// Created By: Lorenzo
abstract contract SBCC {
    function ownerOf(uint256 tokenId) public view virtual returns (address);

    function transferFrom(address _from, address _to, uint256 _tokenId) external virtual payable;

    function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes calldata data) external virtual payable;
}

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

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

File 7 of 11 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 8 of 11 : IERC20Metadata.sol
// 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);
}

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `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);

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

File 10 of 11 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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, _allowances[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 = _allowances[owner][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * 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 Spend `amount` form the allowance of `owner` toward `spender`.
     *
     * 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 11 of 11 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _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);
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_soul","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"uint256","name":"_payoutPerDay","type":"uint256"},{"internalType":"uint256","name":"_riskFactor","type":"uint256"}],"name":"addMansion","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16[]","name":"_values","type":"uint16[]"},{"internalType":"uint16","name":"_startingIndex","type":"uint16"}],"name":"addRarity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"_id","type":"uint16"}],"name":"getRarity","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"mansionBoyStaked","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"owedAtTimeOfStake","type":"uint256"},{"internalType":"uint80","name":"blockStakedTimestamp","type":"uint80"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"mansionOwnerIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"mansions","outputs":[{"internalType":"uint256","name":"payoutPerDay","type":"uint256"},{"internalType":"uint256","name":"riskFactor","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owedPerMansionBoy","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"spookyBoyStaked","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint80","name":"blockStakedTimestamp","type":"uint80"},{"internalType":"uint16","name":"mansionId","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"spookyOwnerIds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16[]","name":"_tokenIds","type":"uint16[]"}],"name":"stakeMansionBoy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16[]","name":"_tokenIds","type":"uint16[]"},{"internalType":"uint16","name":"_mansionId","type":"uint16"}],"name":"stakeSpookyBoy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalMansionStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSpookyStaked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"unstake","type":"bool"}],"name":"unstakeMansionBoy","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"unstake","type":"bool"}],"name":"unstakeSpookyBoy","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

6101006040526000610333556000610334556000610335553480156200002457600080fd5b5060405162001f8c38038062001f8c833981016040819052620000479162000247565b62000052336200014a565b7ffd1076d80fff9dc702ae9fdfea0073467b9b3fb70000000000000000000000006080527fda4128a4fc209df510e9e4483acd059d8462041900000000000000000000000060a0527f39aefb036dabf9d29d33f357dcc3dce06dc2b89900000000000000000000000060c0526001600160601b0319606082901b1660e052600019620000ed600180620000e760058562000277565b6200019a565b6200010f604560036200010260058562000277565b620000e790600262000298565b620001316101a4600562000124818562000277565b620000e790600362000298565b620001426103e8600f60006200019a565b5050620002c4565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000546001600160a01b03163314620001f95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640160405180910390fd5b604051806040016040528083670de0b6b3a76400006200021a919062000298565b81526020908101929092526000938452610330825260409093208351815592015160019092019190915550565b60006020828403121562000259578081fd5b81516001600160a01b038116811462000270578182fd5b9392505050565b6000826200029357634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615620002bf57634e487b7160e01b81526011600452602481fd5b500290565b60805160601c60a05160601c60c05160601c60e05160601c611c5f6200032d6000396000818161070b01526115ea01526000611304015260008181610589015281816109510152610a85015260008181610ddb01528181610f0f01526114770152611c5f6000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c8063bd0d3b9f116100ad578063dad446fe11610071578063dad446fe14610329578063e885d03114610333578063f2fde38b14610346578063f4a5709b14610359578063f55aedc81461036357600080fd5b8063bd0d3b9f1461026c578063c24fba091461027f578063c35927bb14610292578063c9e895dc146102a5578063da9ec5ae146102b857600080fd5b80635885ef07116100f45780635885ef07146101b1578063715018a6146101bb57806374eea030146101c55780638da5cb5b1461023e578063a15261581461025957600080fd5b8063150b7a02146101265780632c0de819146101575780633b32e886146101785780634e55c6af1461019e575b600080fd5b6101396101343660046118e1565b6103a0565b6040516001600160e01b031990911681526020015b60405180910390f35b61016a610165366004611a38565b61041c565b60405190815260200161014e565b61018b610186366004611a58565b610798565b60405161ffff909116815260200161014e565b61016a6101ac36600461197b565b6107e1565b61016a6103335481565b6101c3610813565b005b61020d6101d3366004611a72565b61032f602052600090815260409020546001600160a01b03811690600160a01b81046001600160501b031690600160f01b900461ffff1683565b604080516001600160a01b0390941684526001600160501b03909216602084015261ffff169082015260600161014e565b6000546040516001600160a01b03909116815260200161014e565b6101c36102673660046119e6565b610849565b61016a61027a36600461197b565b610926565b6101c361028d3660046119a6565b610943565b6101c36102a0366004611aa2565b610cb5565b6101c36102b33660046119e6565b610d2b565b6102fb6102c6366004611a72565b61032e602052600090815260409020805460018201546002909201546001600160a01b0390911691906001600160501b031683565b604080516001600160a01b03909416845260208401929092526001600160501b03169082015260600161014e565b61016a6103345481565b61016a610341366004611a38565b611164565b6101c36103543660046118a2565b6116bf565b61016a6103355481565b61038b610371366004611a72565b610330602052600090815260409020805460019091015482565b6040805192835260208301919091520161014e565b60006001600160a01b0385161561040a5760405162461bcd60e51b815260206004820152602360248201527f43616e6e6f742073656e6420746f6b656e7320746f204261726e206469726563604482015262746c7960e81b60648201526084015b60405180910390fd5b50630a85bd0160e11b95945050505050565b600080805b33600090815261033260205260409020548110156106e1573360009081526103326020526040812080548390811061046957634e487b7160e01b600052603260045260246000fd5b600091825260208083209091015480835261032e8252604092839020835160608101855281546001600160a01b03168152600182015493810193909352600201546001600160501b0316928201929092529091506104c43390565b6001600160a01b031681600001516001600160a01b0316146105285760405162461bcd60e51b815260206004820152601d60248201527f596f7520646f6e2774206f776e20746869732e204e696365207472792e0000006044820152606401610401565b80602001516103355461053b9190611b94565b6105459085611b28565b93508515610641578051604051635c46a7ef60e11b81523060048201526001600160a01b0391821660248201526044810184905260806064820152600060848201527f00000000000000000000000000000000000000000000000000000000000000009091169063b88d4fde9060a401600060405180830381600087803b1580156105cf57600080fd5b505af11580156105e3573d6000803e3d6000fd5b505050600083815261032e6020526040812080546001600160a01b031916815560018082018390556002909101805469ffffffffffffffffffff1916905561033480549193509190610636908490611b94565b909155506106cc9050565b60405180606001604052806106533390565b6001600160a01b03908116825261033554602080840191909152426001600160501b03908116604094850152600087815261032e8352849020855181546001600160a01b031916941693909317835590840151600183015592909101516002909101805469ffffffffffffffffffff1916919092161790555b505080806106d990611bcd565b915050610421565b50821561070157336000908152610332602052604081206107019161180f565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166340c10f19336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b15801561077957600080fd5b505af115801561078d573d6000803e3d6000fd5b509295945050505050565b600060018261ffff166132c881106107c057634e487b7160e01b600052603260045260246000fd5b601091828204019190066002029054906101000a900461ffff169050919050565b61033160205281600052604060002081815481106107fe57600080fd5b90600052602060002001600091509150505481565b6000546001600160a01b0316331461083d5760405162461bcd60e51b815260040161040190611acd565b610847600061175a565b565b6000546001600160a01b031633146108735760405162461bcd60e51b815260040161040190611acd565b60005b61ffff81168311156109205783838261ffff168181106108a657634e487b7160e01b600052603260045260246000fd5b90506020020160208101906108bb9190611a58565b60016108c78385611b02565b61ffff166132c881106108ea57634e487b7160e01b600052603260045260246000fd5b601091828204019190066002026101000a81548161ffff021916908361ffff1602179055508061091990611bab565b9050610876565b50505050565b61033260205281600052604060002081815481106107fe57600080fd5b60005b81811015610cb057337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636352211e85858581811061099e57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906109b39190611a58565b6040516001600160e01b031960e084901b16815261ffff909116600482015260240160206040518083038186803b1580156109ed57600080fd5b505afa158015610a01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2591906118c5565b6001600160a01b031614610a7b5760405162461bcd60e51b815260206004820181905260248201527f596f752063616e6e6f74207374616b65207468697321204e696365207472792e6044820152606401610401565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166323b872dd3330868686818110610acc57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610ae19190611a58565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015261ffff166044820152606401600060405180830381600087803b158015610b3457600080fd5b505af1158015610b48573d6000803e3d6000fd5b505050506040518060600160405280610b5e3390565b6001600160a01b03168152602001610335548152602001426001600160501b031681525061032e6000858585818110610ba757634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610bbc9190611a58565b61ffff16815260208082019290925260409081016000908120845181546001600160a01b0319166001600160a01b03909116178155848401516001820155938201516002909401805469ffffffffffffffffffff19166001600160501b03909516949094179093553383526103329091529020838383818110610c4f57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610c649190611a58565b81546001818101845560009384526020842061ffff9093169290910191909155610334805491929091610c98908490611b28565b90915550819050610ca881611bcd565b915050610946565b505050565b6000546001600160a01b03163314610cdf5760405162461bcd60e51b815260040161040190611acd565b604051806040016040528083670de0b6b3a7640000610cfe9190611b75565b81526020908101929092526000938452610330825260409093208351815592015160019092019190915550565b61ffff811660009081526103306020526040902054610d4957600080fd5b8061ffff166103e81415610dcd5760058211610dcd5760405162461bcd60e51b815260206004820152603e60248201527f546f207374616b6520696e20706c6174696e756d206d616e73696f6e20796f7560448201527f206d757374206164642061746c65617374203620617420612074696d652e00006064820152608401610401565b60005b8281101561092057337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636352211e868685818110610e2857634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610e3d9190611a58565b6040516001600160e01b031960e084901b16815261ffff909116600482015260240160206040518083038186803b158015610e7757600080fd5b505afa158015610e8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eaf91906118c5565b6001600160a01b031614610f055760405162461bcd60e51b815260206004820181905260248201527f596f752063616e6e6f74207374616b65207468697321204e696365207472792e6044820152606401610401565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166323b872dd3330878786818110610f5657634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610f6b9190611a58565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015261ffff166044820152606401600060405180830381600087803b158015610fbe57600080fd5b505af1158015610fd2573d6000803e3d6000fd5b505050506040518060600160405280610fe83390565b6001600160a01b03168152602001426001600160501b031681526020018361ffff1681525061032f600086868581811061103257634e487b7160e01b600052603260045260246000fd5b90506020020160208101906110479190611a58565b61ffff90811682526020808301939093526040918201600090812085518154958701519690940151909216600160f01b026001600160f01b036001600160501b03909616600160a01b026001600160f01b03199095166001600160a01b0390941693909317939093179390931617909155610331906110c33390565b6001600160a01b03166001600160a01b0316815260200190815260200160002084848381811061110357634e487b7160e01b600052603260045260246000fd5b90506020020160208101906111189190611a58565b81546001818101845560009384526020842061ffff909316929091019190915561033380549192909161114c908490611b28565b9091555081905061115c81611bcd565b915050610dd0565b60008080805b33600090815261033160205260409020548110156115ba57336000908152610331602052604081208054839081106111b257634e487b7160e01b600052603260045260246000fd5b60009182526020808320919091015480835261032f8252604092839020835160608101855290546001600160a01b038116808352600160a01b82046001600160501b031694830194909452600160f01b900461ffff16938101939093529250331461125f5760405162461bcd60e51b815260206004820152601d60248201527f596f7520646f6e2774206f776e20746869732e204e696365207472792e0000006044820152606401610401565b60408082015161ffff1660009081526103306020908152918120549183015190916201518091611298906001600160501b031642611b94565b6112a29190611b75565b6112ac9190611b61565b9050816040015161ffff166103e814156112d1576112ca8187611b28565b9550611435565b81516040808401519051627eeac760e11b81526001600160a01b03928316600482015261ffff90911660248201526000917f0000000000000000000000000000000000000000000000000000000000000000169062fdd58e9060440160206040518083038186803b15801561134557600080fd5b505afa158015611359573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137d9190611a8a565b111561138d576112ca8187611b28565b60408083015161ffff16600090815261033060205220600101546113b0846117aa565b116113c6576113bf8186611b28565b9450611435565b6132c86001846132c881106113eb57634e487b7160e01b600052603260045260246000fd5b601091828204019190066002029054906101000a900461ffff1661140f9190611b40565b61141a906001611b02565b6114289061ffff1682611b75565b6114329087611b28565b95505b8715611508578151604051635c46a7ef60e11b81523060048201526001600160a01b0391821660248201526044810185905260806064820152600060848201527f00000000000000000000000000000000000000000000000000000000000000009091169063b88d4fde9060a401600060405180830381600087803b1580156114bd57600080fd5b505af11580156114d1573d6000803e3d6000fd5b505050600084815261032f602052604081208190556103338054600193509091906114fd908490611b94565b909155506115a49050565b604051806060016040528061151a3390565b6001600160a01b0390811682526001600160501b0342811660208085019190915260408781015161ffff90811695820195909552600089815261032f835281902086518154938801519790920151909516600160f01b026001600160f01b0396909316600160a01b026001600160f01b031990921693169290921791909117929092169190911790555b50505080806115b290611bcd565b91505061116a565b5083156115da57336000908152610331602052604081206115da9161180f565b8115611671576001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166340c10f19336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101859052604401600060405180830381600087803b15801561165857600080fd5b505af115801561166c573d6000803e3d6000fd5b505050505b801580159061168257506103345415155b156116ad57610334546116959082611b61565b61033560008282546116a79190611b28565b90915550505b6116b78183611b28565b949350505050565b6000546001600160a01b031633146116e95760405162461bcd60e51b815260040161040190611acd565b6001600160a01b03811661174e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610401565b6117578161175a565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000326117b8600143611b94565b60405160609290921b6bffffffffffffffffffffffff191660208301524060348201524460548201524260748201526094810183905260b40160408051601f19818403018152919052805160209091012092915050565b508054600082559060005260206000209081019061175791905b8082111561183d5760008155600101611829565b5090565b60008083601f840112611852578182fd5b50813567ffffffffffffffff811115611869578182fd5b6020830191508360208260051b850101111561188457600080fd5b9250929050565b803561ffff8116811461189d57600080fd5b919050565b6000602082840312156118b3578081fd5b81356118be81611c14565b9392505050565b6000602082840312156118d6578081fd5b81516118be81611c14565b6000806000806000608086880312156118f8578081fd5b853561190381611c14565b9450602086013561191381611c14565b935060408601359250606086013567ffffffffffffffff80821115611936578283fd5b818801915088601f830112611949578283fd5b813581811115611957578384fd5b896020828501011115611968578384fd5b9699959850939650602001949392505050565b6000806040838503121561198d578182fd5b823561199881611c14565b946020939093013593505050565b600080602083850312156119b8578182fd5b823567ffffffffffffffff8111156119ce578283fd5b6119da85828601611841565b90969095509350505050565b6000806000604084860312156119fa578283fd5b833567ffffffffffffffff811115611a10578384fd5b611a1c86828701611841565b9094509250611a2f90506020850161188b565b90509250925092565b600060208284031215611a49578081fd5b813580151581146118be578182fd5b600060208284031215611a69578081fd5b6118be8261188b565b600060208284031215611a83578081fd5b5035919050565b600060208284031215611a9b578081fd5b5051919050565b600080600060608486031215611ab6578283fd5b505081359360208301359350604090920135919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600061ffff808316818516808303821115611b1f57611b1f611be8565b01949350505050565b60008219821115611b3b57611b3b611be8565b500190565b600061ffff80841680611b5557611b55611bfe565b92169190910492915050565b600082611b7057611b70611bfe565b500490565b6000816000190483118215151615611b8f57611b8f611be8565b500290565b600082821015611ba657611ba6611be8565b500390565b600061ffff80831681811415611bc357611bc3611be8565b6001019392505050565b6000600019821415611be157611be1611be8565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b038116811461175757600080fdfea26469706673582212202949ed0427893705f1575100cb10aa7fb07e7e40609872e2bc40ed87d6a9e8ac64736f6c63430008040033000000000000000000000000887d93d024355176b9e00953c98a2bdc08f7a3a2

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101215760003560e01c8063bd0d3b9f116100ad578063dad446fe11610071578063dad446fe14610329578063e885d03114610333578063f2fde38b14610346578063f4a5709b14610359578063f55aedc81461036357600080fd5b8063bd0d3b9f1461026c578063c24fba091461027f578063c35927bb14610292578063c9e895dc146102a5578063da9ec5ae146102b857600080fd5b80635885ef07116100f45780635885ef07146101b1578063715018a6146101bb57806374eea030146101c55780638da5cb5b1461023e578063a15261581461025957600080fd5b8063150b7a02146101265780632c0de819146101575780633b32e886146101785780634e55c6af1461019e575b600080fd5b6101396101343660046118e1565b6103a0565b6040516001600160e01b031990911681526020015b60405180910390f35b61016a610165366004611a38565b61041c565b60405190815260200161014e565b61018b610186366004611a58565b610798565b60405161ffff909116815260200161014e565b61016a6101ac36600461197b565b6107e1565b61016a6103335481565b6101c3610813565b005b61020d6101d3366004611a72565b61032f602052600090815260409020546001600160a01b03811690600160a01b81046001600160501b031690600160f01b900461ffff1683565b604080516001600160a01b0390941684526001600160501b03909216602084015261ffff169082015260600161014e565b6000546040516001600160a01b03909116815260200161014e565b6101c36102673660046119e6565b610849565b61016a61027a36600461197b565b610926565b6101c361028d3660046119a6565b610943565b6101c36102a0366004611aa2565b610cb5565b6101c36102b33660046119e6565b610d2b565b6102fb6102c6366004611a72565b61032e602052600090815260409020805460018201546002909201546001600160a01b0390911691906001600160501b031683565b604080516001600160a01b03909416845260208401929092526001600160501b03169082015260600161014e565b61016a6103345481565b61016a610341366004611a38565b611164565b6101c36103543660046118a2565b6116bf565b61016a6103355481565b61038b610371366004611a72565b610330602052600090815260409020805460019091015482565b6040805192835260208301919091520161014e565b60006001600160a01b0385161561040a5760405162461bcd60e51b815260206004820152602360248201527f43616e6e6f742073656e6420746f6b656e7320746f204261726e206469726563604482015262746c7960e81b60648201526084015b60405180910390fd5b50630a85bd0160e11b95945050505050565b600080805b33600090815261033260205260409020548110156106e1573360009081526103326020526040812080548390811061046957634e487b7160e01b600052603260045260246000fd5b600091825260208083209091015480835261032e8252604092839020835160608101855281546001600160a01b03168152600182015493810193909352600201546001600160501b0316928201929092529091506104c43390565b6001600160a01b031681600001516001600160a01b0316146105285760405162461bcd60e51b815260206004820152601d60248201527f596f7520646f6e2774206f776e20746869732e204e696365207472792e0000006044820152606401610401565b80602001516103355461053b9190611b94565b6105459085611b28565b93508515610641578051604051635c46a7ef60e11b81523060048201526001600160a01b0391821660248201526044810184905260806064820152600060848201527f000000000000000000000000da4128a4fc209df510e9e4483acd059d846204199091169063b88d4fde9060a401600060405180830381600087803b1580156105cf57600080fd5b505af11580156105e3573d6000803e3d6000fd5b505050600083815261032e6020526040812080546001600160a01b031916815560018082018390556002909101805469ffffffffffffffffffff1916905561033480549193509190610636908490611b94565b909155506106cc9050565b60405180606001604052806106533390565b6001600160a01b03908116825261033554602080840191909152426001600160501b03908116604094850152600087815261032e8352849020855181546001600160a01b031916941693909317835590840151600183015592909101516002909101805469ffffffffffffffffffff1916919092161790555b505080806106d990611bcd565b915050610421565b50821561070157336000908152610332602052604081206107019161180f565b6001600160a01b037f000000000000000000000000887d93d024355176b9e00953c98a2bdc08f7a3a2166340c10f19336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401600060405180830381600087803b15801561077957600080fd5b505af115801561078d573d6000803e3d6000fd5b509295945050505050565b600060018261ffff166132c881106107c057634e487b7160e01b600052603260045260246000fd5b601091828204019190066002029054906101000a900461ffff169050919050565b61033160205281600052604060002081815481106107fe57600080fd5b90600052602060002001600091509150505481565b6000546001600160a01b0316331461083d5760405162461bcd60e51b815260040161040190611acd565b610847600061175a565b565b6000546001600160a01b031633146108735760405162461bcd60e51b815260040161040190611acd565b60005b61ffff81168311156109205783838261ffff168181106108a657634e487b7160e01b600052603260045260246000fd5b90506020020160208101906108bb9190611a58565b60016108c78385611b02565b61ffff166132c881106108ea57634e487b7160e01b600052603260045260246000fd5b601091828204019190066002026101000a81548161ffff021916908361ffff1602179055508061091990611bab565b9050610876565b50505050565b61033260205281600052604060002081815481106107fe57600080fd5b60005b81811015610cb057337f000000000000000000000000da4128a4fc209df510e9e4483acd059d846204196001600160a01b0316636352211e85858581811061099e57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906109b39190611a58565b6040516001600160e01b031960e084901b16815261ffff909116600482015260240160206040518083038186803b1580156109ed57600080fd5b505afa158015610a01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2591906118c5565b6001600160a01b031614610a7b5760405162461bcd60e51b815260206004820181905260248201527f596f752063616e6e6f74207374616b65207468697321204e696365207472792e6044820152606401610401565b6001600160a01b037f000000000000000000000000da4128a4fc209df510e9e4483acd059d84620419166323b872dd3330868686818110610acc57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610ae19190611a58565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015261ffff166044820152606401600060405180830381600087803b158015610b3457600080fd5b505af1158015610b48573d6000803e3d6000fd5b505050506040518060600160405280610b5e3390565b6001600160a01b03168152602001610335548152602001426001600160501b031681525061032e6000858585818110610ba757634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610bbc9190611a58565b61ffff16815260208082019290925260409081016000908120845181546001600160a01b0319166001600160a01b03909116178155848401516001820155938201516002909401805469ffffffffffffffffffff19166001600160501b03909516949094179093553383526103329091529020838383818110610c4f57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610c649190611a58565b81546001818101845560009384526020842061ffff9093169290910191909155610334805491929091610c98908490611b28565b90915550819050610ca881611bcd565b915050610946565b505050565b6000546001600160a01b03163314610cdf5760405162461bcd60e51b815260040161040190611acd565b604051806040016040528083670de0b6b3a7640000610cfe9190611b75565b81526020908101929092526000938452610330825260409093208351815592015160019092019190915550565b61ffff811660009081526103306020526040902054610d4957600080fd5b8061ffff166103e81415610dcd5760058211610dcd5760405162461bcd60e51b815260206004820152603e60248201527f546f207374616b6520696e20706c6174696e756d206d616e73696f6e20796f7560448201527f206d757374206164642061746c65617374203620617420612074696d652e00006064820152608401610401565b60005b8281101561092057337f000000000000000000000000fd1076d80fff9dc702ae9fdfea0073467b9b3fb76001600160a01b0316636352211e868685818110610e2857634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610e3d9190611a58565b6040516001600160e01b031960e084901b16815261ffff909116600482015260240160206040518083038186803b158015610e7757600080fd5b505afa158015610e8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eaf91906118c5565b6001600160a01b031614610f055760405162461bcd60e51b815260206004820181905260248201527f596f752063616e6e6f74207374616b65207468697321204e696365207472792e6044820152606401610401565b6001600160a01b037f000000000000000000000000fd1076d80fff9dc702ae9fdfea0073467b9b3fb7166323b872dd3330878786818110610f5657634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610f6b9190611a58565b6040516001600160e01b031960e086901b1681526001600160a01b03938416600482015292909116602483015261ffff166044820152606401600060405180830381600087803b158015610fbe57600080fd5b505af1158015610fd2573d6000803e3d6000fd5b505050506040518060600160405280610fe83390565b6001600160a01b03168152602001426001600160501b031681526020018361ffff1681525061032f600086868581811061103257634e487b7160e01b600052603260045260246000fd5b90506020020160208101906110479190611a58565b61ffff90811682526020808301939093526040918201600090812085518154958701519690940151909216600160f01b026001600160f01b036001600160501b03909616600160a01b026001600160f01b03199095166001600160a01b0390941693909317939093179390931617909155610331906110c33390565b6001600160a01b03166001600160a01b0316815260200190815260200160002084848381811061110357634e487b7160e01b600052603260045260246000fd5b90506020020160208101906111189190611a58565b81546001818101845560009384526020842061ffff909316929091019190915561033380549192909161114c908490611b28565b9091555081905061115c81611bcd565b915050610dd0565b60008080805b33600090815261033160205260409020548110156115ba57336000908152610331602052604081208054839081106111b257634e487b7160e01b600052603260045260246000fd5b60009182526020808320919091015480835261032f8252604092839020835160608101855290546001600160a01b038116808352600160a01b82046001600160501b031694830194909452600160f01b900461ffff16938101939093529250331461125f5760405162461bcd60e51b815260206004820152601d60248201527f596f7520646f6e2774206f776e20746869732e204e696365207472792e0000006044820152606401610401565b60408082015161ffff1660009081526103306020908152918120549183015190916201518091611298906001600160501b031642611b94565b6112a29190611b75565b6112ac9190611b61565b9050816040015161ffff166103e814156112d1576112ca8187611b28565b9550611435565b81516040808401519051627eeac760e11b81526001600160a01b03928316600482015261ffff90911660248201526000917f00000000000000000000000039aefb036dabf9d29d33f357dcc3dce06dc2b899169062fdd58e9060440160206040518083038186803b15801561134557600080fd5b505afa158015611359573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137d9190611a8a565b111561138d576112ca8187611b28565b60408083015161ffff16600090815261033060205220600101546113b0846117aa565b116113c6576113bf8186611b28565b9450611435565b6132c86001846132c881106113eb57634e487b7160e01b600052603260045260246000fd5b601091828204019190066002029054906101000a900461ffff1661140f9190611b40565b61141a906001611b02565b6114289061ffff1682611b75565b6114329087611b28565b95505b8715611508578151604051635c46a7ef60e11b81523060048201526001600160a01b0391821660248201526044810185905260806064820152600060848201527f000000000000000000000000fd1076d80fff9dc702ae9fdfea0073467b9b3fb79091169063b88d4fde9060a401600060405180830381600087803b1580156114bd57600080fd5b505af11580156114d1573d6000803e3d6000fd5b505050600084815261032f602052604081208190556103338054600193509091906114fd908490611b94565b909155506115a49050565b604051806060016040528061151a3390565b6001600160a01b0390811682526001600160501b0342811660208085019190915260408781015161ffff90811695820195909552600089815261032f835281902086518154938801519790920151909516600160f01b026001600160f01b0396909316600160a01b026001600160f01b031990921693169290921791909117929092169190911790555b50505080806115b290611bcd565b91505061116a565b5083156115da57336000908152610331602052604081206115da9161180f565b8115611671576001600160a01b037f000000000000000000000000887d93d024355176b9e00953c98a2bdc08f7a3a2166340c10f19336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101859052604401600060405180830381600087803b15801561165857600080fd5b505af115801561166c573d6000803e3d6000fd5b505050505b801580159061168257506103345415155b156116ad57610334546116959082611b61565b61033560008282546116a79190611b28565b90915550505b6116b78183611b28565b949350505050565b6000546001600160a01b031633146116e95760405162461bcd60e51b815260040161040190611acd565b6001600160a01b03811661174e5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610401565b6117578161175a565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000326117b8600143611b94565b60405160609290921b6bffffffffffffffffffffffff191660208301524060348201524460548201524260748201526094810183905260b40160408051601f19818403018152919052805160209091012092915050565b508054600082559060005260206000209081019061175791905b8082111561183d5760008155600101611829565b5090565b60008083601f840112611852578182fd5b50813567ffffffffffffffff811115611869578182fd5b6020830191508360208260051b850101111561188457600080fd5b9250929050565b803561ffff8116811461189d57600080fd5b919050565b6000602082840312156118b3578081fd5b81356118be81611c14565b9392505050565b6000602082840312156118d6578081fd5b81516118be81611c14565b6000806000806000608086880312156118f8578081fd5b853561190381611c14565b9450602086013561191381611c14565b935060408601359250606086013567ffffffffffffffff80821115611936578283fd5b818801915088601f830112611949578283fd5b813581811115611957578384fd5b896020828501011115611968578384fd5b9699959850939650602001949392505050565b6000806040838503121561198d578182fd5b823561199881611c14565b946020939093013593505050565b600080602083850312156119b8578182fd5b823567ffffffffffffffff8111156119ce578283fd5b6119da85828601611841565b90969095509350505050565b6000806000604084860312156119fa578283fd5b833567ffffffffffffffff811115611a10578384fd5b611a1c86828701611841565b9094509250611a2f90506020850161188b565b90509250925092565b600060208284031215611a49578081fd5b813580151581146118be578182fd5b600060208284031215611a69578081fd5b6118be8261188b565b600060208284031215611a83578081fd5b5035919050565b600060208284031215611a9b578081fd5b5051919050565b600080600060608486031215611ab6578283fd5b505081359360208301359350604090920135919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600061ffff808316818516808303821115611b1f57611b1f611be8565b01949350505050565b60008219821115611b3b57611b3b611be8565b500190565b600061ffff80841680611b5557611b55611bfe565b92169190910492915050565b600082611b7057611b70611bfe565b500490565b6000816000190483118215151615611b8f57611b8f611be8565b500290565b600082821015611ba657611ba6611be8565b500390565b600061ffff80831681811415611bc357611bc3611be8565b6001019392505050565b6000600019821415611be157611be1611be8565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b038116811461175757600080fdfea26469706673582212202949ed0427893705f1575100cb10aa7fb07e7e40609872e2bc40ed87d6a9e8ac64736f6c63430008040033

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

000000000000000000000000887d93d024355176b9e00953c98a2bdc08f7a3a2

-----Decoded View---------------
Arg [0] : _soul (address): 0x887D93d024355176b9e00953C98a2bdC08f7A3a2

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000887d93d024355176b9e00953c98a2bdc08f7a3a2


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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