Closed gangov closed 9 months ago
The function performs a check on deployer that will always be false:
deployer
Redundant deployer check; the if statement will never be taken. let deployer = e.current_contract_address(); if deployer != e.current_contract_address() { deployer.require_auth(); }
Redundant deployer check; the if statement will never be taken.
if
let deployer = e.current_contract_address(); if deployer != e.current_contract_address() { deployer.require_auth(); }
This could be simplified by removing the creation of the deployer value and instead running the following:
Reduced stake contract deployment. e.deployer() .with_current_address(salt) .deploy(stake_wasm_hash)
Reduced stake contract deployment.
e.deployer() .with_current_address(salt) .deploy(stake_wasm_hash)
The current implementation is more verbose and leads to dead code.
Simplify the logic in the function.
The function performs a check on
deployer
that will always be false:This could be simplified by removing the creation of the
deployer
value and instead running the following:Impact
The current implementation is more verbose and leads to dead code.
Recommendation
Simplify the logic in the function.