Skip to content

SchemeFactory Unable To Deploy Competition Scheme #747

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

Closed
dOrgJelli opened this issue May 6, 2020 · 4 comments
Closed

SchemeFactory Unable To Deploy Competition Scheme #747

dOrgJelli opened this issue May 6, 2020 · 4 comments

Comments

@dOrgJelli
Copy link
Contributor

While implementing the SchemeFactory within the client library, we ran into an issue: a SchemeFactory proposal cannot add a competition scheme to the DAO.

The process that's required to deploy a competition scheme is as follows:

  1. Deploy Competition.sol Instance DAOFactory.createInstance("Competition")
    1.a. Save the address of the competition instance
  2. Add ContributionRewardExt.sol As A Scheme SchemeFactory.propose("ContributionRewardExt", initParams)
    2.a. NOTE: initParams has competition's address in it as "rewarder"
  3. After ContributionRewardExt is added as a scheme (and it's deployed), we need to call initialize on competition w/ the contributionrewardext's address.

FAILURE: step 3 is impossible, since the initialize function on competition can only be called during the initial creation process of the contract (if I'm not mistaken).

@orenyodfat am I understanding this correctly?

@orenyodfat
Copy link
Contributor

  • one option will be to do DAOFactory.createInstance("Competition") with no(null) init params ,so it will instance a new Competition without initilize it.

@dOrgJelli
Copy link
Contributor Author

  • one option will be to do DAOFactory.createInstance("Competition") with no(null) init params ,so it will instance a new Competition without initilize it.

If you do this, isn't there a security risk of the competition's initialize function callable by anyone, before you initialize it yourself?

@ben-kaufman
Copy link
Contributor

Well not really a security risk. You will know if something like that has happened, and it's costly "attack" (mining fees...) with no reward, as you'll just deploy another Competition. So worst case it could force you to do some redeployment, but it is very unlikely as an attacker will need to listen to the blockchain and wait for a tx with this specific bytecode, then send immediatly a transaction before you get to send your initialize tx.

@orenyodfat
Copy link
Contributor

fixed by #746

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants