Conversation
|
@rk-rishikesh thank you for contributing! we will take a look soon 💙 |
|
This might be a good foundation for https://www.notion.so/pl-strflt/Filecoin-State-Persistence-DAO-e6ae423e20f74d4abed32418a3414001#9ecf5f44c8cb4ccc8b5111f2dfa9bf9c |
ZenGround0
left a comment
There was a problem hiding this comment.
Thanks a lot for this, great work. I left some cleanup suggestions, if you don't get to them in a few days I'll add them in and then merge.
Random musings for the future, maybe it makes sense to abstract out the basic deal client functionality into a contract that other contracts can call making a mini framework? So for example this contract would call addCID and expose proposalOK method to be called by deal client contract. This way we would need way less copy paste. Probably too early to actually do this but fyi @jennijuju
| import {specific_authenticate_message_params_parse, specific_deal_proposal_cbor_parse} from "./CBORParse.sol"; | ||
|
|
||
| // import "https://github.com/foundry-rs/forge-std/blob/5bafa16b4a6aa67c503d96294be846a22a6f6efb/src/StdStorage.sol"; | ||
| // import "https://github.com/lotus-web3/client-contract/blob/main/src/CBORParse.sol"; |
| // import "https://github.com/lotus-web3/client-contract/blob/main/src/CBORParse.sol"; | ||
|
|
||
|
|
||
| contract MockMarket { |
There was a problem hiding this comment.
You don't need this here, its in the DealClient solidity file, please remove
| function upvoteCIDProposal(uint256 proposalID) public { | ||
| require(!isCallerSP(proposalID), "Storage Provider cannot vote his own proposal"); | ||
| require(!hasVotedForProposal[msg.sender][proposalID], "Already Voted"); | ||
| require(isVotingOn(proposalID), "Voting Period Finished"); |
There was a problem hiding this comment.
nit: you could extract these checks into a little subfuction: voteValid
| } | ||
|
|
||
| function policyOK(uint256 proposalID) internal view returns (bool) { | ||
| //require(proposals[proposalID].proposalExpireAt > block.timestamp, "Voting in On"); |
There was a problem hiding this comment.
I think this should be < so that we only allow proposals that have expired their voting phase to pass the policy check. I think this prevents a single upvoter from rushing through a proposal.
But for now delete this pseudo code and if you want to indicate this as a future direction spell it out more clearly in a comment.
I have added an actor for a simple Data DAO with a client that adds CIDs through a voting mechanism. This actor can be deployed on Wallaby Testnet using Remix IDE and one would be able to directly interact with the actor using Remix IDE.