Skip to content

Commit

Permalink
script: use absolute path instead of contract name
Browse files Browse the repository at this point in the history
  • Loading branch information
TuDo1403 committed Aug 26, 2024
1 parent a2e04cc commit 8f9e942
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions script/libraries/LibInitializeGuard.sol
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ library LibInitializeGuard {
string[] memory inputs = new string[](4);
inputs[0] = "forge";
inputs[1] = "inspect";
inputs[2] = _getContractName($cache._chainInfo[proxy].forkId, proxy);
inputs[2] = _getContractAbsolutePath($cache._chainInfo[proxy].forkId, proxy);
inputs[3] = "methodIdentifiers";

string memory ret = vm.toLowercase(string(vm.ffi(inputs)));
Expand All @@ -301,7 +301,7 @@ library LibInitializeGuard {
string[] memory inputs = new string[](4);
inputs[0] = "forge";
inputs[1] = "inspect";
inputs[2] = _getContractName($cache._chainInfo[proxy].forkId, proxy);
inputs[2] = _getContractAbsolutePath($cache._chainInfo[proxy].forkId, proxy);
inputs[3] = "storage";

string memory ret = string(vm.ffi(inputs));
Expand All @@ -322,12 +322,12 @@ library LibInitializeGuard {
}

/**
* @dev Get the contract name by the given `addr` and `forkId`.
* @dev Get the contract absolute path by the given `addr` and `forkId`.
*/
function _getContractName(uint256 forkId, address addr) private view returns (string memory contractName) {
function _getContractAbsolutePath(uint256 forkId, address addr) private view returns (string memory contractName) {
TNetwork networkType = vme.getNetworkTypeByForkId(forkId);
TContract contractType = vme.getContractTypeByRawData(networkType, addr);
contractName = vme.getContractName(contractType);
contractName = vme.getContractAbsolutePath(contractType);
}

/**
Expand Down

0 comments on commit 8f9e942

Please sign in to comment.