gnosisguild / wand-nft

wand-nft.vercel.app
8 stars 6 forks source link

Simplification: Store Stone directly as Angle #58

Closed cristovaoth closed 2 years ago

cristovaoth commented 2 years ago

When calculating stone interpolation, we derive fromIndex toIndex and progress from an angle in degrees.

Given that solidity does not support decimal numbers, I originally couldn't replicate computation on chain. So decided to store from, to and progress packed in an uint32

This PR removes this indirection, by storing the angle directly, and performing the parameter computation on chain.

NOTE: This is also expanding the amount of stone configurations possible. We are storing a number between 0 and 3600 which effectively means: angle in degrees with one decimal place.

Therefore: