Smart nanocontainers for anticorrosion applications