Closed ctindogaru closed 2 years ago
Hey Trevor, thanks for the feedback. I would not change any logic in this PR. If you'd like we can open a new one and address those issues :D. This PR should be strictly about removing the unsafe
keyword.
I've accidentally opened this PR against the audit branch. Will close it and open the same PR against main
.
Use
env
calls instead ofsys
to remove unsafe keyword and ensure memory safety.The issue was reported by the Halborn team while doing an audit of the sputnik smart contracts.
Original description of the issue: Rust code that uses the unsafe keyword is considered unsafe, since all of the memory safety guarantees of Rust are not enforced there. It means that the code might be prone to vulnerabilities that would’ve been prevented by the compiler, such as Buffer Overflow, Double free, Use After free, and more.