Skip to content

Commit

Permalink
feat: added overflow test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishabh Sharma committed Aug 28, 2023
1 parent 759e7ec commit 67b6b46
Showing 1 changed file with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1934,6 +1934,43 @@ describe('Royalty', function () {
)
).to.be.revertedWith('Manager: No splitter deployed for the creator');
});

it('should revert on for overflow for try mul in splitter contract', async function () {
const {
ERC1155,
deployer,
seller,
royaltyReceiver,
RoyaltyManagerContract,
} = await royaltyDistribution();
await ERC1155.connect(deployer).mint(
seller.address,
1,
1,
royaltyReceiver.address,
'0x'
);
const TestERC20Factory = await ethers.getContractFactory(
'OverflowTestERC20'
);
const OverflowERC20 = await TestERC20Factory.deploy();

const splitter = await RoyaltyManagerContract._creatorRoyaltiesSplitter(
deployer.address
);

const splitterContract = await ethers.getContractAt(
splitterAbi,
splitter
);

await OverflowERC20.mintMax(splitter);
await expect(
splitterContract
.connect(royaltyReceiver)
.splitERC20Tokens(OverflowERC20.address)
).to.be.revertedWith('RoyaltySplitter: Multiplication Overflow');
});
});

describe('Interfaces', function () {
Expand Down

1 comment on commit 67b6b46

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage for this commit

96.86%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
packages/asset/contracts
   Asset.sol94.53%89.58%96.43%98.08%103, 188, 293, 293–294, 65
   AssetCreate.sol94.51%83.33%100%100%130, 132, 165, 281, 68
   AssetReveal.sol94.35%86.21%96.55%98.89%143, 147, 181, 376, 416, 424, 441, 75, 98
   AuthSuperValidator.sol100%100%100%100%
   Catalyst.sol94.81%91.94%95.24%98.08%125, 127, 140, 152, 223, 80
packages/asset/contracts/interfaces
   IAsset.sol100%100%100%100%
   IAssetCreate.sol100%100%100%100%
   IAssetReveal.sol100%100%100%100%
   ICatalyst.sol100%100%100%100%
   ITokenUtils.sol100%100%100%100%
packages/asset/contracts/libraries
   TokenIdUtils.sol100%100%100%100%
packages/dependency-metatx/contracts
   ERC2771Handler.sol100%100%100%100%
   ERC2771HandlerAbstract.sol100%100%100%100%
   ERC2771HandlerUpgradeable.sol95.45%83.33%100%100%43
packages/dependency-metatx/contracts/test
   ERC2771HandlerTest.sol100%100%100%100%
   ERC2771HandlerUpgradeableTest.sol100%100%100%100%
   MockTrustedForwarder.sol0%0%0%0%15, 18–19, 19, 19–20
packages/dependency-operator-filter/contracts
   OperatorFiltererUpgradeable.sol88.64%85%100%90%15, 49–50, 59–60
   OperatorFilterSubscription.sol60%50%100%50%19–20
packages/dependency-operator-filter/contracts/interfaces
   IOperatorFilterRegistry.sol100%100%100%100%
packages/dependency-royalty-management/contracts
   MultiRoyaltyDistributor.sol88.71%62.50%100%97.44%100, 107, 40, 40, 40, 40, 69
   RoyaltyDistributor.sol90.91%50%100%100%45
   RoyaltyManager.sol96.10%87.50%100%100%41, 91, 97
   RoyaltySplitter.sol90.10%75%91.67%94.20%107, 147, 168, 177, 181, 209, 56, 63, 78
packages/dependency-royalty-management/contracts/interfaces
   IERC20Approve.sol100%100%100%100%
   IMultiRoyaltyDistributor.sol100%100%100%100%
   IMultiRoyaltyRecipients.sol100%100%100%100%
   IRoyaltyManager.sol100%100%100%100%
   IRoyaltyUGC.sol100%100%100%100%

Please sign in to comment.