Skip to content

Commit

Permalink
fix: LibInitializeGuard
Browse files Browse the repository at this point in the history
  • Loading branch information
huyhuynh3103 committed Oct 10, 2024
1 parent 824adfe commit ac0327d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions script/libraries/LibInitializeGuard.sol
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,12 @@ library LibInitializeGuard {
string memory path
) internal pure returns (string memory contractName) {
uint256 length = bytes(path).length;
// Remove ".sol"
contractName = path;
if (path.endsWith(".sol")) contractName = path.slice(0, length - 4);
return string(contractName);
string[] memory parts = contractName.split(":");
if (parts.length != 0) contractName = parts[parts.length - 1];
parts = contractName.split("/");
if (parts.length != 0) contractName = parts[parts.length - 1];
}

/**
Expand Down

0 comments on commit ac0327d

Please sign in to comment.