Created
November 12, 2018 03:35
-
-
Save tim-cotten/3ad728710710b771f463c0407c86e362 to your computer and use it in GitHub Desktop.
SampleUpdater.sol for Talking to Ethereum Smart Contracts by Tim Cotten
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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