One of Africa’s largest economies attracted $4.3 billion from foreign investors