Skip to content

Commit ac0327d

Browse files
committed
fix: LibInitializeGuard
1 parent 824adfe commit ac0327d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

script/libraries/LibInitializeGuard.sol

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,12 @@ library LibInitializeGuard {
340340
string memory path
341341
) internal pure returns (string memory contractName) {
342342
uint256 length = bytes(path).length;
343-
// Remove ".sol"
343+
contractName = path;
344344
if (path.endsWith(".sol")) contractName = path.slice(0, length - 4);
345-
return string(contractName);
345+
string[] memory parts = contractName.split(":");
346+
if (parts.length != 0) contractName = parts[parts.length - 1];
347+
parts = contractName.split("/");
348+
if (parts.length != 0) contractName = parts[parts.length - 1];
346349
}
347350

348351
/**

0 commit comments

Comments
 (0)