Comments (3)
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.
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.
Glad you found it helpful! Closing this issue.
from smart-contract-best-practices.
Related Issues (20)
- Replace rate limiting example HOT 5
- Meta Issue for Gitcoining HOT 5
- dead link: securify HOT 2
- Oracle Manipulation HOT 1
- Update bounties HOT 1
- update bounties
- Ss
- Hi
- Speed bump example code is using unrecommended style
- time out. they didn't care about.
- Rate limiting example uses `transfer`.
- Broken links in `README.md`
- Event Monitoring suggests using `transfer()`
- Explain difference between `tx.origin` and `msg.sender`. HOT 1
- Constructor Naming HOT 1
- Explicitly declare state variables HOT 1
- Delete "Insecure Arithmetic" Page? HOT 1
- Update external-calls.md
- Website blocked by Telstra - Australia
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smart-contract-best-practices.