def get_call_params(self, computation: ComputationAPI) -> CallParams: gas = computation.stack_pop1_int() to = force_bytes_to_address(computation.stack_pop1_bytes()) ( value, memory_input_start_position, memory_input_size, memory_output_start_position, memory_output_size, ) = computation.stack_pop_ints(5) return ( gas, value, to, None, # sender None, # code_address memory_input_start_position, memory_input_size, memory_output_start_position, memory_output_size, True, # should_transfer_value, computation.msg.is_static, )
def get_call_params(self, computation: ComputationAPI) -> CallParams: gas = computation.stack_pop1_int() code_address = force_bytes_to_address(computation.stack_pop1_bytes()) ( memory_input_start_position, memory_input_size, memory_output_start_position, memory_output_size, ) = computation.stack_pop_ints(4) to = computation.msg.storage_address sender = computation.msg.sender value = computation.msg.value return ( gas, value, to, sender, code_address, memory_input_start_position, memory_input_size, memory_output_start_position, memory_output_size, False, # should_transfer_value, computation.msg.is_static, )
def sload_eip2929(computation: ComputationAPI) -> None: slot = computation.stack_pop1_int() if _mark_storage_warm(computation, slot): gas_cost = berlin_constants.COLD_SLOAD_COST else: gas_cost = berlin_constants.WARM_STORAGE_READ_COST computation.consume_gas(gas_cost, reason=mnemonics.SLOAD) value = computation.state.get_storage( address=computation.msg.storage_address, slot=slot, ) computation.stack_push_int(value)