2020-02-21 20:00:48 +01:00
|
|
|
pragma solidity ^0.6.1;
|
|
|
|
|
|
|
|
import "./GiftBucket.sol";
|
|
|
|
import "./Proxy.sol";
|
|
|
|
|
|
|
|
contract GiftBucketFactory {
|
|
|
|
GiftBucket public GiftBucketImplementation;
|
|
|
|
|
2020-04-03 14:19:40 +02:00
|
|
|
event BucketCreated(address indexed gifter, address indexed bucket);
|
2020-02-21 20:00:48 +01:00
|
|
|
|
|
|
|
constructor() public {
|
|
|
|
GiftBucketImplementation = new GiftBucket(address(0), block.timestamp + 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
function create(address _tokenAddress, uint256 _expirationTime) public returns (address) {
|
2020-02-23 21:46:50 -04:00
|
|
|
address p = address(new Proxy(abi.encodeWithSelector(0xc350a1b5, _tokenAddress, _expirationTime, msg.sender), address(GiftBucketImplementation)));
|
2020-04-03 14:19:40 +02:00
|
|
|
emit BucketCreated(msg.sender, p);
|
2020-02-23 21:46:50 -04:00
|
|
|
return p;
|
2020-02-21 20:00:48 +01:00
|
|
|
}
|
|
|
|
}
|