-
Notifications
You must be signed in to change notification settings - Fork 19
SecurityToken decimals are hardcoded to 0 #20
Comments
@everhusk can you tell me security tokens are decimals based or not |
I remember it being a design decision to only have whole-numbered security tokens. The reason the decimals property exists at all is that it's part of ERC20. |
Yeah that's correct, 0 decimals for security tokens was decided to mimic how shares exist today. |
Under which circumstances would it make sense to have divisible tokens? @adamdossa says:
|
Hmm, okay let's pull this out to the application level. We'll hardcode in polymath.js. |
So... Adding yet another constructor parameter to SecurityToken and SecurityTokenRegistrar causes the "InternalCompilerError: Stack too deep, try removing local variables." error. |
There's one way to make it work, which is packing a few of the variables that share the same type into an array and passing that around. @everhusk let me know if it worth it or we should push this to V2. |
Hey @pabloruiz55 - I just tried this in the decimals_fix branch, and compilation worked fine for me... Could you let me know how your changes differ to mine? https://github.com/PolymathNetwork/polymath-core/tree/decimals-fix
|
@adamdossa, after fixing a bug (missing the _decimals declaration on the interface file), when trying to compile it gives me the same error I was getting with my version:
Also, your code is missing a few things that we need to do with the decimals variable, but I guess you didn't include that just to try this out. |
@pabloruiz55 I just fixed the decimals-fix branch and it is now compiling without a hardcoded decimals variable. |
@adamdossa great! It does compile and migrate now. Awesome. I didn't think that just moving the code to another function would fix that error even when the function is called within the first function. |
Yep - will do so shortly on this branch. |
Decimals Should be part of the constructor parameters
The text was updated successfully, but these errors were encountered: