-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Slight improvements to Registry (#412)
Signed-off-by: Roz Stengle <rosalind.stengle@gmail.com>
- Loading branch information
1 parent
1cabec5
commit 5cdc6e2
Showing
4 changed files
with
43 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,35 @@ | ||
/* | ||
Registry Interface | ||
*/ | ||
pragma solidity ^0.5.0; | ||
|
||
pragma experimental ABIEncoderV2; | ||
|
||
|
||
/** | ||
* @title Interface for a registry of derivatives and derivative creators | ||
*/ | ||
interface RegistryInterface { | ||
struct RegisteredDerivative { | ||
address derivativeAddress; | ||
address derivativeCreator; | ||
} | ||
|
||
// Registers a new derivative. Only authorized derivative creators can call this method. | ||
/** | ||
* @dev Registers a new derivative. Only authorized derivative creators can call this method. | ||
*/ | ||
function registerDerivative(address[] calldata counterparties, address derivativeAddress) external; | ||
|
||
// Returns whether the derivative has been registered with the registry (and is therefore an authorized participant | ||
// in the UMA system). | ||
/** | ||
* @dev Returns whether the derivative has been registered with the registry (and is therefore an authorized | ||
* participant in the UMA system). | ||
*/ | ||
function isDerivativeRegistered(address derivative) external view returns (bool isRegistered); | ||
|
||
// Returns a list of all derivatives that are associated with a particular party. | ||
/** | ||
* @dev Returns a list of all derivatives that are associated with a particular party. | ||
*/ | ||
function getRegisteredDerivatives(address party) external view returns (RegisteredDerivative[] memory derivatives); | ||
|
||
// Returns all registered derivatives. | ||
/** | ||
* @dev Returns all registered derivatives. | ||
*/ | ||
function getAllRegisteredDerivatives() external view returns (RegisteredDerivative[] memory derivatives); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const Registry = artifacts.require("Registry"); | ||
const { getKeysForNetwork, deployAndGet, addToTdr } = require("../../common/MigrationUtils.js"); | ||
|
||
module.exports = async function(deployer, network, accounts) { | ||
const keys = getKeysForNetwork(network, accounts); | ||
|
||
const registry = await deployAndGet(deployer, Registry, { from: keys.deployer }); | ||
await addToTdr(registry, network); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters