-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.6 receive fallback function instrumented #516
Comments
Am looking at this right now... the test we have with a fallback that looks like this receive() external payable
{
if (msg.value > 0)
emit Deposit(msg.sender, msg.value);
} ...is passing. Client is ganache-core v2.10.1 (MuirGlacier). It probably works because it's too simple and doesn't use much gas. Can you show a receive example that's failing for you? |
The updated |
Adding a third parameter to the event (bytes data) was enough to get it to fail on this side. Is the fallback with the assembly working ok though? |
Seems that way. There are ~70 occurrences of invokeWallet that does the low level call and they are working. That has sufficient gas passed to it though so it's different to doing a |
There's some gas distortion caused by Solidity statements the tool injects to track the execution path. Hopefully it's possible to minimize those for Will try to fix this tomorrow and publish an experimental patch, and maybe you could check that it works for those contracts. |
@elenadimitrova |
Thanks @cgewecke but still having the same problem.
|
@elenadimitrova Oh I'm sorry. That's strange. We have very similar instrumentation in the test here and it's passing. These send & transfer examples: ...run this... event Deposit(address indexed _sender, uint _value, bytes data);
receive() external payable
{
coverage_0xf2a277f5(0xb2baf8814b88a8e10df7811cfe4de699f4dfa82fee21030cef466b986ce61cb7); /* line */
if (msg.value > 0){
coverage_0xf2a277f5(0xa4b8e24690a0c94debffedca61a226696034c80f40f925c74914509c12313b8b); /* branch */
coverage_0xf2a277f5(0xbbd5fa732f9422ad22c57d343d767a696fb98bd2e856cc657c377d4ebe8fe8ea); /* line */
emit Deposit(msg.sender, msg.value, msg.data);
} else {
coverage_0xf2a277f5(0xc454deeb9e6220ae9751a1a45b1b5f6cf82972ab7c93be8d76a188b9bc8a5c9e); /* branch */
}
} Have also experimented with removing the What is the value of |
transfer
call to instrumentedreceive
fallback function fails as it probably exceeds the transfer call gas stipend. Similar to #106The text was updated successfully, but these errors were encountered: