Skip to content

Commit

Permalink
Merge pull request #195 from blackbeard002/bug
Browse files Browse the repository at this point in the history
 Smart Contract Issues #193
  • Loading branch information
0xneves authored Feb 9, 2024
2 parents d4fb218 + f674db1 commit fbe6bb8
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions contracts/Swaplace.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ contract Swaplace is SwapFactory, ISwaplace, IERC165 {
function createSwap(Swap calldata swap) public returns (uint256) {
if (swap.owner != msg.sender) revert InvalidAddress(msg.sender);

unchecked {
assembly {
sstore(_totalSwaps.slot, add(sload(_totalSwaps.slot), 1))
}
assembly {
sstore(_totalSwaps.slot, add(sload(_totalSwaps.slot), 1))
}

uint256 swapId = _totalSwaps;
Expand Down Expand Up @@ -66,12 +64,8 @@ contract Swaplace is SwapFactory, ISwaplace, IERC165 {
swap.owner,
assets[i].amountOrId
);
unchecked {
assembly {
i := mload(0x40)
i := add(i, 1)
mstore(0x40, i)
}
assembly {
i := add(i, 1)
}
}

Expand All @@ -83,12 +77,8 @@ contract Swaplace is SwapFactory, ISwaplace, IERC165 {
receiver,
assets[i].amountOrId
);
unchecked {
assembly {
i := mload(0x40)
i := add(i, 1)
mstore(0x40, i)
}
assembly {
i := add(i, 1)
}
}

Expand Down

0 comments on commit fbe6bb8

Please sign in to comment.