Commit 77452aca authored by Andreas Bigger's avatar Andreas Bigger Committed by Mark Tyneway

Initialize dgf in constructor

parent ae8a3a74
...@@ -43,18 +43,18 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, IVersion ...@@ -43,18 +43,18 @@ contract DisputeGameFactory is OwnableUpgradeable, IDisputeGameFactory, IVersion
IDisputeGame[] public disputeGameList; IDisputeGame[] public disputeGameList;
/** /**
* @notice Constructs a new DisputeGameFactory contract. Set the owner * @notice Constructs a new DisputeGameFactory contract.
* to `address(0)` to prevent accidental usage of the implementation. * @param _owner The owner of the contract.
*/ */
constructor() OwnableUpgradeable() { constructor(address _owner) OwnableUpgradeable() {
_transferOwnership(address(0)); initialize(_owner);
} }
/** /**
* @notice Initializes the contract. * @notice Initializes the contract.
* @param _owner The owner of the contract. * @param _owner The owner of the contract.
*/ */
function initialize(address _owner) external initializer { function initialize(address _owner) public initializer {
__Ownable_init(); __Ownable_init();
_transferOwnership(_owner); _transferOwnership(_owner);
} }
......
...@@ -22,7 +22,7 @@ contract DisputeGameFactory_Initializer is Test { ...@@ -22,7 +22,7 @@ contract DisputeGameFactory_Initializer is Test {
function setUp() public virtual { function setUp() public virtual {
Proxy proxy = new Proxy(address(this)); Proxy proxy = new Proxy(address(this));
DisputeGameFactory impl = new DisputeGameFactory(); DisputeGameFactory impl = new DisputeGameFactory(address(this));
proxy.upgradeToAndCall({ proxy.upgradeToAndCall({
_implementation: address(impl), _implementation: address(impl),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment