-
Notifications
You must be signed in to change notification settings - Fork 457
Handle :
characters in metadata library paths
#2043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Just thought, isn't this and other related parts are affected from this? sourcify/services/server/src/server/apiv2/middlewares.ts Lines 148 to 149 in a5261f6
|
The code in the middleware is correct because we require it to be AT LEAST 2 parts when splitting. In the verification handler we do const splitIdentifier = req.body.contractIdentifier.split(":");
const contractName = splitIdentifier[splitIdentifier.length - 1];
const contractPath = splitIdentifier.slice(0, -1).join(":"); This is the correct way to handle it. |
There is another occurrence that is also wrong: sourcify/services/server/src/server/services/storageServices/SourcifyDatabaseService.ts Line 354 in 9fbc8d7
|
I found an issue in the way the
SolidityMetadataContract
handles libraries. It is about this line:sourcify/packages/lib-sourcify/src/Validation/SolidityMetadataContract.ts
Line 300 in c6e6165
Here, we assume that the result of
split
is always a two element array. But actually the path can contain:
characters itself. I know about this because the default test contract in the server tests has a:
in the path.The text was updated successfully, but these errors were encountered: