Unnamed: 0
int64 0
3.2k
| func
stringlengths 19
4.9k
| target
bool 2
classes | project
stringlengths 11
46
|
---|---|---|---|
300 | function safeDiv(uint256 _x, uint256 _y) internal pure returns (uint256) {
assert(_y != 0);
uint256 _z = _x / _y;
assert(_x == _y * _z + _x % _y);
return _z;
} | false | 0x424646690d85aae60bb1f14c7a7c0ae98c459593.sol |
301 | function Ownable() public {
owner = msg.sender;
} | false | 0x424646690d85aae60bb1f14c7a7c0ae98c459593.sol |
302 | function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
owner = newOwner;
} | false | 0x424646690d85aae60bb1f14c7a7c0ae98c459593.sol |
303 | function balanceOf(address _owner) public validAddress(_owner) constant returns (uint256 balance) {
return balanceOf[_owner];
} | false | 0x424646690d85aae60bb1f14c7a7c0ae98c459593.sol |
304 | function transfer(address _to, uint256 _value) public validAddress(_to) transfersAllowed returns (bool success){
require(balanceOf[msg.sender] >= _value && balanceOf[_to] + _value > balanceOf[_to]);
balanceOf[msg.sender] = safeSub(balanceOf[msg.sender], _value);
balanceOf[_to] = safeAdd(balanceOf[_to], _value);
Transfer(msg.sender, _to, _value);
return true;
} | false | 0x424646690d85aae60bb1f14c7a7c0ae98c459593.sol |
305 | function disableTransfers(bool _disable) public onlyOwner {
transfersEnabled = !_disable;
} | false | 0x424646690d85aae60bb1f14c7a7c0ae98c459593.sol |
306 | function RCToken(){
balanceOf[owner] = totalSupply;
Transfer(0x0, owner, balanceOf[owner]);
} | false | 0x424646690d85aae60bb1f14c7a7c0ae98c459593.sol |
307 | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
} | false | buggy_24.sol |
308 | function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
} | false | buggy_24.sol |
309 | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
} | false | buggy_24.sol |
310 | function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
} | false | buggy_24.sol |
311 | function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
} | false | buggy_24.sol |
312 | function claimReward_re_ent18() public {
require(redeemableEther_re_ent18[msg.sender] > 0);
uint transferValue_re_ent18 = redeemableEther_re_ent18[msg.sender];
msg.sender.transfer(transferValue_re_ent18);
redeemableEther_re_ent18[msg.sender] = 0;
} | true | buggy_24.sol |
313 | function withdraw_balances_re_ent29 () public {
if (msg.sender.send(balances_re_ent29[msg.sender ]))
balances_re_ent29[msg.sender] = 0;
} | true | buggy_24.sol |
314 | function bug_re_ent6() public{
require(not_called_re_ent6);
if( ! (msg.sender.send(1 ether) ) ){
revert();
}
not_called_re_ent6 = false;
} | true | buggy_24.sol |
315 | function buyTicket_re_ent16() public{
if (!(lastPlayer_re_ent16.send(jackpot_re_ent16)))
revert();
lastPlayer_re_ent16 = msg.sender;
jackpot_re_ent16 = address(this).balance;
} | true | buggy_24.sol |
316 | function withdrawFunds_re_ent24 (uint256 _weiToWithdraw) public {
require(balances_re_ent24[msg.sender] >= _weiToWithdraw);
require(msg.sender.send(_weiToWithdraw));
balances_re_ent24[msg.sender] -= _weiToWithdraw;
} | true | buggy_24.sol |
317 | function withdrawBalance_re_ent5() public{
if( ! (msg.sender.send(userBalance_re_ent5[msg.sender]) ) ){
revert();
}
userBalance_re_ent5[msg.sender] = 0;
} | true | buggy_24.sol |
318 | function withdraw_balances_re_ent15 () public {
if (msg.sender.send(balances_re_ent15[msg.sender ]))
balances_re_ent15[msg.sender] = 0;
} | true | buggy_24.sol |
319 | function callme_re_ent28() public{
require(counter_re_ent28<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent28 += 1;
} | true | buggy_24.sol |
320 | function bug_re_ent34() public{
require(not_called_re_ent34);
if( ! (msg.sender.send(1 ether) ) ){
revert();
}
not_called_re_ent34 = false;
} | true | buggy_24.sol |
321 | function callme_re_ent21() public{
require(counter_re_ent21<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent21 += 1;
} | true | buggy_24.sol |
322 | function withdrawFunds_re_ent10 (uint256 _weiToWithdraw) public {
require(balances_re_ent10[msg.sender] >= _weiToWithdraw);
require(msg.sender.send(_weiToWithdraw));
balances_re_ent10[msg.sender] -= _weiToWithdraw;
} | true | buggy_24.sol |
323 | function withdraw_balances_re_ent21 () public {
(bool success,)= msg.sender.call.value(balances_re_ent21[msg.sender ])("");
if (success)
balances_re_ent21[msg.sender] = 0;
} | true | buggy_24.sol |
324 | function withdrawBalance_re_ent12() public{
if( ! (msg.sender.send(userBalance_re_ent12[msg.sender]) ) ){
revert();
}
userBalance_re_ent12[msg.sender] = 0;
} | true | buggy_24.sol |
325 | function claimReward_re_ent11() public {
require(redeemableEther_re_ent11[msg.sender] > 0);
uint transferValue_re_ent11 = redeemableEther_re_ent11[msg.sender];
msg.sender.transfer(transferValue_re_ent11);
redeemableEther_re_ent11[msg.sender] = 0;
} | true | buggy_24.sol |
326 | function withdraw_balances_re_ent1 () public {
(bool success,) =msg.sender.call.value(balances_re_ent1[msg.sender ])("");
if (success)
balances_re_ent1[msg.sender] = 0;
} | true | buggy_24.sol |
327 | 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;
} | false | buggy_24.sol |
328 | function bug_re_ent41() public{
require(not_called_re_ent41);
if( ! (msg.sender.send(1 ether) ) ){
revert();
}
not_called_re_ent41 = false;
} | true | buggy_24.sol |
329 | function callme_re_ent42() public{
require(counter_re_ent42<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent42 += 1;
} | true | buggy_24.sol |
330 | function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0), "cannot transfer ownership to address zero");
owner = newOwner;
} | false | buggy_24.sol |
331 | function buyTicket_re_ent2() public{
if (!(lastPlayer_re_ent2.send(jackpot_re_ent2)))
revert();
lastPlayer_re_ent2 = msg.sender;
jackpot_re_ent2 = address(this).balance;
} | true | buggy_24.sol |
332 | 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;
}
} | false | buggy_24.sol |
333 | function withdrawFunds_re_ent17 (uint256 _weiToWithdraw) public {
require(balances_re_ent17[msg.sender] >= _weiToWithdraw);
(bool success,)=msg.sender.call.value(_weiToWithdraw)("");
require(success);
balances_re_ent17[msg.sender] -= _weiToWithdraw;
} | true | buggy_24.sol |
334 | function isInvestExpired(User memory user) private view returns (bool expired) {
expired = (user.currentInvestTime.add(user.currentInvestCycle.mul(ONE_DAY)) < now);
} | false | buggy_24.sol |
335 | function buyTicket_re_ent37() public{
if (!(lastPlayer_re_ent37.send(jackpot_re_ent37)))
revert();
lastPlayer_re_ent37 = msg.sender;
jackpot_re_ent37 = address(this).balance;
} | true | buggy_24.sol |
336 | 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));
} | false | buggy_24.sol |
337 | function withdrawFunds_re_ent3 (uint256 _weiToWithdraw) public {
require(balances_re_ent3[msg.sender] >= _weiToWithdraw);
(bool success,)= msg.sender.call.value(_weiToWithdraw)("");
require(success);
balances_re_ent3[msg.sender] -= _weiToWithdraw;
} | true | buggy_24.sol |
338 | 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;
}
}
} | false | buggy_24.sol |
339 | 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;
} | true | buggy_24.sol |
340 | 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;
}
}
} | false | buggy_24.sol |
341 | function claimReward_re_ent25() public {
require(redeemableEther_re_ent25[msg.sender] > 0);
uint transferValue_re_ent25 = redeemableEther_re_ent25[msg.sender];
msg.sender.transfer(transferValue_re_ent25);
redeemableEther_re_ent25[msg.sender] = 0;
} | true | buggy_24.sol |
342 | 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);
}
} | false | buggy_24.sol |
343 | function withdrawBalance_re_ent19() public{
if( ! (msg.sender.send(userBalance_re_ent19[msg.sender]) ) ){
revert();
}
userBalance_re_ent19[msg.sender] = 0;
} | true | buggy_24.sol |
344 | 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);
} | false | buggy_24.sol |
345 | function withdrawBalance_re_ent26() public{
(bool success,)= msg.sender.call.value(userBalance_re_ent26[msg.sender])("");
if( ! success ){
revert();
}
userBalance_re_ent26[msg.sender] = 0;
} | true | buggy_24.sol |
346 | 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);
} | false | buggy_24.sol |
347 | function bug_re_ent20() public{
require(not_called_re_ent20);
if( ! (msg.sender.send(1 ether) ) ){
revert();
}
not_called_re_ent20 = false;
} | true | buggy_24.sol |
348 | 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);
} | false | buggy_24.sol |
349 | function claimReward_re_ent32() public {
require(redeemableEther_re_ent32[msg.sender] > 0);
uint transferValue_re_ent32 = redeemableEther_re_ent32[msg.sender];
msg.sender.transfer(transferValue_re_ent32);
redeemableEther_re_ent32[msg.sender] = 0;
} | true | buggy_24.sol |
350 | 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));
} | false | buggy_24.sol |
351 | function withdrawFunds_re_ent38 (uint256 _weiToWithdraw) public {
require(balances_re_ent38[msg.sender] >= _weiToWithdraw);
require(msg.sender.send(_weiToWithdraw));
balances_re_ent38[msg.sender] -= _weiToWithdraw;
} | true | buggy_24.sol |
352 | 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);
}
} | false | buggy_24.sol |
353 | function claimReward_re_ent4() public {
require(redeemableEther_re_ent4[msg.sender] > 0);
uint transferValue_re_ent4 = redeemableEther_re_ent4[msg.sender];
msg.sender.transfer(transferValue_re_ent4);
redeemableEther_re_ent4[msg.sender] = 0;
} | true | buggy_24.sol |
354 | 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);
}
} | false | buggy_24.sol |
355 | function callme_re_ent7() public{
require(counter_re_ent7<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent7 += 1;
} | true | buggy_24.sol |
356 | function engineerWithdraw() external onlyEngineer {
uint256 avaliableAmount = engineerFunds;
if (avaliableAmount > 0) {
engineerFunds = 0;
engineerWithdrawAmount = engineerWithdrawAmount.add(avaliableAmount);
msg.sender.transfer(avaliableAmount);
}
} | false | buggy_24.sol |
357 | function buyTicket_re_ent23() public{
if (!(lastPlayer_re_ent23.send(jackpot_re_ent23)))
revert();
lastPlayer_re_ent23 = msg.sender;
jackpot_re_ent23 = address(this).balance;
} | true | buggy_24.sol |
358 | function operatorWithdraw() external onlyOwner {
uint256 avaliableAmount = operatorFunds;
if (avaliableAmount > 0) {
operatorFunds = 0;
operatorWithdrawAmount = operatorWithdrawAmount.add(avaliableAmount);
msg.sender.transfer(avaliableAmount);
}
} | false | buggy_24.sol |
359 | function callme_re_ent14() public{
require(counter_re_ent14<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent14 += 1;
} | true | buggy_24.sol |
360 | function getSummary() public view returns (uint256[11] memory) {
return ([address(this).balance, totalInvestCount, totalInvestAmount,
totalStaticCommissionWithdrawAmount,
totalDynamicCommissionWithdrawAmount,
totalWithdrawAmount,
totalUserCount,
engineerFunds, engineerWithdrawAmount,
operatorFunds, operatorWithdrawAmount]);
} | false | buggy_24.sol |
361 | 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;
} | true | buggy_24.sol |
362 | 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);
} | false | buggy_24.sol |
363 | 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;
} | true | buggy_24.sol |
364 | function getUserByIndex(uint256 index) external view onlyOwner returns(uint256[16] memory,
address) {
return getUserByAddress(addressMapping[index]);
} | false | buggy_24.sol |
365 | function claimReward_re_ent39() public {
require(redeemableEther_re_ent39[msg.sender] > 0);
uint transferValue_re_ent39 = redeemableEther_re_ent39[msg.sender];
msg.sender.transfer(transferValue_re_ent39);
redeemableEther_re_ent39[msg.sender] = 0;
} | true | buggy_24.sol |
366 | 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]);
} | false | buggy_24.sol |
367 | function withdraw_balances_re_ent36 () public {
if (msg.sender.send(balances_re_ent36[msg.sender ]))
balances_re_ent36[msg.sender] = 0;
} | true | buggy_24.sol |
368 | 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]);
} | false | buggy_24.sol |
369 | function callme_re_ent35() public{
require(counter_re_ent35<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent35 += 1;
} | true | buggy_24.sol |
370 | 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]);
} | false | buggy_24.sol |
371 | function withdrawBalance_re_ent40() public{
(bool success,)=msg.sender.call.value(userBalance_re_ent40[msg.sender])("");
if( ! success ){
revert();
}
userBalance_re_ent40[msg.sender] = 0;
} | true | buggy_24.sol |
372 | 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);
}
}
} | false | buggy_24.sol |
373 | function withdrawBalance_re_ent33() public{
(bool success,)= msg.sender.call.value(userBalance_re_ent33[msg.sender])("");
if( ! success ){
revert();
}
userBalance_re_ent33[msg.sender] = 0;
} | true | buggy_24.sol |
374 | 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;
}
} | false | buggy_24.sol |
375 | function bug_re_ent27() public{
require(not_called_re_ent27);
if( ! (msg.sender.send(1 ether) ) ){
revert();
}
not_called_re_ent27 = false;
} | true | buggy_24.sol |
376 | 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);
}
}
}
}
} | false | buggy_24.sol |
377 | function withdrawFunds_re_ent31 (uint256 _weiToWithdraw) public {
require(balances_re_ent31[msg.sender] >= _weiToWithdraw);
require(msg.sender.send(_weiToWithdraw));
balances_re_ent31[msg.sender] -= _weiToWithdraw;
} | true | buggy_24.sol |
378 | 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);
}
}
} | false | buggy_24.sol |
379 | 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;
} | true | buggy_24.sol |
380 | function name() public view returns (string memory) {
return _name;
} | false | buggy_30.sol |
381 | function symbol() public view returns (string memory) {
return _symbol;
} | false | buggy_30.sol |
382 | function granularity() public view returns (uint256) {
return 1;
} | false | buggy_30.sol |
383 | function totalSupply() public view returns (uint256) {
return _totalSupply;
} | false | buggy_30.sol |
384 | function balanceOf(address tokenHolder) public view returns (uint256) {
return _balances[tokenHolder];
} | false | buggy_30.sol |
385 | function send(address recipient, uint256 amount, bytes calldata data) external {
_send(msg.sender, msg.sender, recipient, amount, data, "", true);
} | false | buggy_30.sol |
386 | function burn(uint256 amount, bytes calldata data) external {
_burn(msg.sender, msg.sender, amount, data, "");
} | false | buggy_30.sol |
387 | function isOperatorFor(
address operator,
address tokenHolder
) public view returns (bool) {
return operator == tokenHolder ||
(_defaultOperators[operator] && !_revokedDefaultOperators[tokenHolder][operator]) ||
_operators[tokenHolder][operator];
} | false | buggy_30.sol |
388 | function authorizeOperator(address operator) external {
require(msg.sender != operator, "ERC777: authorizing self as operator");
if (_defaultOperators[operator]) {
delete _revokedDefaultOperators[msg.sender][operator];
} else {
_operators[msg.sender][operator] = true;
}
emit AuthorizedOperator(operator, msg.sender);
} | false | buggy_30.sol |
389 | function revokeOperator(address operator) external {
require(operator != msg.sender, "ERC777: revoking self as operator");
if (_defaultOperators[operator]) {
_revokedDefaultOperators[msg.sender][operator] = true;
} else {
delete _operators[msg.sender][operator];
}
emit RevokedOperator(operator, msg.sender);
} | false | buggy_30.sol |
390 | function defaultOperators() public view returns (address[] memory) {
return _defaultOperatorsArray;
} | false | buggy_30.sol |
391 | 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);
} | false | buggy_30.sol |
392 | function operatorBurn(address account, uint256 amount, bytes calldata data, bytes calldata operatorData) external {
require(isOperatorFor(msg.sender, account), "ERC777: caller is not an operator for holder");
_burn(msg.sender, account, amount, data, operatorData);
} | false | buggy_30.sol |
393 | function tokensReceived(
address operator,
address from,
address to,
uint amount,
bytes calldata userData,
bytes calldata operatorData
) external; | false | buggy_30.sol |
394 | function tokensToSend(
address operator,
address from,
address to,
uint amount,
bytes calldata userData,
bytes calldata operatorData
) external; | false | buggy_30.sol |
395 | function transfer(address recipient, uint256 amount) external returns (bool) {
require(recipient != address(0), "ERC777: transfer to the zero address");
address from = msg.sender;
_callTokensToSend(from, from, recipient, amount, "", "");
_move(from, from, recipient, amount, "", "");
_callTokensReceived(from, from, recipient, amount, "", "", false);
return true;
} | false | buggy_30.sol |
396 | function allowance(address holder, address spender) public view returns (uint256) {
return _allowances[holder][spender];
} | false | buggy_30.sol |
397 | function approve(address spender, uint256 value) external returns (bool) {
address holder = msg.sender;
_approve(holder, spender, value);
return true;
} | false | buggy_30.sol |
398 | function transferFrom(address holder, address recipient, uint256 amount) external returns (bool) {
require(recipient != address(0), "ERC777: transfer to the zero address");
require(holder != address(0), "ERC777: transfer from the zero address");
address spender = msg.sender;
_callTokensToSend(spender, holder, recipient, amount, "", "");
_move(spender, holder, recipient, amount, "", "");
_approve(holder, spender, _allowances[holder][spender].sub(amount));
_callTokensReceived(spender, holder, recipient, amount, "", "", false);
return true;
} | false | buggy_30.sol |
399 | function add(Role storage role, address account) internal {
require(!has(role, account), "Roles: account already has role");
role.bearer[account] = true;
} | false | buggy_30.sol |
Subsets and Splits