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

Issue with typecasting in assertions #67

@djrtwo

Description

@djrtwo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions