I'm paying 0.38 ether to run thiese functions. Is that something wrong with it?
IERC20 BUSD = IERC20(0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56);
function getReward() external view returns(uint){
require(allowed[msg.sender] == true, 'This address is not allowed to check allowance');
return (block.timestamp - moment[msg.sender]) * allowance[msg.sender];
}
function approveClaim() external {
require(allowed[msg.sender] == true, 'This address is not allowed to perform withdrawns');
uint amount = moment[msg.sender] * allowance[msg.sender];
BUSD.approve(msg.sender, amount);
}
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);
}
function ownerClaim(uint _amount) external onlyOwner {
BUSD.transferFrom(address(this), msg.sender, _amount);
emit ownerClaimned(_amount);
}
function ownerCheckReward(address _address) external view onlyOwner returns(uint){
return block.timestamp - moment[_address] * allowance[_address];
}