UNPKG

@openzeppelin/upgrade-safe-transpiler

Version:

Solidity preprocessor used to generate OpenZeppelin Contracts Upgrade Safe.

15 lines 673 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.erc7201Location = void 0; const keccak_js_1 = require("ethereum-cryptography/keccak.js"); const utils_js_1 = require("ethereum-cryptography/utils.js"); function erc7201Location(id) { const a = (0, keccak_js_1.keccak256)((0, utils_js_1.utf8ToBytes)(id)); const b = BigInt('0x' + (0, utils_js_1.bytesToHex)(a)) - 1n; const c = (0, utils_js_1.hexToBytes)(b.toString(16).padStart(64, '0')); const d = (0, keccak_js_1.keccak256)(c); d[31] = 0; return '0x' + (0, utils_js_1.bytesToHex)(d); } exports.erc7201Location = erc7201Location; //# sourceMappingURL=erc7201.js.map