Skip to content

Commit

Permalink
Replace bytes32(0) check with extcodesize in createEscrow
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenceday committed Nov 1, 2023
1 parent 016f6f2 commit 3261f45
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/WildcatSanctionsSentinel.sol
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,13 @@ contract WildcatSanctionsSentinel is IWildcatSanctionsSentinel {

escrowContract = getEscrowAddress(borrower, account, asset);

if (escrowContract.codehash != bytes32(0)) return escrowContract;
uint256 size;
assembly {
size := extcodesize(escrowContract)
}

// Skip creation if the address code size is non-zero
if (size > 0) return escrowContract;

tmpEscrowParams = TmpEscrowParams(borrower, account, asset);

Expand Down

0 comments on commit 3261f45

Please sign in to comment.