Skip to content

Instantly share code, notes, and snippets.

@kadenzipfel
Created December 3, 2019 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kadenzipfel/a5d23fd9291c4d0dede4abbe13b92e72 to your computer and use it in GitHub Desktop.
Save kadenzipfel/a5d23fd9291c4d0dede4abbe13b92e72 to your computer and use it in GitHub Desktop.
contract Relayer {
mapping (bytes => bool) executed;
function relay(bytes _data) public {
// replay protection; do not call the same transaction twice
require(executed[_data] == 0, "Duplicate call");
executed[_data] = true;
innerContract.call(bytes4(keccak256("execute(bytes)")), _data);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment