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.
21 lines
434 B
21 lines
434 B
9 years ago
|
import '../PullPaymentCapable.sol';
|
||
9 years ago
|
|
||
|
// UNSAFE CODE, DO NOT USE!
|
||
|
|
||
|
contract BadArrayUse is PullPaymentCapable {
|
||
|
address[] employees;
|
||
|
|
||
9 years ago
|
function payBonus() {
|
||
9 years ago
|
for (var i = 0; i < employees.length; i++) {
|
||
9 years ago
|
address employee = employees[i];
|
||
|
uint bonus = calculateBonus(employee);
|
||
|
asyncSend(employee, bonus);
|
||
9 years ago
|
}
|
||
|
}
|
||
9 years ago
|
|
||
|
function calculateBonus(address employee) returns (uint) {
|
||
|
// some expensive computation...
|
||
|
}
|
||
|
|
||
9 years ago
|
}
|