Hi all! Does anyone know is there a way to make the smart contract to automatically add the erc20 token senders address to the array?
The erc20 token is received, the balance is increased, but the playersCount is not increased and the senders address is not added to the array ... What can I do?
Nov 15, 2022, 8:54 PM
theres no array
Nov 15, 2022, 8:55 PM
...senders.push(msg.sender)
No way ??? That to happen automatically when the erc20 is received?
Nov 15, 2022, 8:57 PM
instead of array of addresses...
consider a single uint256 holders public
and in your transfer() function...
holders++ if to balance starts as 0
and holder-- if from balance ends up being 0
array of addresses may not be useful...
consider a single uint256 holders public
and in your transfer() function...
holders++ if to balance starts as 0
and holder-- if from balance ends up being 0
array of addresses may not be useful...
Nov 15, 2022, 8:59 PM
If only I was a senior programmer🤣... In smart contract I don't have transfer() function, the smart contract must keep in its mind the senders addresses. Later when needed it must send all the stuff to the winner. Now what shall I write instead of senders.push(msg.sender)?
for(uint i =0; i < senders.length; i++){
senders.push(msg.sender)}
also doesn't work...
senders.push(msg.sender)}
also doesn't work...
I believe I can make you rich if give me at least a hint...😄
Really I can... I have a genius project, but I am stuck...
Nov 15, 2022, 9:27 PM
you are making reward distribution token?
Nov 15, 2022, 9:28 PM
... something like that. In its nature it is a redistributioning... A little bit complicated...
Nov 15, 2022, 9:30 PM