I'm trying to deploy a sponsor_contract that will pay transactions fee for Wallet A, to claim token and transfer it to other wallet.
Here is my code:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract SponsorContract {
address public sponsor;
address public sponsoredParty;
uint public sponsorshipAmount;
bool public isApproved;
constructor(address _sponsor, address _sponsoredParty, uint _sponsorshipAmount) {
sponsor = _sponsor;
sponsoredParty = _sponsoredParty;
sponsorshipAmount = _sponsorshipAmount;
isApproved = false;
}
function approveSponsorship() public {
require(msg.sender == sponsoredParty, "Only the sponsored party can approve the sponsorship.");
isApproved = true;
}
function cancelSponsorship() public {
require(msg.sender == sponsor, "Only the sponsor can cancel the sponsorship.");
require(!isApproved, "The sponsorship has already been approved and cannot be cancelled.");
selfdestruct(payable(sponsor));
}
function withdrawFunds() public {
require(msg.sender == sponsoredParty, "Only the sponsored party can withdraw funds.");
require(isApproved, "The sponsorship has not been approved yet.");
payable(sponsoredParty).transfer(sponsorshipAmount);
}
}
And this is the error when I deploy:
creation of SponsorContract errored: Error encoding arguments: Error: invalid address (argument="address", value="", code=INVALID_ARGUMENT, version=address/5.5.0) (argument=null, value="", code=INVALID_ARGUMENT, version=abi/5.5.0)
Can you give me a hand. Many thanks <3