2023-01-blockswap-fv's People
Forkers
0xmstore yongsxyz nl0243 eugenioclrc ankit85 anthonypiazza bubblyorca pedroais youshallnotp4ss mancingcrypto deivitto teryanarmen bloomingflower adamsxd cadian992023-01-blockswap-fv's Issues
[informational] incorrect error thrown
In _registerKnotsToSyndicate
the following line seems to throw the wrong error:
if (getSlotRegistry().currentSlashedAmountOfSLOTForKnot(blsKey.unwrap(blsPubKey)) != 0) revert InvalidNumberOfCollateralizedOwners();
I think it should be throwing KnotSlashed
[informational] unused function
These functions are not used:
_calculateCollateralizedETHOwedPerKnot
_calculateNewAccumulatedETHPerCollateralizedShare
[informational] strange duplicate check in _addPriorityStakers
There is a check for duplicates in _addPriorityStakers
:
function _addPriorityStakers(address[] memory _priorityStakers) internal {
uint256 numOfStakers = _priorityStakers.length;
if (numOfStakers == 0) revert EmptyArray();
for (uint256 i; i < numOfStakers; ++i) {
address staker = _priorityStakers[i];
if (i > 0 && staker < _priorityStakers[i-1]) revert DuplicateArrayElements();
isPriorityStaker[staker] = true;
emit PriorityStakerRegistered(staker);
}
}
This seems strange because a) if there are duplicates there is no harm caused to the contract because the mapping is just changed twice to true in the same place, b) the check will not catch all duplicates since it uses strict less than as apposed to <=
.
Example array with duplicates that will not end in a revert:
[0x1, 0x1]
This duplicate check also makes the life of the caller unnecessarily difficult because they have to sort their array of addresses, which could be an expensive operation if the caller is another contract.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.