LayerXcom / verified-vyper-contracts

FVyper: A collection of useful Vyper contracts developed with formal methods
Apache License 2.0
55 stars 15 forks source link

[ERC721] Spec transferFrom don't pass #62

Open nrryuya opened 5 years ago

nrryuya commented 5 years ago

transferFrom-success-1

kprove fails (gist) because K makes a branch in which this assertion makes reverts even if the precondition assure it don't revert.

assert self._isApprovedOrOwner(_sender, _tokenId)

This is because the simplification in |Int doesn't work correctly. KEVM team suggested two workarouunds here.

transferFrom-failure-1

kprove doesn't stop. I haven't investigate it yet.

transferFrom-success-2 and transferFrom-failure-2

They cause error (gist), java.lang.AssertionError: unexpected class at matching: class org.kframework.backend.java.kil.KList in the symbolic execution of this line in _removeTokenFrom().

    # Change count tracking
    self.ownerToNFTokenCount[_from] -= 1

In transferFrom-success-1, the symbolic execution here doesn't cause error, though.