CORIONplatform / solidity

GNU General Public License v3.0
12 stars 9 forks source link

Provider could join another Provider #139

Closed gundas closed 7 years ago

gundas commented 7 years ago

https://github.com/CORIONplatform/solidity/blob/master/provider.sol#L417

        var currHeight = providers[provider].currentHeight;
        require( ! providers[msg.sender].data[currHeight].valid );

The check above which checks that provider should not be able to join another provider might not always work.

For example, if the providers[provider].currentHeight = 1 and the providers[msg.sender].currentHeight = 2, then the check above does not work as intended.

I think the check should be replaced to:

require( ! providers[msg.sender].data[providers[msg.sender].currentHeight].valid );

iFA88 commented 7 years ago

Hey, you check the very old version of the provider! https://github.com/CORIONplatform/solidity/blob/provider-recode/provider.sol I will update it anon, I'm almost done with the check payment process.

But for your answer, provider could not join to another provider, this is prohibited.

gundas commented 7 years ago

OK, let me know when you are ready - which branch should I check the Provider and Schelling. I understand that provider cannot join other provider, but the check in https://github.com/CORIONplatform/solidity/blob/master/provider.sol#L417 will not work if currentHeight is different for the message sender (which could be a provider) and a provider he is trying to join.

But let me know which branch I should be looking at.

iFA88 commented 7 years ago

https://github.com/CORIONplatform/solidity/tree/provider-recode

gundas commented 7 years ago

Let me know when you update it - currently it seems to be very old branch. And for the Schelling module - will it be also on provider-recode branch, or you are not changing that?

iFA88 commented 7 years ago

The important is the provider.sol any else please skip it. Yes i will recode the Schelling too, but first the provider.

iFA88 commented 7 years ago

https://github.com/CORIONplatform/solidity/blob/provider-recode/provider.sol I have uploaded the latest code, but still under development and needs lot of testing. The code is really cute, I have commented some lines in checkReward :)