Skip to content

Instantly share code, notes, and snippets.

@tim-cotten
Created November 12, 2018 03:35
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 tim-cotten/3ad728710710b771f463c0407c86e362 to your computer and use it in GitHub Desktop.
Save tim-cotten/3ad728710710b771f463c0407c86e362 to your computer and use it in GitHub Desktop.
SampleUpdater.sol for Talking to Ethereum Smart Contracts by Tim Cotten
pragma solidity ^0.4.0;
contract SampleUpdater {
address authorized_service_provider;
uint nonce;
function getNonce() public view returns(uint) {
return nonce;
}
function update() public {
require(msg.sender == authorized_service_provider, 'Not the authorized service provider.');
nonce += 1;
}
constructor() public {
authorized_service_provider = msg.sender;
nonce = 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment