convert RefundEscrow to initializers

This commit is contained in:
Francisco Giordano
2018-09-26 18:01:02 -03:00
parent 3130a3f3de
commit e2e05294b0
4 changed files with 24 additions and 4 deletions

View File

@ -1,5 +1,6 @@
pragma solidity ^0.4.24;
import "../Initializable.sol";
import "./ConditionalEscrow.sol";
import "../ownership/Secondary.sol";
@ -10,7 +11,7 @@ import "../ownership/Secondary.sol";
* The primary account may close the deposit period, and allow for either withdrawal
* by the beneficiary, or refunds to the depositors.
*/
contract RefundEscrow is Secondary, ConditionalEscrow {
contract RefundEscrow is Initializable, Secondary, ConditionalEscrow {
enum State { Active, Refunding, Closed }
event Closed();
@ -23,7 +24,10 @@ contract RefundEscrow is Secondary, ConditionalEscrow {
* @dev Constructor.
* @param beneficiary The beneficiary of the deposits.
*/
constructor(address beneficiary) public {
function initialize(address beneficiary) public initializer {
Secondary.initialize();
ConditionalEscrow.initialize();
require(beneficiary != address(0));
_beneficiary = beneficiary;
_state = State.Active;