I am having trouble with this parse error when I compile the abi. I want to be able to add the argument that gets passed into the function to the workdone. However when I try to do that I get a parse error. If I hardcode in a number then it compiles without issue. Any help?
doesn't compile
function test1(address addr1, uint8 num) nonReentrant external {
for (uint8 i = 0; i < num; i++) {
//do the thing
}
workDone[msg.sender] = workDone[msg.sender].add(uint256(num ether));
}
compiles fine
function test1(address addr1) nonReentrant external {
for (uint8 i = 0; i < 10; i++) {
//do the thing
}
workDone[msg.sender] = workDone[msg.sender].add(uint256(10 ether));
}