Add SB Curated (copied from the smartbugs repository).
This commit is contained in:
24
dataset/access_control/mycontract.sol
Normal file
24
dataset/access_control/mycontract.sol
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* @source: https://consensys.github.io/smart-contract-best-practices/recommendations/#avoid-using-txorigin
|
||||
* @author: Consensys Diligence
|
||||
* @vulnerable_at_lines: 20
|
||||
* Modified by Gerhard Wagner
|
||||
*/
|
||||
|
||||
pragma solidity ^0.4.24;
|
||||
|
||||
contract MyContract {
|
||||
|
||||
address owner;
|
||||
|
||||
function MyContract() public {
|
||||
owner = msg.sender;
|
||||
}
|
||||
|
||||
function sendTo(address receiver, uint amount) public {
|
||||
// <yes> <report> ACCESS_CONTROL
|
||||
require(tx.origin == owner);
|
||||
receiver.transfer(amount);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user