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

QA Report #107

Open
code423n4 opened this issue Apr 27, 2022 · 0 comments
Open

QA Report #107

code423n4 opened this issue Apr 27, 2022 · 0 comments
Assignees
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) reviewed Issues that Backd has reviewed (just for internal tracking, can ignore this)

Comments

@code423n4
Copy link
Contributor

  1. Comment was not same as actual code

https://github.com/code-423n4/2022-04-backd/blob/c856714a50437cb33240a5964b63687c9876275b/backd/contracts/pool/LiquidityPool.sol#L323

the current implementation was set return true, so it has not the same as comment do. cause it was return true if address of the new staker vault for the pool was correct.

##Tool Used
Manual Review

##Recommended Mitigation
Change it or remove it

##Another Occurances

1.StakerVault
2.TopUpKeeperHelper

  1. Missbehavior isShutdown in shutdown()

Since isShutdown was return value false, it would be missbehavior executed after. cause return was false. This implementation usually or common use using logical operator ! for isShutdown below can be set for good or you can set it into modifier for is it done or not.

##Tool Used
Manual Review

##POC
Using this logic
https://www.tabnine.com/code/java/methods/io.netty.util.concurrent.EventExecutor/isShutdown

##Recommended Mitigation
function shutdown() external override onlyVault returns (bool) {
if (!isShutdown) return false;
isShutdown = true;
emit Shutdown();
return true;
}

or you can using this logic :

contract Shutdownable is Ownable {
bool public isShutdown;

event Shutdown();

modifier notShutdown {
    require(!isShutdown, "Smart contract is shut down.");
    _;
}

function shutdown() public onlyOwner {
    isShutdown = true;
    emit Shutdown();
}

}

@code423n4 code423n4 added bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax labels Apr 27, 2022
code423n4 added a commit that referenced this issue Apr 27, 2022
@chase-manning chase-manning added the reviewed Issues that Backd has reviewed (just for internal tracking, can ignore this) label Apr 28, 2022
@chase-manning chase-manning self-assigned this May 2, 2022
@chase-manning chase-manning added the resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) label May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax resolved Finding has been patched by sponsor (sponsor pls link to PR containing fix) reviewed Issues that Backd has reviewed (just for internal tracking, can ignore this)
Projects
None yet
Development

No branches or pull requests

2 participants