initialize GiftBucket in Proxy constructor

This commit is contained in:
Richard Ramos 2020-02-23 21:46:50 -04:00 committed by GitHub
parent 7d19a6f98e
commit ac2b2ca61e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 8 deletions

View File

@ -13,13 +13,9 @@ contract GiftBucketFactory {
} }
function create(address _tokenAddress, uint256 _expirationTime) public returns (address) { function create(address _tokenAddress, uint256 _expirationTime) public returns (address) {
address p = address(new Proxy("", address(GiftBucketImplementation))); // initialize(address,uint256,address)
address p = address(new Proxy(abi.encodeWithSelector(0xc350a1b5, _tokenAddress, _expirationTime, msg.sender), address(GiftBucketImplementation)));
GiftBucket g = GiftBucket(p); emit Created(msg.sender, p);
g.initialize(_tokenAddress, _expirationTime, msg.sender); return p;
emit Created(msg.sender, address(p));
return address(p);
} }
} }