Contract deployment with gsn

Hi… wondering if we could use GSN during contract deployment; this part of our non-DApp user on-boarding. Our ideal scenario is to allow a traditional user to access on-chain assets without bothering about any gas fees… thanks.

Yes. You can have a deployer contract and reference this method to deploy a user-specific contract:

contract Deployer is ERC2771Recipient {
  function deploy() public {
    user = _msgSender();
    addr = new UserContract (user);
    emit Created(addr, user);
  }
}

This method is callable by everyone. You have a paymaster to allow users without gas to call it.

To prevent abuse, your paymaster should make some verification, eg off chain captcha or email approval. This is verified on chain using a VerifyingPaymaster.