diff --git a/docs/language/accounts.mdx b/docs/language/accounts.mdx index 286ae60d90..e53747aa5c 100644 --- a/docs/language/accounts.mdx +++ b/docs/language/accounts.mdx @@ -377,6 +377,20 @@ to all its stored objects. The path must be a storage path, i.e., only the domain `storage` is allowed. +- `cadence•fun clear(_ path: StoragePath): Bool` + + Clears an object from the account's storage which is stored under the given path + + If there is an object stored, the stored resource or structure is removed from storage, and + destroyed if it is a resource. + + When the function returns, the storage no longer contains an object under the given path. + + The path must be a storage path, i.e., only the domain ` + "`storage`" + ` is allowed. + + The function returns true if a stored object was cleared, and false if no object + was stored under the given path. + - `cadence•fun copy(from: StoragePath): T?` Returns a copy of a structure stored in account storage, without removing it from storage.