I would like to create a contract that holds references to 20 Ethereum addresses. Each address has some associated Ethereum value. I want to send the message to this contract later and call function "payBonus" which accepts the ordered array of addresses.
1st address in array gets 60% of total sum of Ethereum, 2nd - 30%, third - 10%. All other 17 addresses get nothing.
Imagine 20 people made bets and I decide who are the winners.
I have few questions
It's really expensive to store data. Do I have to store 20 bytes (people who bet) * 20 addresses + byte_size_of_ethereum_type * 20?
Do I have to pay for 20*3 bytes while sending the message to my contract "payBonus" function?
It's not clear why the other 17 addresses need to be stored?
The scenario is: I create betting contract. 20 people take part in it and deposit money to the contract. The idea is to record which user has put money on the contract.
If the contract already has the 3 address, you don't need to pay for the 20*3 bytes when calling payBonus
Contract knows who and how much deposited funds to it. The contract doesn't know who won. Contract owner (me) should send three top winner addresses. I should send a message to a contract with three addresses and it should cost a gas since message changes state of contract and transferred over