gnolang / hackerspace

Tinker, build, explore Gno - without the monorepo!
7 stars 4 forks source link

Reentrancy #57

Open kristovatlas opened 4 months ago

kristovatlas commented 4 months ago

Reentrancy is a common source of vulnerabilities in other smart contract languages like Solidity.

Here's a Solidity example for reference: https://solidity-by-example.org/hacks/re-entrancy/

Common preventative measures in those languages are to audit code for use of the Checks-Effects-Interactions pattern, and use of libraries like OpenZeppelin's ReentrancyGuard. Code analysis tools like Slither also commonly test for reentrancy.

Given the utility in defi and other applications, it seems likely to me that Gnolang will one day support reentrancy in some form.

There's an open question as to whether reentrancy is currently achievable in Gnolang via MsgRun, which I plan to take a closer look at when time permits.

In the meantime, I wanted to create a thread on this topic and invite everyone to share their insights and ideas.