mirror of openzeppelin-contracts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
openzeppelin-contracts/contracts/BadArrayUse.sol

20 lines
433 B

import './PullPaymentCapable.sol';
// UNSAFE CODE, DO NOT USE!
contract BadArrayUse is PullPaymentCapable {
address[] employees;
function payBonus() {
for (var i = 0; i < employees.length; i++) {
address employee = employees[i];
uint bonus = calculateBonus(employee);
asyncSend(employee, bonus);
}
}
function calculateBonus(address employee) returns (uint) {
// some expensive computation...
}
}