Giveth / vaultcontroller

Vault Architecture
GNU General Public License v3.0
0 stars 3 forks source link

Add isInitialized() #14

Closed adria0 closed 7 years ago

adria0 commented 7 years ago

It's not usual to use an external property with different semantics (address(childVault) == 0) that the propery name says. Maybe is usefull to add a function like isInitialized() for this:

Instead:

function topUpVault() initialized notCanceled {
        ...
        Vault childVault = Vault(vc.primaryVault());
        if (address(childVault) == 0) throw; // Child project is not initialized
        ...
}

use

function topUpVault() initialized notCanceled {
        ...
        if (!vc.isInitialized())  throw;
        Vault childVault = Vault(vc.primaryVault());
        ...
}
jbaylina commented 7 years ago

Your optios takes two calls instead of one and needs an extra method. (We need to safe gas in the deployment).