gamedaoco / gamedao-protocol Goto Github PK
View Code? Open in Web Editor NEWGameDAO Protocol
Home Page: https://docs.gamedao.co
License: Apache License 2.0
GameDAO Protocol
Home Page: https://docs.gamedao.co
License: Apache License 2.0
Every extrinsic with string type params currently has BoundedVec<u8, T::StringLimit>
type, which doesn't check the minimum length.
BoundedVec from std library has a lower bound, but BoundedVec from frame_support doesn't.
So, we should either find a BoundedVec with the lower bound or create our implementation.
Already raised a question: https://substrate.stackexchange.com/questions/4263/extrinsics-string-parameter-lower-bound-validation
As GameDAO Council I want to be able to control availability of protocol features:
Each major milestone contains different features, but the public availability may be phased in or out at different points in time or even may or may not be available on network a,b,c.
As launch support, we want to create a smooth transition from initial deployment to fully functional protocol suite. To achieve this, we want to enable features after periods, e.g.:
Discussion:
to be specified:
unwrap()
issue. Avoid panics at almost any cost in the runtime and add "proofs" for expect() calls on why they cannot fail. The only reason to panic should be in case a block should not be built when that code path is triggered or when it indicates a bug. It is only ok for tests and benchmarks. E.g. https://github.com/gamedaoco/gamedao-protocol/blob/main/signal/src/lib.rs#L903
In most cases you should handle the Error. More use of ok_or
, unwrap_or
, ?
, or returning Err
in a matching pattern.
E.g not properly handled:
Unnecessary checking of errors already handled by the pallet methods:
map_err
: https://github.com/paritytech/polkadot/blob/master/xcm/xcm-builder/src/fungibles_adapter.rs#L246-L247As user i want to create campaigns which start in the future, so that I can get my audience ready for funding.
As a Creator
I want to create an "Upcoming" campaign
So that Contributors will be aware of it before it's activation
Campaign Statuses: https://docs.google.com/spreadsheets/d/1H6ZQMjveL5weN146BbKlXXdDAUxvDiVa9mSHruerq0s/edit?usp=sharing
related to frontend task: gamedaoco/gamedao-haiku#270
ProposalsArray
and ProposalCount
and ProposalIndex
? It seems it is never read and it just using storage. (maybe related with #53 )CampaignsArray
and CampaignsCount
and CampaignsIndex
? It seems it is never read and it just using storage. (maybe related with #53 )As a Creator
I want to add a reward to a campaign
So that a Contributor will be able to earn it by investing in my campaign
———
A Creator must be able to add a reward to a campaign with a "Draft" status.
Multiple rewards can be added to a campaign.
Adding a reward to a campaign is optional (a campaign can be created without a reward).
———
User flows
User flows that outline the detailed process can be found here.
Describe the bug
After submitting a preimage in polkadot.js an error shows on the democracy.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
democracy tab should work in any case, also when proposing a preimage from our pallets.
Additional context
Add any other context about the problem here (eg. device/browser)
As a Contributor
I want to claim a reward
So that I will be able to sell or collect it
———
Given:
A campaign is successfully completed (campaign status is "Success")
and
A collectible has been assigned to a Contributor
When:
A Contributor claims a collectible
Then:
A collectible must be sent to a Contributor's wallet
and
A fee amount must be deducted from a Contributor's balance
———
User flows
User flows that outline the detailed process can be found here.
========================================
Stage 1
open branch migration/tangram
update cargo.toml dependencies
migrate structs to new macro syntax
migrate storage to new macro syntax
migrate events, errors to new macro syntax
migrate pallet to new macro syntax
add/fix commission calculation (fixed point arithmetic)
write tests
benchmarking
add PR to main
Stage 2
Refactor assets to ORML:
Network Transaction fees use local network native currency
Deposits use GAME
Payments use (depending on network) aUSD/PLAY/DAI/USDT
suggest migration in architecture round
extend this issue with new decisions
========================================
how to test:
your build should result in no warnings by your added functionality.
As GameDAO we want to integrate aUSD into our parachain so our users can fund with a widely accepted stablecoin into campaigns and perform spendings.
The token registration form gives us the details that we use to add your token into the Karura network.
preimage hash
and DO NOT sign and submitTo announce the intention to open HRMP channels between networks
[Here](https://acala.discourse.group/t/open-hrmp-channel-between-parallel-heiko-and-karura/784) a good example of an HRMP off-chain governance post
Motion to open the HRMP channels and register Karura tokens
Test token transfers
Marketing
Once bootstrap and liquidity mining rewards have been confirmed, we will then coordinate a listing date.
[Here](https://acala.discourse.group/t/list-kint-kusd-pair-on-karura-swap-and-incentive-program-for-kint-kusd-liquidity-providers/802) is a good example for reference
Motion to create bootstrap and the listing
Once the bootstrap and incentive parameters have been finalized, the next step is to prepare the co-marketing campaign. The objectives of the co-marketing campaign are as follows:
Please note, the Acala/Karura Growth team will provide you with block numbers for the start of bootstrap and liquidity mining programs when we are starting to put together the marketing pieces.
Below is a list of the recommended marketing materials and when we need them completed by to best support the listing:
Led by your team:
SOCIAL: Tweet announcing the HRMP channels have been opened (completed)
BLOG: Prepare the blog that outlines:
[Here](https://docs.google.com/document/d/1ZKT5VClrGJGhVJ6pNWK7rDD-iziOnkQrTMRNBDHmpbg/edit?usp=sharing) is a document that outlines what should be included in the blog along with some suggested copy.
[Here](https://medium.com/acalanetwork/bifrost-launches-on-karura-swap-with-over-200k-bnc-in-liquidity-mining-rewards-1ebec8e8ec15) is an example of a final blog that outlined bootstrap and liquidity mining parameters. Please remember to add the additional areas outlined above including a brief project overview and aUSD use cases.
SOCIAL: Tweet outlining Bootstrap & incentive program linking to the blog (inform Acala so we can share)
[Here](https://twitter.com/PhalaNetwork/status/1506240002367229958) is an example
SOCIAL: Tweet announcing the start of bootstrap (on the bootstrap go live date) - please inform us so we can share
SOCIAL: Tweet announcing trading is live & liquidity mining incentives (on the trading go live date) - please inform us so we can share
[Here](https://twitter.com/PhalaNetwork/status/1509565027878985732) is an example.
Led by our team:
The bootstrap will go live at the designated block number. If bootstrap parameters are not met, the Karura team will re-engage in Telegram to coordinate additional support and next steps.
As #creator I want to be able to mint collectables on zero network so I can build new applications.
========================================
Stage 1
open branch migration/flow
update cargo.toml dependencies
migrate structs to new macro syntax
migrate storage to new macro syntax
migrate events, errors to new macro syntax
migrate pallet to new macro syntax
add/fix commission calculation (fixed point arithmetic)
write tests
benchmarking
add PR to main
Stage 2
Refactor assets to ORML:
Network Transaction fees use local network native currency
Deposits use GAME
Payments use (depending on network) aUSD/PLAY/DAI/USDT
suggest migration in architecture round
extend this issue with new decisions
========================================
how to test:
your build should result in no warnings by your added functionality.
As organisation prime (controller of organisation) I want to create an organisation which has its own treasury so that the organisation can govern the treasury.
As a user, I want to change the organization, whether it's an Individual type or Dao type so that I can call the same extrinsic and not two as it works now.
Same applies to add_member
, remove_member
, disable_org
, enable_org
, make_spending
.
It means moving proposal creation to the Control pallet scope.
origins need to be created to reflect the participating and approving majority VotingResult
, composed of:
root
raw_origin
-> member||members
there are also member groups
Prime
Council
Contributors
Members
GameDAOCouncil
example:
extrinsic( origin, params )
-> origin is result of voting, e.g. [
5 -> accepted,
7 -> eligible,
Option<Voting.Majority> -> how to determine, e.g. `Voting.TokenWeighted`
]
updateOrg(orgId, primeId, accessModel, memberLimit, feeModel, membershipFee)
addMember(orgId, who)
(need addMember for open orgs not access restricted, probably need other extrinsic which allows users into the the org )removeMember(orgId, who)
(need removeMember for open orgs not access restricted, probably need other extrinsic which suspends/blacklists users from the the org)spendFunds(orgId, currencyId, beneficiary, amount)
As a user, I want to create a campaign using different currencies so I can spend those tokens later using governance mechanisms.
TBD
What is the purpose of Nonce
and OrgByNonce
? They seem are not really necessary.
Why not include OrgConfiguration
as attribute of Orgs
? (probably related to #53 )
check_membership
is unnecessary. No need to create an extrinsic to read from the chain state. Extrinsics are meant to modify the chain state, not for querying.
accounts want to use various gamedao protocols. to enable access, accounts need to stake GAME token and assign the amount of token to the protocol function. the functionality gets automatically enabled until the assigned stake is not assigned to the functionality anymore.
example:
bit | protocol | min staking | return | available |
---|---|---|---|---|
0 | dao / co | 100 | 5% | x |
1 | paid members | 1000 | 5% | |
2 | governance | 1000 | 5% | x |
3 | fundraising / grant | 0 | 5% | x |
3 | fundraising / prepaid | 1000 | 5% | |
3 | fundraising / token | 5000 | 5% | |
4 | battlepass | 1000 | 5% | x |
5 | collectables | 1000 | 5% |
0000 0000 0000 0000
- all disabled0000 0000 0000 0001
- dao enabledBoundedVec
Please review all your extrinsic arguments that could have an arbitrary size. For example: https://github.com/gamedaoco/gamedao-protocol/blob/main/control/src/lib.rs#L360-L361
Replace Vec
by BoundedVec
for that kind of cases
As Organisation Creator I want to decide if I want to take all the decisions with impact on Treasury and Organisation Rules or if the community should be able to decide on major decisions so that the right form of governance is chosen for the organisation.
Figjam: https://www.figma.com/file/wwxuOXF1eqDLMfa9caj9Kv/Organisation?node-id=35%3A1030
ℹ️ possibly we first need a roles construct to do this ticket?
As user I want to externalise configurable values consumed by pallets so I can do changes on them.
As a Contributor
I want to earn a reward
So that I will be able to sell or collect it
———
Given:
A campaign is published
and
A campaign is not completed (campaign status is "Finalizing" / "Reverting" / "Success" / "Failed")
and
A campaign contains a reward with the "Active" status
When:
A Contributor invests to a campaign
and
The invested amount is greater than a collectible's minimum funding amount
or
The invested amount equals a collectible's minimum funding amount
and
A Contributor hasn't earned the same collectible before
Then:
Assign a collectible to a Contributor (a collectible (one instance) becomes unavailable for other contributors and will be provided to a Contributor who earned it after a campaign is successfully completed)
and
Collectible's "Q-ty" parameter must be updated:
• if the "Q-ty" is Limited
, then subtract earned collectible (one instance) from the current amount
———
User flows
User flows that outline the detailed process can be found here.
Proposals changes:
Voting changes:
All related issues:
For debugging reasons.
Extrinsic Error -> possible reasons.
As GameDAO we want to have a pallet architecture which uses as much as possible already hardened and audited functions so that we are enabled to launch fast and not loose time on developing, testing and auditing own code.
[]
[]
========================================
Stage 1
open branch migration/control
update cargo.toml dependencies
migrate structs to new macro syntax
migrate storage to new macro syntax
migrate events, errors to new macro syntax
migrate pallet to new macro syntax
add/fix commission calculation (fixed point arithmetic)
write tests
benchmarking
add PR to main
Stage 2
Refactor assets to ORML:
Network Transaction fees use local network native currency
Deposits use GAME
Payments use (depending on network) aUSD/PLAY/DAI/USDT
suggest migration in architecture round
extend this issue with new decisions
========================================
how to test:
your build should result in no warnings by your added functionality.
Upgrade to latest version of Substrate and Polkadot. v0.9.13 is very old
As organisation/DAO member I want to create a spending proposal to transfer some money to another wallet so the DAO can make use of the collected funds.
As blockchain developer I want to make sure that when a campaign is finalised the chain is not blocked with too many settlement processings of users.
1....
https://www.figma.com/file/Jqy2XnQh9ZgvU518Zhp48u/Scheduling-%2B-Campaign-Settlement?node-id=0%3A1
As user I want to keep my GAME & PLAY tokens which I accumulated over time also on the new chain version so I can spend my tokens on the features provided.
As GameDAO user interacting on GameDAO I want to use the GAME token so that I can access protocols like creating Organisations, Campaigns and Proposals.
Now Polkadot JS app provides links to the extrinsics. Instead of only providing screenshots, you could copy/paste the extrinsics links into the tutorials to make it easier and a better experience for the user.
As GameDAO user investing in a campaign I want to invest in the "network stable coin" so that my funds are not exposed to volatility.
As gamedao protocol I want to reward an organisation membership with an achievement token so that the user feels appreciated.
As a Creator
I want to create a reward
So that I will be able to add a collectible to a reward and a Contributor will be able to earn it
———
A Creator must be able to create a reward with the following parameters:
1.1. Name. A user will indicate a value of this parameter on UI.
1.2. Reward type (this parameter must be predefined with the same value in BE):
• Collectible
("Collectible" is the only available type for now, but the list of types will be expanded in future)
Reward is an entity that will be created during the campaign creation (a campaign can be published with a reward, or without a reward, or with multiple rewards).
Reward statuses:
3.1. Draft
the reward is created and added to a "Draft" campaign
3.2. Active
the reward is created and added to a campaign, which status is not "Draft"
3.3. Completed
the reward is created and added to a campaign and a campaign has been completed (campaign status is "Finalizing" / "Reverting" / "Success" / "Failed")
or
all collectibles added to a reward have been earned
———
User flows
User flows that outline the detailed process can be found here.
The pallets storage schema and usage is not correct. Some tips and guidance:
You are duplicating values without any need when they should be if possible gathered in a single struct.
flow.campaings
and flow.campaignOwner
. The campaign owner is already in the GamedaoFlowCampaign
struct. In addition, I don’t see the need of adding the campaign id
in the struct as it is defined as the StorageMap
key. It seems that you are unnecessarily duplicating data that is already stored in the main struct object in other StorageMap
with the same key. It applies to all your pallets (control, flow, etc..)As a consequence of the previous issue, there are too many unnecessary storage read/writes, which affects to the extrinsic weight.
Org
, Campaign
, etc)Consider using StorageDoubleMap
instead of a simple StorageMap
+ Vec
. There is not right answer here, it will really depend on each particular case. E.g: OrgMembers
could be a StorageDoubleMap
where the secondary key is the member AccountId
.
Vec
with contains
and binary_search
migh be less optimal for read/write than using contains_key
for the StorageDoubleMap
.Vec
might be only make sense if you need to list the vector items in runtime. In that case, StorageDoubleMap
would mean a lot of DB reads.OrgMembers
example, since there is not a value to save in the double map, it might cause some storage penalty as you'll need to save at least a bool
value. Maybe in the future your members have more attributes, so it make sense to create a Member
struct.More information about storage best practices: https://docs.substrate.io/main-docs/build/runtime-storage/#best-practices
If the reason of your storage design is to make it easier to retrieve data, there are better alternatives such as:
As organisation PRIME I want to be able to change the organisation settings so I can adapt the organisation rules to new situations.
As protocol I want to protect market participants from protocol abuse, e.g. bad actors proposing destructive activity for GameDAO or any other DAO running on the protocol.
To achieve this we require creators of a Proposal to deposit a sound amount of collateral to their proposal. This disincentivizes bad actors from abuse and creates more transparency for the voters.
deposit
to extrinsicaccepted
--> deposit will be fully returnedrejected
--> decide if to be slashed or not:
GameDAO Treasury
for global proposals75%
, GameDAO Treasury
25%automated
: rejection criteria met --> slashtribunal
: rejection criteria met --> create slashing vote (not scope of this ticket)GAME
token to deposit, an error message is displayed ("insufficient funds")think about configurable slashing requirements, e.g. based on member count, TVL, etc.
think about configurable quorum per proposal (@vovacha)
please slice on estimate
do we need to extend the states free, locked, reserved by another state, which is collateral, which cannot be spent under any circumstances without approval of the respective protocol (@vovacha)?
minDeposit = 100 GAME
Pallet level storage versioning: save version in the storage instead of hardcoding it. Make use of GetStorageVersion
trait.
Example:
let on_chain_storage_version = <P as GetStorageVersion>::on_chain_storage_version();
Bad: https://github.com/paritytech/substrate/blob/master/frame/collective/src/lib.rs#L173
Good: https://github.com/paritytech/substrate/blob/master/frame/uniques/src/migration.rs#L25
As a Creator
I want to add a collectible to a reward
So that a Contributor will be able to earn it by investing in my campaign
———
A Creator must be able to create a collectible within a reward with the following attributes:
1.1. sn
1.2. id
1.3. collection (A collectible must be minted from a collection which must be created automatically for each DAO in BE)
1.4. symbol
1.5. Name (A user will indicate a value of this parameter on UI)
1.6. Description (A user will indicate a value of this parameter on UI)
1.7. Metadata. Collectible file. (A user will upload this file on UI).
• File types supported: AAC, AVI, BMP, FLAC, GIF, GLB, HEIC, ICO, JPG, JSON, M4V, MOV, MP3, MP4, MPEG, OGG, PDF, PNG, SVG, TIFF, WAV, WEBM, WEBP.
• Max file size: 30 MB
1.8. Royalty percent float (A user will indicate a value of this parameter on UI)
1.9. Royalty receiver (This must be a user who creates a reward)
1.10. Quantity:
• Unlimited
(A user won't indicate q-ty on UI) (unlimited number of Contributors will be able to earn a collectible)
• Limited
(A user will indicate a number which is greater than 0 on UI) (limited number of Contributors will be able to earn a collectible)
1.11. Minimum funding amount (if the amount of contribution is less than a min. funding amount, then this contribution is not eligible for a reward)
1.12. Thumbnail. (A user will upload this file on UI).
• File types supported: JPG, PNG, SVG.
• Max file size: 30 MB
1.13. Custom attribute. 100 custom attributes max can be created for one collectible. (A user will indicate a name and a value of this parameter on UI).
Collection must be created for each DAO with the following attributes:
2.1. id
2.2. Name (The name of the DAO must be used here)
2.3. Description (The description of the DAO must be used here)
2.4. Collection max (How many NFTs will ever belong to this collection). 0 must be set by default.
2.5. Issuer (Issuer's address (can be different than minter)
2.6. Symbol (Ticker symbol by which to represent the token in wallets and UIs (e.g. "ZOMB"))
2.7. Metadata (The image of the DAO must be used here)
• File types supported: JPG, PNG.
• Max file size: 30 MB
Multiple collectibles can be minted from one collection.
Multiple collectibles can be added to one reward.
———
Specification
Domain model, data dictionary can be found here.
User flows
User flows that outline the detailed process can be found here.
========================================
Stage 1
open branch migration/signal
update cargo.toml dependencies
migrate structs to new macro syntax
migrate storage to new macro syntax
migrate events, errors to new macro syntax
migrate pallet to new macro syntax
add/fix commission calculation (fixed point arithmetic)
write tests
benchmarking
add PR to main
Stage 2
Refactor assets to ORML:
Network Transaction fees use local network native currency
Deposits use GAME
Payments use (depending on network) aUSD/PLAY/DAI/USDT
suggest migration in architecture round
extend this issue with new decisions
========================================
how to test:
your build should result in no warnings by your added functionality.
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.