I am new to solidity. I have written the below contract which holds some USDC in it. I want to withdraw it but on calling executeOperation()
gas limit is being exceed. I have even tried it with high gas limit like 555555
but still it don't work.
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.8.10;
pragma experimental ABIEncoderV2;
import { SafeMath } from "https://github.com/aave/aave-v3-core/contracts/dependencies/openzeppelin/contracts/SafeMath.sol";
interface IFaucet {
function mint(
address _token,
uint256 _amount
) external;
}
/**
Faucet address:
0x1ca525Cd5Cb77DB5Fa9cBbA02A0824e283469DBe
Assest address (USDC):
0xA2025B15a1757311bfD68cb14eaeFCc237AF5b43
*/
contract MySimpleFlashLoanV3 {
using SafeMath for uint256;
address payable owner;
IFaucet FAUCET;
constructor(IFaucet _faucet) {
owner = payable(msg.sender);
FAUCET= _faucet;
}
function widthdrawAmount() internal {
// require(owner == msg.sender,"Only for owner");
owner.transfer(10);
}
function executeOperation(
address asset,
uint256 amount
)
public
returns (bool)
{
FAUCET.mint(asset,10);
widthdrawAmount();
return true;
}
}
May anyone tell me what's I am doing wrong ? why it's costing so much that even high gas fee is not enough.