We are two young devs that are starting to explore this amazing world. As a starting project we wanted to make a funny, but real, project on Ethereum.
The project is inspired by DecentraLand (LAND) and is pretty simple:
We have a 1000x1000 area (representing a map) and we want to let the users to claim an arbitrary piece of this map, communicating a Starting XY and an Ending XY coordinates.
This will generate an unique token (ERC-271) that will represent this area of the map.
Our main problem is the algorithm that will check if an area is already claimed or not.
The more users will claim a piece of map the more we will have to iterate to know if a new order should fail or not, raising the gas fee to the roof.
The smart contract will be like:
- Take the new order containing the start and the ending coordinates
- Iterates for every previous area bought while checking if there is an overlap
- Revert or Confirm the transaction
And this will get so much expensive in terms of gas when you have to check a lot of previuosly claimed areas.
Any suggestion? Thank you a lot!