You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following event is declared twice, one in the Subscriptions.sol Library and once in the ISubscription.sol interface (implemented by Fund.sol). event Deposit(address subscriber, uint256 subIdx, address token, uint256 balance);
When a Contract uses a library, underneath the hood it is a delegateCall. So when Fund calls a library function from SubLib, it's a delegateCall from Fund to SubLib (which is why libraries can't access storage directly, and have to be passed a pointer specifically).
If we don't include the event in ISubscription however, the event is never emitted (since the abi for Fund doesn't have the event?)
A similar problem arises when we're emitting events from Utils.create_position and Utils.close_positions.
Not having the event in the abi manifests problems in Matcha Tests and The Graph's subgraphs.
There are 2 solutions:
copypasta the events in 2 places. Manual and error-prone labour of making sure they're synced.
modify the contract such that the library is not responsible for emitting events.
The text was updated successfully, but these errors were encountered:
The following event is declared twice, one in the
Subscriptions.sol
Library and once in theISubscription.sol
interface (implemented byFund.sol
).event Deposit(address subscriber, uint256 subIdx, address token, uint256 balance);
When a Contract uses a library, underneath the hood it is a delegateCall. So when Fund calls a library function from SubLib, it's a delegateCall from Fund to SubLib (which is why libraries can't access storage directly, and have to be passed a pointer specifically).
If we don't include the event in ISubscription however, the event is never emitted (since the abi for Fund doesn't have the event?)
A similar problem arises when we're emitting events from Utils.create_position and Utils.close_positions.
Not having the event in the abi manifests problems in Matcha Tests and The Graph's subgraphs.
There are 2 solutions:
The text was updated successfully, but these errors were encountered: