solidity/test/libsolidity/semanticTests/events/event_emit_from_other_contract.sol

23 lines
648 B
Solidity
Raw Normal View History

contract D {
event Deposit(address indexed _from, bytes32 indexed _id, uint _value);
function deposit(bytes32 _id) public payable {
emit Deposit(msg.sender, _id, msg.value);
}
}
contract C {
D d;
constructor() {
d = new D();
}
function deposit(bytes32 _id) public payable {
d.deposit(_id);
}
}
// ----
// constructor() ->
2022-08-10 16:45:38 +00:00
// gas irOptimized: 166854
2021-11-15 15:19:33 +00:00
// gas legacy: 250376
// gas legacyOptimized: 174522
// deposit(bytes32), 18 wei: 0x1234 ->
// ~ emit Deposit(address,bytes32,uint256) from 0x137aa4dfc0911524504fcd4d98501f179bc13b4a: #0xc06afe3a8444fc0004668591e8306bfb9968e79e, #0x1234, 0x00