Unnamed: 0
int64 1
24.8k
| func
stringlengths 26
42.8k
| target
int64 0
7
| project
stringlengths 9
47
|
---|---|---|---|
3,321 | contract FomoFeast {
/**
* MATH
*/
using SafeMath for uint256;
struct User {
uint256 totalInvestCount;
uint256 totalInvestAmount;
uint256 totalStaticCommissionWithdrawAmount;
uint256 totalDynamicCommissionWithdrawAmount;
uint256 totalWithdrawAmount;
uint256 downlineCount;
uint256 nodeCount;
uint256 totalDownlineInvestAmount;
uint256 currentInvestTime;
uint256 currentInvestAmount;
uint256 currentInvestCycle;
uint256 currentlevel;
uint256 currentStaticCommissionRatio;
uint256 currentStaticCommissionWithdrawAmount;
uint256 staticCommissionBalance;
uint256 dynamicCommissionBalance;
uint256 calcDynamicCommissionAmount;
address sponsorAddress;
}
struct InvestRecord {
uint256 time;
uint256 amount;
uint256 cycle;
}
struct CommissionRecord {
uint256 time;
uint256 amount;
}
/**
* DATA
*/
uint256 private constant ONE_ETH = 1 ether;
uint256 private constant ONE_DAY = 1 days;
address private constant GENESIS_USER_ADDRESS = 0xe00d13D53Ba180EAD5F4838BD56b15629026A8C9;
address private constant ENGINEER_ADDRESS = 0xddf0bB01f81059CCdB3D5bF5b1C7Bd540aDDFEac;
// INITIALIZATION DATA
bool private initialized = false;
// OWNER DATA
address public owner;
uint256 public totalInvestCount;
uint256 public totalInvestAmount;
mapping(address => uint) balances_intou18;
function transfer_intou18(address _to, uint _value) public returns (bool) {
require(balances_intou18[msg.sender] - _value >= 0); //bug
balances_intou18[msg.sender] -= _value; //bug
balances_intou18[_to] += _value; //bug
return true;
}
uint256 public totalStaticCommissionWithdrawAmount;
mapping(address => uint) public lockTime_intou29;
function increaseLockTime_intou29(uint _secondsToIncrease) public {
lockTime_intou29[msg.sender] += _secondsToIncrease; //overflow
}
function withdraw_intou29() public {
require(now > lockTime_intou29[msg.sender]);
uint transferValue_intou29 = 10;
msg.sender.transfer(transferValue_intou29);
}
uint256 public totalDynamicCommissionWithdrawAmount;
mapping(address => uint) balances_intou6;
function transfer_intou62(address _to, uint _value) public returns (bool) {
require(balances_intou6[msg.sender] - _value >= 0); //bug
balances_intou6[msg.sender] -= _value; //bug
balances_intou6[_to] += _value; //bug
return true;
}
uint256 public totalWithdrawAmount;
function bug_intou16(uint8 p_intou16) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou16; // overflow bug
}
uint256 public totalUserCount;
function bug_intou24(uint8 p_intou24) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou24; // overflow bug
}
uint256 public engineerFunds;
mapping(address => uint) public lockTime_intou5;
function increaseLockTime_intou5(uint _secondsToIncrease) public {
lockTime_intou5[msg.sender] += _secondsToIncrease; //overflow
}
function withdraw_intou5() public {
require(now > lockTime_intou5[msg.sender]);
uint transferValue_intou5 = 10;
msg.sender.transfer(transferValue_intou5);
}
uint256 public engineerWithdrawAmount;
function bug_intou15() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
}
uint256 public operatorFunds;
function bug_intou28(uint8 p_intou28) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou28; // overflow bug
}
uint256 public operatorWithdrawAmount;
mapping(address => uint) balances_intou34;
function transfer_intou34(address _to, uint _value) public returns (bool) {
require(balances_intou34[msg.sender] - _value >= 0); //bug
balances_intou34[msg.sender] -= _value; //bug
balances_intou34[_to] += _value; //bug
return true;
}
mapping (address => User) private userMapping;
mapping(address => uint) public lockTime_intou21;
function increaseLockTime_intou21(uint _secondsToIncrease) public {
lockTime_intou21[msg.sender] += _secondsToIncrease; //overflow
}
function withdraw_intou21() public {
require(now > lockTime_intou21[msg.sender]);
uint transferValue_intou21 = 10;
msg.sender.transfer(transferValue_intou21);
}
mapping (uint256 => address) private addressMapping;
mapping(address => uint) balances_intou10;
function transfer_intou10(address _to, uint _value) public returns (bool) {
require(balances_intou10[msg.sender] - _value >= 0); //bug
balances_intou10[msg.sender] -= _value; //bug
balances_intou10[_to] += _value; //bug
return true;
}
mapping (address => InvestRecord[9]) private investRecordMapping;
mapping(address => uint) balances_intou22;
function transfer_intou22(address _to, uint _value) public returns (bool) {
require(balances_intou22[msg.sender] - _value >= 0); //bug
balances_intou22[msg.sender] -= _value; //bug
balances_intou22[_to] += _value; //bug
return true;
}
mapping (address => CommissionRecord[9]) private staticCommissionRecordMapping;
function bug_intou12(uint8 p_intou12) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou12; // overflow bug
}
mapping (address => CommissionRecord[9]) private dynamicCommissionRecordMapping;
/**
* FUNCTIONALITY
*/
// INITIALIZATION FUNCTIONALITY
/**
* @dev sets 0 initials tokens, the owner, and the supplyController.
* this serves as the constructor for the proxy but compiles to the
* memory model of the Implementation contract.
*/
function initialize() public {
require(!initialized, "already initialized");
owner = msg.sender;
userMapping[GENESIS_USER_ADDRESS] = User(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, address(0));
initialized = true;
}
function bug_intou11() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
}
/**
* The constructor is used here to ensure that the implementation
* contract is initialized. An uncontrolled implementation
* contract might lead to misleading state
* for users who accidentally interact with it.
*/
constructor() public {
initialize();
}
mapping(address => uint) public lockTime_intou1;
function increaseLockTime_intou1(uint _secondsToIncrease) public {
lockTime_intou1[msg.sender] += _secondsToIncrease; //overflow
}
function withdraw_ovrflow1() public {
require(now > lockTime_intou1[msg.sender]);
uint transferValue_intou1 = 10;
msg.sender.transfer(transferValue_intou1);
}
// OWNER FUNCTIONALITY
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner, "onlyOwner");
_;
}
modifier onlyEngineer() {
require(msg.sender == ENGINEER_ADDRESS, "onlyEngineer");
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0), "cannot transfer ownership to address zero");
owner = newOwner;
}
mapping(address => uint) balances_intou2;
function transfer_undrflow2(address _to, uint _value) public returns (bool) {
require(balances_intou2[msg.sender] - _value >= 0); //bug
balances_intou2[msg.sender] -= _value; //bug
balances_intou2[_to] += _value; //bug
return true;
}
function getLevelByInvestAmount(uint256 investAmount) private pure returns (uint256 level) {
if (investAmount >= ONE_ETH.mul(11)) {
level = 3;
} else if (investAmount >= ONE_ETH.mul(6)) {
level = 2;
} else {
level = 1;
}
}
mapping(address => uint) public lockTime_intou17;
function increaseLockTime_intou17(uint _secondsToIncrease) public {
lockTime_intou17[msg.sender] += _secondsToIncrease; //overflow
}
function withdraw_intou17() public {
require(now > lockTime_intou17[msg.sender]);
uint transferValue_intou17 = 10;
msg.sender.transfer(transferValue_intou17);
}
function isInvestExpired(User memory user) private view returns (bool expired) {
expired = (user.currentInvestTime.add(user.currentInvestCycle.mul(ONE_DAY)) < now);
}
mapping(address => uint) public lockTime_intou37;
function increaseLockTime_intou37(uint _secondsToIncrease) public {
lockTime_intou37[msg.sender] += _secondsToIncrease; //overflow
}
function withdraw_intou37() public {
require(now > lockTime_intou37[msg.sender]);
uint transferValue_intou37 = 10;
msg.sender.transfer(transferValue_intou37);
}
function getAbortInvestAmount(User memory user) private view returns (uint256 amount) {
uint256 commissionDays = now.sub(user.currentInvestTime).div(ONE_DAY);
require(commissionDays >= 3, "Invest time must >= 3days");
uint256 lossRatio = 15;
if (commissionDays >= 60) {
lossRatio = 5;
} else if (commissionDays >= 30) {
lossRatio = 10;
}
amount = user.currentInvestAmount;
amount = amount.sub(user.currentInvestAmount.mul(lossRatio).div(100));
}
function bug_intou3() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
}
function getStaticCommissionRatio(uint256 level, uint256 investCycle) private pure returns (uint256 ratio) {
if (level == 1) {
if (investCycle == 30) {
ratio = 7;
} else if(investCycle == 60) {
ratio = 8;
} else {
ratio = 9;
}
} else if (level == 2) {
if (investCycle == 30) {
ratio = 8;
} else if(investCycle == 60) {
ratio = 9;
} else {
ratio = 10;
}
} else {
if (investCycle == 30) {
ratio = 11;
} else if(investCycle == 60) {
ratio = 12;
} else {
ratio = 13;
}
}
}
mapping(address => uint) public lockTime_intou9;
function increaseLockTime_intou9(uint _secondsToIncrease) public {
lockTime_intou9[msg.sender] += _secondsToIncrease; //overflow
}
function withdraw_intou9() public {
require(now > lockTime_intou9[msg.sender]);
uint transferValue_intou9 = 10;
msg.sender.transfer(transferValue_intou9);
}
function getDynamicCommissionRatio(User memory user, uint256 depth) private pure returns (uint256 ratio) {
if (user.currentlevel == 1) {
if (depth == 1) {
ratio = 50;
} else {
ratio = 0;
}
} else if (user.currentlevel == 2) {
if (depth == 1) {
ratio = 70;
} else if (depth == 2) {
ratio = 50;
} else {
ratio = 0;
}
} else {
if (depth == 1) {
ratio = 100;
} else if (depth == 2) {
ratio = 70;
} else if (depth == 3) {
ratio = 50;
} else if (depth >= 4 && depth <= 10) {
ratio = 10;
} else if (depth >= 11 && depth <= 20) {
ratio = 5;
} else {
ratio = 1;
}
}
}
mapping(address => uint) public lockTime_intou25;
function increaseLockTime_intou25(uint _secondsToIncrease) public {
lockTime_intou25[msg.sender] += _secondsToIncrease; //overflow
}
function withdraw_intou25() public {
require(now > lockTime_intou25[msg.sender]);
uint transferValue_intou25 = 10;
msg.sender.transfer(transferValue_intou25);
}
function getAvaliableStaticCommissionAmount(User memory user) private view returns (uint256 amount) {
if (user.currentInvestAmount == 0) {
amount = 0;
} else {
uint256 commissionDays = now.sub(user.currentInvestTime).div(ONE_DAY);
if (commissionDays > user.currentInvestCycle) {
commissionDays = user.currentInvestCycle;
}
amount = user.currentInvestAmount.mul(user.currentStaticCommissionRatio).mul(commissionDays);
amount = amount.div(1000);
amount = amount.sub(user.currentStaticCommissionWithdrawAmount);
}
}
function bug_intou19() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
}
function addInvestRecord(address userAddress, uint256 time, uint256 amount, uint256 cycle) private {
InvestRecord[9] storage records = investRecordMapping[userAddress];
for (uint256 i = 8; i > 0; --i) {
InvestRecord memory prevRecord = records[i - 1];
records[i] = prevRecord;
}
records[0] = InvestRecord(time, amount, cycle);
}
mapping(address => uint) balances_intou26;
function transfer_intou26(address _to, uint _value) public returns (bool) {
require(balances_intou26[msg.sender] - _value >= 0); //bug
balances_intou26[msg.sender] -= _value; //bug
balances_intou26[_to] += _value; //bug
return true;
}
function addStaticCommissionRecord(address userAddress, uint256 time, uint256 amount) private {
CommissionRecord[9] storage records = staticCommissionRecordMapping[userAddress];
for (uint256 i = 8; i > 0; --i) {
CommissionRecord memory prevRecord = records[i - 1];
records[i] = prevRecord;
}
records[0] = CommissionRecord(time, amount);
}
function bug_intou20(uint8 p_intou20) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou20; // overflow bug
}
function addDynamicCommissionRecord(address userAddress, uint256 time, uint256 amount) private {
CommissionRecord[9] storage records = dynamicCommissionRecordMapping[userAddress];
for (uint256 i = 8; i > 0; --i) {
CommissionRecord memory prevRecord = records[i - 1];
records[i] = prevRecord;
}
records[0] = CommissionRecord(time, amount);
}
function bug_intou32(uint8 p_intou32) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou32; // overflow bug
}
function invest(address sponsorAddress, uint256 investCycle) external payable {
User storage sponsor = userMapping[sponsorAddress];
require(sponsor.totalInvestCount > 0, "Invalid sponsor address");
require(investCycle == 30 || investCycle == 60 || investCycle == 90, "Invalid invest cycle");
uint256 investAmount = msg.value.div(ONE_ETH);
investAmount = investAmount.mul(ONE_ETH);
require(investAmount == msg.value, "Invest amount is not integer");
require(investAmount >= ONE_ETH.mul(1) && investAmount <= ONE_ETH.mul(15), "Invalid invest amount");
User memory user = userMapping[msg.sender];
uint256 level = getLevelByInvestAmount(investAmount);
if (user.totalInvestCount > 0) {
require(user.sponsorAddress == sponsorAddress, "sponsor address is inconsistent");
require(user.currentInvestAmount == 0, "Dumplicate invest");
require(user.currentInvestTime == 0, "Invalid state");
require(user.currentInvestCycle == 0, "Invalid state");
require(user.currentlevel == 0, "Invalid state");
require(user.currentStaticCommissionRatio == 0, "Invalid state");
require(user.currentStaticCommissionWithdrawAmount == 0, "Invalid state");
user.totalInvestCount = user.totalInvestCount.add(1);
user.totalInvestAmount = user.totalInvestAmount.add(investAmount);
user.currentInvestTime = now;
user.currentInvestAmount = investAmount;
user.currentInvestCycle = investCycle;
user.currentlevel = level;
user.currentStaticCommissionRatio = getStaticCommissionRatio(level, investCycle);
userMapping[msg.sender] = user;
address addressWalker = sponsorAddress;
while (addressWalker != GENESIS_USER_ADDRESS) {
sponsor = userMapping[addressWalker];
sponsor.totalDownlineInvestAmount = sponsor.totalDownlineInvestAmount.add(investAmount);
addressWalker = sponsor.sponsorAddress;
}
} else {
userMapping[msg.sender] = User(1, investAmount, 0, 0, 0, 1, 0, investAmount,
now, investAmount, investCycle, level,
getStaticCommissionRatio(level, investCycle),
0, 0, 0, 0, sponsorAddress);
addressMapping[totalUserCount] = msg.sender;
totalUserCount = totalUserCount.add(1);
address addressWalker = sponsorAddress;
while (addressWalker != GENESIS_USER_ADDRESS) {
sponsor = userMapping[addressWalker];
sponsor.downlineCount = sponsor.downlineCount.add(1);
if (addressWalker == sponsorAddress) {
sponsor.nodeCount = sponsor.nodeCount.add(1);
}
sponsor.totalDownlineInvestAmount = sponsor.totalDownlineInvestAmount.add(investAmount);
addressWalker = sponsor.sponsorAddress;
}
}
addInvestRecord(msg.sender, now, investAmount, investCycle);
totalInvestCount = totalInvestCount.add(1);
totalInvestAmount = totalInvestAmount.add(investAmount);
engineerFunds = engineerFunds.add(investAmount.div(50));
operatorFunds = operatorFunds.add(investAmount.mul(3).div(100));
}
mapping(address => uint) balances_intou38;
function transfer_intou38(address _to, uint _value) public returns (bool) {
require(balances_intou38[msg.sender] - _value >= 0); //bug
balances_intou38[msg.sender] -= _value; //bug
balances_intou38[_to] += _value; //bug
return true;
}
function userWithdraw() external {
User storage user = userMapping[msg.sender];
if (user.currentInvestAmount > 0) {
uint256 avaliableIA = user.currentInvestAmount;
if (!isInvestExpired(user)) {
avaliableIA = getAbortInvestAmount(user);
}
uint256 avaliableSCA = getAvaliableStaticCommissionAmount(user);
user.staticCommissionBalance = user.staticCommissionBalance.add(avaliableSCA);
user.currentInvestTime = 0;
user.currentInvestAmount = 0;
user.currentInvestCycle = 0;
user.currentlevel = 0;
user.currentStaticCommissionRatio = 0;
user.currentStaticCommissionWithdrawAmount = 0;
user.totalWithdrawAmount = user.totalWithdrawAmount.add(avaliableIA);
totalWithdrawAmount = totalWithdrawAmount.add(avaliableIA);
msg.sender.transfer(avaliableIA);
}
}
function bug_intou4(uint8 p_intou4) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou4; // overflow bug
}
function userWithdrawCommission() external {
User storage user = userMapping[msg.sender];
uint256 avaliableDCB = user.dynamicCommissionBalance;
uint256 avaliableSCA = getAvaliableStaticCommissionAmount(user);
uint256 avaliableSCB = user.staticCommissionBalance.add(avaliableSCA);
uint256 avaliableWithdrawAmount = avaliableDCB.add(avaliableSCB);
if (avaliableWithdrawAmount >= ONE_ETH.div(10)) {
user.staticCommissionBalance = 0;
user.dynamicCommissionBalance = 0;
user.currentStaticCommissionWithdrawAmount = user.currentStaticCommissionWithdrawAmount.add(avaliableSCA);
user.totalStaticCommissionWithdrawAmount = user.totalStaticCommissionWithdrawAmount.add(avaliableSCB);
user.totalDynamicCommissionWithdrawAmount = user.totalDynamicCommissionWithdrawAmount.add(avaliableDCB);
user.totalWithdrawAmount = user.totalWithdrawAmount.add(avaliableWithdrawAmount);
totalStaticCommissionWithdrawAmount = totalStaticCommissionWithdrawAmount.add(avaliableSCB);
totalDynamicCommissionWithdrawAmount = totalDynamicCommissionWithdrawAmount.add(avaliableDCB);
totalWithdrawAmount = totalWithdrawAmount.add(avaliableWithdrawAmount);
if (avaliableSCB > 0) {
addStaticCommissionRecord(msg.sender, now, avaliableSCB);
}
msg.sender.transfer(avaliableWithdrawAmount);
}
}
function bug_intou7() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
}
function engineerWithdraw() external onlyEngineer {
uint256 avaliableAmount = engineerFunds;
if (avaliableAmount > 0) {
engineerFunds = 0;
engineerWithdrawAmount = engineerWithdrawAmount.add(avaliableAmount);
msg.sender.transfer(avaliableAmount);
}
}
function bug_intou23() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
}
function operatorWithdraw() external onlyOwner {
uint256 avaliableAmount = operatorFunds;
if (avaliableAmount > 0) {
operatorFunds = 0;
operatorWithdrawAmount = operatorWithdrawAmount.add(avaliableAmount);
msg.sender.transfer(avaliableAmount);
}
}
mapping(address => uint) balances_intou14;
function transfer_intou14(address _to, uint _value) public returns (bool) {
require(balances_intou14[msg.sender] - _value >= 0); //bug
balances_intou14[msg.sender] -= _value; //bug
balances_intou14[_to] += _value; //bug
return true;
}
function getSummary() public view returns (uint256[11] memory) {
return ([address(this).balance, totalInvestCount, totalInvestAmount,
totalStaticCommissionWithdrawAmount,
totalDynamicCommissionWithdrawAmount,
totalWithdrawAmount,
totalUserCount,
engineerFunds, engineerWithdrawAmount,
operatorFunds, operatorWithdrawAmount]);
}
mapping(address => uint) balances_intou30;
function transfer_intou30(address _to, uint _value) public returns (bool) {
require(balances_intou30[msg.sender] - _value >= 0); //bug
balances_intou30[msg.sender] -= _value; //bug
balances_intou30[_to] += _value; //bug
return true;
}
function getUserByAddress(address userAddress) public view returns(uint256[16] memory,
address) {
User memory user = userMapping[userAddress];
return ([user.totalInvestCount, user.totalInvestAmount,
user.totalStaticCommissionWithdrawAmount,
user.totalDynamicCommissionWithdrawAmount,
user.totalWithdrawAmount,
user.downlineCount, user.nodeCount,
user.totalDownlineInvestAmount,
user.currentInvestTime, user.currentInvestAmount,
user.currentInvestCycle, user.currentlevel,
user.currentStaticCommissionRatio,
user.staticCommissionBalance.add(getAvaliableStaticCommissionAmount(user)),
user.dynamicCommissionBalance,
user.calcDynamicCommissionAmount],
user.sponsorAddress);
}
function bug_intou8(uint8 p_intou8) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou8; // overflow bug
}
function getUserByIndex(uint256 index) external view onlyOwner returns(uint256[16] memory,
address) {
return getUserByAddress(addressMapping[index]);
}
function bug_intou39() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
}
function getInvestRecords(address userAddress) external view returns(uint256[3] memory,
uint256[3] memory,
uint256[3] memory,
uint256[3] memory,
uint256[3] memory,
uint256[3] memory,
uint256[3] memory,
uint256[3] memory,
uint256[3] memory) {
InvestRecord[9] memory records = investRecordMapping[userAddress];
return ([records[0].time, records[0].amount, records[0].cycle],
[records[1].time, records[1].amount, records[1].cycle],
[records[2].time, records[2].amount, records[2].cycle],
[records[3].time, records[3].amount, records[3].cycle],
[records[4].time, records[4].amount, records[4].cycle],
[records[5].time, records[5].amount, records[5].cycle],
[records[6].time, records[6].amount, records[6].cycle],
[records[7].time, records[7].amount, records[7].cycle],
[records[8].time, records[8].amount, records[8].cycle]);
}
function bug_intou36(uint8 p_intou36) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou36; // overflow bug
}
function getStaticCommissionRecords(address userAddress) external view returns(uint256[2] memory,
uint256[2] memory,
uint256[2] memory,
uint256[2] memory,
uint256[2] memory,
uint256[2] memory,
uint256[2] memory,
uint256[2] memory,
uint256[2] memory) {
CommissionRecord[9] memory records = staticCommissionRecordMapping[userAddress];
return ([records[0].time, records[0].amount],
[records[1].time, records[1].amount],
[records[2].time, records[2].amount],
[records[3].time, records[3].amount],
[records[4].time, records[4].amount],
[records[5].time, records[5].amount],
[records[6].time, records[6].amount],
[records[7].time, records[7].amount],
[records[8].time, records[8].amount]);
}
function bug_intou35() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
}
function getDynamicCommissionRecords(address userAddress) external view returns(uint256[2] memory,
uint256[2] memory,
uint256[2] memory,
uint256[2] memory,
uint256[2] memory,
uint256[2] memory,
uint256[2] memory,
uint256[2] memory,
uint256[2] memory) {
CommissionRecord[9] memory records = dynamicCommissionRecordMapping[userAddress];
return ([records[0].time, records[0].amount],
[records[1].time, records[1].amount],
[records[2].time, records[2].amount],
[records[3].time, records[3].amount],
[records[4].time, records[4].amount],
[records[5].time, records[5].amount],
[records[6].time, records[6].amount],
[records[7].time, records[7].amount],
[records[8].time, records[8].amount]);
}
function bug_intou40(uint8 p_intou40) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou40; // overflow bug
}
function calcDynamicCommission() external onlyOwner {
for (uint256 i = 0; i < totalUserCount; ++i) {
User storage user = userMapping[addressMapping[i]];
user.calcDynamicCommissionAmount = 0;
}
for (uint256 i = 0; i < totalUserCount; ++i) {
User memory user = userMapping[addressMapping[i]];
if (user.currentInvestAmount > 0) {
uint256 commissionDays = now.sub(user.currentInvestTime).div(ONE_DAY);
if (commissionDays >= 1 && commissionDays <= user.currentInvestCycle) {
uint256 depth = 1;
address addressWalker = user.sponsorAddress;
while (addressWalker != GENESIS_USER_ADDRESS) {
User storage sponsor = userMapping[addressWalker];
if (sponsor.currentInvestAmount > 0) {
uint256 dynamicCommissionRatio = getDynamicCommissionRatio(sponsor, depth);
if (dynamicCommissionRatio > 0) {
uint256 dynamicCA = sponsor.currentInvestAmount;
if (dynamicCA > user.currentInvestAmount) {
dynamicCA = user.currentInvestAmount;
}
dynamicCA = dynamicCA.mul(user.currentStaticCommissionRatio);
dynamicCA = dynamicCA.mul(dynamicCommissionRatio);
if (sponsor.currentlevel == 1) {
dynamicCA = dynamicCA.mul(3).div(1000 * 100 * 10);
} else if (sponsor.currentlevel == 2) {
dynamicCA = dynamicCA.mul(6).div(1000 * 100 * 10);
} else {
dynamicCA = dynamicCA.div(1000 * 100);
}
sponsor.calcDynamicCommissionAmount = sponsor.calcDynamicCommissionAmount.add(dynamicCA);
}
}
addressWalker = sponsor.sponsorAddress;
depth = depth.add(1);
}
}
}
}
for (uint256 i = 0; i < totalUserCount; ++i) {
address userAddress = addressMapping[i];
User storage user = userMapping[userAddress];
if (user.calcDynamicCommissionAmount > 0) {
user.dynamicCommissionBalance = user.dynamicCommissionBalance.add(user.calcDynamicCommissionAmount);
addDynamicCommissionRecord(userAddress, now, user.calcDynamicCommissionAmount);
}
}
}
mapping(address => uint) public lockTime_intou33;
function increaseLockTime_intou33(uint _secondsToIncrease) public {
lockTime_intou33[msg.sender] += _secondsToIncrease; //overflow
}
function withdraw_intou33() public {
require(now > lockTime_intou33[msg.sender]);
uint transferValue_intou33 = 10;
msg.sender.transfer(transferValue_intou33);
}
function calcDynamicCommissionBegin(uint256 index, uint256 length) external onlyOwner {
for (uint256 i = index; i < (index + length); ++i) {
User storage user = userMapping[addressMapping[i]];
user.calcDynamicCommissionAmount = 0;
}
}
function bug_intou27() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
}
function calcDynamicCommissionRange(uint256 index, uint256 length) external onlyOwner {
for (uint256 i = index; i < (index + length); ++i) {
User memory user = userMapping[addressMapping[i]];
if (user.currentInvestAmount > 0) {
uint256 commissionDays = now.sub(user.currentInvestTime).div(ONE_DAY);
if (commissionDays >= 1 && commissionDays <= user.currentInvestCycle) {
uint256 depth = 1;
address addressWalker = user.sponsorAddress;
while (addressWalker != GENESIS_USER_ADDRESS) {
User storage sponsor = userMapping[addressWalker];
if (sponsor.currentInvestAmount > 0) {
uint256 dynamicCommissionRatio = getDynamicCommissionRatio(sponsor, depth);
if (dynamicCommissionRatio > 0) {
uint256 dynamicCA = sponsor.currentInvestAmount;
if (dynamicCA > user.currentInvestAmount) {
dynamicCA = user.currentInvestAmount;
}
dynamicCA = dynamicCA.mul(user.currentStaticCommissionRatio);
dynamicCA = dynamicCA.mul(dynamicCommissionRatio);
if (sponsor.currentlevel == 1) {
dynamicCA = dynamicCA.mul(3).div(1000 * 100 * 10);
} else if (sponsor.currentlevel == 2) {
dynamicCA = dynamicCA.mul(6).div(1000 * 100 * 10);
} else {
dynamicCA = dynamicCA.div(1000 * 100);
}
sponsor.calcDynamicCommissionAmount = sponsor.calcDynamicCommissionAmount.add(dynamicCA);
}
}
addressWalker = sponsor.sponsorAddress;
depth = depth.add(1);
}
}
}
}
}
function bug_intou31() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
}
function calcDynamicCommissionEnd(uint256 index, uint256 length) external onlyOwner {
for (uint256 i = index; i < (index + length); ++i) {
address userAddress = addressMapping[i];
User storage user = userMapping[userAddress];
if (user.calcDynamicCommissionAmount > 0) {
user.dynamicCommissionBalance = user.dynamicCommissionBalance.add(user.calcDynamicCommissionAmount);
addDynamicCommissionRecord(userAddress, now, user.calcDynamicCommissionAmount);
}
}
}
mapping(address => uint) public lockTime_intou13;
function increaseLockTime_intou13(uint _secondsToIncrease) public {
lockTime_intou13[msg.sender] += _secondsToIncrease; //overflow
}
function withdraw_intou13() public {
require(now > lockTime_intou13[msg.sender]);
uint transferValue_intou13 = 10;
msg.sender.transfer(transferValue_intou13);
}
} | 2 | buggy_24.sol |
7,980 | function master() public view returns (address)
{
return _master;
} | 0 | buggy_6.sol |
18,582 | function play_tmstmp23(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp23 = msg.sender;}} | 6 | buggy_3.sol |
7,419 | function operatorSend(
address sender,
address recipient,
uint256 amount,
bytes calldata data,
bytes calldata operatorData
)
external
{
require(isOperatorFor(msg.sender, sender), "ERC777: caller is not an operator for holder");
_send(msg.sender, sender, recipient, amount, data, operatorData, true);
} | 0 | buggy_30.sol |
5,907 | function totalSupply() public view returns (uint) { //constant -> view : compiler version up
return _totalSupply.sub(balances[address(0)]);
} | 0 | buggy_48.sol |
14,203 | function setReward_TOD20() public payable {
require (!claimed_TOD20);
require(msg.sender == owner_TOD20);
owner_TOD20.transfer(reward_TOD20);
reward_TOD20 = msg.value;
} | 4 | buggy_17.sol |
22,194 | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
} | 0 | buggy_23.sol |
17,663 | function buyTicket_re_ent30() public{
if (!(lastPlayer_re_ent30.send(jackpot_re_ent30)))
revert();
lastPlayer_re_ent30 = msg.sender;
jackpot_re_ent30 = address(this).balance;
} | 5 | buggy_17.sol |
15,699 | function claimReward_re_ent4() public {
// ensure there is a reward to give
require(redeemableEther_re_ent4[msg.sender] > 0);
uint transferValue_re_ent4 = redeemableEther_re_ent4[msg.sender];
msg.sender.transfer(transferValue_re_ent4); //bug
redeemableEther_re_ent4[msg.sender] = 0;
} | 5 | buggy_6.sol |
8,972 | function isActiveOperator(address caller) public view returns (bool ok) {
return (isOperator(caller) && hasActiveOperator());
} | 0 | buggy_44.sol |
23,031 | function balanceOf(address who) external view returns (uint256); | 0 | buggy_4.sol |
22,790 | function _burn(address account, uint256 value) internal {
require(account != address(0), "ERC20: burn from the zero address");
_totalSupply = _totalSupply.sub(value);
_balances[account].amount = _balances[account].amount.sub(value);
emit Transfer(account, address(0), value);
} | 0 | buggy_34.sol |
7,868 | function bug_unchk19() public{
address payable addr_unchk19;
if (!addr_unchk19.send (10 ether) || 1==1)
{revert();}
} | 3 | buggy_27.sol |
19,526 | function () external payable {
revert("this pool cannot receive ether");
} | 0 | buggy_20.sol |
21,813 | function allowance(address owner, address spender) external view returns (uint256); | 0 | buggy_26.sol |
16,441 | function buyTicket_re_ent9() public{
(bool success,) = lastPlayer_re_ent9.call.value(jackpot_re_ent9)("");
if (!success)
revert();
lastPlayer_re_ent9 = msg.sender;
jackpot_re_ent9 = address(this).balance;
} | 5 | buggy_35.sol |
17,057 | function withdrawFunds_re_ent17 (uint256 _weiToWithdraw) public {
require(balances_re_ent17[msg.sender] >= _weiToWithdraw);
// limit the withdrawal
(bool success,)=msg.sender.call.value(_weiToWithdraw)("");
require(success); //bug
balances_re_ent17[msg.sender] -= _weiToWithdraw;
} | 5 | buggy_42.sol |
19,397 | function play_tmstmp35(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp35 = msg.sender;}} | 6 | buggy_5.sol |
21,602 | function symbol() external view returns (string memory); | 0 | buggy_30.sol |
14,082 | function transferOwnership(address payable newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
} | 0 | buggy_16.sol |
23,503 | function approve(address spender, uint256 amount) external returns (bool); | 0 | buggy_40.sol |
14,759 | function caclTeamPerformance() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
} | 0 | buggy_19.sol |
21,878 | function bug_unchk_send1() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_32.sol |
5,450 | function getFactory() public view returns (address factory) {
factory = _factory;
} | 0 | buggy_44.sol |
22,604 | function bug_unchk_send29() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_7.sol |
3,554 | function allowance(address holder, address spender) public view returns (uint256) {
return _allowances[holder][spender];
} | 0 | buggy_30.sol |
20,387 | function transferBatch(address[] memory _tos, uint256[] memory _values) public returns (bool) {
require(_tos.length == _values.length);
for (uint256 i = 0; i < _tos.length; i++) {
transfer(_tos[i], _values[i]);
}
return true;
} | 0 | buggy_9.sol |
347 | function withdrawAll_txorigin26(address payable _recipient,address owner_txorigin26) public {
require(tx.origin == owner_txorigin26);
_recipient.transfer(address(this).balance);
} | 1 | buggy_30.sol |
10,434 | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
} | 0 | buggy_30.sol |
23,370 | function bug_unchk_send9() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_44.sol |
19,708 | function play_tmstmp27(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp27 = msg.sender;}} | 6 | buggy_4.sol |
19,786 | function bug_tmstmp25() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_47.sol |
11,097 | function play_TOD13(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD13 = msg.sender;
}
} | 4 | buggy_32.sol |
14,913 | function getUserByIndex(uint256 index) external view onlyOwner returns(uint256[16] memory,
address) {
return getUserByAddress(addressMapping[index]);
} | 0 | buggy_24.sol |
22,736 | function bug_unchk_send21() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_34.sol |
10,456 | function totalSupply() external view returns (uint256); | 0 | buggy_30.sol |
19,158 | function bug_tmstmp25() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_36.sol |
11,255 | function play_TOD21(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD21 = msg.sender;
}
} | 4 | buggy_27.sol |
23,391 | function confirmOwner()
public
{
if(msg.sender==newOwner)
{
owner=newOwner;
}
} | 0 | 0x8fd1e427396ddb511533cf9abdbebd0a7e08da35.sol |
13,704 | function acceptOwnership() public {
require(msg.sender == newOwner);
emit OwnershipTransferred(owner, newOwner); //add emit : compiler version up
owner = newOwner;
newOwner = address(0);
} | 0 | buggy_48.sol |
7,847 | function cash_unchk34(uint roundIndex, uint subpotIndex, address payable winner_unchk34) public{
uint64 subpot_unchk34 = 10 ether;
winner_unchk34.send(subpot_unchk34); //bug
subpot_unchk34= 0;
} | 3 | buggy_27.sol |
9,902 | function withdrawBal_unchk17 () public{
uint64 Balances_unchk17 = 0;
msg.sender.send(Balances_unchk17);} | 3 | buggy_28.sol |
8,224 | function bug_unchk42() public{
uint receivers_unchk42;
address payable addr_unchk42;
if (!addr_unchk42.send(42 ether))
{receivers_unchk42 +=1;}
else
{revert();}
} | 3 | buggy_36.sol |
1,381 | function withdrawAll_txorigin14(address payable _recipient,address owner_txorigin14) public {
require(tx.origin == owner_txorigin14);
_recipient.transfer(address(this).balance);
} | 1 | buggy_7.sol |
5,646 | function withdraw_intou25() public {
require(now > lockTime_intou25[msg.sender]);
uint transferValue_intou25 = 10;
msg.sender.transfer(transferValue_intou25);
} | 2 | buggy_43.sol |
17,223 | function approve(address spender, uint tokens) public returns (bool success); | 0 | buggy_48.sol |
14,778 | function withdraw_balances_re_ent8 () public {
(bool success,) = msg.sender.call.value(balances_re_ent8[msg.sender ])("");
if (success)
balances_re_ent8[msg.sender] = 0;
} | 5 | buggy_31.sol |
7,362 | function bug_unchk39(address payable addr) public
{addr.send (4 ether); } | 3 | buggy_30.sol |
4,905 | function bug_intou31() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
} | 2 | buggy_20.sol |
6,020 | function run(uint256 input) {
if (initialized == 0) {
return;
}
// <yes> <report> ARITHMETIC
count -= input;
} | 2 | integer_overflow_multitx_multifunc_feasible.sol |
20,799 | function bug_tmstmp5() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_16.sol |
1,426 | function withdrawAll_txorigin26(address payable _recipient,address owner_txorigin26) public {
require(tx.origin == owner_txorigin26);
_recipient.transfer(address(this).balance);
} | 1 | buggy_34.sol |
13,874 | function setReward_TOD36() public payable {
require (!claimed_TOD36);
require(msg.sender == owner_TOD36);
owner_TOD36.transfer(reward_TOD36);
reward_TOD36 = msg.value;
} | 4 | buggy_38.sol |
18,513 | function play_tmstmp7(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp7 = msg.sender;}} | 6 | buggy_18.sol |
20,037 | function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
} | 0 | buggy_40.sol |
14,857 | function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
} | 0 | buggy_24.sol |
13,075 | function play_TOD31(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD31 = msg.sender;
}
} | 4 | buggy_44.sol |
3,547 | function defaultOperators() public view returns (address[] memory) {
return _defaultOperatorsArray;
} | 0 | buggy_30.sol |
15,732 | function _transferMasterRole(address newMaster) internal
{
require(newMaster != address(0));
emit MasterRoleTransferred(_master, newMaster);
_master = newMaster;
} | 0 | buggy_6.sol |
19,856 | function bug_tmstmp33() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_45.sol |
20,784 | function bug_tmstmp9() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_16.sol |
15,741 | function bug_re_ent13() public{
require(not_called_re_ent13);
(bool success,)=msg.sender.call.value(1 ether)("");
if( ! success ){
revert();
}
not_called_re_ent13 = false;
} | 5 | buggy_6.sol |
8,606 | function sub(uint256 a, uint256 b) internal pure returns (uint256)
{
assert(b <= a);
return a - b;
} | 0 | buggy_21.sol |
9,741 | function cash_unchk46(uint roundIndex, uint subpotIndex, address payable winner_unchk46) public{
uint64 subpot_unchk46 = 3 ether;
winner_unchk46.send(subpot_unchk46); //bug
subpot_unchk46= 0;
} | 3 | buggy_17.sol |
17,273 | function callme_re_ent7() public{
require(counter_re_ent7<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent7 += 1;
} | 5 | buggy_48.sol |
678 | function sendto_txorigin9(address payable receiver, uint amount,address owner_txorigin9) public {
require (tx.origin == owner_txorigin9);
receiver.transfer(amount);
} | 1 | buggy_32.sol |
13,554 | function play_TOD7(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD7 = msg.sender;
}
} | 4 | buggy_42.sol |
7,438 | function withdrawBal_unchk17 () public{
uint64 Balances_unchk17 = 0;
msg.sender.send(Balances_unchk17);} | 3 | buggy_30.sol |
14,091 | function play_TOD1(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD1 = msg.sender;
}
} | 4 | buggy_16.sol |
1,826 | function sendto_txorigin33(address payable receiver, uint amount,address owner_txorigin33) public {
require (tx.origin == owner_txorigin33);
receiver.transfer(amount);
} | 1 | buggy_47.sol |
5,072 | function withdraw_intou21() public {
require(now > lockTime_intou21[msg.sender]);
uint transferValue_intou21 = 10;
msg.sender.transfer(transferValue_intou21);
} | 2 | buggy_35.sol |
1,256 | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "Safe mul error");
return c;
} | 0 | buggy_22.sol |
3,145 | function caclTeamPerformance() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
} | 0 | buggy_19.sol |
7,029 | contract ethBank is owned{
function () payable external {}
function bug_unchk3(address payable addr) public
{addr.send (42 ether); }
function withdrawForUser(address payable _address,uint amount) onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
_address.transfer(amount);
}
bool public payedOut_unchk9 = false;
function withdrawLeftOver_unchk9() public {
require(payedOut_unchk9);
msg.sender.send(address(this).balance);
}
function moveBrick(uint amount) onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(amount);
}
function callnotchecked_unchk25(address payable callee) public {
callee.call.value(1 ether);
}
/**
* @dev withdraws Contracts balance.
* -functionhash- 0x7ee20df8
*/
function moveBrickContracts() onlyOwner public
{
// only team just can withdraw Contracts
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
}
function bug_unchk19() public{
address payable addr_unchk19;
if (!addr_unchk19.send (10 ether) || 1==1)
{revert();}
}
// either settled or refunded. All funds are transferred to contract owner.
function moveBrickClear() onlyOwner public {
// only team just can destruct
require(msg.sender == owner, "only owner can use this method");
selfdestruct(msg.sender);
}
function unhandledsend_unchk26(address payable callee) public {
callee.send(5 ether);
}
////////////////////////////////////////////////////////////////////
function joinFlexible() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
}
bool public payedOut_unchk20 = false;
address payable public winner_unchk20;
uint public winAmount_unchk20;
function sendToWinner_unchk20() public {
require(!payedOut_unchk20);
winner_unchk20.send(winAmount_unchk20);
payedOut_unchk20 = true;
}
function joinFixed() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
}
bool public payedOut_unchk32 = false;
address payable public winner_unchk32;
uint public winAmount_unchk32;
function sendToWinner_unchk32() public {
require(!payedOut_unchk32);
winner_unchk32.send(winAmount_unchk32);
payedOut_unchk32 = true;
}
function staticBonus() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
}
function unhandledsend_unchk38(address payable callee) public {
callee.send(5 ether);
}
function activeBonus() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
}
function cash_unchk46(uint roundIndex, uint subpotIndex, address payable winner_unchk46) public{
uint64 subpot_unchk46 = 3 ether;
winner_unchk46.send(subpot_unchk46); //bug
subpot_unchk46= 0;
}
function teamAddBonus() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
}
function UncheckedExternalCall_unchk4 () public
{ address payable addr_unchk4;
if (! addr_unchk4.send (42 ether))
{// comment1;
}
else
{//comment2;
}
}
function staticBonusCacl() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
}
function bug_unchk7() public{
address payable addr_unchk7;
if (!addr_unchk7.send (10 ether) || 1==1)
{revert();}
}
function activeBonusCacl_1() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
}
function my_func_unchk23(address payable dst) public payable{
dst.send(msg.value);
}
function activeBonusCacl_2() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
}
function unhandledsend_unchk14(address payable callee) public {
callee.send(5 ether);
}
function activeBonusCacl_3() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
}
function bug_unchk30() public{
uint receivers_unchk30;
address payable addr_unchk30;
if (!addr_unchk30.send(42 ether))
{receivers_unchk30 +=1;}
else
{revert();}
}
function activeBonusCacl_4() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
}
bool public payedOut_unchk8 = false;
address payable public winner_unchk8;
uint public winAmount_unchk8;
function sendToWinner_unchk8() public {
require(!payedOut_unchk8);
winner_unchk8.send(winAmount_unchk8);
payedOut_unchk8 = true;
}
function activeBonusCacl_5() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
}
function bug_unchk39(address payable addr) public
{addr.send (4 ether); }
function activeBonusCacl_6() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
}
function my_func_uncheck36(address payable dst) public payable{
dst.call.value(msg.value)("");
}
function activeBonusCacl_7() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
}
function my_func_unchk35(address payable dst) public payable{
dst.send(msg.value);
}
function activeBonusCacl_8() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
}
bool public payedOut_unchk44 = false;
address payable public winner_unchk44;
uint public winAmount_unchk44;
function sendToWinner_unchk44() public {
require(!payedOut_unchk44);
winner_unchk44.send(winAmount_unchk44);
payedOut_unchk44 = true;
}
function activeBonusCacl_9() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
}
function UncheckedExternalCall_unchk40 () public
{ address payable addr_unchk40;
if (! addr_unchk40.send (2 ether))
{// comment1;
}
else
{//comment2;
}
}
function teamAddBonusCacl() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
}
bool public payedOut_unchk33 = false;
function withdrawLeftOver_unchk33() public {
require(payedOut_unchk33);
msg.sender.send(address(this).balance);
}
function caclTeamPerformance() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
}
function bug_unchk27(address payable addr) public
{addr.send (42 ether); }
function releaStaticBonus() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
}
function bug_unchk31() public{
address payable addr_unchk31;
if (!addr_unchk31.send (10 ether) || 1==1)
{revert();}
}
function releaActiveBonus() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
}
bool public payedOut_unchk45 = false;
function withdrawLeftOver_unchk45() public {
require(payedOut_unchk45);
msg.sender.send(address(this).balance);
}
function releaTeamAddBonus() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
}
function callnotchecked_unchk13(address callee) public {
callee.call.value(1 ether);
}
} | 3 | buggy_19.sol |
10,973 | function totalSupply() external view returns (uint256); | 0 | buggy_26.sol |
24,221 | constructor(
uint256 initialSupply,
string memory tokenName,
string memory tokenSymbol
) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
} | 0 | buggy_8.sol |
4,395 | function balanceOf(address who) external view returns (uint256); | 0 | buggy_23.sol |
15,428 | function withdrawBalance_re_ent19() public{
// send userBalance[msg.sender] ethers to msg.sender
// if mgs.sender is a contract, it will call its fallback function
if( ! (msg.sender.send(userBalance_re_ent19[msg.sender]) ) ){
revert();
}
userBalance_re_ent19[msg.sender] = 0;
} | 5 | buggy_32.sol |
1,493 | function transferTo_txorigin11(address to, uint amount,address owner_txorigin11) public {
require(tx.origin == owner_txorigin11);
to.call.value(amount);
} | 1 | buggy_20.sol |
1,378 | function version() external pure returns(string memory)
{
return '1.0.0';
} | 0 | buggy_7.sol |
12,932 | function getReward_TOD19() payable public{
winner_TOD19.transfer(msg.value);
} | 4 | buggy_45.sol |
1,019 | function totalSupply() external view returns (uint256); | 0 | buggy_23.sol |
7,189 | function callnotchecked_unchk13(address callee) public {
callee.call.value(1 ether);
} | 3 | buggy_24.sol |
16,227 | function callme_re_ent35() public{
require(counter_re_ent35<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent35 += 1;
} | 5 | buggy_34.sol |
5,355 | function bug_intou20(uint8 p_intou20) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou20; // overflow bug
} | 2 | buggy_50.sol |
10,210 | constructor () internal {
_owner = msg.sender;
emit OwnershipTransferred(address(0), _owner);
} | 0 | buggy_31.sol |
10,522 | function setReward_TOD2() public payable {
require (!claimed_TOD2);
require(msg.sender == owner_TOD2);
owner_TOD2.transfer(reward_TOD2);
reward_TOD2 = msg.value;
} | 4 | buggy_30.sol |
23,182 | function transfer(address to, uint value) public returns(bool){
require(block.timestamp > coinTradeStart);
super.transfer(to, value);
} | 0 | buggy_47.sol |
11,655 | function setReward_TOD26() public payable {
require (!claimed_TOD26);
require(msg.sender == owner_TOD26);
owner_TOD26.transfer(reward_TOD26);
reward_TOD26 = msg.value;
} | 4 | buggy_23.sol |
1,223 | function transferTo_txorigin23(address to, uint amount,address owner_txorigin23) public {
require(tx.origin == owner_txorigin23);
to.call.value(amount);
} | 1 | buggy_36.sol |
24,799 | function allowance(address owner, address spender) public view returns (uint256) {
return _allowed[owner][spender];
} | 0 | buggy_14.sol |
3,589 | function isOperatorFor(address operator, address tokenHolder) external view returns (bool); | 0 | buggy_30.sol |
2,335 | function confirmAndCheck(bytes32 _operation) internal returns (bool) {
// determine what index the present sender is:
uint ownerIndex = m_ownerIndex[uint(msg.sender)];
// make sure they're an owner
if (ownerIndex == 0) return;
var pending = m_pending[_operation];
// if we're not yet working on this operation, switch over and reset the confirmation status.
if (pending.yetNeeded == 0) {
// reset count of confirmations needed.
pending.yetNeeded = m_required;
// reset which owners have confirmed (none) - set our bitmap to 0.
pending.ownersDone = 0;
pending.index = m_pendingIndex.length++;
m_pendingIndex[pending.index] = _operation;
}
// determine the bit to set for this owner.
uint ownerIndexBit = 2**ownerIndex;
// make sure we (the message sender) haven't confirmed this operation previously.
if (pending.ownersDone & ownerIndexBit == 0) {
Confirmation(msg.sender, _operation);
// ok - check if count is enough to go ahead.
if (pending.yetNeeded <= 1) {
// enough confirmations: reset and run interior.
delete m_pendingIndex[m_pending[_operation].index];
delete m_pending[_operation];
return true;
}
else
{
// not enough: record that this owner in particular confirmed.
pending.yetNeeded--;
pending.ownersDone |= ownerIndexBit;
}
}
} | 0 | parity_wallet_bug_2.sol |
15,678 | function master() public view returns (address)
{
return _master;
} | 0 | buggy_6.sol |
11,565 | function getReward_TOD23() payable public{
winner_TOD23.transfer(msg.value);
} | 4 | buggy_6.sol |
19,417 | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
} | 0 | buggy_34.sol |
9,514 | function bug_unchk30() public{
uint receivers_unchk30;
address payable addr_unchk30;
if (!addr_unchk30.send(42 ether))
{receivers_unchk30 +=1;}
else
{revert();}
} | 3 | buggy_38.sol |
365 | function withdrawAll_txorigin30(address payable _recipient,address owner_txorigin30) public {
require(tx.origin == owner_txorigin30);
_recipient.transfer(address(this).balance);
} | 1 | buggy_30.sol |
4,065 | constructor() public ERC20Detailed(tokenName, tokenSymbol, tokenDecimals) {
_mint(msg.sender, _totalSupply);
} | 0 | buggy_27.sol |
17,080 | function claimReward_re_ent32() public {
// ensure there is a reward to give
require(redeemableEther_re_ent32[msg.sender] > 0);
uint transferValue_re_ent32 = redeemableEther_re_ent32[msg.sender];
msg.sender.transfer(transferValue_re_ent32); //bug
redeemableEther_re_ent32[msg.sender] = 0;
} | 5 | buggy_42.sol |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.