Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Issue with typecasting in assertions #67

Closed
djrtwo opened this issue Mar 29, 2018 · 1 comment
Closed

Issue with typecasting in assertions #67

djrtwo opened this issue Mar 29, 2018 · 1 comment
Labels

Comments

@djrtwo
Copy link
Contributor

djrtwo commented Mar 29, 2018

Issue

Vyper performs implicit conversion for ==, causing a few previously uncaught sources of error.

For example in deposit and logout function, assert self.current_epoch == block.number / self.epoch_length which converts self.current_epoch to decimal rather than converting block.number / self.epoch_length to an int. This line should instead be assert self.current_epoch == floor(block.number / self.epoch_length).

Proposed implementation

  • Fix assertions mentioned above
  • Comb the contract for other incorrect implicit type casting and fix
  • add any relevant tests.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant