effectai / effect-network

Smart contracts and documentation for Effect Network
MIT License
46 stars 9 forks source link

Other way of getting vaccount ID #74

Closed jabbarn closed 2 years ago

jabbarn commented 2 years ago

the current implementation of releasetask makes use of a for loop to get the vaccount id of the campaign owner. This for loop is too excessive logic wise, it should be possible to get the same result with the find method of the multi_index with the second index ("token" on vaccount).

jeisses commented 2 years ago

The problem is that it's common to have multiple vaccount entries for a single vaddress, token_contract combo (one for each token), so find is not really useful as you need to find the correct row.

You check my edits at https://github.com/effectai/effect-network/pull/75/commits/004430c05ace0e3959a78b76fd04d06b874ba6f7