I have a function that gets an address array from another contract, conditionally deletes the msg.sender from the array, then saves the new array back to that contract.
Because the array backerList is in memory, i can't do backerList.length--;
But I cannot declare backerList as a storage array because memory array can't be converted to a storage one.
I am stuck here, what should I do?
address[] memory backerList = syndicate.getBackerList();
if(syndicate.individualTotalBacking(msg.sender) == 0){
uint index;
for(uint i=0; i<backerList.length; i++){
if (backerList[i] == msg.sender){
index = i;
}
//shifting array
for(uint k=index; k<backerList.length-1; k++){
backerList[k]=backerList[k+1];
}
}
backerList.length--;
syndicate.setBackerList(backerList);
} else {}
setBackerList
?setBackerList
anaddress[] memory
?