Coder Social home page Coder Social logo

land's Introduction

LAND

Contracts for Decentraland's World.

Overview

The LAND contract keeps a record of all the land parcels, who their owner is, and what data is associated with them. The data associated can be an IPFS identifier, an IPNS url, or a simple HTTPS endpoint with a land description file.

Check this doc for further understanding.

License

Code released under the Apache v2.0 license.

land's People

Contributors

7flash avatar abarmat avatar alonzo-coeus avatar belohlavek avatar eordano avatar hprivakos avatar nachomazzara avatar nicosantangelo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

land's Issues

Add composable behavior into the Estate contract

The Estate contract should have the ability to receive the NFT representing a parcel and also to transfer it out from the Estate whenever the owner decides to do so.

  • Update the ERC721Received to handle the addition of the received ERC721 into the internal array. (userData parameter)
  • Add a transferOut() function to handle the unbundling of a parcel.
  • Handle the case when safeTransferFrom() was not used in the source contract.
  • Address mangling to create a unique id representing the assetId.

Note: The Composable attribute of this contract can be narrowed down to only supporting a LANDRegistry ERC721.

Reference: ethereum/EIPs#998

Should holders have to authorize themselves to updateLandData?

Currently a holder must do that in order to modify land data, here's an example test on how that works:

it('returns land data for a given set of parcel coordinates', async () => {
  await land.authorizeOperator(user, true, sentByUser)
  await land.updateLandData(0, 1, 'test_data', sentByUser)
  const data = await land.landData(0, 1, sentByUser)
  data.should.be.equal('test_data')
})

Is this necessary? If so, why?

Interacting with the LANDRegistry (?)

Hello,

I am very new to smart contracts, but managed my way to build this repository, and connect it with the mainnet via Infura. I want to retrieve the owner of a parcel, but I am not figuring out what am I doing wrong. Here's what I try:

truffle(livenet)> LANDRegistry.at("0x7e06a9512086bc44c51C07c2bF0Af338420c2A13").encodeTokenId.call(13,-7)
BigNumber {
s: 1,
e: 39,
c: [ 476395313689, 31384884872445, 4044754960377 ] }
truffle(livenet)>

truffle(livenet)> LANDRegistry.at("0x7e06a9512086bc44c51C07c2bF0Af338420c2A13").ownerOfLand.call(13,-7)
'0x0000000000000000000000000000000000000000'
truffle(livenet)>

So this cannot be true, since 13, -7 was sold in the auction and the team mentioned that the LAND is distributed among the auction winners. It would be great if somebody could give me the right nudge :)

Trying to deploy Land contracts

Hello, I am trying to deploy the Land contracts and having some trouble. Could someone tell me the order they are deployed and what goes in function initialize(bytes) in the LANDRegistry contract? Any help would be greatly appreciated.

About Estate

From the docs of FAQ about What is an Estate?

An estate is an association of two or more directly adjacent parcels of LAND. These parcels must be directly adjacent and cannot be separated by a road, plaza or any other parcel.

But, from the code

function _createEstate(

two non-adjacent parcels can also be combined into one estate.

Is there something wrong with me?

canDeploy modifier

Right now the following line is used in two deployment related functions:
require(authorizedDeploy[msg.sender]);

It may be relevant to move that logic into a modifier, specially if we implement require(condition, message) in the future.

Return is stopping land transfer

We should replace:

function transferLand(int x, int y, address to) public {
    return transfer(to, encodeTokenId(x, y));
  }

  function transferManyLand(int[] x, int[] y, address to) public {
    require(x.length == y.length);
    for (uint i = 0; i < x.length; i++) {
      return transfer(to, encodeTokenId(x[i], y[i]));
    }
  }

To

function transferLand(int x, int y, address to) public {
    transfer(to, encodeTokenId(x, y));
  }

  function transferManyLand(int[] x, int[] y, address to) public {
    require(x.length == y.length);
    for (uint i = 0; i < x.length; i++) {
      transfer(to, encodeTokenId(x[i], y[i]));
    }
  }

transferLand it is working anyways, but transferManyLand is only transferred one land and then break the process due return keyword

Update the EstateOwner contract into an ERC721

Convert the current EstateOwner implementation into an ERC721 compatible registry as it will make easier using the asset within the Marketplace and listing into other platforms.

  • Refactor constructor
  • Update single state variables to mappings accordingly in order to support multiple tokenIds
  • Change current operator name into updateOperator or something meaningful
  • Change EstateOwner to EstateRegistry (proposal)
  • Update tests

Note: Use as a base for the ERC721 standard the OpenZeppelin implementation.

Reference: https://github.com/OpenZeppelin/openzeppelin-solidity/tree/master/contracts/token/ERC721

Remove destroy function

Decentraland contact owner should not be able to destroy LAND at will...

The destroy function is counter productive to the Decentraland project. No government or single entity should have control over your LAND.

function destroy(uint256 assetId) onlyOwner public {

claimForgottenParcel allows anyone to steal "forgotten" parcels

I am still new to Solidity so forgive me if I missed something obvious but....

In LAND.sol -> claimForgottenParcel there is no verification other than that the token is already owned and it hasn't been pinged in over a year.

Anyone can claim forgotten tokens for free? Or is it supposed to "require(msg.sender == claimContract);"?

Run lint on Circle

Let the build break if the npm run lint command doesn't exit correctly

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.