0

Good Morning Everyone, I have created a dAPP that sends ether to multiple addresses at once....but I have one issue, I am trying to create an event where all information about the transactions is stored.. so I am trying to display an array of addresses when the event is logged....is this possible please.

This is the event; event Transfer(address from, address[] _to, uint etherd, uint256 timestamp);

Then am trying to log the address array in the event log.

1 Answer 1

1

It's possible but the addresses in the array can't be indexed.

contract Tmp {
    event Transfer(address indexed from, address[] _to, uint256 etherd, uint256 timestamp);

    function stuff(address from, address[] memory _to, uint etherd, uint256 timestamp) external payable {
        // ...
        
        emit Transfer(from, _to, etherd, timestamp);
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.