diff --git a/neo3/contracts/applicationengine.py b/neo3/contracts/applicationengine.py index 1e1cc7f8..defe64cf 100644 --- a/neo3/contracts/applicationengine.py +++ b/neo3/contracts/applicationengine.py @@ -42,10 +42,10 @@ def __init__(self, self.notifications: List[Tuple[payloads.IVerifiable, types.UInt160, bytes, vm.ArrayStackItem]] = [] if self.snapshot is None or self.snapshot.persisting_block is None or self.snapshot.persisting_block.index == 0: self.exec_fee_factor = contracts.PolicyContract().DEFAULT_EXEC_FEE_FACTOR - self.STORAGE_PRICE = contracts.PolicyContract().DEFAULT_STORAGE_PRICE + self.storage_price = contracts.PolicyContract().DEFAULT_STORAGE_PRICE else: self.exec_fee_factor = contracts.PolicyContract().get_exec_fee_factor(snapshot) - self.STORAGE_PRICE = contracts.PolicyContract().get_storage_price(snapshot) + self.storage_price = contracts.PolicyContract().get_storage_price(snapshot) if isinstance(self.script_container, payloads.Transaction): self.nonce_data = self.script_container.hash().to_array()[:16] diff --git a/neo3/contracts/interop/storage.py b/neo3/contracts/interop/storage.py index 3cd209f1..04df9d71 100644 --- a/neo3/contracts/interop/storage.py +++ b/neo3/contracts/interop/storage.py @@ -91,7 +91,7 @@ def storage_put(engine: contracts.ApplicationEngine, context: storage.StorageCon else: new_data_len = (len(item.value) - 1) // 4 + 1 + len(value) - len(item.value) - engine.add_gas(new_data_len * engine.STORAGE_PRICE) + engine.add_gas(new_data_len * engine.storage_price) item.value = value diff --git a/neo3/contracts/native/management.py b/neo3/contracts/native/management.py index 8da92535..bb585bcf 100644 --- a/neo3/contracts/native/management.py +++ b/neo3/contracts/native/management.py @@ -74,7 +74,7 @@ def contract_create_with_data(self, raise ValueError("Invalid NEF or manifest length") engine.add_gas( - max(engine.STORAGE_PRICE * (nef_len + manifest_len), self.get_minimum_deployment_fee(engine.snapshot)) + max(engine.storage_price * (nef_len + manifest_len), self.get_minimum_deployment_fee(engine.snapshot)) ) nef = contracts.NEF.deserialize_from_bytes(nef_file) @@ -128,7 +128,7 @@ def contract_update_with_data(self, nef_len = 0 if nef_file is None else len(nef_file) manifest_len = 0 if manifest is None else len(manifest) - engine.add_gas(engine.STORAGE_PRICE * (nef_len + manifest_len)) + engine.add_gas(engine.storage_price * (nef_len + manifest_len)) contract = engine.snapshot.contracts.try_get(engine.calling_scripthash, read_only=False) if contract is None: diff --git a/neo3/contracts/native/nativecontract.py b/neo3/contracts/native/nativecontract.py index 5600d3c8..19cec450 100644 --- a/neo3/contracts/native/nativecontract.py +++ b/neo3/contracts/native/nativecontract.py @@ -201,9 +201,9 @@ def invoke(self, engine: contracts.ApplicationEngine, version: int) -> None: raise ValueError(f"Method requires call flag: {method.required_flags} received: {flags}") engine.add_gas(method.cpu_price - * contracts.PolicyContract().get_exec_fee_factor(engine.snapshot) + * engine.exec_fee_factor + method.storage_price - * contracts.PolicyContract().get_storage_price(engine.snapshot)) + * engine.storage_price) params: List[Any] = [] if method.add_engine: