1.1 ❗️ Fund your WorldLand

When deploying contracts, you need some coins. This a way how to get world land testnet coins! Plz follow these statements:

2. Run the remix and compile the code


2.1 make file and input file name

any name is okay

2.2 write or Paste contract code

I use this code samples

2.2.1 fungible tokens

// contracts/ testerc20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract TESTToken is ERC20 {
    constructor(uint256 initialSupply) ERC20("TEST", "TST") {
        _mint(msg.sender, initialSupply);

2.2.2 Non-fungible tokens

// contracts/testerc721.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/utils/Counters.sol";

contract TESTItem is ERC721URIStorage {
    using Counters for Counters.Counter;
    Counters.Counter private _tokenIds;
    constructor() ERC721("TESTItem", "TST") {}
    function awardItem(address player, string memory tokenURI)
        returns (uint256)
        uint256 newItemId = _tokenIds.current();
        _mint(player, newItemId);
        _setTokenURI(newItemId, tokenURI);
        return newItemId;

When you're done writing the code, go to the Compile tab.

Warning! Set the EVM version to Paris and compile.

Once you've changed the version, press the Compile button to run the compile.

3. Connect to Metamask and deploy to contract

After compiling, go to the Deployment tab.

Select "injected web3" in the environment.

The connected network number and account will then appear.

If there are parameters of the contract constructor, write them by clicking the button in the picture below.

Click the TRANSACT button to deploy the contract.

Finally, you can deploy contract to WorldLand

4. Execute function of contract

You can excute function of contract in Deployed Contracts

5. Import token in metamask

You can check your tokens in metamsk using "Import tokens"

Extra. Save nft using ipfs(pinata)

Below is how to register NFT using pinata and ipfs in erc721.

If the above TEST721.sol contract is deployed, the following functions appear.

awarditem is a function that awards the NFT json file in tokenUrl to the player.

So, we need to store the JSON file in the URL.

Upload the NFS JSON file to IPFS using pinata.

  1. First sign up for Pinata

{% embed url="" %}

2. upload image of nft and make json The format of the json file is as follows.

"name": "timetable",
"description": "smin's timetable",
"strength": 20

If you want to include an image, the image must also be stored in ipfs. So, I upload the image first.

You can see the file is saved.

Click the eye icon and copy the url of the image.

image ipfs example:

Paste the url into the image item in json.

"image": "",

3. Upload the json to pinata and copy the url. The method is the same as the image.

json ipfs example:

Finally, copy the address of your wallet, put your wallet address in the player, and the json url in tokenURL and send the transaction.

You saved the NFT!

Last updated