sophia/test/contracts/simple_storage.aes
2018-12-22 01:23:40 +01:00

30 lines
588 B
Plaintext

/* Example from Solidity by Example
http://solidity.readthedocs.io/en/develop/introduction-to-smart-contracts.html
The Solidity code:
contract SimpleStorage {
uint storedData
function set(uint x) {
storedData = x
}
function get() constant returns (uint) {
return storedData
}
}
*/
contract SimpleStorage =
type event = int
record state = { data : int }
function init(value : int) : state = { data = value }
function get() : int = state.data
function set(value : int) =
put(state{data = value})