Add SB Curated (copied from the smartbugs repository).
This commit is contained in:
29
dataset/unchecked_low_level_calls/lotto.sol
Normal file
29
dataset/unchecked_low_level_calls/lotto.sol
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* @source: https://github.com/sigp/solidity-security-blog
|
||||
* @author: Suhabe Bugrara
|
||||
* @vulnerable_at_lines: 20,27
|
||||
*/
|
||||
|
||||
pragma solidity ^0.4.18;
|
||||
|
||||
contract Lotto {
|
||||
|
||||
bool public payedOut = false;
|
||||
address public winner;
|
||||
uint public winAmount;
|
||||
|
||||
// ... extra functionality here
|
||||
|
||||
function sendToWinner() public {
|
||||
require(!payedOut);
|
||||
// <yes> <report> UNCHECKED_LL_CALLS
|
||||
winner.send(winAmount);
|
||||
payedOut = true;
|
||||
}
|
||||
|
||||
function withdrawLeftOver() public {
|
||||
require(payedOut);
|
||||
// <yes> <report> UNCHECKED_LL_CALLS
|
||||
msg.sender.send(this.balance);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user