I learn Solidity from the official documentation and the stack in the exercise, where I create a simple coin:
pragma solidity ^0.4.20;
contract Coin {
address public minter;
mapping (address => uint) public balances;
event Sent(address from, address to, uint amount);
function Coin() public {
minter = msg.sender;
}
function mint(address receiver, uint amount) public {
if (msg.sender != minter) return;
balances[receiver] += amount;
}
function send(address receiver, uint amount) public {
if (balances[msg.sender] < amount) return;
balances[msg.sender] -= amount;
balances[receiver] += amount;
emit Sent(msg.sender, receiver, amount);
}
}
When I try to compile, I received a syntax error in the last line: emit Sent (msg.sender, receiver, quantity)
I tried to compile it in Remix and VS Code, but got the same error message.
Can someone help me pls?
source
share