Closed mfw78 closed 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);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Problem
The
IAdminView
interface is used for retrieving in the admin in theCOWShedStorage
, and is defined as being a function that's accessible on theCOWShedProxy
, however theCOWShedProxy
does not inherit the interface.https://github.com/meetmangukiya/cow-shed/blob/d67e97dd501d2fec42ab7d3e511bc3f9a2d87a8a/src/COWShedProxy.sol#L32
Solution
Inherit the
IAdminView
interface inCOWShedProxy
to ensure that it remains tightly bound.