function nativeDomesticAsset(
) public returns (struct AssetRegistry.AssetDefinition assetDefinition)
Return the CAP-native asset definition.
function lookup(
struct AssetRegistry.AssetDefinition assetDefinition
) public returns (address)
Fetch the ERC-20 token address corresponding to the
given asset definition.
Name Type Description
assetDefinition
struct AssetRegistry.AssetDefinition an asset definition
Returns Type Description
⇒ struct AssetRegistry.AssetDefinition ERC-20 address
function isCapeAssetRegistered(
struct AssetRegistry.AssetDefinition assetDefinition
) public returns (bool)
Is the given asset definition registered?
Name Type Description
assetDefinition
struct AssetRegistry.AssetDefinition an asset definition
Returns Type Description
⇒ struct AssetRegistry.AssetDefinition if the asset type is registered, false otherwise.
function sponsorCapeAsset(
address erc20Address,
struct AssetRegistry.AssetDefinition newAsset
) external
Create and register a new asset type associated with an
ERC-20 token. Will revert if the asset type is already
registered or the ERC-20 token address is zero.
Name Type Description
erc20Address
address An ERC-20 token address
newAsset
struct AssetRegistry.AssetDefinition An asset type to be registered in the contract
function _checkForeignAssetCode(
uint256 assetDefinitionCode,
address erc20Address,
address sponsor,
struct AssetRegistry.AssetPolicy policy
) internal
Throws an exception if the asset definition code is
not correctly derived from the ERC-20 address of the token and
the address of the sponsor.
Requires "view" to access msg.sender.
Name Type Description
assetDefinitionCode
uint256 The code of an asset definition
erc20Address
address The ERC-20 address bound to the asset definition
sponsor
address The sponsor address of this wrapped asset
policy
struct AssetRegistry.AssetPolicy asset policy
function _checkDomesticAssetCode(
uint256 assetDefinitionCode,
uint256 internalAssetCode
) internal
Checks if the asset definition code is correctly derived from the internal asset code.
Name Type Description
assetDefinitionCode
uint256 asset definition code
internalAssetCode
uint256 internal asset code
function _computeAssetDescription(
address erc20Address,
address sponsor,
struct AssetRegistry.AssetPolicy policy
) internal returns (bytes)
Compute the asset description from the address of the
ERC-20 token and the address of the sponsor.
Name Type Description
erc20Address
address address of the erc20 token
sponsor
address address of the sponsor
policy
struct AssetRegistry.AssetPolicy asset policy
Returns Type Description
⇒ address asset description
event AssetSponsored(
)