SlideShare a Scribd company logo
1 of 11
18th JANUARY 2021 
 
- 
version v2.0 
Smart Contract Security Audit and General Analysis 
 
 
COPYRIGHT 2021. HAECHI AUDIT. all rights reserved 
 
Table of Contents 
0 Issues (0 Critical, 0 Major, 2 Minor) Found 
Table of Contents 
About HAECHI AUDIT 
01. Introduction 
02. Summary 
Issues 
03. Overview 
Contracts Subject to Audit 
Roles 
Notice 
04. Issues Found 
MINOR : BunnyToken#delegateBySig() can be called with (nonce, expiry) which was 
not used to generate the (v, r, s). (Found - v1.0) 
MINOR : BunnyPool,VaultFlipToCake#notifyRewardAmount() can decrease 
rewardRate (Found - v1.0) (Intended Behavior - v2.0) 
05. Disclaimer 
   
COPYRIGHT 2021. HAECHI AUDIT. all rights reserved 1 
 
 
About HAECHI AUDIT 
HAECHI AUDIT is a global leading smart contract security audit and development firm 
operated by HAECHI LABS. HAECHI AUDIT consists of professionals with years of 
experience in blockchain R&D and provides the most reliable smart contract security audit 
and development services. 
So far, based on the HAECHI AUDIT's security audit report, our clients have been 
successfully listed on the global cryptocurrency exchanges such as Huobi, Upbit, OKEX, 
and others.  
Our notable portfolios include SK Telecom, Ground X by Kakao, and Carry Protocol while 
HAECHI AUDIT has conducted security audits for the world's top projects and enterprises. 
Trusted by the industry leaders, we have been incubated by Samsung Electronics and 
awarded the Ethereum Foundation Grants and Ethereum Community Fund. 
Contact : ​audit@haechi.io 
Website : audit.haechi.io 
 
 
 
COPYRIGHT 2021. HAECHI AUDIT. all rights reserved 2 
 
 
01. Introduction 
This report was written to provide a security audit for the PancakeBunny smart contract. 
HAECHI AUDIT conducted the audit focusing on whether PancakeBunny smart contract is 
designed and implemented in accordance with publicly released information and whether 
it has any security vulnerabilities. 
The issues found are classified as​ , , or according to 
their severity. 
 
HAECHI AUDIT advises addressing all the issues found in this report. 
 
 
 
 
 
COPYRIGHT 2021. HAECHI AUDIT. all rights reserved 3 
 
 
Critical issues are security vulnerabilities that MUST be addressed in 
order to prevent widespread and massive damage. 
 
Major issues contain security vulnerabilities or have faulty 
implementation issues and need to be fixed.  
  
Minor issues are some potential risks that require some degree of 
modification.  
 
Tips ​could help improve the code’s usability and efficiency 
 
02. Summary 
The code used for the audit can be found at GitHub 
(https://github.com/PancakeBunny-finance/Bunny). The last commit for the code audited 
is at “b4501d84e60954b0d645e3e54aa3488f6c675221”.  
Issues 
HAECHI AUDIT has 0 Critical Issues, 0 Major Issues, and 2 Minor Issue. 
   
COPYRIGHT 2021. HAECHI AUDIT. all rights reserved 4 
 
Severity  Issue  Status 
 
BunnyToken#delegateBySig() can be 
called with (nonce, expiry) which was not 
used to generate the (v, r, s).  
(Found v1.0) 
 
BunnyPool,VaultFlipToCake#notifyRewar
dAmount() can decrease rewardRate 
(Found v1.0) 
(Intended Behavior - 
v2.0) 
NOTICE 
Non-audited, changeable external 
contract 
(Found v1.0) 
 
03. Overview 
Contracts Subject to Audit 
● BunnyMinter.sol 
● BunnyToken.sol 
● BunnyPool.sol 
● BunnyBNBPool.sol 
● VaultCakeToCake.sol 
● VaultFlipToFlip.sol 
● VaultFlipToCake.sol 
 
Roles 
The PancakeBunny Smart contract has the following authorizations: 
• Owner 
• Minter 
• Keeper 
• RewardDistribution 
The features accessible by each level of authorization is as follows: 
COPYRIGHT 2021. HAECHI AUDIT. all rights reserved 5 
 
Role  Functions 
Owner 
● BunnyToken 
○ mint 
● VaultFlipToCake 
○ setMinter 
○ setRewardsToken 
○ setRewardsDuration 
○ recoverToken 
● BunnyMinter 
○ transferBunnyOwner 
○ setWithdrawalFee 
○ setPerformanceFee 
○ setWithdrawalFeeFreePeriod 
○ setMinter 
○ setBunnyPerProfitBNB 
○ setBunnyPerBunnyBNBFlip 
 
 
Notice 
- Non-audited, changeable external contract 
Haechi has found that PancakeBunny protocol used “StrategyHelper” contract in 
several parts for getting tvl, apy. Although this helper is used to get data, not 
writing data which is much safer. But this “helper” can be changed by the owner 
and this can lead to price manipulation. Also, these view functions which depend on 
COPYRIGHT 2021. HAECHI AUDIT. all rights reserved 6 
 
○ setHelper 
● VaultController 
○ setMinter 
○ recoverToken 
● VaultFlipToFlip 
○ recoverToken 
● BunnyPool 
○ setRewardsToken 
○ setHelper 
○ recoverBEP20 
○ setRewardsDuration 
● BunnyBNBPool 
○ setFlipToken 
○ setMinter 
○ setHelper 
Minter 
● BunnyMinter 
○ mintFor 
○ mintForBunnyBNB 
Keeper 
● VaultController 
○ setKeeper 
● VaultFlipToFlip 
○ harvest 
RewardDistributio
n 
● VaultFlipToCake 
○ notifyRewardAmont 
● BunnyPool 
○ notifyRewardAmount 
 
helper contracts, are weak to flash loan attacks. Do not trust these functions as a 
price table when building on top of this protocol. 
If you are an end-user, this issue will not expose much issue/security risk to you. 
But if you build something on top of this code, be aware of the above issue. 
   
COPYRIGHT 2021. HAECHI AUDIT. all rights reserved 7 
 
 
04. Issues Found 
MMINOR : BunnyToken#delegateBySig() can be called with (nonce, expiry) 
which was not used to generate the (v, r, s). ​(Found - v1.0) 
 
Problem Statement 
BunnyToken#delegateBySIg() ​is designed to delegate the voting right with 
meta-transaction. In this case, the delegator generates (v, r, s) by signing (nonce,expiry) 
with its privateKey. Delegatee(or any other one who can call this function) will call 
delegateBySig() with these parameter. Then the function should verify if the (v,r,s) is 
signed by delegator, but in BunnyToken, it does not check if the signer is the delegator. 
Which will result in delegating another address’s voting power instead of the delegator if 
(nonce, expiry) is not the one that was signed. 
Recommendation 
Add one more parameter in delegateBySig() function that gets delegator’s address and 
verify if ecrecovered address is delegator. 
Disclaimer 
- This issue has been found on most well-known governance tokens, since these 
“delegate” parts are copy and pasted which results in almost the same codes 
being used over and over again. 
- Although this looks very malicious, it is nearly impossible to find (nonce,expiry) 
that will result in making another user with voting power to delegate instead of 
the actual signer. 
- If you are an end-user, this issue will not expose much issue/security risk to 
you. But if you are going to build on top of this code, such as opening a website 
to receive voting power using delegateBySig, or some kind of reward system 
contract that rewards users when delegate, be aware that this “delegateBySig” 
won’t guarantee the signature is valid. 
 
   
COPYRIGHT 2021. HAECHI AUDIT. all rights reserved 8 
 
 
MINOR : BunnyPool,VaultFlipToCake#notifyRewardAmount() can decrease 
rewardRate ​(Found - v1.0) (Intended Behavior - v2.0) 
 
Problem Statement 
notifyRewardAmount() does not check if the rewardRate decreases after notification. 
Since it updates rate to be​ (leftoverRate + notified reward)/duration​ when previous reward is 
not finished, if admin keeps notifying with zero reward, it can lead to continuous decrease 
on reward rate, 
Since this function is designed to be only called by admin, this error can only be done by 
admin. 
Recommendation 
Check if rewardRate increases after notifying reward. 
Update 
Pancake Bunny team has confirmed that this is a intended behavior   
COPYRIGHT 2021. HAECHI AUDIT. all rights reserved 9 
 
 
05. Disclaimer 
This report is not an advice on investment, nor does it guarantee adequacy of a business 
model and/or a bug-free code. This report should be used only to discuss known technical 
problems. The code may include problems on Ethereum that are not included in this 
report. It will be necessary to resolve addressed issues and conduct thorough tests to 
ensure the safety of the smart contract. 
COPYRIGHT 2021. HAECHI AUDIT. all rights reserved 10 
 

More Related Content

Similar to [Haechi Audit] Pancake Bunny Smart Contract Audit Report

December Patch Tuesday 2020
December Patch Tuesday 2020December Patch Tuesday 2020
December Patch Tuesday 2020Ivanti
 
Ivanti Patch Tuesday for April 2020
Ivanti Patch Tuesday for April 2020Ivanti Patch Tuesday for April 2020
Ivanti Patch Tuesday for April 2020Ivanti
 
Ivanti Patch Tuesday for October 2019
Ivanti Patch Tuesday for October 2019Ivanti Patch Tuesday for October 2019
Ivanti Patch Tuesday for October 2019Ivanti
 
2022 March Patch Tuesday
2022 March Patch Tuesday2022 March Patch Tuesday
2022 March Patch TuesdayIvanti
 
Patch Tuesday for January 2020
Patch Tuesday for January 2020Patch Tuesday for January 2020
Patch Tuesday for January 2020Ivanti
 
Mergebase dont-let-vulns-run-wild
Mergebase dont-let-vulns-run-wildMergebase dont-let-vulns-run-wild
Mergebase dont-let-vulns-run-wildJaredHarris18
 
Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!
Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!
Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!Anderson Bassani
 
October2020 patchtuesday[1] read-only
October2020 patchtuesday[1]     read-onlyOctober2020 patchtuesday[1]     read-only
October2020 patchtuesday[1] read-onlyIvanti
 
January 2021 Patch Tuesday
January 2021 Patch TuesdayJanuary 2021 Patch Tuesday
January 2021 Patch TuesdayIvanti
 
February 2018 Patch Tuesday Analysis
February 2018 Patch Tuesday AnalysisFebruary 2018 Patch Tuesday Analysis
February 2018 Patch Tuesday AnalysisIvanti
 
July Patch Tuesday 2019
July Patch Tuesday 2019July Patch Tuesday 2019
July Patch Tuesday 2019Ivanti
 
September Patch Tuesday- 2020
September Patch Tuesday- 2020September Patch Tuesday- 2020
September Patch Tuesday- 2020Ivanti
 
27.2.15 lab investigating a malware exploit
27.2.15 lab   investigating a malware exploit27.2.15 lab   investigating a malware exploit
27.2.15 lab investigating a malware exploitFreddy Buenaño
 
July Patch Tuesday 2020
July Patch Tuesday 2020July Patch Tuesday 2020
July Patch Tuesday 2020Dan Lalli
 
October Patch Tuesday Analysis 2018
October Patch Tuesday Analysis 2018October Patch Tuesday Analysis 2018
October Patch Tuesday Analysis 2018Ivanti
 
How to detect, assess, prioritize, and remediate vulnerabilities using SanerNow?
How to detect, assess, prioritize, and remediate vulnerabilities using SanerNow?How to detect, assess, prioritize, and remediate vulnerabilities using SanerNow?
How to detect, assess, prioritize, and remediate vulnerabilities using SanerNow?SecPod
 
Patch Tuesday November - 2020
Patch Tuesday November - 2020Patch Tuesday November - 2020
Patch Tuesday November - 2020Ivanti
 
November Patch Tuesday 2020
November Patch Tuesday 2020 November Patch Tuesday 2020
November Patch Tuesday 2020 Ivanti
 
Ivanti Patch Tuesday for June 2020
Ivanti Patch Tuesday for June 2020Ivanti Patch Tuesday for June 2020
Ivanti Patch Tuesday for June 2020Ivanti
 
How GitLab and HackerOne help organizations innovate faster without compromis...
How GitLab and HackerOne help organizations innovate faster without compromis...How GitLab and HackerOne help organizations innovate faster without compromis...
How GitLab and HackerOne help organizations innovate faster without compromis...HackerOne
 

Similar to [Haechi Audit] Pancake Bunny Smart Contract Audit Report (20)

December Patch Tuesday 2020
December Patch Tuesday 2020December Patch Tuesday 2020
December Patch Tuesday 2020
 
Ivanti Patch Tuesday for April 2020
Ivanti Patch Tuesday for April 2020Ivanti Patch Tuesday for April 2020
Ivanti Patch Tuesday for April 2020
 
Ivanti Patch Tuesday for October 2019
Ivanti Patch Tuesday for October 2019Ivanti Patch Tuesday for October 2019
Ivanti Patch Tuesday for October 2019
 
2022 March Patch Tuesday
2022 March Patch Tuesday2022 March Patch Tuesday
2022 March Patch Tuesday
 
Patch Tuesday for January 2020
Patch Tuesday for January 2020Patch Tuesday for January 2020
Patch Tuesday for January 2020
 
Mergebase dont-let-vulns-run-wild
Mergebase dont-let-vulns-run-wildMergebase dont-let-vulns-run-wild
Mergebase dont-let-vulns-run-wild
 
Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!
Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!
Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!
 
October2020 patchtuesday[1] read-only
October2020 patchtuesday[1]     read-onlyOctober2020 patchtuesday[1]     read-only
October2020 patchtuesday[1] read-only
 
January 2021 Patch Tuesday
January 2021 Patch TuesdayJanuary 2021 Patch Tuesday
January 2021 Patch Tuesday
 
February 2018 Patch Tuesday Analysis
February 2018 Patch Tuesday AnalysisFebruary 2018 Patch Tuesday Analysis
February 2018 Patch Tuesday Analysis
 
July Patch Tuesday 2019
July Patch Tuesday 2019July Patch Tuesday 2019
July Patch Tuesday 2019
 
September Patch Tuesday- 2020
September Patch Tuesday- 2020September Patch Tuesday- 2020
September Patch Tuesday- 2020
 
27.2.15 lab investigating a malware exploit
27.2.15 lab   investigating a malware exploit27.2.15 lab   investigating a malware exploit
27.2.15 lab investigating a malware exploit
 
July Patch Tuesday 2020
July Patch Tuesday 2020July Patch Tuesday 2020
July Patch Tuesday 2020
 
October Patch Tuesday Analysis 2018
October Patch Tuesday Analysis 2018October Patch Tuesday Analysis 2018
October Patch Tuesday Analysis 2018
 
How to detect, assess, prioritize, and remediate vulnerabilities using SanerNow?
How to detect, assess, prioritize, and remediate vulnerabilities using SanerNow?How to detect, assess, prioritize, and remediate vulnerabilities using SanerNow?
How to detect, assess, prioritize, and remediate vulnerabilities using SanerNow?
 
Patch Tuesday November - 2020
Patch Tuesday November - 2020Patch Tuesday November - 2020
Patch Tuesday November - 2020
 
November Patch Tuesday 2020
November Patch Tuesday 2020 November Patch Tuesday 2020
November Patch Tuesday 2020
 
Ivanti Patch Tuesday for June 2020
Ivanti Patch Tuesday for June 2020Ivanti Patch Tuesday for June 2020
Ivanti Patch Tuesday for June 2020
 
How GitLab and HackerOne help organizations innovate faster without compromis...
How GitLab and HackerOne help organizations innovate faster without compromis...How GitLab and HackerOne help organizations innovate faster without compromis...
How GitLab and HackerOne help organizations innovate faster without compromis...
 

Recently uploaded

Catalogue ONG NUOC PPR DE NHAT .pdf
Catalogue ONG NUOC PPR DE NHAT      .pdfCatalogue ONG NUOC PPR DE NHAT      .pdf
Catalogue ONG NUOC PPR DE NHAT .pdfOrient Homes
 
rishikeshgirls.in- Rishikesh call girl.pdf
rishikeshgirls.in- Rishikesh call girl.pdfrishikeshgirls.in- Rishikesh call girl.pdf
rishikeshgirls.in- Rishikesh call girl.pdfmuskan1121w
 
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999Tina Ji
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Dipal Arora
 
7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...Paul Menig
 
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...anilsa9823
 
GD Birla and his contribution in management
GD Birla and his contribution in managementGD Birla and his contribution in management
GD Birla and his contribution in managementchhavia330
 
Sales & Marketing Alignment: How to Synergize for Success
Sales & Marketing Alignment: How to Synergize for SuccessSales & Marketing Alignment: How to Synergize for Success
Sales & Marketing Alignment: How to Synergize for SuccessAggregage
 
Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023Neil Kimberley
 
A DAY IN THE LIFE OF A SALESMAN / WOMAN
A DAY IN THE LIFE OF A  SALESMAN / WOMANA DAY IN THE LIFE OF A  SALESMAN / WOMAN
A DAY IN THE LIFE OF A SALESMAN / WOMANIlamathiKannappan
 
Cash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call GirlsCash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call GirlsApsara Of India
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMRavindra Nath Shukla
 
Vip Female Escorts Noida 9711199171 Greater Noida Escorts Service
Vip Female Escorts Noida 9711199171 Greater Noida Escorts ServiceVip Female Escorts Noida 9711199171 Greater Noida Escorts Service
Vip Female Escorts Noida 9711199171 Greater Noida Escorts Serviceankitnayak356677
 
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...lizamodels9
 
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,noida100girls
 
Tech Startup Growth Hacking 101 - Basics on Growth Marketing
Tech Startup Growth Hacking 101  - Basics on Growth MarketingTech Startup Growth Hacking 101  - Basics on Growth Marketing
Tech Startup Growth Hacking 101 - Basics on Growth MarketingShawn Pang
 
2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis UsageNeil Kimberley
 
Intro to BCG's Carbon Emissions Benchmark_vF.pdf
Intro to BCG's Carbon Emissions Benchmark_vF.pdfIntro to BCG's Carbon Emissions Benchmark_vF.pdf
Intro to BCG's Carbon Emissions Benchmark_vF.pdfpollardmorgan
 
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service Jamshedpur
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service JamshedpurVIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service Jamshedpur
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service JamshedpurSuhani Kapoor
 

Recently uploaded (20)

Catalogue ONG NUOC PPR DE NHAT .pdf
Catalogue ONG NUOC PPR DE NHAT      .pdfCatalogue ONG NUOC PPR DE NHAT      .pdf
Catalogue ONG NUOC PPR DE NHAT .pdf
 
rishikeshgirls.in- Rishikesh call girl.pdf
rishikeshgirls.in- Rishikesh call girl.pdfrishikeshgirls.in- Rishikesh call girl.pdf
rishikeshgirls.in- Rishikesh call girl.pdf
 
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999
Russian Faridabad Call Girls(Badarpur) : ☎ 8168257667, @4999
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
 
7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...7.pdf This presentation captures many uses and the significance of the number...
7.pdf This presentation captures many uses and the significance of the number...
 
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
 
GD Birla and his contribution in management
GD Birla and his contribution in managementGD Birla and his contribution in management
GD Birla and his contribution in management
 
Sales & Marketing Alignment: How to Synergize for Success
Sales & Marketing Alignment: How to Synergize for SuccessSales & Marketing Alignment: How to Synergize for Success
Sales & Marketing Alignment: How to Synergize for Success
 
Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023Mondelez State of Snacking and Future Trends 2023
Mondelez State of Snacking and Future Trends 2023
 
A DAY IN THE LIFE OF A SALESMAN / WOMAN
A DAY IN THE LIFE OF A  SALESMAN / WOMANA DAY IN THE LIFE OF A  SALESMAN / WOMAN
A DAY IN THE LIFE OF A SALESMAN / WOMAN
 
Cash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call GirlsCash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call Girls
 
Monte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSMMonte Carlo simulation : Simulation using MCSM
Monte Carlo simulation : Simulation using MCSM
 
KestrelPro Flyer Japan IT Week 2024 (English)
KestrelPro Flyer Japan IT Week 2024 (English)KestrelPro Flyer Japan IT Week 2024 (English)
KestrelPro Flyer Japan IT Week 2024 (English)
 
Vip Female Escorts Noida 9711199171 Greater Noida Escorts Service
Vip Female Escorts Noida 9711199171 Greater Noida Escorts ServiceVip Female Escorts Noida 9711199171 Greater Noida Escorts Service
Vip Female Escorts Noida 9711199171 Greater Noida Escorts Service
 
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
Lowrate Call Girls In Laxmi Nagar Delhi ❤️8860477959 Escorts 100% Genuine Ser...
 
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
BEST Call Girls In Old Faridabad ✨ 9773824855 ✨ Escorts Service In Delhi Ncr,
 
Tech Startup Growth Hacking 101 - Basics on Growth Marketing
Tech Startup Growth Hacking 101  - Basics on Growth MarketingTech Startup Growth Hacking 101  - Basics on Growth Marketing
Tech Startup Growth Hacking 101 - Basics on Growth Marketing
 
2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage2024 Numerator Consumer Study of Cannabis Usage
2024 Numerator Consumer Study of Cannabis Usage
 
Intro to BCG's Carbon Emissions Benchmark_vF.pdf
Intro to BCG's Carbon Emissions Benchmark_vF.pdfIntro to BCG's Carbon Emissions Benchmark_vF.pdf
Intro to BCG's Carbon Emissions Benchmark_vF.pdf
 
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service Jamshedpur
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service JamshedpurVIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service Jamshedpur
VIP Call Girl Jamshedpur Aashi 8250192130 Independent Escort Service Jamshedpur
 

[Haechi Audit] Pancake Bunny Smart Contract Audit Report

  • 1. 18th JANUARY 2021    -  version v2.0  Smart Contract Security Audit and General Analysis      COPYRIGHT 2021. HAECHI AUDIT. all rights reserved 
  • 2.   Table of Contents  0 Issues (0 Critical, 0 Major, 2 Minor) Found  Table of Contents  About HAECHI AUDIT  01. Introduction  02. Summary  Issues  03. Overview  Contracts Subject to Audit  Roles  Notice  04. Issues Found  MINOR : BunnyToken#delegateBySig() can be called with (nonce, expiry) which was  not used to generate the (v, r, s). (Found - v1.0)  MINOR : BunnyPool,VaultFlipToCake#notifyRewardAmount() can decrease  rewardRate (Found - v1.0) (Intended Behavior - v2.0)  05. Disclaimer      COPYRIGHT 2021. HAECHI AUDIT. all rights reserved 1   
  • 3.   About HAECHI AUDIT  HAECHI AUDIT is a global leading smart contract security audit and development firm  operated by HAECHI LABS. HAECHI AUDIT consists of professionals with years of  experience in blockchain R&D and provides the most reliable smart contract security audit  and development services.  So far, based on the HAECHI AUDIT's security audit report, our clients have been  successfully listed on the global cryptocurrency exchanges such as Huobi, Upbit, OKEX,  and others.   Our notable portfolios include SK Telecom, Ground X by Kakao, and Carry Protocol while  HAECHI AUDIT has conducted security audits for the world's top projects and enterprises.  Trusted by the industry leaders, we have been incubated by Samsung Electronics and  awarded the Ethereum Foundation Grants and Ethereum Community Fund.  Contact : ​audit@haechi.io  Website : audit.haechi.io        COPYRIGHT 2021. HAECHI AUDIT. all rights reserved 2   
  • 4.   01. Introduction  This report was written to provide a security audit for the PancakeBunny smart contract.  HAECHI AUDIT conducted the audit focusing on whether PancakeBunny smart contract is  designed and implemented in accordance with publicly released information and whether  it has any security vulnerabilities.  The issues found are classified as​ , , or according to  their severity.    HAECHI AUDIT advises addressing all the issues found in this report.            COPYRIGHT 2021. HAECHI AUDIT. all rights reserved 3      Critical issues are security vulnerabilities that MUST be addressed in  order to prevent widespread and massive damage.    Major issues contain security vulnerabilities or have faulty  implementation issues and need to be fixed.      Minor issues are some potential risks that require some degree of  modification.     Tips ​could help improve the code’s usability and efficiency 
  • 5.   02. Summary  The code used for the audit can be found at GitHub  (https://github.com/PancakeBunny-finance/Bunny). The last commit for the code audited  is at “b4501d84e60954b0d645e3e54aa3488f6c675221”.   Issues  HAECHI AUDIT has 0 Critical Issues, 0 Major Issues, and 2 Minor Issue.      COPYRIGHT 2021. HAECHI AUDIT. all rights reserved 4    Severity  Issue  Status    BunnyToken#delegateBySig() can be  called with (nonce, expiry) which was not  used to generate the (v, r, s).   (Found v1.0)    BunnyPool,VaultFlipToCake#notifyRewar dAmount() can decrease rewardRate  (Found v1.0)  (Intended Behavior -  v2.0)  NOTICE  Non-audited, changeable external  contract  (Found v1.0) 
  • 6.   03. Overview  Contracts Subject to Audit  ● BunnyMinter.sol  ● BunnyToken.sol  ● BunnyPool.sol  ● BunnyBNBPool.sol  ● VaultCakeToCake.sol  ● VaultFlipToFlip.sol  ● VaultFlipToCake.sol    Roles  The PancakeBunny Smart contract has the following authorizations:  • Owner  • Minter  • Keeper  • RewardDistribution  The features accessible by each level of authorization is as follows:  COPYRIGHT 2021. HAECHI AUDIT. all rights reserved 5    Role  Functions  Owner  ● BunnyToken  ○ mint  ● VaultFlipToCake  ○ setMinter  ○ setRewardsToken  ○ setRewardsDuration  ○ recoverToken  ● BunnyMinter  ○ transferBunnyOwner  ○ setWithdrawalFee  ○ setPerformanceFee  ○ setWithdrawalFeeFreePeriod  ○ setMinter  ○ setBunnyPerProfitBNB  ○ setBunnyPerBunnyBNBFlip 
  • 7.     Notice  - Non-audited, changeable external contract  Haechi has found that PancakeBunny protocol used “StrategyHelper” contract in  several parts for getting tvl, apy. Although this helper is used to get data, not  writing data which is much safer. But this “helper” can be changed by the owner  and this can lead to price manipulation. Also, these view functions which depend on  COPYRIGHT 2021. HAECHI AUDIT. all rights reserved 6    ○ setHelper  ● VaultController  ○ setMinter  ○ recoverToken  ● VaultFlipToFlip  ○ recoverToken  ● BunnyPool  ○ setRewardsToken  ○ setHelper  ○ recoverBEP20  ○ setRewardsDuration  ● BunnyBNBPool  ○ setFlipToken  ○ setMinter  ○ setHelper  Minter  ● BunnyMinter  ○ mintFor  ○ mintForBunnyBNB  Keeper  ● VaultController  ○ setKeeper  ● VaultFlipToFlip  ○ harvest  RewardDistributio n  ● VaultFlipToCake  ○ notifyRewardAmont  ● BunnyPool  ○ notifyRewardAmount 
  • 8.   helper contracts, are weak to flash loan attacks. Do not trust these functions as a  price table when building on top of this protocol.  If you are an end-user, this issue will not expose much issue/security risk to you.  But if you build something on top of this code, be aware of the above issue.      COPYRIGHT 2021. HAECHI AUDIT. all rights reserved 7   
  • 9.   04. Issues Found  MMINOR : BunnyToken#delegateBySig() can be called with (nonce, expiry)  which was not used to generate the (v, r, s). ​(Found - v1.0)    Problem Statement  BunnyToken#delegateBySIg() ​is designed to delegate the voting right with  meta-transaction. In this case, the delegator generates (v, r, s) by signing (nonce,expiry)  with its privateKey. Delegatee(or any other one who can call this function) will call  delegateBySig() with these parameter. Then the function should verify if the (v,r,s) is  signed by delegator, but in BunnyToken, it does not check if the signer is the delegator.  Which will result in delegating another address’s voting power instead of the delegator if  (nonce, expiry) is not the one that was signed.  Recommendation  Add one more parameter in delegateBySig() function that gets delegator’s address and  verify if ecrecovered address is delegator.  Disclaimer  - This issue has been found on most well-known governance tokens, since these  “delegate” parts are copy and pasted which results in almost the same codes  being used over and over again.  - Although this looks very malicious, it is nearly impossible to find (nonce,expiry)  that will result in making another user with voting power to delegate instead of  the actual signer.  - If you are an end-user, this issue will not expose much issue/security risk to  you. But if you are going to build on top of this code, such as opening a website  to receive voting power using delegateBySig, or some kind of reward system  contract that rewards users when delegate, be aware that this “delegateBySig”  won’t guarantee the signature is valid.        COPYRIGHT 2021. HAECHI AUDIT. all rights reserved 8   
  • 10.   MINOR : BunnyPool,VaultFlipToCake#notifyRewardAmount() can decrease  rewardRate ​(Found - v1.0) (Intended Behavior - v2.0)    Problem Statement  notifyRewardAmount() does not check if the rewardRate decreases after notification.  Since it updates rate to be​ (leftoverRate + notified reward)/duration​ when previous reward is  not finished, if admin keeps notifying with zero reward, it can lead to continuous decrease  on reward rate,  Since this function is designed to be only called by admin, this error can only be done by  admin.  Recommendation  Check if rewardRate increases after notifying reward.  Update  Pancake Bunny team has confirmed that this is a intended behavior    COPYRIGHT 2021. HAECHI AUDIT. all rights reserved 9   
  • 11.   05. Disclaimer  This report is not an advice on investment, nor does it guarantee adequacy of a business  model and/or a bug-free code. This report should be used only to discuss known technical  problems. The code may include problems on Ethereum that are not included in this  report. It will be necessary to resolve addressed issues and conduct thorough tests to  ensure the safety of the smart contract.  COPYRIGHT 2021. HAECHI AUDIT. all rights reserved 10