Hey, I've written a function using openzeppelin TimeLockController.sol's schedule function. I want to call a function from another deployed contract using my timelock contract at some time, means after some delay.
I wrote it like this...
import "@openzeppelin/contracts/governance/TimeLockController.sol";
interface Ierc20 {
function mint(address to, uint amount) external;
function burn(uint amount) external;
}
contract TimeLock is TimelockController {
function scheduleMintFuctionCall(address to, uint amount) public {
//the target address is my erc20 contract's address whos function I want to call
address target = 0x5FbDB2315678afecb367f032d93F642f64180aa3;
bytes calldata data = abi.encodePacked(Ierc20(target).mint(to, amount));
uint256 value = 10000000;
bytes32 salt = keccak256("MY_SALT");
uint256 delay = block.timestamp + 3 minutes;
schedule(target, value, data, bytes32(0), salt, delay);
}
}
Now, I'm getting the error in data part which is the function call from another contract with the parameters and I'm encoding it. But I'm getting the error in the same line
Type bytes memory is not implicitly convertible to expected type bytes
calldata.
anyone please help.