From ac2b2ca61eff11d878191afa99d4d6363b132a90 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Sun, 23 Feb 2020 21:46:50 -0400 Subject: [PATCH] initialize GiftBucket in Proxy constructor --- contracts/GiftBucketFactory.sol | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/contracts/GiftBucketFactory.sol b/contracts/GiftBucketFactory.sol index 7f8f526..af779dc 100644 --- a/contracts/GiftBucketFactory.sol +++ b/contracts/GiftBucketFactory.sol @@ -13,13 +13,9 @@ contract GiftBucketFactory { } function create(address _tokenAddress, uint256 _expirationTime) public returns (address) { - address p = address(new Proxy("", address(GiftBucketImplementation))); - - GiftBucket g = GiftBucket(p); - g.initialize(_tokenAddress, _expirationTime, msg.sender); - - emit Created(msg.sender, address(p)); - - return address(p); + // initialize(address,uint256,address) + address p = address(new Proxy(abi.encodeWithSelector(0xc350a1b5, _tokenAddress, _expirationTime, msg.sender), address(GiftBucketImplementation))); + emit Created(msg.sender, p); + return p; } }