Skip to main content
Version: 0.4.3

Registry.vy

Functions#

setGovernance#

function setGovernance(address)

Starts the 1st phase of the governance transfer.

Throws if the caller is not current governance.

Parameters:#

NameTypeDescription
governance * * The next governance address

acceptGovernance#

function acceptGovernance()

Completes the 2nd phase of the governance transfer.

Throws if the caller is not the pending caller. Emits a NewGovernance event.

latestRelease#

function latestRelease()

Returns the api version of the latest release.

Throws if no releases are registered yet.

Return Values:#

Description
The api version of the latest release.

latestVault#

function latestVault(address)

Returns the latest deployed vault for the given token.

Throws if no vaults are endorsed yet for the given token.

Parameters:#

NameTypeDescription
token * * The token address to find the latest vault for.

Return Values:#

Description
The address of the latest vault for the given token.

newRelease#

function newRelease(address)

Add a previously deployed Vault as the template contract for the latest release, to be used by further "forwarder-style" delegatecall proxy contracts that can be deployed from the registry throw other methods (to save gas).

Throws if caller isn't self.governance. Throws if vault's governance isn't self.governance. Throws if the api version is the same as the previous release. Emits a NewVault event.

Parameters:#

NameTypeDescription
vault * * The vault that will be used as the template contract for the next release.

newVault#

function newVault(address,address,address,string,string)

Create a new vault for the given token using the latest release in the registry, as a simple "forwarder-style" delegatecall proxy to the latest release. Also adds the new vault to the list of "endorsed" vaults for that token.

governance is set in the new vault as self.governance, with no ability to override. Throws if caller isn't self.governance. Throws if no releases are registered yet. Throws if there already is a registered vault for the given token with the latest api version. Emits a NewVault event.

Parameters:#

NameTypeDescription
token * * The token that may be deposited into the new Vault.
guardian * * The address authorized for guardian interactions in the new Vault.
rewards * * The address to use for collecting rewards in the new Vault
name * * Specify a custom Vault name. Set to empty string for default choice.
symbol * * Specify a custom Vault symbol name. Set to empty string for default choice.
releaseDelta * * Specify the number of releases prior to the latest to use as a target. Default is latest.

Return Values:#

Description
The address of the newly-deployed vault

newVault#

function newVault(address,address,address,string,string,uint256)

governance is set in the new vault as self.governance, with no ability to override. Throws if caller isn't self.governance. Throws if no releases are registered yet. Throws if there already is a registered vault for the given token with the latest api version. Emits a NewVault event.

Parameters:#

NameTypeDescription
token * * The token that may be deposited into the new Vault.
guardian * * The address authorized for guardian interactions in the new Vault.
rewards * * The address to use for collecting rewards in the new Vault
name * * Specify a custom Vault name. Set to empty string for default choice.
symbol * * Specify a custom Vault symbol name. Set to empty string for default choice.
releaseDelta * * Specify the number of releases prior to the latest to use as a target. Default is latest.

Return Values:#

Description
The address of the newly-deployed vault

newExperimentalVault#

function newExperimentalVault(address,address,address,address,string,string)

Create a new vault for the given token using the latest release in the registry, as a simple "forwarder-style" delegatecall proxy to the latest release. Does not add the new vault to the list of "endorsed" vaults for that token.

Throws if no releases are registered yet. Emits a NewExperimentalVault event.

Parameters:#

NameTypeDescription
token * * The token that may be deposited into the new Vault.
governance * * The address authorized for governance interactions in the new Vault.
guardian * * The address authorized for guardian interactions in the new Vault.
rewards * * The address to use for collecting rewards in the new Vault
name * * Specify a custom Vault name. Set to empty string for default choice.
symbol * * Specify a custom Vault symbol name. Set to empty string for default choice.
releaseDelta * * Specify the number of releases prior to the latest to use as a target. Default is latest.

Return Values:#

Description
The address of the newly-deployed vault

newExperimentalVault#

function newExperimentalVault(address,address,address,address,string,string,uint256)

Throws if no releases are registered yet. Emits a NewExperimentalVault event.

Parameters:#

NameTypeDescription
token * * The token that may be deposited into the new Vault.
governance * * The address authorized for governance interactions in the new Vault.
guardian * * The address authorized for guardian interactions in the new Vault.
rewards * * The address to use for collecting rewards in the new Vault
name * * Specify a custom Vault name. Set to empty string for default choice.
symbol * * Specify a custom Vault symbol name. Set to empty string for default choice.
releaseDelta * * Specify the number of releases prior to the latest to use as a target. Default is latest.

Return Values:#

Description
The address of the newly-deployed vault

endorseVault#

function endorseVault(address)

Adds an existing vault to the list of "endorsed" vaults for that token.

governance is set in the new vault as self.governance, with no ability to override. Throws if caller isn't self.governance. Throws if vault's governance isn't self.governance. Throws if no releases are registered yet. Throws if vault's api version does not match latest release. Throws if there already is a deployment for the vault's token with the latest api version. Emits a NewVault event.

Parameters:#

NameTypeDescription
vault * * The vault that will be endorsed by the Registry.
releaseDelta * * Specify the number of releases prior to the latest to use as a target. Default is latest.

endorseVault#

function endorseVault(address,uint256)

governance is set in the new vault as self.governance, with no ability to override. Throws if caller isn't self.governance. Throws if vault's governance isn't self.governance. Throws if no releases are registered yet. Throws if vault's api version does not match latest release. Throws if there already is a deployment for the vault's token with the latest api version. Emits a NewVault event.

Parameters:#

NameTypeDescription
vault * * The vault that will be endorsed by the Registry.
releaseDelta * * Specify the number of releases prior to the latest to use as a target. Default is latest.

setBanksy#

function setBanksy(address)

Set the ability of a particular tagger to tag current vaults.

Throws if caller is not self.governance.

Parameters:#

NameTypeDescription
tagger * * The address to approve or deny access to tagging.
allowed * * Whether to approve or deny tagger. Defaults to approve.

setBanksy#

function setBanksy(address,bool)

Throws if caller is not self.governance.

Parameters:#

NameTypeDescription
tagger * * The address to approve or deny access to tagging.
allowed * * Whether to approve or deny tagger. Defaults to approve.

tagVault#

function tagVault(address,string)

Tag a Vault with a message.

Throws if caller is not self.governance or an approved tagger. Emits a VaultTagged event.

Parameters:#

NameTypeDescription
vault * * The address to tag with the given tag message.
tag * * The message to tag vault with.

Events#

NewRelease

  • release_id : uint256, indexed
  • template : address, notIndexed
  • api_version : string, notIndexed

NewVault

  • token : address, indexed
  • vault_id : uint256, indexed
  • vault : address, notIndexed
  • api_version : string, notIndexed

NewExperimentalVault

  • token : address, indexed
  • deployer : address, indexed
  • vault : address, notIndexed
  • api_version : string, notIndexed

NewGovernance

  • governance : address, notIndexed

VaultTagged

  • vault : address, notIndexed
  • tag : string, notIndexed