When adding treats, no matter in constructor
or addTreat
function, protocol did not check the param name.
This might make some user get confused.
When they try to execute trickOrTreat
function. They might not get what they want.
For example, there are two same-name treat in treatList : ['treat1', 'treat2', 'treat2', 'treat3']
.
But first one cost only 3 ether, and second one cost 10 ether.
A user just happen to know treat called : treat2
. So he decide to execute trickOrTreat
function
And what he/she expects is cost 3 ether in normal situation(6 ether when tricky, and 1.5 ether when treaty).
But actually the treat2 he/she calls, it's cost 10 ether.
So 5 ether in treaty situation and 20 ether in tricky situation.
Totally confused the user.
try to add test below.
Find out it might confused if same treat with different cost happened.
POC
If treatList includes same-name treat more than one.
That's say, maybe 5 more same-name treat but different cost.
It will confused user.
Manually
Consider check treatList[name]
is existed or not.
Or if same-name is acceptable, at least they should have same cost and metaURI.
The function `addTreat` is called by the owner. The owner is trusted. There will be no duplicates.
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.