The Solidity Contract-Oriented Programming Language - By chatting here you agree to the https://github.com/ethereum/solidity/blob/develop/CODE_OF_CONDUCT.md
Hello everybody, I am very new in Solidity and also in JavaScript. I finished the CryptoZombies tutorial (maybe you know that) and now I am just playing around a bit to display some things via Javascript.
I have the following problem: I have an array where some parameters as "name" "age" etc are stored and a mapping where it is stored which array entry belongs to which user. So there are more than one entry per address possible.
My problem now is, if I want to display it and I use a "while"-pattern, the while pattern is finished before the results from the smart contract querys are there. And also the results from the smart contract array are not always available in the order requested. so an example:
according to the mapping array entry 0, 3 and 4 belong to some specific address.
so i implemented a while pattern and requested entrys 0, 3 and 4 of the array in the contract but results got in order 3, 0, 4. From MySQL and PHP what I learned several years ago the results are always presented in the order you wanted them. Any suggestions?
"Unreachable code."
warning with solc 0.8.9 even though the code is definitely reachable. I saw : ethereum/solidity#11522yarn && yarn compile
generate quite a few Unreachable code warnigns
Hey! Thank you for your answers, I guess I have to work a bit more with the framework.
But I have another solidity question. I don't know why the following is not working:
struct LotteryEntries {
string hash;
string userId;
}
LotterieEntries[][] public Entries;
function enterTicket() public {
Entries[0].push(LotterieEntries("Hallo","1"));
}
It always reverts. Why??