You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: According to the investInternal method, we're calling PricingStrategy.calculatePrice with first argument as amount sent by wallet in Wei and last argument as number of decimals for a token which is usually 18.
These two amounts are then multiplied again in the actual calculatePrice methods.
Fix: It seems like calculatePrice expects ether value that it can multiply by amount of decimals and divide by the price per token in Wei. Currently, it takes Wei value, multiplies it by decimals (i.e. 10^18), and divides it by price per token in Wei -- we're still left with 18 extra zeros.
If this is correct, then we need to fix the example YAML that lists price in Wei as well.
The text was updated successfully, but these errors were encountered:
Problem: According to the
investInternal
method, we're callingPricingStrategy.calculatePrice
with first argument as amount sent by wallet in Wei and last argument as number of decimals for a token which is usually 18.These two amounts are then multiplied again in the actual
calculatePrice
methods.Fix: It seems like
calculatePrice
expects ether value that it can multiply by amount of decimals and divide by the price per token in Wei. Currently, it takes Wei value, multiplies it by decimals (i.e. 10^18), and divides it by price per token in Wei -- we're still left with 18 extra zeros.If this is correct, then we need to fix the example YAML that lists price in Wei as well.
The text was updated successfully, but these errors were encountered: