cowdao-grants / cow-shed

A gas-efficient, address-bound account abstraction for permissioned hooks on CoW Protocol
GNU General Public License v3.0
8 stars 1 forks source link

Use IAdminView interface #5

Closed mfw78 closed 3 months ago

mfw78 commented 3 months ago

Problem

The IAdminView interface is used for retrieving in the admin in the COWShedStorage, and is defined as being a function that's accessible on the COWShedProxy, however the COWShedProxy does not inherit the interface.

https://github.com/meetmangukiya/cow-shed/blob/d67e97dd501d2fec42ab7d3e511bc3f9a2d87a8a/src/COWShedProxy.sol#L32

Solution

Inherit the IAdminView interface in COWShedProxy to ensure that it remains tightly bound.

meetmangukiya commented 3 months ago

not possible since admin is not always a view, its a view only when called from self, in other cases its a state changing function. So cant inherit an interface that declares it as a view.

Error (6959): Overriding function changes state mutability from "view" to "nonpayable".
  --> src/COWShedProxy.sol:32:5:
   |
32 |     function admin() external returns (address) {
   |     ^ (Relevant source part starts here and spans across multiple lines).
Note: Overridden function is here:
 --> src/COWShedStorage.sol:5:5:
  |
5 |     function admin() external view returns (address);
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^