@newos/upgradeability-transpiler
Version:
Transpiles Solidity contracts to updgradable versions compatible with NewOs.
16 lines • 679 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const ast_utils_1 = require("../solc/ast-utils");
function transformContractName(contractNode, source, newName) {
const [start, , nodeSource] = ast_utils_1.getNodeSources(contractNode, source);
const subStart = nodeSource.indexOf(contractNode.name);
if (subStart === -1)
throw new Error(`Can't find ${contractNode.name} in ${nodeSource}`);
return {
start: start + subStart,
end: start + subStart + contractNode.name.length,
text: newName,
};
}
exports.transformContractName = transformContractName;
//# sourceMappingURL=transform-contract-name.js.map