PackageDB¶
-
contract
PackageDB
is Authorized¶ Title: Database contract for a package index package data. Author: Tim Coulter <tim.coulter@consensys.net>, Piper Merriam <pipermerriam@gmail.com> -
mapping (bytes32 => Package)
_recordedPackages
¶
-
IndexedOrderedSetLib.IndexedOrderedSet
_allPackageNameHashes
¶
-
event
PackageOwnerUpdate
(bytes32 indexed nameHash, address indexed oldOwner, address indexed newOwner)¶
¶
-
function
setPackage
(string name)¶
public
auth
returns (bool)
¶ Creates or updates a release for a package. Returns success.
Parameters: - name – Package name
-
function
removePackage
(bytes32 nameHash, string reason)¶
public
auth
onlyIfPackageExists(nameHash)
returns (bool)
¶ Removes a package from the package db. Packages with existing releases may not be removed. Returns success.
Parameters: - nameHash – The name hash of a package.
-
function
setPackageOwner
(bytes32 nameHash, address newPackageOwner)¶
public
auth
onlyIfPackageExists(nameHash)
returns (bool)
¶ Sets the owner of a package to the provided address. Returns success.
Parameters: - nameHash – The name hash of a package.
- newPackageOwner – The address of the new owner.
-
function
packageExists
(bytes32 nameHash)¶
public
view
returns (bool)
¶ Query the existence of a package with the given name. Returns boolean indicating whether the package exists.
Parameters: - nameHash – The name hash of a package.
-
function
getPackageNameHash
(uint idx)¶
public
view
returns (bytes32)
¶ Returns package namehash at the provided index from the set of all known name hashes.
Parameters: - idx – The index of the package name hash to retrieve.
-
function
getPackageData
(bytes32 nameHash)¶
public
view
onlyIfPackageExists(nameHash)
returns (address packageOwner, uint createdAt, uint updatedAt)
¶ Returns information about the package.
Parameters: - nameHash – The name hash to look up.
-
function
getPackageName
(bytes32 nameHash)¶
public
view
onlyIfPackageExists(nameHash)
returns (string)
¶ Returns the package name for the given namehash
Parameters: - nameHash – The name hash to look up.
-
mapping (bytes32 => Package)