I have some code that attempts to copy an array to mapping:
// Mapping of user addresses to their payment configuration
mapping(address => PaymentConfiguration[]) internal configurations;
// Event to signal that a user's payment configuration has been updated
event ConfigurationUpdated(address user, PaymentConfiguration[] paymentConfigurations);
function updateConfiguration(PaymentConfiguration[] calldata paymentConfigurations) onlyOwner public {
//TODO: we should probably add validations to assure that payment configuration total percentage doesn't exceed the denominator
configurations[_msgSender()] = paymentConfigurations;
emit ConfigurationUpdated(_msgSender(), paymentConfigurations);
}
I believe this issue is caused by the fact that you can't copy an array of structs to memory. Is there a simple way I can replicate this behavior