New answers tagged

2

The ability to use the PC opcode directly in Solidity was removed in Solidity 0.7. However, you may be able to use PC again in the future via the verbatim assembly builtin. Currently, you can only use verbatim in contracts written in yul. If the Solidity team decides to expose verbatim for normal Solidity contracts, it will allow you to inject arbitrary ...


0

The EVM increases the program counter (PC) by one for all opcodes except for PUSH and its derivatives. As per the docs on Source Mappings: Each of these elements corresponds to an instruction, i.e. you cannot use the byte offset but have to use the instruction offset (push instructions are longer than a single byte). Thus when the EVM sees this: PUSH1 0 ...


3

Declaring a function as external rather than public does not affect gas usage at all, neither in contracts nor in libraries. In earlier versions of Solidity only external functions could take calldata arguments. Making a function public would force you to use the more expensive memory arguments. This restriction was lifted in Solidity 0.6.9. This is probably ...


0

First of all let's look what "public" means. Public, functions can call internally or externally. Internal calls is a basic jumps on EVM. So they takes more less gas than external calls. If you call public functions in your contract that is an internal call. In your situation you are calling your function by internally. If you change it to ...


Top 50 recent answers are included