-
Notifications
You must be signed in to change notification settings - Fork 27
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
Genesis dao plugin #49
Conversation
# Conflicts: # sources/genesis_dao/GenesisDao.move
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感觉是不是应该有个 resource 来代表雇佣合同?未来这个 resource 也可以用在金融场景里,比如基于雇佣合同的无抵押贷款。
sources/genesis_dao/GenesisDao.move
Outdated
let nft_update_cap = &mut borrow_global_mut<DaoNFTUpdateCapHolder<DaoT>>(dao_address).cap; | ||
let borrow_nft = IdentifierNFT::borrow_out<DaoMember<DaoT>, DaoMemberBody<DaoT>>(nft_update_cap, member_addr); | ||
let nft = IdentifierNFT::borrow_nft_mut(&mut borrow_nft); | ||
let body = NFT::borrow_body_mut_with_cap(nft_update_cap, nft); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感觉这里应该不需要 mut,但可能有些只读的方法没有提供。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里改好了
DaoT, | ||
ConfigProposalPlugin, | ||
ConfigProposalAction<ConfigT>>(&proposal_cap, &sender, proposal_id); | ||
Config::publish_new_config<ConfigT>(&sender, config); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个配置的 ModifyCapability 会写到 sender 账号下,但这个 sender 可以是任何人,所以这里有问题。感觉这个配置需要写到 Dao 的账号下。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里想过要这样存,但是plugin拿不到Dao账号的signer,或者GenesisDAO提供一个存储配置的接口
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GenesisDao::set_custom_config 增加了一个这样的接口
|
||
//assert!(now_seconds() - receive.last_receive_time > config.period, | ||
// Errors::invalid_state(ERR_PLUGIN_RECEIVE_TIME_NOT_REACHED)) | ||
sbt * ((Timestamp::now_seconds() - receive.last_receive_time) as u128) / (period as u128) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
工资基于 sbt 计算吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对,工资基于SBT,这里的算法先暂时用个最简单的。
|
|
这个我先合并进去,之后看插件放在哪里合适。部分插件可能不需要在 StarcoinFramework 里。 |
* [genesis_dao] Implement GenesisDao * Implement Proposal * Init MemberJoinPlugin * implement InstallPluginProposalPlugin * update build * update build * Implement DaoAccount and GenesisDao module (#46) * Implement DaoAccount and GenesisDao module * Update BuildInfo.yaml * merge Dao proposal and dao config into genesis dao base code (#47) Co-authored-by: jolestar <jolestar@gmail.com> * Update BuildInfo.yaml * Genesis dao plugin (#49) * add salary governance * add salary governance * Salary governance plugin * add script tag for plugin functions * Dao account test (#53) * Update DaoAccount and write integration test * update build * update CI for genesis_dao branch * Add member event (#55) * Dao proposal implement (#57) * dao proposal implementation * update build files * fixed merge genesis_dao conflicts * Genesis dao test (#59) * [test] Add dao integration test * fixup * update build file * remove XDao module * checkpoints temp Test (#62) * Grant plugin (#61) * add GrantProposalPlugin * add event struct * add grant in GenesisDao * add grant cap * fix grant plugin * Rename DaoGrantWithdrawTokenCap * Add the plugin code that to convert token to SBT amount (#64) * Dao proposal test (#66) * add proposal create and member join test case * upgrade proof params via rpc raw proofs api * generate struct tag for dao resource * add bcs option tuple test case * add queue proposal action script * add script signer * add cast vote scripts * unify daoT ablity * fix dao propsosal abort test case * fix prove (#67) Co-authored-by: WGB5445 <919603023@qq.com> * Dao event and get vote info api (#69) * add dao event and get vote info api * fix get vote info option when has not vote yet * no_with_veto counts as no but also adds a veto vote * event associate with dao id (#71) * Change some functions into Script methods and fix part of the logic (#65) * [ Other ] Rename DaoSpace (#72) * rename DaoSpace * Fix dir name * add AnyMemberPlugin Accept * Rename : DAOSpace * Rename Co-authored-by: WGB5445 <WGB98512@163.com> * Add Grant view and Grant refund (#73) * add query_grant * add refund grant function * add query_grant_can_withdraw * add GrantInfo * [lib] Refactor include source dir * Fix stake SBT plugin from one stake to multiple stake * DAOSpace error code (#74) * [dao] Refactor DAOSpace's error codes * [refactor] Move VoteStrategy to test dir * [Feature and test]Add dao_grant test and query_grant_info_total (#76) * Fixed the problems in PR that relationship between SBT and the staked token * Add some integration test for StakeToSBTPlugin * Add some integration test for StakeToSBTPlugin * Rename Dao to DAO (#79) * [daospace] rename Dao to DAO * update struct tag testcase after change Dao to DAO * fix test exp * fix prove and remove Debug print Co-authored-by: BaiChuan <muzixinly@gmail.com> Co-authored-by: WGB5445 <919603023@qq.com> Co-authored-by: Bai Chuan <muzixinly@gmail.com> Co-authored-by: BobWong <libo.weng@gmail.com> Co-authored-by: WGB5445 <919603023@qq.com> Co-authored-by: WGB5445 <WGB98512@163.com>
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Other information