I have a crowdsale contract which inherits the following contracts from openzepplin:
contract MyCrowdsale is Crowdsale, TimedCrowdsale, AllowanceCrowdsale, PostDeliveryCrowdsale, IncreasingPriceCrowdsale {
constructor(
uint256 openingTime,
uint256 closingTime,
uint256 initialRate,
uint256 finalRate,
address tokenWallet,
address payable wallet,
IERC20 token
)
public
Crowdsale(initialRate, wallet, token)
TimedCrowdsale(openingTime, closingTime)
IncreasingPriceCrowdsale(initialRate, finalRate)
AllowanceCrowdsale(tokenWallet)
PostDeliveryCrowdsale()
{
}
}
And everything works fine when I deploy it with the wallet being a Metamask wallet. The wallet is where the collected ETH from the ICO should go.
await MyCrowdsale.deploy(
openingTime,
closingTime,
initialRate,
finalRate,
tokenWallet, //tokenWallet - address holding MyToken to sell (granted allowance)
myMetamaskVault, //wallet - where to send ETH from crowdsale. This parameter cannot be a Gnosis Safe???
tokenProxyAdd
);
When I deploy the crowdsale with myMetamaskVault as the vault, (approve crowdsale to spend from tokenWallet), everything works great.
However, if I simply replace the vault where to send ETH with a Gnosis multi-sig safe, I can no longer call buyTokens() on the crowdsale. It returns Out of gas, as show in my Tenderly stacktrace:
I understand that Gnosis wallets cannot be used to sign transactions, but the approve() is the one that needs signing, and that’s for the tokenWallet not the wallet. Why can’t my crowdsale simply transfer received ETH to Gnosis?
Is there a specific limitation in openzepplin Crowdsale that prevents using a multisig safe as the vault?
I suppose I can do this manually, transfering from Metamask to Gnosis as the funds are coming in, or using OZ Autotasks, but this is obviously not ideal.
