sophia/test/contracts/simple_storage.aes
2019-06-28 09:42:28 +02:00

29 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
entrypoint set(uint x) {
storedData = x
}
entrypoint get() constant returns (uint) {
return storedData
}
}
*/
contract SimpleStorage =
record state = { data : int }
entrypoint init(value : int) : state = { data = value }
entrypoint get() : int = state.data
stateful entrypoint set(value : int) =
put(state{data = value})