$10 000 USD
DESCRIPTION OF EVENTS
"Paydays don't make sense any more. Sign up below to have instant access to your earnings through a money protocol built on Ethereum." "On Sablier, time means money, literally. As a worker, you see your earnings increasing in real-time in the Sablier wallet. As an organisation, our technology helps you get rid of the hassle of payroll admin. After a one-time deposit, our smart contracts will start "streaming" the money towards the payees, without you lifting a finger again."
"With Ethereum's native ETH token it is possible to call a smart contract function and send ETH to the contract at the same time. This is done using so-called payable functions. But because ERC20 tokens are smart contracts themselves, there is no way to directly send tokens to a smart contract while also calling one of its functions."
"Instead, the ERC20 standard allows smart contracts to transfer tokens on behalf of users - with the transferFrom() function. To do so, the user needs to allow the smart contract to transfer those tokens on their behalf."
"This way, a user can "deposit" tokens into a smart contract, and at the same time, the smart contract can update its state to reflect the deposit. In contrast, if you just send ERC20 tokens to the contract, the contract cannot update its state (e.g. to credit the deposit to your account)."
"If you want to use ERC20 tokens on DeFi protocols such as Uniswap, Aave, and Year, you need to authorize the dApp to use these tokens. This is the so-called ERC20 authorization . These authorizations are essential for the operation of the DeFi platform, but if they are not controlled, it will be very dangerous."
"However, this setup comes with significant drawbacks. As we know, bugs can exist and exploits can happen even in established projects. And by giving these platforms an unlimited allowance, you do not only expose your deposited funds to these risks, but also the tokens that you're holding "safely" in your wallet."
"Paul Berg ... found (and fixed!) a bug in his smart contracts, where not only the deposited DAI ($100) were at risk, but also all DAI in the testers' wallets ($10k)!" "This event [was] part of Osaka Blockchain Week (Devcon 5)."
"For a long time the risk of unlimited allowances was largely theoretical, and Paul's Sablier bug was fixed before the platform went into production. Back then there hadn't been any exploits that took advantage of ERC20 allowances, but it was bound to happen as platforms kept using unlimited allowances."
"In [his] speech, Paul mentioned some solutions to the problem of unlimited authorization. Each of these programs has advantages and disadvantages. One of the most practical solutions is the batch-to-use model. In this mode, the application will only ask the user to authorize the exact amount, rather than unlimited."
During an early version of the smart contract, the Sablier platform found that it was vulnerable. Users of this early platform version would have provided full access to their ethereum (ERC20) wallet, which would have exposed them to the full risk.
The issue was ultimately fixed before it was exploited and Sablier continues to operate.
HOW COULD THIS HAVE BEEN PREVENTED?
In general, one should consider smart contract security to be similar to hot wallet security. The funds are online and accessible in the event of a breach.
While there are a number of steps which can be taken to reduce the risk, such as not giving unlimited permissions, auditing the smart contract, and exercising caution and due diligence on each contract, the best security continues to be offline storage with a multi-signature arrangement where multiple known people approve large withdrawals.
Sablier (Jun 5)
Unlimited ERC20 allowances considered harmful (Jun 5)
Shaky ERC20 Allowances by Paul Razvan Berg (Devcon5) - YouTube (Jun 5)
Kickback Powered Side Events At Devcon5 (Jun 20)
Sablier Osaka Meetup (Jun 20)
What are the possible security risks of unlimited token authorization? • Blockcast.cc- News on Blockchain, DLT, Cryptocurrency (Jun 20)
Unlimited Approval In Erc20 Convenience Or Security (Oct 12)