Skip to content

Commit

Permalink
remove automatic mint and burn role granting in BurnMintERC20 constru…
Browse files Browse the repository at this point in the history
…ctor
  • Loading branch information
jhweintraub committed Nov 11, 2024
1 parent 11c5898 commit 9aee6d0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 18 deletions.
16 changes: 8 additions & 8 deletions contracts/gas-snapshots/ccip.gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -173,20 +173,20 @@ FeeQuoter_getValidatedFee:test_NotAFeeToken_Revert() (gas: 21280)
FeeQuoter_getValidatedFee:test_SingleTokenMessage_Success() (gas: 114442)
FeeQuoter_getValidatedFee:test_TooManyTokens_Revert() (gas: 23473)
FeeQuoter_getValidatedFee:test_ZeroDataAvailabilityMultiplier_Success() (gas: 63843)
FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Above18Decimals_Success() (gas: 1968881)
FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Below18Decimals_Success() (gas: 1968839)
FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt0Decimals_Success() (gas: 1948958)
FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt18Decimals_Success() (gas: 1968613)
FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFlippedDecimals_Success() (gas: 1968817)
FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedMaxInt224Value_Success() (gas: 1968629)
FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Above18Decimals_Success() (gas: 1919674)
FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Below18Decimals_Success() (gas: 1919632)
FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt0Decimals_Success() (gas: 1899751)
FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt18Decimals_Success() (gas: 1919406)
FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFlippedDecimals_Success() (gas: 1919610)
FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedMaxInt224Value_Success() (gas: 1919422)
FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedOverStalenessPeriod_Success() (gas: 65210)
FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeed_Success() (gas: 65090)
FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPrice_Success() (gas: 58872)
FeeQuoter_getValidatedTokenPrice:test_OverflowFeedPrice_Revert() (gas: 1968255)
FeeQuoter_getValidatedTokenPrice:test_OverflowFeedPrice_Revert() (gas: 1919048)
FeeQuoter_getValidatedTokenPrice:test_StaleFeeToken_Success() (gas: 61821)
FeeQuoter_getValidatedTokenPrice:test_TokenNotSupportedFeed_Revert() (gas: 116926)
FeeQuoter_getValidatedTokenPrice:test_TokenNotSupported_Revert() (gas: 14160)
FeeQuoter_getValidatedTokenPrice:test_UnderflowFeedPrice_Revert() (gas: 1966932)
FeeQuoter_getValidatedTokenPrice:test_UnderflowFeedPrice_Revert() (gas: 1917725)
FeeQuoter_onReport:test_OnReport_StaleUpdate_SkipPriceUpdate_Success() (gas: 43936)
FeeQuoter_onReport:test_onReport_InvalidForwarder_Reverts() (gas: 23657)
FeeQuoter_onReport:test_onReport_Success() (gas: 80700)
Expand Down
12 changes: 6 additions & 6 deletions contracts/gas-snapshots/shared.gas-snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ AuthorizedCallers_constructor:test_ZeroAddressNotAllowed_Revert() (gas: 64390)
AuthorizedCallers_constructor:test_constructor_Success() (gas: 674931)
BurnMintERC20approve:test_Approve_Success() (gas: 55564)
BurnMintERC20approve:test_InvalidAddress_Reverts() (gas: 10663)
BurnMintERC20burn:test_BasicBurn_Success() (gas: 135713)
BurnMintERC20burn:test_BasicBurn_Success() (gas: 153474)
BurnMintERC20burn:test_BurnFromZeroAddress_Reverts() (gas: 43655)
BurnMintERC20burn:test_ExceedsBalance_Reverts() (gas: 21711)
BurnMintERC20burn:test_SenderNotBurner_Reverts() (gas: 19837)
BurnMintERC20burn:test_SenderNotBurner_Reverts() (gas: 19578)
BurnMintERC20burnFrom:test_BurnFrom_Success() (gas: 57874)
BurnMintERC20burnFrom:test_ExceedsBalance_Reverts() (gas: 35788)
BurnMintERC20burnFrom:test_InsufficientAllowance_Reverts() (gas: 21720)
BurnMintERC20burnFrom:test_SenderNotBurner_Reverts() (gas: 19804)
BurnMintERC20burnFrom:test_SenderNotBurner_Reverts() (gas: 19545)
BurnMintERC20burnFromAlias:test_BurnFrom_Success() (gas: 57918)
BurnMintERC20burnFromAlias:test_ExceedsBalance_Reverts() (gas: 35821)
BurnMintERC20burnFromAlias:test_InsufficientAllowance_Reverts() (gas: 21762)
BurnMintERC20burnFromAlias:test_SenderNotBurner_Reverts() (gas: 19846)
BurnMintERC20constructor:test_Constructor_Success() (gas: 1762798)
BurnMintERC20burnFromAlias:test_SenderNotBurner_Reverts() (gas: 19587)
BurnMintERC20constructor:test_Constructor_Success() (gas: 1708881)
BurnMintERC20decreaseApproval:test_DecreaseApproval_Success() (gas: 31192)
BurnMintERC20getCCIPAdmin:test_getCCIPAdmin_Success() (gas: 10525)
BurnMintERC20getCCIPAdmin:test_setCCIPAdmin_Success() (gas: 21612)
BurnMintERC20grantMintAndBurnRoles:test_GrantMintAndBurnRoles_Success() (gas: 79321)
BurnMintERC20increaseApproval:test_IncreaseApproval_Success() (gas: 44163)
BurnMintERC20mint:test_BasicMint_Success() (gas: 57263)
BurnMintERC20mint:test_BasicMint_Success() (gas: 101665)
BurnMintERC20mint:test_MaxSupplyExceeded_Reverts() (gas: 50037)
BurnMintERC20mint:test_SenderNotMinter_Reverts() (gas: 11479)
BurnMintERC20supportsInterface:test_SupportsInterface_Success() (gas: 11217)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ contract BurnMintERC20constructor is BurnMintERC20Setup {
assertEq(maxSupply, s_burnMintERC20.maxSupply());

assertTrue(s_burnMintERC20.hasRole(s_burnMintERC20.DEFAULT_ADMIN_ROLE(), s_alice));
assertTrue(s_burnMintERC20.hasRole(s_burnMintERC20.MINTER_ROLE(), s_alice));
assertTrue(s_burnMintERC20.hasRole(s_burnMintERC20.BURNER_ROLE(), s_alice));
assertEq(s_burnMintERC20.balanceOf(s_alice), 1e18);
assertEq(s_burnMintERC20.totalSupply(), 1e18);
}
Expand Down
2 changes: 0 additions & 2 deletions contracts/src/v0.8/shared/token/ERC20/BurnMintERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ contract BurnMintERC20 is IBurnMintERC20, IGetCCIPAdmin, IERC165, ERC20Burnable,

// Set up the owner as the initial minter and burner
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
_grantRole(MINTER_ROLE, msg.sender);
_grantRole(BURNER_ROLE, msg.sender);
}

/// @inheritdoc IERC165
Expand Down

0 comments on commit 9aee6d0

Please sign in to comment.