-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/refactor #44
Feature/refactor #44
Conversation
[Update] Added lockup test scenarios
contracts/RequestManager.sol
Outdated
function deploy(uint256 id) external returns (address newPoolAddress) { | ||
if (requests.length <= id) revert InvalidId(); | ||
Request memory req = requests[id]; | ||
if (req.requestStatus != Status.APPROVED) revert InvalidRequestStatus(); | ||
if (msg.sender != req.data.deployer) revert InvalidCaller(); | ||
newPoolAddress = IBaseFactory(req.data.factory).deploy( | ||
req.data.deployer, | ||
req.data.stakingData | ||
); | ||
stakingPools.push(newPoolAddress); | ||
requests[id].requestStatus = Status.DEPLOYED; | ||
poolById[id] = newPoolAddress; | ||
emit RequestFullfilled(id, newPoolAddress); | ||
} |
Check notice
Code scanning / Slither
Reentrancy vulnerabilities Low
External calls:
- newPoolAddress = IBaseFactory(req.data.factory).deploy(req.data.deployer,req.data.stakingData)
State variables written after the call(s):
- poolById[id] = newPoolAddress
- stakingPools.push(newPoolAddress)
function removeFactory(address factory) onlyOwner external { | ||
if (whitelistFactory[factory] != true) revert UnregisteredFactory(); | ||
whitelistFactory[factory] = false; | ||
emit FactoryUnregistered(factory); | ||
} |
Check warning
Code scanning / Slither
Boolean equality Warning
-whitelistFactory[factory] != true
function requestDeployment(RequestPayload calldata data) external { | ||
if (data.deployer == address(0) || data.factory == address(0)) | ||
revert InvalidAddress(); | ||
if (data.ipfsHash == bytes32(0)) revert InvalidIpfsHash(); | ||
if (data.stakingData.length == 0) revert InvalidPayload(); | ||
if (whitelistFactory[data.factory] != true) | ||
revert UnregisteredFactory(); | ||
requests.push(Request({requestStatus: Status.CREATED, data: data})); | ||
emit RequestSubmitted( | ||
requests.length - 1, | ||
data | ||
); | ||
} |
Check warning
Code scanning / Slither
Boolean equality Warning
-whitelistFactory[data.factory] != true
@@ -15,107 +15,52 @@ | |||
/// @author Ayooluwa Akindeko, Soramitsu team | |||
contract ERC721PenaltyFeeStakingFactory is Ownable, IPenaltyFeeFactory { | |||
using SafeERC20 for IERC20; | |||
|
|||
address public requestManager; |
Check warning
Code scanning / Slither
State variables that could be declared immutable Warning
@@ -15,107 +15,52 @@ | |||
/// @author Ayooluwa Akindeko, Soramitsu team | |||
contract ERC20PenaltyFeeStakingFactory is Ownable, IPenaltyFeeFactory { | |||
using SafeERC20 for IERC20; | |||
|
|||
address public requestManager; |
Check warning
Code scanning / Slither
State variables that could be declared immutable Warning
@@ -16,112 +16,52 @@ | |||
contract ERC721LockUpStakingFactory is Ownable, ILockUpFactory { | |||
using SafeERC20 for IERC20; | |||
|
|||
address public requestManager; |
Check warning
Code scanning / Slither
State variables that could be declared immutable Warning
contract ERC20LockUpStakingFactory is Ownable, ILockUpFactory { | ||
using SafeERC20 for IERC20; | ||
|
||
address public requestManager; |
Check warning
Code scanning / Slither
State variables that could be declared immutable Warning
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #44 +/- ##
===========================================
- Coverage 90.59% 86.55% -4.04%
===========================================
Files 10 11 +1
Lines 606 543 -63
Branches 156 113 -43
===========================================
- Hits 549 470 -79
- Misses 56 72 +16
Partials 1 1 ☔ View full report in Codecov by Sentry. |
Merge pull request #44 from soramitsu/feature/refactor
No description provided.