From 4ebb8e2eabab0601891fd8191b56cc4b44302031 Mon Sep 17 00:00:00 2001 From: r4bbit <445106+0x-r4bbit@users.noreply.github.com> Date: Fri, 7 Nov 2025 15:36:16 +0100 Subject: [PATCH 1/2] chore: extend deploy protocol script with simpleKarmaDistributor --- status-network-contracts/.gas-report | 778 +++++++++++++++++- status-network-contracts/.gas-snapshot | 350 +++++++- .../script/DeployProtocol.s.sol | 35 +- .../script/DeploySimpleKarmaDistributor.s.sol | 2 +- 4 files changed, 1156 insertions(+), 9 deletions(-) diff --git a/status-network-contracts/.gas-report b/status-network-contracts/.gas-report index 0014b2e511..0a2ecf139f 100644 --- a/status-network-contracts/.gas-report +++ b/status-network-contracts/.gas-report @@ -1,4 +1,138 @@ +╭-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╮ +| lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol:ERC1967Proxy Contract | | | | | | ++==================================================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| 267150 | 1438 | | | | | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| | | | | | | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| GUARDIAN_ROLE | 5169 | 5169 | 5169 | 5169 | 46 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| MAX_MULTIPLIER | 5212 | 5212 | 5212 | 5212 | 4 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| MIN_LOCKUP_PERIOD | 5170 | 5170 | 5170 | 5170 | 1 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| OPERATOR_ROLE | 5166 | 5166 | 5166 | 5166 | 2 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| emergencyModeEnabled | 7271 | 7271 | 7271 | 7271 | 256 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| enableEmergencyMode | 53706 | 53706 | 53706 | 53706 | 257 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| fallback | 5123 | 72193 | 51498 | 376118 | 4967 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| getAccountVaults | 10122 | 10122 | 10122 | 10122 | 4 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| getVault | 18585 | 18585 | 18585 | 18585 | 4091 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| grantRole | 56298 | 56321 | 56322 | 56322 | 48 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| lastRewardTime | 7290 | 7290 | 7290 | 7290 | 3 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| mint | 82652 | 82652 | 82652 | 82652 | 1 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| mintedSupply | 7267 | 7267 | 7267 | 7267 | 1 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| mpAccruedOf | 7537 | 7537 | 7537 | 7537 | 12 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| mpBalanceOf | 9869 | 13647 | 15268 | 15268 | 12 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| pause | 32844 | 44525 | 44525 | 56206 | 4 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| redeemRewards | 28971 | 125811 | 136460 | 147140 | 260 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| rewardAmount | 7288 | 7288 | 7288 | 7288 | 4 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| rewardEndTime | 7313 | 7313 | 7313 | 7313 | 4 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| rewardStartTime | 7313 | 7313 | 7313 | 7313 | 4 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| rewardsBalanceOf | 25160 | 29672 | 30773 | 30994 | 268 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| rewardsBalanceOfAccount | 7469 | 29616 | 30004 | 30114 | 265 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| setReward | 33125 | 33125 | 33125 | 33125 | 1 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| setRewardsSupplier | 52252 | 56479 | 56663 | 56663 | 48 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| setTrustedCodehash | 53031 | 53031 | 53031 | 53031 | 46 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| totalMP | 11689 | 13141 | 13141 | 14594 | 6 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| totalMPAccrued | 7268 | 7268 | 7268 | 7268 | 4088 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| totalMPStaked | 7268 | 7268 | 7268 | 7268 | 4094 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| totalMaxMP | 7290 | 7290 | 7290 | 7290 | 4088 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| totalRewardsAccrued | 7290 | 7290 | 7290 | 7290 | 5 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| totalRewardsSupply | 7242 | 13387 | 13881 | 16786 | 1075 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| totalShares | 9502 | 9502 | 9502 | 9502 | 6 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| totalStaked | 7291 | 7291 | 7291 | 7291 | 4094 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| unpause | 34283 | 34283 | 34283 | 34283 | 1 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| updateGlobalState | 106119 | 106119 | 106119 | 106119 | 1 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| updateVault | 60403 | 62325 | 60403 | 139034 | 1008 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| upgradeTo | 39110 | 39110 | 39110 | 39110 | 1 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| upgradeToAndCall | 29762 | 29762 | 29762 | 29762 | 1 | +|-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| vaultShares | 9757 | 9757 | 9757 | 9757 | 12 | +╰-------------------------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╯ + +╭-----------------------------------------------------+-----------------+---------+---------+---------+---------╮ +| script/DeployKarma.s.sol:DeployKarmaScript Contract | | | | | | ++===============================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|-----------------------------------------------------+-----------------+---------+---------+---------+---------| +| 6899314 | 33011 | | | | | +|-----------------------------------------------------+-----------------+---------+---------+---------+---------| +| | | | | | | +|-----------------------------------------------------+-----------------+---------+---------+---------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|-----------------------------------------------------+-----------------+---------+---------+---------+---------| +| getDeployer | 2306 | 2306 | 2306 | 2306 | 1 | +|-----------------------------------------------------+-----------------+---------+---------+---------+---------| +| runForTest | 5992550 | 5992550 | 5992550 | 5992550 | 290 | +╰-----------------------------------------------------+-----------------+---------+---------+---------+---------╯ + +╭-------------------------------------------------------------------+-----------------+---------+---------+---------+---------╮ +| script/DeployKarmaAirdrop.s.sol:DeployKarmaAirdropScript Contract | | | | | | ++=============================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| 3619345 | 17786 | | | | | +|-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| | | | | | | +|-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| runForTest | 2716159 | 2716159 | 2716159 | 2716159 | 14 | +╰-------------------------------------------------------------------+-----------------+---------+---------+---------+---------╯ + +╭-----------------------------------------------------------+-----------------+---------+---------+---------+---------╮ +| script/DeployKarmaNFT.s.sol:DeployKarmaNFTScript Contract | | | | | | ++=====================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|-----------------------------------------------------------+-----------------+---------+---------+---------+---------| +| 3234069 | 15962 | | | | | +|-----------------------------------------------------------+-----------------+---------+---------+---------+---------| +| | | | | | | +|-----------------------------------------------------------+-----------------+---------+---------+---------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|-----------------------------------------------------------+-----------------+---------+---------+---------+---------| +| runForTest | 2475901 | 2475901 | 2475901 | 2475901 | 10 | +╰-----------------------------------------------------------+-----------------+---------+---------+---------+---------╯ + ╭---------------------------------------------------------------+-----------------+---------+---------+---------+---------╮ | script/DeployKarmaTiers.s.sol:DeployKarmaTiersScript Contract | | | | | | +=========================================================================================================================+ @@ -13,6 +147,76 @@ | runForTest | 2681644 | 2681644 | 2681644 | 2681644 | 9 | ╰---------------------------------------------------------------+-----------------+---------+---------+---------+---------╯ +╭-----------------------------------------------------------------------------+-----------------+---------+---------+---------+---------╮ +| script/DeployMetadataGenerator.s.sol:DeployMetadataGeneratorScript Contract | | | | | | ++=======================================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|-----------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| 4059435 | 19137 | | | | | +|-----------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| | | | | | | +|-----------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|-----------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| runForTest | 2921800 | 2921800 | 2921800 | 2921800 | 3 | +╰-----------------------------------------------------------------------------+-----------------+---------+---------+---------+---------╯ + +╭-----------------------------------------------------------+-----------------+----------+----------+----------+---------╮ +| script/DeployProtocol.s.sol:DeployProtocolScript Contract | | | | | | ++========================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|-----------------------------------------------------------+-----------------+----------+----------+----------+---------| +| 34028529 | 164551 | | | | | +|-----------------------------------------------------------+-----------------+----------+----------+----------+---------| +| | | | | | | +|-----------------------------------------------------------+-----------------+----------+----------+----------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|-----------------------------------------------------------+-----------------+----------+----------+----------+---------| +| runForTest | 16305019 | 16305019 | 16305019 | 16305019 | 8 | +╰-----------------------------------------------------------+-----------------+----------+----------+----------+---------╯ + +╭---------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------╮ +| script/DeploySimpleKarmaDistributor.s.sol:DeploySimpleKarmaDistributorScript Contract | | | | | | ++=================================================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|---------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| 4654303 | 22576 | | | | | +|---------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| | | | | | | +|---------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|---------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| deploy | 1967814 | 1967814 | 1967814 | 1967814 | 12 | +╰---------------------------------------------------------------------------------------+-----------------+---------+---------+---------+---------╯ + +╭-------------------------------------------------------------------+-----------------+---------+---------+---------+---------╮ +| script/DeployStakeManager.s.sol:DeployStakeManagerScript Contract | | | | | | ++=============================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| 6907628 | 33045 | | | | | +|-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| | | | | | | +|-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| runForTest | 5807847 | 5807847 | 5807847 | 5807847 | 104 | +╰-------------------------------------------------------------------+-----------------+---------+---------+---------+---------╯ + +╭-------------------------------------------------------------------+-----------------+---------+---------+---------+---------╮ +| script/DeployVaultFactory.s.sol:DeployVaultFactoryScript Contract | | | | | | ++=============================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| 4818098 | 23383 | | | | | +|-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| | | | | | | +|-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|-------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| runForTest | 3950979 | 3950979 | 3950979 | 3950979 | 104 | +╰-------------------------------------------------------------------+-----------------+---------+---------+---------+---------╯ + ╭---------------------------------------------------------+-----------------+------+--------+------+---------╮ | script/DeploymentConfig.s.sol:DeploymentConfig Contract | | | | | | +============================================================================================================+ @@ -24,9 +228,171 @@ |---------------------------------------------------------+-----------------+------+--------+------+---------| | Function Name | Min | Avg | Median | Max | # Calls | |---------------------------------------------------------+-----------------+------+--------+------+---------| -| activeNetworkConfig | 4455 | 4455 | 4455 | 4455 | 9 | +| activeNetworkConfig | 455 | 3473 | 4455 | 4455 | 424 | ╰---------------------------------------------------------+-----------------+------+--------+------+---------╯ +╭---------------------------------------------------------------------+-----------------+---------+---------+---------+---------╮ +| script/UpgradeStakeManager.s.sol:UpgradeStakeManagerScript Contract | | | | | | ++===============================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|---------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| 6491320 | 31116 | | | | | +|---------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| | | | | | | +|---------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|---------------------------------------------------------------------+-----------------+---------+---------+---------+---------| +| runWithAdminAndProxy | 3843973 | 3843973 | 3843973 | 3843973 | 3 | +╰---------------------------------------------------------------------+-----------------+---------+---------+---------+---------╯ + +╭------------------------------+-----------------+--------+--------+--------+---------╮ +| src/Karma.sol:Karma Contract | | | | | | ++=====================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|------------------------------+-----------------+--------+--------+--------+---------| +| 4266351 | 19767 | | | | | +|------------------------------+-----------------+--------+--------+--------+---------| +| | | | | | | +|------------------------------+-----------------+--------+--------+--------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|------------------------------+-----------------+--------+--------+--------+---------| +| DEFAULT_ADMIN_ROLE | 262 | 262 | 262 | 262 | 34 | +|------------------------------+-----------------+--------+--------+--------+---------| +| DOMAIN_SEPARATOR | 4866 | 4866 | 4866 | 4866 | 5 | +|------------------------------+-----------------+--------+--------+--------+---------| +| MIN_SLASH_AMOUNT | 308 | 308 | 308 | 308 | 1 | +|------------------------------+-----------------+--------+--------+--------+---------| +| OPERATOR_ROLE | 283 | 283 | 283 | 283 | 2 | +|------------------------------+-----------------+--------+--------+--------+---------| +| SLASHER_ROLE | 262 | 262 | 262 | 262 | 31 | +|------------------------------+-----------------+--------+--------+--------+---------| +| actualTokenBalanceOf | 2685 | 2685 | 2685 | 2685 | 12 | +|------------------------------+-----------------+--------+--------+--------+---------| +| addRewardDistributor | 29953 | 63027 | 70881 | 70881 | 510 | +|------------------------------+-----------------+--------+--------+--------+---------| +| allowance | 573 | 573 | 573 | 573 | 12 | +|------------------------------+-----------------+--------+--------+--------+---------| +| allowedToTransfer | 2609 | 2609 | 2609 | 2609 | 1 | +|------------------------------+-----------------+--------+--------+--------+---------| +| approve | 431 | 431 | 431 | 431 | 12 | +|------------------------------+-----------------+--------+--------+--------+---------| +| balanceOf | 20280 | 32321 | 23447 | 48649 | 591 | +|------------------------------+-----------------+--------+--------+--------+---------| +| balanceOfRewardDistributor | 4933 | 4933 | 4933 | 4933 | 518 | +|------------------------------+-----------------+--------+--------+--------+---------| +| calculateSlashAmount | 2763 | 2793 | 2804 | 2804 | 260 | +|------------------------------+-----------------+--------+--------+--------+---------| +| checkpoints | 5085 | 5085 | 5085 | 5085 | 6 | +|------------------------------+-----------------+--------+--------+--------+---------| +| delegate | 7028 | 57010 | 73864 | 88811 | 17 | +|------------------------------+-----------------+--------+--------+--------+---------| +| delegateBySig | 726 | 52457 | 44817 | 104940 | 6 | +|------------------------------+-----------------+--------+--------+--------+---------| +| delegates | 2678 | 2678 | 2678 | 2678 | 8 | +|------------------------------+-----------------+--------+--------+--------+---------| +| getPastVotes | 545 | 7204 | 8087 | 13314 | 29 | +|------------------------------+-----------------+--------+--------+--------+---------| +| getRewardDistributors | 5132 | 7621 | 9644 | 9644 | 29 | +|------------------------------+-----------------+--------+--------+--------+---------| +| getVotes | 2703 | 3939 | 3939 | 5175 | 22 | +|------------------------------+-----------------+--------+--------+--------+---------| +| grantRole | 29490 | 29490 | 29490 | 29490 | 36 | +|------------------------------+-----------------+--------+--------+--------+---------| +| hasRole | 2710 | 2710 | 2710 | 2710 | 5 | +|------------------------------+-----------------+--------+--------+--------+---------| +| initialize | 139037 | 139037 | 139037 | 139037 | 299 | +|------------------------------+-----------------+--------+--------+--------+---------| +| mint | 4947 | 109651 | 121478 | 168405 | 350 | +|------------------------------+-----------------+--------+--------+--------+---------| +| name | 3286 | 3286 | 3286 | 3286 | 1 | +|------------------------------+-----------------+--------+--------+--------+---------| +| nonces | 2661 | 2661 | 2661 | 2661 | 1 | +|------------------------------+-----------------+--------+--------+--------+---------| +| numCheckpoints | 2720 | 2720 | 2720 | 2720 | 9 | +|------------------------------+-----------------+--------+--------+--------+---------| +| removeRewardDistributor | 5037 | 41594 | 29952 | 86728 | 39 | +|------------------------------+-----------------+--------+--------+--------+---------| +| setAllowedToTransfer | 1140 | 24618 | 25040 | 25040 | 492 | +|------------------------------+-----------------+--------+--------+--------+---------| +| setReward | 4901 | 208238 | 229111 | 229111 | 639 | +|------------------------------+-----------------+--------+--------+--------+---------| +| setSlashRewardPercentage | 2737 | 16140 | 9069 | 29914 | 5 | +|------------------------------+-----------------+--------+--------+--------+---------| +| slash | 4976 | 90223 | 90196 | 146150 | 265 | +|------------------------------+-----------------+--------+--------+--------+---------| +| slashRewardPercentage | 2407 | 2407 | 2407 | 2407 | 2 | +|------------------------------+-----------------+--------+--------+--------+---------| +| symbol | 3284 | 3284 | 3284 | 3284 | 1 | +|------------------------------+-----------------+--------+--------+--------+---------| +| totalSupply | 25058 | 25324 | 25058 | 35187 | 38 | +|------------------------------+-----------------+--------+--------+--------+---------| +| transfer | 2897 | 14482 | 14291 | 95809 | 821 | +|------------------------------+-----------------+--------+--------+--------+---------| +| transferFrom | 558 | 558 | 558 | 558 | 12 | +|------------------------------+-----------------+--------+--------+--------+---------| +| upgradeTo | 2869 | 2869 | 2869 | 2869 | 1 | +╰------------------------------+-----------------+--------+--------+--------+---------╯ + +╭--------------------------------------------+-----------------+--------+--------+--------+---------╮ +| src/KarmaAirdrop.sol:KarmaAirdrop Contract | | | | | | ++===================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| 990560 | 4780 | | | | | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| | | | | | | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| claim | 26408 | 141318 | 183894 | 190244 | 7 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| epoch | 2351 | 2351 | 2351 | 2351 | 4 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| isClaimed | 4899 | 4899 | 4899 | 4899 | 7 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| merkleRoot | 2308 | 2308 | 2308 | 2308 | 4 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| owner | 2352 | 2352 | 2352 | 2352 | 3 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| pause | 46835 | 46835 | 46835 | 46835 | 3 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| setMerkleRoot | 24089 | 43983 | 47396 | 54607 | 16 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| unpause | 24869 | 24869 | 24869 | 24869 | 1 | +╰--------------------------------------------+-----------------+--------+--------+--------+---------╯ + +╭-------------------------------------------------+-----------------+-------+--------+-------+---------╮ +| src/KarmaNFT.sol:KarmaNFT Contract | | | | | | ++======================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| 0 | 3502 | | | | | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| approve | 393 | 393 | 393 | 393 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| getApproved | 296 | 296 | 296 | 296 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| isApprovedForAll | 510 | 510 | 510 | 510 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| metadataGenerator | 2325 | 2325 | 2325 | 2325 | 2 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| safeTransferFrom(address,address,uint256) | 485 | 485 | 485 | 485 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| safeTransferFrom(address,address,uint256,bytes) | 655 | 655 | 655 | 655 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| setApprovalForAll | 475 | 475 | 475 | 475 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| setMetadataGenerator | 24036 | 26509 | 26509 | 28983 | 2 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| tokenURI | 73648 | 73648 | 73648 | 73648 | 1 | +|-------------------------------------------------+-----------------+-------+--------+-------+---------| +| transferFrom | 530 | 530 | 530 | 530 | 1 | +╰-------------------------------------------------+-----------------+-------+--------+-------+---------╯ + ╭----------------------------------------+-----------------+--------+--------+--------+---------╮ | src/KarmaTiers.sol:KarmaTiers Contract | | | | | | +===============================================================================================+ @@ -45,4 +411,414 @@ | updateTiers | 23978 | 107929 | 28296 | 301092 | 9 | ╰----------------------------------------+-----------------+--------+--------+--------+---------╯ +╭----------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ +| src/SimpleKarmaDistributor.sol:SimpleKarmaDistributor Contract | | | | | | ++=====================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| 0 | 8911 | | | | | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| DEFAULT_ADMIN_ROLE | 284 | 284 | 284 | 284 | 2 | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| OPERATOR_ROLE | 283 | 283 | 283 | 283 | 15 | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| availableSupply | 2363 | 2363 | 2363 | 2363 | 3 | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| grantRole | 29468 | 29659 | 29468 | 32144 | 14 | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| hasRole | 2687 | 2687 | 2687 | 2687 | 1 | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| initialize | 71497 | 71497 | 71497 | 71497 | 20 | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| mint | 4971 | 35646 | 53921 | 56122 | 5 | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| mintedSupply | 2384 | 2384 | 2384 | 2384 | 3 | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| redeemRewards | 2653 | 32388 | 32388 | 62124 | 2 | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| rewardsBalanceOfAccount | 2583 | 2583 | 2583 | 2583 | 6 | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| rewardsSupplier | 2427 | 2427 | 2427 | 2427 | 2 | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| setReward | 2491 | 21884 | 25763 | 25763 | 6 | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| setRewardsSupplier | 6037 | 23806 | 25937 | 29924 | 23 | +|----------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| totalRewardsSupply | 2359 | 2359 | 2359 | 2359 | 9 | +╰----------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ + +╭--------------------------------------------+-----------------+--------+--------+--------+---------╮ +| src/StakeManager.sol:StakeManager Contract | | | | | | ++===================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| 4092275 | 18952 | | | | | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| | | | | | | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| DEFAULT_ADMIN_ROLE | 284 | 284 | 284 | 284 | 2 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| GUARDIAN_ROLE | 286 | 286 | 286 | 286 | 104 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| MAX_LOCKUP_PERIOD | 383 | 383 | 383 | 383 | 4 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| MAX_MULTIPLIER | 329 | 329 | 329 | 329 | 20 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| MIN_LOCKUP_PERIOD | 287 | 287 | 287 | 287 | 13 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| STAKING_TOKEN | 2429 | 2429 | 2429 | 2429 | 2 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| emergencyModeEnabled | 2388 | 2388 | 2388 | 2388 | 263 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| enableEmergencyMode | 2431 | 27581 | 27762 | 27762 | 268 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| getAccountTotalMaxMP | 21191 | 21191 | 21191 | 21191 | 1 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| getAccountTotalStakedBalance | 21169 | 21169 | 21169 | 21169 | 1 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| getAccountVaults | 5230 | 5230 | 5230 | 5230 | 4 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| getVault | 13675 | 13675 | 13675 | 13675 | 4186 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| grantRole | 29492 | 29492 | 29492 | 29492 | 104 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| hasRole | 2731 | 2731 | 2731 | 2731 | 1 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| initialize | 115847 | 115847 | 115847 | 115847 | 112 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| lastRewardTime | 2407 | 2407 | 2407 | 2407 | 3 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| leave | 96367 | 125692 | 96367 | 213668 | 4 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| lock | 9325 | 42512 | 46117 | 65395 | 1034 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| migrateToVault | 11508 | 77786 | 13715 | 208136 | 3 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| mpAccruedOf | 2651 | 2651 | 2651 | 2651 | 20 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| mpBalanceOf | 4983 | 8761 | 10382 | 10382 | 12 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| mpBalanceOfAccount | 30189 | 31262 | 31262 | 32335 | 2 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| pause | 6896 | 20915 | 30262 | 30262 | 5 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| proxiableUUID | 343 | 343 | 343 | 343 | 3 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| redeemRewards | 54883 | 101136 | 110142 | 249933 | 260 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| registerVault | 2455 | 75443 | 76267 | 76267 | 427 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| rewardAmount | 2405 | 2405 | 2405 | 2405 | 4 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| rewardEndTime | 2430 | 2430 | 2430 | 2430 | 4 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| rewardStartTime | 2430 | 2430 | 2430 | 2430 | 4 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| rewardsBalanceOf | 20274 | 24786 | 25887 | 26108 | 268 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| rewardsBalanceOfAccount | 20752 | 25264 | 25118 | 62242 | 272 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| rewardsSupplier | 2428 | 2428 | 2428 | 2428 | 3 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| setReward | 6879 | 106222 | 107434 | 107434 | 531 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| setRewardsSupplier | 2585 | 29637 | 30348 | 34285 | 116 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| setTrustedCodehash | 24429 | 26286 | 26429 | 26429 | 112 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| stake | 4736 | 133389 | 204853 | 215768 | 2932 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| totalMP | 6806 | 8258 | 8258 | 9711 | 6 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| totalMPAccrued | 2385 | 2385 | 2385 | 2385 | 4168 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| totalMPStaked | 2385 | 2385 | 2385 | 2385 | 4171 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| totalMaxMP | 2407 | 2407 | 2407 | 2407 | 4168 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| totalRewardsAccrued | 2407 | 2407 | 2407 | 2407 | 5 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| totalRewardsSupply | 6737 | 8510 | 8998 | 11903 | 1076 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| totalShares | 4619 | 4619 | 4619 | 4619 | 6 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| totalStaked | 2408 | 2408 | 2408 | 2408 | 4174 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| unpause | 13139 | 13139 | 13139 | 13139 | 1 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| unstake | 39068 | 66318 | 70029 | 78859 | 20 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| updateAccount | 349803 | 349803 | 349803 | 349803 | 1 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| updateGlobalState | 17994 | 33841 | 31404 | 80175 | 9 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| updateVault | 34088 | 36341 | 34088 | 112719 | 1027 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| upgradeTo | 10308 | 10929 | 10308 | 12795 | 4 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| upgradeToAndCall | 3166 | 3166 | 3166 | 3166 | 1 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| vaultShares | 4871 | 4871 | 4871 | 4871 | 12 | +╰--------------------------------------------+-----------------+--------+--------+--------+---------╯ + +╭----------------------------------------+-----------------+--------+--------+--------+---------╮ +| src/StakeVault.sol:StakeVault Contract | | | | | | ++===============================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|----------------------------------------+-----------------+--------+--------+--------+---------| +| 1802448 | 8494 | | | | | +|----------------------------------------+-----------------+--------+--------+--------+---------| +| | | | | | | +|----------------------------------------+-----------------+--------+--------+--------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|----------------------------------------+-----------------+--------+--------+--------+---------| +| STAKING_TOKEN | 240 | 240 | 240 | 240 | 2 | +|----------------------------------------+-----------------+--------+--------+--------+---------| +| depositedBalance | 2341 | 2341 | 2341 | 2341 | 4 | +|----------------------------------------+-----------------+--------+--------+--------+---------| +| emergencyExit | 19932 | 36399 | 36397 | 53497 | 263 | +|----------------------------------------+-----------------+--------+--------+--------+---------| +| initialize | 70397 | 70397 | 70397 | 70397 | 448 | +|----------------------------------------+-----------------+--------+--------+--------+---------| +| leave | 2616 | 143762 | 133069 | 381648 | 8 | +|----------------------------------------+-----------------+--------+--------+--------+---------| +| lock | 25855 | 59127 | 62647 | 85326 | 1034 | +|----------------------------------------+-----------------+--------+--------+--------+---------| +| lockUntil | 2363 | 2363 | 2363 | 2363 | 3825 | +|----------------------------------------+-----------------+--------+--------+--------+---------| +| migrateFromVault | 46642 | 46642 | 46642 | 46642 | 1 | +|----------------------------------------+-----------------+--------+--------+--------+---------| +| migrateToVault | 10442 | 85994 | 32869 | 267797 | 4 | +|----------------------------------------+-----------------+--------+--------+--------+---------| +| owner | 424 | 474 | 424 | 2424 | 439 | +|----------------------------------------+-----------------+--------+--------+--------+---------| +| register | 3354 | 79929 | 84335 | 84335 | 447 | +|----------------------------------------+-----------------+--------+--------+--------+---------| +| stake | 2593 | 202740 | 245508 | 315095 | 2938 | +|----------------------------------------+-----------------+--------+--------+--------+---------| +| transferOwnership | 4746 | 4746 | 4746 | 4746 | 1 | +|----------------------------------------+-----------------+--------+--------+--------+---------| +| unstake(uint256) | 4655 | 13543 | 6781 | 114132 | 272 | +|----------------------------------------+-----------------+--------+--------+--------+---------| +| unstake(uint256,address) | 2670 | 2670 | 2670 | 2670 | 1 | +|----------------------------------------+-----------------+--------+--------+--------+---------| +| withdraw(address,uint256) | 10328 | 21759 | 21760 | 35337 | 6 | +|----------------------------------------+-----------------+--------+--------+--------+---------| +| withdraw(address,uint256,address) | 2770 | 19139 | 19139 | 35509 | 2 | +╰----------------------------------------+-----------------+--------+--------+--------+---------╯ + +╭--------------------------------------------+-----------------+--------+--------+--------+---------╮ +| src/VaultFactory.sol:VaultFactory Contract | | | | | | ++===================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| 483043 | 2094 | | | | | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| | | | | | | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| createVault | 145515 | 222224 | 226496 | 226496 | 446 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| owner | 2317 | 2317 | 2317 | 2317 | 1 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| stakeManager | 2301 | 2301 | 2301 | 2301 | 2 | +|--------------------------------------------+-----------------+--------+--------+--------+---------| +| vaultImplementation | 2345 | 2345 | 2345 | 2345 | 2 | +╰--------------------------------------------+-----------------+--------+--------+--------+---------╯ + +╭------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ +| src/nft-metadata-generators/NFTMetadataGeneratorSVG.sol:NFTMetadataGeneratorSVG Contract | | | | | | ++===============================================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| 0 | 6015 | | | | | +|------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| generate | 54775 | 54775 | 54775 | 54775 | 1 | +|------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| imagePrefix | 3183 | 3183 | 3183 | 3183 | 2 | +|------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| imageSuffix | 3227 | 3227 | 3227 | 3227 | 2 | +|------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| setImageStrings | 25295 | 30634 | 30634 | 35974 | 2 | +╰------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ + +╭------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ +| src/nft-metadata-generators/NFTMetadataGeneratorURL.sol:NFTMetadataGeneratorURL Contract | | | | | | ++===============================================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| 1173479 | 5828 | | | | | +|------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| generate | 64121 | 64121 | 64121 | 64121 | 1 | +|------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| setURLStrings | 25463 | 30802 | 30802 | 36142 | 2 | +|------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| urlPrefix | 3184 | 3184 | 3184 | 3184 | 1 | +|------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| urlSuffix | 3228 | 3228 | 3228 | 3228 | 1 | +╰------------------------------------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ + +╭----------------------------------------------------+-----------------+-------+--------+-------+---------╮ +| src/rln/PoseidonHasher.sol:PoseidonHasher Contract | | | | | | ++=========================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|----------------------------------------------------+-----------------+-------+--------+-------+---------| +| 3373017 | 15385 | | | | | +|----------------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|----------------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|----------------------------------------------------+-----------------+-------+--------+-------+---------| +| hash | 11098 | 11098 | 11098 | 11098 | 48 | +╰----------------------------------------------------+-----------------+-------+--------+-------+---------╯ + +╭------------------------------+-----------------+--------+--------+--------+---------╮ +| src/rln/RLN.sol:RLN Contract | | | | | | ++=====================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|------------------------------+-----------------+--------+--------+--------+---------| +| 2018843 | 9311 | | | | | +|------------------------------+-----------------+--------+--------+--------+---------| +| | | | | | | +|------------------------------+-----------------+--------+--------+--------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|------------------------------+-----------------+--------+--------+--------+---------| +| DEFAULT_ADMIN_ROLE | 240 | 240 | 240 | 240 | 16 | +|------------------------------+-----------------+--------+--------+--------+---------| +| REGISTER_ROLE | 263 | 263 | 263 | 263 | 15 | +|------------------------------+-----------------+--------+--------+--------+---------| +| SET_SIZE | 2384 | 2384 | 2384 | 2384 | 1 | +|------------------------------+-----------------+--------+--------+--------+---------| +| SLASHER_ROLE | 262 | 262 | 262 | 262 | 17 | +|------------------------------+-----------------+--------+--------+--------+---------| +| hasRole | 2708 | 2708 | 2708 | 2708 | 45 | +|------------------------------+-----------------+--------+--------+--------+---------| +| identityCommitmentIndex | 2362 | 2362 | 2362 | 2362 | 5 | +|------------------------------+-----------------+--------+--------+--------+---------| +| initialize | 187142 | 187142 | 187142 | 187142 | 16 | +|------------------------------+-----------------+--------+--------+--------+---------| +| lastRevealStartTime | 2576 | 2576 | 2576 | 2576 | 2 | +|------------------------------+-----------------+--------+--------+--------+---------| +| members | 4712 | 4712 | 4712 | 4712 | 7 | +|------------------------------+-----------------+--------+--------+--------+---------| +| register | 6997 | 44579 | 53001 | 55801 | 10 | +|------------------------------+-----------------+--------+--------+--------+---------| +| setSlashRevealWindowTime | 9143 | 19505 | 19505 | 29868 | 2 | +|------------------------------+-----------------+--------+--------+--------+---------| +| slash | 23167 | 103443 | 103443 | 183719 | 2 | +|------------------------------+-----------------+--------+--------+--------+---------| +| slashCommit | 29935 | 39593 | 39920 | 47292 | 8 | +|------------------------------+-----------------+--------+--------+--------+---------| +| slashCommitments | 2710 | 2710 | 2710 | 2710 | 7 | +|------------------------------+-----------------+--------+--------+--------+---------| +| slashReveal | 5307 | 52627 | 17678 | 169846 | 4 | +|------------------------------+-----------------+--------+--------+--------+---------| +| slashRevealWindowTime | 2340 | 2340 | 2340 | 2340 | 3 | +╰------------------------------+-----------------+--------+--------+--------+---------╯ + +╭-------------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ +| test/mocks/KarmaDistributorMock.sol:KarmaDistributorMock Contract | | | | | | ++========================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|-------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| 276283 | 1097 | | | | | +|-------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|-------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|-------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| rewardsBalanceOfAccount | 549 | 1926 | 2549 | 2549 | 1690 | +|-------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| setTotalKarmaShares | 43589 | 43589 | 43589 | 43589 | 96 | +|-------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| setUserKarmaShare | 44182 | 44193 | 44194 | 44194 | 49 | +|-------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| totalRewardsSupply | 2327 | 2327 | 2327 | 2327 | 968 | +╰-------------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ + +╭---------------------------------------------------------------------+-----------------+-------+--------+-------+---------╮ +| test/mocks/MockMetadataGenerator.sol:MockMetadataGenerator Contract | | | | | | ++==========================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|---------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| 939356 | 4684 | | | | | +|---------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|---------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|---------------------------------------------------------------------+-----------------+-------+--------+-------+---------| +| generate | 60554 | 60554 | 60554 | 60554 | 1 | +╰---------------------------------------------------------------------+-----------------+-------+--------+-------+---------╯ + +╭---------------------------------------------+-----------------+-------+--------+-------+---------╮ +| test/mocks/MockToken.sol:MockToken Contract | | | | | | ++==================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|---------------------------------------------+-----------------+-------+--------+-------+---------| +| 770657 | 3987 | | | | | +|---------------------------------------------+-----------------+-------+--------+-------+---------| +| | | | | | | +|---------------------------------------------+-----------------+-------+--------+-------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|---------------------------------------------+-----------------+-------+--------+-------+---------| +| approve | 29075 | 31691 | 29195 | 46259 | 3003 | +|---------------------------------------------+-----------------+-------+--------+-------+---------| +| balanceOf | 2561 | 2561 | 2561 | 2561 | 4988 | +|---------------------------------------------+-----------------+-------+--------+-------+---------| +| mint | 33964 | 37449 | 34084 | 68248 | 3015 | +╰---------------------------------------------+-----------------+-------+--------+-------+---------╯ + +╭-------------------------------------------------------+-----------------+--------+--------+--------+---------╮ +| test/mocks/MockVotesToken.sol:MockVotesToken Contract | | | | | | ++==============================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|-------------------------------------------------------+-----------------+--------+--------+--------+---------| +| 1998773 | 9906 | | | | | +|-------------------------------------------------------+-----------------+--------+--------+--------+---------| +| | | | | | | +|-------------------------------------------------------+-----------------+--------+--------+--------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|-------------------------------------------------------+-----------------+--------+--------+--------+---------| +| DOMAIN_SEPARATOR | 353 | 353 | 353 | 353 | 7 | +|-------------------------------------------------------+-----------------+--------+--------+--------+---------| +| balanceOf | 584 | 1784 | 2584 | 2584 | 15 | +|-------------------------------------------------------+-----------------+--------+--------+--------+---------| +| delegates | 2598 | 2598 | 2598 | 2598 | 1 | +|-------------------------------------------------------+-----------------+--------+--------+--------+---------| +| getVotes | 5116 | 5116 | 5116 | 5116 | 1 | +|-------------------------------------------------------+-----------------+--------+--------+--------+---------| +| mint | 117977 | 117977 | 117977 | 117977 | 4 | +╰-------------------------------------------------------+-----------------+--------+--------+--------+---------╯ + +╭-----------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╮ +| test/mocks/StackOverflowStakeManager.sol:StackOverflowStakeManager Contract | | | | | | ++====================================================================================================================================+ +| Deployment Cost | Deployment Size | | | | | +|-----------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| 1681940 | 7653 | | | | | +|-----------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| | | | | | | +|-----------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| Function Name | Min | Avg | Median | Max | # Calls | +|-----------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| leave | 817 | 162105 | 162105 | 323457 | 333 | +|-----------------------------------------------------------------------------+-----------------+--------+--------+--------+---------| +| proxiableUUID | 330 | 330 | 330 | 330 | 1 | +╰-----------------------------------------------------------------------------+-----------------+--------+--------+--------+---------╯ + diff --git a/status-network-contracts/.gas-snapshot b/status-network-contracts/.gas-snapshot index d4f9d93b90..9e8d5b528a 100644 --- a/status-network-contracts/.gas-snapshot +++ b/status-network-contracts/.gas-snapshot @@ -1,3 +1,75 @@ +AccessControlTest:test_GrantRoleCanBeUsedByAdmin() (gas: 91967) +AccessControlTest:test_GrantRoleRevertsIfNotAdmin() (gas: 114638) +AddRewardDistributorTest:testActualTokenBalanceOf() (gas: 618438) +AddRewardDistributorTest:testAddKarmaDistributorOnlyAdmin() (gas: 520366) +AddRewardDistributorTest:testAddRewardDistributorAsOtherAdmin() (gas: 182868) +AddRewardDistributorTest:testBalanceOf() (gas: 605937) +AddRewardDistributorTest:testBalanceOfWithNoSystemTotalKarma() (gas: 74357) +AddRewardDistributorTest:testMintOnlyAdmin() (gas: 588101) +AddRewardDistributorTest:testRemoveKarmaDistributorOnlyOwner() (gas: 219753) +AddRewardDistributorTest:testRemoveUnknownKarmaDistributor() (gas: 41623) +AddRewardDistributorTest:testTotalSupply() (gas: 515872) +AddRewardDistributorTest:testTransfersNotAllowed() (gas: 79474) +AddRewardDistributorTest:test_RevertWhen_SenderIsNotDefaultAdmin() (gas: 68449) +ApprovalsTest:testApproveNotAllowed() (gas: 10567) +ApprovalsTest:testGetApproved() (gas: 10573) +ApprovalsTest:testIsApprovedForAll() (gas: 10702) +ApprovalsTest:testSetApprovalForAllNotAllowed() (gas: 8474) +ClaimTest:test_ClaimDelegatesToDefaultDelegatee() (gas: 407251) +ClaimTest:test_ClaimFromComplexMerkleTree() (gas: 594249) +ClaimTest:test_ClaimWithValidProof() (gas: 444228) +ClaimTest:test_Owner() (gas: 12718) +ClaimTest:test_RevertWhen_ClaimBeforeMerkleRootSet() (gas: 47679) +DeployProtocolTest:testContractInitialization() (gas: 72270) +DeployProtocolTest:testKarmaNFTConfiguration() (gas: 13131) +DeployProtocolTest:testKarmaOwnership() (gas: 25875) +DeployProtocolTest:testKarmaRewardDistributorSetup() (gas: 18177) +DeployProtocolTest:testStakeManagerConfiguration() (gas: 33494) +DeployProtocolTest:testStakeManagerOwnership() (gas: 28699) +DeployProtocolTest:testVaultFactoryConfiguration() (gas: 23477) +DeployProtocolTest:testVaultFactoryOwnership() (gas: 13124) +EmergencyExitTest:test_CannotEnableEmergencyModeTwice() (gas: 93563) +EmergencyExitTest:test_CannotLeaveBeforeEmergencyMode() (gas: 384058) +EmergencyExitTest:test_EmergencyExitBasic() (gas: 564885) +EmergencyExitTest:test_EmergencyExitMultipleUsers() (gas: 1015978) +EmergencyExitTest:test_EmergencyExitToAlternateAddress() (gas: 519727) +EmergencyExitTest:test_EmergencyExitWithLock() (gas: 470989) +EmergencyExitTest:test_EmergencyExitWithRewards() (gas: 525110) +EmergencyExitTest:test_GuardianCanEnableEmergencyMode() (gas: 61718) +EmergencyExitTest:test_OnlyOwnerOrGuardianCanEnableEmergencyMode() (gas: 43414) +EmergencyExitTest:test_OwnerCanEnableEmergencyMode() (gas: 63919) +FuzzTests:testFuzz_AccrueMP(uint128,uint64,uint64) (runs: 1000, μ: 599760, ~: 573043) +FuzzTests:testFuzz_AccrueMP_Relock(uint128,uint64,uint64,uint64) (runs: 1000, μ: 831208, ~: 801319) +FuzzTests:testFuzz_EmergencyExit(uint256,uint256) (runs: 1000, μ: 617819, ~: 617758) +FuzzTests:testFuzz_Lock(uint256,uint64) (runs: 1000, μ: 1023181, ~: 1024221) +FuzzTests:testFuzz_RedeemRewards(uint256,uint256,uint256,uint16,uint16) (runs: 1000, μ: 918063, ~: 929889) +FuzzTests:testFuzz_Relock(uint256,uint64,uint64) (runs: 1000, μ: 621463, ~: 596527) +FuzzTests:testFuzz_Rewards(uint256,uint256,uint256,uint16,uint16) (runs: 1000, μ: 734646, ~: 736582) +FuzzTests:testFuzz_Stake(uint256,uint64) (runs: 1000, μ: 393665, ~: 368349) +FuzzTests:testFuzz_Unstake(uint128,uint64,uint16,uint128) (runs: 1000, μ: 770631, ~: 755765) +FuzzTests:testFuzz_UpdateVault(uint128,uint64,uint64) (runs: 1000, μ: 599783, ~: 573066) +IntegrationTest:testStakeFoo() (gas: 2471190) +KarmaAirdropTest:test_Owner() (gas: 12635) +KarmaOwnershipTest:testActualTokenBalanceOf() (gas: 618438) +KarmaOwnershipTest:testAddKarmaDistributorOnlyAdmin() (gas: 520354) +KarmaOwnershipTest:testBalanceOf() (gas: 605870) +KarmaOwnershipTest:testBalanceOfWithNoSystemTotalKarma() (gas: 74379) +KarmaOwnershipTest:testInitialOwner() (gas: 20520) +KarmaOwnershipTest:testMintOnlyAdmin() (gas: 588123) +KarmaOwnershipTest:testOwnershipTransfer() (gas: 94330) +KarmaOwnershipTest:testRemoveKarmaDistributorOnlyOwner() (gas: 219763) +KarmaOwnershipTest:testRemoveUnknownKarmaDistributor() (gas: 41611) +KarmaOwnershipTest:testTotalSupply() (gas: 515872) +KarmaOwnershipTest:testTransfersNotAllowed() (gas: 79496) +KarmaTest:testActualTokenBalanceOf() (gas: 618438) +KarmaTest:testAddKarmaDistributorOnlyAdmin() (gas: 520354) +KarmaTest:testBalanceOf() (gas: 605870) +KarmaTest:testBalanceOfWithNoSystemTotalKarma() (gas: 74379) +KarmaTest:testMintOnlyAdmin() (gas: 588123) +KarmaTest:testRemoveKarmaDistributorOnlyOwner() (gas: 219741) +KarmaTest:testRemoveUnknownKarmaDistributor() (gas: 41611) +KarmaTest:testTotalSupply() (gas: 515872) +KarmaTest:testTransfersNotAllowed() (gas: 79474) KarmaTiersTest:test_GetTierIdByKarmaBalance_EdgeCases() (gas: 297868) KarmaTiersTest:test_Revert_When_TierNameEmpty() (gas: 39361) KarmaTiersTest:test_Revert_When_TierNameTooLong() (gas: 40510) @@ -7,9 +79,285 @@ KarmaTiersTest:test_Revert_When_TiersNotStartingAtZero() (gas: 37667) KarmaTiersTest:test_Revert_When_UpdateTiersCalledByNonOwner() (gas: 36642) KarmaTiersTest:test_Success_When_LastTierIsUnlimited() (gas: 242295) KarmaTiersTest:test_Success_When_TiersAreContiguous() (gas: 336294) +LeaveTest:testOwner() (gas: 15308) +LeaveTest:test_LeaveShouldKeepFundsLockedInStakeVault() (gas: 10921068) +LeaveTest:test_LeaveShouldProperlyUpdateAccounting() (gas: 11008965) +LeaveTest:test_LeaveShouldRedeemRewardsToActualKarma() (gas: 1058451) +LeaveTest:test_LeaveTransfersAllFunds() (gas: 215777) +LeaveTest:test_RevertWHen_NotOwner() (gas: 37371) +LeaveTest:test_RevertWhen_InvalidDestination() (gas: 36921) +LockTest:test_LockFailsWithInvalidPeriod(uint256) (runs: 1000, μ: 428069, ~: 428093) +LockTest:test_LockFailsWithNoStake() (gas: 90096) +LockTest:test_LockFailsWithZero() (gas: 389696) +LockTest:test_LockMultipleTimesExceedMaxLock() (gas: 774215) +LockTest:test_LockWithPriorLock() (gas: 704755) +LockTest:test_LockWithoutPriorLock() (gas: 546748) +LockTest:test_RevertWhenVaultToLockIsEmpty() (gas: 90096) +MaliciousUpgradeTest:test_UpgradeStackOverflowStakeManager() (gas: 2565202) +MintTest:testActualTokenBalanceOf() (gas: 618438) +MintTest:testAddKarmaDistributorOnlyAdmin() (gas: 520354) +MintTest:testBalanceOf() (gas: 605870) +MintTest:testBalanceOfWithNoSystemTotalKarma() (gas: 74379) +MintTest:testMintOnlyAdmin() (gas: 588123) +MintTest:testRemoveKarmaDistributorOnlyOwner() (gas: 219741) +MintTest:testRemoveUnknownKarmaDistributor() (gas: 41611) +MintTest:testTotalSupply() (gas: 515872) +MintTest:testTransfersNotAllowed() (gas: 79474) +MintTest:test_Mint() (gas: 192118) +MintTest:test_MintByAdminAdjustsSupply() (gas: 316433) +MintTest:test_MintByOperator() (gas: 320690) +MintTest:test_RevertWhen_InsufficientSupply() (gas: 220991) +MintTest:test_RevertWhen_ZeroAmount() (gas: 43986) +MultipleVaultsStakeTest:test_StakeMultipleVaults() (gas: 1047806) +NFTMetadataGeneratorSVGTest:testGenerateMetadata() (gas: 92580) +NFTMetadataGeneratorSVGTest:testSetImageStrings() (gas: 80029) +NFTMetadataGeneratorSVGTest:testSetImageStringsRevert() (gas: 35879) +NFTMetadataGeneratorURLTest:testGenerateMetadata() (gas: 108341) +NFTMetadataGeneratorURLTest:testSetBaseURL() (gas: 59131) +NFTMetadataGeneratorURLTest:testSetBaseURLRevert() (gas: 36066) +OverflowTest:testActualTokenBalanceOf() (gas: 618422) +OverflowTest:testAddKarmaDistributorOnlyAdmin() (gas: 520366) +OverflowTest:testBalanceOf() (gas: 605876) +OverflowTest:testBalanceOfWithNoSystemTotalKarma() (gas: 74357) +OverflowTest:testMintOnlyAdmin() (gas: 588113) +OverflowTest:testRemoveKarmaDistributorOnlyOwner() (gas: 219753) +OverflowTest:testRemoveUnknownKarmaDistributor() (gas: 41629) +OverflowTest:testTotalSupply() (gas: 515878) +OverflowTest:testTransfersNotAllowed() (gas: 79474) +OverflowTest:test_RevertWhen_MintingCausesOverflow() (gas: 269443) +OverflowTest:test_RevertWhen_SettingRewardCausesOverflow() (gas: 253221) +PauseTest:test_PauseAndUnpause() (gas: 501727) +PauseTest:test_RevertWhenNotAdmin() (gas: 43353) +PauseTest:test_RevertWhenNotGuardian() (gas: 43398) +RLNTest:test_SetSlashRevealWindowTime() (gas: 56098) +RLNTest:test_SetSlashRevealWindowTimeRevertsIfNotAdmin() (gas: 103805) +RLNTest:test_SlashCommitAddsNewHashWithSlashRole() (gas: 129526) +RLNTest:test_SlashCommitCreatesQueueForMultipleCommits() (gas: 291885) +RLNTest:test_SlashCommitRevertsIfNoSlashRole() (gas: 109141) +RLNTest:test_SlashRevealRevertsIfCommitmentDoesntExist() (gas: 46912) +RLNTest:test_SlashRevealRevertsIfNoSlashRole() (gas: 109088) +RLNTest:test_SlashRevealRevertsIfRevealWindowNotStarted() (gas: 428032) +RLNTest:test_SlashRevealSlashesAccountAndRemovesHash() (gas: 583679) +RLNTest:test_initial_state() (gas: 45775) +RLNTest:test_register_fails_when_duplicate_identity_commitment() (gas: 132472) +RLNTest:test_register_fails_when_index_exceeds_set_size() (gas: 2628978) +RLNTest:test_register_succeeds() (gas: 273618) +RLNTest:test_slash_fails_when_not_registered() (gas: 64729) +RLNTest:test_slash_succeeds() (gas: 542065) +RedeemRewardsTest:test_RedeemRewards() (gas: 1036886) +RedeemRewardsTest:test_RedeemRewardsTransfersKarma() (gas: 461246) +RedeemRewardsTest:test_RedeemRewardsWhenNoBalance() (gas: 39125) +RedeemRewardsTest:test_RedeemRewardsZeroRewards() (gas: 594891) +RegisterVaultTest:test_RevertWHen_Paused() (gas: 227167) +RegisterVaultTest:test_Revertwhen_EmergencyModeEnabled() (gas: 222356) +RegisterVaultTest:test_VaultRegistration() (gas: 89890) +RemoveRewardDistributorTest:testActualTokenBalanceOf() (gas: 618444) +RemoveRewardDistributorTest:testAddKarmaDistributorOnlyAdmin() (gas: 520378) +RemoveRewardDistributorTest:testBalanceOf() (gas: 605943) +RemoveRewardDistributorTest:testBalanceOfWithNoSystemTotalKarma() (gas: 74357) +RemoveRewardDistributorTest:testMintOnlyAdmin() (gas: 588113) +RemoveRewardDistributorTest:testRemoveKarmaDistributorOnlyOwner() (gas: 219765) +RemoveRewardDistributorTest:testRemoveRewardDistributor() (gas: 443244) +RemoveRewardDistributorTest:testRemoveRewardDistributorAsOtherAdmin() (gas: 299857) +RemoveRewardDistributorTest:testRemoveUnknownKarmaDistributor() (gas: 41629) +RemoveRewardDistributorTest:testTotalSupply() (gas: 515901) +RemoveRewardDistributorTest:testTransfersNotAllowed() (gas: 79474) +RemoveRewardDistributorTest:test_RevertWhen_SenderIsNotDefaultAdmin() (gas: 66500) +RewardsAccrualTest:testRewardsBalanceOf() (gas: 2884099) +RewardsAccrualTest:testSetRewards() (gas: 340268) +RewardsAccrualTest:testSetRewardsAccumulatesRemainingRewards() (gas: 472517) +RewardsAccrualTest:testSetRewardsAfterPeriodEndedNoAccumulation() (gas: 393279) +RewardsAccrualTest:testSetRewardsWithPartialElapsedTime() (gas: 391554) +RewardsAccrualTest:testSetRewards_RevertsBadAmount() (gas: 128056) +RewardsAccrualTest:testSetRewards_RevertsBadDuration() (gas: 167814) +RewardsAccrualTest:testSetRewards_RevertsNotAuthorized() (gas: 43676) +RewardsAccrualTest:testTotalRewardsSupply() (gas: 1411097) +SetMerkleRootTest:test_Owner() (gas: 12719) +SetMerkleRootTest:test_RevertWhen_NotOwner() (gas: 34603) +SetMerkleRootTest:test_RevertWhen_NotPaused() (gas: 1122294) +SetMerkleRootTest:test_RevertWhen_UpdateMerkleRootNotAllowed() (gas: 87123) +SetMerkleRootTest:test_SetMerkleRoot() (gas: 67534) +SetMerkleRootTest:test_UpdateMerkleRootIncreasesEpoch() (gas: 1247856) +SetMerkleRootTest:test_UpdateMerkleRootResetsClaimedBitmap() (gas: 1646891) +SetMerkleRootTest:test__UpdateMerkleRootWhenAllowed() (gas: 1201394) +SetMetadataGeneratorTest:testSetMetadataGenerator() (gas: 1017305) +SetMetadataGeneratorTest:test_RevertWhen_NotOwner() (gas: 1006958) +SetRewardSupplierTest:test_RevertWhen_EmergencyModeEnabled() (gas: 96179) +SetRewardSupplierTest:test_RevertWhen_NotAdmin() (gas: 108257) +SetRewardSupplierTest:test_RevertWhen_Paused() (gas: 100919) +SetRewardSupplierTest:test_SetRewardSupplier_Success() (gas: 64734) +SetRewardTest:testActualTokenBalanceOf() (gas: 618466) +SetRewardTest:testAddKarmaDistributorOnlyAdmin() (gas: 520400) +SetRewardTest:testBalanceOf() (gas: 605876) +SetRewardTest:testBalanceOfWithNoSystemTotalKarma() (gas: 74379) +SetRewardTest:testMintOnlyAdmin() (gas: 588135) +SetRewardTest:testRemoveKarmaDistributorOnlyOwner() (gas: 219743) +SetRewardTest:testRemoveUnknownKarmaDistributor() (gas: 41629) +SetRewardTest:testSetRewardAsAdmin() (gas: 285815) +SetRewardTest:testSetRewardAsOperator() (gas: 211363) +SetRewardTest:testSetRewardAsOtherAdmin() (gas: 354812) +SetRewardTest:testTotalSupply() (gas: 515923) +SetRewardTest:testTransfersNotAllowed() (gas: 79518) +SetRewardTest:test_RevertWHen_Unauthorized() (gas: 76649) +SetRewardTest:test_RevertWhen_SenderIsNotDefaultAdmin() (gas: 43628) +SetRewardTest:test_RevertWhen_SenderIsNotOperator() (gas: 61932) +SetRewardTest:test_SetRewardUpdatesAvailableSupply() (gas: 205282) +SetRewardsSupplierTest:test_RevertWhen_NotAdmin() (gas: 104233) +SetRewardsSupplierTest:test_SetRewardsUpdatesSupplierIfAdmin() (gas: 70639) +SlashRewardPercentageTest:testActualTokenBalanceOf() (gas: 618466) +SlashRewardPercentageTest:testAddKarmaDistributorOnlyAdmin() (gas: 520400) +SlashRewardPercentageTest:testBalanceOf() (gas: 605920) +SlashRewardPercentageTest:testBalanceOfWithNoSystemTotalKarma() (gas: 74401) +SlashRewardPercentageTest:testMintOnlyAdmin() (gas: 588157) +SlashRewardPercentageTest:testRemoveKarmaDistributorOnlyOwner() (gas: 219720) +SlashRewardPercentageTest:testRemoveUnknownKarmaDistributor() (gas: 41629) +SlashRewardPercentageTest:testTotalSupply() (gas: 515923) +SlashRewardPercentageTest:testTransfersNotAllowed() (gas: 79518) +SlashRewardPercentageTest:test_RevertWhen_SetSlashRewardPercentageAsOperator() (gas: 103948) +SlashRewardPercentageTest:test_RevertWhen_SetSlashRewardPercentageExceedsMax() (gas: 39332) +SlashRewardPercentageTest:test_RevertWhen_SetSlashRewardPercentageNotAuthorized() (gas: 103958) +SlashRewardPercentageTest:test_SetSlashRewardPercentageAsAdmin() (gas: 57743) +SlashRewardPercentageTest:test_SlashWithCustomRewardPercentage() (gas: 503491) +SlashTest:testActualTokenBalanceOf() (gas: 618444) +SlashTest:testAddKarmaDistributorOnlyAdmin() (gas: 520378) +SlashTest:testBalanceOf() (gas: 605876) +SlashTest:testBalanceOfWithNoSystemTotalKarma() (gas: 74379) +SlashTest:testFuzz_Slash(uint256) (runs: 1000, μ: 313073, ~: 308529) +SlashTest:testMintOnlyAdmin() (gas: 588135) +SlashTest:testRemoveKarmaDistributorOnlyOwner() (gas: 219743) +SlashTest:testRemoveUnknownKarmaDistributor() (gas: 41640) +SlashTest:testTotalSupply() (gas: 515901) +SlashTest:testTransfersNotAllowed() (gas: 79496) +SlashTest:test_RevertWhen_KarmaBalanceIsInvalid() (gas: 64815) +SlashTest:test_RevertWhen_SenderIsNotDefaultAdminOrSlasher() (gas: 43551) +SlashTest:test_Slash() (gas: 528034) +SlashTest:test_SlashRemainingBalanceIfBalanceIsLow() (gas: 394113) StakeMathTest:test_CalcAbsoluteMaxTotalMP() (gas: 5173) StakeMathTest:test_CalcAccrueMP() (gas: 8487) StakeMathTest:test_CalcBonusMP() (gas: 7649) StakeMathTest:test_CalcInitialMP() (gas: 5727) StakeMathTest:test_CalcMaxAccruedMP() (gas: 4819) -StakeMathTest:test_CalcMaxTotalMP() (gas: 8372) \ No newline at end of file +StakeMathTest:test_CalcMaxTotalMP() (gas: 8372) +StakeTest:testOwner() (gas: 15341) +StakeTest:test_RevertWhen_NotOwner() (gas: 37182) +StakeTest:test_StakeMultipleAccounts() (gas: 752654) +StakeTest:test_StakeMultipleAccountsAndRewards() (gas: 807354) +StakeTest:test_StakeMultipleAccountsMPIncreasesMaxMPDoesNotChange() (gas: 1417891) +StakeTest:test_StakeMultipleAccountsWithMinLockUp() (gas: 678869) +StakeTest:test_StakeMultipleAccountsWithRandomLockUp() (gas: 687440) +StakeTest:test_StakeMultipleTimesDoesNotExceedsMaxMP() (gas: 1846029) +StakeTest:test_StakeMultipleTimesWithLockIncreaseAtSameBlock() (gas: 721453) +StakeTest:test_StakeMultipleTimesWithLockZeroAfterMaxLock() (gas: 1250389) +StakeTest:test_StakeOneAccount() (gas: 433139) +StakeTest:test_StakeOneAccountAndRewards() (gas: 487902) +StakeTest:test_StakeOneAccountMPIncreasesMaxMPDoesNotChange() (gas: 875839) +StakeTest:test_StakeOneAccountReachingMPLimit() (gas: 761105) +StakeTest:test_StakeOneAccountWithMaxLockUp() (gas: 402313) +StakeTest:test_StakeOneAccountWithMinLockUp() (gas: 402909) +StakeTest:test_StakeOneAccountWithRandomLockUp() (gas: 402954) +StakeTest:test_StakeTransfersTokensToVault() (gas: 137222) +StakeVaultMigrationTest:testMigrateToVault() (gas: 1280978) +StakeVaultMigrationTest:test_RevertWhenDestinationVaultIsNotRegistered() (gas: 271002) +StakeVaultMigrationTest:test_RevertWhenMigrationVaultNotEmpty() (gas: 653511) +StakeVaultMigrationTest:test_RevertWhenNotOwnerOfMigrationVault() (gas: 49471) +StakeVaultTest:testOwner() (gas: 15307) +StakingTokenTest:testOwner() (gas: 15307) +StakingTokenTest:testStakeToken() (gas: 13144) +TokenURITest:testTokenURI() (gas: 108841) +TransferOwnershipTest:testOwner() (gas: 15307) +TransferOwnershipTest:test_RevertWhen_TransferOwnership() (gas: 41429) +TransferTest:testActualTokenBalanceOf() (gas: 618444) +TransferTest:testAddKarmaDistributorOnlyAdmin() (gas: 520366) +TransferTest:testBalanceOf() (gas: 605898) +TransferTest:testBalanceOfWithNoSystemTotalKarma() (gas: 74379) +TransferTest:testMintOnlyAdmin() (gas: 588135) +TransferTest:testRemoveKarmaDistributorOnlyOwner() (gas: 219775) +TransferTest:testRemoveUnknownKarmaDistributor() (gas: 41617) +TransferTest:testSafeTransferNotAllowed() (gas: 10677) +TransferTest:testSafeTransferWithDataNotAllowed() (gas: 10868) +TransferTest:testTotalSupply() (gas: 515878) +TransferTest:testTransferNotAllowed() (gas: 10713) +TransferTest:testTransfersNotAllowed() (gas: 79496) +TransferTest:test_RevertWhen_AmountExceedsAccountSlashAmount() (gas: 544458) +TransferTest:test_RevertWhen_TransferIsNotAllowed() (gas: 39599) +TransferTest:test_Transfer() (gas: 377361) +TrustedCodehashAccessTest:test_RevertWhenProxyCloneCodehashNotTrusted() (gas: 2145486) +UnstakeTest:testOwner() (gas: 15319) +UnstakeTest:test_RevertWhen_FundsLocked() (gas: 464053) +UnstakeTest:test_RevertWhen_InvalidDestination() (gas: 157163) +UnstakeTest:test_StakeMultipleAccounts() (gas: 752633) +UnstakeTest:test_StakeMultipleAccountsAndRewards() (gas: 807398) +UnstakeTest:test_StakeMultipleAccountsMPIncreasesMaxMPDoesNotChange() (gas: 1417957) +UnstakeTest:test_StakeMultipleAccountsWithMinLockUp() (gas: 678935) +UnstakeTest:test_StakeMultipleAccountsWithRandomLockUp() (gas: 687439) +UnstakeTest:test_StakeMultipleTimesDoesNotExceedsMaxMP() (gas: 1846085) +UnstakeTest:test_StakeMultipleTimesWithLockIncreaseAtSameBlock() (gas: 721408) +UnstakeTest:test_StakeMultipleTimesWithLockZeroAfterMaxLock() (gas: 1250400) +UnstakeTest:test_StakeOneAccount() (gas: 433161) +UnstakeTest:test_StakeOneAccountAndRewards() (gas: 487901) +UnstakeTest:test_StakeOneAccountMPIncreasesMaxMPDoesNotChange() (gas: 875838) +UnstakeTest:test_StakeOneAccountReachingMPLimit() (gas: 761085) +UnstakeTest:test_StakeOneAccountWithMaxLockUp() (gas: 402335) +UnstakeTest:test_StakeOneAccountWithMinLockUp() (gas: 402909) +UnstakeTest:test_StakeOneAccountWithRandomLockUp() (gas: 402954) +UnstakeTest:test_UnstakeBonusMPAndAccuredMP() (gas: 780193) +UnstakeTest:test_UnstakeMultipleAccounts() (gas: 1120176) +UnstakeTest:test_UnstakeMultipleAccountsAndRewards() (gas: 1406867) +UnstakeTest:test_UnstakeOneAccount() (gas: 806891) +UnstakeTest:test_UnstakeOneAccountAndAccruedMP() (gas: 767236) +UnstakeTest:test_UnstakeOneAccountAndRewards() (gas: 719310) +UnstakeTest:test_UnstakeOneAccountWithLockUpAndAccruedMP() (gas: 747791) +UnstakeTest:test_UnstakeTransfersTokensBackToOwner() (gas: 183188) +UpdateAccountTest:test_UpdateAccount() (gas: 2758666) +UpgradeKarmaTest:testActualTokenBalanceOf() (gas: 618438) +UpgradeKarmaTest:testAddKarmaDistributorOnlyAdmin() (gas: 520366) +UpgradeKarmaTest:testBalanceOf() (gas: 605892) +UpgradeKarmaTest:testBalanceOfWithNoSystemTotalKarma() (gas: 74379) +UpgradeKarmaTest:testMintOnlyAdmin() (gas: 588123) +UpgradeKarmaTest:testRemoveKarmaDistributorOnlyOwner() (gas: 219753) +UpgradeKarmaTest:testRemoveUnknownKarmaDistributor() (gas: 41611) +UpgradeKarmaTest:testTotalSupply() (gas: 515872) +UpgradeKarmaTest:testTransfersNotAllowed() (gas: 79474) +UpgradeKarmaTest:test_RevertWhen_NonAdminTriesToUpgrade() (gas: 15878064) +UpgradeTest:test_RevertWhenNotOwner() (gas: 4169199) +UpgradeTest:test_UpgradeStakeManager() (gas: 10820892) +VotesTest:test_delegateBeforeRedeemingCreatesCheckpointsWithoutVotes() (gas: 518658) +VotesTest:test_redeemWithoutDelegatingBeforeDoesntCreateCheckpoints() (gas: 477217) +VotingCapabilityTest:testActualTokenBalanceOf() (gas: 618473) +VotingCapabilityTest:testAddKarmaDistributorOnlyAdmin() (gas: 520693) +VotingCapabilityTest:testBalanceOf() (gas: 605905) +VotingCapabilityTest:testBalanceOfWithNoSystemTotalKarma() (gas: 74379) +VotingCapabilityTest:testMintOnlyAdmin() (gas: 588147) +VotingCapabilityTest:testRemoveKarmaDistributorOnlyOwner() (gas: 220132) +VotingCapabilityTest:testRemoveUnknownKarmaDistributor() (gas: 41617) +VotingCapabilityTest:testTotalSupply() (gas: 515951) +VotingCapabilityTest:testTransfersNotAllowed() (gas: 79558) +VotingCapabilityTest:test_AcceptSignedDelegation() (gas: 384580) +VotingCapabilityTest:test_ChangeDelegation() (gas: 516362) +VotingCapabilityTest:test_DelegationWithBalance() (gas: 346479) +VotingCapabilityTest:test_DelegationWithoutBalance() (gas: 95616) +VotingCapabilityTest:test_DoesNotAddMoreThanOneCheckpointInBlock() (gas: 731083) +VotingCapabilityTest:test_GetPastVotesReturnsCorrectBalanceAtCheckpoints() (gas: 796538) +VotingCapabilityTest:test_GetPastVotesReturnsLatestIfAfterLastCheckpoint() (gas: 293972) +VotingCapabilityTest:test_GetPastVotesReturnsZeroBeforeFirstCheckpoint() (gas: 294174) +VotingCapabilityTest:test_GetPastVotesReturnsZeroWhenNoCheckpoints() (gas: 19960) +VotingCapabilityTest:test_InitialNonceIsZero() (gas: 17757) +VotingCapabilityTest:test_NumCheckpointsForDelegate() (gas: 915088) +VotingCapabilityTest:test_RecentCheckpoints() (gas: 983276) +VotingCapabilityTest:test_RejectBadDelegatee() (gas: 267150) +VotingCapabilityTest:test_RevertWhen_BadNonce() (gas: 235092) +VotingCapabilityTest:test_RevertWhen_ExpiredSignature() (gas: 203955) +VotingCapabilityTest:test_RevertWhen_GetPastVotesForFutureBlock() (gas: 15121) +VotingCapabilityTest:test_RevertWhen_MintingRisksOverflowingVotes() (gas: 115756) +VotingCapabilityTest:test_RevertWhen_ReusingSignature() (gas: 351648) +VotingCapabilityTest:test_TransferWithFullDelegation() (gas: 537765) +VotingCapabilityTest:test_TransferWithReceiverDelegation() (gas: 419423) +VotingCapabilityTest:test_TransferWithSenderDelegation() (gas: 429572) +VotingCapabilityTest:test_TransferWithoutDelegation() (gas: 311309) +WithdrawTest:testOwner() (gas: 15286) +WithdrawTest:test_RevertWhen_InsufficientAvailableBalance() (gas: 167225) +WithdrawTest:test_RevertWhen_InvalidDestination() (gas: 111158) +WithdrawTest:test_RewertWhen_WithdrawingStakedFundsWithoutCallingLeaveFirst() (gas: 460511) +WithdrawTest:test_WithdrawOtherTokenTransfersToDestination() (gas: 142285) +WithdrawTest:test_WithdrawStakedTokensAfterLeave() (gas: 556841) +WithdrawTest:test_WithdrawTransfersGenericTokenToOwner() (gas: 139595) \ No newline at end of file diff --git a/status-network-contracts/script/DeployProtocol.s.sol b/status-network-contracts/script/DeployProtocol.s.sol index 210fadd1ee..c1b0dbd128 100644 --- a/status-network-contracts/script/DeployProtocol.s.sol +++ b/status-network-contracts/script/DeployProtocol.s.sol @@ -11,12 +11,14 @@ import { DeployMetadataGeneratorScript } from "./DeployMetadataGenerator.s.sol"; import { DeployKarmaNFTScript } from "./DeployKarmaNFT.s.sol"; import { DeployStakeManagerScript } from "./DeployStakeManager.s.sol"; import { DeployVaultFactoryScript } from "./DeployVaultFactory.s.sol"; +import { DeploySimpleKarmaDistributorScript } from "./DeploySimpleKarmaDistributor.s.sol"; import { INFTMetadataGenerator } from "../src/interfaces/INFTMetadataGenerator.sol"; import { Karma } from "../src/Karma.sol"; import { KarmaNFT } from "../src/KarmaNFT.sol"; import { StakeManager } from "../src/StakeManager.sol"; import { VaultFactory } from "../src/VaultFactory.sol"; +import { SimpleKarmaDistributor } from "../src/SimpleKarmaDistributor.sol"; /** * @dev This script deploys the entire protocol including Karma, KarmaNFT, StakeManager, and VaultFactory. @@ -34,12 +36,15 @@ contract DeployProtocolScript is BaseScript { DeployVaultFactoryScript deployVaultFactory; + DeploySimpleKarmaDistributorScript deploySimpleKarmaDistributor; + constructor() BaseScript() { deployKarma = new DeployKarmaScript(); deployMetadataGenerator = new DeployMetadataGeneratorScript(); deployKarmaNFT = new DeployKarmaNFTScript(); deployStakeManager = new DeployStakeManagerScript(); deployVaultFactory = new DeployVaultFactoryScript(); + deploySimpleKarmaDistributor = new DeploySimpleKarmaDistributorScript(); } /** @@ -59,14 +64,14 @@ contract DeployProtocolScript is BaseScript { public returns ( Karma, - address, + address, /* karmaImpl */ INFTMetadataGenerator, KarmaNFT, StakeManager, - address, + address, /* stakeManagerImpl */ VaultFactory, - address, - address + address, /* vaultImpl */ + address /* vaultProxyClone */ ) { DeploymentConfig deploymentConfig = new DeploymentConfig(broadcaster); @@ -152,6 +157,10 @@ contract DeployProtocolScript is BaseScript { (vaultFactory, vaultImpl, vaultProxyClone) = deployVaultFactory.deploy(broadcaster, address(stakeManager), stakingToken); + console.log("Deploying SimpleRewardDistributor..."); + (SimpleKarmaDistributor simpleKarmaDistributor, address simpleKarmaDistributorImpl) = + deploySimpleKarmaDistributor.deploy(broadcaster, address(karma)); + console.log("\nContract addresses:"); console.log(address(karma), ": Karma (proxy)"); console.log(karmaImpl, ": Karma (implementation)"); @@ -162,20 +171,34 @@ contract DeployProtocolScript is BaseScript { console.log(address(vaultFactory), ": VaultFactory"); console.log(vaultImpl, ": StakeVault (implementation)"); console.log(vaultProxyClone, ": StakeVault (proxy clone)"); + console.log(address(simpleKarmaDistributor), ": SimpleKarmaDistributor (proxy)"); + console.log(simpleKarmaDistributorImpl, ": SimpleKarmaDistributor (implementation)"); /// INITIALIZATION vm.startBroadcast(broadcaster); console.log("\nInitializing contracts..."); + // add reward distributors to Karma karma.addRewardDistributor(address(stakeManager)); console.log("Added reward distributor (StakeManager)", address(stakeManager)); + karma.addRewardDistributor(address(simpleKarmaDistributor)); + console.log("Added reward distributor (SimpleKarmaDistributor)", address(simpleKarmaDistributor)); + // whitelist reward distributors for transferring Karma tokens + karma.setAllowedToTransfer(address(stakeManager), true); + console.log("Whitelisted reward distributor (StakeManager)", address(stakeManager), "for transfer"); karma.setAllowedToTransfer(address(stakeManager), true); - console.log("Whitelisted reward distributor", address(stakeManager), "for transfer"); + console.log( + "Whitelisted reward distributor (SimpleKarmaDistributor)", address(simpleKarmaDistributor), "for transfer" + ); + // configure Karma as reward supplier for reward distributors stakeManager.setRewardsSupplier(address(karma)); - console.log("Set rewards supplier (Karma) for StakeManager:", address(karma)); + console.log("Set rewards supplier (Karma) for StakeManager"); + simpleKarmaDistributor.setRewardsSupplier(address(karma)); + console.log("Set rewards supplier (Karma) for SimpleRewardDistributor"); + // whitelist StakeVault proxy clone codehash in StakeManager stakeManager.setTrustedCodehash(vaultProxyClone.codehash, true); console.log("Set trusted codehash for StakeVault proxy clone:", vaultProxyClone); vm.stopBroadcast(); diff --git a/status-network-contracts/script/DeploySimpleKarmaDistributor.s.sol b/status-network-contracts/script/DeploySimpleKarmaDistributor.s.sol index c78cf85929..6482dc090c 100644 --- a/status-network-contracts/script/DeploySimpleKarmaDistributor.s.sol +++ b/status-network-contracts/script/DeploySimpleKarmaDistributor.s.sol @@ -33,7 +33,7 @@ contract DeploySimpleKarmaDistributorScript is BaseScript { (distributor,) = _run(karmaAddress); } - function _run(address karmaAddress) internal broadcast returns (SimpleKarmaDistributor distributor, address impl) { + function _run(address karmaAddress) internal returns (SimpleKarmaDistributor distributor, address impl) { return deploy(broadcaster, karmaAddress); } From 6e80f72f46de393e5501336bd848e66c05a70cad Mon Sep 17 00:00:00 2001 From: r4bbit <445106+0x-r4bbit@users.noreply.github.com> Date: Mon, 10 Nov 2025 16:26:20 +0100 Subject: [PATCH 2/2] docs(README): update readme and make it more concise The readme has become a bit outdated. This commit removes outdated information and makes the document more evergreen. --- status-network-contracts/README.md | 179 +++++++---------------------- 1 file changed, 42 insertions(+), 137 deletions(-) diff --git a/status-network-contracts/README.md b/status-network-contracts/README.md index c9e5756dfb..e513c11fac 100644 --- a/status-network-contracts/README.md +++ b/status-network-contracts/README.md @@ -1,167 +1,76 @@ -# Staking Protocol [![Github Actions][gha-badge]][gha] [![Codecov][codecov-badge]][codecov] [![Foundry][foundry-badge]][foundry] +# Status Network Contracts -[gha]: https://github.com/vacp2p/staking-reward-streamer/actions -[gha-badge]: https://github.com/vacp2p/staking-reward-streamer/actions/workflows/test.yml/badge.svg -[codecov]: https://codecov.io/gh/vacp2p/staking-reward-streamer -[codecov-badge]: https://codecov.io/gh/vacp2p/staking-reward-streamer/graph/badge.svg -[foundry]: https://getfoundry.sh/ -[foundry-badge]: https://img.shields.io/badge/Built%20with-Foundry-FFDB1C.svg +Smart contracts for Status Network's Karma reputation system, which enables gasless transactions. -## 🧭 Overview +## Overview -The **Staking Reward Streamer Protocol** enables secure token staking with dynamic reward calculation on Ethereum. Built with modularity and upgradability in mind, the system includes core components to manage stake deposits, reward calculations, time-based locking, and contract migration through user consent. +This repository contains the core smart contracts that power the Status Network's reputation and reward system. The system is built with modularity and upgradability in mind. ---- +### Main Components -## 🧩 Core Contracts +- **Karma Token**: An ERC20 reputation token used throughout the Status Network ecosystem. Karma enables free transactions and access to network features. +- **Karma NFT**: A non-transferable ERC721 token that visually represents an account's Karma level. +- **Reward Distributors**: Contracts that implement custom reward distribution logic, including the staking reward distributor and simple distributor variants. +- **Staking System**: Allows users to stake SNT tokens to earn Karma rewards. +- **Karma Airdrop**: Merkle tree-based airdrop mechanism for distributing Karma to accounts. -### 🛠️ `StakeManager` +For a comprehensive overview of the system architecture, see [System Overview](docs/system-overview.md). -- Handles staking logic, tracks stakes and reward epochs. -- Calculates APY via **Multiplier Points**, which increase over time. -- Validates vaults using codehash verification for added safety. -- Upgradeable via proxy; users can opt out of migrations. +## Documentation -### 🔐 `StakeVault` +Detailed documentation is available in the [`docs`](docs) folder: -- A vault owned by the user, used to store and manage staked tokens. -- Interacts directly with `StakeManager` for staking and unstaking operations. -- Ensures only the owner can execute critical actions. -- Verifies contract code via codehash to ensure safety. +- [System Overview](docs/system-overview.md) - Architecture and component interactions +- [Karma Token](docs/karma.md) - Token mechanics and features +- [Staking Reward Distributor](docs/staking-reward-distributor/overview.md) - How staking and rewards work +- [Reward Distributors](docs/reward-distributors.md) - Custom reward distribution logic +- [Deployment Guide](docs/deployment.md) - How to deploy the contracts +- [Security](SECURITY.md) - Security considerations and audit information ---- +## Getting Started -## ✨ Features +### Prerequisites -- **Secure, user-owned staking vaults** -- **Dynamic APY via Multiplier Points** -- **Stake locking to boost rewards** -- **ERC20-compatible (via OpenZeppelin)** -- **Proxy upgradeability with opt-in/opt-out support** -- **Epoch-based reward streaming** +- [Foundry](https://getfoundry.sh/) - Ethereum development toolkit +- [pnpm](https://pnpm.io/) - Package manager ---- +### Installation -## 🚀 Getting Started - -### 📦 Install Dependencies - -```bash +```sh pnpm install ``` ---- - -## ⚙️ Usage - -### 📄 Deployment Flow - -1. **Deploy `StakeManager`** -2. **Deploy a sample `StakeVault` (e.g., on a devnet or testnet)** -3. **Configure codehash** in `StakeManager`: - -```solidity -stakeManager.setTrustedCodehash(, true); -``` - ---- - -### 💰 Staking - -1. **Approve** the `StakeVault` to spend your tokens: - -```solidity -erc20.approve(stakeVaultAddress, amount); -``` - -2. **Stake** your tokens: - -```solidity -stakeVault.stake(amount, secondsToLock); -``` - -> ⚠️ Do not transfer tokens directly to the `StakeVault`. Always use `approve` + `stake`. - -Minimum stake amount and lock duration are enforced via contract settings. Epochs are automatically processed on stake actions. - ---- - -### 🔓 Unstaking - -```solidity -stakeVault.unstake(amount); -``` - -- Only available for unlocked balances. -- Reduces stake proportionally based on amount and duration. - ---- - -### 🔁 Migration (Opt-In/Out) - -Users may opt-in to a new `StakeManager` implementation or leave: - -```solidity -stakeVault.acceptMigration(); // opt-in -stakeVault.leave(); // opt-out -``` - -> Migration triggers automatic reward claiming. Locked balances can still opt out. - ---- - -## 📬 Deployed Contracts - -These are the official contract deployments on the **Sepolia testnet** (via [Status Network Explorer](https://sepoliascan.status.network)): - -| Contract | Address | -|---------------------|-----------------------------------------------------------------------------------------------------| -| **StakeManagerProxy** | [0x2C09141e66970A71862beAcCbDb816ec01D6B676](https://sepoliascan.status.network/address/0x2C09141e66970A71862beAcCbDb816ec01D6B676?tab=contract) | -| **StakeManager** | [0xa2432fB545829f89E172ddE2DeD6D289c7ee125F](https://sepoliascan.status.network/address/0xa2432fB545829f89E172ddE2DeD6D289c7ee125F?tab=contract) | -| **VaultFactory** | [0xA6300Bd8aF26530D399a1b24B703EEf2c48a71Be](https://sepoliascan.status.network/address/0xA6300Bd8aF26530D399a1b24B703EEf2c48a71Be) | -| **KarmaProxy** | [0x486Ac0F5Eb7079075dE26739E1192D41F278a8db](https://sepoliascan.status.network/address/0x486Ac0F5Eb7079075dE26739E1192D41F278a8db) | -| **Karma** | [0xE9413C84eFF6B08E4F614Efe69EB7eb9a1Ca1180](https://sepoliascan.status.network/address/0xE9413C84eFF6B08E4F614Efe69EB7eb9a1Ca1180?tab=contract) | -| **KarmaNFT** | [0xdE5592e1001f52380f9EDE01aa6725F469A8e46F](https://sepoliascan.status.network/address/0xdE5592e1001f52380f9EDE01aa6725F469A8e46F?tab=contract) | - ---- - -## 🧪 Development - -### 🏗️ Build Contracts +### Build ```sh forge build ``` -### 🧹 Clean Build Artifacts - -```sh -forge clean -``` - -### 🧪 Run Tests +### Test ```sh forge test ``` -### 🧮 Coverage +### Coverage ```sh forge coverage ``` -### 🚀 Deploy Locally (Anvil) +## Development + +### Linting ```sh -forge script script/Deploy.s.sol --broadcast --fork-url http://localhost:8545 +pnpm lint ``` -> Requires `MNEMONIC` env variable. - ---- +### Formatting -## 📊 Gas & Linting +```sh +forge fmt +``` ### Gas Reports @@ -170,21 +79,17 @@ pnpm gas-report forge snapshot ``` -### Linting -```sh -pnpm lint -``` +## Deployment -### Formatting +The recommended way to deploy the full protocol is using the `DeployProtocol` script: ```sh -forge fmt +MNEMONIC=$YOUR_MNEMONIC forge script script/DeployProtocol.s.sol --rpc-url $RPC_URL --broadcast ``` -### Commit preparing command +For detailed deployment instructions, including verification and network configuration, see the [Deployment Guide](docs/deployment.md). -```sh -pnpm adorno -``` +## License +This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.