The Solidity Contract-Oriented Programming Language - By chatting here you agree to the https://github.com/ethereum/solidity/blob/develop/CODE_OF_CONDUCT.md
"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??
@ccolorado: They should both be the same, at least after optimization.
The easiest way to compare is writing two different contracts, both with a single function that does what you want to do. They call each of them and compare the costs. Make sure that the optimizer is turned on, otherwise, the comparison can be meaningless. Often users incorrectly writes two functions in the same contract and compares the gas, but this is incorrect because the order in which the function appear in the function dispatch can influence this.
Maybe https://www.npmjs.com/package/hardhat-gas-reporter can be useful in testing. Otherwise, something as simple as Remix should do.
constructor
function.
/// @notice Takes in the open interest and appllies Overlay's monetary policy
/// @dev The impact is a measure of the demand placed on the market over
/// @dev a rolling window.
constructor() { owner = payable(msg.sender); }
mean in a contract?
msg.sender
can receive ether