Skip to content

Commit

Permalink
Merge pull request #438 from superform-xyz/SUP-5255
Browse files Browse the repository at this point in the history
chore: superformfactory and superregistry
  • Loading branch information
0xTimepunk authored Jan 18, 2024
2 parents a36f0df + fcf1533 commit d8ed672
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/unit/super-registry/SuperRegistry.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ contract SuperRegistryTest is BaseSetup {
superRegistry.setRequiredMessagingQuorum(OP, 5);
}

function test_set_delay() public {
function test_setDelay() public {
vm.prank(deployer);
vm.expectRevert(Error.INVALID_TIMELOCK_DELAY.selector);
superRegistry.setDelay(5 minutes);
Expand All @@ -359,6 +359,12 @@ contract SuperRegistryTest is BaseSetup {
superRegistry.setDelay(11 hours);
}

function test_setQuorum_invalid_chainId() public {
vm.prank(deployer);
vm.expectRevert(Error.INVALID_CHAIN_ID.selector);
superRegistry.setRequiredMessagingQuorum(0,2);
}

function test_getAmbId() public {
uint256 ambId_ = superRegistry.getAmbId(getContract(ETH, "LayerzeroImplementation"));
assertEq(ambId_, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,28 @@ contract SuperformFactoryCreateSuperformTest is BaseSetup {
SuperformFactory(getContract(chainId, "SuperformFactory")).getSuperform(superformId);
}

function test_getAllSuperformsFromVault() public {
vm.startPrank(deployer);
vm.selectFork(FORKS[chainId]);
address superRegistry = getContract(chainId, "SuperRegistry");
/// @dev Deploying Forms
address formImplementation = address(new ERC4626Form(superRegistry));
address formImplementation2 = address(new ERC4626Form(superRegistry));

// Deploying Forms Using AddImplementation. Not Testing Reverts As Already Tested
SuperformFactory(getContract(chainId, "SuperformFactory")).addFormImplementation(
formImplementation, 420, 1
);

SuperformFactory(getContract(chainId, "SuperformFactory")).addFormImplementation(
formImplementation2, 69, 1
);

SuperformFactory(getContract(chainId, "SuperformFactory")).createSuperform(420, vault);
SuperformFactory(getContract(chainId, "SuperformFactory")).createSuperform(69, vault);
SuperformFactory(getContract(chainId, "SuperformFactory")).getAllSuperformsFromVault(vault);
}

function test_initializeWithZeroAddressAsset() public {
vm.selectFork(FORKS[chainId]);
address zeroAssetVault = address(new ZeroAssetVault());
Expand Down

0 comments on commit d8ed672

Please sign in to comment.