hyperledger-solang / solang

Solidity Compiler for Solana and Polkadot
https://solang.readthedocs.io/
Apache License 2.0
1.27k stars 215 forks source link

Various fallback improvements #1611

Open seanyoung opened 11 months ago

seanyoung commented 11 months ago

Allow the following:

contract A {
    // Take raw calldata as argument and return return data
    fallback(bytes calldata input) external payable (bytes memory) {}
}

Allow a function to be called fallback:

contract A {
    // Will give a warning that's not a fallback function,
    // just a regular functon
    function fallback() public {}
}

This should make proxy contracts much easier to implement.

Also fixes all fallback/receive related failures in the evm tests.

codecov[bot] commented 11 months ago

Codecov Report

Attention: 35 lines in your changes are missing coverage. Please review.

Comparison is base (00bcabb) 88.44% compared to head (1a4cef6) 88.42%.

Files Patch % Lines
src/lir/converter/expression.rs 0.00% 23 Missing :warning:
src/codegen/cfg.rs 0.00% 10 Missing :warning:
src/codegen/mod.rs 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1611 +/- ## ========================================== - Coverage 88.44% 88.42% -0.03% ========================================== Files 150 150 Lines 68322 68503 +181 ========================================== + Hits 60429 60572 +143 - Misses 7893 7931 +38 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

xermicus commented 7 months ago

@seanyoung I'll be preparing a release in the upcoming days, I think this would be nice to have in :)