New answers tagged

1

It is not possible to assign struct with nested mappings (see v0.7.0 breaking changes). To work around this you can create an instance of your struct and then assign values to it. Try something like this: mapping(bytes4 => Question) private questions; struct Question { bytes8[] answers; mapping(bytes32 => bool) answerers; } function newQuestion(...


0

type(int256).min is -57896044618658097711785492504343953926634992332820282019728792003956564819968, while type(int256).max is 57896044618658097711785492504343953926634992332820282019728792003956564819967. If x was equal to type(int256).min, then the theoretic -x will certainly be greater than type(int256).max by 1 and it will not fit the positive number ...


1

Arguments passed to external and public functions are passed to the contract via calldata, if called from outside the contract (a transaction). They are not directly modifiable; (they are copied in memory if needed). The function visibility does not change the storage position https://docs.soliditylang.org/en/v0.8.7/introduction-to-smart-contracts.html?...


Top 50 recent answers are included