Submit Transaction (Solution)

Solution

git checkout exercise-02-solution
modifier onlyOwner() {
    require(isOwner[msg.sender], "not owner");
    _;
}
function submitTransaction(address _to, uint _value, bytes memory _data)
    public
    onlyOwner
{
    uint txIndex = transactions.length;

    transactions.push(Transaction({
        to: _to,
        value: _value,
        data: _data,
        executed: false,
        numConfirmations: 0
    }));

    emit SubmitTransaction(msg.sender, txIndex, _to, _value, _data);
}