ethavatar icon indicating copy to clipboard operation
ethavatar copied to clipboard

Reduce avatar cost & Add mechanism to keep avatars contract update

Open filips123 opened this issue 5 years ago • 0 comments

Smart contract currently uses string to store IPFS hash, so it could be pretty expensive to set avatar. According to answers on Ethereum Stack Exchange (1) (2) it is better (cheaper) to store IPFS hash as struct of bytes32 and two uint8s.

I don't test if that ts really cheaper, but maybe (after tests) you could update smart contract.

struct MultiHash {
  bytes32 hash
  uint8 hashFunction
  uint8 size
}

Also, there should be mechanism to keep avatars after updating smart contract. They currently gone after update. Maybe there could be program to listen for contract changes and re-upload avatars if contract has changed?

filips123 avatar Oct 10 '18 19:10 filips123