Skip to main content

One post tagged with "refinement-types"

View All Tags

Refinement Types: Making Smart Contracts Safer by Default

· 7 min read
axe
Creator of Ora

Smart contracts deal with money. That means every integer operation, every division, every transfer needs to be correct. Traditional type systems catch some bugs, but they don't catch the ones that actually matter: "is this value non-zero?", "is this amount above the minimum?", "is this rate within bounds?"

Refinement types fix that. They let you express constraints directly in the type system, and the compiler enforces them—at compile time when possible, at runtime when necessary.