New answers tagged assembly
0
votes
What is the reason for this assembly code?
The code is incomplete but the revert is returning Reentrant() (0xed3ba6a6).
It could be some kind of reentrancy protection.
0
votes
Inline assembly loop doesn't update memory
While i was editing my question i realized:
I just need to set the offset for calldata's reading point first to 34 outside the loop, then in every loop i must add 32 to it.
outside:
let loffset:= 34
...
0
votes
reading and writing to a packed nested struct using inline assembly
The code below shows an implementation for incrementing:
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
contract CalendarGasTest {
struct ExampleNested_1 {
uint88 e0;
...
2
votes
Accepted
Is there a shortcut for "greater than or equals to" in Solidity assembly?
There is no such opcode and no assembly function. You can use iszero(lt()) for this
2
votes
Accepted
Grab first 20 bytes of 32-bytes input
You could cast the value in byte20 case i.e(bytes20(bytes32)).
Top 50 recent answers are included
Related Tags
assembly × 296solidity × 228
evm × 46
contract-development × 33
yul × 24
bytes × 19
contract-design × 17
opcode × 17
remix × 16
delegatecall × 15
contract-deployment × 14
memory × 13
calldata × 11
storage × 8
contract-invocation × 7
uniswap × 7
gas × 6
arrays × 6
solc × 6
bytecode × 6
solidity-0.8.x × 6
go-ethereum × 5
optimization × 5
returndata × 5
create2 × 5