Skip to content

Instantly share code, notes, and snippets.

@developeruche
Created August 2, 2022 12:55
Show Gist options
  • Save developeruche/109b9252f67e2ebbb730bb23d646197b to your computer and use it in GitHub Desktop.
Save developeruche/109b9252f67e2ebbb730bb23d646197b to your computer and use it in GitHub Desktop.
Odd testing
pragma solidity >=0.7.0 <0.9.0;
contract MyContract {
uint[] public arr = [1,2,3,4,5,6,7,8,9,10];
uint[] public res;
function startWork() public {
for (uint i = 0; i < arr.length; i++) {
if(arr[i] % 2 == 0) {
res.push(arr[i]);
}
}
}
function makeReturns() external returns (uint[] memory) {
return res;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment