From what I have read, an array is made by using square brackets[],(The type of an array of fixed size k and element type T is written as T[k], and an array of dynamic size as T[].)
*. When looking at this basic cryptocurrency example from solidity.readthedocs **, I cannot see any array being made, yet Function mint() seems to refer to an array (balances[receiver] += amount;)
can anyone explain what is going on? what am I missing?
contract Coin {
address public minter;
mapping (address => uint) public balances;
event Sent(address from, address to, uint amount);
function Coin() {
minter = msg.sender;
}
function mint(address receiver, uint amount) returns {
if (msg.sender != minter) return;
balances[receiver] += amount;
}
function send(address receiver, uint amount) {
if (balances[msg.sender] < amount) return;
balances[msg.sender] -= amount;
balances[receiver] += amount;
Sent(msg.sender, receiver, amount);
}
}
*https://solidity.readthedocs.io/en/develop/types.html?highlight=address#arrays **https://solidity.readthedocs.io/en/v0.3.2/introduction-to-smart-contracts.html