status-im / ens-usernames

DApp to register usernames for Status Network
MIT License
19 stars 11 forks source link

2 transactions required to save changes when editing name #6

Open asemiankevich opened 6 years ago

asemiankevich commented 6 years ago

When i edit contact code for example and try to save changes - 2 transactions are done in a row, however i expect 1

image

bgits commented 5 years ago

@rachelhamlin Is this still v1 if we are removing editing?

@3esmit Does it make sense to add a method to the Username Registrar contract that allows both fields to be updated in one call before the contract is finalized?

rachelhamlin commented 5 years ago

Good point, if only during the edit flow, let's take it off.

3esmit commented 5 years ago

The reason is because each change of ENS Resolver is a single transaction. This could be fixed through a contract upgrade that would take back the ownership of subdomain, make the changes in the resolver and then give back the ownership of the subdomain. Other possible solution would be possible with Identity contract, if it support multisend (a option within the contract to make multiple calls) then this would be fixed in another layer. Also a new resolver could be developed that supports changing multiple fields with one call.

The reason for this problem is because PublicResolver can only be edited by the owner of that subdomain, and each change is a separate call.

This could be mitigated if the Dapp checks if the current field is the same as in PublicResolver and only requesting calls to what changed - also correctly loading the fields that are already in the PublicResolver and warning if is different from current user.