Skip to content
Snippets Groups Projects
Unverified Commit c29e72a8 authored by xermicus's avatar xermicus Committed by GitHub
Browse files

[pallet-revive] allow delegate calls to non-contract accounts (#7729)


This PR changes the behavior of delegate calls when the callee is not a
contract account: Instead of returning a `CodeNotFound` error, this is
allowed and the caller observes a successful call with empty output.

The change makes for example the following contract behave the same as
on EVM:

```Solidity
contract DelegateCall {
    function delegateToLibrary() external returns (bool) {
        address testAddress = 0x0000000000000000000000000000000000000000;
        (bool success, ) = testAddress.delegatecall(
            abi.encodeWithSignature("test()")
        );
        return success;
    }
}
```

Closes https://github.com/paritytech/revive/issues/235

---------

Signed-off-by: default avatarxermicus <cyrill@parity.io>
Co-authored-by: default avatarcmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
parent 10f7f410
Pipeline #517149 waiting for manual action with stages
in 1 hour, 38 minutes, and 45 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment