Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unconverted Builder #178

Open
jubnzv opened this issue Oct 15, 2024 · 0 comments
Open

Unconverted Builder #178

jubnzv opened this issue Oct 15, 2024 · 0 comments

Comments

@jubnzv
Copy link
Member

jubnzv commented Oct 15, 2024

Summary
An optional low-severity dead code detector that finds suspicious Builder objects which are not converted to Cell or Slice.

Context
The Builder object should be converted to Cell or Slice using .endCell() or standard library functions such as asCell() or asSlice(), or stored in another Builder using .storeBuilder(). If this is not done, it could indicate disruptions in the contract's logic and should be reviewed by the auditor.

Examples

fun storeValue(value: Int): Cell {
  let b = beginCell(); // Bad: Not converted to Cell
  b = b.storeInt(value, 16);
  return self.someCell; // Wrong value was returned
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant