Skip to content

TransientStorageLib usage #761

@BZAghalarov

Description

@BZAghalarov

Hi,

There are some functions use TransientStorageLib's tstore, tload functions.
What is the advantage of these functions over the classical methods ?

For example rather than saving temporary value we can set permanent value and read it from memory.

function overridePricePoolPerAsset(PoolId poolId, ShareClassId scId, AssetId assetId, D18 value)
external
payable
isManager(poolId)
{
TransientStorageLib.tstore(keccak256(abi.encode("pricePoolPerAsset", poolId, scId, assetId)), value.raw());
TransientStorageLib.tstore(keccak256(abi.encode("pricePoolPerAssetIsSet", poolId, scId, assetId)), true);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions