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

update yml script #418

Merged
merged 1 commit into from
Jun 25, 2024
Merged

update yml script #418

merged 1 commit into from
Jun 25, 2024

Conversation

YouStillAlive
Copy link
Member

No description provided.

@YouStillAlive YouStillAlive merged commit ff85de2 into master Jun 25, 2024
1 check passed
@YouStillAlive YouStillAlive deleted the protected-release branch June 25, 2024 11:00
Copy link

Methods

Symbol Meaning
Execution gas for this method does not include intrinsic gas overhead
Cost was non-zero but below the precision setting for the currency display (see options)
Min Max Avg Calls usd avg
DealProvider
       createNewPool(address[],uint256[],bytes) 260,252 291,052 271,816 65 0.78
ERC20Token
       approve(address,uint256) - - 46,323 1 0.13
LockDealNFT
       approvePoolTransfers(bool) 22,065 43,977 33,021 8 0.09
       renounceOwnership() - - 23,317 1 0.07
       safeTransferFrom(address,address,uint256,bytes) 299,328 418,787 362,119 13 1.04
       safeTransferFrom(address,address,uint256) 118,841 174,672 141,771 11 0.41
       setApprovedContract(address,bool) 28,072 47,972 44,241 16 0.13
       setBaseURI(string) 51,127 79,666 70,153 3 0.20
       transferFrom(address,address,uint256) 98,440 116,890 107,665 2 0.31
       transferOwnership(address) - - 28,694 1 0.08
       updateAllMetadata() - - 24,534 2 0.07
LockDealProvider
       createNewPool(address[],uint256[],bytes) 295,557 306,757 305,957 14 0.87
MockProvider
       createNewPool(address[],uint256[],bytes) - - 379,076 5 1.08
       createNewPoolWithTransfer(address[],uint256[]) - - 344,049 1 0.98
       withdraw(uint256,uint256) 68,012 72,800 70,406 2 0.20
MockTransfer
       createNewPool(address[],uint256[],bytes) - - 271,541 1 0.78
MockVaultManager
       setTransferStatus(bool) 21,703 43,615 32,659 2 0.09
TimedDealProvider
       createNewPool(address[],uint256[],bytes) 355,878 384,613 367,904 32 1.05

Deployments

Min Max Avg Block % usd avg
DealProvider 1,965,666 1,965,678 1,965,675 1.5 % 5.62
ERC20Token - - 673,031 0.5 % 1.92
LockDealNFT - - 5,239,501 4 % 14.98
LockDealProvider 2,104,628 2,104,640 2,104,636 1.6 % 6.02
MockProvider - - 1,102,276 0.8 % 3.15
MockTransfer - - 2,010,387 1.5 % 5.75
MockVaultManager - - 431,292 0.3 % 1.23
TimedDealProvider - - 2,348,896 1.8 % 6.72

Solidity and Network Config

Settings Value
Solidity: version 0.8.25
Solidity: optimized true
Solidity: runs 200
Solidity: viaIR false
Block Limit 130,000,000
L1 Gas Price 5 gwei
Token Price 571.77 usd/bnb
Network BINANCE
Toolchain hardhat

Copy link

Slither report

THIS CHECKLIST IS NOT COMPLETE. Use --show-ignored-findings to show all the results.
Summary

uninitialized-local

Impact: Medium
Confidence: Medium

unused-return

Impact: Medium
Confidence: Medium

function mintAndTransfer(
address owner,
address token,
uint256 amount,
IProvider provider
)
external
firewallProtected
onlyApprovedContract(address(provider))
notZeroAddress(owner)
notZeroAddress(token)
notZeroAmount(amount)
returns (uint256 poolId)
{
poolId = _mint(owner, provider);
IERC20(token).approve(address(vaultManager), amount);
poolIdToVaultId[poolId] = vaultManager.depositByToken(token, amount);
}

calls-loop

Impact: Low
Confidence: Medium

function _getData(uint256 poolId) internal view returns (BasePoolInfo memory poolInfo) {
IProvider provider = poolIdToProvider[poolId];
poolInfo = BasePoolInfo(
provider,
provider.name(),
poolId,
poolIdToVaultId[poolId],
ownerOf(poolId),
tokenOf(poolId),
provider.getParams(poolId)
);
}

function tokenOf(uint256 poolId) public view returns (address token) {
token = vaultManager.vaultIdToTokenAddress(poolIdToVaultId[poolId]);
}

timestamp

Impact: Low
Confidence: Medium

function _registerPool(uint256 poolId, uint256[] calldata params) internal override firewallProtectedSig(0xfe3627e9) {
require(block.timestamp <= params[1], "Invalid start time");
poolIdToTime[poolId] = params[1];
provider.registerPool(poolId, params);
}

function getWithdrawableAmount(uint256 poolId) public view override returns (uint256) {
uint256[] memory params = getParams(poolId);
uint256 leftAmount = params[0];
uint256 startTime = params[1];
uint256 finishTime = params[2];
uint256 startAmount = params[3];
if (block.timestamp < startTime) return 0;
if (finishTime <= block.timestamp) return leftAmount;
uint256 totalPoolDuration = finishTime - startTime;
uint256 timePassed = block.timestamp - startTime;
uint256 debitableAmount = (startAmount * timePassed) / totalPoolDuration;
return debitableAmount - (startAmount - leftAmount);
}

function _update(
address to,
uint256 poolId,
address auth
) internal override firewallProtectedSig(0x30e0789e) returns (address from) {
if (auth != address(0) && ERC165Checker.supportsInterface(address(poolIdToProvider[poolId]), type(IBeforeTransfer).interfaceId)) {
IBeforeTransfer(address(poolIdToProvider[poolId])).beforeTransfer(auth, to, poolId);
}
// check for split and withdraw transfers
if (auth != address(0) && !(approvedContracts[to] || approvedContracts[auth])) {
require(approvedPoolUserTransfers[auth], "Pool transfer not approved by user");
require(
vaultManager.vaultIdToTradeStartTime(poolIdToVaultId[poolId]) < block.timestamp,
"Can't transfer before trade start time"
);
}
from = super._update(to, poolId, auth);
}

function getWithdrawableAmount(uint256 poolId) public view override returns (uint256) {
return poolIdToTime[poolId] <= block.timestamp ? provider.getWithdrawableAmount(poolId) : 0;
}

dead-code

Impact: Informational
Confidence: Medium

function _validProvider(uint256 poolId, IProvider provider) internal view {
require(lockDealNFT.poolIdToProvider(poolId) == provider, "Invalid provider poolId");
}

function _validProviderInterface(IProvider provider, bytes4 interfaceId) internal view {
require(ERC165Checker.supportsInterface(address(provider), interfaceId), "invalid provider type");
}

function _withdraw(
uint256 poolId,
uint256 amount
) internal virtual returns (uint256 withdrawnAmount, bool isFinal) {}

naming-convention

Impact: Informational
Confidence: High

https://github.com/The-Poolz/LockDealNFT/blob/dec57f0f1c8d519b816a4798a2bdd7c14f9de684/node_modules/@poolzfinance/poolz-helper-v2/contracts/token/ERC20Token.sol#L22-L24

https://github.com/The-Poolz/LockDealNFT/blob/dec57f0f1c8d519b816a4798a2bdd7c14f9de684/node_modules/@poolzfinance/poolz-helper-v2/contracts/Array.sol#L11

https://github.com/The-Poolz/LockDealNFT/blob/dec57f0f1c8d519b816a4798a2bdd7c14f9de684/node_modules/@poolzfinance/poolz-helper-v2/contracts/Array.sol#L25

https://github.com/The-Poolz/LockDealNFT/blob/dec57f0f1c8d519b816a4798a2bdd7c14f9de684/node_modules/@poolzfinance/poolz-helper-v2/contracts/Array.sol#L81

https://github.com/The-Poolz/LockDealNFT/blob/dec57f0f1c8d519b816a4798a2bdd7c14f9de684/node_modules/@poolzfinance/poolz-helper-v2/contracts/Array.sol#L81

https://github.com/The-Poolz/LockDealNFT/blob/dec57f0f1c8d519b816a4798a2bdd7c14f9de684/node_modules/@poolzfinance/poolz-helper-v2/contracts/Array.sol#L25-L37

https://github.com/The-Poolz/LockDealNFT/blob/dec57f0f1c8d519b816a4798a2bdd7c14f9de684/node_modules/@poolzfinance/poolz-helper-v2/contracts/Array.sol#L11-L23

https://github.com/The-Poolz/LockDealNFT/blob/dec57f0f1c8d519b816a4798a2bdd7c14f9de684/node_modules/@poolzfinance/poolz-helper-v2/contracts/Array.sol#L25

https://github.com/The-Poolz/LockDealNFT/blob/dec57f0f1c8d519b816a4798a2bdd7c14f9de684/node_modules/@poolzfinance/poolz-helper-v2/contracts/Array.sol#L70

https://github.com/The-Poolz/LockDealNFT/blob/dec57f0f1c8d519b816a4798a2bdd7c14f9de684/node_modules/@poolzfinance/poolz-helper-v2/contracts/Array.sol#L11

https://github.com/The-Poolz/LockDealNFT/blob/dec57f0f1c8d519b816a4798a2bdd7c14f9de684/node_modules/@poolzfinance/poolz-helper-v2/contracts/Array.sol#L57

https://github.com/The-Poolz/LockDealNFT/blob/dec57f0f1c8d519b816a4798a2bdd7c14f9de684/node_modules/@poolzfinance/poolz-helper-v2/contracts/Array.sol#L40

https://github.com/The-Poolz/LockDealNFT/blob/dec57f0f1c8d519b816a4798a2bdd7c14f9de684/node_modules/@poolzfinance/poolz-helper-v2/contracts/Array.sol#L70

unused-import

Impact: Informational
Confidence: High

  • ID-24
    The following unused import(s) in contracts/LockDealNFT/ILockDealNFTEvents.sol should be removed:
    -import "@poolzfinance/poolz-helper-v2/contracts/interfaces/IProvider.sol"; (contracts/LockDealNFT/ILockDealNFTEvents.sol#4)

  • ID-25
    The following unused import(s) in contracts/SimpleProviders/Provider/BasicProvider.sol should be removed:
    -import "@poolzfinance/poolz-helper-v2/contracts/interfaces/IProvider.sol"; (contracts/SimpleProviders/Provider/BasicProvider.sol#5)

immutable-states

Impact: Optimization
Confidence: High

IVaultManager public vaultManager;

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.

1 participant