Skip to content

Instantly share code, notes, and snippets.

@KadenZipfel

KadenZipfel/Relayer.sol Secret

Created Dec 3, 2019
Embed
What would you like to do?
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