Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[EVM] Sponsored, inefficient with push/pop
pragma solidity^0.4.19;
// like a less-liquid GasToken
contract Sponsored {
uint256[] wastedSpace;
function sponsor() external {
wastedSpace.push(1);
wastedSpace.push(1);
wastedSpace.push(1);
wastedSpace.push(1);
wastedSpace.push(1);
}
modifier sponsored {
_;
if (wastedSpace.length != 0) {
wastedSpace.pop();
wastedSpace.pop();
wastedSpace.pop();
wastedSpace.pop();
wastedSpace.pop();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.