Saving Tokens

DerBärDerBär Member Posts: 1

I have some basic questions about implementing Tokens. I want to use the ERC20 standard, which defines the following interfaces:
- balanceOf(address _owner) constant returns (uint256 balance)
- transfer(address _to, uint256 _value) returns (bool success)
Therefore i must somehow save, which address has got how many tokens. I looked around the internet and they implement it alwasy with an array definded by "mapping (address => uint256) public balanceOf". I know how to implement the transfer(..) function with this array, but i still i have two questions:
- The array balanceOf becomes bigger and bigger when more addresses own Tokens. Isn't there a risk, that the array becomes so big that i can't search users in it anymore because of the gas limit of a block?
- The array balanceOf is some kind of user registration, which i don't want. Is there a way how i can send tokens directly to a user wallet? If yes, how would it look like in solidity?

Thanks for your help,

Sign In or Register to comment.