input-output-hk / plutus-apps

The Plutus application platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adversary Actions in ContractModel report a validation error.

locallycompact opened this issue · comments


Hi, in this paragraph in the documentation it reads:

One way to mitigate this problem is to add additional ‘attack’ endpoints to the contract under test, that carry out a 
variety of conceivable attacks. Our contract model would then model these attack actions as no-ops, to represent the fact that 
the attacks fail; our tests would then check that the attacks fail in all circumstances, and with all parameters.

I have tried to do this noop approach with a simple NFT contract where an adversary tries to mint more than one of the same TokenName here:

This doesn't work though, since the validation failure kills the contract instance and fails the test anyway.

Log here:

Steps to reproduce the behavior

lc/adversary branch

Actual Result


Expected Result

no error

Describe the approach you would take to fix this

No response

System info


You need to catch the errors in the attacker Contract endpoint. The assumption is that crashing endpoints is bad.

Also, your properties appear to be failing because the slot numbers don't match between the model and the emulator - fixing this will help with some failures.

Closing. Reopen if the problem persists.

ezoic increase your site revenue