Skip to content

refactor: validate metadata asset_id matches map key#40

Open
respp wants to merge 1 commit intoNeko-Protocol:devfrom
respp:refactor/validate-metadata-asset-id
Open

refactor: validate metadata asset_id matches map key#40
respp wants to merge 1 commit intoNeko-Protocol:devfrom
respp:refactor/validate-metadata-asset-id

Conversation

@respp
Copy link
Contributor

@respp respp commented Jan 30, 2026

Closes #32

I implemented a data integrity mechanism to prevent the contract from storing contradictory information. By adding this validation, I ensured that the external identifier (the map key) always matches the asset's internal identifier. This closes a vulnerability where an administrator—whether by error or malice—could register data for one asset (e.g., 'Tesla') under the name of another (e.g., 'Nvidia'), which would have caused critical failures for any downstream contract or application consuming the Oracle's data.

Tests:

stellar contract build --package rwa-oracle
image

cargo build --package rwa-oracle --target wasm32-unknown-unknown --release
image

cargo test --package rwa-oracle
image

@vercel
Copy link

vercel bot commented Jan 30, 2026

@respp is attempting to deploy a commit to the fabianalejandrosanchezduran-gmailcom's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@aguilar1x aguilar1x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good implementation in the tests, just fix the conflicts to be able to merge.

LGTM!

@aguilar1x
Copy link
Contributor

Any updates?

@respp

@respp respp force-pushed the refactor/validate-metadata-asset-id branch from d1507a6 to 92b6022 Compare February 4, 2026 22:06
@respp respp force-pushed the refactor/validate-metadata-asset-id branch from 92b6022 to fe71544 Compare February 9, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[refactor] Validate Metadata asset_id Matches Map Key

2 participants

Comments