Giter VIP home page Giter VIP logo

Comments (3)

dmuhs avatar dmuhs commented on June 1, 2024 1

Hey Marcel! I'm currently spending my time between audits to revamp the best practices. The code samples especially are in dire need of some love. 😄 You are correct about the increased gas usage, and while lots of projects solve this issue by inlining these requirements, just as many neglect the address(this) check.

There are a lot of examples around where users lost their funds.

This issue is not always given when the address(this) check is missing, e.g., when the contract allows owners to withdraw accidentally sent ETH/tokens and manually refund people. However, this introduces additional trust into the owning entity. Designing a trustless refund mechanism would be too expensive, so a simple revert informing the user of their mistake is the easiest way to go.

(edit: And sorry for the late reply! We'll give this repo more attention going forward!)

from smart-contract-best-practices.

marceljay avatar marceljay commented on June 1, 2024

Awesome. In the end I implemented the checks for our contracts (toucan.earth), I think especially address(this) has immense value :)

from smart-contract-best-practices.

dmuhs avatar dmuhs commented on June 1, 2024

Glad you found it helpful! Closing this issue.

from smart-contract-best-practices.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.