Skip to content

Instantly share code, notes, and snippets.

@crazyrabbitLTC
Created August 18, 2019 13:19
Show Gist options
  • Select an option

  • Save crazyrabbitLTC/cd2c335842d31bb4e8c68ce97f1c5a97 to your computer and use it in GitHub Desktop.

Select an option

Save crazyrabbitLTC/cd2c335842d31bb4e8c68ce97f1c5a97 to your computer and use it in GitHub Desktop.
GSN Enabled Solidity Contract
pragma solidity ^0.5.0;
import "@openzeppelin/contracts-ethereum-package/contracts/GSN/GSNRecipient.sol";
contract Counter is GSNRecipient {
uint256 public value;
function increase() public {
value += 1;
}
function acceptRelayedCall(
address relay,
address from,
bytes calldata encodedFunction,
uint256 transactionFee,
uint256 gasPrice,
uint256 gasLimit,
uint256 nonce,
bytes calldata approvalData,
uint256 maxPossibleCharge
) external view returns (uint256, bytes memory) {
return _approveRelayedCall();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment