Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
concordium
smart-contract-interactions
Commits
71b1a654
Commit
71b1a654
authored
Oct 13, 2019
by
Jakob Botsch Nielsen
Browse files
Prove a couple of facts about contracts
Contracts cannot create blocks and balance of undeployed contract is 0
parent
cfebc81e
Changes
1
Hide whitespace changes
Inline
Side-by-side
theories/Blockchain.v
View file @
71b1a654
...
...
@@ -966,6 +966,33 @@ Proof.
auto
.
Qed
.
Lemma
contract_no_created_blocks
state
(
trace
:
ChainTrace
empty_state
state
)
addr
:
address_is_contract
addr
=
true
->
created_blocks
trace
addr
=
[].
Proof
.
intros
is_contract
.
remember
empty_state
eqn
:
eq
.
induction
trace
;
auto
.
destruct_chain_step
;
auto
.
cbn
.
subst
.
inversion
valid_header
.
destruct
(
address_eqb_spec
(
block_creator
header
)
addr
);
auto
.
congruence
.
Qed
.
Lemma
undeployed_contract_balance_0
state
addr
:
reachable
state
->
address_is_contract
addr
=
true
->
env_contracts
state
addr
=
None
->
account_balance
state
addr
=
0.
Proof
.
intros
[
trace
]
is_contract
no_contract
.
rewrite
(
account_balance_trace
_
trace
);
auto
.
rewrite
undeployed_contract_no_out_txs
,
undeployed_contract_no_in_txs
,
contract_no_created_blocks
;
auto
.
Qed
.
End
Theories
.
End
Trace
.
End
Semantics
.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment