Annotate Memory-Safe Assembly (#3392)

pull/3407/head
Kartik0099 3 years ago committed by GitHub
parent 3b9381dfb1
commit 3bdf4bfd29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      contracts/utils/Create2.sol
  2. 2
      contracts/utils/cryptography/ECDSA.sol
  3. 1
      contracts/utils/cryptography/MerkleProof.sol

@ -35,6 +35,7 @@ library Create2 {
address addr;
require(address(this).balance >= amount, "Create2: insufficient balance");
require(bytecode.length != 0, "Create2: bytecode length is zero");
/// @solidity memory-safe-assembly
assembly {
addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)
}

@ -64,6 +64,7 @@ library ECDSA {
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
/// @solidity memory-safe-assembly
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
@ -75,6 +76,7 @@ library ECDSA {
bytes32 vs;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
/// @solidity memory-safe-assembly
assembly {
r := mload(add(signature, 0x20))
vs := mload(add(signature, 0x40))

@ -56,6 +56,7 @@ library MerkleProof {
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, a)
mstore(0x20, b)

Loading…
Cancel
Save