1

I'm deploying a contract that is the owner of a token. In that contract i want to say that the token increaseAllowance to msg.sender and the amount that msg.send have putted in arguments of the function. Example:

function setAllowance(uint256 _amount){ token.increaseAllowance(address(msg.sender),_amount) }

How can i do this?

0

Should probably look something like this:

//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface ISPCT is IERC20 {
    function increaseAllowance(address, uint256) external virtual returns (bool);
}


contract canAllow {
    ISPCT public spctContract;
    address public SPCTaddress;

    constructor(address _SPCT) {
        SPCTaddress = _SPCT;
        spctContract = ISPCT(SPCTaddress);
    }

    function setAllowance(uint256 _amount){
        bool increasedAllowance = spctContract.increaseAllowance(msg.sender, _amount);
        require(increasedAllowance, "no_allowance");
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.