Skip to main content
added 1 character in body
Source Link

I'm paying 0.38 gas fees in this function. There's something wrong with it?

function claim() external {
    require(allowed[msg.sender] === true, 'This address is not allowed to perform withdrawns');
    require(BUSD.balanceOf(address(this)) > block.timestamp - moment[msg.sender] * allowance[msg.sender], 'Not enough balance');
    uint amount = moment[msg.sender] * allowance[msg.sender];
    BUSD.transferFrom(address(this), msg.sender, amount);
    allowance[msg.sender] = 0;
    emit claimed(msg.sender, amount);
}

I'm paying 0.38 gas fees in this function. There's something wrong with it?

function claim() external {
    require(allowed[msg.sender] = true, 'This address is not allowed to perform withdrawns');
    require(BUSD.balanceOf(address(this)) > block.timestamp - moment[msg.sender] * allowance[msg.sender], 'Not enough balance');
    uint amount = moment[msg.sender] * allowance[msg.sender];
    BUSD.transferFrom(address(this), msg.sender, amount);
    allowance[msg.sender] = 0;
    emit claimed(msg.sender, amount);
}

I'm paying 0.38 gas fees in this function. There's something wrong with it?

function claim() external {
    require(allowed[msg.sender] == true, 'This address is not allowed to perform withdrawns');
    require(BUSD.balanceOf(address(this)) > block.timestamp - moment[msg.sender] * allowance[msg.sender], 'Not enough balance');
    uint amount = moment[msg.sender] * allowance[msg.sender];
    BUSD.transferFrom(address(this), msg.sender, amount);
    allowance[msg.sender] = 0;
    emit claimed(msg.sender, amount);
}
Source Link

Extremely high gas fees

I'm paying 0.38 gas fees in this function. There's something wrong with it?

function claim() external {
    require(allowed[msg.sender] = true, 'This address is not allowed to perform withdrawns');
    require(BUSD.balanceOf(address(this)) > block.timestamp - moment[msg.sender] * allowance[msg.sender], 'Not enough balance');
    uint amount = moment[msg.sender] * allowance[msg.sender];
    BUSD.transferFrom(address(this), msg.sender, amount);
    allowance[msg.sender] = 0;
    emit claimed(msg.sender, amount);
}