Do we need to multiply amount to 100000000? #111

Open
opened 2025-12-28 18:08:33 +00:00 by sami · 6 comments
Owner

Originally created by @masterSplinter01 on GitHub (Oct 27, 2022).

https://github.com/nspcc-dev/neofs-contract/blob/master/neofs/neofs_contract.go#L313

// notify alphabet nodes
amount = amount * 100000000
tx := runtime.GetScriptContainer()

@roman-khimov @alexvanin

Originally created by @masterSplinter01 on GitHub (Oct 27, 2022). https://github.com/nspcc-dev/neofs-contract/blob/master/neofs/neofs_contract.go#L313 ``` // notify alphabet nodes amount = amount * 100000000 tx := runtime.GetScriptContainer() ``` @roman-khimov @alexvanin
Author
Owner

@roman-khimov commented on GitHub (Oct 27, 2022):

This is very confusing and also leads to inability to withdraw any fractional amount of GAS (like 0.5 GAS). At the same time that's the interface we have now and changing it can easily break something.

@roman-khimov commented on GitHub (Oct 27, 2022): This is very confusing and also leads to inability to withdraw any fractional amount of GAS (like 0.5 GAS). At the same time that's the interface we have now and changing it can easily break something.
Author
Owner

@alexvanin commented on GitHub (Oct 28, 2022):

We had some concerns in the past about having many tiny withdrawals, so it looked okay to restrict fractional amount of GAS.
But now, with those large withdrawal fees (which can be much-much lower with notary subsystem) I don't see any issues with accepting Fixed8 values in Withdraw method.

Also /cc @fyrchik @cthulhu-rider @carpawell

@alexvanin commented on GitHub (Oct 28, 2022): We had some concerns in the past about having many tiny withdrawals, so it looked okay to restrict fractional amount of GAS. But now, with those large withdrawal fees (which can be much-much lower with notary subsystem) I don't see any issues with accepting Fixed8 values in `Withdraw` method. Also /cc @fyrchik @cthulhu-rider @carpawell
Author
Owner

@cthulhu-rider commented on GitHub (Oct 28, 2022):

IMO we should process the passed argument value and leave all business logic outside. For example, notification listener can add some zeros by itself.

@cthulhu-rider commented on GitHub (Oct 28, 2022): IMO we should process the passed argument value and leave all business logic outside. For example, notification listener can add some zeros by itself.
Author
Owner

@roman-khimov commented on GitHub (Dec 30, 2022):

  1. A new method can be introduced deprecating the old one.
  2. Or this can be handled with some transition period where Withdraw will accept both. It's somewhat strange, but at the same time all old values are in the 1-9000 range and new ones are likely to start from 10_000_000, withdrawing a 0.01 (2 cents) is 100_000 already, so old and new calls can be differentiated this way.
@roman-khimov commented on GitHub (Dec 30, 2022): 1. A new method can be introduced deprecating the old one. 2. Or this can be handled with some transition period where `Withdraw` will accept both. It's somewhat strange, but at the same time all old values are in the 1-9000 range and new ones are likely to start from 10_000_000, withdrawing a 0.01 (2 cents) is 100_000 already, so old and new calls can be differentiated this way.
Author
Owner

@roman-khimov commented on GitHub (Jan 29, 2024):

A new withdrawGAS would be safer here.

@roman-khimov commented on GitHub (Jan 29, 2024): A new `withdrawGAS` would be safer here.
Author
Owner

@roman-khimov commented on GitHub (Jun 17, 2024):

Maybe this should be initiated from the FS chain. Ideally we want to deduct fees from the bridged amount to reduce scope requirements and this can't be done safely if initiated from the mainnet (consider unsuccessful attempts).

@roman-khimov commented on GitHub (Jun 17, 2024): Maybe this should be initiated from the FS chain. Ideally we want to deduct fees from the bridged amount to reduce scope requirements and this can't be done safely if initiated from the mainnet (consider unsuccessful attempts).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-contract#111
No description provided.