aurora-is-near / aurora-relayer

[DEPRECATED] Web3-compatible relayer server for Aurora.
https://aurora-is-near.github.io/aurora-relayer/
Creative Commons Zero v1.0 Universal
26 stars 13 forks source link

Fix invalid `from` address value in events #120

Closed 0x3bfc closed 2 years ago

0x3bfc commented 2 years ago

Reproducing the issue

The call (low level EVM function) should emit the callee contract address in the transaction logs, however it emits the caller contract address. The following example reproduces the issue:

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

contract Caller {
    function greet(address to) public {
        to.call(abi.encodeWithSelector(Greeter(to).greet.selector));
    }
}

contract Delegated {
    function greet(address to) public {
        to.delegatecall(abi.encodeWithSelector(Greeter(to).greet.selector));
    }
}

contract Greeter {
    event Logger(address sender);

    function greet() public {
        emit Logger(msg.sender);
    }
}

On Aurora testnet:

By calling Caller.greet(), it returns the caller contract address in the transaction logs.

image

image (1)

On Goerli testnet:

image image

delegateCall is working fine as expected (emitting the caller contract address in the logs). For more info please refer to solidity docs

Related issues #118 and https://github.com/aurora-is-near/aurora-engine/issues/336

artob commented 2 years ago

@0x3bfc Please fix the merge conflicts.