Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions contracts/GSNMultisigFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ pragma solidity 0.5.13;
import "@openzeppelin/contracts-ethereum-package/contracts/GSN/GSNRecipientERC20Fee.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/access/roles/MinterRole.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/ownership/Ownable.sol";
import 'hardlydifficult-ethereum-contracts/contracts/proxies/CloneFactory.sol';

import "./GSNMultiSigWalletWithDailyLimit.sol";

contract GSNMultisigFactory is GSNRecipientERC20Fee, MinterRole, Ownable {
using CloneFactory for address;

mapping(address => address[]) public deployedWallets;
mapping(address => bool) public isMULTISigWallet;
address public masterCopy;

event ContractInstantiation(address sender, address instantiation);

Expand All @@ -27,6 +31,10 @@ contract GSNMultisigFactory is GSNRecipientERC20Fee, MinterRole, Ownable {
_removeMinter(account);
}

function setMasterCopy(address _masterCopy) public onlyOwner {
masterCopy = _masterCopy;
}

/*
* Public functions
*/
Expand All @@ -37,11 +45,10 @@ contract GSNMultisigFactory is GSNRecipientERC20Fee, MinterRole, Ownable {
return deployedWallets[creator].length;
}

function create(address[] memory _owners, uint _required, uint _dailyLimit) public returns (address wallet)
{
GSNMultiSigWalletWithDailyLimit multisig = new GSNMultiSigWalletWithDailyLimit();
multisig.initialize(_owners, _required, _dailyLimit);
wallet = address(multisig);
function create(address[] memory _owners, uint _required, uint _dailyLimit) public payable returns (address payable wallet) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if create has to be payable

wallet = address(uint160(masterCopy.createClone()));
GSNMultiSigWalletWithDailyLimit(wallet).initialize(_owners, _required, _dailyLimit);

isMULTISigWallet[wallet] = true;
deployedWallets[_msgSender()].push(wallet);

Expand Down
Loading