if (externalId == bytes32(0x00)) {
bytes memory buffer = new bytes(64);
assembly {
mstore(add(buffer, 0x20), escrowId)
mstore(add(buffer, 0x40), timestamp)
}
externalId = keccak256(buffer);
}
-
Error says, builtin function timestamp must be called.– Vidhan ManglaCommented Nov 3, 2022 at 13:26
Add a comment
|
1 Answer
In inside-assembly, you have to use timestamp()
to read the block.timestamp
.
if (externalId == bytes32(0x00)) {
bytes memory buffer = new bytes(64);
assembly {
mstore(add(buffer, 0x20), escrowId)
mstore(add(buffer, 0x40), timestamp())
}
externalId = keccak256(buffer);
}