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: add proveCashierShard and proveCashierRoot checks #18

Merged
merged 22 commits into from
Nov 4, 2024

Conversation

ihoroleksiienko
Copy link
Contributor

@ihoroleksiienko ihoroleksiienko commented Oct 28, 2024

Main changes

Implemented proveCashierShard and proveCashierRoot validation checks in CashierShard and Cashier contracts to verify whether a provided address corresponds to a valid CashierShard or Cashier instance.

New declarations

ICashier interface:

    /**
     * @dev Proves that the contract is the cashier root contract.
     */
    function proveCashierRoot() external pure;

ICashierShard interface:

    /**
     * @dev Proves that the contract is the cashier shard contract.
     */
    function proveCashierShard() external pure;

Test coverage

New functionality was fully covered by tests.

Coverage details
File % Stmts % Branch % Funcs % Lines
contracts/ 100.00 97.75 100.00 100
├─ Cashier.sol 100.00 98.53 100.00 100
├─ CashierShard.sol 100.00 95.24 100.00 100
├─ CashierShardStorage.sol 100.00 100.00 100.00 100.00
├─ CashierStorage.sol 100.00 100.00 100.00 100.00
contracts/base/ 100.00 100.00 100.00 100.00
├─ AccessControlExtUpgradeable.sol 100.00 100.00 100.00 100.00
├─ PausableExtUpgradeable.sol 100.00 100.00 100.00 100.00
├─ RescuableUpgradeable.sol 100.00 100.00 100.00 100.00
contracts/interfaces/ 100.00 100.00 100.00 100.00
├─ ICashier.sol 100.00 100.00 100.00 100.00
├─ ICashierHook.sol 100.00 100.00 100.00 100.00
├─ ICashierHookable.sol 100.00 100.00 100.00 100.00
├─ ICashierShard.sol 100.00 100.00 100.00 100.00
├─ ICashierTypes.sol 100.00 100.00 100.00 100.00
├─ IERC20Mintable.sol 100.00 100.00 100.00 100.00
contracts/mocks/ 100.00 100.00 100.00 100.00
├─ CashierHookMock.sol 100.00 100.00 100.00 100.00
├─ CashierShardMock.sol 100.00 100.00 100.00 100.00
contracts/mocks/base/ 100.00 100.00 100.00 100.00
├─ AccessControlExtUpgradeableMock.sol 100.00 100.00 100.00 100.00
├─ PausableExtUpgradeableMock.sol 100.00 100.00 100.00 100.00
├─ RescuableUpgradeableMock.sol 100.00 100.00 100.00 100.00
contracts/mocks/tokens/ 100.00 100.00 100.00 100.00
├─ ERC20TokenMock.sol 100.00 100.00 100.00 100.00
--------------------------------------- --------- ---------- --------- ---------
All files 100.00 98.06 100.00 100
--------------------------------------- --------- ---------- --------- ---------

@ihoroleksiienko ihoroleksiienko changed the title feat: add isShard and isRoot checks feat: add isCashierShard and isCashierRoot checks Oct 29, 2024
@igorsenych-cw igorsenych-cw changed the title feat: add isCashierShard and isCashierRoot checks feat: add proveCashierShard and proveCashierRoot checks Nov 4, 2024
@igorsenych-cw igorsenych-cw merged commit c3461fb into main Nov 4, 2024
6 checks passed
@igorsenych-cw igorsenych-cw deleted the feat/add-contract-determinant branch November 4, 2024 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants