timewave-computer / valence-services

Other
3 stars 0 forks source link

Set no limit for max_limit #6

Closed Art3miX closed 1 year ago

Art3miX commented 1 year ago

When users set max_limit, they might want to have a no limit which should be represented by 0.

But currently if you set 0, it means we will sell nothing (as the max amount allowed for us to sell will always be 0)

Art3miX commented 1 year ago

@uditvira @bekauz @NoahSaso

Thinking more about it, max_limit is percentage, so no limit for it is basically 100%, which is already done in code.

max_limit_bps is optional, so: None - 100% Some(limit) - limit must be between 1-10000

Only thing missing in code is check between 1-10000

bekauz commented 1 year ago

sounds good! maybe we can wrap this in a dedicated struct and do the range validation on that to keep contract logic free of the validations?

Art3miX commented 1 year ago

I have to_config helper which already does that.