polyland
and initialize it.
polyland/src/
directory. In the directory, create your metaverse contract: polyland.sol
.
Triangle
object with three edge
properties. The triangle is a patch of land that has three edges.constructor
function sets the contract up with four triangles. Since this is an array and starts with 0, while the ID of the minted patch starts with 1, the first element is set to Triangle0
. Triangle0
is the default first element that will not represent a patch of land in the Polyland metaverse.maxSupply
variable and the supplyCap
modifier, the number of patches available to mint is capped at 4
.remappings.txt
file with the following contents:
Polyland
— the name of the contract as provided in the contract code contract Polyland is ERC721, Ownable
/root/polyland/src/polylandFlat.sol
— full path to the flattened contract0x
prefix. Fund the account with devnet ONE using the testnet faucet.--legacy
— the Foundry flag to work with the EVM-based networks that are not EIP-1559 activated.solc
and the Deployed
to values in the output.
Contract Name
field, put Polyland
.Chain Type
to devnet
.Compiler
, provide the solc
version that the contract compiled with.Optimizer
, set Yes
, 200
. Contract bytecode optimization with 200 runs is the default Foundry setting.mintTriangle
, provide an address to distribute a patch of land to. Distribute the patches to different addresses until you hit the cap with the All patches minted
message.ownerOf
field by putting in the tokenId
values representing each of the patches of land: 1
, 2
, 3
, 4
.triangles field
, put in the same tokenId
values to get the data on each of the patches: name and the size of each of the three edges.