@solvprotocol/upgrade-safe-transpiler
Version:
Solidity preprocessor used to generate OpenZeppelin Contracts Upgrade Safe.
19 lines • 834 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.removeInheritanceListArguments = void 0;
const utils_1 = require("solidity-ast/utils");
const ast_utils_1 = require("../solc/ast-utils");
// Removes inheritance arguments from contracts inheritance list, for example
// This: contract B is A(4) {
// Becomes this: contract B is A {
function* removeInheritanceListArguments(sourceUnit) {
for (const base of (0, utils_1.findAll)('InheritanceSpecifier', sourceUnit)) {
yield {
...(0, ast_utils_1.getNodeBounds)(base),
kind: 'remove-inheritance-arguments',
transform: source => source.replace(/\(.*\)/, ''),
};
}
}
exports.removeInheritanceListArguments = removeInheritanceListArguments;
//# sourceMappingURL=remove-inheritance-list-args.js.map