ethavatar
ethavatar copied to clipboard
Reduce avatar cost & Add mechanism to keep avatars contract update
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 uint8
s.
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?