Once a user sets their secret using set_secret
, they cannot update or overwrite it. Any further attempt results in a RESOURCE_ALREADY_EXISTS
error.
Likelihood: Medium
This issue will occur at the time after the owner is needed to set the secret.
Impact: Medium
Owner is unable to update their secrets, which can impact usability.
Put the test_owner_can_only_set_once
into the test section of secret_vault.move
.
Run the test with aptos move test -f test_owner_can_only_set_once
.
There are multiple ways to fix this issue, here are two of them:
Update the set_secret()
to allow updating the secret if it already exists. This will avoid unnecessary removal and recreation.
Explicitly remove the resource if it already exists and recreate it.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.