morpho-org / morpho-seatbelt

Morpho seatbelt for governance setup and proposals.
MIT License
3 stars 1 forks source link

Add mapping function name #18

Closed Tristan22400 closed 1 year ago

Tristan22400 commented 1 year ago

Fix: https://github.com/morpho-org/morpho-seatbelt/issues/8

Tristan22400 commented 1 year ago

You could also build a utility function that takes as input the signature of a function as a string and a prefix as a string and registers the selector (using abi.encodeWithSignature with empty payload) as well as register its name (which is passed as a parameter)

I am not sure to completely understand your point. Can you explain it again please?

Rubilmax commented 1 year ago

Instead of registering the selector then the function's name, we could do both inside a utility function, at the same time, given the function's signature It's just some sort of shorter solution and easier to maintain (for a given function, you only have a call to the utility function instead of having to register the selector AND it he function's name) I believe the idea of isolating this logic to a utility function is a good idea (and is great for software maintainability) ; however simplifying the logic using only the function's signature is not worth