// SPDX-License-Identifier: Apache-2.0 #pragma once #include "eeibase.h" namespace SSVM { namespace Host { class EEICall : public EEI { public: EEICall(EVMEnvironment &HostEnv) : EEI(HostEnv, 700) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint64_t Gas, uint32_t AddressOffset, uint32_t ValueOffset, uint32_t DataOffset, uint32_t DataLength); }; class EEICallCode : public EEI { public: EEICallCode(EVMEnvironment &HostEnv) : EEI(HostEnv, 700) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint64_t Gas, uint32_t AddressOffset, uint32_t ValueOffset, uint32_t DataOffset, uint32_t DataLength); }; class EEICallDataCopy : public EEI { public: EEICallDataCopy(EVMEnvironment &HostEnv) : EEI(HostEnv, 3) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint32_t ResultOffset, uint32_t DataOffset, uint32_t Length); }; class EEICallDelegate : public EEI { public: EEICallDelegate(EVMEnvironment &HostEnv) : EEI(HostEnv, 700) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint64_t Gas, uint32_t AddressOffset, uint32_t DataOffset, uint32_t DataLength); }; class EEICallStatic : public EEI { public: EEICallStatic(EVMEnvironment &HostEnv) : EEI(HostEnv, 700) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint64_t Gas, uint32_t AddressOffset, uint32_t DataOffset, uint32_t DataLength); }; class EEICodeCopy : public EEI { public: EEICodeCopy(EVMEnvironment &HostEnv) : EEI(HostEnv, 3) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint32_t ResultOffset, uint32_t CodeOffset, uint32_t Length); }; class EEICreate : public EEI { public: EEICreate(EVMEnvironment &HostEnv) : EEI(HostEnv, 32000) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint32_t ValueOffset, uint32_t DataOffset, uint32_t DataLength, uint32_t ResultOffset); }; class EEIExternalCodeCopy : public EEI { public: EEIExternalCodeCopy(EVMEnvironment &HostEnv) : EEI(HostEnv, 700) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint32_t AddressOffset, uint32_t ResultOffset, uint32_t CodeOffset, uint32_t Length); }; class EEIFinish : public EEI { public: EEIFinish(EVMEnvironment &HostEnv) : EEI(HostEnv, 0) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint32_t DataOffset, uint32_t DataLength); }; class EEIGetAddress : public EEI { public: EEIGetAddress(EVMEnvironment &HostEnv) : EEI(HostEnv, 2) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint32_t ResultOffset); }; class EEIGetBlockCoinbase : public EEI { public: EEIGetBlockCoinbase(EVMEnvironment &HostEnv) : EEI(HostEnv, 2) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint32_t ResultOffset); }; class EEIGetBlockDifficulty : public EEI { public: EEIGetBlockDifficulty(EVMEnvironment &HostEnv) : EEI(HostEnv, 2) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint32_t ResultOffset); }; class EEIGetBlockGasLimit : public EEI { public: EEIGetBlockGasLimit(EVMEnvironment &HostEnv) : EEI(HostEnv, 2) {} Expect body(Runtime::Instance::MemoryInstance *MemInst); }; class EEIGetBlockHash : public EEI { public: EEIGetBlockHash(EVMEnvironment &HostEnv) : EEI(HostEnv, 800) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint64_t Number, uint32_t ResultOffset); }; class EEIGetBlockNumber : public EEI { public: EEIGetBlockNumber(EVMEnvironment &HostEnv) : EEI(HostEnv, 2) {} Expect body(Runtime::Instance::MemoryInstance *MemInst); }; class EEIGetBlockTimestamp : public EEI { public: EEIGetBlockTimestamp(EVMEnvironment &HostEnv) : EEI(HostEnv, 2) {} Expect body(Runtime::Instance::MemoryInstance *MemInst); }; class EEIGetCallDataSize : public EEI { public: EEIGetCallDataSize(EVMEnvironment &HostEnv) : EEI(HostEnv, 2) {} Expect body(Runtime::Instance::MemoryInstance *MemInst); }; class EEIGetCaller : public EEI { public: EEIGetCaller(EVMEnvironment &HostEnv) : EEI(HostEnv, 2) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint32_t ResultOffset); }; class EEIGetCallValue : public EEI { public: EEIGetCallValue(EVMEnvironment &HostEnv) : EEI(HostEnv, 2) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint32_t ResultOffset); }; class EEIGetCodeSize : public EEI { public: EEIGetCodeSize(EVMEnvironment &HostEnv) : EEI(HostEnv, 2) {} Expect body(Runtime::Instance::MemoryInstance *MemInst); }; class EEIGetExternalBalance : public EEI { public: EEIGetExternalBalance(EVMEnvironment &HostEnv) : EEI(HostEnv, 400) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint32_t AddressOffset, uint32_t ResultOffset); }; class EEIGetExternalCodeSize : public EEI { public: EEIGetExternalCodeSize(EVMEnvironment &HostEnv) : EEI(HostEnv, 700) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint32_t AddressOffset); }; class EEIGetGasLeft : public EEI { public: EEIGetGasLeft(EVMEnvironment &HostEnv) : EEI(HostEnv, 2) {} Expect body(Runtime::Instance::MemoryInstance *MemInst); }; class EEIGetReturnDataSize : public EEI { public: EEIGetReturnDataSize(EVMEnvironment &HostEnv) : EEI(HostEnv, 2) {} Expect body(Runtime::Instance::MemoryInstance *MemInst); }; class EEIGetTxGasPrice : public EEI { public: EEIGetTxGasPrice(EVMEnvironment &HostEnv) : EEI(HostEnv, 2) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint32_t ResultOffset); }; class EEIGetTxOrigin : public EEI { public: EEIGetTxOrigin(EVMEnvironment &HostEnv) : EEI(HostEnv, 2) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint32_t ResultOffset); }; class EEILog : public EEI { public: EEILog(EVMEnvironment &HostEnv) : EEI(HostEnv, 375) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint32_t DataOffset, uint32_t DataLength, uint32_t NumberOfTopics, uint32_t Topic1, uint32_t Topic2, uint32_t Topic3, uint32_t Topic4); }; class EEIReturnDataCopy : public EEI { public: EEIReturnDataCopy(EVMEnvironment &HostEnv) : EEI(HostEnv, 3) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint32_t ResultOffset, uint32_t DataOffset, uint32_t Length); }; class EEIRevert : public EEI { public: EEIRevert(EVMEnvironment &HostEnv) : EEI(HostEnv, 0) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint32_t DataOffset, uint32_t DataLength); }; class EEISelfDestruct : public EEI { public: EEISelfDestruct(EVMEnvironment &HostEnv) : EEI(HostEnv, 5000) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint32_t AddressOffset); }; class EEIStorageLoad : public EEI { public: EEIStorageLoad(EVMEnvironment &HostEnv) : EEI(HostEnv, 200) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint32_t PathOffset, uint32_t ValueOffset); }; class EEIStorageStore : public EEI { public: EEIStorageStore(EVMEnvironment &HostEnv) : EEI(HostEnv, 5000) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint32_t PathOffset, uint32_t ValueOffset); }; class EEIUseGas : public EEI { public: EEIUseGas(EVMEnvironment &HostEnv) : EEI(HostEnv, 0) {} Expect body(Runtime::Instance::MemoryInstance *MemInst, uint64_t Amount); }; } // namespace Host } // namespace SSVM