Skip to content

Commit

Permalink
Escrow updates for ASv2 (#9636)
Browse files Browse the repository at this point in the history
* Implement transferWithTrustedIssuers

* Update transfer and revoke tests

* Implement withdraw and mock tests

* Nits: fix linting, remove some TODOs, reformat text in tests

* Add logic for setting defaultTrustedIssuers

* Simplify transfer logic and docstrings and add unset event

* Reorder escrow functions based on solidity style guide

* Nit remove TODOs

* Use FederatedAttestations instead of MockFA in escrow tests

* Address PR comments

* Remove redundant comments
  • Loading branch information
eelanagaraj authored Jun 16, 2022
1 parent 44cbbee commit b03b482
Show file tree
Hide file tree
Showing 7 changed files with 864 additions and 101 deletions.
8 changes: 8 additions & 0 deletions packages/protocol/contracts/common/UsingRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import "../governance/interfaces/IValidators.sol";

import "../identity/interfaces/IRandom.sol";
import "../identity/interfaces/IAttestations.sol";
import "../identity/interfaces/IFederatedAttestations.sol";

import "../stability/interfaces/IExchange.sol";
import "../stability/interfaces/IReserve.sol";
Expand All @@ -36,6 +37,9 @@ contract UsingRegistry is Ownable {
bytes32 constant FEE_CURRENCY_WHITELIST_REGISTRY_ID = keccak256(
abi.encodePacked("FeeCurrencyWhitelist")
);
bytes32 constant FEDERATED_ATTESTATIONS_REGISTRY_ID = keccak256(
abi.encodePacked("FederatedAttestations")
);
bytes32 constant FREEZER_REGISTRY_ID = keccak256(abi.encodePacked("Freezer"));
bytes32 constant GOLD_TOKEN_REGISTRY_ID = keccak256(abi.encodePacked("GoldToken"));
bytes32 constant GOVERNANCE_REGISTRY_ID = keccak256(abi.encodePacked("Governance"));
Expand Down Expand Up @@ -92,6 +96,10 @@ contract UsingRegistry is Ownable {
return IFeeCurrencyWhitelist(registry.getAddressForOrDie(FEE_CURRENCY_WHITELIST_REGISTRY_ID));
}

function getFederatedAttestations() internal view returns (IFederatedAttestations) {
return IFederatedAttestations(registry.getAddressForOrDie(FEDERATED_ATTESTATIONS_REGISTRY_ID));
}

function getFreezer() internal view returns (IFreezer) {
return IFreezer(registry.getAddressForOrDie(FREEZER_REGISTRY_ID));
}
Expand Down
Loading

0 comments on commit b03b482

Please sign in to comment.