Check stateful annotations #560

Merged
zxq9 merged 8 commits from PT-162578475-stateful into master 2019-05-15 22:44:38 +09:00

8 Commits

Author SHA1 Message Date
Ulf Norell
cf5a8aeb5f changelog 2019-05-14 10:10:53 +02:00
Ulf Norell
9e555a3121 Fix type definition 2019-05-14 09:42:27 +02:00
Ulf Norell
d051fa6c89 Remove bad code 2019-05-14 09:42:17 +02:00
Ulf Norell
389072fb12 Add stateful to __call 2019-05-14 09:32:52 +02:00
Ulf Norell
d8dd6b900f Remove unused test contract 2019-05-13 17:51:56 +02:00
Ulf Norell
74d4048d9f Check that init doesn't read or write the state 2019-05-13 17:51:47 +02:00
Ulf Norell
6bd2b7c483 Remember source location when computing used names 2019-05-13 17:50:34 +02:00
Ulf Norell
5aed8b3ef5 Check stateful annotations
Functions must be annotated as `stateful` in order to
- Update the contract state (using `put`)
- Call `Chain.spend` or other primitive functions that cost tokens
- Call an Oracle or AENS function that requires a signature
- Make a remote call with a non-zero value
- Construct a lambda calling a stateful function

It does not need to be stateful to
- Read the contract state
- Call another contract with value=0, even when the remote function is stateful
2019-05-13 13:39:17 +02:00