gamedaoco / gamedao-beta

https://beta.gamedao.co
Apache License 2.0
9 stars 1 forks source link

DAO membership fee transfer is not transferred but reserved #288

Closed 5-mark closed 2 years ago

5-mark commented 2 years ago

Describe the bug Creating a DAO with the setting "Fee Model = transfer" does reserve the fee on the joiners wallet when joining but should transfer the fee to the DAO treasury.

To Reproduce Steps to reproduce the behavior:

  1. Create a DAO with setting "Fee Model = transfer" and enter a number (eg. 1)
  2. choose another wallet than controller or treasury wallet and check your balances
  3. check the balances of the DAO treasury ( and the controller - just to be sure)
  4. Join the DAO with that wallet
  5. See that the fee is "reserved" in your wallet and not transferred to the DAO treasury

Expected behavior When selecting fee model "transfer" the DAO treasury should get the fee from the user.

Screenshots

Additional context

2075 commented 2 years ago

possibly the values are mixed up:

            match &config.fee_model {
                ControlFeeModel::NoFees => {
                },
                ControlFeeModel::Reserve => {
                    <balances::Module<T>>::reserve(&account, config.fee)?;
                },
                ControlFeeModel::Transfer => {
                    let treasury = BodyTreasury::<T>::get(hash);
                    let transfer = <balances::Module<T> as Currency<_>>::transfer(
                        &account,
                        &treasury,
                        config.fee,
                        ExistenceRequirement::AllowDeath
                    );
                },
                _ => {}
            }

can you try what happens, when you select reserve?

2075 commented 2 years ago

@5-mark ah found the bug, updated the dropdown provider:

export const dao_fee_model = [
    { key: '0', text: 'no fees', value: 0 }, // fees are reserved in actor account
    { key: '1', text: 'reserve', value: 1 }, // fees are paid to treasury
    { key: '2', text: 'transfer', value: 2 }, // fees are staked and may result in item drops
]

fixed in main: please try again in 10mins.

5-mark commented 2 years ago

@2075 just tried again. but still same behaviour. Setting transfer as fee model but seeing the fee reserved. How comes this bug was fixed? it is still in the buglog and not in review. Also I didnt see any pull request?

2075 commented 2 years ago

i just updated the three values in the main branch. if you can see the three values as shown above, the correct fee calculation should apply.

2075 commented 2 years ago

please verify @5-mark @soundyogi

soundyogi commented 2 years ago

testing.

2075 commented 2 years ago

@soundyogi

2075 commented 2 years ago

@5-mark

2075 commented 2 years ago

testing.

any results @soundyogi ?

soundyogi commented 2 years ago

image

image

image

image

- [] See that the fee is "reserved" in your wallet and not transferred to the DAO treasury

image

image

image

soundyogi commented 2 years ago

So it seems to me behavior works as intended.

soundyogi commented 2 years ago

for good measure, the same for reserved variant:

image

now all 3 accounts show 1 token reserved: image

image

image

soundyogi commented 2 years ago

@2075 @5-mark is this reserve behavior correct?

2075 commented 2 years ago

should:

0 = no fees 1 = reserve, no transfer 2 = transfer to treasury

soundyogi commented 2 years ago

for some reason on all 3 accounts (controller, trasury, newMember) 1 ZERO was reserved - this is what seems odd to me

2075 commented 2 years ago

hm reserved or maybe tx fees?

2075 commented 2 years ago

lets move to discord

soundyogi commented 2 years ago

I can confirm that 1 ZERO gets reserved for each the treasury and the controller when creating a organisations with the reserve fee model.