What happened?
Currently they are stored in the contract that was the target of the delegate call (i.e. the one with code that emits the event).
#[motsu::test]
fn delegate_call_with_event(
proxy: Contract<Proxy>,
erc20: Contract<Erc20>,
alice: Address,
) {
proxy.sender(alice).constructor(erc20.address());
// mint 1000 tokens
let amount = U256::from(1000);
let mint_call =
IERC20::mintCall { to: alice, value: amount }.abi_encode();
proxy
.sender(alice)
.fallback(&mint_call)
.expect("should be able to mint");
// ERROR: THIS ASSERT FAILS, BUT SHOULD WORK
proxy.assert_emitted(&Transfer {
from: Address::ZERO,
to: alice,
value: amount,
});
// THIS ASSERT SHOULD FAIL, BUT WORKS
erc20.assert_emitted(&Transfer {
from: Address::ZERO,
to: alice,
value: amount,
});
Related #104
platform
Expected behavior
Events should be stored on the contract that initiated the delegate call
Contribution Guidelines