Explore Philand
  • Welcome to Phi
    • 🏝️What's Phi?
    • 🌄Mission
    • 🏃‍♀️Story
    • 🏄Phi Crew
  • ⚡Products
    • 🏝️Phi Land
      • 🔦User Guide for Phi Land
        • 0️⃣Before Playing Phi
          • 🦊Download a Crypto Wallet
          • 🟣Get $MATIC
          • 🔷Get an ENS Domain
        • 1️⃣Access Phi Land
        • 2️⃣Create your Phi Land
        • 3️⃣Claim Quest Objects
        • 4️⃣Purchase Items on Shop
        • 5️⃣Deposit Objects to Land
        • 6️⃣Build your land
        • 7️⃣Share your land on Twitter
      • 🎧Phi Music
      • ⛓️Hyperlinks & Link List
      • 💫Transferring Land
      • ↔️Phi Connect
    • ⚔️Phi Quest
      • 🔦User Guide for Phi Quest
        • 0️⃣Before Playing Phi
          • 🦊Download a Crypto Wallet
          • 🟣Get $MATIC
        • 1️⃣Access Phi Quest
        • 2️⃣Claim Quest Objects
          • Quest List
          • Adventure
          • Campaign
        • 3️⃣Purchase Items on Shop
        • 4️⃣Play Phi Land with Items you got
      • 🧑Account
      • 🏅Active Score Rank Quests
    • 🍭Phi Opportunity (beta)
    • 💎Phi Material
      • ⚒️Phi Craft
      • 🥗UGC Craft
    • 🔮OpenSea Collection Links
    • 💡How-to's
      • 🏷️Mastering ENS (Ethereum Name Service)
        • How to Register an ENS Domain Name
        • How to Renew an ENS Domain Name
        • How to Manage ENS records
          • How to set up the Avatar record in ENS
            • Using MintYourPFP to set an Avatar to an ENS name
        • How to Transfer ENS to Another Wallet
        • How to set up an ENS Subdomain
    • ❓FAQ
      • Must I have an ENS to play Phi Quest?
      • How can I get an ENS domain?
      • Why don't my ENS domains show up?
      • Can I use ENS subdomains for Phi Land?
      • What happens when I transfer ENS?
      • I can't create a land
      • Why cannot access to my land?
      • Why can't I change the baseplate?
      • Why can’t I claim Quest objects?
      • Any rewards for participating in Testnet?
      • What is Phi Quest?
      • How the Leaderboard on Phi Quest is calculated?
      • Why are there two EXPs?
      • I claimed objects on Phi Quest. How can I create my Phi Land?
      • Why can’t I see my objects in my wallet?
      • Can I trade Quest Objects?
      • Are traded objects included in my EXP calculation?
      • My EXP not showing, leaderboard not updating
      • Which browser should I use?
      • Which devices are supported?
      • How to update my Twitter OGP image (card)?
    • 📬Submit Feedback
      • Bug Report
      • Feature Request
      • User Survey
  • ⚙️DEVELOPERS
    • 🪴Create Philand
    • 🎨Objects NFT
      • ⛓️Quest Object
      • 🌾Free Object
      • 🧊Premium Object
      • 🍰Baseplate Object
      • 🧮Wallpaper Object
      • 💄Other Topics
      • 💡Appendix
    • 🛠️Use PhiMap
      • 🗺️Deposit/Withdraw
      • 🍧Save Philand
      • 👀View Function
      • 💡Appendix
    • 💝Philand API
      • ⌚Introduction
      • 🔑Authentication
        • 😄Use API key
        • 😍Get Access Token
        • 🤩Verify Access Token
        • 🤪Get Refresh Token
        • 😎Refresh JWT
      • 🫔Quest
        • 🎾Get Quest List
        • 🏀Get Quest Status
        • ⚽Trigger Eligible Check
        • 🎯Get Claimed Status
        • 🏓Get Verify Coupon
      • 🏝️Philand
        • 🫑View Philand Link
        • 🍍Get Philand Image
      • 🧸Account
        • 🍞Get Philand List
        • 👑Get PhiRank
      • 🎺Object
        • 🎸Get Object Info
      • 🦖Example Call
        • 🤠Quest Claim
      • 👔Related Links
    • 🧑‍🏫How to Verify your transaction
      • 👓Read Contract Method
      • 🚩Third-party API
      • 🦷Whitelist
    • 📄Contracts
      • 👮Audit
  • 💼Career
    • 👯Phi is hiring
  • 🔗Official links
    • Website
    • Twitter
    • Discord
    • Discourse
    • Medium
    • Github
    • Guild.xyz
    • Lenster
    • Instagram
Powered by GitBook
On this page
  • A baseplate serves as the foundation for creating your world.
  • Contract
  • Let's visit Our Shop and see Baseplate

Was this helpful?

  1. DEVELOPERS
  2. Objects NFT

Baseplate Object

Original and creative Baseplate

PreviousPremium ObjectNextWallpaper Object

Last updated 2 years ago

Was this helpful?

A baseplate serves as the foundation for creating your world.

A baseplate allows you to build your world in the direction you choose, providing the foundation for creating and expanding your world.

Contract

The wallpaper and baseplate objects are designed to prevent multiple deposits in a map contract in order to save on gas fees. You can see behavior of Baseplate from changeWallpaper method.

 
    /*
     * @title checkBasePlate
     * @notice Functions for check BasePlate status
     * @param name : ens name
     * @dev Check BasePlate information
     * @return contractAddress,tokenId
     */
    function checkBasePlate(string memory name) external view returns (BasePlate memory) {
        return basePlate[name];
    }


    /*
     * @title changeBasePlate
     * @notice Receive changeBasePlate
     * @param name : ens name
     * @param contractAddress : Address of BasePlate
     * @param tokenId : tokenId
     */
    function _changeBasePlate(
        string memory name,
        address contractAddress,
        uint256 tokenId
    ) internal {
        address lastBasePlateContractAddress = basePlate[name].contractAddress;
        uint256 lastBasePlateTokenId = basePlate[name].tokenId;
        // Withdraw the deposited BasePlate OBJECT at the same time if it has already been deposited
        if (lastBasePlateContractAddress != address(0)) {
            IObject _lastBasePlate = IObject(lastBasePlateContractAddress);
            _lastBasePlate.safeTransferFrom(address(this), msg.sender, lastBasePlateTokenId, 1, "0x00");
        }
        // Check condition
        _checkConditon(name, contractAddress, tokenId);
        basePlate[name] = BasePlate(contractAddress, tokenId);
        // Deposit BasePlate object to be set in map contract
        IObject _object = IObject(contractAddress);
        _object.safeTransferFrom(msg.sender, address(this), tokenId, 1, "0x00");
        emit ChangeBasePlate(name, contractAddress, tokenId);
    }
    

    function _checkConditon(
        string memory name,
        address contractAddress,
        uint256 tokenId
    ) internal view {
        // Check that contractAddress is whitelisted.
        if (!_whitelist[contractAddress]) revert InvalidWhitelist();
        IObject _object = IObject(contractAddress);
        IObject.Size memory size = _object.getSize(tokenId);
        // Check that the size of the wall object matches the size of the current map contract
        if ((size.x != mapSettings.maxX) || (size.y != mapSettings.maxY)) {
            revert NotFit(msg.sender, size.x, size.y, mapSettings.maxX, mapSettings.maxY);
        }
        // Check if user has a wall object
        uint256 userBalance = _object.balanceOf(msg.sender, tokenId);
        if (userBalance < 1) {
            revert NotBalance({ name: name, sender: msg.sender, contractAddress: contractAddress, tokenId: tokenId });
        }
    }

     

CheckConditon methods check whether the owner has a baseplate or not, and whether the map size is 8*8 and the baseplate size is consistent.

Let's visit Our Shop and see Baseplate

BasePlate: '0xE83d625E021f8238f418c068D256FeceDE705970',

PhiMap: '0xe8b6395d223C9D3D85e162f2cb2023bC9088a908',

https://polygonscan.com/address/0xE83d625E021f8238f418c068D256FeceDE705970
https://polygonscan.com/address/0xe8b6395d223C9D3D85e162f2cb2023bC9088a908
⚙️
🎨
🍰
Baseplate - Shop | Phi QuestBaseplate - Shop | Phi Quest
Logo
(Draft of Baseplate...)
Windows model
Page cover image