Contact A:
function redeemAssetsForBuyback(address[] calldata tokens) external {
// ...
}
I would like to call redeemAssetsForBuyback
from Contract B:
function initiateRedeem() external {
// ...
// I have address[] memory payload ready to be sent
address[] memory myPayload;
// Can I transform myPayload to address[] calldata?
IContractA(contractAAdrress).redeemAssetsForBuyback(myPayload); // Parameter mismatchs
}
I can change the redeemAssetsForBuyback
function's parameter to be memory instead of calldata and my issue resolves on JS VM at Remix but I read that I should be using calldata here.
So, can I somehow create a address[] calldata
on ContractB and call ContractA's function with it? If not, is it okay to use redeemAssetsForBuyback(address[] memory tokens)
?