Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/clarity #81

Merged
merged 5 commits into from
Dec 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
cleaned up PCR
Arvolear committed Dec 17, 2023
commit dbcbf3b2cb9f8462a154fda5456fd87065a154e5
Original file line number Diff line number Diff line change
@@ -48,6 +48,16 @@ abstract contract AbstractPoolContractsRegistry is Initializable, AbstractDepend
_contractsRegistry = contractsRegistry_;
}

/**
* @notice The function to add new pools into the registry. Gets called from PoolFactory
*
* Proper only factory access control must be added in descending contracts + `_addProxyPool()` should be called inside.
*
* @param name_ the pool's associated name
* @param poolAddress_ the proxy address of the pool
*/
function addProxyPool(string memory name_, address poolAddress_) public virtual;

/**
* @notice The function to get implementation of the specific pools
* @param name_ the name of the pools
Original file line number Diff line number Diff line change
@@ -74,11 +74,7 @@ abstract contract AbstractPoolFactory is AbstractDependant {
string memory poolType_,
address poolProxy_
) internal virtual {
(bool success, ) = poolRegistry_.call(
abi.encodeWithSignature("addProxyPool(string,address)", poolType_, poolProxy_)
);

require(success, "AbstractPoolFactory: failed to register contract");
AbstractPoolContractsRegistry(poolRegistry_).addProxyPool(poolType_, poolProxy_);
}

/**
Original file line number Diff line number Diff line change
@@ -39,6 +39,4 @@ abstract contract MultiOwnablePoolContractsRegistry is
) external onlyOwner {
_injectDependenciesToExistingPoolsWithData(name_, data_, offset_, limit_);
}

function addProxyPool(string memory name_, address poolAddress_) public virtual;
}
Original file line number Diff line number Diff line change
@@ -40,6 +40,4 @@ abstract contract OwnablePoolContractsRegistry is
) external onlyOwner {
_injectDependenciesToExistingPoolsWithData(name_, data_, offset_, limit_);
}

function addProxyPool(string memory name_, address poolAddress_) public virtual;
}
Original file line number Diff line number Diff line change
@@ -107,7 +107,7 @@ describe("PoolFactory", () => {
await contractsRegistry.addContract(await contractsRegistry.POOL_FACTORY_NAME(), OWNER);
await contractsRegistry.injectDependencies(await contractsRegistry.POOL_CONTRACTS_REGISTRY_NAME());

await expect(poolFactory.deployPool()).to.be.revertedWith("AbstractPoolFactory: failed to register contract");
await expect(poolFactory.deployPool()).to.be.revertedWith("PoolContractsRegistry: not a factory");
});

it("should deploy several pools", async () => {