redacted-cartel / contracts-v1 Goto Github PK
View Code? Open in Web Editor NEWSmart contracts for Redacted Protocol v1 (Deprecated)
Home Page: https://redacted.finance
Smart contracts for Redacted Protocol v1 (Deprecated)
Home Page: https://redacted.finance
King @realkinando is back, hyped for V2 ๐ . Here's my feedback from looking at the contracts in v2-core
cap
doesn't seem to be changed after it's set in the constructor. You can make it immutable
cap
an issue? Will we need a method that can raise/lower it?epochSeconds_
is never set, which would cause distribute
to always revert since it'd never be greater than lastEpoch
(which also never seems to be set)0
as it's already the default valuecurrentEpoch - lastEpoch
to a variable and use that (vs. doing the calculation on each iteration)
currentEpoch - lastEpoch
equal 1
?j <= collectionCount
instead of j < collectionCount + 1
(otherwise it'll do the calculation on every iteration, similar to the point above)Collection storage c = getCollection[j]
)distribute
may run out of gas if there are too many collections in the futurelockToken
can be immutable - never re-assigned outside of constructoroffset
can be immutable - never re-assigned outside of constructor function _getCurrentRound() internal view returns (uint round){
round = (block.timestamp + (offset * 1 weeks)) / (4 * 1 weeks);
}
function getCurrentRound() external view returns (uint round){
round = _getCurrentRound();
}
function _getTimestampFromRound(uint round) internal view returns (uint timestamp){
timestamp = ((round * 4) + offset) * 1 weeks;
}
function getTimestampFromRound(uint round) external view returns (uint timestamp){
timestamp = _getTimestampFromRound(round);
}
function _getRewardHash(address token, bool conviction) internal view returns(bytes32 rewardHash){
rewardHash = keccak256(abi.encode(token,conviction));
}
function getRewardHash(address token, bool conviction) external view returns(bytes32 rewardHash){
rewardHash = _getRewardHash(token, conviction);
}
rewardRoundHash
is the same thingI'll update this again when I go through the other contracts.
Need to update the original Thecosomata contract with any applicable changes from ThecosomataETH as @realkinando mentioned today.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.