Extracts a mapping (assets -> total amount) from a set of boxes passed as a parameter.
Extracts a mapping (assets -> total amount) from a set of boxes passed as a parameter. That is, the method is checking amounts of assets in the boxes(i.e. that a box contains positive amount for an asset) and then summarize and group their corresponding amounts.
- boxes to check and extract assets from
a mapping from asset id to balance and total assets number
Extract total assets access cost from in/out boxes
Extract total assets access cost from in/out boxes
Input boxes
Output boxes
access cost for a token
total assets access cost
Cost of assets preservation rules checks.
Cost of assets preservation rules checks.
We iterate through all assets to create a map (cost: (outAssetsNum + inAssetsNum) * tokenAccessCost)
)
and after that we iterate through unique asset ids to check preservation rules
(cost: (inAssets.size + outAssets.size) * tokenAccessCost
)
number of input assets in all boxes
number if unique input asset ids
number of output assets in all boxes
number if unique output asset ids
access cost for a token
total assets access cost