Skip to content

Commit

Permalink
Clean up file
Browse files Browse the repository at this point in the history
  • Loading branch information
hieronx committed Aug 13, 2024
1 parent 3ccba56 commit 9193a3d
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/factories/AggregatorV3OracleFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,18 @@ contract VaultOracle is Auth, IAggregatorV3 {
// --- Administration ---
function file(bytes32 what, address data) public auth {
if (what == "vault") {
_updateVault(data);
require(
address(vault) == address(0)
|| (IERC7540Vault(data).share() == vault.share() && IERC7540Vault(data).asset() == vault.asset()),
"VaultOracle/mismatching-asset-or-share"
);
vault = IERC7540Vault(data);
emit File(what, data);
} else {
revert("VaultOracle/file-unrecognized-param");
}
}

function _updateVault(address vault_) internal {
IERC7540Vault newVault = IERC7540Vault(vault_);
require(
address(vault) == address(0) || (vault.share() == newVault.share() && vault.asset() == newVault.asset()),
"VaultOracle/mismatching-asset-or-share"
);

vault = newVault;
}

// --- Price computation ---
function latestRoundData()
public
Expand Down

0 comments on commit 9193a3d

Please sign in to comment.