aragon / minime Goto Github PK
View Code? Open in Web Editor NEWMinime Token
Minime Token
The current MiniMe token contract is very underoptimized for SLOADs, especially now that SLOADs are 800 gas and not 50 gas.
We should update the implementation to make the contract more performant.
According to the analysis from ForceDAO
Hackers can get the tokens from transferFrom
, which returns false instead of revert. This part of the contract is forked from this repository.
ForceDAO contract: 0x6807d7f7df53b7739f6438eabd40ab8c262c0aa8
The documentation implies the current block, but the implementation at l359 uses block - 1
.
Not sure how we missed that one ๐ .
See https://github.com/aragon/minime/blob/master/contracts/MiniMeToken.sol#L232-L236.
Some discussion on this was held in OpenZeppelin: github.com/OpenZeppelin/openzeppelin-contracts/issues/438, and is in the ERC20 spec:
NOTE: To prevent attack vectors like the one described here and discussed here, clients SHOULD make sure to create user interfaces in such a way that they set the allowance first to 0 before setting it to another value for the same spender. THOUGH The contract itself shouldn't enforce it, to allow backwards compatilibilty with contracts deployed before
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.