0
if (externalId == bytes32(0x00)) {
    bytes memory buffer = new bytes(64);
    assembly {
        mstore(add(buffer, 0x20), escrowId)
        mstore(add(buffer, 0x40), timestamp)
                
    }
    externalId = keccak256(buffer);
}
1
  • Error says, builtin function timestamp must be called. Commented Nov 3, 2022 at 13:26

1 Answer 1

0

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);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.