Assess criticality of deploying contract with mismatching Environment
#1694
Labels
B-research
Research task that has open questions that need to be resolved.
good first issue
Good for newcomers
OpenZeppelin
In this section of our
ARCHITECTURE.md
we explain what theEnvironment
trait in ink! is used for. TheDefaultEnvironment
which ink! uses is defined here.Right now someone can deploy a contract with mismatching types on a live chain. So e.g. the contract would use
type Balance = u128
and the chain support onlytype Balance = u64
.Note, that actually nobody has ever tried out what exactly happens then. Right now the assumption is just that people won't do this. This in itself is bad and we will fix it with #1695. Also note, that we investigated in #1614 and couldn't find a chain that deviates for our default types.
ToDo
Balance
Deploy a contract that uses a different
Balance
type for itsEnvironment
, see what happens when you have a functionwith
value: Balance
in the contract's storage.MAX_EVENT_TOPICS
Have a contract with an environment of 5 max topics and also annotate five topics. Run the chain with only 4 max topics (that's the default) and see if the contract indeed traps.
See here for documentation on how to annotate events with topics.
The text was updated successfully, but these errors were encountered: