2 votes

What is calldata offset for dynamic calldata arrays?

Let's say we have this function: contract Foo { function getOffset(uint256[] calldata arr) external pure returns (uint256 offset) { assembly { offset := arr.offset } ...
HosseinNedaee's user avatar
2 votes

Do the tight variable packing rules apply to arrays in structs?

From the docs: Except for dynamically-sized arrays and mappings (see below), data is stored contiguously item after item starting with the first state variable, which is stored in slot 0. Source: ...
user2340939's user avatar
1 vote

abi.decode() does not accept "address payable" as type

I didn't find a documented way to decode an array address payable[] implicitly, however the closest equivalent I can think of is the following: // SPDx-License-Identifier: UNLICENSED pragma solidity ^...
Mila A's user avatar
  • 1,179
1 vote
Accepted

TypeError: Type is not callable in my code

It’s because addressinvests is a mapping, so your semantic for calling the value is incorrect. Change addressinvests(_address) to addressinvests[_address] …also, your naming convention for the mapping ...
immaxkent's user avatar
  • 509

Only top scored, non community-wiki answers of a minimum length are eligible