Here is what I need to do,
- Create a smart contract that can use a relayer account from Openzeppelin defender and do the gasless meta transactions. Which I already created and sent some Ethereum too.
- The contract can receive USDT erc20 funds, and show balance, and the contract owner can withdraw the funds.
- Then use Metamask in a react frontend and call those functions. Here the Metamask account will not pay the gas fees. Instead, the relayer will do.
The contract I created,
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
contract EtherWallet{
address payable public owner;
constructor() {
owner =payable(msg.sender);
}
receive() external payable {}
function withdraw(uint _amount) external {
require(msg.sender == owner, "Only owner can withdraw");
payable(msg.sender).transfer(_amount);
}
function getBalance() external view returns (uint) {
return address(this).balance;
}
}
But not sure how to do this. I need help with all the 3 options.