Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TERA-168] Add burner role for burn functions #24

Merged
merged 10 commits into from
Oct 1, 2024

Conversation

stanleygtrillion
Copy link
Contributor

@stanleygtrillion stanleygtrillion commented Sep 3, 2024

Add BURNER_ROLE and burnByBurnerOnly function to FiatToken
this is to allow a contract to have BURNER_ROLE who only can perform token burn

Copy link

openzeppelin-code bot commented Sep 3, 2024

Add burner role for burn functions

Generated at commit: c72bab630cda416d13f81d5b252cc064505bb7c6

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
0
0
0
3
9
12
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

@stanleygtrillion stanleygtrillion self-assigned this Sep 4, 2024
Copy link
Contributor

@snggeng snggeng left a comment

Choose a reason for hiding this comment

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

oh i hadn't realized that the original burn and mint didn't have virtual and so cannot be overriden. maybe worth thinking about whether we want to go forward with this or not. if we do, maybe what we want to do is to "deprecate" the original mint/burn by removing the MINTER_ROLE altogether and set new ones. So technically no account has permissions to call those functions

Copy link

github-actions bot commented Sep 9, 2024

Changes to gas cost

Generated at commit: 427fd29756af7d0d285d97d5fa430b6aa36cd14f, compared to commit: c6201580173d4e5e6b424f96f59e314500a3ae78

🧾 Summary (20% most significant diffs)

Contract Method Avg (+/-) %
ERC1967Proxy grantRole
version
+10,772 ❌
-750 ✅
+24.29%
-18.52%

Full diff report 👇
Contract Deployment Cost (+/-) Method Min (+/-) % Avg (+/-) % Median (+/-) % Max (+/-) % # Calls (+/-)
ERC1967Proxy 476,240 (0) balanceOf
blacklist
grantRole
hasRole
isBlacklisted
mint
pause
renounceRole
revokeRole
totalSupply
transfer
unBlacklist
version
1,150 (0)
29,261 (0)
32,045 (0)
1,127 (0)
1,060 (0)
29,461 (0)
28,752 (0)
30,026 (0)
31,978 (0)
806 (0)
26,830 (0)
29,197 (0)
1,050 (0)
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
0.00%
1,410 (-82)
48,674 (+1,945)
55,117 (+10,772)
2,482 (-321)
2,560 (-937)
77,890 (+2,080)
48,219 (+779)
30,031 (+5)
33,725 (+428)
3,790 (-56)
39,588 (-1,713)
30,124 (+235)
3,300 (-750)
-5.50%
+4.16%
+24.29%
-11.45%
-26.79%
+2.74%
+1.64%
+0.02%
+1.29%
-1.46%
-4.15%
+0.79%
-18.52%
1,150 (0)
52,552 (0)
56,656 (+12,311)
3,127 (0)
1,060 (0)
84,935 (+6)
52,113 (0)
30,031 (+5)
34,582 (+1,285)
1,806 (-1,000)
33,703 (-1,224)
30,582 (+693)
3,300 (-2,250)
0.00%
0.00%
+27.76%
0.00%
0.00%
+0.01%
0.00%
+0.02%
+3.86%
-35.64%
-3.50%
+2.32%
-40.54%
7,650 (0)
52,564 (+12)
56,656 (+10)
3,627 (0)
7,560 (0)
85,076 (0)
52,113 (0)
30,036 (+10)
34,616 (0)
7,306 (0)
63,301 (0)
30,594 (+12)
5,550 (0)
0.00%
+0.02%
+0.02%
0.00%
0.00%
0.00%
0.00%
+0.03%
0.00%
0.00%
0.00%
+0.04%
0.00%
25 (+6)
6 (+2)
16 (+14)
23 (+6)
13 (+5)
22 (+5)
6 (+1)
2 (+1)
3 (+1)
32 (+7)
7 (+1)
3 (+1)
6 (+3)
FiatTokenV1 2,498,811 (0) initialize 70,956 (0) 0.00% 333,594 (+149) +0.04% 339,848 (0) 0.00% 339,848 (0) 0.00% 43 (+1)

Copy link

github-actions bot commented Sep 9, 2024

Coverage after merging add-burner-role into main will be

70.42%▴ +0.86%

Coverage Report for Changed Files
FileStmtsBranchesFuncsLinesUncovered Lines
script
   UpgradeFiatToken.s.sol0%100%0%0%12–13, 15–16, 18–20
src/v2
   FiatTokenV2.sol100%100%100%100%
test/v1
   FiatTokenV1.t.sol100%100%100%100%

Copy link
Contributor

@snggeng snggeng left a comment

Choose a reason for hiding this comment

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

LGTM

@stanleygtrillion stanleygtrillion changed the title Add burner role for burn functions [TERA-168] Add burner role for burn functions Sep 10, 2024
Copy link

@stanleygtrillion stanleygtrillion merged commit 5422f36 into main Oct 1, 2024
7 checks passed
@stanleygtrillion stanleygtrillion deleted the add-burner-role branch October 1, 2024 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants