From f52e00530722ee73c11610effcf13ed1a7199c0b Mon Sep 17 00:00:00 2001 From: Daniel Lubarov Date: Sat, 13 Aug 2022 12:17:19 -0700 Subject: [PATCH] Add static --- evm/src/cpu/kernel/context_metadata.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/evm/src/cpu/kernel/context_metadata.rs b/evm/src/cpu/kernel/context_metadata.rs index 5b6ce303..26bd541f 100644 --- a/evm/src/cpu/kernel/context_metadata.rs +++ b/evm/src/cpu/kernel/context_metadata.rs @@ -17,10 +17,13 @@ pub(crate) enum ContextMetadata { Caller = 6, /// The value (in wei) deposited by the caller. CallValue = 7, + /// Whether this context was created by `STATICCALL`, in which case state changes are + /// prohibited. + Static = 8, } impl ContextMetadata { - pub(crate) const COUNT: usize = 8; + pub(crate) const COUNT: usize = 9; pub(crate) fn all() -> [Self; Self::COUNT] { [ @@ -32,6 +35,7 @@ impl ContextMetadata { Self::CodeSize, Self::Caller, Self::CallValue, + Self::Static, ] } @@ -46,6 +50,7 @@ impl ContextMetadata { ContextMetadata::CodeSize => "CTX_METADATA_CODE_SIZE", ContextMetadata::Caller => "CTX_METADATA_CALLER", ContextMetadata::CallValue => "CTX_METADATA_CALL_VALUE", + ContextMetadata::Static => "CTX_METADATA_STATIC", } } }