Skip to content

Instantly share code, notes, and snippets.

Created June 26, 2017 17:00
Show Gist options
  • Save anonymous/f5c444b9e087d03438aa990cb91b9e3a to your computer and use it in GitHub Desktop.
Save anonymous/f5c444b9e087d03438aa990cb91b9e3a to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.11;
contract Base {
modifier onlyPayloadSize(uint256 size) {
if(msg.data.length < size + 4) {
throw;
}
_;
}
function guarded(uint x) onlyPayloadSize(32) {
}
}
contract Foo is Base {
function shouldNotThrow() {
super.guarded(0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment