@@ -169,6 +169,26 @@ std::vector<SemanticInformation::Operation> SemanticInformation::readWriteOperat
169169 });
170170 return operations;
171171 }
172+ case Instruction::EXTCALL:
173+ case Instruction::EXTSTATICCALL:
174+ case Instruction::EXTDELEGATECALL:
175+ {
176+ size_t paramCount = static_cast <size_t >(instructionInfo (_instruction, langutil::EVMVersion ()).args );
177+ size_t const memoryStartParam = _instruction == Instruction::EXTCALL ? paramCount - 3 : paramCount - 2 ;
178+ size_t const memoryLengthParam = _instruction == Instruction::EXTCALL ? paramCount - 2 : paramCount - 1 ;
179+ std::vector<Operation> operations{
180+ Operation{Location::Memory, Effect::Read, memoryStartParam, memoryLengthParam, {}},
181+ Operation{Location::Storage, Effect::Read, {}, {}, {}},
182+ Operation{Location::TransientStorage, Effect::Read, {}, {}, {}}
183+ };
184+ if (_instruction == Instruction::EXTDELEGATECALL)
185+ {
186+ operations.emplace_back (Operation{Location::Storage, Effect::Write, {}, {}, {}});
187+ operations.emplace_back (Operation{Location::TransientStorage, Effect::Write, {}, {}, {}});
188+ }
189+
190+ return operations;
191+ }
172192 case Instruction::CREATE:
173193 case Instruction::CREATE2:
174194 return std::vector<Operation>{
@@ -380,6 +400,9 @@ bool SemanticInformation::isDeterministic(AssemblyItem const& _item)
380400 case Instruction::CALLCODE:
381401 case Instruction::DELEGATECALL:
382402 case Instruction::STATICCALL:
403+ case Instruction::EXTCALL:
404+ case Instruction::EXTDELEGATECALL:
405+ case Instruction::EXTSTATICCALL:
383406 case Instruction::CREATE:
384407 case Instruction::CREATE2:
385408 case Instruction::GAS:
@@ -475,6 +498,9 @@ SemanticInformation::Effect SemanticInformation::memory(Instruction _instruction
475498 case Instruction::LOG4:
476499 case Instruction::EOFCREATE:
477500 case Instruction::RETURNCONTRACT:
501+ case Instruction::EXTCALL:
502+ case Instruction::EXTDELEGATECALL:
503+ case Instruction::EXTSTATICCALL:
478504 return SemanticInformation::Read;
479505
480506 default :
@@ -514,10 +540,13 @@ SemanticInformation::Effect SemanticInformation::storage(Instruction _instructio
514540 case Instruction::SSTORE:
515541 case Instruction::EOFCREATE:
516542 case Instruction::RETURNCONTRACT:
543+ case Instruction::EXTCALL:
544+ case Instruction::EXTDELEGATECALL:
517545 return SemanticInformation::Write;
518546
519547 case Instruction::SLOAD:
520548 case Instruction::STATICCALL:
549+ case Instruction::EXTSTATICCALL:
521550 return SemanticInformation::Read;
522551
523552 default :
@@ -537,10 +566,13 @@ SemanticInformation::Effect SemanticInformation::transientStorage(Instruction _i
537566 case Instruction::TSTORE:
538567 case Instruction::EOFCREATE:
539568 case Instruction::RETURNCONTRACT:
569+ case Instruction::EXTCALL:
570+ case Instruction::EXTDELEGATECALL:
540571 return SemanticInformation::Write;
541572
542573 case Instruction::TLOAD:
543574 case Instruction::STATICCALL:
575+ case Instruction::EXTSTATICCALL:
544576 return SemanticInformation::Read;
545577
546578 default :
@@ -559,7 +591,10 @@ SemanticInformation::Effect SemanticInformation::otherState(Instruction _instruc
559591 case Instruction::CREATE2:
560592 case Instruction::EOFCREATE:
561593 case Instruction::RETURNCONTRACT:
594+ case Instruction::EXTCALL:
595+ case Instruction::EXTDELEGATECALL:
562596 case Instruction::SELFDESTRUCT:
597+ case Instruction::EXTSTATICCALL:
563598 case Instruction::STATICCALL: // because it can affect returndatasize
564599 // Strictly speaking, log0, .., log4 writes to the state, but the EVM cannot read it, so they
565600 // are just marked as having 'other side effects.'
@@ -606,6 +641,7 @@ bool SemanticInformation::invalidInPureFunctions(Instruction _instruction)
606641 case Instruction::NUMBER:
607642 case Instruction::PREVRANDAO:
608643 case Instruction::GASLIMIT:
644+ case Instruction::EXTSTATICCALL:
609645 case Instruction::STATICCALL:
610646 case Instruction::SLOAD:
611647 case Instruction::TLOAD:
@@ -635,6 +671,8 @@ bool SemanticInformation::invalidInViewFunctions(Instruction _instruction)
635671 case Instruction::CALL:
636672 case Instruction::CALLCODE:
637673 case Instruction::DELEGATECALL:
674+ case Instruction::EXTCALL:
675+ case Instruction::EXTDELEGATECALL:
638676 // According to EOF spec https://eips.ethereum.org/EIPS/eip-7620#eofcreate
639677 case Instruction::EOFCREATE:
640678 // According to EOF spec https://eips.ethereum.org/EIPS/eip-7620#returncontract
0 commit comments