Sword-Smith / Sword

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

Confusing TransferCallID with SettlementAssetID #27

Closed Sword-Smith closed 3 years ago

Sword-Smith commented 3 years ago

When calculating the payouts to PT0, we store the intermediate accumulated value in memory. In our attempt to calculate this, we confused TransferCallID with SettlementAssetID meaning that we stored the results the wrong places in memory.

To solve this problem, we must be able to dynamically (in the runtime) map from TransferCallId to SettlementAssetID. I suggest that we make a subroutine for this. This subroutine will be our first contract-dependent subroutine!

To achieve this, we need

Sword-Smith commented 3 years ago

[] Use this new subroutine inside the loop of the payToPartyToken0 function.

Included in ef0ad7d566d0ce5da3a327a2e8d0cb7fbddd56a2.