Comparing version 0.7.0 to 0.8.0-canary.20230310T203353
@@ -286,2 +286,3 @@ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } | ||
var abiParameterWithTupleRegex = /^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z0-9_]+))?$/; | ||
var dynamicIntegerRegex = /^u?int$/; | ||
function parseAbiParameter(param, options) { | ||
@@ -300,3 +301,3 @@ const parameterCacheKey = getParameterCacheKey(param, _optionalChain([options, 'optionalAccess', _3 => _3.type])); | ||
}); | ||
if (match.name && isProtectedSolidityKeyword(match.name)) | ||
if (match.name && isSolidityKeyword(match.name)) | ||
throw new BaseError("Invalid ABI parameter.", { | ||
@@ -325,2 +326,4 @@ details: param, | ||
components = { components: structs[match.type] }; | ||
} else if (dynamicIntegerRegex.test(match.type)) { | ||
type = `${match.type}256`; | ||
} else { | ||
@@ -393,3 +396,3 @@ type = match.type; | ||
var protectedKeywordsRegex = /^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/; | ||
function isProtectedSolidityKeyword(name2) { | ||
function isSolidityKeyword(name2) { | ||
return name2 === "address" || name2 === "bool" || name2 === "function" || name2 === "string" || name2 === "tuple" || _chunkO6V2CMEFjs.bytesRegex.test(name2) || _chunkO6V2CMEFjs.integerRegex.test(name2) || protectedKeywordsRegex.test(name2); | ||
@@ -396,0 +399,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "0.7.0", | ||
"version": "0.8.0-canary.20230310T203353", | ||
"repository": { | ||
@@ -61,2 +61,2 @@ "type": "git", | ||
] | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
474638
14471