Sword-Smith / Sword

Sword — A financial derivative language for the blockchain
MIT License
29 stars 2 forks source link

What happens if two transfer() with different conditions target same Party Token? #23

Closed sshine closed 3 years ago

Sword-Smith commented 3 years ago

We determined that this is not allowed as the derivative contracts cannot store that one payout has taken place for a certain token holder but not the other payout. Consider for example

both(
    translate(days(90), transfer('GOLEM', 1)),
    transfer('DAI', 1)))

If tokenID=1 calls pay() after one day, they would get 1 DAI per token 1 that they owned. But there would be no way of storing the fact that they already did get the payout when they called it later as they would still have their tokens of ID 1 as it would be eligible for a later payout. Thus this was determined to be illegal.