gamedaoco / gamedao-refinement

issues to be refined until ready for development
0 stars 0 forks source link

Test E2E process #13

Open 5-mark opened 2 years ago

5-mark commented 2 years ago

User Story

As user I want to create a DAO, create a campaign, raise funds and withdraw them to spend it so I can reach my objective to build sth nice the community wants

Acceptance Criteria

  1. Create a DAO
  2. Create a campaign and collect funds
  3. Submit a withdrawal voting
  4. See funds being transferred to DAO treasury
  5. See fees being transferred to GameDAO treasury.

Additional Information

Wallets before Funding:

Controller Wallet 1: 5mark
Wallet: 3b2qZTPzhpJkJULMtMjtL5dsiYvmfVyh15Xxg3K83UwGpCJz DAO Admin
TOTAL: 513.9296 ZERO -
TRANSFERRABLE: 351.2126 ZERO -
LOCKED: 10.0000 ZERO -
RESERVED: 152.7069 ZERO -
treasury Wallet 2: Inan 2nd Wallet
Wallet: 3bM6UuZYEQjDqSdsyevEWjdRqQbDTXahvLLvvFDnsnam8bN2 DAO Treasury
TOTAL: 39.9999 ZERO -
TRANSFERRABLE: 25.9989 ZERO -
LOCKED: 0 ZERO -
RESERVED: 14.0009 ZERO -
funding Wallet 3: Allchainsfunding
Wallet: 3ZYcKFCPWN5tDFsaYJVEgvCJjV5EXxSKMXtD7HgdmhALrCG6 DAO member
TOTAL: 74.9999 ZERO -
TRANSFERRABLE: 56.4999 ZERO -
LOCKED: 10.0000 ZERO -
RESERVED: 18.5000 ZERO -
funding Wallet 4: Zero1
Wallet: 3ZjAeLZWrhu1uFGxgFSPUuSBJmEJZpgHHM6qJUzuHb3B9ykb DAO member
TOTAL: 29.9999 ZERO -
TRANSFERRABLE: 18.9989 ZERO -
RESERVED: 11.0010 ZERO -
funding Wallet 5: Zero2
Wallet: 3Xg5B1ESG3pSRPejciW5RssF4LCKGqdow8A5gdhXUPmQ8Rb2 DAO member
TOTAL: 5.9999 ZERO -
TRANSFERRABLE: 4.9989 ZERO -
RESERVED: 1.0010 ZERO -
funding Wallet 6: Zero3
Wallet: 3ZJca4hGtBH68dzRLajMceUVSUhyvmhPu5yLM8CazwQoM4yk not DAO member
TOTAL: 21.9999 ZERO -
TRANSFERRABLE: 21.9989 ZERO -
RESERVED: 0.0010 ZERO -

Campaign created

creating the Campaign resulted in that the treasury account also had 1 ZERO (Deposit) reserved. I was the owner of the account but I dont think that i approved or signed any transaction with that account. Not sure if it works same way if I would use a treasury account which is not my wallet.
Wallet: 3bM6UuZYEQjDqSdsyevEWjdRqQbDTXahvLLvvFDnsnam8bN2 DAO Treasury
TOTAL: 39.9999 ZERO -
TRANSFERRABLE: 24.9989 ZERO -
LOCKED: 0 ZERO -
RESERVED: 15.0009 ZERO -

After funding each contributor had the funding amount shown as reserved in their own wallet.

Campaign funded

After the campaign runtime expired and was declared successful the funds went to the DAO treasury account and were reserved (+10.000 ZERO)

Wallet: 3bM6UuZYEQjDqSdsyevEWjdRqQbDTXahvLLvvFDnsnam8bN2 DAO Treasury
TOTAL: 49.9999 ZERO -
TRANSFERRABLE: 24.9989 ZERO -
LOCKED: 0 ZERO -
RESERVED: 25.0009 ZERO -

Proposal was created and Zero1 & Zero2 voted yes and the proposal was closed. Zero3 who also funded but is not a DAO member was not able to vote. This was logged:

gameDaoGovernance.WithdrawalGranted
Hash
0xdbe78a5958ceebd37ea12d816bfbfd2a549f6ba56d5131ec571943dfc5f2770d

Hash
0xab8534164222107b9a216ee12d80ac7dec0801b72034f0ad70ea09c8d2b1f845

Hash
0xec3ffcc4186aa7fefc00b81fd029958f90b6084d30d07e695bb655fa08f498b1
balances.Unreserved
Some balance was unreserved (moved from reserved to free). [who, value] 
AccountId

INAN 2ND WALLET
3bM6UuZYEQjDqSdsyevEWjdRqQbDTXahvLLvvFDnsnam8bN2
Balance
10.0000
After the Vote was expired somehow the controller account received the funds:
Wallet: 3b2qZTPzhpJkJULMtMjtL5dsiYvmfVyh15Xxg3K83UwGpCJz DAO Admin
TOTAL: 521.9196 ZERO -
TRANSFERRABLE: 359.2126 ZERO -
LOCKED: 10.0000 ZERO -
RESERVED: 152.7069 ZERO -

There are now 8 ZERO more on this account even though it should at least be 9.75 ZERO (10 minus GameDAO fee)

5-mark commented 2 years ago

Scenario with open DAO and transferred fees.

Assumption that GameDAO Treasury is 3YmHCgQ3dNa1jib4fidr3bZxZshfnPMCsQYkoijCW65EG4bt

Before creating a DAO:
WALLET TOTAL TRANSFERRABLE LOCKED RESERVED
ZERO1 (Controller) 29.9899 18.9889 0 11.0010
ZERO2 (Treasury) 13.9999 7.9999 0 5.9999
ZERO3 (Member) 15.9999 0 0 15.9999
POLKA (Not a member) 505.9195 348.2122 10.0000 147.7073
GameDAO Treasury 7,047.1273 115.7480 6,196.2777 735.1014
After creating a DAO:
WALLET TOTAL TRANSFERRABLE LOCKED RESERVED
ZERO1 (Controller) 28.9799 17.9789 0 11.0010
ZERO2 (Treasury) 14.9999 8.9999 0 5.9999
ZERO3 (Member) 15.9999 15.9999 0 0
POLKA (Not a member) 505.9195 348.2122 10.0000 147.7073
GameDAO Treasury 7,047.1273 115.7480 6,196.2777 735.1014

1 ZERO was taken from Controller and transferred as a fee to the Treasury.

After joining with ZERO3
WALLET TOTAL TRANSFERRABLE LOCKED RESERVED
ZERO1 (Controller) 28.9799 17.9789 0 11.0010
ZERO2 (Treasury) 15.9999 9.9999 0 5.9999
ZERO3 (Member) 14.9999 14.9999 0 0
POLKA (Not a member) 505.9195 348.2122 10.0000 147.7073
GameDAO Treasury 7,047.1273 115.7480 6,196.2777 735.1014

1 ZERO was taken from Member (ZERO3) and transferred as a fee to the Treasury.

After creating Campaign:
WALLET TOTAL TRANSFERRABLE LOCKED RESERVED
ZERO1 (Controller) 28.9799 17.9789 0 11.0010
ZERO2 (Treasury) 15.9999 9.9999 0 5.9999
ZERO3 (Member) 14.9999 14.9999 0 0
POLKA (Not a member) 505.9195 348.2122 10.0000 147.7073
GameDAO Treasury 7,047.1273 115.7480 6,196.2777 735.1014

no changes

After funding Campaign:
WALLET TOTAL TRANSFERRABLE LOCKED RESERVED
ZERO1 (Controller) 28.9799 17.9789 0 11.0010
ZERO2 (Treasury) 15.9999 9.9999 0 5.9999
ZERO3 (Member) funds 5.0 14.9999 9.9999 0 5.0000
POLKA (Not a member) funds 5.0 505.9195 343.2122 10.0000 152.7073
GameDAO Treasury 7,047.1273 115.7480 6,196.2777 735.1014

ZERO3 & POLKA are funding 5 ZERO and 5 ZERO get reserved for each wallet and are deducted from transferrable.

After Campaign expired & successful:
WALLET TOTAL TRANSFERRABLE LOCKED RESERVED
ZERO1 (Controller) 38.9799 27.9789 0 11.0010
ZERO2 (Treasury) 25.9999 9.9999 0 15.9999
ZERO3 (Member) funded 5.0 4.9999 4.9999 0 0
POLKA (Not a member) funded 5.0 495.9195 343.2122 10.0000 142.7073
GameDAO Treasury 7,047.1273 115.7480 6,196.2777 735.1014
This is very odd: 
Controller gets +10ZERO transferrable
Treasury gets +10ZERO transferrable
(in total 20 instead of 10)
ZERO3 gets 10 away from transferrable and 5 away from reserved (in total 10)
POLKA gets 10 away from transferrable and 10 aware from reserved (in total 10)

Error is that ZERO3 & POLKA funded each 5 but get deducted each 10 and Controller account gets +10 and Treasury also gets +10. Only Treasury should get +10 and ZERO3 & POLKA should get -5 each.
After proposal for withdrawal is voted yes and before expiry
WALLET TOTAL TRANSFERRABLE LOCKED RESERVED
ZERO1 (Controller) 38.9799 27.9789 0 11.0010
ZERO2 (Treasury) 25.9999 9.9999 0 15.9999
ZERO3 (Member) funded 5.0 4.9999 4.9999 0 0
POLKA (Not a member) funded 5.0 495.9195 343.2122 10.0000 142.7073
GameDAO Treasury 7,047.1273 115.7480 6,196.2777 735.1014

no changes

After proposal voted with yes is expired
WALLET TOTAL TRANSFERRABLE LOCKED RESERVED
ZERO1 (Controller) 38.9799 27.9789 0 11.0010
ZERO2 (Treasury) 25.9999 9.9999 0 15.9999
ZERO3 (Member) funded 5.0 4.9999 4.9999 0 0
POLKA (Not a member) funded 5.0 495.9195 343.2122 10.0000 142.7073
GameDAO Treasury 7,047.1273 115.7480 6,196.2777 735.1014
Nothing has changed compared to last step:
The money in the treasury stays RESERVED but should have been unlocked and transferrable.
The Controller has still the wrongly assigned +10 ZERO which are Transferrable.
No GameDAO treasury received any fees.
2075 commented 2 years ago

super comprehensive overview, but a bit confusing. "gets transferrable" means unreserved? i would strongly recommend to start with fresh accounts, otherwise confusing to determine what really happens. what is locked vs reserved? do you mean contributed which gets reserved?

when you test this locally with a dev chain you also get 10 accounts with prefilled balance and no passwords, makes testing and checking balances much easier for you.

at least we should really test with untainted fresh accounts so the results become easier to comprehend :)

5-mark commented 2 years ago

Thanks for the feedback @2075. "gets transferrable" means unreserved? --> that depends if the amount was reserved before. In our case tranfers happened without being reserved before. In the case of amount reserved for the treasury, yes I meant unreserved.

what is locked vs reserved? --> in our case no amounts were locked as we seem to not work with locking up amounts within this process.

For me setting up a dev chain and/or setting up fresh accounts is a huge manual task which I dont even know how I would do that. I would love to have the test results easier to read but I would need support to set up a proper testing environment. How is everyone else testing? (@soundyogi , @DarkNebula0 , @Persqual , @vovacha). You must be much faster than I with testing having a local dev chain. Maybe someone can help me setting this up so I can also be fast and clean in testing?

5-mark commented 2 years ago
soundyogi commented 2 years ago

I am writing/automating this test for the local dev chain. This also should be a good guide how to test / automate e2e locally.

5-mark commented 2 years ago

last Version upgrade 1.46.0 and corresponding manual test showed: